本文整理汇总了PHP中MassiveAction::process方法的典型用法代码示例。如果您正苦于以下问题:PHP MassiveAction::process方法的具体用法?PHP MassiveAction::process怎么用?PHP MassiveAction::process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MassiveAction
的用法示例。
在下文中一共展示了MassiveAction::process方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MassiveAction
Session::checkCentralAccess();
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
try {
$ma = new MassiveAction($_POST, $_GET, 'process');
} catch (Exception $e) {
Html::popHeader(__('Bulk modification error'), $_SERVER['PHP_SELF']);
echo "<div class='center'><img src='" . $CFG_GLPI["root_doc"] . "/pics/warning.png' alt='" . __s('Warning') . "'><br><br>";
echo "<span class='b'>" . $e->getMessage() . "</span><br>";
Html::displayBackLink();
echo "</div>";
Html::popFooter();
exit;
}
Html::popHeader(__('Bulk modification'), $_SERVER['PHP_SELF']);
$results = $ma->process();
$nbok = $results['ok'];
$nbko = $results['ko'];
$nbnoright = $results['noright'];
if ($nbok == 0) {
$message = __('Failed operation');
} else {
if ($nbnoright || $nbko) {
$message = __('Operation performed partially successful');
} else {
$message = __('Operation successful');
}
}
if ($nbnoright || $nbko) {
//TRANS: %$1d and %$2d are numbers
$message .= "<br>" . sprintf(__('(%1$d authorizations problems, %2$d failures)'), $nbnoright, $nbko);