showList() static public method

Print out list kb item
static public showList ( $options, $type = 'search' )
$options $_GET
$type string search type : browse / search (default search)
示例#1
0
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkCentralAccess();
if (isset($_GET["item_type"]) && isset($_GET["display_type"])) {
    if ($_GET["display_type"] < 0) {
        $_GET["display_type"] = -$_GET["display_type"];
        $_GET["export_all"] = 1;
    }
    switch ($_GET["item_type"]) {
        case 'KnowbaseItem':
            KnowbaseItem::showList($_GET, $_GET["is_faq"]);
            break;
        case 'Stat':
            if (isset($_GET["item_type_param"])) {
                $params = Toolbox::decodeArrayFromInput($_GET["item_type_param"]);
                switch ($params["type"]) {
                    case "comp_champ":
                        $val = Stat::getItems($_GET["itemtype"], $params["date1"], $params["date2"], $params["dropdown"]);
                        Stat::showTable($_GET["itemtype"], $params["type"], $params["date1"], $params["date2"], $params["start"], $val, $params["dropdown"]);
                        break;
                    case "device":
                        $val = Stat::getItems($_GET["itemtype"], $params["date1"], $params["date2"], $params["dropdown"]);
                        Stat::showTable($_GET["itemtype"], $params["type"], $params["date1"], $params["date2"], $params["start"], $val, $params["dropdown"]);
                        break;
                    default:
                        $val2 = isset($params['value2']) ? $params['value2'] : 0;
示例#2
0
// Affichage Module FAQ
//******************
$name = "";
checkFaqAccess();
if (getLoginUserID()) {
    helpHeader($LANG['Menu'][20], $_SERVER['PHP_SELF'], $_SESSION["glpiname"]);
} else {
    $_SESSION["glpilanguage"] = $CFG_GLPI['language'];
    // Anonymous FAQ
    simpleHeader($LANG['Menu'][20], array($LANG['Menu'][20] => $_SERVER['PHP_SELF']));
}
if (!isset($_GET["contains"])) {
    $_GET["contains"] = "";
}
if (!isset($_GET["knowbaseitemcategories_id"])) {
    $_GET["knowbaseitemcategories_id"] = 0;
}
if (isset($_GET["id"])) {
    $kb = new KnowbaseItem();
    if ($kb->getFromDB($_GET["id"])) {
        $kb->showFull(false);
    }
} else {
    KnowbaseItem::searchForm($_GET, 1);
    KnowbaseItemCategory::showFirstLevel($_GET, 1);
    KnowbaseItem::showList($_GET, 1);
    if (!$_GET["knowbaseitemcategories_id"] && strlen($_GET["contains"]) == 0) {
        KnowbaseItem::showViewGlobal($_SERVER['PHP_SELF'], 1);
    }
}
helpFooter();
示例#3
0
 /**
  * Show the knowbase Manage view
  **/
 static function showManageView()
 {
     if (isset($_GET["unpublished"])) {
         $_SESSION['kbunpublished'] = $_GET["unpublished"];
     } else {
         if (isset($_SESSION['kbunpublished'])) {
             $_GET["unpublished"] = $_SESSION['kbunpublished'];
         }
     }
     if (!isset($_GET["unpublished"])) {
         $_GET["unpublished"] = 'myunpublished';
     }
     $ki = new KnowbaseItem();
     $ki->showManageForm($_GET);
     KnowbaseItem::showList($_GET, $_GET["unpublished"]);
 }
示例#4
0
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
checkSeveralRightsOr(array('knowbase' => 'r', 'faq' => 'r'));
if (isset($_GET["id"])) {
    glpi_header($CFG_GLPI["root_doc"] . "/front/knowbaseitem.form.php?id=" . $_GET["id"]);
}
commonHeader($LANG['title'][5], $_SERVER['PHP_SELF'], "utils", "knowbase");
// Search a solution
if (!isset($_GET["contains"]) && isset($_GET["tickets_id"])) {
    $ticket = new Ticket();
    if ($ticket->getFromDB($_GET["tickets_id"])) {
        $_GET["contains"] = $ticket->getField('name');
    }
}
if (!isset($_GET["contains"])) {
    $_GET["contains"] = "";
}
if (!isset($_GET["knowbaseitemcategories_id"])) {
    $_GET["knowbaseitemcategories_id"] = "0";
}
$faq = !haveRight("knowbase", "r");
KnowbaseItem::searchForm($_GET, $faq);
if (!isset($_GET["tickets_id"])) {
    KnowbaseItemCategory::showFirstLevel($_GET, $faq);
}
KnowbaseItem::showList($_GET, $faq);
if (!$_GET["knowbaseitemcategories_id"] && strlen($_GET["contains"]) == 0) {
    KnowbaseItem::showViewGlobal($CFG_GLPI["root_doc"] . "/front/knowbaseitem.form.php", $faq);
}
commonFooter();