start();
/// TODO try to remove them if possible
include_once (GLPI_ROOT . "/inc/db.function.php");
// Standard includes
include_once (GLPI_ROOT . "/inc/config.php");
require_once '../functionsophalglpi.php';
Session::checkLoginUser();
//disbled errors =>pour le variable res (Ajax)
ini_set('display_errors', 0);
global $DB;
$name = "Attribution Accès";
$table ='
Nom & Prénom Employé : '.explode("-",$_POST['id_user'])[1].'
Matricule Employé : '.$_POST['matricule'].'
Fonction : '.$_POST['fonction'].'
Structure : '.$_POST['structure'].'
'.'
Matériel Associé : '.$_POST['user_hardware'].'
Profil Accès : '.$_POST['accesprofile'].'
Type : '.$_POST['accestype'].'
Raison de la Reconfiguration : '.$_POST['reason_to_reconfig'].'
Demandé par : '.$_POST['requested_by_id'].'
Détail des accès :';
$nbr = count($_POST["software"]);
for($i=0;$i < $nbr ;$i++){
$table = $table.' '.'
Logiciel : '.
$_POST['software'][$i].'
Remarque : '.$_POST['remarque'][$i].
'
---------------------------------
';
}
$id_categorie = array("Attribution Accès"=>"51" ,"Reconfiguration Accès"=>"52" , "Retrait Accès"=>"53");
add_ticket($id_categorie[$name],$name,$table,$_SESSION["glpiID"]);
$tickets_id = $DB->insert_id();
add_User_Demandeur($tickets_id , $_SESSION["glpiID"]);
atributeTo($tickets_id , 431);//validation de lokmane
add_Validation($tickets_id,128,$_SESSION["glpiID"]);// validation de DSI
add_Validation($tickets_id,132,$_SESSION["glpiID"]);// validation de IT applications manager
add_Validation($tickets_id,2,$_SESSION["glpiID"]);// validation de IT operations manager