本文整理汇总了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");