Esempio n. 1
0
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);