本文整理汇总了PHP中CronTask::callCron方法的典型用法代码示例。如果您正苦于以下问题:PHP CronTask::callCron方法的具体用法?PHP CronTask::callCron怎么用?PHP CronTask::callCron使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CronTask
的用法示例。
在下文中一共展示了CronTask::callCron方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: simpleHeader
/**
* Print a simple HTML head with links
*
* @param $title title of the page
* @param $links array of links to display
**/
static function simpleHeader($title, $links = array())
{
global $CFG_GLPI, $HEADER_LOADED;
// Print a nice HTML-head for help page
if ($HEADER_LOADED) {
return;
}
$HEADER_LOADED = true;
self::includeHeader($title);
// Body
echo "<body>";
echo '
<nav class="navbar navbar-default" id="menuHeader">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="' . $CFG_GLPI["root_doc"] . '/front/central.php">
<img src="' . $CFG_GLPI["root_doc"] . '/pics/fd_logo1.png" style="margin-top:-4px;" />
<span class=\'invisible\'>Logo</span>
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav" >';
echo "<li id='menu1'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php' title=\"" . __s('Home') . "\" class='itemP'>" . __('Home') . "</a>";
echo "</li>";
// Main Headline
echo "<div id='header'>";
echo "<div id='c_logo'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/' accesskey='1' title=\"" . __s('Home') . "\">" . "<span class='invisible'>Logo</span></a></div>";
// Les préférences + lien déconnexion
echo "<div id='c_preference'>";
echo "<div class='sep'></div>";
echo "</div>";
//-- Le moteur de recherche --
echo "<div id='c_recherche'>";
echo "<div class='sep'></div>";
echo "</div>";
//-- Le menu principal --
echo "<div id='c_menu'>";
echo "<ul id='menu'>";
// Build the navigation-elements
if (count($links)) {
$i = 1;
foreach ($links as $name => $link) {
echo "<li id='menu{$i}'>";
echo "<a href='{$link}' title=\"" . $name . "\" class='itemP'>" . $name . "</a>";
echo "</li>";
$i++;
}
}
//echo "</ul></div>";
echo '
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav> ';
// End navigation bar
// End headline
///Le sous menu contextuel 1
//echo "<div id='c_ssmenu1'></div>";
// Le fil d ariane
/*echo "<div id='c_ssmenu2'></div>";
echo "</div>"; // fin header
*/
echo "<div id='page'>";
// call static function callcron() every 5min
CronTask::callCron();
}
示例2: helpHeader
//.........这里部分代码省略.........
echo "<ul id='menu'>";
// Build the navigation-elements
// Home
echo "<li id='menu1'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php' title=\"" . __s('Home') . "\" class='itemP'>" . __('Home') . "</a>";
echo "</li>";
// Create ticket
if (Session::haveRight("ticket", CREATE)) {
echo "<li id='menu2'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php?create_ticket=1' " . "title=\"" . __s('Create a ticket') . "\" class='itemP'>" . __('Create a ticket') . "</a>";
echo "</li>";
}
// Suivi ticket
if (Session::haveRight("ticket", Ticket::READMY) || Session::haveRight("followup", TicketFollowup::SEEPUBLIC)) {
echo "<li id='menu3'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/ticket.php' title=\"" . __s('Ticket followup') . "\" class='itemP'>" . _n('Ticket', 'Tickets', Session::getPluralNumber()) . "</a>";
echo "</li>";
}
// Reservation
if (Session::haveRight("reservation", ReservationItem::RESERVEANITEM)) {
echo "<li id='menu4'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.php' title=\"" . _sn('Reservation', 'Reservations', Session::getPluralNumber()) . "\" class='itemP'>" . _n('Reservation', 'Reservations', Session::getPluralNumber()) . "</a>";
echo "</li>";
}
// FAQ
if (Session::haveRight('knowbase', KnowbaseItem::READFAQ)) {
echo "<li id='menu5' >";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.faq.php' title=\"" . __s('FAQ') . "\" class='itemP'>" . __('FAQ') . "</a>";
echo "</li>";
}
// PLUGINS
$plugins = array();
if (isset($PLUGIN_HOOKS["helpdesk_menu_entry"]) && count($PLUGIN_HOOKS["helpdesk_menu_entry"])) {
foreach ($PLUGIN_HOOKS["helpdesk_menu_entry"] as $plugin => $active) {
if ($active) {
$plugins[$plugin] = Plugin::getInfo($plugin);
}
}
}
if (isset($plugins) && count($plugins) > 0) {
$list = array();
foreach ($plugins as $key => $val) {
$list[$key] = $val["name"];
}
asort($list);
echo "<li id='menu5' onmouseover=\"javascript:menuAff('menu5','menu');\">";
echo "<a href='#' title=\"" . _sn('Plugin', 'Plugins', Session::getPluralNumber()) . "\" class='itemP'>" . __('Plugins') . "</a>";
// default none
echo "<ul class='ssmenu'>";
// list menu item
foreach ($list as $key => $val) {
$link = "";
if (is_string($PLUGIN_HOOKS["helpdesk_menu_entry"][$key])) {
$link = $PLUGIN_HOOKS["helpdesk_menu_entry"][$key];
}
echo "<li><a href='" . $CFG_GLPI["root_doc"] . "/plugins/" . $key . $link . "'>" . $plugins[$key]["name"] . "</a></li>\n";
}
echo "</ul></li>";
}
echo "</ul>";
echo "</div>";
// End navigation bar
// End headline
// Le fil d ariane
echo "<div id='c_ssmenu2'>";
echo "<ul>";
echo "<li class='breadcrumb_item'>" . "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php' title=\"" . __s('Home') . "\">" . __('Home') . "</a></li>";
if (TicketValidation::getValidateRights()) {
$opt = array();
$opt['reset'] = 'reset';
$opt['criteria'][0]['field'] = 55;
// validation status
$opt['criteria'][0]['searchtype'] = 'equals';
$opt['criteria'][0]['value'] = TicketValidation::WAITING;
$opt['criteria'][0]['link'] = 'AND';
$opt['criteria'][1]['field'] = 59;
// validation aprobator
$opt['criteria'][1]['searchtype'] = 'equals';
$opt['criteria'][1]['value'] = Session::getLoginUserID();
$opt['criteria'][1]['link'] = 'AND';
$url_validate = $CFG_GLPI["root_doc"] . "/front/ticket.php?" . Toolbox::append_params($opt, '&');
$pic_validate = "<a href='{$url_validate}'>" . "<img title=\"" . __s('Ticket waiting for your approval') . "\" alt=\"" . __s('Ticket waiting for your approval') . "\" src='" . $CFG_GLPI["root_doc"] . "/pics/menu_showall.png' class='pointer'></a>";
echo "<li class='icons_block'>{$pic_validate}</li>\n";
}
if (Session::haveRight('ticket', CREATE) && strpos($_SERVER['PHP_SELF'], "ticket")) {
echo "<li class='icons_block'><a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php?create_ticket=1'>";
echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/menu_add.png' title=\"" . __s('Add') . "\" alt=\"" . __s('Add') . "\" class='pointer'></a></li>";
}
// check user id : header used for display messages when session logout
if (Session::getLoginUserID()) {
self::showProfileSelecter($CFG_GLPI["root_doc"] . "/front/helpdesk.public.php");
}
echo "</ul></div>";
echo "</div>";
// fin header
echo "<div id='page' >";
// call static function callcron() every 5min
CronTask::callCron();
self::displayMessageAfterRedirect();
}
示例3: helpHeader
//.........这里部分代码省略.........
}
// Suivi ticket
if (Session::haveRight("observe_ticket", "1") || Session::haveRight("create_ticket", "1")) {
echo "<li id='menu3'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/ticket.php' title=\"" . __s('Ticket followup') . "\" class='itemP'>" . _n('Ticket', 'Tickets', 2) . "</a>";
echo "</li>";
}
// Reservation
if (Session::haveRight("reservation_helpdesk", "1")) {
echo "<li id='menu4'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.php' title=\"" . _sn('Reservation', 'Reservations', 2) . "\" class='itemP'>" . _n('Reservation', 'Reservations', 2) . "</a>";
echo "</li>";
}
// FAQ
if (Session::haveRight("faq", "r")) {
echo "<li id='menu5' >";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.faq.php' title=\"" . __s('FAQ') . "\" class='itemP'>" . __('FAQ') . "</a>";
echo "</li>";
}
// PLUGINS
$plugins = array();
if (isset($PLUGIN_HOOKS["helpdesk_menu_entry"]) && count($PLUGIN_HOOKS["helpdesk_menu_entry"])) {
foreach ($PLUGIN_HOOKS["helpdesk_menu_entry"] as $plugin => $active) {
if ($active) {
$plugins[$plugin] = Plugin::getInfo($plugin);
}
}
}
if (isset($plugins) && count($plugins) > 0) {
$list = array();
foreach ($plugins as $key => $val) {
$list[$key] = $val["name"];
}
asort($list);
echo "<li id='menu5' onmouseover=\"javascript:menuAff('menu5','menu');\">";
echo "<a href='#' title=\"" . __s('Plugins') . "\" class='itemP'>" . __('Plugins') . "</a>";
// default none
echo "<ul class='ssmenu'>";
// list menu item
foreach ($list as $key => $val) {
$link = "";
if (is_string($PLUGIN_HOOKS["helpdesk_menu_entry"][$key])) {
$link = $PLUGIN_HOOKS["helpdesk_menu_entry"][$key];
}
echo "<li><a href='" . $CFG_GLPI["root_doc"] . "/plugins/" . $key . $link . "'>" . $plugins[$key]["name"] . "</a></li>\n";
}
echo "</ul></li>";
}
echo "</ul>";
echo "<div class='sep'></div>";
echo "</div>";
// End navigation bar
// End headline
///Le sous menu contextuel 1
echo "<div id='c_ssmenu1'> </div>";
// Le fil d ariane
echo "<div id='c_ssmenu2'>";
echo "<ul>";
echo "<li><a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php' title=\"" . __s('Home') . "\">" . __('Home') . "></a></li>";
echo "<li> </li>";
if (Session::haveRight('validate_incident', 1) || Session::haveRight('validate_request', 1)) {
$opt = array();
$opt['reset'] = 'reset';
$opt['field'][0] = 55;
// validation status
$opt['searchtype'][0] = 'equals';
$opt['contains'][0] = 'waiting';
$opt['link'][0] = 'AND';
$opt['field'][1] = 59;
// validation aprobator
$opt['searchtype'][1] = 'equals';
$opt['contains'][1] = Session::getLoginUserID();
$opt['link'][1] = 'AND';
$url_validate = $CFG_GLPI["root_doc"] . "/front/ticket.php?" . Toolbox::append_params($opt, '&');
$pic_validate = "<a href='{$url_validate}'>" . "<img title=\"" . __s('Ticket waiting for your approval') . "\" alt=\"" . __s('Ticket waiting for your approval') . "\" src='" . $CFG_GLPI["root_doc"] . "/pics/menu_showall.png'></a>";
echo "<li>{$pic_validate}</li>\n";
}
echo "<li> </li>";
if (Session::haveRight('create_ticket', 1) && strpos($_SERVER['PHP_SELF'], "ticket")) {
echo "<li><a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php?create_ticket=1'>";
echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/menu_add.png' title=\"" . __s('Add') . "\" alt=\"" . __s('Add') . "\"></a></li>";
}
echo "<li> </li>";
/// Bookmark load
echo "<li>";
echo "<a href='#' onClick=\"var w=window.open('" . $CFG_GLPI["root_doc"] . "/front/popup.php?popup=load_bookmark' ,'glpibookmarks', 'height=400, width=600, " . "top=100, left=100, scrollbars=yes' );w.focus();\">";
echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/bookmark.png' title=\"" . __s('Load a bookmark') . "\" alt=\"" . __s('Load a bookmark') . "\">";
echo "</a></li>";
// check user id : header used for display messages when session logout
if (Session::getLoginUserID()) {
self::showProfileSelecter($CFG_GLPI["root_doc"] . "/front/helpdesk.public.php");
}
echo "</ul></div>";
echo "</div>";
// fin header
echo "<div id='page' >";
// call static function callcron() every 5min
CronTask::callCron();
self::displayMessageAfterRedirect();
}