commit d485029b7b33842d144ec352e571a5c3b91f0153
Author: root <root@anet>
Date:   Sun Feb 13 15:53:26 2011 +0100

    contrat de maintenance et cahier de recette

diff --git a/htdocs/epack/export/checksum b/htdocs/epack/export/checksum
index 8a90f53..2b43d9a 100644
Binary files a/htdocs/epack/export/checksum and b/htdocs/epack/export/checksum differ
diff --git a/htdocs/epack/export/checksum.md5 b/htdocs/epack/export/checksum.md5
index d10ffc5..c05f43c 100644
--- a/htdocs/epack/export/checksum.md5
+++ b/htdocs/epack/export/checksum.md5
@@ -1 +1 @@
-9a23820e93e146acb3f17bea87af9914  checksum
+5826d5f26c71610ec0516f7ea3cf4d7d  checksum
diff --git a/htdocs/epack/new.php b/htdocs/epack/new.php
index e3d1d5e..dcc15f6 100644
--- a/htdocs/epack/new.php
+++ b/htdocs/epack/new.php
@@ -123,7 +123,7 @@ abuledu.net est un service de RyXéo SARL, société éditrice d'AbulÉdu
       $message .= "<p>Le compte de votre client a été créé, vous pouvez maintenant le sélectionner dans la liste déroulante et valider.</p>";
       $_SESSION['epack_session'] = 3;
       //273 c'est l'entite clients a trier ... hardcode
-      $query = "INSERT INTO glpi_entities VALUES('','" . addslashes(propre($_POST['client_name'])) . "','" . $_SESSION['login_entity'] . "','1. Clients > 00 - A Trier > " . addslashes($_POST['client_name']) . "','',3)";
+      $query = "INSERT INTO glpi_entities VALUES('','" . addslashes(propre($_POST['client_name'])) . "','" . $_SESSION['login_entity'] . "','1. AbulEdu > 00 - A Trier > " . addslashes($_POST['client_name']) . "','',3)";
       $result = $DB->query($query);
       
       //et il faut tout de suite raccrocher le userid de la personne a cette entitee pour qu'il ait les droits ad-hoc
diff --git a/htdocs/epack/register.php b/htdocs/epack/register.php
index 29312aa..b69cdb1 100644
--- a/htdocs/epack/register.php
+++ b/htdocs/epack/register.php
@@ -314,6 +314,7 @@ function add_user_and_update_link($usermail,$identity,$userlastname,$userfirstna
       }
       else {
 	$message .= "<li>Tentative de lien avec l'entité racine refusée pour $usermail: <font color=\"red\">ERROR</font></li>\n";
+	//$message .= "<li>$query2</li>\n";
       }
     }
     //Sinon c'est que tout est déjà fait !
@@ -518,7 +519,7 @@ WHERE code='$code' AND password='$pass'";
 	    $data1 = $DB->fetch_assoc($result1);
 	    $identityenduser = $data1['ID'];
 	  }
-
+	  //$message .= "<li>Entity: $query1</li>\n";
 	  add_user_and_update_link($datapost['IEMAIL'], $identityenduser,$datapost['INAME'],$datapost['ICITY'],"Installation");
 	  add_user_and_update_link($datapost['ADM_EMAIL'], $identityenduser,$datapost['ADM_LASTNAME'],$datapost['ADM_FIRSTNAME'],"Directrice ou directeur");
 	  add_user_and_update_link($datapost['PR_EMAIL'], $identityenduser,$datapost['PR_LASTNAME'],$datapost['PR_FIRSTNAME'],"Autre contact");
diff --git a/htdocs/front/helpdesk.abuledu_details.php b/htdocs/front/helpdesk.abuledu_details.php
index 01ed6f3..67490d1 100644
--- a/htdocs/front/helpdesk.abuledu_details.php
+++ b/htdocs/front/helpdesk.abuledu_details.php
@@ -136,10 +136,61 @@ for($i = 0; $i < $DB->numrows($result); $i++) {
 
 print "</table>";
 
-print "<h2>Votre contrat de maintenance</h2>
+print "<h2>Votre cahier de recette</h2>";
 
-<p>Informations en cours de traitement.</p>";
+$query = "SELECT glpi_docs.FK_entities, glpi_docs.recursive,
+  glpi_docs.name AS name,
+  glpi_docs.filename AS filename,
+  glpi_docs.mime AS mimetype,
+  glpi_docs.ID AS ID,
+  glpi_docs.comments AS comments
+FROM glpi_docs
+  LEFT JOIN glpi_entities ON (glpi_docs.FK_entities = glpi_entities.ID)
+  LEFT JOIN glpi_dropdown_rubdocs ON (glpi_docs.rubrique = glpi_dropdown_rubdocs.ID)
+WHERE
+  glpi_docs.filename LIKE '%recette%' AND
+  glpi_docs.deleted='0' AND ( glpi_docs.FK_entities IN (" . $_SESSION['glpiactive_entity'] . ") OR ( glpi_docs.recursive='1' AND glpi_docs.FK_entities IN (" . $_SESSION['glpiactive_entity'] . ")) ) ORDER BY glpi_docs.name";
+
+$result = $DB->query($query) or die($DB->error());
+//print $query;
+
+if($DB->numrows($result) == 0) {
+  print "<p>Aucune information disponible ...</p>";
+ }
+ else {
+   for($i = 0; $i < $DB->numrows($result); $i++) {
+     $data=$DB->fetch_array($result);
+     print "<p>Vous pouvez télécharger votre cahier de recette: <a href='document.abuledu_view.php?file=" . $data['filename'] . "'>" . $data['filename'] . "</a></p>\n";
+   }
+ }
+
+print "<h2>Votre contrat de maintenance</h2>";
 
+$query = "SELECT glpi_docs.FK_entities, glpi_docs.recursive,
+  glpi_docs.name AS name,
+  glpi_docs.filename AS filename,
+  glpi_docs.mime AS mimetype,
+  glpi_docs.ID AS ID,
+  glpi_docs.comments AS comments
+FROM glpi_docs
+  LEFT JOIN glpi_entities ON (glpi_docs.FK_entities = glpi_entities.ID)
+  LEFT JOIN glpi_dropdown_rubdocs ON (glpi_docs.rubrique = glpi_dropdown_rubdocs.ID)
+WHERE
+  glpi_docs.filename LIKE '%contrat%' AND
+  glpi_docs.deleted='0' AND ( glpi_docs.FK_entities IN (" . $_SESSION['glpiactive_entity'] . ") OR ( glpi_docs.recursive='1' AND glpi_docs.FK_entities IN (" . $_SESSION['glpiactive_entity'] . ")) ) ORDER BY glpi_docs.name";
+
+$result = $DB->query($query) or die($DB->error());
+//print $query;
+
+if($DB->numrows($result) == 0) {
+  print "<p>Aucune information disponible ...</p>";
+ }
+ else {
+   for($i = 0; $i < $DB->numrows($result); $i++) {
+     $data=$DB->fetch_array($result);
+     print "<p>Vous pouvez télécharger votre contrat de maintenance: <a href='document.abuledu_view.php?file=" . $data['filename'] . "'>" . $data['filename'] . "</a></p>\n";
+   }
+ }
 
 helpFooter();
 
