Esempio n. 1
0
along with Manufacturersimports. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
$log = new PluginManufacturersimportsLog();
$config = new PluginManufacturersimportsConfig();
Html::header(_n('Suppliers import', 'Suppliers imports', 2, 'manufacturersimports'), $_SERVER['PHP_SELF'], "plugins", "manufacturersimports");
$config->checkGlobal("r");
if (isset($_POST["action"]) && isset($_POST["id"]) && isset($_POST["item"]) && count($_POST["item"])) {
    switch ($_POST["action"]) {
        case "import":
            PluginManufacturersimportsPostImport::massiveimport($_POST);
            break;
        case "reinit_once":
            foreach ($_POST["item"] as $key => $val) {
                if ($val == 1) {
                    $log->reinitializeImport($_POST["itemtype"], $key);
                }
            }
            Session::addMessageAfterRedirect(__('Operation successful'));
            Html::redirect($_SERVER['HTTP_REFERER'] . "?itemtype=" . $_POST["itemtype"] . "&manufacturers_id=" . $_POST["manufacturers_id"] . "&start=" . $_POST["start"] . "&imported=" . $_POST["imported"]);
            break;
    }
} else {
    echo "<div align='center'>";
    echo "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/warning.png\" alt=\"warning\"><br><br>";
    echo "<b>" . __('No selected element or badly defined operation') . "</b></div>";
}
Html::footer();