示例#1
0
 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";
     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 = 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 = 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);
     print $form_filtre_demande;
     //Formulaire de la liste
     $req = $this->getQueryFilter($idetat, $iduser, $idempr, $user_input, $date_debut, $date_fin, $id_theme, $id_type, $dmde_loc);
     $res = mysql_query($req, $dbh);
     $liste = "";
     if (mysql_num_rows($res)) {
         $parity = 1;
         while ($dmde = mysql_fetch_object($res)) {
             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 . "'";
             $liste .= "<tr class='" . $pair_impair . "' " . $tr_javascript . " style='cursor: pointer'  >";
             $carac_empr = $this->getCaracEmpr($dmde->num_demandeur);
             $nom_empr = $carac_empr['nom'];
             $liste .= "\n\t\t\t\t\t<td {$action}>" . htmlentities($dmde->libelle_theme, ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t<td {$action}>" . htmlentities($dmde->libelle_type, 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($this->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($dmde->nom, 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>";
             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>";
         }
         $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('!!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;
 }
示例#2
0
 function show_modif_form()
 {
     global $form_modif_demande, $msg, $charset, $id_empr, $form_linked_record, $opac_demandes_allow_from_record;
     $themes = new demandes_themes('demandes_theme', 'id_theme', 'libelle_theme', $this->theme_demande);
     $types = new demandes_types('demandes_type', 'id_type', 'libelle_type', $this->type_demande);
     if (!$this->id_demande) {
         $form_modif_demande = str_replace('!!form_title!!', htmlentities($msg['demandes_creation'], ENT_QUOTES, $charset), $form_modif_demande);
         $form_modif_demande = str_replace('!!sujet!!', '', $form_modif_demande);
         $form_modif_demande = str_replace('!!progression!!', '', $form_modif_demande);
         $form_modif_demande = str_replace('!!empr_txt!!', '', $form_modif_demande);
         $form_modif_demande = str_replace('!!idempr!!', $id_empr, $form_modif_demande);
         $form_modif_demande = str_replace('!!iduser!!', "", $form_modif_demande);
         $form_modif_demande = str_replace('!!titre!!', '', $form_modif_demande);
         $etat = $this->getStateValue();
         $form_modif_demande = str_replace('!!idetat!!', $etat['id'], $form_modif_demande);
         $form_modif_demande = str_replace('!!value_etat!!', $etat['comment'], $form_modif_demande);
         $form_modif_demande = str_replace('!!select_theme!!', $themes->getListSelector(), $form_modif_demande);
         $form_modif_demande = str_replace('!!select_type!!', $types->getListSelector(), $form_modif_demande);
         $date = formatdate(today());
         $date_debut = date("Y-m-d", time());
         $date_dmde = "<input type='button' class='bouton' id='date_debut_btn' name='date_debut_btn' value='!!date_debut_btn!!' \n\t\t\t\tonClick=\"openPopUp('./select.php?what=calendrier&caller=modif_dmde&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')\"/>";
         $form_modif_demande = str_replace('!!date_demande!!', $date_dmde, $form_modif_demande);
         $form_modif_demande = str_replace('!!date_fin_btn!!', $date, $form_modif_demande);
         $form_modif_demande = str_replace('!!date_debut_btn!!', $date, $form_modif_demande);
         $form_modif_demande = str_replace('!!date_debut!!', $date_debut, $form_modif_demande);
         $form_modif_demande = str_replace('!!date_fin!!', $date_debut, $form_modif_demande);
         $form_modif_demande = str_replace('!!date_prevue!!', $date_debut, $form_modif_demande);
         $form_modif_demande = str_replace('!!date_prevue_btn!!', $date, $form_modif_demande);
         $form_modif_demande = str_replace('!!iddemande!!', '', $form_modif_demande);
         $form_modif_demande = str_replace("!!form_linked_record!!", "", $form_modif_demande);
     } else {
         $btn_suppr = "<input type='submit' class='bouton' value='{$msg['63']}' onclick='this.form.act.value=\"suppr\"; return confirm_delete();' />";
         $form_modif_demande = str_replace('!!form_title!!', htmlentities(sprintf($msg['demandes_modification'], ' : ' . $this->titre_demande), ENT_QUOTES, $charset), $form_modif_demande);
         $form_modif_demande = str_replace('!!titre!!', htmlentities($this->titre_demande, ENT_QUOTES, $charset), $form_modif_demande);
         $form_modif_demande = str_replace('!!sujet!!', htmlentities($this->sujet_demande, ENT_QUOTES, $charset), $form_modif_demande);
         $form_modif_demande = str_replace('!!progression!!', htmlentities($this->progression, ENT_QUOTES, $charset), $form_modif_demande);
         $etat = $this->getStateValue($this->etat_demande);
         $form_modif_demande = str_replace('!!idetat!!', $etat['id'], $form_modif_demande);
         $form_modif_demande = str_replace('!!value_etat!!', $etat['comment'], $form_modif_demande);
         $form_modif_demande = str_replace('!!idempr!!', $this->num_demandeur, $form_modif_demande);
         $form_modif_demande = str_replace('!!titre!!', $this->titre_demande, $form_modif_demande);
         $form_modif_demande = str_replace('!!iduser!!', $this->num_user, $form_modif_demande);
         $form_modif_demande = str_replace('!!select_theme!!', $themes->getListSelector($this->theme_demande), $form_modif_demande);
         $form_modif_demande = str_replace('!!select_type!!', $types->getListSelector($this->type_demande), $form_modif_demande);
         $form_modif_demande = str_replace('!!date_fin_btn!!', formatdate($this->deadline_demande), $form_modif_demande);
         $form_modif_demande = str_replace('!!date_demande!!', formatdate($this->date_demande), $form_modif_demande);
         $form_modif_demande = str_replace('!!date_debut!!', htmlentities($this->date_demande, ENT_QUOTES, $charset), $form_modif_demande);
         $form_modif_demande = str_replace('!!date_fin!!', htmlentities($this->deadline_demande, ENT_QUOTES, $charset), $form_modif_demande);
         $form_modif_demande = str_replace('!!date_prevue_btn!!', formatdate($this->date_prevue), $form_modif_demande);
         $form_modif_demande = str_replace('!!date_prevue!!', htmlentities($this->date_prevue, ENT_QUOTES, $charset), $form_modif_demande);
         $form_modif_demande = str_replace('!!iddemande!!', $this->id_demande, $form_modif_demande);
         if ($opac_demandes_allow_from_record && $this->num_linked_notice) {
             $record_datas = record_display::get_record_datas($this->num_linked_notice);
             $form_modif_demande = str_replace("!!form_linked_record!!", $form_linked_record, $form_modif_demande);
             $form_modif_demande = str_replace("!!linked_record!!", htmlentities($record_datas->get_tit1(), ENT_QUOTES, $charset), $form_modif_demande);
             $form_modif_demande = str_replace("!!linked_record_id!!", htmlentities($this->num_linked_notice, ENT_QUOTES, $charset), $form_modif_demande);
             $form_modif_demande = str_replace("!!linked_record_link!!", htmlentities($record_datas->get_permalink(), ENT_QUOTES, $charset), $form_modif_demande);
         } else {
             $form_modif_demande = str_replace("!!form_linked_record!!", "", $form_modif_demande);
         }
     }
     $act_cancel = "document.location='./empr.php?tab=request&lvl=list_dmde'";
     $act_form = "./empr.php?tab=request&lvl=list_dmde&sub=save_demande";
     $form_modif_demande = str_replace('!!form_action!!', $act_form, $form_modif_demande);
     $form_modif_demande = str_replace('!!cancel_action!!', $act_cancel, $form_modif_demande);
     print $form_modif_demande;
 }
示例#3
0
 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;
 }
示例#4
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: theme.inc.php,v 1.1 2009-10-01 13:29:24 kantin Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $class_path . "/liste_simple.class.php";
$dmd_type = new demandes_themes("demandes_theme", "id_theme", "libelle_theme", $id_liste);
$dmd_type->proceed($act);
示例#5
0
// modules propres à demandes.php ou à ses sous-modules
require "{$include_path}/templates/demandes.tpl.php";
require "{$include_path}/templates/demandes_actions.tpl.php";
require "{$include_path}/templates/demandes_notes.tpl.php";
require_once $class_path . "/liste_simple.class.php";
print "<div id='att' style='z-Index:1000'></div>";
print $menu_bar;
print $extra;
print $extra2;
print $extra_info;
if ($use_shortcuts) {
    include "{$include_path}/shortcuts/circ.sht";
}
echo window_title($database_window_title . $msg[demandes_menu] . $msg[1003] . $msg[1001]);
print $demandes_layout;
$nb_themes = demandes_themes::get_qty();
$nb_types = demandes_types::get_qty();
if (!$nb_themes || !$nb_types) {
    //Pas de themes ou de types définis
    $error_msg .= htmlentities($msg["demandes_err_theme_type"], ENT_QUOTES, $charset) . "<div class='row'></div>";
    error_message($msg[321], $error_msg . htmlentities($msg["demandes_err_par"], ENT_QUOTES, $charset), '1', './admin.php?categ=demandes');
} else {
    switch ($categ) {
        case 'gestion':
            include "./demandes/demandes.inc.php";
            break;
        case 'list':
            include "./demandes/demandes_liste.inc.php";
            break;
        case 'action':
            include "./demandes/demandes_actions.inc.php";
 public static function get_display_demand($notice_id)
 {
     global $msg, $include_path, $form_modif_demande, $form_linked_record, $demandes_active, $opac_demandes_allow_from_record;
     if ($demandes_active && $opac_demandes_allow_from_record && $_SESSION['id_empr_session']) {
         $record_datas = static::get_record_datas($notice_id);
         $demande = new demandes();
         $themes = new demandes_themes('demandes_theme', 'id_theme', 'libelle_theme', $demande->theme_demande);
         $types = new demandes_types('demandes_type', 'id_type', 'libelle_type', $demande->type_demande);
         $f_modif_demande = $form_modif_demande;
         $f_modif_demande = str_replace('!!form_title!!', htmlentities($msg['demandes_creation'], ENT_QUOTES, $charset), $f_modif_demande);
         $f_modif_demande = str_replace('!!sujet!!', '', $f_modif_demande);
         $f_modif_demande = str_replace('!!progression!!', '', $f_modif_demande);
         $f_modif_demande = str_replace('!!empr_txt!!', '', $f_modif_demande);
         $f_modif_demande = str_replace('!!idempr!!', $_SESSION['id_empr_session'], $f_modif_demande);
         $f_modif_demande = str_replace('!!iduser!!', "", $f_modif_demande);
         $f_modif_demande = str_replace('!!titre!!', '', $f_modif_demande);
         $etat = $demande->getStateValue();
         $f_modif_demande = str_replace('!!idetat!!', $etat['id'], $f_modif_demande);
         $f_modif_demande = str_replace('!!value_etat!!', $etat['comment'], $f_modif_demande);
         $f_modif_demande = str_replace('!!select_theme!!', $themes->getListSelector(), $f_modif_demande);
         $f_modif_demande = str_replace('!!select_type!!', $types->getListSelector(), $f_modif_demande);
         $date = formatdate(today());
         $date_debut = date("Y-m-d", time());
         $date_dmde = "<input type='button' class='bouton' id='date_debut_btn' name='date_debut_btn' value='!!date_debut_btn!!'\n\t\t\t\t\tonClick=\"openPopUp('./select.php?what=calendrier&caller=modif_dmde&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')\"/>";
         $f_modif_demande = str_replace('!!date_demande!!', $date_dmde, $f_modif_demande);
         $f_modif_demande = str_replace('!!date_fin_btn!!', $date, $f_modif_demande);
         $f_modif_demande = str_replace('!!date_debut_btn!!', $date, $f_modif_demande);
         $f_modif_demande = str_replace('!!date_debut!!', $date_debut, $f_modif_demande);
         $f_modif_demande = str_replace('!!date_fin!!', $date_debut, $f_modif_demande);
         $f_modif_demande = str_replace('!!date_prevue!!', $date_debut, $f_modif_demande);
         $f_modif_demande = str_replace('!!date_prevue_btn!!', $date, $f_modif_demande);
         $f_modif_demande = str_replace('!!iddemande!!', '', $f_modif_demande);
         $f_modif_demande = str_replace('!!form_linked_record!!', $form_linked_record, $f_modif_demande);
         $f_modif_demande = str_replace('!!linked_record!!', $record_datas->get_tit1(), $f_modif_demande);
         $f_modif_demande = str_replace("!!linked_record_id!!", $notice_id, $f_modif_demande);
         $f_modif_demande = str_replace("!!linked_record_link!!", $record_datas->get_permalink(), $f_modif_demande);
         $act_cancel = "demandDialog_" . $notice_id . ".hide();";
         $act_form = "./empr.php?tab=request&lvl=list_dmde&sub=save_demande";
         $f_modif_demande = str_replace('!!form_action!!', $act_form, $f_modif_demande);
         $f_modif_demande = str_replace('!!cancel_action!!', $act_cancel, $f_modif_demande);
         // Requires et début de formulaire
         $html = "\n\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\trequire(['dojo/parser', 'dijit/Dialog']);\n\t\t\t\t\t\tdocument.body.setAttribute('class', 'tundra');\n\t\t\t\t\t</script>\n\t\t\t\t\t<div data-dojo-type='dijit/Dialog' data-dojo-id='demandDialog_" . $notice_id . "' title='" . $msg['do_demande_on_record'] . "' style='display:none;width:75%;'>\n\t\t\t\t\t\t" . $f_modif_demande . "\n\t\t\t\t\t</div>\n\t\t\t\t\t<a href='#' onClick='demandDialog_" . $notice_id . ".show();return false;'>\n\t\t\t\t\t\t" . $msg['do_demande_on_record'] . "\n\t\t\t\t\t</a>";
         return $html;
     }
     return "";
 }