obtformlib.php 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. <?php
  2. // ------------------------------
  3. // Caractéristiques du module
  4. // ------------------------------
  5. unset($module);
  6. $module = array(
  7. "titre" => "Gestion des libérations",
  8. "urldest" => $SCRIPT_NAME . "?page=liste_liberations",
  9. "recherche" => array("engin" => true),
  10. "jeton" => $jeton,
  11. "opradmin" => "Ajouter une libération",
  12. "fenetre" => array(
  13. "nom" => "liste_liberations",
  14. "titre" => "titre",
  15. "largeur" => "1024",
  16. "hauteur" => "500",
  17. "champs" => array("lemploye") //, "lpresentation", "lnom", "lprenom", "ladresse1", "ladresse2", "lville", "lcodepostal", "ltelephone", "lemail", "lmembreca", "lnoemployeur", "lnumero")
  18. ),
  19. "msgajoutbouton" => "Ajout de la libération",
  20. //"actionajoutbouton" => "Ajouter la lib�ration",
  21. "msgmodifbouton" => "Modification de la libération",
  22. //"actionmodifbouton" => "Modifier la fiche de l'employ�",
  23. "nombre_a_afficher" => array(
  24. 0 => array("refid" => 15, "valeur" => 15),
  25. 1 => array("refid" => 30, "valeur" => 30),
  26. 2 => array("refid" => 45, "valeur" => 45),
  27. 3 => array("refid" => 60, "valeur" => 60),
  28. 4 => array("refid" => 120, "valeur" => 120),
  29. 5 => array("refid" => 240, "valeur" => 240)
  30. ),
  31. "lientri" => true,
  32. "entete" => array(
  33. 1 => array("Employé" => "concat(employes.nomfamille,employes.prenom)", "largeur" => "130px"),
  34. 2 => array("Type" => "liberations.typeoperation", "largeur" => "78px"),
  35. 3 => array("Date de libération" => "ligneliberations.dateliberation", "largeur" => "141px"),
  36. 4 => array("Article" => "articles.noarticle", "largeur" => "65px"),
  37. 5 => array("Commentaire" => "ligneliberations.commentaire", "largeur" => "204px"),
  38. 6 => array("Durée" => "duree.duree", "largeur" => "61px"),
  39. 7 => array("Lieu" => "ligneliberations.lieu", "largeur" => "79px"),
  40. 8 => array("Assumer par" => "ligneliberations.quipaye", "largeur" => "105px"),
  41. 9 => array("Paiement" => "ligneliberations.paiement", "largeur" => "84px"),
  42. 10 => array("En date du" => "ligneliberations.datepaiement", "largeur" => "90px"),
  43. 11 => array("<img alt=\"Save\" src=\"../images/icones/icones_12.png\">" => "-1", "largeur" => "23px", "droit" => array("gestion_site" => "Oui")),
  44. 12 => array("<img alt=\"Pdf\" src=\"../images/pdficon_small.gif\">" => "-1", "largeur" => "22px")
  45. ),
  46. "msg" => array(
  47. "maj_ok" => "Création de la libération effectuée avec succès.",
  48. "maj_echec" => "L'opération de création de la libération a échouée",
  49. "rech_ok" => "La recherche a réussie.",
  50. "rech_echec" => "La recherche a été infructueuse ou a échouée.",
  51. "employeur_invalide" => "Employeur introuvable ou inconnu.",
  52. )
  53. );
  54. session_start();
  55. require (__DIR__ . '/vendor/autoload.php');
  56. require_once("lib/libconfig.inc.php");
  57. require_once("lib/libsession.inc.php");
  58. require_once("lib/libfonctions.inc.php");
  59. require_once("lib/libmysql.inc.php");
  60. require_once("lib/libencode.inc.php");
  61. require_once("lib/libforms.inc.php");
  62. require_once("lib/libcourriel.inc.php");
  63. require_once("lib/libliberations.inc.php");
  64. require_once("lib/lib2fa.inc.php");
  65. ini_set('display_errors', 'off');
  66. //Encodage des caractères
  67. header('Content-Type: text/html; charset=$ENCODAGE');
  68. //Pour test local avec des appels directs, transformer les INPUT_POST en INPUT_GET
  69. //INPUT_POST
  70. //INPUT_GET
  71. $SCRIPT_NAME = "index2.php";
  72. $jeton = filter_input(INPUT_POST, "jeton");
  73. $rsearch1 = filter_input(INPUT_POST, "prm1");
  74. if (!empty($rsearch1)) {
  75. if ($rsearch1 == "-1" || intval($rsearch1) > 0) {
  76. unset($cpt, $vide);
  77. $cpt = 0;
  78. if (intval($rsearch1) > 0) {
  79. unset($sqlparam);
  80. $sqlparam["table"][] = "liberations";
  81. $sqlparam["table"][] = "ligneliberations";
  82. $sqlparam["table"][] = "employes";
  83. $sqlparam["table"][] = "articles";
  84. $sqlparam["table"][] = "employeurs";
  85. $sqlparam["table"][] = "duree";
  86. $sqlparam["join"][] = "ligneliberations.refliberation = liberations.refliberation";
  87. $sqlparam["join"][] = "employes.refemploye = liberations.refemploye";
  88. $sqlparam["join"][] = "ligneliberations.refarticle = articles.refarticle";
  89. $sqlparam["join"][] = "employes.refemployeur=employeurs.refemployeur";
  90. $sqlparam["join"][] = "ligneliberations.duree=duree.refduree";
  91. $sqlparam["champs"][] = "liberations.refliberation";
  92. $sqlparam["champs"][] = "ligneliberations.refligneliberation";
  93. $sqlparam["champs"][] = "employes.numemploye";
  94. $sqlparam["champs"][] = "CONCAT(employes.prenom,' ',employes.nomfamille) as nomemploye";
  95. $sqlparam["champs"][] = "liberations.typeoperation";
  96. $sqlparam["champs"][] = "UNIX_TIMESTAMP(liberations.datedemande) as datedemande";
  97. $sqlparam["champs"][] = "unix_timestamp(ligneliberations.dateliberation) as dateliberation";
  98. $sqlparam["champs"][] = "duree.duree";
  99. $sqlparam["champs"][] = "articles.noarticle";
  100. $sqlparam["champs"][] = "ligneliberations.commentaire";
  101. $sqlparam["champs"][] = "ligneliberations.lieu";
  102. $sqlparam["champs"][] = "ligneliberations.quipaye";
  103. $sqlparam["champs"][] = "ligneliberations.paiement";
  104. $sqlparam["champs"][] = "IF(ligneliberations.paiement=2,UNIX_TIMESTAMP(ligneliberations.datepaiement),'') as datepaiement";
  105. $sqlparam["where"][] = sprintf("liberations.refliberation=%d", $rsearch1);
  106. unset($resultlib);
  107. $resultlib = executerRequeteSql($sqlparam);
  108. $cpt = count($resultlib) - 1;
  109. $vide = false;
  110. } else {
  111. $cpt = 0;
  112. $vide = true;
  113. $resultlib = array();
  114. }
  115. //Si syndicat régionaux, on limite l'accès aux articles.
  116. unset($sqlparam);
  117. $sqlparam["table"][] = "articles";
  118. $sqlparam["champs"][] = "refarticle";
  119. $sqlparam["champs"][] = "noarticle";
  120. if ($_SESSION['gestion_site'] == 'Non') {
  121. $sqlparam["where"][] = "noarticle='7.04' OR noarticle='7.09'";
  122. }
  123. unset($resultart);
  124. $resultart = executerRequeteSql($sqlparam);
  125. //Lecture des durées de temps
  126. unset($sqlparam);
  127. $sqlparam["table"][] = "duree";
  128. $sqlparam["champs"][] = "refduree";
  129. $sqlparam["champs"][] = "duree";
  130. unset($resultduree);
  131. $resultduree = executerRequeteSql($sqlparam);
  132. // Vérification de la libération si elle a été annulée ou pas
  133. $liberationIsCanceled = checkIfLiberationIsCanceled($rsearch1);
  134. // Formulaire de saisie
  135. print " <table width='100%' border='0' >\n";
  136. print " <tr>\n";
  137. print " <td align='center' width='100%'>\n";
  138. print " <div style='background:#f2f6f7'>\n";
  139. print " <form action='" . $SCRIPT_NAME . "?page=liste_liberations&jeton=" . $jeton . "' method='post' id='frmModif' name='frmModif' "; //>\n";
  140. if (isset($param["validation"])) {
  141. print " onSubmit='return ValidationFormulaire();'";
  142. }
  143. print " autocomplete='off'>\n";
  144. print " <table width='100%'>\n";
  145. print " <tr>\n";
  146. print " <td colspan='2'>\n";
  147. print " <table width='100%'>\n";
  148. print " <tr>\n";
  149. print " </tr>\n";
  150. print " </table>\n";
  151. print " </td>\n";
  152. print " </tr>\n";
  153. print "<INPUT TYPE='hidden' name='action'>\n";
  154. if ($vide) {
  155. print "<INPUT TYPE='hidden' name='noliberation'>\n";
  156. } else {
  157. print "<INPUT TYPE='hidden' name='noliberation' value='" . $rsearch1 . "'>\n";
  158. }
  159. print "<table width='100%' border='0'>\n";
  160. print "<tr>\n";
  161. print "<td valign=top style='width:300px;'>Type d'op&eacute;ration : </td>\n";
  162. print "<td style='width:305px;'>\n";
  163. if ($vide) {
  164. print "<table id='tblopr' style='width:265px; padding-left:20px; padding-right: 20px; border:1px solid #cfcfcf;'>\n";
  165. print "<tr>\n";
  166. print "<td>\n";
  167. print "<label for='opr1'>\n";
  168. print "<input style='margin-right:10px;' type='radio' id='opr1' name='ltypeopr' value='1' checked> Demande&nbsp;&nbsp;\n";
  169. print "</label>\n";
  170. // print "<label for='opr2'>\n";
  171. // print "<input style='margin-right:10px;' type='radio' id='opr2' name='ltypeopr' value='2'> Annulation&nbsp;&nbsp;\n";
  172. // print "</label>\n";
  173. print "</td>\n";
  174. print "</tr>\n";
  175. print "</table>\n";
  176. } else {
  177. unset($vtypeopr);
  178. $vtypeopr = ($resultlib[0]["typeoperation"] == 1) ? "Demande" : "Annulation";
  179. print $vtypeopr;
  180. print "<input type='hidden' id='opr' name='ltypeopr' value='" . $resultlib[0]["typeoperation"] . "'>\n";
  181. print "<input type='hidden' name='liberation' value='$rsearch1'>\n";
  182. }
  183. print "</td>\n";
  184. print "<td style='text-align:right; width:200px;'>\n";
  185. print "<INPUT class='styled vsolde' TYPE='button' VALUE='Voir le solde' id='vsolde' onclick='voirsolde();'>\n";
  186. print "<div style='position: relative; margin-left:85px;'>\n";
  187. print "<div class='voirsolde' id='voirsolde' style='display:none; padding:2px;'></div>\n";
  188. print "</div>\n";
  189. print "</td>\n";
  190. print "</tr>\n";
  191. print "<tr>\n";
  192. print "<td valign=top>\n";
  193. print "Employ&eacute; :\n";
  194. print "</td>\n";
  195. print "<td colspan='2'>\n";
  196. unset($condition1, $condition2, $condition3);
  197. $condition1 = "Recherche";
  198. $condition2 = "";
  199. $condition3 = date("Y-m-d");
  200. if (!$vide) {
  201. $condition1 = $resultlib[0]["nomemploye"];
  202. $condition2 = ($resultlib[0]["typeoperation"] == 2) ? "checked" : "";
  203. $condition3 = date("Y-m-d", $resultlib[0]["datedemande"]);
  204. }
  205. if ($vide) {
  206. print "<input type='text' value='$condition1' id='zonerecherche2' name='zonerecherche2' onfocus=\"this.value='';\">\n";
  207. } else {
  208. print ucfirst($condition1);
  209. }
  210. print "<input type='hidden' value='$condition2' id='lreference2' name='lreference'>\n";
  211. print "<div id='zoneresultats2' style='max-height:300px;'>\n";
  212. print "</div>\n";
  213. print "</td>\n";
  214. print "</tr>\n";
  215. print "<tr>\n";
  216. print "<td>Date de la cr&eacute;ation du document de lib&eacute;ration : </td>\n";
  217. print "<td colspan='2'>\n";
  218. if ($vide) {
  219. print "<INPUT TYPE='text' NAME='ldatecreation' id='datecreation' Value='$condition3'> (Format : AAAA-MM-JJ)\n";
  220. } else {
  221. print "$condition3";
  222. print "<INPUT TYPE='hidden' NAME='ldatecreation' id='datecreation' Value='$condition3'>";
  223. }
  224. print "</td>\n";
  225. print "</tr>\n";
  226. print "<tr>\n";
  227. print "<td colspan='3'>\n";
  228. print "<br>\n";
  229. //<!-- Il faut conserver 2 rangées pour cette table, l'entête et la seconde
  230. //qui sert de modèle pour l'insertion des rangées virtuelles subséquentes.-->
  231. print "<table id='liberations' cellspacing='0' style='width:100%; border-collapse:collapse; border:1px solid #cfcfcf;'>";
  232. print "<tbody>\n";
  233. print "<tr>\n";
  234. print "<th class='liberationsdetail'>Date de lib&eacute;ration</th>\n";
  235. print "<th class='liberationsdetail'>Article</th>\n";
  236. print "<th class='liberationsdetail'>Commentaire</th>\n";
  237. print "<th class='liberationsdetail'>Dur&eacute;e</th>\n";
  238. print "<th class='liberationsdetail'>Lieu</th>\n";
  239. print "<th class='liberationsdetail'>Assum&eacute;e par</th>\n";
  240. if (!$vide) {
  241. print "<th class='liberationsdetail'>Paiement</th>";
  242. print "<th class='liberationsdetail'>En date du</th>";
  243. } else {
  244. // Colonne visible seulement en mode ajout
  245. print "<th class='liberationsdetail'>&nbsp;</th>\n";
  246. }
  247. print "<th style=class='liberationsdetail'>Action</th>\n";
  248. print "</tr>\n";
  249. // Boucle d'affichage des lignes de détail
  250. unset($x);
  251. $tableauid = array();
  252. for ($x = 0; $x <= $cpt; $x++) {
  253. unset($liberation);
  254. $liberation["refliberation"] = "";
  255. $liberation["date"] = "";
  256. $liberation["article"] = "";
  257. $liberation["commentaire"] = "";
  258. $liberation["duree"] = "";
  259. $liberation["lieu"] = "";
  260. $liberation["assumerpar"] = "";
  261. $liberation["paiement"] = "";
  262. $liberation["datepaiement"] = "";
  263. if (!$vide) {
  264. $liberation["refliberation"] = $resultlib[$x]["refliberation"];
  265. $liberation["date"] = date("Y-m-d", $resultlib[$x]["dateliberation"]);
  266. $liberation["article"] = $resultlib[$x]["noarticle"];
  267. $liberation["commentaire"] = htmlentities(stripslashes($resultlib[$x]["commentaire"]), ENT_QUOTES, $ENCODAGE);
  268. $liberation["duree"] = $resultlib[$x]["duree"];
  269. $liberation["lieu"] = htmlentities(stripslashes($resultlib[$x]["lieu"]), ENT_QUOTES, $ENCODAGE);
  270. $liberation["assumerpar"] = $resultlib[$x]["quipaye"];
  271. $liberation["paiement"] = $resultlib[$x]["paiement"];
  272. $liberation["datepaiement"] = ($resultlib[$x]["paiement"] == 2) ? date("Y-m-d", $resultlib[$x]["datepaiement"]) : "";
  273. $liberation["refligneliberation"] = $resultlib[$x]["refligneliberation"];
  274. }
  275. print "<tr class='ligne' id='ligne$x'>\n";
  276. // Le document original ne doit pas être annulé et doit être une demande uniquement.
  277. if ($rsearch1==-1 || (!$liberationIsCanceled && $vtypeopr == "Demande")) {
  278. print "<td class='liberationsdetail'>\n";
  279. print "<input name=\"ancdate[]\" value=\"" . $liberation["date"] . "\" id='idanc$x'\" type=\"hidden\">";
  280. print "<input name='datelib[]' style='min-width:80px;' value='" . $liberation["date"] . "' id='id$x' onblur=\"verifieDate('id$x','lart$x');\" onfocus='verifieinfo();' >";
  281. print "<img alt='Calendrier' src='images/calendar.gif' class='calendrier' id='butdate$x' onclick=\"calendrier('id$x');\">\n";
  282. print "</td>\n";
  283. print "<td class='liberationsdetail'>\n";
  284. print "<select name='larticle[]' id='lart$x' onfocus='verifieinfo();' onblur=\"reponseBoolDate=true;verifieDate('id$x','lart$x');\" >\n";
  285. print "<option value='0'>--------</option>\n";
  286. if (isset($resultart) && is_array($resultart) && count($resultart) > 0) {
  287. foreach ($resultart as $clef => $champs) {
  288. unset($selected);
  289. $selected = "";
  290. if ($champs["noarticle"] == $liberation["article"]) {
  291. $selected = "selected";
  292. }
  293. print "<option $selected value=\"" . $champs["refarticle"] . "\">" . $champs["noarticle"] . "</option>";
  294. }
  295. }
  296. print "</select>\n";
  297. print "</td>\n";
  298. print "<td class='liberationsdetail'>\n";
  299. print "<input class='boite_commentaire' name='commentaire[]' id='com$x' value=\"" . $liberation["commentaire"] . "\" onfocus='verifieinfo();' >\n";
  300. print "</td>\n";
  301. print "<td class='liberationsdetail'>\n";
  302. print "<select name='lduree[]' id='ldur$x' onfocus='verifieinfo();' >\n";
  303. print "<option value='0'>------</option>\n";
  304. if (isset($resultduree) && is_array($resultduree) && count($resultduree) > 0) {
  305. foreach ($resultduree as $clef => $champs) {
  306. unset($selected);
  307. $selected = "";
  308. if ($champs["duree"] == $liberation["duree"]) {
  309. $selected = "selected";
  310. }
  311. print "<option $selected value=\"" . $champs["refduree"] . "\">" . $champs["duree"] . "</option>";
  312. }
  313. }
  314. print "</select>\n";
  315. print "</td>\n";
  316. print "<td class='liberationsdetail'>\n";
  317. print "<input name='lieu[]' value=\"" . $liberation["lieu"] . "\" id='lie$x' onfocus='verifieinfo();' >\n";
  318. print "</td>\n";
  319. print "<td class='liberationsdetail'>\n";
  320. print "<select NAME='lassumerpar[]' id='las$x' onfocus='verifieinfo();' >\n";
  321. print "<option value='0'>--------</option>\n";
  322. unset($selected1, $selected2);
  323. $selected1 = "";
  324. $selected2 = "";
  325. if ($liberation["assumerpar"] == "Syndicat") {
  326. $selected1 = "selected";
  327. } elseif ($liberation["assumerpar"] == "Employeur") {
  328. $selected2 = "selected";
  329. }
  330. print "<option $selected1 value='Syndicat'>Syndicat</option>\n";
  331. print "<option $selected2 value='Employeur'>Employeur</option>\n";
  332. print "</select>\n";
  333. print "</td>\n";
  334. if (!$vide) {
  335. print "<td class='liberationsdetail'>";
  336. print "<select NAME=\"lpaiement[]\" id=\"lpa$x\" onchange=\"creeDatePaiement('lpa$x','datepaiement$x');\"\">";
  337. print "<option value=\"0\">--------</option>";
  338. unset($condition1, $condition2);
  339. $condition1 = ($liberation["paiement"] == "1") ? "Selected" : "";
  340. $condition2 = ($liberation["paiement"] == "2") ? "Selected" : "";
  341. print "<option value=\"1\" $condition1>Non</option>";
  342. print "<option value=\"2\" $condition2>Oui</option>";
  343. print "</td>\n";
  344. print "<td class='liberationsdetail'>";
  345. print "<input name=\"datepaiement[]\" id=\"datepaiement$x\" size=\"10\" maxlength=\"10\" type=\"text\" readonly=\"readonly\" value=\"" . $liberation["datepaiement"] . "\">";
  346. print sprintf("<input type='hidden' id='ligneliberation$x' name='ligneliberation[]' value='%d'>", $liberation["refligneliberation"]);
  347. print "</td>\n";
  348. } else {
  349. // La suppression de ligne seulement en mode ajout d'une libération
  350. print "<td class='liberationsdetail'>\n";
  351. print "<input type='button' class='supprimer' onclick='supprimeLigne(this);' value='' id='$x'>\n";
  352. print "</td>\n";
  353. }
  354. print "<td class='liberationsdetail'>";
  355. print "<input type='button' class='copier' title='Copier' onclick='copieLigne(\"liberations\");'>\n";
  356. print "</td>\n";
  357. $tableauid[] = "$(\"#id$x\").datepicker({
  358. autoSize: true,
  359. onSelect:function(){
  360. reponseBoolDate=true;
  361. verifieDate('id$x','lart$x');
  362. }
  363. });\n
  364. $(\"#id$x\").datepicker(\"hide\");\n";
  365. print "</tr>\n";
  366. } else {
  367. // ------------------------------------------
  368. // Libération annulée, modification interdite
  369. // ------------------------------------------
  370. print "<td class='liberationsdetail'>\n";
  371. print $liberation["date"];
  372. print "</td>\n";
  373. print "<td class='liberationsdetail'>\n";
  374. print $liberation["article"];
  375. print "</td>\n";
  376. print "<td class='liberationsdetail'>\n";
  377. print $liberation["commentaire"];
  378. print "</td>\n";
  379. print "<td class='liberationsdetail'>\n";
  380. print $liberation["duree"];
  381. print "</td>\n";
  382. print "<td class='liberationsdetail'>\n";
  383. print $liberation["lieu"];
  384. print "</td>\n";
  385. print "<td class='liberationsdetail'>\n";
  386. print $liberation["assumerpar"];
  387. print "</td>\n";
  388. if (!$vide) {
  389. print "<td class='liberationsdetail'>";
  390. $paiement = ($liberation["paiement"] == "1") ? "Oui" : "Non";
  391. print $paiement;
  392. print "</td>\n";
  393. print "<td class='liberationsdetail'>";
  394. print $liberation["datepaiement"];
  395. print "</td>\n";
  396. }
  397. print "<td class='liberationsdetail'></td>\n";
  398. print "</tr>\n";
  399. }
  400. }
  401. // Fin de la boucle
  402. print "</tbody>\n";
  403. print "</table>\n";
  404. print "<script type=\"text/javascript\">$(document).ready(function() {\n";
  405. if ($vide) {
  406. print "
  407. // Calendrier pour la date de demande
  408. $( \"#datecreation\" ).datepicker({
  409. showOn: \"button\",
  410. buttonImage: \"images/calendar.gif\",
  411. buttonImageOnly: true
  412. });\n";
  413. }
  414. foreach ($tableauid as $clef) {
  415. print $clef;
  416. }
  417. print "});</script>";
  418. // L'ajout de ligne seulement en mode ajout d'une libération
  419. if (!$vide) {
  420. print "<div style='height:25px;'></div>\n";
  421. } else {
  422. print "<div class='user' style='cursor:pointer;' tabindex='0' onclick=\"addRow('liberations');\">Ajouter une ligne</div>\n";
  423. }
  424. print "<div style='width:auto; text-align:center;'>\n";
  425. print "<INPUT class='styled' TYPE='button' VALUE='Aper&ccedil;u' onclick='apercuLiberation(" . $liberation["refliberation"] . ");'>\n";
  426. // Le document original ne doit pas être annulé et doit être une demande uniquement.
  427. if ($rsearch1==-1 || (!$liberationIsCanceled && $vtypeopr == "Demande")) {
  428. if ($vide) {
  429. print "<INPUT class='styled' TYPE='button' VALUE='Accepter et imprimer' onclick='ValidationFormulaire(this.value);'>\n";
  430. print "<INPUT class='styled' TYPE='button' VALUE='Accepter et envoyer par courriel' onclick='ValidationFormulaire(this.value);'>\n";
  431. } else {
  432. print "<INPUT class='styled' TYPE='button' VALUE='Modifier' onclick='ValidationFormulaire(this.value);'>\n";
  433. print "<INPUT class='styled' TYPE='button' VALUE='Modifier et imprimer' onclick='ValidationFormulaire(this.value);'>\n";
  434. // Bouton d'annulation applicable seulement pour les demandes.
  435. if ($resultlib[0]["typeoperation"] == 1) {
  436. print "<INPUT class='styled' TYPE='button' VALUE='Annuler la demande de libération' onclick='AnnuleLiberation(this.value," . $liberation["refliberation"] . ");'>\n";
  437. }
  438. }
  439. } else {
  440. print "<INPUT class='styled' TYPE='button' VALUE='Copier la demande de libération' onclick='CopierLiberation(this.value," . $liberation["refliberation"] . ");'>\n";
  441. }
  442. if ($vide) {
  443. print "<INPUT class='styled' TYPE='button' VALUE='Effacer' onclick='recommencer();'>";
  444. }
  445. unset($titretemp);
  446. //$datepaiement = ($champs[6] == 2) ? date("Y-m-d", $champs[8]) : "&nbsp;";
  447. if (isset($module["actionajoutbouton"])) {
  448. $titretemp = $module["actionajoutbouton"];
  449. }
  450. $titretemp = '';
  451. print "</div>\n";
  452. print " <tr>\n";
  453. print " <td colspan='3' style='height:50px; text-align:center;'>\n";
  454. $style = "font-size:10pt; font-family:arial, helvetica, sans-serif; margin-left:5px; margin-right:5px; text-align:center;";
  455. //TODO
  456. //Suspendu pour l'instant, je ne vois pas d'assignation de la variable $titre.....
  457. //SG 2023-09-30
  458. /*
  459. if (is_array($titre)) {
  460. foreach ($titre as $clef) {
  461. print "<input style='$style' type=\"submit\" id='boutonaction' name=\"action\" value=\"" . $clef . "\">&nbsp;\n";
  462. }
  463. } else {
  464. if ($titre != '') {
  465. print " <input style='$style' type=\"submit\" id='boutonaction' name=\"action\" value=\"" . $titre . "\">\n";
  466. }
  467. }
  468. */
  469. print "<input class='styled' type=\"button\" id='boutonaction' value=\"Annuler\" onclick='fermerfenetremodale();'>&nbsp;\n";
  470. print " </td>\n";
  471. print " </tr>\n";
  472. print " </table>\n";
  473. print " </form>\n";
  474. print " </div>\n";
  475. print " </td>\n";
  476. print " </tr>\n";
  477. print " </table>\n";
  478. //fenetremodalefin($titretemp);
  479. ?>
  480. <script>
  481. $(document).ready(function () {
  482. // Paramètres pour la seconde zone de recherche
  483. $("#zonerecherche2").focus(function () {
  484. if ($("#zonerecherche2").val() === 'Recherche') {
  485. $("#zonerecherche2").val('');
  486. }
  487. });
  488. $("#zonerecherche2").blur(function () {
  489. $("#zoneresultats2").slideUp();
  490. });
  491. $("#zonerecherche2").keyup(function () {
  492. var SearchText = $("#zonerecherche2").val();
  493. if (SearchText.length > 0) {
  494. $("#zoneresultats2").load("ajaxsearch.php", {zonerecherche: SearchText, id: 2});
  495. $("#zoneresultats2").slideDown();
  496. } else {
  497. $("#zoneresultats2").slideUp();
  498. }
  499. });
  500. $("#zoneresultats2").slideUp();
  501. });
  502. </script>
  503. <?php
  504. }
  505. }