本文整理匯總了PHP中CronTask::getFromDB方法的典型用法代碼示例。如果您正苦於以下問題:PHP CronTask::getFromDB方法的具體用法?PHP CronTask::getFromDB怎麽用?PHP CronTask::getFromDB使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CronTask
的用法示例。
在下文中一共展示了CronTask::getFromDB方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
$name = CronTask::launch(-CronTask::MODE_INTERNAL, 1, $_POST['execute']);
}
if ($name) {
//TRANS: %s is a task name
Session::addMessageAfterRedirect(sprintf(__('Task %s executed'), $name));
}
Html::back();
} else {
if (isset($_POST["update"])) {
Session::checkRight('config', UPDATE);
$crontask->update($_POST);
Html::back();
} else {
if (isset($_POST['resetdate']) && isset($_POST["id"])) {
Session::checkRight('config', UPDATE);
if ($crontask->getFromDB($_POST["id"])) {
$crontask->resetDate();
}
Html::back();
} else {
if (isset($_POST['resetstate']) && isset($_POST["id"])) {
Session::checkRight('config', UPDATE);
if ($crontask->getFromDB($_POST["id"])) {
$crontask->resetState();
}
Html::back();
} else {
if (!isset($_GET["id"]) || empty($_GET["id"])) {
exit;
}
Html::header(Crontask::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], 'config', 'crontask');
示例2: CronTask
// ----------------------------------------------------------------------
// Original Author of file: Remi Collet
// Purpose of file: Display tab on CronTask form
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
header_nocache();
if (!isset($_POST["id"])) {
exit;
}
if (!isset($_REQUEST['glpi_tab'])) {
exit;
}
$crontask = new CronTask();
if ($_POST['id'] > 0 && $crontask->getFromDB($_POST['id'])) {
switch ($_REQUEST['glpi_tab']) {
case -1:
$crontask->showStatistics();
$crontask->showHistory();
Plugin::displayAction($crontask, $_REQUEST['glpi_tab']);
break;
case 2:
$crontask->showHistory();
break;
default:
if (!Plugin::displayAction($crontask, $_REQUEST['glpi_tab'])) {
$crontask->showStatistics();
}
}
}
示例3: checkRight
$input['_link']['link'] = $_POST['link'];
$input['_link']['tickets_id_2'] = $key;
if ($ticket->can($_POST['tickets_id_1'], 'w')) {
$ticket->update($input);
}
}
}
}
}
break;
case 'reset':
if ($_POST["itemtype"] == 'CronTask') {
checkRight('config', 'w');
$crontask = new CronTask();
foreach ($_POST["item"] as $key => $val) {
if ($val == 1 && $crontask->getFromDB($key)) {
$crontask->resetDate();
}
}
}
break;
case 'move_under':
if (isset($_POST['parent'])) {
$fk = $item->getForeignKeyField();
$parent = new $_POST["itemtype"]();
if ($parent->getFromDB($_POST['parent'])) {
foreach ($_POST["item"] as $key => $val) {
if ($val == 1 && $item->can($key, 'w')) {
// Check if parent is not a child of the original one
if (!in_array($parent->getID(), getSonsOf($item->getTable(), $item->getID()))) {
$item->update(array('id' => $key, $fk => $_POST['parent']));
示例4: CronTask
*/
// ----------------------------------------------------------------------
// Original Author of file: Remi Collet
// Purpose of file: Form to edit Cron Task
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
$crontask = new CronTask();
if (isset($_POST["update"])) {
checkRight('config', 'w');
$crontask->update($_POST);
glpi_header($_SERVER['HTTP_REFERER']);
} else {
if (isset($_GET['resetdate']) && isset($_GET["id"])) {
checkRight('config', 'w');
if ($crontask->getFromDB($_GET["id"])) {
$crontask->resetDate();
}
glpi_header($_SERVER['HTTP_REFERER']);
} else {
if (isset($_GET['resetstate']) && isset($_GET["id"])) {
checkRight('config', 'w');
if ($crontask->getFromDB($_GET["id"])) {
$crontask->resetState();
}
glpi_header($_SERVER['HTTP_REFERER']);
} else {
if (!isset($_GET["id"]) || empty($_GET["id"])) {
exit;
}
commonHeader($LANG['crontask'][0], $_SERVER['PHP_SELF'], "config", "crontask");