95 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			95 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| 	if (!defined('GLPI_ROOT')) {
 | |
| 
 | |
| 	   define('GLPI_ROOT', dirname(__DIR__));
 | |
| 
 | |
| 	}
 | |
| 
 | |
| 
 | |
| 
 | |
| 	include_once GLPI_ROOT . '/inc/based_config.php';
 | |
| 
 | |
| 
 | |
| 
 | |
| 	// Init Timer to compute time of display
 | |
| 
 | |
| 	$TIMER_DEBUG = new Timer();
 | |
| 
 | |
| 	$TIMER_DEBUG->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 ='<br><strong>Nom & Prénom Employé</strong> : '.explode("-",$_POST['id_user'])[1].'<br><strong>Matricule Employé</strong> : '.$_POST['matricule'].'<br><strong>Fonction</strong> : '.$_POST['fonction'].'<br><strong>Structure</strong> : '.$_POST['structure'].'<br>'.'
 | |
| 
 | |
| 	<br><strong>Matériel Associé</strong> : '.$_POST['user_hardware'].'<br><br><strong>Profil Accès</strong> : '.$_POST['accesprofile'].'<br><strong>Type</strong> : '.$_POST['accestype'].'<br><strong>Raison de la Reconfiguration</strong> : '.$_POST['reason_to_reconfig'].'
 | |
| 
 | |
|     <br><strong>Demandé par</strong> :  '.$_POST['requested_by_id'].'<br><br><strong>Détail des accès</strong> :';
 | |
| 
 | |
| 	
 | |
| 
 | |
|     $nbr = count($_POST["software"]);
 | |
| 
 | |
| 
 | |
| 
 | |
| 	for($i=0;$i < $nbr ;$i++){
 | |
| 
 | |
| 		$table = $table.' '.'<br>    <strong>Logiciel</strong> : '.
 | |
| 
 | |
| 		$_POST['software'][$i].'<br>    <strong>Remarque</strong> : '.$_POST['remarque'][$i].
 | |
| 
 | |
| 		'<br>   ---------------------------------<br>';
 | |
| 
 | |
| 	}
 | |
| 
 | |
| 
 | |
| 
 | |
|     $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
 |