showRecentPopular() static public method

Print out list recent or popular kb/faq
static public showRecentPopular ( $type ) : nothing
$type type : recent / popular / not published
return nothing (display table)
コード例 #1
0
ファイル: knowbase.class.php プロジェクト: jose-martins/glpi
 /**
  * Show the knowbase search view
  **/
 static function showSearchView()
 {
     // Search a solution
     if (!isset($_GET["contains"]) && isset($_GET["itemtype"]) && isset($_GET["items_id"])) {
         if ($item = getItemForItemtype($_GET["itemtype"])) {
             if ($item->getFromDB($_GET["items_id"])) {
                 $_GET["contains"] = addslashes($item->getField('name'));
             }
         }
     }
     if (isset($_GET["contains"])) {
         $_SESSION['kbcontains'] = $_GET["contains"];
     } else {
         if (isset($_SESSION['kbcontains'])) {
             $_GET['contains'] = $_SESSION["kbcontains"];
         }
     }
     $ki = new KnowbaseItem();
     $ki->searchForm($_GET);
     if (!isset($_GET['contains']) || empty($_GET['contains'])) {
         echo "<div><table class='center-h' width='950px'><tr class='noHover'><td class='center top'>";
         KnowbaseItem::showRecentPopular("recent");
         echo "</td><td class='center top'>";
         KnowbaseItem::showRecentPopular("lastupdate");
         echo "</td><td class='center top'>";
         KnowbaseItem::showRecentPopular("popular");
         echo "</td></tr>";
         echo "</table></div>";
     } else {
         KnowbaseItem::showList($_GET, 'search');
     }
 }
コード例 #2
0
ファイル: helpdesk.public.php プロジェクト: btry/glpi
        echo "<tr class='noHover'><td class='top'>";
        Reminder::showListForCentral(false);
        echo "</td></tr>";
    }
    if (Session::haveRight("rssfeed_public", READ)) {
        echo "<tr class='noHover'><td class='top'>";
        RSSFeed::showListForCentral(false);
        echo "</td></tr>";
    }
    echo "</table></td>";
    echo "<td class='top' width='50%'><br>";
    echo "<table class='central'>";
    // Show KB items
    if (Session::haveRight('knowbase', KnowbaseItem::READFAQ)) {
        echo "<tr class='noHover'><td class='top'>";
        KnowbaseItem::showRecentPopular("popular");
        echo "</td></tr>";
        echo "<tr class='noHover'><td class='top'><br>";
        KnowbaseItem::showRecentPopular("recent");
        echo "</td></tr>";
        echo "<tr class='noHover'><td class='top'><br>";
        KnowbaseItem::showRecentPopular("lastupdate");
        echo "</td></tr>";
    } else {
        echo "<tr><td>&nbsp;</td></tr>";
    }
    echo "</table>";
    echo "</td>";
    echo "</tr></table>";
}
Html::helpFooter();
コード例 #3
0
        Reminder::showListForCentral($_SESSION["glpiactive_entity"]);
        $entities = array_reverse(getAncestorsOf("glpi_entities", $_SESSION["glpiactive_entity"]));
        foreach ($entities as $entity) {
            Reminder::showListForCentral($entity, true);
        }
        foreach ($_SESSION["glpiactiveentities"] as $entity) {
            if ($entity != $_SESSION["glpiactive_entity"]) {
                Reminder::showListForCentral($entity, false);
            }
        }
        echo "</td></tr>";
    }
    echo "</table></td>";
    echo "<td class='top' width='450px'><br>";
    echo "<table>";
    // Show KB items
    if (haveRight("faq", "r")) {
        echo "<tr><td class='top' width='450px'>";
        KnowbaseItem::showRecentPopular($CFG_GLPI['root_doc'] . '/front/helpdesk.faq.php', "popular", 1);
        echo "</td></tr>";
        echo "<tr><td class='top' width='450px'><br>";
        KnowbaseItem::showRecentPopular($CFG_GLPI['root_doc'] . '/front/helpdesk.faq.php', "recent", 1);
        echo "</td></tr>";
    } else {
        echo "<tr><td>&nbsp;</td></tr>";
    }
    echo "</table>";
    echo "</td>";
    echo "</tr></table>";
}
helpFooter();