function show_list_form()
 {
     global $form_filtre_demande, $form_liste_demande;
     global $dbh, $charset, $msg;
     global $idetat, $iduser, $idempr, $user_input;
     global $date_debut, $date_fin, $id_type, $id_theme, $dmde_loc;
     //Formulaire des filtres
     $date_deb = "\n\t\t\t<input type='hidden' id='date_debut' name='date_debut' value='!!date_debut!!' />\n\t\t\t<input type='button' class='bouton' id='date_debut_btn' name='date_debut_btn' value='!!date_debut_btn!!' onClick=\"openPopUp('./select.php?what=calendrier&caller=search&date_caller=!!date_debut!!&param1=date_debut&param2=date_debut_btn&auto_submit=NO&date_anterieure=YES', 'date_debut', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\"/>\n\t\t";
     $date_but = "\n\t\t\t<input type='hidden' id='date_fin' name='date_fin' value='!!date_fin!!' />\n\t\t\t<input type='button' class='bouton' id='date_fin_btn' name='date_fin_btn' value='!!date_fin_btn!!' onClick=\"openPopUp('./select.php?what=calendrier&caller=search&date_caller=!!date_fin!!&param1=date_fin&param2=date_fin_btn&auto_submit=NO&date_anterieure=YES', 'date_fin', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\"/>\n\t\t";
     //Affichage de l'état en entete de page (si séléctioné)
     if ($idetat) {
         $form_filtre_demande = str_replace('!!etat_demandes!!', htmlentities(stripslashes($this->liste_etat[$idetat]['comment']), ENT_QUOTES, $charset), $form_filtre_demande);
     } else {
         $form_filtre_demande = str_replace('!!etat_demandes!!', "", $form_filtre_demande);
     }
     if ($date_debut && $date_fin) {
         $date_deb = str_replace('!!date_debut_btn!!', formatdate($date_debut), $date_deb);
         $date_but = str_replace('!!date_fin_btn!!', formatdate($date_fin), $date_but);
         $date_deb = str_replace('!!date_debut!!', $date_debut, $date_deb);
         $date_but = str_replace('!!date_fin!!', $date_fin, $date_but);
     } else {
         $date_lib = formatdate(today());
         $date_sql = date("Y-m-d", time());
         $date_deb = str_replace('!!date_debut_btn!!', $date_lib, $date_deb);
         $date_but = str_replace('!!date_fin_btn!!', $date_lib, $date_but);
         $date_deb = str_replace('!!date_debut!!', $date_sql, $date_deb);
         $date_but = str_replace('!!date_fin!!', $date_sql, $date_but);
     }
     if ($idempr) {
         $form_filtre_demande = str_replace('!!idempr!!', $idempr, $form_filtre_demande);
         $carac_empr = $this->getCaracEmpr($idempr);
         $nom = $carac_empr['nom'];
         $form_filtre_demande = str_replace('!!empr_txt!!', $nom, $form_filtre_demande);
     } else {
         $form_filtre_demande = str_replace('!!idempr!!', '', $form_filtre_demande);
         $form_filtre_demande = str_replace('!!empr_txt!!', '', $form_filtre_demande);
     }
     $form_filtre_demande = str_replace('!!user_input!!', htmlentities(stripslashes($user_input), ENT_QUOTES, $charset), $form_filtre_demande);
     $form_filtre_demande = str_replace('!!periode!!', sprintf($msg['demandes_filtre_periode_lib'], $date_deb, $date_but), $form_filtre_demande);
     $onchange = "onchange='this.form.act.value=\"search\";submit()'";
     $form_filtre_demande = str_replace('!!affectation!!', $this->getUsersSelector($onchange, true, false, true), $form_filtre_demande);
     $form_filtre_demande = str_replace('!!state!!', $this->getStateSelector($idetat, $onchange, true), $form_filtre_demande);
     $themes = new demandes_themes('demandes_theme', 'id_theme', 'libelle_theme', $id_type);
     $types = new demandes_types('demandes_type', 'id_type', 'libelle_type', $id_theme);
     $form_filtre_demande = str_replace('!!theme!!', $themes->getListSelector($id_theme, $onchange, true), $form_filtre_demande);
     $form_filtre_demande = str_replace('!!type!!', $types->getListSelector($id_type, $onchange, true), $form_filtre_demande);
     $req_loc = "select idlocation, location_libelle from docs_location";
     $res_loc = pmb_mysql_query($req_loc, $dbh);
     $sel_loc = "<select id='dmde_loc' name='dmde_loc' onchange='this.form.act.value=\"search\";submit()' >";
     $sel_loc .= "<option value='0' " . (!$dmde_loc ? 'selected' : '') . ">" . htmlentities($msg['demandes_localisation_all'], ENT_QUOTES, $charset) . "</option>";
     while ($loc = pmb_mysql_fetch_object($res_loc)) {
         $sel_loc .= "<option value='" . $loc->idlocation . "' " . ($dmde_loc == $loc->idlocation ? 'selected' : '') . ">" . htmlentities($loc->location_libelle, ENT_QUOTES, $charset) . "</option>";
     }
     $sel_loc .= "</select>";
     $form_filtre_demande = str_replace('!!localisation!!', $sel_loc, $form_filtre_demande);
     $p_perso = new parametres_perso("demandes");
     if (!$p_perso->no_special_fields) {
         $c = 0;
         $perso_ = $p_perso->show_search_fields();
         for ($i = 0; $i < count($perso_["FIELDS"]); $i++) {
             $p = $perso_["FIELDS"][$i];
             if ($c == 0) {
                 $perso .= "<div class='row'>";
             }
             $perso .= "<div class='colonne3'><label for='" . $p["NAME"] . "' class='etiquette'>" . $p["TITRE"] . "</label><div class='row'>" . $p["AFF"] . "</div></div>";
             $c++;
             if ($c == 3) {
                 $perso .= "</div>";
                 $c = 0;
             }
         }
         if ($c == 1) {
             $perso .= "<div class='colonne2'>&nbsp;</div><div class='colonne2'>&nbsp;</div></div>";
         } elseif ($c == 2) {
             $perso .= "<div class='colonne2'>&nbsp;</div></div>";
         }
     }
     $form_filtre_demande = str_replace("!!champs_perso!!", $perso, $form_filtre_demande);
     print $form_filtre_demande;
     $header_champs_perso = "";
     reset($p_perso->t_fields);
     $nb_cp_column = 0;
     while (list($key, $val) = each($p_perso->t_fields)) {
         $header_champs_perso .= "<th>" . htmlentities($val["TITRE"], ENT_QUOTES, $charset) . "</th>";
         $nb_cp_column++;
     }
     //Formulaire de la liste
     $req = self::getQueryFilter($idetat, $iduser, $idempr, $user_input, $date_debut, $date_fin, $id_theme, $id_type, $dmde_loc);
     $res = pmb_mysql_query($req, $dbh);
     $liste = "";
     if (pmb_mysql_num_rows($res)) {
         $parity = 1;
         while ($dmde = pmb_mysql_fetch_object($res)) {
             $dmde = new demandes($dmde->id_demande);
             if ($parity % 2) {
                 $pair_impair = "even";
             } else {
                 $pair_impair = "odd";
             }
             $parity += 1;
             $tr_javascript = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" ";
             $action = "onclick=\"document.location='./demandes.php?categ=gestion&act=see_dmde&iddemande=" . $dmde->id_demande;
             //Ajout des éléments de retour vers la bonne liste
             if ($idetat) {
                 $action .= "&idetat=" . $idetat;
             }
             if ($iduser) {
                 $action .= "&iduser="******"&idempr=" . $idempr;
             }
             if ($user_input) {
                 $action .= "&user_input=" . $user_input;
             }
             if ($date_debut) {
                 $action .= "&date_debut=" . $date_debut;
             }
             if ($date_fin) {
                 $action .= "&date_fin=" . $date_fin;
             }
             if ($id_type) {
                 $action .= "&id_type=" . $id_type;
             }
             if ($id_theme) {
                 $action .= "&id_theme=" . $id_theme;
             }
             if ($dmde_loc) {
                 $action .= "&dmde_loc=" . $dmde_loc;
             }
             $action .= "'\"";
             // affichage en gras si nouveauté du côté des notes ou des actions
             $dmde->dmde_read_gestion = demandes::dmde_majRead($dmde->id_demande, "_gestion");
             if ($dmde->dmde_read_gestion == 1) {
                 $style = " style='cursor: pointer; font-weight:bold'";
             } else {
                 $style = " style='cursor: pointer'";
             }
             $liste .= "<tr id='dmde" . $dmde->id_demande . "' class='" . $pair_impair . "' " . $tr_javascript . $style . "  >";
             $carac_empr = $dmde->getCaracEmpr($dmde->num_demandeur);
             $nom_empr = $carac_empr['nom'];
             $nom_user = '';
             if (sizeof($dmde->users)) {
                 foreach ($dmde->users as $id => $user) {
                     if ($user['statut'] == 1) {
                         if ($nom_user) {
                             $nom_user .= "/ ";
                         }
                         $nom_user .= $user['nom'];
                     }
                 }
             }
             $liste .= "<td><img hspace=\"3\" border=\"0\" onclick=\"expand_action('action" . $dmde->id_demande . "','{$dmde->id_demande}', true); return false;\" title=\"\" id=\"action" . $dmde->id_demande . "Img\" name=\"imEx\" class=\"img_plus\" src=\"./images/plus.gif\"></td>";
             $liste .= "<td>";
             if ($dmde->dmde_read_gestion == 1) {
                 // remplacer $action le jour où on décide d'activer la modif d'état manuellement par onclick=\"change_read_dmde('dmde".$dmde->id_demande."','$dmde->id_demande', true); return false;\"
                 $liste .= "<img hspace=\"3\" border=\"0\" title=\"\" " . $action . " id=\"dmde" . $dmde->id_demande . "Img1\" name=\"imRead\" class=\"img_plus\" src=\"./images/notification_empty.png\" style='display:none'>\n\t\t\t\t\t\t\t\t<img hspace=\"3\" border=\"0\" title=\"\" " . $action . " id=\"dmde" . $dmde->id_demande . "Img2\" name=\"imRead\" class=\"img_plus\" src=\"./images/notification_new.png\">";
             } else {
                 // remplacer $action le jour où on décide d'activer la modif d'état manuellement par onclick=\"change_read_dmde('dmde".$dmde->id_demande."','$dmde->id_demande', true); return false;\"
                 $liste .= "<img hspace=\"3\" border=\"0\" title=\"\" " . $action . " id=\"dmde" . $dmde->id_demande . "Img1\" name=\"imRead\" class=\"img_plus\" src=\"./images/notification_empty.png\" >\n\t\t\t\t\t\t\t\t<img hspace=\"3\" border=\"0\" title=\"\" " . $action . " id=\"dmde" . $dmde->id_demande . "Img2\" name=\"imRead\" class=\"img_plus\" src=\"./images/notification_new.png\" style='display:none'>";
             }
             $liste .= "\n\t\t\t\t\t</td>\n\t\t\t\t\t<td {$action}>" . htmlentities($themes->getLabel($dmde->theme_demande), ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t<td {$action}>" . htmlentities($types->getLabel($dmde->type_demande), ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t<td {$action}>" . htmlentities($dmde->titre_demande, ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t<td {$action}>" . htmlentities($dmde->workflow->getStateCommentById($dmde->etat_demande), ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t<td {$action}>" . htmlentities(formatdate($dmde->date_demande), ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t<td {$action}>" . htmlentities(formatdate($dmde->date_prevue), ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t<td {$action}>" . htmlentities(formatdate($dmde->deadline_demande), ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t<td {$action}>" . htmlentities($nom_empr, ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t<td {$action}>" . htmlentities($nom_user, ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t<td><span id='progressiondemande_" . $dmde->id_demande . "'  dynamics='demandes,progressiondemande' dynamics_params='img/img' >\n\t\t\t\t\t\t<img src=\"./images/jauge.png\" height='15px' width=\"" . $dmde->progression . "%\" title='" . $dmde->progression . "%' />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</td>";
             $perso_ = $p_perso->show_fields($dmde->id_demande);
             for ($i = 0; $i < count($perso_["FIELDS"]); $i++) {
                 $p = $perso_["FIELDS"][$i];
                 $liste .= "<td>" . nl2br($p["AFF"]) . "</td>";
             }
             if ($dmde->num_notice) {
                 $liste .= "<td><a href='./catalog.php?categ=isbd&id={$dmde->num_notice}'><img border='0' align='middle' src='./images/notice.gif' alt='" . htmlentities($msg['demandes_see_notice'], ENT_QUOTES, $charset) . "' title='" . htmlentities($msg['demandes_see_notice'], ENT_QUOTES, $charset) . "'></a></td>";
             } else {
                 $liste .= "<td></td>";
             }
             $liste .= "<td ><input type='checkbox' id='chk[" . $dmde->id_demande . "]' name='chk[]' value='" . $dmde->id_demande . "'></td>";
             $liste .= "</tr>";
             //Le détail de l'action, contient les notes
             $liste .= "<tr id=\"action" . $dmde->id_demande . "Child\" style=\"display:none\">\r\n\t\t\t\t<td></td>\r\n\t\t\t\t<td colspan=\"" . ($nb_cp_column + 13) . "\" id=\"action" . $dmde->id_demande . "ChildTd\">";
             $liste .= "</td>\r\n\t\t\t\t</tr>";
         }
         $btn_suppr = "<input type='submit' class='bouton' value='{$msg['63']}' onclick='this.form.act.value=\"suppr_noti\"; return verifChk(\"suppr\");'/>";
         //afficher la liste des boutons de changement d'état
         if ($idetat) {
             $states = $this->workflow->getStateList($idetat);
             $states_btn = $this->getDisplayStateBtn($states, 1);
         }
         $affectation_btn = "";
         if ($iduser == -1) {
             $affectation_btn = "<input type='submit' class='bouton' name='affect_btn' id='affect_btn' onclick='this.form.act.value=\"affecter\";return verifChk();' value='" . htmlentities($msg['demandes_attribution_checked'], ENT_QUOTES, $charset) . "' />&nbsp;" . $this->getUsersSelector();
         }
     } else {
         $liste .= "<tr><td>" . $msg['demandes_liste_vide'] . "</td></tr>";
     }
     $form_liste_demande = str_replace('!!header_champs_perso!!', $header_champs_perso, $form_liste_demande);
     $form_liste_demande = str_replace('!!btn_etat!!', $states_btn, $form_liste_demande);
     $form_liste_demande = str_replace('!!btn_attribue!!', $affectation_btn, $form_liste_demande);
     $form_liste_demande = str_replace('!!btn_suppr!!', $btn_suppr, $form_liste_demande);
     $form_liste_demande = str_replace('!!liste_dmde!!', $liste, $form_liste_demande);
     print $form_liste_demande;
 }