コード例 #1
0
ファイル: model.class.php プロジェクト: JULIO8/respaldo_glpi
 static function cleanSessionVariables()
 {
     //Reset parameters stored in session
     PluginDatainjectionSession::removeParams();
     PluginDatainjectionSession::setParam('infos', array());
 }
コード例 #2
0
                    //File uploaded successfully and matches the given model : switch to the import tab
                    $_SESSION['datainjection']['file_name'] = $_FILES['filename']['name'];
                    $_SESSION['datainjection']['step'] = PluginDatainjectionClientInjection::STEP_PROCESS;
                    //Store model in session for injection
                    $_SESSION['datainjection']['currentmodel'] = serialize($model);
                    $_SESSION['datainjection']['go'] = true;
                } else {
                    //Got back to the file upload page
                    $_SESSION['datainjection']['step'] = PluginDatainjectionClientInjection::STEP_UPLOAD;
                }
            } else {
                Session::addMessageAfterRedirect(__('The file could not be found', 'datainjection'), true, ERROR, true);
            }
        }
        Html::back();
    } else {
        if (isset($_POST['finish']) || isset($_POST['cancel'])) {
            PluginDatainjectionSession::removeParams();
            Html::redirect(Toolbox::getItemTypeFormURL('PluginDatainjectionClientInjection'));
        } else {
            if (isset($_GET['id'])) {
                // Allow link to a model
                PluginDatainjectionSession::setParam('models_id', $_GET['id']);
            }
            $clientInjection = new PluginDatainjectionClientInjection();
            $clientInjection->title();
            $clientInjection->showForm(0);
        }
    }
}
Html::footer();