Exemplo n.º 1
0
 function get_form()
 {
     global $groupexpl_form_tpl, $msg, $charset;
     global $pmb_lecteurs_localises, $deflt_docs_location;
     global $groupexpl_form_list_line_tpl;
     $tpl = $groupexpl_form_tpl;
     if ($this->id) {
         $tpl = str_replace('!!msg_title!!', $msg['groupexpl_form_edit'], $tpl);
         $tpl = str_replace('!!delete!!', "<input type='button' class='bouton' value='" . $msg['admin_mailtpl_delete'] . "'  onclick=\"document.getElementById('action').value='delete';this.form.submit();\"  />", $tpl);
         $tpl = str_replace('!!see_button!!', "<input type='button' class='bouton' value='" . $msg['groupexpl_list_see'] . "' onClick=\"document.location='./circ.php?categ=groupexpl&action=see_form&id=!!id!!'\">", $tpl);
     } else {
         $tpl = str_replace('!!msg_title!!', $msg['groupexpl_form_add'], $tpl);
         $tpl = str_replace('!!delete!!', "", $tpl);
         $tpl = str_replace('!!see_button!!', "", $tpl);
     }
     $tpl = str_replace('!!statut_principal!!', do_selector('docs_statut', 'statut_principal', $this->info['statut_principal']), $tpl);
     $tpl = str_replace('!!statut_others!!', do_selector('docs_statut', 'statut_others', $this->info['statut_others']), $tpl);
     if ($pmb_lecteurs_localises) {
         if (!$this->info['location']) {
             $f_loc = $deflt_docs_location;
         } else {
             $f_loc = $this->info['location'];
         }
         $loc_select .= "\n\t\t\t<div class='row'>\n\t\t\t\t<label class='etiquette' for='name'>" . $msg['groupexpl_form_location'] . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\t\n\t\t\t\t<select name='f_loc' >";
         $res = mysql_query("SELECT idlocation, location_libelle FROM docs_location order by location_libelle");
         $loc_select .= "<option value='0'>" . $msg["all_location"] . "</option>";
         while ($value = mysql_fetch_array($res)) {
             $loc_select .= "<option value='" . $value[0] . "'";
             if ($value[0] == $f_loc) {
                 $loc_select .= " selected ";
             }
             $loc_select .= ">" . htmlentities($value[1], ENT_QUOTES, $charset) . "</option>";
         }
         $loc_select .= "\n\t\t\t\t</select>\n\t\t\t</div>";
     }
     $items = "";
     foreach ($this->info['expl'] as $expl) {
         $item = $groupexpl_form_list_line_tpl;
         $item = str_replace('!!cb!!', $expl['cb'], $item);
         if ($expl['checked']) {
             $checked = "x";
         } else {
             $checked = "";
         }
         $item = str_replace('!!checked!!', $checked, $item);
         if ($expl['id'] == $this->info['resp_expl_num']) {
             $item = str_replace('!!resp_expl_num_checked!!', "checked='checked'", $item);
         } else {
             $item = str_replace('!!resp_expl_num_checked!!', "", $item);
         }
         $item = str_replace('!!expl_num!!', $expl['id'], $item);
         $item = $this->get_expl_display($item, $expl['id']);
         $items .= $item;
     }
     $tpl = str_replace('!!error_message!!', htmlentities($this->error_message, ENT_QUOTES, $charset), $tpl);
     $tpl = str_replace('!!info_message!!', htmlentities($this->info_message, ENT_QUOTES, $charset), $tpl);
     $tpl = str_replace('!!location!!', $loc_select, $tpl);
     $tpl = str_replace('!!expl_list!!', $items, $tpl);
     $tpl = str_replace('!!name!!', htmlentities($this->info['name'], ENT_QUOTES, $charset), $tpl);
     $tpl = str_replace('!!comment!!', htmlentities($this->info['comment'], ENT_QUOTES, $charset), $tpl);
     $tpl = str_replace('!!id!!', $this->id, $tpl);
     return $tpl;
 }
Exemplo n.º 2
0
    }
    if ($f_user_input && !$user_input) {
        $user_input = $f_user_input;
    }
}
// affichage des membres de la page
if ($bt_ajouter == "no") {
    $bouton_ajouter = "";
} else {
    $bouton_ajouter = "<input type='button' class='bouton_small' onclick=\"document.location='{$base_url}&action=add&deb_rech='+this.form.f_user_input.value\" value=\"" . $msg["groupexpl_create_button"] . "\" />";
}
switch ($action) {
    case 'add':
        $groupexpl_form = str_replace("!!deb_saisie!!", htmlentities(stripslashes($f_user_input), ENT_QUOTES, $charset), $groupexpl_form);
        $groupexpl_form = str_replace('!!statut_principal!!', do_selector('docs_statut', 'statut_principal', ""), $groupexpl_form);
        $groupexpl_form = str_replace('!!statut_others!!', do_selector('docs_statut', 'statut_others', ""), $groupexpl_form);
        if ($pmb_lecteurs_localises) {
            $f_loc = $deflt_docs_location;
            $loc_select .= "\n\t\t\t<div class='row'>\n\t\t\t\t<label class='etiquette' for='name'>" . $msg['groupexpl_form_location'] . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<select name='f_loc' >";
            $res = pmb_mysql_query("SELECT idlocation, location_libelle FROM docs_location order by location_libelle", $dbh);
            $loc_select .= "<option value='0'>" . $msg["all_location"] . "</option>";
            while ($value = pmb_mysql_fetch_array($res)) {
                $loc_select .= "<option value='" . $value[0] . "'";
                if ($value[0] == $f_loc) {
                    $loc_select .= " selected ";
                }
                $loc_select .= ">" . htmlentities($value[1], ENT_QUOTES, $charset) . "</option>";
            }
            $loc_select .= "\n\t\t\t\t</select>\n\t\t\t</div>";
        }
        $groupexpl_form = str_replace('!!location!!', $loc_select, $groupexpl_form);
function bul_do_form($obj)
{
    // $obj = objet contenant les propriétés de l'exemplaire associé
    global $bul_expl_form1, $expl_bulletinage_tpl;
    global $msg;
    // pour texte du bouton supprimer
    global $dbh, $charset;
    global $pmb_type_audit, $select_categ_prop, $pmb_antivol;
    global $id_bull, $bul_id, $serial_id, $numero, $pmb_rfid_activate, $pmb_rfid_serveur_url;
    global $deflt_explnum_statut;
    if (!$obj->abt_numeric) {
        $bul_expl_form1 = str_replace('!!expl_bulletinage_tpl!!', $expl_bulletinage_tpl, $bul_expl_form1);
    } else {
        $bul_expl_form1 = str_replace('!!expl_bulletinage_tpl!!', "", $bul_expl_form1);
    }
    $action = "./pointage_exemplarise.php?act=update&id_bull={$id_bull}&bul_id={$bul_id}";
    // statut
    $select_statut = gen_liste_multiple("select id_explnum_statut, gestion_libelle from explnum_statut order by 2", "id_explnum_statut", "gestion_libelle", "id_explnum_statut", "f_explnum_statut", "", $deflt_explnum_statut, "", "", "", "", 0);
    $bul_expl_form1 = str_replace('!!statut_list!!', $select_statut, $bul_expl_form1);
    // mise à jour des champs de gestion
    $bul_expl_form1 = str_replace('!!bul_id!!', $obj->expl_bulletin, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!id_form!!', md5(microtime()), $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!org_cb!!', $obj->expl_cb, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!expl_id!!', $obj->expl_id, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!action!!', $action, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!id!!', $obj->expl_notice, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!cb!!', $obj->expl_cb, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!note!!', $obj->expl_note, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!comment!!', $obj->expl_comment, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!cote!!', htmlentities($obj->expl_cote, ENT_QUOTES, $charset), $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!prix!!', $obj->expl_prix, $bul_expl_form1);
    if (!$obj->abt_numeric) {
        $bul_expl_form1 = str_replace('!!focus!!', $obj->focus, $bul_expl_form1);
    } else {
        $bul_expl_form1 = str_replace('!!focus!!', "", $bul_expl_form1);
    }
    // select "type document"
    $bul_expl_form1 = str_replace('!!type_doc!!', do_selector('docs_type', 'expl_typdoc', $obj->expl_typdoc), $bul_expl_form1);
    // select "section"
    $bul_expl_form1 = str_replace('!!section!!', do_selector_bul_section($obj->expl_section, $obj->expl_location), $bul_expl_form1);
    // select "statut"
    $bul_expl_form1 = str_replace('!!statut!!', do_selector('docs_statut', 'expl_statut', $obj->expl_statut), $bul_expl_form1);
    // select "localisation"
    $bul_expl_form1 = str_replace('!!localisation!!', gen_liste("select distinct idlocation, location_libelle from docs_location, docsloc_section where num_location=idlocation order by 2", "idlocation", "location_libelle", 'expl_location', "calcule_section(this);", $obj->expl_location, "", "", "", "", 0), $bul_expl_form1);
    // select "code statistique"
    $bul_expl_form1 = str_replace('!!codestat!!', do_selector('docs_codestat', 'expl_codestat', $obj->expl_codestat), $bul_expl_form1);
    // select "owner"
    $bul_expl_form1 = str_replace('!!owner!!', do_selector('lenders', 'expl_owner', $obj->expl_owner), $bul_expl_form1);
    $selector = "";
    if ($pmb_antivol > 0) {
        // select "type_antivol"
        $selector = "\n\t\t<div class='colonne3'>\n\t\t<!-- code stat -->\n\t\t<label class='etiquette' for='type_antivol'>{$msg['type_antivol']}</label>\n\t\t<div class='row'>\n\t\t<select name='type_antivol' id='type_antivol'>";
        $selector .= "<option value='0'";
        if ($obj->type_antivol == 0) {
            $selector .= ' SELECTED';
        }
        $selector .= '>';
        $selector .= $msg["type_antivol_aucun"] . '</option>';
        $selector .= "<option value='1'";
        if ($obj->type_antivol == 1) {
            $selector .= ' SELECTED';
        }
        $selector .= '>';
        $selector .= $msg["type_antivol_magnetique"] . '</option>';
        $selector .= "<option value='2'";
        if ($obj->type_antivol == 2) {
            $selector .= ' SELECTED';
        }
        $selector .= '>';
        $selector .= $msg["type_antivol_autre"] . '</option>';
        $selector .= '</select></div></div>';
    }
    $bul_expl_form1 = str_replace('!!type_antivol!!', $selector, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!bul_id!!', $bul_id, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!expl_id!!', $obj->expl_id, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!bul_no!!', htmlentities($obj->bul_no, ENT_QUOTES, $charset), $bul_expl_form1);
    $date_date_formatee = formatdate_input($obj->date_date);
    $date_clic = "onClick=\"openPopUp('./../../../select.php?what=calendrier&caller=expl&date_caller=" . str_replace('-', '', $obj->date_date) . "&param1=date_date&param2=date_date_lib&auto_submit=NO&date_anterieure=YES', 'date_date', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\"  ";
    $date_date = "<input type='hidden' name='date_date' value='" . str_replace('-', '', $obj->date_date) . "' />\n\t\t<input class='saisie-10em' type='text' name='date_date_lib' value='" . $date_date_formatee . "' placeholder='" . $msg["format_date_input_placeholder"] . "'/>\n\t\t<input class='bouton_small' type='button' name='date_date_lib_bouton' value='" . $msg["bouton_calendrier"] . "' " . $date_clic . " />";
    $bul_expl_form1 = str_replace('!!date_date!!', $date_date, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!bul_date!!', htmlentities($obj->bul_date, ENT_QUOTES, $charset), $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!bul_titre!!', htmlentities($obj->bul_titre, ENT_QUOTES, $charset), $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!serial_id!!', $serial_id, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!numero!!', $obj->bul_titre, $bul_expl_form1);
    $bul_expl_form1 = str_replace('!!destinataire!!', $obj->destinataire, $bul_expl_form1);
    $p_perso = new parametres_perso("expl");
    if (!$p_perso->no_special_fields) {
        $c = 0;
        $perso = "";
        $perso_ = $p_perso->show_editable_fields($obj->expl_id);
        for ($i = 0; $i < count($perso_["FIELDS"]); $i++) {
            $p = $perso_["FIELDS"][$i];
            if ($c == 0) {
                $perso .= "<div class='row'>\n";
            }
            $perso .= "<div class='colonne3'><label for='" . $p["NAME"] . "' class='etiquette'>" . $p["TITRE"] . " </label>" . $p["COMMENT_DISPLAY"] . "<div class='row'>" . $p["AFF"] . "</div></div>\n";
            $c++;
            if ($c == 3) {
                $perso .= "</div>\n";
                $c = 0;
            }
        }
        if ($c == 1) {
            $perso .= "<div class='colonne2'>&nbsp;</div>\n</div>\n";
        }
        $perso = $perso_["CHECK_SCRIPTS"] . "\n" . $perso;
    } else {
        $perso = "\n<script>function check_form() { return true; }</script>\n";
    }
    $bul_expl_form1 = str_replace("!!champs_perso!!", $perso, $bul_expl_form1);
    if ($pmb_rfid_activate == 1 && $pmb_rfid_serveur_url && !$obj->abt_numeric) {
        $script_rfid_encode = "if(script_rfid_encode()==false) return false;";
        $bul_expl_form1 = str_replace('!!questionrfid!!', $script_rfid_encode, $bul_expl_form1);
    } else {
        $bul_expl_form1 = str_replace('!!questionrfid!!', '', $bul_expl_form1);
    }
    $bul_expl_form1 = str_replace('!!create_notice_bul!!', '<input type="checkbox" value="1" id="create_notice_bul" name="create_notice_bul">&nbsp;' . $msg['bulletinage_create_notice'], $bul_expl_form1);
    return $bul_expl_form1;
}
Exemplo n.º 4
0
 function fill_form(&$form, $action)
 {
     global $charset;
     global $msg;
     global $pmb_antivol;
     global $option_num_auto;
     global $dbh;
     global $pmb_expl_show_dates;
     global $thesaurus_concepts_active;
     if (isset($option_num_auto)) {
         $requete = "DELETE from exemplaires_temp where sess not in (select SESSID from sessions)";
         pmb_mysql_query($requete, $dbh);
         //Appel à la fonction de génération automatique de cb
         $code_exemplaire = init_gen_code_exemplaire($this->id_notice, $this->id_bulletin);
         do {
             $code_exemplaire = gen_code_exemplaire($this->id_notice, $this->id_bulletin, $code_exemplaire);
             $requete = "select expl_cb from exemplaires WHERE expl_cb='{$code_exemplaire}'";
             $res0 = pmb_mysql_query($requete, $dbh);
             $requete = "select cb from exemplaires_temp WHERE cb='{$code_exemplaire}' AND sess <>'" . SESSid . "'";
             $res1 = pmb_mysql_query($requete, $dbh);
         } while (pmb_mysql_num_rows($res0) || pmb_mysql_num_rows($res1));
         //Memorise dans temps le cb et la session pour le cas de multi utilisateur session
         $this->cb = $code_exemplaire;
         $requete = "INSERT INTO exemplaires_temp (cb ,sess) VALUES ('{$this->cb}','" . SESSid . "')";
         pmb_mysql_query($requete, $dbh);
     }
     $form = str_replace('!!action!!', $action, $form);
     if ($this->id_notice) {
         $form = str_replace('!!id!!', $this->id_notice, $form);
     } else {
         $form = str_replace('!!id!!', $this->id_bulletin, $form);
     }
     $form = str_replace('!!cb!!', htmlentities($this->cb, ENT_QUOTES, $charset), $form);
     $form = str_replace('!!nbparts!!', htmlentities($this->nbparts, ENT_QUOTES, $charset), $form);
     $form = str_replace('!!note!!', htmlentities($this->note, ENT_QUOTES, $charset), $form);
     $form = str_replace('!!comment!!', htmlentities($this->expl_comment, ENT_QUOTES, $charset), $form);
     if ($this->id_notice) {
         $form = str_replace('!!cote!!', htmlentities(prefill_cote($this->id_notice, $this->cote), ENT_QUOTES, $charset), $form);
     } else {
         $form = str_replace('!!cote!!', htmlentities(prefill_cote($this->id_bulletin_notice, $this->cote), ENT_QUOTES, $charset), $form);
     }
     $form = str_replace('!!prix!!', htmlentities($this->prix, ENT_QUOTES, $charset), $form);
     // select "type document"
     $form = str_replace('!!type_doc!!', do_selector('docs_type', 'f_ex_typdoc', $this->typdoc_id), $form);
     // select "section"
     $form = str_replace('!!section!!', $this->do_selector(), $form);
     // select "statut"
     $form = str_replace('!!statut!!', do_selector('docs_statut', 'f_ex_statut', $this->statut_id), $form);
     // select "localisation"
     //visibilité des exemplaires
     global $explr_visible_mod, $pmb_droits_explr_localises;
     if ($pmb_droits_explr_localises) {
         $where_clause_explr = "idlocation in (" . $explr_visible_mod . ") and";
     }
     $form = str_replace('!!localisation!!', gen_liste("select distinct idlocation, location_libelle from docs_location, docsloc_section where {$where_clause_explr} num_location=idlocation order by 2 ", "idlocation", "location_libelle", 'f_ex_location', "calcule_section(this);", $this->location_id, "", "", "", "", 0), $form);
     // select "code statistique"
     $form = str_replace('!!codestat!!', do_selector('docs_codestat', 'f_ex_cstat', $this->codestat_id), $form);
     if ($pmb_antivol) {
         global $value_deflt_antivol;
         if ($this->type_antivol == "") {
             $this->type_antivol = $value_deflt_antivol;
         }
         // select "type_antivol"
         $selector = "<select name='type_antivol' id='type_antivol'>";
         $selector .= "<option value='0'";
         if ($this->type_antivol == 0) {
             $selector .= ' selected="selected"';
         }
         $selector .= '>';
         $selector .= $msg["type_antivol_aucun"] . '</option>';
         $selector .= "<option value='1'";
         if ($this->type_antivol == 1) {
             $selector .= ' selected="selected"';
         }
         $selector .= '>';
         $selector .= $msg["type_antivol_magnetique"] . '</option>';
         $selector .= "<option value='2'";
         if ($this->type_antivol == 2) {
             $selector .= ' selected="selected"';
         }
         $selector .= '>';
         $selector .= $msg["type_antivol_autre"] . '</option>';
         $selector .= '</select>';
     } else {
         $selector = "";
     }
     $form = str_replace('!!type_antivol!!', $selector, $form);
     // select "owner"
     $form = str_replace('!!owner!!', do_selector('lenders', 'f_ex_owner', $this->owner_id), $form);
     //dates creation / modification
     if ($this->expl_id && ($pmb_expl_show_dates == '1' || $pmb_expl_show_dates == '3')) {
         $form = str_replace('<!-- msg_exp_cre_date -->', "<label class='etiquette' >" . htmlentities($msg['exp_cre_date'], ENT_QUOTES, $charset) . "</label>", $form);
         $form = str_replace('<!-- exp_cre_date -->', format_date($this->create_date), $form);
         $form = str_replace('<!-- msg_exp_upd_date -->', "<label class='etiquette' >" . htmlentities($msg['exp_upd_date'], ENT_QUOTES, $charset) . "</label>", $form);
         $form = str_replace('<!-- exp_upd_date -->', format_date($this->update_date), $form);
     }
     //dates dépôt / retour
     if ($this->expl_id && ($pmb_expl_show_dates == '2' || $pmb_expl_show_dates == '3')) {
         $form = str_replace('<!-- msg_exp_filing_date -->', "<label class='etiquette' >" . htmlentities($msg['filing_date'], ENT_QUOTES, $charset) . "</label>", $form);
         $form = str_replace('<!-- exp_filing_date -->', format_date($this->date_depot), $form);
         $form = str_replace('<!-- msg_exp_return_date -->', "<label class='etiquette' >" . htmlentities($msg['return_date'], ENT_QUOTES, $charset) . "</label>", $form);
         $form = str_replace('<!-- exp_return_date -->', format_date($this->date_retour), $form);
     }
     // Indexation concept
     if ($thesaurus_concepts_active == 1) {
         $index_concept = new index_concept($this->expl_id, TYPE_EXPL);
         $form = str_replace('<!-- index_concept_form -->', $index_concept->get_form("expl"), $form);
     }
     $p_perso = new parametres_perso("expl");
     if (!$p_perso->no_special_fields) {
         $c = 0;
         $perso = "<hr />";
         $perso_ = $p_perso->show_editable_fields($this->expl_id);
         for ($i = 0; $i < count($perso_["FIELDS"]); $i++) {
             $p = $perso_["FIELDS"][$i];
             if ($c == 0) {
                 $perso .= "<div class='row'>\n";
             }
             $perso .= "<div class='colonne2'><label for='" . $p["NAME"] . "' class='etiquette'>" . $p["TITRE"] . "</label><div class='row'>" . $p["AFF"] . "</div></div>\n";
             $c++;
             if ($c == 2) {
                 $perso .= "</div>\n";
                 $c = 0;
             }
         }
         if ($c == 1) {
             $perso .= "<div class='colonne2'>&nbsp;</div>\n</div>\n";
         }
         $perso = $perso_["CHECK_SCRIPTS"] . "\n" . $perso;
     } else {
         $perso = "\n<script>function check_form() { return true; }</script>\n";
     }
     $form = str_replace("!!champs_perso!!", $perso, $form);
     //Remplissage ajax de la cote
     global $pmb_prefill_cote_ajax, $pmb_antivol;
     if ($pmb_prefill_cote_ajax) {
         $expl_ajax_cote = " completion='expl_cote' listfield='" . $this->ajax_cote_fields . ",f_ex_cb,f_ex_typdoc,f_ex_location,f_ex_owner,f_ex_statut,f_ex_cstat" . ($pmb_antivol > 0 ? ",type_antivol" : "") . "' ";
     } else {
         $expl_ajax_cote = "";
     }
     $form = str_replace("!!expl_ajax_cote!!", $expl_ajax_cote, $form);
 }
Exemplo n.º 5
0
function bul_do_form($obj, $bul_id = 0)
{
    // $obj = objet contenant les propriétés de l'exemplaire associé
    global $bul_expl_form;
    global $msg;
    // pour texte du bouton supprimer
    global $dbh;
    global $pmb_type_audit, $select_categ_prop;
    global $pmb_antivol;
    global $option_num_auto;
    global $pmb_rfid_activate, $pmb_rfid_serveur_url, $charset;
    global $pmb_expl_show_dates, $pmb_expl_show_lastempr;
    global $thesaurus_concepts_active;
    if (isset($option_num_auto)) {
        $requete = "DELETE from exemplaires_temp where sess not in (select SESSID from sessions)";
        $res = pmb_mysql_query($requete, $dbh);
        //Appel à la fonction de génération automatique de cb
        $code_exemplaire = init_gen_code_exemplaire(0, $obj->expl_bulletin);
        do {
            $code_exemplaire = gen_code_exemplaire(0, $obj->expl_bulletin, $code_exemplaire);
            $requete = "select expl_cb from exemplaires WHERE expl_cb='{$code_exemplaire}'";
            $res0 = pmb_mysql_query($requete, $dbh);
            $requete = "select cb from exemplaires_temp WHERE cb='{$code_exemplaire}' AND sess <>'" . SESSid . "'";
            $res1 = pmb_mysql_query($requete, $dbh);
        } while (pmb_mysql_num_rows($res0) || pmb_mysql_num_rows($res1));
        //Memorise dans temps le cb et la session pour le cas de multi utilisateur session
        $obj->expl_cb = $code_exemplaire;
        $requete = "INSERT INTO exemplaires_temp (cb ,sess) VALUES ('{$obj->expl_cb}','" . SESSid . "')";
        $res = pmb_mysql_query($requete, $dbh);
    }
    //on compte le nombre de prets pour cet exemplaire
    $req = "select count(arc_expl_id) as nb_prets from pret_archive where arc_expl_id = " . $obj->expl_id;
    $res = pmb_mysql_query($req);
    if (pmb_mysql_num_rows($res)) {
        $arch_pret = pmb_mysql_fetch_object($res);
        $nb_prets = $arch_pret->nb_prets;
    } else {
        $nb_prets = 0;
    }
    if ($nb_prets) {
        //dernière date de pret pour cet exemplaire
        $req = "select date_format(last_loan_date, '" . $msg["format_date"] . "') as date_last from exemplaires where expl_id = " . $obj->expl_id;
        $res = pmb_mysql_query($req);
        if (pmb_mysql_num_rows($res)) {
            $expl_pret = pmb_mysql_fetch_object($res);
            $date_last = $expl_pret->date_last;
            $info_nb_prets = str_replace("!!nb_prets!!", $nb_prets, $msg['expl_nbprets']);
            $query = "select count(pret_idexpl) ";
            $query .= "from pret, empr where pret_idexpl='" . $obj->expl_id . "' and pret_idempr=id_empr ";
            $result = pmb_mysql_query($query, $dbh);
            if ($result && pmb_mysql_result($result, 0, 0)) {
                $info_date_last = str_replace("!!date_last!!", $date_last, $msg['expl_lastpret_encours']);
            } else {
                $info_date_last = str_replace("!!date_last!!", $date_last, $msg['expl_lastpret_retour']);
            }
            print $info_nb_prets . " " . $info_date_last;
        }
    }
    // l'annulation du form renvoit à :
    $annuler = "./catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=" . $obj->expl_bulletin;
    $action = "./catalog.php?categ=serials&sub=bulletinage&action=expl_update";
    $expl_nbparts = $obj->expl_cb;
    if (!$obj->expl_nbparts) {
        $expl_nbparts = 1;
    } else {
        $expl_nbparts = $obj->expl_nbparts;
    }
    // mise à jour des champs de gestion
    $bul_expl_form = str_replace('!!bul_id!!', $obj->expl_bulletin, $bul_expl_form);
    $bul_expl_form = str_replace('!!id_form!!', md5(microtime()), $bul_expl_form);
    $bul_expl_form = str_replace('!!org_cb!!', htmlentities($obj->expl_cb, ENT_QUOTES, $charset), $bul_expl_form);
    $bul_expl_form = str_replace('!!expl_id!!', $obj->expl_id, $bul_expl_form);
    $bul_expl_form = str_replace('!!action!!', $action, $bul_expl_form);
    $bul_expl_form = str_replace('!!id!!', $obj->expl_notice, $bul_expl_form);
    $bul_expl_form = str_replace('!!cb!!', htmlentities($obj->expl_cb, ENT_QUOTES, $charset), $bul_expl_form);
    $bul_expl_form = str_replace('!!nbparts!!', htmlentities($expl_nbparts, ENT_QUOTES, $charset), $bul_expl_form);
    $bul_expl_form = str_replace('!!note!!', $obj->expl_note, $bul_expl_form);
    $bul_expl_form = str_replace('!!comment!!', $obj->expl_comment, $bul_expl_form);
    $bul_expl_form = str_replace('!!cote!!', $obj->expl_cote, $bul_expl_form);
    $bul_expl_form = str_replace('!!prix!!', $obj->expl_prix, $bul_expl_form);
    // select "type document"
    $bul_expl_form = str_replace('!!type_doc!!', do_selector('docs_type', 'expl_typdoc', $obj->expl_typdoc), $bul_expl_form);
    // select "section"
    $bul_expl_form = str_replace('!!section!!', do_selector_bul_section($obj->expl_section, $obj->expl_location), $bul_expl_form);
    // select "statut"
    $bul_expl_form = str_replace('!!statut!!', do_selector('docs_statut', 'expl_statut', $obj->expl_statut), $bul_expl_form);
    // select "localisation"
    //visibilité des exemplaires
    global $explr_visible_mod, $pmb_droits_explr_localises;
    if ($pmb_droits_explr_localises) {
        $where_clause_explr = "idlocation in (" . $explr_visible_mod . ") and";
    } else {
        $where_clause_explr = "";
    }
    $bul_expl_form = str_replace('!!localisation!!', gen_liste("select distinct idlocation, location_libelle from docs_location, docsloc_section where {$where_clause_explr} num_location=idlocation order by 2", "idlocation", "location_libelle", 'expl_location', "calcule_section(this);", $obj->expl_location, "", "", "", "", 0), $bul_expl_form);
    // select "code statistique"
    $bul_expl_form = str_replace('!!codestat!!', do_selector('docs_codestat', 'expl_codestat', $obj->expl_codestat), $bul_expl_form);
    // select "owner"
    $bul_expl_form = str_replace('!!owner!!', do_selector('lenders', 'expl_owner', $obj->expl_owner), $bul_expl_form);
    //dates creation / modification
    if ($obj->expl_id && ($pmb_expl_show_dates == '1' || $pmb_expl_show_dates == '3')) {
        $bul_expl_form = str_replace('<!-- msg_exp_cre_date -->', "<label class='etiquette' >" . htmlentities($msg['exp_cre_date'], ENT_QUOTES, $charset) . "</label>", $bul_expl_form);
        $bul_expl_form = str_replace('<!-- exp_cre_date -->', format_date($obj->create_date), $bul_expl_form);
        $bul_expl_form = str_replace('<!-- msg_exp_upd_date -->', "<label class='etiquette' >" . htmlentities($msg['exp_upd_date'], ENT_QUOTES, $charset) . "</label>", $bul_expl_form);
        $bul_expl_form = str_replace('<!-- exp_upd_date -->', format_date($obj->update_date), $bul_expl_form);
    }
    //dates dépôt / retour
    if ($obj->expl_id && ($pmb_expl_show_dates == '2' || $pmb_expl_show_dates == '3')) {
        $bul_expl_form = str_replace('<!-- msg_exp_filing_date -->', "<label class='etiquette' >" . htmlentities($msg['filing_date'], ENT_QUOTES, $charset) . "</label>", $bul_expl_form);
        $bul_expl_form = str_replace('<!-- exp_filing_date -->', format_date($obj->expl_date_depot), $bul_expl_form);
        $bul_expl_form = str_replace('<!-- msg_exp_return_date -->', "<label class='etiquette' >" . htmlentities($msg['return_date'], ENT_QUOTES, $charset) . "</label>", $bul_expl_form);
        $bul_expl_form = str_replace('<!-- exp_return_date -->', format_date($obj->expl_date_retour), $bul_expl_form);
    }
    // Indexation concept
    if ($thesaurus_concepts_active == 1) {
        $index_concept = new index_concept($obj->expl_id, TYPE_EXPL);
        $bul_expl_form = str_replace('<!-- index_concept_form -->', $index_concept->get_form("expl"), $bul_expl_form);
    }
    // select "type_antivol"
    $selector = "";
    if ($pmb_antivol > 0) {
        global $value_deflt_antivol;
        if ($obj->type_antivol == "") {
            $obj->type_antivol = $value_deflt_antivol;
        }
        // select "type_antivol"
        $selector = "\n\t\t<div class='colonne3'>\n\t\t<!-- code stat -->\n\t\t<label class='etiquette' for='type_antivol'>{$msg['type_antivol']}</label>\n\t\t<div class='row'>\n\t\t<select name='type_antivol' id='type_antivol'>";
        $selector .= "<option value='0'";
        if ($obj->type_antivol == 0) {
            $selector .= ' SELECTED';
        }
        $selector .= '>';
        $selector .= $msg["type_antivol_aucun"] . '</option>';
        $selector .= "<option value='1'";
        if ($obj->type_antivol == 1) {
            $selector .= ' SELECTED';
        }
        $selector .= '>';
        $selector .= $msg["type_antivol_magnetique"] . '</option>';
        $selector .= "<option value='2'";
        if ($obj->type_antivol == 2) {
            $selector .= ' SELECTED';
        }
        $selector .= '>';
        $selector .= $msg["type_antivol_autre"] . '</option>';
        $selector .= '</select></div></div>';
    }
    $bul_expl_form = str_replace('!!type_antivol!!', $selector, $bul_expl_form);
    $p_perso = new parametres_perso("expl");
    if (!$p_perso->no_special_fields) {
        $c = 0;
        $perso = "<hr />";
        global $expl_id_from;
        if ($expl_id_from && !$obj->expl_id) {
            $perso_id_expl = $expl_id_from;
        } elseif ($obj->expl_id) {
            $perso_id_expl = $obj->expl_id;
        } else {
            $perso_id_expl = 0;
        }
        $perso_ = $p_perso->show_editable_fields($perso_id_expl);
        for ($i = 0; $i < count($perso_["FIELDS"]); $i++) {
            $p = $perso_["FIELDS"][$i];
            if ($c == 0) {
                $perso .= "<div class='row'>\n";
            }
            $perso .= "<div class='colonne2'><label for='" . $p["NAME"] . "' class='etiquette'>" . $p["TITRE"] . " </label>" . $p["COMMENT_DISPLAY"] . "<div class='row'>" . $p["AFF"] . "</div></div>\n";
            $c++;
            if ($c == 2) {
                $perso .= "</div>\n";
                $c = 0;
            }
        }
        if ($c == 1) {
            $perso .= "<div class='colonne2'>&nbsp;</div>\n</div>\n";
        }
        $perso = $perso_["CHECK_SCRIPTS"] . "\n" . $perso;
        $perso = "<div class='row'>" . $perso . "</div>";
    } else {
        $perso = "";
    }
    $bul_expl_form = str_replace("!!champs_perso!!", $perso, $bul_expl_form);
    // circulation des périodique
    $perio_circ_tpl = "";
    $in_circ = 0;
    if ($obj->expl_id) {
        $req = "select * from serialcirc_expl where num_serialcirc_expl_id=" . $obj->expl_id;
        $res_in_circ = pmb_mysql_query($req);
        if (pmb_mysql_num_rows($res_in_circ)) {
            $in_circ = 1;
            $perio_circ_tpl = "<label class='etiquette'>" . $msg['serialcirc_expl_in_circ'] . "</label>";
        }
    }
    if (!$in_circ) {
        $req = "select * from abts_abts, bulletins, serialcirc where abts_abts.num_notice =bulletin_notice and  bulletin_id=" . $obj->expl_bulletin . " and num_serialcirc_abt=abt_id\n\t\torder by abt_name";
        $res_circ = pmb_mysql_query($req);
        if ($nb = pmb_mysql_num_rows($res_circ)) {
            $perio_circ_tpl = "<input type='checkbox' name='serial_circ_add' value='1'> " . $msg['serialcirc_add_expl'];
            if ($nb > 1) {
                $perio_circ_tpl .= "<select name='abt_id'>";
            }
            while ($circ = pmb_mysql_fetch_object($res_circ)) {
                if ($nb == 1) {
                    $perio_circ_tpl .= "<input type='hidden' name='abt_id' value='" . $circ->abt_id . "' >";
                    break;
                }
                $perio_circ_tpl .= "<option value='" . $circ->abt_id . "'> " . htmlentities($circ->abt_name, ENT_QUOTES, $charset) . "</option>";
            }
            if ($nb > 1) {
                $perio_circ_tpl .= "</select>";
            }
        }
    }
    $bul_expl_form = str_replace("!!perio_circ_tpl!!", $perio_circ_tpl, $bul_expl_form);
    // bouton supprimer si modification
    if ($obj->expl_id) {
        $del_button = "<input type='button' class='bouton' value=' {$msg['63']} ' onClick=\"confirm_expl_delete();\">";
        $bt_dupliquer = "<input type='button' class='bouton' value=\"" . $msg['dupl_expl_bt'] . "\" name='dupl_ex' id='dupl_ex' onClick=\"unload_off();document.location='./catalog.php?categ=serials&sub=bulletinage&action=dupl_expl&bul_id=" . $obj->expl_bulletin . "&expl_id=" . $obj->expl_id . "' ; \" />";
        if ($pmb_type_audit) {
            $link_audit = "<input class='bouton' type='button' onClick=\"openPopUp('./audit.php?type_obj=2&object_id={$obj->expl_id}', 'audit_popup', 700, 500, -2, -2, '{$select_categ_prop}')\" title='{$msg['audit_button']}' value='{$msg['audit_button']}' />";
        } else {
            $link_audit = "";
        }
    } else {
        $del_button = "";
        $link_audit = "";
        $bt_dupliquer = "";
    }
    //boutons selon droits
    $nex = new exemplaire($obj->cb, $obj->expl_id, $obj->notice, $obj->bulletin);
    if ($nex->explr_acces_autorise == "MODIF") {
        $bt_modifier = "<input type='submit' class='bouton' value=' {$msg['77']} ' onClick=\"return test_form(this.form)\" />";
    } else {
        $bt_modifier = "";
        $del_button = "";
        $bt_dupliquer = "";
    }
    if ($pmb_rfid_activate == 1 && $pmb_rfid_serveur_url) {
        $script_rfid_encode = "if(script_rfid_encode()==false) return false;";
        $bul_expl_form = str_replace('!!questionrfid!!', $script_rfid_encode, $bul_expl_form);
    } else {
        $bul_expl_form = str_replace('!!questionrfid!!', '', $bul_expl_form);
    }
    $bul_expl_form = str_replace('!!del!!', $del_button, $bul_expl_form);
    $bul_expl_form = str_replace('!!link_audit!!', $link_audit, $bul_expl_form);
    $bul_expl_form = str_replace('!!bt_dupliquer!!', $bt_dupliquer, $bul_expl_form);
    $bul_expl_form = str_replace('!!bt_modifier!!', $bt_modifier, $bul_expl_form);
    $bul_expl_form = str_replace('!!bul_id!!', $bul_id, $bul_expl_form);
    $bul_expl_form = str_replace('!!expl_id!!', $obj->expl_id, $bul_expl_form);
    // action du bouton annuler
    $bul_expl_form = str_replace('!!annuler_action!!', $annuler, $bul_expl_form);
    // rafraichissement de la liste des sections par rapport à la localisation sélectionnée
    //	$bul_expl_form .= "<script> calcule_section(document.forms['expl'].expl_location.options[document.forms['expl'].expl_location.selectedIndex].value); </script>";
    // zone du dernier emrunteur
    $last_pret = "";
    if ($pmb_expl_show_lastempr && $obj->expl_lastempr) {
        $lastempr = new emprunteur($obj->expl_lastempr, '', FALSE, 0);
        $last_pret = "<hr /><div class='row'><b>{$msg['expl_lastempr']} </b>";
        $link = "<a href='./circ.php?categ=pret&form_cb=" . rawurlencode($lastempr->cb) . "'>";
        $last_pret .= $link . $lastempr->prenom . ' ' . $lastempr->nom . ' (' . $lastempr->cb . ')</a>';
        $last_pret .= "</div>";
    }
    // zone de l'emprunteur
    $query = "select empr_cb, empr_nom, empr_prenom, ";
    $query .= " date_format(pret_date, '" . $msg["format_date"] . "') as aff_pret_date, ";
    $query .= " date_format(pret_retour, '" . $msg["format_date"] . "') as aff_pret_retour, ";
    $query .= " IF(pret_retour>sysdate(),0,1) as retard ";
    $query .= " from pret, empr where pret_idexpl='" . $obj->expl_id . "' and pret_idempr=id_empr ";
    $result = pmb_mysql_query($query, $dbh);
    if (pmb_mysql_num_rows($result)) {
        $pret = pmb_mysql_fetch_object($result);
        $last_pret .= "<hr /><div class='row'><b>{$msg['380']}</b> ";
        $link = "<a href='./circ.php?categ=pret&form_cb=" . rawurlencode($pret->empr_cb) . "'>";
        $last_pret .= $link . $pret->empr_prenom . ' ' . $pret->empr_nom . ' (' . $pret->empr_cb . ')</a>';
        $last_pret .= "&nbsp;{$msg[381]}&nbsp;" . $pret->aff_pret_date;
        $last_pret .= ".&nbsp;{$msg[358]}&nbsp;" . $pret->aff_pret_retour . ".";
        $last_pret .= "</div>";
    }
    return $bul_expl_form . $last_pret;
}
Exemplo n.º 6
0
require_once "{$include_path}/expl_info.inc.php";
// Titre de la fenêtre
echo window_title($database_window_title . $msg[transferts_circ_menu_reset] . $msg[1003] . $msg[1001]);
//creation de l'objet transfert
$obj_transfert = new transfert();
$form = do_cb_expl($msg[transferts_circ_menu_titre] . " > " . $msg[transferts_circ_menu_reset], $msg[661], $msg[transferts_circ_reset_exemplaire], "./circ.php?categ=trans&sub=" . $sub, 0);
if (!$f_ex_location) {
    $f_ex_location = $deflt_docs_location;
}
if (!$f_ex_statut) {
    $f_ex_statut = $deflt_docs_statut;
}
$form_suite = "\n\t<div class='row'>\n\t\t<label class='f_ex_location' for='form_cb_expl'>{$msg['298']}</label>\n\t</div>\n\t<div class='row'>\n\t\t" . gen_liste("select distinct idlocation, location_libelle from docs_location order by location_libelle", "idlocation", "location_libelle", 'f_ex_location', "calcule_section(this);", $f_ex_location, "", "", "", "", 0) . "\n\t</div>\n\t<script type='text/javascript'>\n\tfunction calcule_section(selectBox) {\n\t\tfor (i=0; i<selectBox.options.length; i++) {\n\t\t\tid=selectBox.options[i].value;\n\t\t    list=document.getElementById(\"docloc_section\"+id);\n\t\t    list.style.display=\"none\";\n\t\t}\n\t\n\t\tid=selectBox.options[selectBox.selectedIndex].value;\n\t\tlist=document.getElementById(\"docloc_section\"+id);\n\t\tlist.style.display=\"block\";\n\t}\n\t</script>\n\t<div class='row'>\n\t\t<label class='etiquette' for='f_ex_section'>{$msg['295']}</label>\n\t</div>\n\t<div class='row'>";
$expl = new exemplaire();
$form_suite .= $expl->do_selector();
$form_suite .= "\t</div>\n\t<div class='row'>\n\t\t<label class='etiquette' for='f_ex_statut'>{$msg['297']}</label>\n\t</div>\r\n\t<div class='row'>\r\n\t\t" . do_selector('docs_statut', 'f_ex_statut', $f_ex_statut) . "\r\n\t</div>";
$form = str_replace('<!-- !!suite!! -->', $form_suite, $form);
print $form;
//si cb
if ($form_cb_expl != "") {
    $formlocid = "f_ex_section" . $f_ex_location;
    $expl_section = ${$formlocid};
    $query = "select * from exemplaires where expl_cb='" . $form_cb_expl . "' ";
    $result = pmb_mysql_query($query, $dbh);
    $expl_info = pmb_mysql_fetch_object($result);
    if ($expl_info->expl_id) {
        // Reset des transferts en cours
        $rqt = "UPDATE transferts,transferts_demande, exemplaires set etat_transfert=1, etat_demande=7\t\t\t\t\t\t\t\n\t\t\t\tWHERE id_transfert=num_transfert and num_expl=expl_id  and etat_transfert=0 AND expl_cb='" . $form_cb_expl . "' ";
        pmb_mysql_query($rqt);
        //on met à jour la localisation de expl avec celle de l'utilisateur
        $rqt = "UPDATE exemplaires \n\t\t\t\tSET expl_location=" . $f_ex_location . ", transfert_location_origine =" . $f_ex_location . ",  \n\t\t\t\texpl_statut=" . $f_ex_statut . ", transfert_statut_origine =" . $f_ex_statut . ",  \n\t\t\t\texpl_section=" . $expl_section . ", transfert_section_origine =" . $expl_section . " \n\t\t\t\tWHERE expl_cb='" . $form_cb_expl . "' ";
Exemplo n.º 7
0
 }
 foreach ($values_array as $values) {
     if ($nb % 2) {
         $tmpLigne = str_replace("!!class_ligne!!", "odd", $transferts_popup_ligne_tableau);
     } else {
         $tmpLigne = str_replace("!!class_ligne!!", "even", $transferts_popup_ligne_tableau);
     }
     //on parcourt toutes les colonnes de la requete
     for ($i = 0; $i < $nbCols; $i++) {
         //on remplace les données à afficher
         $tmpLigne = str_replace("!!" . pmb_mysql_field_name($res, $i) . "!!", $values[$i], $tmpLigne);
         if ($nb == 0 && $transferts_ghost_expl_enable) {
             $tmpStringGhost = str_replace("!!" . pmb_mysql_field_name($res, $i) . "!!", $values[$i], $tmpStringGhost);
             switch (pmb_mysql_field_name($res, $i)) {
                 case 'expl_id':
                     $tmpStringGhost = str_replace("!!expl_status!!", do_selector('docs_statut', "expl_virtual_status", $transferts_ghost_statut_expl_transferts), $tmpStringGhost);
                     $tmpStringGhost = str_replace("!!expl_parent_id!!", $values[$i], $tmpStringGhost);
                     break;
                 case 'expl_cb':
                     $tmpStringGhost = str_replace("!!cb_ghost_from!!", $values[$i], $tmpStringGhost);
                     break;
                 case 'expl_notice':
                     $tmpStringGhost = str_replace("!!parent_type!!", 'notice', $tmpStringGhost);
                     $tmpStringGhost = str_replace("!!parent_num!!", $values[$i], $tmpStringGhost);
                     break;
                 case 'expl_bulletin':
                     $tmpStringGhost = str_replace("!!parent_type!!", 'bulletin', $tmpStringGhost);
                     $tmpStringGhost = str_replace("!!parent_num!!", $values[$i], $tmpStringGhost);
                     break;
             }
         }
Exemplo n.º 8
0
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once "{$include_path}/expl_info.inc.php";
// Titre de la fenêtre
echo window_title($database_window_title . $msg[transferts_circ_menu_reset] . $msg[1003] . $msg[1001]);
//creation de l'objet transfert
$obj_transfert = new transfert();
$form = do_cb_expl($msg[transferts_circ_menu_titre] . " > " . $msg[transferts_circ_menu_reset], $msg[661], $msg[transferts_circ_reset_exemplaire], "./circ.php?categ=trans&sub=" . $sub, 0);
if (!$f_ex_location) {
    $f_ex_location = $deflt_docs_location;
}
if (!$f_ex_statut) {
    $f_ex_statut = $deflt_docs_statut;
}
$form_suite = "\n\t<div class='row'>\n\t\t<label class='f_ex_location' for='form_cb_expl'>{$msg['298']}</label>\n\t</div>\n\t<div class='row'>\n\t\t" . gen_liste("select distinct idlocation, location_libelle from docs_location order by location_libelle", "idlocation", "location_libelle", 'f_ex_location', "", $f_ex_location, "", "", "", "", 0) . "\n\t</div>\n\t<div class='row'>\n\t\t<label class='etiquette' for='f_ex_statut'>{$msg['297']}</label>\n\t</div>\r\n\t<div class='row'>\r\n\t\t" . do_selector('docs_statut', 'f_ex_statut', $f_ex_statut) . "\r\n\t</div>";
$form = str_replace('<!-- !!suite!! -->', $form_suite, $form);
print $form;
//si cb
if ($form_cb_expl != "") {
    $query = "select * from exemplaires where expl_cb='" . $form_cb_expl . "' ";
    $result = mysql_query($query, $dbh);
    $expl_info = mysql_fetch_object($result);
    if ($expl_info->expl_id) {
        // Reset des transferts en cours
        $rqt = "UPDATE transferts,transferts_demande, exemplaires set etat_transfert=1, etat_demande=7\t\t\t\t\t\t\t\n\t\t\t\tWHERE id_transfert=num_transfert and num_expl=expl_id  and etat_transfert=0 AND expl_cb='" . $form_cb_expl . "' ";
        mysql_query($rqt);
        //on met à jour la localisation de expl avec celle de l'utilisateur
        $rqt = "UPDATE exemplaires SET expl_location=" . $f_ex_location . ", transfert_location_origine =" . $f_ex_location . " WHERE expl_cb='" . $form_cb_expl . "' ";
        mysql_query($rqt);
        //on met à jour le statut d'origine
Exemplo n.º 9
0
 function gen_tpl_abt_modele($id, $titre, $num, $vol, $tome, $delais, $delais_critique, $change_statut_id)
 {
     global $dbh;
     global $msg;
     $requete = "select * from abts_modeles where modele_id='{$id}'";
     $resultat = mysql_query($requete, $dbh);
     if ($r_a = mysql_fetch_object($resultat)) {
         $tom_actif = $r_a->tom_actif;
         $vol_actif = $r_a->vol_actif;
         $num_depart = $r_a->num_depart;
         $vol_depart = $r_a->vol_depart;
         $tom_depart = $r_a->tom_depart;
     }
     if (!$num) {
         $num = $num_depart;
     }
     if (!$vol) {
         $vol = $vol_depart;
     }
     if (!$tome) {
         $tome = $tom_depart;
     }
     $contenu = "\n\t\t<div class='row'>\n\t\t\t<label for='num_periodicite' class='etiquette'>" . $msg["abonnements_periodique_numero_depart"] . "</label>\n\t\t</div>\t\n\t\t<div class='row'>\n\t\t\t<input type='text' size='4' name='num[{$id}]' id='num[{$id}]' value='{$num}'/>\t\t\n\t\t</div>\n\t\t";
     if ($vol_actif) {
         $contenu .= "\t\t\n\t\t<div class='colonne2'>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='num_periodicite' class='etiquette'>" . $msg["abonnements_volume_numero_depart"] . "</label>\n\t\t\t</div>\t\n\t\t\t<div class='row'>\n\t\t\t\t<input type='text' size='4' name='vol[{$id}]' id='vol[{$id}]' value='{$vol}'/>\t\n\t\t\t</div>\n\t\t</div>\n\t\t";
     }
     if ($tom_actif) {
         $contenu .= "\n\t\t<div class='colonne_suite'>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='num_periodicite' class='etiquette'>" . $msg["abonnements_tome_numero_depart"] . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<input type='text' size='4' name='tome[{$id}]' id='tome' value='{$tome}'/>\n\t\t\t</div>\n\t\t</div>\n\t\t";
     }
     $contenu .= "\n\t\t<div class='row'></div>\n\t\t<div class='colonne2'>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='num_periodicite' class='etiquette'>" . $msg["abonnements_delais_avant_retard"] . "</label>\n\t\t\t</div>\t\n\t\t\t<div class='row'>\n\t\t\t\t<input type='text' size='4' name='delais[{$id}]' id='delais[{$id}]' value='{$delais}'/>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class='colonne_suite'>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='num_periodicite' class='etiquette'>" . $msg["abonnements_delais_critique"] . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<input type='text' size='4' name='delais_critique[{$id}]' id='delais_critique[{$id}]' value='{$delais_critique}'/>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class='row'></div>\n\t\t";
     // select !!change_statut!!
     $statut_form = str_replace('!!statut_check!!', "<input type='checkbox' checked value='1' name='change_statut_check[" . $id . "]' id='change_statut[" . $id . "]_check' onclick=\"gere_statut('change_statut[" . $id . "]');\"/>", $msg['catalog_change_statut_form']);
     $statut_form = str_replace('!!statut_list!!', do_selector('docs_statut', "change_statut[" . $id . "]", $change_statut_id), $statut_form);
     $contenu .= "\n\t\t<div class='row'>&nbsp;</div>\n\t\t<div class='row'>\n\t\t\t{$statut_form}\n\t\t</div>\n\t\t";
     return gen_plus_form($id, $titre, $contenu);
 }
Exemplo n.º 10
0
 function option_form()
 {
     global $serialcirc_diff_form_option, $charset;
     $form = $serialcirc_diff_form_option;
     if ($this->circ_type == 0) {
         $form = str_replace("!!circ_type_checked_0!!", " checked='checked' ", $form);
         $form = str_replace("!!circ_type_checked_1!!", "", $form);
     } else {
         $form = str_replace("!!circ_type_checked_0!!", "", $form);
         $form = str_replace("!!circ_type_checked_1!!", " checked='checked' ", $form);
     }
     $form = str_replace("!!circ_type_checked_" . $this->circ_type . "!!", " checked='checked' ", $form);
     //circ vituelle
     if ($this->virtual_circ) {
         $checked = " checked='checked' ";
     } else {
         $checked = "";
     }
     $form = str_replace("!!virtual_checked!!", $checked, $form);
     // circ simplifiée
     if ($this->simple_circ) {
         $checked = " checked='checked' ";
     } else {
         $checked = "";
     }
     $form = str_replace("!!simple_circ_checked!!", $checked, $form);
     if ($this->no_ret_circ) {
         $checked = " checked='checked' ";
     } else {
         $checked = "";
     }
     $form = str_replace("!!no_ret_circ_checked!!", $checked, $form);
     if ($this->virtual_circ) {
         $display = 'block';
     } else {
         $display = 'none';
     }
     $form = str_replace("!!display_virtual_circ_part!!", $display, $form);
     $form = str_replace("!!duration!!", $this->duration, $form);
     //$form=str_replace("!!retard_mode_checked_".$this->retard_mode."!!"," checked='checked' ",$form);
     if ($this->retard_mode == 0) {
         $form = str_replace("!!retard_mode_checked_0!!", " checked='checked' ", $form);
         $form = str_replace("!!retard_mode_checked_1!!", "", $form);
     } else {
         $form = str_replace("!!retard_mode_checked_0!!", "", $form);
         $form = str_replace("!!retard_mode_checked_1!!", " checked='checked' ", $form);
     }
     if ($this->checked) {
         $checked = " checked='checked' ";
     } else {
         $checked = "";
     }
     $form = str_replace("!!checked_checked!!", $checked, $form);
     if ($this->allow_resa) {
         $checked = " checked='checked' ";
     } else {
         $checked = "";
     }
     $form = str_replace("!!allow_resa_checked!!", $checked, $form);
     if ($this->allow_copy) {
         $checked = " checked='checked' ";
     } else {
         $checked = "";
     }
     $form = str_replace("!!allow_copy_checked!!", $checked, $form);
     if ($this->allow_send_ask) {
         $checked = " checked='checked' ";
     } else {
         $checked = "";
     }
     $form = str_replace("!!allow_send_ask_checked!!", $checked, $form);
     if ($this->allow_subscription) {
         $checked = " checked='checked' ";
     } else {
         $checked = "";
     }
     $form = str_replace("!!allow_subscription_checked!!", $checked, $form);
     $form = str_replace("!!duration_before_send!!", $this->duration_before_send, $form);
     $form = str_replace('!!expl_statut_circ!!', do_selector('docs_statut', 'expl_statut_circ', $this->expl_statut_circ), $form);
     $form = str_replace('!!expl_statut_circ_after!!', do_selector('docs_statut', 'expl_statut_circ_after', $this->expl_statut_circ_after), $form);
     return $form;
 }
Exemplo n.º 11
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: express.tpl.php,v 1.7 2012-07-06 08:00:08 dgoron Exp $
if (stristr($_SERVER['REQUEST_URI'], ".tpl.php")) {
    die("no access");
}
// select "type document"
$sel_tdoc = do_selector('docs_type', 'pe_tdoc', 0);
$layout_begin = "\n<script type=\"text/javascript\">\n<!--\nfunction test_form(form)\n{\n\tif (!form.pe_titre.value){\n\t\talert(\"" . $msg['pret_express_err'] . "\");\n\t\tform.pe_titre.focus();\n\t\treturn false;\n\t}\n\tif(form.pe_excb.value.replace(/^\\s+|\\s+\$/g, '').length == 0) {\n\t\tform.pe_excb.value = '';\n\t}\n\tdocument.pret_express_form.submit();\n}\n\n-->\n</script>\n\n<div class=\"row\">\n<h1>" . $msg['pret_express'] . "</h1>" . $msg['pret_express_new'] . " <a href='./circ.php?categ=pret&form_cb=!!cb_lecteur!!&groupID={$groupID}" . ($pmb_short_loan_management == 1 && $short_loan == 1 ? '&short_loan=1' : '') . "'>!!nom_lecteur!!</a>\n</div>\n<br />\n\n<form class='form-{$current_module}' id='express' name='pret_express_form' method='post' action='./circ.php?categ=pret&sub=pret_express&id_empr={$id_empr}&groupID={$groupID}" . ($pmb_short_loan_management == 1 && $short_loan == 1 ? '&short_loan=1' : '') . "'>\n<h3>" . $msg['pret_express_cap'] . "</h3>\n\n<div class='form-contenu'>\n\t<!--\tISBN\t-->\n\t<div class='row'>\n\t\t<label class='etiquette' for='pe_isbn'>" . $msg['pret_express_cod'] . "</label>\n\t\t<br />\n\t\t<input class='saisie-20em' id='pe_isbn' type='text' value='' name='pe_isbn' />\n\t\t</div>\n\n\t<!--\ttitolo\t-->\n\t<div class='row'>\n\t\t<label class='etiquette' for='pe_titre'>" . $msg['pret_express_tit'] . "</label>\n\t\t<br />\n\t\t<input class='saisie-80em' id='pe_titre' type='text' value='' name='pe_titre' />\n\t\t</div>\n\n\n\t<div class='row'><br /><hr /></div>\n\t<!-- type document -->\n\t<div class='colonne3'>\n\t\t<label class='etiquette' for='f_ex_typdoc'>{$msg['294']}</label>\n\t\t<br />\n\t\t{$sel_tdoc}\n\t</div>\n\t<div class='colonne_suite'>\n\t<!-- codice a barre\t-->\n\t\t<label class='etiquette' for='pe_excb'>" . $msg['pret_express_ecb'] . "</label>\n\t\t<br />\n\t\t<input class='saisie-20em' id='pe_excb' type='text' value='' name='pe_excb' />\n\t\t</div>\n\t<div class='row'></div>\n\t</div>\n\n<!--\tBouton d'envoi\t-->\n<div class='row'>\n\t<input class='bouton' type='button' value=' {$msg['76']} ' onClick=\"document.location='./circ.php?categ=pret&sub=&id_empr={$id_empr}&groupID={$groupID}" . ($pmb_short_loan_management == 1 && $short_loan == 1 ? '&short_loan=1' : '') . "'\" />&nbsp;\n\t<input class='bouton' type='button' value='" . $msg['pret_express_reg'] . "' onClick=\"return test_form(this.form)\" />\n\t</div>\n</form>";