Ejemplo n.º 1
0
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
// gestion des exemplaires
print "<h1>" . $msg["dupl_expl_titre"] . "</h1>";
$notice = new mono_display($id, 1, './catalog.php?categ=modif&id=!!id!!', FALSE);
print pmb_bidi("<div class='row'><b>" . $notice->header . "</b><br />");
print pmb_bidi($notice->isbd . "</div>");
$nex = new exemplaire($cb, $expl_id, $id);
// visibilité des exemplaires
// $nex->explr_acces_autorise contient INVIS, MODIF ou UNMOD
if ($nex->explr_acces_autorise != "INVIS") {
    print "<div class='row'>";
    $nex->cb = "";
    $nex->expl_id = 0;
    $expl_form = $nex->expl_form("./catalog.php?categ=expl_update&sub=create", "./catalog.php?categ=isbd&id={$id}");
    if ($nex->explr_acces_autorise == "MODIF") {
        // lien pour suppression
        $supprimer = "";
        // lien pour la modification
        $modifier = "<input type='submit' class='bouton' value=' {$msg['77']} ' onClick=\"return test_form(this.form)\" />";
    } else {
        $modifier = "";
        $supprimer = "";
    }
    $expl_form = str_replace('!!questionrfid!!', "", $expl_form);
    $expl_form = str_replace('!!modifier!!', $modifier, $expl_form);
    $expl_form = str_replace('!!supprimer!!', $supprimer, $expl_form);
    print $expl_form;
    print "</div>";
} else {
Ejemplo n.º 2
0
        $query = "select count(pret_idexpl) ";
        $query .= "from pret, empr where pret_idexpl='" . $nex->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;
    }
}
// visibilité des exemplaires
// $nex->explr_acces_autorise contient INVIS, MODIF ou UNMOD
if ($nex->explr_acces_autorise != "INVIS") {
    print "<div class='row'>";
    $expl_form = $nex->expl_form("./catalog.php?categ=expl_update&sub=update&org_cb=" . urlencode($cb) . "&expl_id=" . $expl_id, "./catalog.php?categ=isbd&id={$id}");
    if ($nex->explr_acces_autorise == "MODIF") {
        // lien pour suppression
        $supprimer = "\n\t\t\t<script type=\"text/javascript\">\n   \t\t \tfunction confirm_delete() {\n\t       \t\tresult = confirm(\"{$msg[314]} ?\");\n    \t    \tif(result) document.location = \"./catalog.php?categ=del_expl&id={$id}&cb=" . urlencode($cb) . "&expl_id=" . $expl_id . "\";\n    \t    \telse unload_on(); \n     \t\t}\n\t\t\t</script>\n\t\t\t<input type='button' class='bouton' value=\"{$msg['63']}\" name='del_ex' id='del_ex' onClick=\"unload_off();confirm_delete();\" />\n\t\t\t";
        $dupliquer = "&nbsp;<input type='button' class='bouton' value=\"" . $msg['dupl_expl_bt'] . "\" name='dupl_ex' id='dupl_ex' onClick=\"unload_off();document.location='./catalog.php?categ=dupl_expl&id={$id}&cb=" . urlencode($cb) . "&expl_id=" . $expl_id . "' ; \" />\n\t\t\t";
        // lien pour la modification
        $modifier = "<input type='submit' class='bouton' value=' {$msg['77']} ' onClick=\"unload_off();return test_form(this.form);\" />" . $dupliquer;
    } else {
        $modifier = "";
        $supprimer = "";
    }
    $expl_form = str_replace('!!modifier!!', $modifier, $expl_form);
    $expl_form = str_replace('!!supprimer!!', $supprimer, $expl_form);
    if ($pmb_rfid_activate == 1 && $pmb_rfid_serveur_url) {
        $script_rfid_encode = "if(script_rfid_encode()==false) return false;";
        $expl_form = str_replace('!!questionrfid!!', $script_rfid_encode, $expl_form);
Ejemplo n.º 3
0
function do_expl_form()
{
    global $recept_deliv_form_expl, $expl_form;
    global $typ_lig, $id_prod;
    global $option_num_auto, $pmb_numero_exemplaire_auto, $pmb_numero_exemplaire_auto_script, $recept_deliv_form_expl_auto;
    global $pmb_droits_explr_localises, $explr_visible_mod;
    $form = '';
    $num_auto = 0;
    if (!isset($first)) {
        $first = 1;
    }
    // visibilité des exemplaires
    // On ne vérifie que si l'utilisateur peut créer sur au moins une localisation.
    if (!$pmb_droits_explr_localises || $explr_visible_mod) {
        $id_notice = 0;
        $id_bulletin = 0;
        switch ($typ_lig) {
            case '1':
                //notice
                $id_notice = $id_prod;
                break;
            case '2':
                //bulletin
                $id_bulletin = $id_prod;
                break;
            default:
                //non catalogué
                break;
        }
        if ($id_notice) {
            $expl_form = $recept_deliv_form_expl;
            if (($pmb_numero_exemplaire_auto == '1' || $pmb_numero_exemplaire_auto == '2') && $pmb_numero_exemplaire_auto_script) {
                $num_auto = 1;
            }
            if ($num_auto == 1 && isset($option_num_auto)) {
                $recept_deliv_form_expl_auto = str_replace('!!checked!!', "checked='checked'", $recept_deliv_form_expl_auto);
                $expl_form = str_replace('<!-- option_num_auto -->', $recept_deliv_form_expl_auto, $expl_form);
            } elseif ($num_auto == 1 && !isset($option_num_auto)) {
                $recept_deliv_form_expl_auto = str_replace('!!checked!!', '', $recept_deliv_form_expl_auto);
                $expl_form = str_replace('<!-- option_num_auto -->', $recept_deliv_form_expl_auto, $expl_form);
            }
            $nex = new exemplaire('', 0, $id_notice);
            $expl_form = $nex->expl_form('', '');
            $form = $expl_form;
        } elseif ($id_bulletin) {
            $expl_form = $recept_deliv_form_expl;
            if (($pmb_numero_exemplaire_auto == '1' || $pmb_numero_exemplaire_auto == '3') && $pmb_numero_exemplaire_auto_script) {
                $num_auto = 1;
            }
            if ($num_auto == 1 && isset($option_num_auto)) {
                $recept_deliv_form_expl_auto = str_replace('!!checked!!', "checked='checked'", $recept_deliv_form_expl_auto);
                $expl_form = str_replace('<!-- option_num_auto -->', $recept_deliv_form_expl_auto, $expl_form);
            } elseif ($num_auto == 1 && !isset($option_num_auto)) {
                $recept_deliv_form_expl_auto = str_replace('!!checked!!', '', $recept_deliv_form_expl_auto);
                $expl_form = str_replace('<!-- option_num_auto -->', $recept_deliv_form_expl_auto, $expl_form);
            }
            $nex = new exemplaire('', 0, 0, $id_bulletin);
            $expl_form = $nex->expl_form('', '');
            $form = $expl_form;
        }
    }
    return $form;
}