예제 #1
0
function get_info_expl($cb_doc)
{
    global $dbh, $msg;
    $requete = "SELECT notices_m.notice_id as m_id, notices_s.notice_id as s_id, expl_cb, expl_cote, expl_location,pret_date, pret_retour, tdoc_libelle, section_libelle, location_libelle, trim(concat(ifnull(notices_m.tit1,''),ifnull(notices_s.tit1,''),' ',ifnull(bulletin_numero,''), if (mention_date, concat(' (',mention_date,')') ,''))) as tit, ";
    $requete .= " date_format(pret_date, '" . $msg["format_date"] . "') as aff_pret_date, ";
    $requete .= " date_format(pret_retour, '" . $msg["format_date"] . "') as aff_pret_retour, ";
    $requete .= " IF(pret_retour>sysdate(),0,1) as retard, notices_m.tparent_id, notices_m.tnvol ";
    $requete .= " FROM (((exemplaires LEFT JOIN notices AS notices_m ON expl_notice = notices_m.notice_id ) LEFT JOIN bulletins ON expl_bulletin = bulletins.bulletin_id) LEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id), docs_type, docs_section, docs_location, pret ";
    $requete .= " WHERE expl_cb='" . $cb_doc . "' and expl_typdoc = idtyp_doc and expl_section = idsection and expl_location = idlocation and pret_idexpl = expl_id  ";
    $res = pmb_mysql_query($requete, $dbh) or die("<br />" . pmb_mysql_error());
    $expl = pmb_mysql_fetch_object($res);
    $responsabilites = get_notice_authors($expl->m_id + $expl->s_id);
    $as = array_search("0", $responsabilites["responsabilites"]);
    if ($as !== FALSE && $as !== NULL) {
        $auteur_0 = $responsabilites["auteurs"][$as];
        $auteur = new auteur($auteur_0["id"]);
        $header_aut .= $auteur->isbd_entry;
    } else {
        $aut1_libelle = array();
        $as = array_keys($responsabilites["responsabilites"], "1");
        for ($i = 0; $i < count($as); $i++) {
            $indice = $as[$i];
            $auteur_1 = $responsabilites["auteurs"][$indice];
            $auteur = new auteur($auteur_1["id"]);
            $aut1_libelle[] = $auteur->isbd_entry;
        }
        $header_aut .= implode(", ", $aut1_libelle);
    }
    $header_aut ? $auteur = " / " . $header_aut : ($auteur = "");
    $expl->header_aut = $header_aut;
    // récupération du titre de série
    if ($expl->tparent_id && $expl->m_id) {
        $parent = new serie($expl->tparent_id);
        $tit_serie = $parent->name;
        if ($expl->tnvol) {
            $tit_serie .= ', ' . $expl->tnvol;
        }
    }
    if ($tit_serie) {
        $expl->tit = $tit_serie . '. ' . $expl->tit;
    }
    return $expl;
}
예제 #2
0
 public function get_data_resa($id_resa_print)
 {
     global $dbh, $msg;
     $dates_resa_sql = " date_format(resa_date_debut, '" . $msg["format_date"] . "') as aff_resa_date_debut, date_format(resa_date_fin, '" . $msg["format_date"] . "') as aff_resa_date_fin ";
     $requete = "SELECT notices_m.notice_id as m_id, notices_s.notice_id as s_id, resa_date_debut, resa_date_fin, resa_cb, resa_loc_retrait, trim(concat(ifnull(notices_m.tit1,''),ifnull(notices_s.tit1,''),' ',ifnull(bulletin_numero,''), if (mention_date, concat(' (',mention_date,')') ,''))) as tit, " . $dates_resa_sql;
     $requete .= "FROM (((resa LEFT JOIN notices AS notices_m ON resa_idnotice = notices_m.notice_id ) LEFT JOIN bulletins ON resa_idbulletin = bulletins.bulletin_id) LEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id) ";
     $requete .= "WHERE id_resa='" . $id_resa_print . "' ";
     $res = pmb_mysql_query($requete, $dbh);
     $expl = pmb_mysql_fetch_object($res);
     $responsabilites = get_notice_authors($expl->m_id + $expl->s_id);
     $as = array_search("0", $responsabilites["responsabilites"]);
     if ($as !== FALSE && $as !== NULL) {
         $auteur_0 = $responsabilites["auteurs"][$as];
         $auteur = new auteur($auteur_0["id"]);
         $header_aut .= $auteur->isbd_entry;
     } else {
         $aut1_libelle = array();
         $as = array_keys($responsabilites["responsabilites"], "1");
         for ($i = 0; $i < count($as); $i++) {
             $indice = $as[$i];
             $auteur_1 = $responsabilites["auteurs"][$indice];
             $auteur = new auteur($auteur_1["id"]);
             $aut1_libelle[] = $auteur->isbd_entry;
         }
         $header_aut .= implode(", ", $aut1_libelle);
     }
     //$header_aut ? $auteur=" / ".$header_aut : $auteur="";
     $rqt_detail = "select resa_confirmee, resa_cb,location_libelle, expl_cote from resa\r\n\t\tleft join exemplaires on expl_cb=resa_cb\r\n\t\tleft join docs_location on idlocation=expl_location\r\n\t\twhere id_resa ={$id_resa_print}  and resa_cb is not null and resa_cb!='' ";
     $res_detail = pmb_mysql_query($rqt_detail);
     $expl_detail = pmb_mysql_fetch_object($res_detail);
     $data_resa["id"] = $id_resa_print;
     $data_resa["titre"] = $expl->tit;
     $data_resa["auteur"] = $header_aut;
     $data_resa["cb"] = $expl->resa_cb;
     $data_resa["cote"] = $expl->expl_cote;
     $data_resa["date_debut"] = $expl->aff_resa_date_debut;
     $data_resa["date_fin"] = $expl->aff_resa_date_fin;
     $i = count($this->data["resa_list"]);
     $this->data["resa_list"][$i] = $data_resa;
     return $data_resa;
 }
예제 #3
0
function m_not_bull_info_resa($id_empr, $notice, $bulletin)
{
    global $msg;
    $res_final = array();
    $dates_resa_sql = "date_format(resa_date, '" . $msg["format_date"] . "') as date_pose_resa, IF(resa_date_fin>sysdate() or resa_date_fin='0000-00-00',0,1) as perimee, if(resa_date_debut='0000-00-00', '', date_format(resa_date_debut, '" . $msg["format_date"] . "')) as aff_resa_date_debut, if(resa_date_fin='0000-00-00', '', date_format(resa_date_fin, '" . $msg["format_date"] . "')) as aff_resa_date_fin ";
    if ($notice) {
        $requete = "SELECT notice_id, resa_date, resa_idempr, tit1 as tit, " . $dates_resa_sql;
        $requete .= "FROM notices, resa ";
        $requete .= "WHERE notice_id='" . $notice . "' and resa_idnotice=notice_id order by resa_date ";
    } else {
        $requete = "SELECT notice_id, resa_date, resa_idempr, trim(concat(tit1,' ',ifnull(bulletin_numero,''), if (mention_date, concat(' (',mention_date,')') ,''))) as tit, " . $dates_resa_sql;
        $requete .= "FROM bulletins, resa, notices ";
        $requete .= "WHERE resa_idbulletin='{$bulletin}' and resa_idbulletin = bulletins.bulletin_id and bulletin_notice = notice_id order by resa_date ";
    }
    $res = pmb_mysql_query($requete) or die("<br />" . pmb_mysql_error());
    $nb_resa = pmb_mysql_num_rows($res);
    for ($j = 0; $j < $nb_resa; $j++) {
        $resa = pmb_mysql_fetch_object($res);
        if ($resa->resa_idempr == $id_empr) {
            $responsabilites = get_notice_authors($resa->notice_id);
            $as = array_search("0", $responsabilites["responsabilites"]);
            if ($as !== FALSE && $as !== NULL) {
                $auteur_0 = $responsabilites["auteurs"][$as];
                $auteur = new auteur($auteur_0["id"]);
                $header_aut .= $auteur->isbd_entry;
            } else {
                $aut1_libelle = array();
                $as = array_keys($responsabilites["responsabilites"], "1");
                for ($i = 0; $i < count($as); $i++) {
                    $indice = $as[$i];
                    $auteur_1 = $responsabilites["auteurs"][$indice];
                    $auteur = new auteur($auteur_1["id"]);
                    $aut1_libelle[] = $auteur->isbd_entry;
                }
                $header_aut .= implode(", ", $aut1_libelle);
            }
            $header_aut ? $auteur = " / " . $header_aut : ($auteur = "");
            if ($resa->aff_resa_date_debut) {
                $tmpmsg_res = $msg['fpdf_reserve_du'] . " " . $resa->aff_resa_date_debut . " " . $msg['fpdf_adherent_au'] . " " . $resa->aff_resa_date_fin;
            } else {
                $tmpmsg_res = $msg['fpdf_attente_valid'];
            }
            $res_final[] = "<b>" . $resa->tit . $auteur . "</b>";
            $res_final[] = "<blockquote>" . $tmpmsg_res;
            $date_resa = " " . $msg['fpdf_reserv_enreg'] . " " . $resa->date_pose_resa . ".";
            $res_final[] = $msg['fpdf_rang'] . " " . ($j + 1) . $date_resa . "</blockquote>";
        }
    }
    // fin for
    return implode("\n", $res_final);
}
예제 #4
0
function send_mail($id_empr, $relance)
{
    global $pmb_gestion_devise, $msg, $charset;
    global $biblio_name, $biblio_email, $biblio_phone, $PMBuseremailbcc;
    // l'objet du mail
    $var = "mailretard_" . $relance . "objet";
    global ${$var};
    eval("\$objet=\"" . ${$var} . "\";");
    // la formule de politesse du bas (le signataire)
    $var = "mailretard_" . $relance . "fdp";
    global ${$var};
    eval("\$fdp=\"" . ${$var} . "\";");
    // le texte après la liste des ouvrages en retard
    $var = "mailretard_" . $relance . "after_list";
    global ${$var};
    eval("\$after_list=\"" . ${$var} . "\";");
    // le texte avant la liste des ouvrges en retard
    $var = "mailretard_" . $relance . "before_list";
    global ${$var};
    eval("\$before_list=\"" . ${$var} . "\";");
    // le "Madame, Monsieur," ou tout autre truc du genre "Cher adhérent,"
    $var = "mailretard_" . $relance . "madame_monsieur";
    global ${$var};
    eval("\$madame_monsieur=\"" . ${$var} . "\";");
    if ($madame_monsieur) {
        $texte_mail .= $madame_monsieur . "\r\n\r\n";
    }
    if ($before_list) {
        $texte_mail .= $before_list . "\r\n\r\n";
    }
    //Récupération des exemplaires
    $rqt = "select pret_idempr, expl_id, expl_cb from pret, exemplaires where pret_idempr='" . $id_empr . "' and pret_retour < curdate() and pret_idexpl=expl_id order by pret_date ";
    $req = pmb_mysql_query($rqt) or die('Erreur SQL !<br />' . $rqt . '<br />' . pmb_mysql_error());
    $i = 0;
    $total_amendes = 0;
    //Calcul des frais de relance
    $id_compte = comptes::get_compte_id_from_empr($id_empr, 2);
    if ($id_compte) {
        $cpte = new comptes($id_compte);
        $frais_relance = $cpte->summarize_transactions("", "", 0, $realisee = -1);
        if ($frais_relance < 0) {
            $frais_relance = -$frais_relance;
        } else {
            $frais_relance = 0;
        }
    }
    while ($data = pmb_mysql_fetch_array($req)) {
        //Calcul des amendes
        $valeur = 0;
        $amende = new amende($data["pret_idempr"]);
        $amd = $amende->get_amende($data["expl_id"]);
        if ($amd["valeur"]) {
            $valeur = $amd["valeur"];
            $total_amendes += $valeur;
        }
        /* Récupération des infos exemplaires et prêt */
        $requete = "SELECT notices_m.notice_id as m_id, notices_s.notice_id as s_id, expl_cb, pret_date, pret_retour, tdoc_libelle, trim(concat(ifnull(notices_m.tit1,''),ifnull(notices_s.tit1,''),' ',ifnull(bulletin_numero,''), if (mention_date, concat(' (',mention_date,')') ,''))) as tit, ";
        $requete .= " date_format(pret_date, '" . $msg["format_date"] . "') as aff_pret_date, ";
        $requete .= " date_format(pret_retour, '" . $msg["format_date"] . "') as aff_pret_retour, ";
        $requete .= " IF(pret_retour>sysdate(),0,1) as retard, notices_m.tparent_id, notices_m.tnvol ";
        $requete .= "FROM (((exemplaires LEFT JOIN notices AS notices_m ON expl_notice = notices_m.notice_id ) LEFT JOIN bulletins ON expl_bulletin = bulletins.bulletin_id) LEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id), docs_type , pret ";
        $requete .= "WHERE expl_cb='" . addslashes($data['expl_cb']) . "' and expl_typdoc = idtyp_doc and pret_idexpl = expl_id  ";
        $res = pmb_mysql_query($requete);
        $expl = pmb_mysql_fetch_object($res);
        $responsabilites = array();
        $header_aut = "";
        $responsabilites = get_notice_authors($expl->m_id + $expl->s_id);
        $as = array_search("0", $responsabilites["responsabilites"]);
        if ($as !== FALSE && $as !== NULL) {
            $auteur_0 = $responsabilites["auteurs"][$as];
            $auteur = new auteur($auteur_0["id"]);
            $header_aut .= $auteur->isbd_entry;
        } else {
            $aut1_libelle = array();
            $as = array_keys($responsabilites["responsabilites"], "1");
            for ($i = 0; $i < count($as); $i++) {
                $indice = $as[$i];
                $auteur_1 = $responsabilites["auteurs"][$indice];
                $auteur = new auteur($auteur_1["id"]);
                $aut1_libelle[] = $auteur->isbd_entry;
            }
            $header_aut .= implode(", ", $aut1_libelle);
        }
        $header_aut ? $auteur = " / " . $header_aut : ($auteur = "");
        // récupération du titre de série
        $tit_serie = "";
        if ($expl->tparent_id && $expl->m_id) {
            $parent = new serie($expl->tparent_id);
            $tit_serie = $parent->name;
            if ($expl->tnvol) {
                $tit_serie .= ', ' . $expl->tnvol;
            }
        }
        if ($tit_serie) {
            $expl->tit = $tit_serie . '. ' . $expl->tit;
        }
        $texte_mail .= $expl->tit . $auteur . "\r\n";
        $texte_mail .= "    -" . sprintf($msg["relance_mail_retard_dates"], $expl->aff_pret_date, $expl->aff_pret_retour);
        if ($valeur) {
            $texte_mail .= " " . sprintf($msg["relance_mail_retard_amende"], comptes::format_simple($valeur));
        }
        $texte_mail .= "\r\n";
        $i++;
    }
    if ($total_amendes) {
        $texte_mail .= "\r\n" . sprintf($msg["relance_mail_retard_total_amendes"], comptes::format_simple($total_amendes));
    }
    if ($frais_relance) {
        $texte_mail .= "\r\n" . $msg["relance_lettre_retard_frais_relance"] . comptes::format_simple($frais_relance);
    }
    if ($frais_relance && $total_amendes) {
        $texte_mail .= "\r\n" . $msg["relance_lettre_retard_total_du"] . comptes::format_simple($total_amendes + $frais_relance);
    }
    $texte_mail .= "\r\n\r\n";
    if ($after_list) {
        $texte_mail .= $after_list . "\r\n\r\n";
    }
    if ($fdp) {
        $texte_mail .= $fdp . "\r\n\r\n";
    }
    $texte_mail .= mail_bloc_adresse();
    //Si mail de rappel affecté au responsable du groupe
    $requete = "select id_groupe,resp_groupe from groupe,empr_groupe where id_groupe=groupe_id and empr_id={$id_empr} and resp_groupe and mail_rappel limit 1";
    $res = pmb_mysql_query($requete);
    /* Récupération du nom, prénom et mail du lecteur destinataire */
    if (pmb_mysql_num_rows($res) > 0) {
        $requete = "select id_empr, empr_mail, empr_nom, empr_prenom from empr where id_empr='" . pmb_mysql_result($res, 0, 1) . "'";
        $result = pmb_mysql_query($requete);
        $coords_dest = pmb_mysql_fetch_object($result);
    } else {
        $requete = "select id_empr, empr_mail, empr_nom, empr_prenom from empr where id_empr={$id_empr}";
        $res = pmb_mysql_query($requete);
        $coords_dest = pmb_mysql_fetch_object($res);
    }
    /* Récupération du nom, prénom et mail du lecteur concerné */
    $requete = "select id_empr, empr_mail, empr_nom, empr_prenom, empr_cb from empr where id_empr={$id_empr}";
    $res = pmb_mysql_query($requete);
    $coords = pmb_mysql_fetch_object($res);
    //remplacement nom et prenom
    $texte_mail = str_replace("!!empr_name!!", $coords->empr_nom, $texte_mail);
    $texte_mail = str_replace("!!empr_first_name!!", $coords->empr_prenom, $texte_mail);
    // function mailpmb($to_nom="", $to_mail, $obj="", $corps="", $from_name="", $from_mail, $headers, $copie_CC="", $copie_BCC="", $faire_nl2br=0, $pieces_jointes=array()) {
    $res_envoi = mailpmb($coords_dest->empr_prenom . " " . $coords_dest->empr_nom, $coords_dest->empr_mail, $objet . " : " . $coords->empr_prenom . " " . mb_strtoupper($coords->empr_nom, $charset) . " (" . $coords->empr_cb . ")", $texte_mail, $biblio_name, $biblio_email, "Content-Type: text/plain; charset=\"{$charset}\"\n", "", $PMBuseremailbcc, 1);
    return $res_envoi;
}
예제 #5
0
파일: fpdf.inc.php 프로젝트: bouchra012/PMB
function notice_resa_planning($id_resa_print, $x, $y, $largeur, $retrait, $link)
{
    global $ourPDF;
    global $msg;
    global $pmb_pdf_font;
    $dates_resa_sql = " date_format(resa_date_debut, '" . $msg["format_date"] . "') as aff_resa_date_debut, date_format(resa_date_fin, '" . $msg["format_date"] . "') as aff_resa_date_fin ";
    $requete = "SELECT notice_id, resa_date_debut, resa_date_fin, trim(tit1) as tit, " . $dates_resa_sql;
    $requete .= "FROM resa_planning LEFT JOIN notices ON resa_idnotice = notice_id  ";
    $requete .= "WHERE id_resa='" . $id_resa_print . "' ";
    $res = mysql_query($requete, $link) or die(mysql_error() . " {$requete}");
    $expl = mysql_fetch_object($res);
    $responsabilites = get_notice_authors($expl->notice_id);
    $as = array_search("0", $responsabilites["responsabilites"]);
    if ($as !== FALSE && $as !== NULL) {
        $auteur_0 = $responsabilites["auteurs"][$as];
        $auteur = new auteur($auteur_0["id"]);
        $header_aut .= $auteur->isbd_entry;
    } else {
        $aut1_libelle = array();
        $as = array_keys($responsabilites["responsabilites"], "1");
        for ($i = 0; $i < count($as); $i++) {
            $indice = $as[$i];
            $auteur_1 = $responsabilites["auteurs"][$indice];
            $auteur = new auteur($auteur_1["id"]);
            $aut1_libelle[] = $auteur->isbd_entry;
        }
        $header_aut .= implode(", ", $aut1_libelle);
    }
    $header_aut ? $auteur = " / " . $header_aut : ($auteur = "");
    $ourPDF->SetXY($x, $y);
    $ourPDF->setFont($pmb_pdf_font, 'BU', 10);
    $ourPDF->multiCell($largeur - $x, 8, $expl->tit . $auteur, 0, 'L', 0);
    $ourPDF->SetXY($x + $retrait, $y + 4);
    $ourPDF->setFont($pmb_pdf_font, '', 10);
    $ourPDF->multiCell($largeur - $retrait - $x, 8, $msg['resa_planning_date_debut'] . " " . $expl->aff_resa_date_debut . " " . $msg['resa_planning_date_fin'] . " " . $expl->aff_resa_date_fin, 0, 'L', 0);
}
예제 #6
0
$rqt = "select expl_cb from pret, exemplaires where pret_idempr='" . $id_empr . "' and pret_retour < curdate() and pret_idexpl=expl_id order by pret_date ";
$req = pmb_mysql_query($rqt) or die('Erreur SQL !<br />' . $rqt . '<br />' . pmb_mysql_error());
$i = 0;
while ($data = pmb_mysql_fetch_array($req)) {
    /* Récupération des infos exemplaires et prêt */
    $requete = "SELECT notices_m.notice_id as m_id, notices_s.notice_id as s_id, expl_cb, pret_date, pret_retour, tdoc_libelle, section_libelle, location_libelle, trim(concat(ifnull(notices_m.tit1,''),ifnull(notices_s.tit1,''),' ',ifnull(bulletin_numero,''), if (mention_date, concat(' (',mention_date,')') ,''))) as tit, ";
    $requete .= " date_format(pret_date, '" . $msg["format_date"] . "') as aff_pret_date, ";
    $requete .= " date_format(pret_retour, '" . $msg["format_date"] . "') as aff_pret_retour, ";
    $requete .= " IF(pret_retour>sysdate(),0,1) as retard, notices_m.tparent_id, notices_m.tnvol ";
    $requete .= "FROM (((exemplaires LEFT JOIN notices AS notices_m ON expl_notice = notices_m.notice_id ) LEFT JOIN bulletins ON expl_bulletin = bulletins.bulletin_id) LEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id), docs_type, docs_section, docs_location, pret ";
    $requete .= "WHERE expl_cb='" . addslashes($data['expl_cb']) . "' and expl_typdoc = idtyp_doc and expl_section = idsection and expl_location = idlocation and pret_idexpl = expl_id  ";
    $res = pmb_mysql_query($requete);
    $expl = pmb_mysql_fetch_object($res);
    $responsabilites = array();
    $header_aut = "";
    $responsabilites = get_notice_authors($expl->m_id + $expl->s_id);
    $as = array_search("0", $responsabilites["responsabilites"]);
    if ($as !== FALSE && $as !== NULL) {
        $auteur_0 = $responsabilites["auteurs"][$as];
        $auteur = new auteur($auteur_0["id"]);
        $header_aut .= $auteur->isbd_entry;
    } else {
        $aut1_libelle = array();
        $as = array_keys($responsabilites["responsabilites"], "1");
        for ($i = 0; $i < count($as); $i++) {
            $indice = $as[$i];
            $auteur_1 = $responsabilites["auteurs"][$indice];
            $auteur = new auteur($auteur_1["id"]);
            $aut1_libelle[] = $auteur->isbd_entry;
        }
        $header_aut .= implode(", ", $aut1_libelle);
예제 #7
0
 function fetch_analysis_data()
 {
     global $dbh;
     global $fonction_auteur;
     $myQuery = pmb_mysql_query("SELECT * FROM notices WHERE notice_id='" . $this->analysis_id . "' LIMIT 1", $dbh);
     $myAnalysis = pmb_mysql_fetch_object($myQuery);
     // type du document
     $this->analysis_typdoc = $myAnalysis->typdoc;
     // statut
     $this->analysis_statut = $myAnalysis->statut;
     $this->analysis_commentaire_gestion = $myAnalysis->commentaire_gestion;
     $this->analysis_thumbnail_url = $myAnalysis->thumbnail_url;
     // mentions de titre
     $this->analysis_tit1 = $myAnalysis->tit1;
     $this->analysis_tit2 = $myAnalysis->tit2;
     $this->analysis_tit3 = $myAnalysis->tit3;
     $this->analysis_tit4 = $myAnalysis->tit4;
     // libelle des auteurs
     $this->responsabilites_dep = get_notice_authors($this->analysis_id);
     // Mention de pagination
     $this->analysis_pages = $myAnalysis->npages;
     // zone des notes
     $this->analysis_n_gen = $myAnalysis->n_gen;
     $this->analysis_n_contenu = $myAnalysis->n_contenu;
     $this->analysis_n_resume = $myAnalysis->n_resume;
     // mise à jour des catégories
     $this->analysis_categories = get_notice_categories($this->analysis_id);
     // indexation interne
     if ($myAnalysis->indexint) {
         $this->analysis_indexint = $myAnalysis->indexint;
         $indexint = new indexint($this->analysis_indexint);
         if ($indexint->comment) {
             $this->analysis_indexint_lib = $indexint->name . " - " . $indexint->comment;
         } else {
             $this->analysis_indexint_lib = $indexint->name;
         }
     }
     // indexation libre
     $this->analysis_index_l = $myAnalysis->index_l;
     // libelle des langues
     $this->analysis_langues = get_notice_langues($this->analysis_id, 0);
     // langues de la publication
     $this->analysis_languesorg = get_notice_langues($this->analysis_id, 1);
     // langues originales
     $this->analysis_indexation_lang = $myAnalysis->indexation_lang;
     $this->analysis_is_new = $myAnalysis->notice_is_new;
     $this->analysis_date_is_new = $myAnalysis->notice_date_is_new;
     $this->notice_link = array();
     //liens vers autres notices
     $requete = "SELECT * FROM notices_relations WHERE num_notice=" . $this->analysis_id . " OR linked_notice=" . $this->analysis_id . " ORDER BY rank";
     $result_rel = pmb_mysql_query($requete);
     if (pmb_mysql_num_rows($result_rel)) {
         $i = 0;
         while ($r_rel = pmb_mysql_fetch_object($result_rel)) {
             if ($r_rel->linked_notice == $this->analysis_id) {
                 //notice en cours est notice fille
                 $this->notice_link['down'][$i]['relation_direction'] = 'down';
                 $this->notice_link['down'][$i]['id_notice'] = $r_rel->num_notice;
                 $this->notice_link['down'][$i]['title_notice'] = $this->get_notice_title($r_rel->num_notice);
                 $this->notice_link['down'][$i]['rank'] = $r_rel->rank;
                 $this->notice_link['down'][$i]['relation_type'] = $r_rel->relation_type;
             } elseif ($r_rel->num_notice == $this->analysis_id) {
                 //notice en cours est notice mere
                 $this->notice_link['up'][$i]['relation_direction'] = 'up';
                 $this->notice_link['up'][$i]['id_notice'] = $r_rel->linked_notice;
                 $this->notice_link['up'][$i]['title_notice'] = $this->get_notice_title($r_rel->linked_notice);
                 $this->notice_link['up'][$i]['rank'] = $r_rel->rank;
                 $this->notice_link['up'][$i]['relation_type'] = $r_rel->relation_type;
             }
             $i++;
         }
     }
     // lien vers une ressource électronique
     $this->analysis_lien = $myAnalysis->lien;
     if ($this->analysis_lien) {
         $this->analysis_eformat = $myAnalysis->eformat;
     } else {
         $this->analysis_eformat = "";
     }
     $this->analysis_create_date = $myAnalysis->create_date;
     $this->analysis_update_date = $myAnalysis->update_date;
     return $myQuery->nbr_rows;
 }
예제 #8
0
 }
 //Valeurs
 $loc_cours = "";
 while ($data = pmb_mysql_fetch_array($req)) {
     $line++;
     $x = 0;
     if ($loc_cours != $data['location_libelle']) {
         $loc_cours = $data['location_libelle'];
         $worksheet->write($line, $x, $msg["expl_header_location_libelle"] . " : " . $loc_cours, $heading_12);
         $line++;
     }
     $id_expl = $data['expl_cb'];
     $titre = $data['tit'];
     $responsab = array("responsabilites" => array(), "auteurs" => array());
     // les auteurs
     $responsab = get_notice_authors($data['not_id']);
     $as = array_search("0", $responsab["responsabilites"]);
     if ($as !== FALSE && $as !== NULL) {
         $auteur_0 = $responsab["auteurs"][$as];
         $auteur = new auteur($auteur_0["id"]);
         $mention_resp = $auteur->isbd_entry;
     } else {
         $as = array_keys($responsab["responsabilites"], "1");
         $aut1_libelle = array();
         for ($i = 0; $i < count($as); $i++) {
             $indice = $as[$i];
             $auteur_1 = $responsab["auteurs"][$indice];
             $auteur = new auteur($auteur_1["id"]);
             $aut1_libelle[] = $auteur->isbd_entry;
         }
         $mention_resp = implode(", ", $aut1_libelle);
예제 #9
0
 function fetch_data()
 {
     global $base_path, $charset;
     global $opac_show_book_pics;
     global $opac_book_pics_url;
     global $opac_book_pics_msg;
     global $opac_url_base, $use_opac_url_base;
     global $opac_sur_location_activate;
     global $fonction_auteur, $msg;
     global $tdoc, $icon_doc, $biblio_doc;
     global $pmb_map_activate;
     global $pmb_url_base;
     if (!$this->notice_id) {
         return false;
     }
     //Recuperation des infos de la notice
     $requete = "select * from notices where notice_id=" . $this->notice_id;
     $resultat = pmb_mysql_query($requete);
     $res = pmb_mysql_fetch_object($resultat);
     $this->notice = $res;
     $this->memo_isbn = $this->notice->code;
     $this->memo_typdoc = $tdoc->table[$this->notice->typdoc];
     //Icone type de Document
     $icon = $icon_doc[$this->notice->niveau_biblio . $this->notice->typdoc];
     if ($icon) {
         $info_bulle_icon = $biblio_doc[$this->notice->niveau_biblio] . " : " . $tdoc->table[$this->notice->typdoc];
         if ($use_opac_url_base) {
             $this->memo_icondoc = "<img src=\"" . $opac_url_base . "images/{$icon}\" alt=\"{$info_bulle_icon}\" title=\"{$info_bulle_icon}\" align='top' />";
         } else {
             $this->memo_icondoc = "<img src=\"" . $pmb_url_base . "images/{$icon}\" alt=\"{$info_bulle_icon}\" title=\"{$info_bulle_icon}\" align='top' />";
         }
     }
     if ($use_opac_url_base) {
         if (isset($_SESSION["cart"]) && in_array($this->notice_id, $_SESSION["cart"])) {
             $this->memo_iconcart = "<span id='baskets" . $this->notice_id . "'><a href='#' class=\"img_basket_exist\" title=\"" . $msg['notice_title_basket_exist'] . "\"><img src=\"" . $opac_url_base . "images/basket_exist.gif\" border=\"0\" alt=\"" . $msg['notice_title_basket_exist'] . "\" /></a></span>";
         } else {
             $title = $this->notice_header;
             if (!$title) {
                 $title = $this->notice->tit1;
             }
             $this->memo_iconcart = "<span id='baskets" . $this->notice_id . "'><a href=\"cart_info.php?id=" . $this->notice_id . "&header=" . rawurlencode(strip_tags($title)) . "\" target=\"cart_info\" class=\"img_basket\" title=\"" . $msg['notice_title_basket'] . "\"><img src=\"" . $opac_url_base . "images/basket_small_20x20.gif\" border=\"0\" title=\"" . $msg['notice_title_basket'] . "\" alt=\"" . $msg['notice_title_basket'] . "\" /></a></span>";
         }
     } else {
         $this->memo_iconcart = "<img src=\"" . $pmb_url_base . "images/basket_small_20x20.gif\" align='absmiddle' border='0' title='" . $msg["400"] . "' alt='" . $msg["400"] . "' />";
     }
     $this->niveau_biblio = $this->notice->niveau_biblio;
     $this->niveau_hierar = $this->notice->niveau_hierar;
     //Recherche des infos du périodique
     $this->fetch_analysis_info();
     //Recherche des etats de collection
     $this->fetch_collstate();
     //Titres
     //Titre de serie et composition du titre
     $this->memo_series[] = array();
     if ($res->tparent_id) {
         $requete = "select * from series where serie_id=" . $res->tparent_id;
         $resultat = pmb_mysql_query($requete);
         if ($serie = pmb_mysql_fetch_object($resultat)) {
             $this->memo_series[] = $serie;
             $this->memo_titre = $serie->serie_name;
             $this->memo_titre_serie = $serie->serie_name;
             $this->isbd = $this->serie_name;
             if ($this->notice->tnvol) {
                 $this->memo_titre .= ', ' . $res->tnvol;
                 $this->memo_titre_serie .= ', ' . $res->tnvol;
                 $this->isbd .= ',&nbsp;' . $this->tnvol;
             }
         }
     } elseif ($this->notice->tnvol) {
         $this->memo_titre .= $res->tnvol;
     }
     $this->memo_titre ? $this->memo_titre .= '. ' . $res->tit1 : ($this->memo_titre = $res->tit1);
     $this->isbd ? $this->isbd .= '.&nbsp;' . $this->notice->tit1 : ($this->isbd = $this->notice->tit1);
     $tit2 = $this->notice->tit2;
     $tit3 = $this->notice->tit3;
     $tit4 = $this->notice->tit4;
     if ($tit3) {
         $this->isbd .= "&nbsp;= {$tit3}";
     }
     if ($tit4) {
         $this->isbd .= "&nbsp;: {$tit4}";
     }
     if ($tit2) {
         $this->isbd .= "&nbsp;; {$tit2}";
     }
     $this->isbd .= ' [' . $tdoc->table[$this->notice->typdoc] . ']';
     $this->memo_notice_bulletin = new stdClass();
     $this->memo_bulletin = new stdClass();
     if ($res->niveau_biblio == 'b') {
         $rqt = "select tit1, date_format(date_date, '" . $msg["format_date"] . "') as aff_date_date, bulletin_numero as num_bull,bulletin_notice from bulletins,notices where bulletins.num_notice='" . $this->notice_id . "' and notices.notice_id=bulletins.bulletin_notice";
         $execute_query = pmb_mysql_query($rqt);
         $row = pmb_mysql_fetch_object($execute_query);
         $this->memo_titre .= " " . (!$row->aff_date_date ? sprintf($msg["bul_titre_perio"], $row->tit1) : sprintf($msg["bul_titre_perio"], $row->tit1 . ", " . $row->num_bull . " [" . $row->aff_date_date . "]"));
         // recherche editeur de la notice de perio
         $rqt_perio = "select * from notices where notice_id=" . $row->bulletin_notice;
         $execute_query_perio = pmb_mysql_query($rqt_perio);
         $row_perio = pmb_mysql_fetch_object($execute_query_perio);
         if (!$this->notice->ed1_id) {
             $this->notice->ed1_id = $row_perio->ed1_id;
         }
         //issn pour les notices de bulletin
         if (!$this->notice->code) {
             $this->memo_isbn = $row_perio->code;
         }
     } elseif ($res->niveau_biblio == 'a' && $res->niveau_hierar == 2) {
         $requete = "SELECT b.* ";
         $requete .= "from analysis a, notices b, bulletins c";
         $requete .= " WHERE a.analysis_notice=" . $this->notice_id;
         $requete .= " AND c.bulletin_id=a.analysis_bulletin";
         $requete .= " AND c.bulletin_notice=b.notice_id";
         $requete .= " LIMIT 1";
         $myQuery = pmb_mysql_query($requete);
         if (pmb_mysql_num_rows($myQuery)) {
             $row_perio = pmb_mysql_fetch_object($myQuery);
             if (!$this->notice->ed1_id) {
                 $this->notice->ed1_id = $row_perio->ed1_id;
             }
             //issn pour les notice de dépouillement
             if (!$this->notice->code) {
                 $this->memo_isbn = $row_perio->code;
             }
         }
         //	info du bulletin de ce dépouillement
         $req_bulletin = "SELECT  c.* from analysis a, bulletins c WHERE c.bulletin_id=a.analysis_bulletin AND analysis_notice=" . $res->notice_id;
         $result_bull = pmb_mysql_query($req_bulletin);
         if ($bull = pmb_mysql_fetch_object($result_bull)) {
             $this->memo_bulletin = $bull;
             $this->memo_notice_bulletin = $bull;
             $this->bulletin_mention_date = $bull->mention_date;
             $this->bulletin_date_date = formatdate($bull->date_date);
             $this->bulletin_numero = $bull->bulletin_numero;
         }
     }
     $this->memo_complement_titre = $res->tit4;
     $this->memo_titre_parallele = $res->tit3;
     $this->memo_notice = $res;
     //mention d'édition
     $this->memo_mention_edition = $res->mention_edition;
     //Titre du pério pour les notices de bulletin
     if ($res->niveau_biblio == 'b' && $res->niveau_hierar == '2') {
         $req_bulletin = "SELECT bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, bulletin_numero, tit1 as titre from bulletins, notices WHERE bulletin_notice=notice_id AND num_notice=" . $res->notice_id;
         $result_bull = pmb_mysql_query($req_bulletin);
         while ($bull = pmb_mysql_fetch_object($result_bull)) {
             $this->memo_notice_bulletin = $bull;
             $this->memo_bulletin = $bull;
             $this->serial_title = $bull->titre;
             $this->bulletin_mention_date = $bull->mention_date;
             $this->bulletin_date_date = formatdate($bull->date_date);
             $this->bulletin_numero = $bull->bulletin_numero;
             $this->bulletin_id = $bull->bulletin_id;
         }
     }
     //Langage
     $this->memo_lang = get_notice_langues($this->notice_id, 0);
     // langues de la publication
     $this->memo_lang_or = get_notice_langues($this->notice_id, 1);
     // langues originales
     //Auteurs
     $this->authors = array();
     //Recherche des auteurs;
     $this->responsabilites = get_notice_authors($this->notice_id);
     $mention_resp = $mention_resp_1 = $mention_resp_2 = array();
     $isbd_entry_1 = $isbd_entry_2 = array();
     $as = array_search("0", $this->responsabilites["responsabilites"]);
     if ($as !== FALSE && $as !== NULL) {
         $auteur_0 = $this->responsabilites["auteurs"][$as];
         $auteur = new auteur($auteur_0["id"]);
         $auteur->fonction = $fonction_auteur[$auteur_0["fonction"]];
         $this->authors[] = $auteur;
         if ($this->print_mode) {
             $mention_resp_lib = $auteur->isbd_entry;
         } else {
             $mention_resp_lib = $auteur->isbd_entry_lien_gestion;
         }
         if (!$this->print_mode) {
             $mention_resp_lib .= $auteur->author_web_link;
         }
         if ($auteur_0["fonction"]) {
             $mention_resp_lib .= ", " . $fonction_auteur[$auteur_0["fonction"]];
         }
         $mention_resp[] = $mention_resp_lib;
         $this->memo_auteur_principal = $auteur->isbd_entry;
     }
     $as = array_keys($this->responsabilites["responsabilites"], "1");
     for ($i = 0; $i < count($as); $i++) {
         $indice = $as[$i];
         $auteur_1 = $this->responsabilites["auteurs"][$indice];
         $auteur = new auteur($auteur_1["id"]);
         $auteur->fonction = $fonction_auteur[$auteur_1["fonction"]];
         $this->authors[] = $auteur;
         if ($this->print_mode) {
             $mention_resp_lib = $auteur->isbd_entry;
         } else {
             $mention_resp_lib = $auteur->isbd_entry_lien_gestion;
         }
         if (!$this->print_mode) {
             $mention_resp_lib .= $auteur->author_web_link;
         }
         if ($auteur_1["fonction"]) {
             $mention_resp_lib .= ", " . $fonction_auteur[$auteur_1["fonction"]];
         }
         $mention_resp[] = $mention_resp_lib;
         $mention_resp_1[] = $mention_resp_lib;
         $isbd_entry_1[] = $auteur->isbd_entry;
     }
     $this->memo_mention_resp_1 = implode("; ", $mention_resp_1);
     $this->memo_auteur_autre_tab = $isbd_entry_1;
     $this->memo_auteur_autre = implode("; ", $isbd_entry_1);
     $as = array_keys($this->responsabilites["responsabilites"], "2");
     for ($i = 0; $i < count($as); $i++) {
         $indice = $as[$i];
         $auteur_2 = $this->responsabilites["auteurs"][$indice];
         $auteur = new auteur($auteur_2["id"]);
         $auteur->fonction = $fonction_auteur[$auteur_2["fonction"]];
         $this->authors[] = $auteur;
         if ($this->print_mode) {
             $mention_resp_lib = $auteur->isbd_entry;
         } else {
             $mention_resp_lib = $auteur->isbd_entry_lien_gestion;
         }
         if (!$this->print_mode) {
             $mention_resp_lib .= $auteur->author_web_link;
         }
         if ($auteur_2["fonction"]) {
             $mention_resp_lib .= ", " . $fonction_auteur[$auteur_2["fonction"]];
         }
         $mention_resp[] = $mention_resp_lib;
         $mention_resp_2[] = $mention_resp_lib;
         $isbd_entry_2[] = $auteur->isbd_entry;
     }
     $this->memo_mention_resp_2 = implode("; ", $mention_resp_2);
     $this->memo_auteur_secondaire_tab = $isbd_entry_2;
     $this->memo_auteur_secondaire = implode("; ", $isbd_entry_2);
     $this->memo_libelle_mention_resp = implode("; ", $mention_resp);
     if ($this->memo_libelle_mention_resp) {
         $this->isbd .= "&nbsp;/ {$this->memo_libelle_mention_resp}";
     }
     // on récupère la collection au passage, si besoin est
     if ($this->notice->subcoll_id) {
         $collection = new subcollection($this->notice->subcoll_id);
         $info = $this->get_info_editeur($collection->editeur);
         $this->memo_collection = $collection->isbd_entry;
         $this->memo_ed1 = $info["isbd_entry"];
         $this->memo_ed1_name = $info["name"];
         $this->memo_ed1_place = $info["place"];
         $editeurs = $info["isbd_entry"];
     } elseif ($this->notice->coll_id) {
         $collection = new collection($this->notice->coll_id);
         $info = $this->get_info_editeur($collection->parent);
         $this->memo_collection = $collection->isbd_entry;
         $this->memo_ed1 = $info["isbd_entry"];
         $this->memo_ed1_name = $info["name"];
         $this->memo_ed1_place = $info["place"];
         $editeurs = $info["isbd_entry"];
     } elseif ($this->notice->ed1_id) {
         $info = $this->get_info_editeur($this->notice->ed1_id);
         $this->memo_ed1 = $info["isbd_entry"];
         $this->memo_ed1_name = $info["name"];
         $this->memo_ed1_place = $info["place"];
         $editeurs = $info["isbd_entry"];
     }
     if ($this->notice->ed2_id) {
         $info = $this->get_info_editeur($this->notice->ed2_id);
         $this->memo_ed2 = $info["isbd_entry"];
         $this->memo_ed2_name = $info["name"];
         $this->memo_ed2_place = $info["place"];
         $editeurs ? $editeurs .= '&nbsp;; ' . $info["isbd_entry"] : ($editeurs = $info["isbd_entry"]);
     }
     if ($this->notice->year) {
         $editeurs ? $editeurs .= ', ' . $this->notice->year : ($editeurs = $this->notice->year);
     } elseif ($this->notice->niveau_biblio != 'b') {
         $editeurs ? $editeurs .= ', [s.d.]' : ($editeurs = "[s.d.]");
     }
     $this->memo_year = $this->notice->year;
     if ($editeurs) {
         $this->isbd .= ".&nbsp;-&nbsp;{$editeurs}";
     }
     // zone de la collation (ne concerne que a2)
     if ($this->notice->npages) {
         $collation = $this->notice->npages;
     }
     if ($this->notice->ill) {
         $collation .= ': ' . $this->notice->ill;
     }
     if ($this->notice->size) {
         $collation .= '; ' . $this->notice->size;
     }
     if ($this->notice->accomp) {
         $collation .= '+ ' . $this->notice->accomp;
     }
     if ($collation) {
         $this->isbd .= ".&nbsp;-&nbsp;{$collation}";
     }
     $this->memo_collation = $collation;
     // map
     $this->memo_map_isbd = "";
     $this->memo_map_id = 0;
     $this->memo_map_echelle = "";
     $this->memo_map_projection = "";
     $this->memo_map_ref = "";
     $this->memo_map_equinoxe = "";
     $this->memo_map = "";
     if ($pmb_map_activate) {
         $ids[] = $this->notice_id;
         $this->map = new map_objects_controler(TYPE_RECORD, $ids);
         $this->map_info = new map_info($this->notice_id);
         $this->memo_map_isbd = $this->map_info->get_isbd();
         if ($this->memo_map_isbd) {
             $this->isbd .= ".&nbsp;-&nbsp;" . $this->memo_map_isbd;
         }
         $this->memo_map_id = $this->map_info->map['id'];
         $this->memo_map_echelle = $this->map_info->map['echelle'];
         $this->memo_map_projection = $this->map_info->map['projection'];
         $this->memo_map_ref = $this->map_info->map['ref'];
         $this->memo_map_equinoxe = $this->map_info->map['equinoxe'];
         $this->memo_map = $this->map->get_map();
     }
     //Recherche du code dewey
     $requete = "select * from indexint where indexint_id=" . $res->indexint;
     $resultat = pmb_mysql_query($requete);
     if ($code_dewey = pmb_mysql_fetch_object($resultat)) {
         $this->memo_dewey = $code_dewey;
     }
     if ($collections = $this->memo_collection) {
         if ($this->notice->nocoll) {
             $collections .= '; ' . $this->notice->nocoll;
         }
         $this->isbd .= ".&nbsp;-&nbsp;({$collections})" . ' ';
     }
     if (substr(trim($this->isbd), -1) != ".") {
         $this->isbd .= '.';
     }
     //Traitement des exemplaires
     $this->memo_exemplaires = array();
     $requete = "select expl_id, expl_cb, expl_cote, expl_statut,statut_libelle, expl_typdoc, tdoc_libelle, expl_note, expl_comment, expl_section, section_libelle, ";
     $requete .= "expl_owner, lender_libelle, expl_codestat, codestat_libelle, expl_date_retour, expl_date_depot, expl_note, pret_flag, expl_location, location_libelle, expl_prix ";
     if ($opac_sur_location_activate) {
         $requete .= ", ifnull(surloc_id,0) as surloc_id, ifnull(surloc_libelle,'') as surloc_libelle ";
     }
     $requete .= "from exemplaires, docs_statut, docs_type, docs_section, docs_codestat, lenders, docs_location ";
     if ($opac_sur_location_activate) {
         $requete .= "left join sur_location on surloc_num=surloc_id ";
     }
     $requete .= "where expl_notice=" . $res->notice_id . " and expl_statut=idstatut and expl_typdoc=idtyp_doc and expl_section=idsection and expl_owner=idlender and expl_codestat=idcode ";
     $requete .= "and expl_location=idlocation ";
     $requete .= "union ";
     $requete .= "select expl_id, expl_cb, expl_cote, expl_statut,statut_libelle, expl_typdoc, tdoc_libelle, expl_note, expl_comment, expl_section, section_libelle, ";
     $requete .= "expl_owner, lender_libelle, expl_codestat, codestat_libelle, expl_date_retour, expl_date_depot, expl_note, pret_flag, expl_location, location_libelle, expl_prix ";
     if ($opac_sur_location_activate) {
         $requete .= ", ifnull(surloc_id,0) as surloc_id, ifnull(surloc_libelle,'') as surloc_libelle ";
     }
     $requete .= "from exemplaires, bulletins, docs_statut, docs_type, docs_section, docs_codestat, lenders, docs_location ";
     if ($opac_sur_location_activate) {
         $requete .= "left join sur_location on surloc_num=surloc_id ";
     }
     $requete .= "where bulletins.num_notice=" . $res->notice_id . " and expl_bulletin=bulletin_id and expl_statut=idstatut and expl_typdoc=idtyp_doc and expl_section=idsection and expl_owner=idlender and expl_codestat=idcode ";
     $requete .= "and expl_location=idlocation";
     $resultat = pmb_mysql_query($requete);
     while ($ex = pmb_mysql_fetch_object($resultat)) {
         //Champs perso d'exemplaires
         $parametres_perso = array();
         $mes_pp = new parametres_perso("expl");
         if (!$mes_pp->no_special_fields) {
             $mes_pp->get_values($ex->expl_id);
             $values = $mes_pp->values;
             foreach ($values as $field_id => $vals) {
                 $parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["TITRE"] = $mes_pp->t_fields[$field_id]["TITRE"];
                 foreach ($vals as $value) {
                     $parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["VALUE"][] = $mes_pp->get_formatted_output(array($value), $field_id);
                 }
             }
         }
         $ex->parametres_perso = $parametres_perso;
         $this->memo_exemplaires[] = $ex;
     }
     //Descripteurs
     $requete = "SELECT libelle_categorie FROM categories, notices_categories WHERE notcateg_notice=" . $res->notice_id . " and categories.num_noeud = notices_categories.num_noeud ORDER BY ordre_categorie";
     $resultat = pmb_mysql_query($requete);
     $this->memo_categories = array();
     while ($cat = pmb_mysql_fetch_object($resultat)) {
         $this->memo_categories[] = $cat;
     }
     $authperso = new authperso_notice($this->notice_id);
     $this->memo_authperso_all_isbd .= $authperso->get_notice_display();
     $this->memo_authperso_all_isbd_list = $authperso->get_notice_display_list();
     foreach ($authperso->auth_info as $fields) {
         foreach ($fields["info_fields"] as $field) {
             if (is_array($field["values"]) && count($field["values"])) {
                 $tvalues = array();
                 foreach ($field["values"] as $values) {
                     $tvalues[] = $values["format_value"];
                 }
                 $this->parametres_auth_perso[$field["name"]]["TITRE"][] = $field["label"];
                 $this->parametres_auth_perso[$field["name"]]["VALUE"][] = $tvalues;
             }
         }
     }
     //Champs perso de notice traite par la table notice_custom
     $mes_pp = new parametres_perso("notices");
     $mes_pp->get_values($res->notice_id);
     $values = $mes_pp->values;
     $this->parametres_perso = array();
     foreach ($values as $field_id => $vals) {
         $this->parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["TITRE"] = $mes_pp->t_fields[$field_id]["TITRE"];
         foreach ($vals as $value) {
             $this->parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["VALUE"][] = $mes_pp->get_formatted_output(array($value), $field_id);
             $this->parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["VALUE_IN_DATABASE"][] = $value;
         }
     }
     //Notices liées, relations entre notices
     //les notices mères
     $requete = "SELECT num_notice, linked_notice, relation_type, rank from notices_relations where num_notice=" . $res->notice_id . " order by num_notice, rank asc";
     $resultat = pmb_mysql_query($requete);
     $i = 0;
     while ($notice_fille = pmb_mysql_fetch_object($resultat)) {
         $this->memo_notice_mere[$i] = $notice_fille->linked_notice;
         $this->memo_notice_mere_relation_type[$i] = $notice_fille->relation_type;
         $i++;
     }
     // les notices filles
     $requete = "SELECT num_notice, linked_notice, relation_type, rank from notices_relations where linked_notice=" . $res->notice_id . " order by num_notice, rank asc";
     $resultat = pmb_mysql_query($requete);
     $i = 0;
     while ($notice_mere = pmb_mysql_fetch_object($resultat)) {
         $this->memo_notice_fille[$i] = $notice_mere->num_notice;
         $this->memo_notice_fille_relation_type[$i] = $notice_mere->relation_type;
         $i++;
     }
     // liens vers les périodiques pour les notices d'article
     $req_perio_link = "SELECT notice_id, tit1, code from bulletins,analysis,notices WHERE bulletin_notice=notice_id and bulletin_id=analysis_bulletin and analysis_notice=" . $res->notice_id;
     $result_perio_link = pmb_mysql_query($req_perio_link);
     while ($notice_perio_link = pmb_mysql_fetch_object($result_perio_link)) {
         $this->memo_notice_article[] = $notice_perio_link->notice_id;
     }
     // bulletinage pour les notices de pério
     $req_bulletinage = "SELECT bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, bulletin_numero from bulletins, notices WHERE bulletin_notice = notice_id AND notice_id=" . $res->notice_id;
     $result_bulletinage = pmb_mysql_query($req_bulletinage);
     while ($notice_bulletinage = pmb_mysql_fetch_object($result_bulletinage)) {
         $this->memo_bulletinage[] = $notice_bulletinage->bulletin_id;
     }
     // liens vers les bulletins pour les notices d'article
     $req_bull_link = "SELECT bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, bulletin_numero from bulletins, analysis WHERE bulletin_id=analysis_bulletin and analysis_notice=" . $res->notice_id;
     $result_bull_link = pmb_mysql_query($req_bull_link);
     while ($notice_bull_link = pmb_mysql_fetch_object($result_bull_link)) {
         $this->memo_article_bulletinage[] = $notice_bull_link->bulletin_id;
     }
     $paramaff["mine_type"] = 1;
     $this->memo_explnum_assoc = show_explnum_per_notice($res->notice_id, 0, "", $paramaff);
     if ($this->notice->code || $this->notice->thumbnail_url) {
         if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $this->notice->thumbnail_url)) {
             $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $this->notice->code);
             $url_image = $opac_book_pics_url;
             $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&amp;noticecode=!!noticecode!!&amp;vigurl=" . urlencode($this->notice->thumbnail_url);
             if ($this->notice->thumbnail_url) {
                 $url_image_ok = $this->notice->thumbnail_url;
                 $title_image_ok = "";
             } else {
                 $url_image_ok = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                 $title_image_ok = htmlentities($opac_book_pics_msg, ENT_QUOTES, $charset);
             }
             $this->memo_image = "<img class='vignetteimg' src='" . $url_image_ok . "' title=\"" . $title_image_ok . "\" align='right' hspace='4' vspace='2' style='max-width : 140px; max-height: 200px;' >";
             $this->memo_url_image = $url_image_ok;
         } else {
             $this->memo_image = "";
             $this->memo_url_image = "";
         }
     }
     //calcul du permalink...
     if ($this->notice->niveau_biblio != "b") {
         $this->permalink = $opac_url_base . "index.php?lvl=notice_display&id=" . $this->notice_id;
     } else {
         $this->permalink = $opac_url_base . "index.php?lvl=bulletin_display&id=" . $this->bulletin_id;
     }
     //Traitement des avis
     $this->memo_avis = array();
     $requete = "SELECT id_avis,note,sujet,commentaire,DATE_FORMAT(dateajout,'" . $msg['format_date'] . "') as ladate,empr_login,empr_nom, empr_prenom, valide\n\t\tfrom avis left join empr on id_empr=num_empr where num_notice='" . $res->notice_id . "' and valide=1 order by avis_rank, dateajout desc";
     $resultat = pmb_mysql_query($requete);
     if ($resultat) {
         while ($avis = pmb_mysql_fetch_object($resultat)) {
             $avis->note_textuelle = $msg['avis_detail_note_' . $avis->note];
             if ($charset != "utf-8") {
                 $avis->commentaire = cp1252Toiso88591($avis->commentaire);
             }
             $avis->commentaire = do_bbcode($avis->commentaire);
             $this->memo_avis[] = $avis;
         }
     }
     //Titres uniformes
     $requete = "select * from notices_titres_uniformes where ntu_num_notice=" . $res->notice_id . " order by ntu_ordre";
     $resultat = pmb_mysql_query($requete);
     if (pmb_mysql_num_rows($resultat)) {
         while ($tu = pmb_mysql_fetch_object($resultat)) {
             $tu_memo = new titre_uniforme($tu->ntu_num_tu);
             $tu_memo->parametres_perso = array();
             $mes_pp = new parametres_perso("tu");
             $mes_pp->get_values($tu->ntu_num_tu);
             $values = $mes_pp->values;
             foreach ($values as $field_id => $vals) {
                 $tu_memo->parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["TITRE"] = $mes_pp->t_fields[$field_id]["TITRE"];
                 foreach ($vals as $value) {
                     $tu_memo->parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["VALUE"][] = $mes_pp->get_formatted_output(array($value), $field_id);
                 }
             }
             $this->memo_tu[] = $tu_memo;
         }
     }
     //statut
     $this->memo_statut['id_notice_statut'] = $res->statut;
     $this->memo_statut['gestion_statut_libelle'] = '';
     $this->memo_statut['opac_statut_libelle'] = '';
     if ($this->memo_statut['id_notice_statut']) {
         $requete = "SELECT * FROM notice_statut WHERE id_notice_statut=" . $this->memo_statut['id_notice_statut'] * 1;
         $resultat = pmb_mysql_query($requete);
         if ($resultat) {
             $statut = pmb_mysql_fetch_object($resultat);
             $this->memo_statut['gestion_statut_libelle'] = $statut->gestion_libelle;
             $this->memo_statut['opac_statut_libelle'] = $statut->opac_libelle;
         }
     }
     return true;
 }
예제 #10
0
 function autres_lectures($notice_id = 0, $bulletin_id = 0)
 {
     global $dbh, $msg;
     global $opac_autres_lectures_tri;
     global $opac_autres_lectures_nb_mini_emprunts;
     global $opac_autres_lectures_nb_maxi;
     global $opac_autres_lectures_nb_jours_maxi;
     global $opac_autres_lectures;
     global $gestion_acces_active, $gestion_acces_empr_notice;
     if (!$opac_autres_lectures || !$notice_id && !$bulletin_id) {
         return "";
     }
     if (!$opac_autres_lectures_nb_maxi) {
         $opac_autres_lectures_nb_maxi = 999999;
     }
     if ($opac_autres_lectures_nb_jours_maxi) {
         $restrict_date = " date_add(oal.arc_fin, INTERVAL {$opac_autres_lectures_nb_jours_maxi} day)>=sysdate() AND ";
     }
     if ($notice_id) {
         $pas_notice = " oal.arc_expl_notice!={$notice_id} AND ";
     }
     if ($bulletin_id) {
         $pas_bulletin = " oal.arc_expl_bulletin!={$bulletin_id} AND ";
     }
     // Ajout ici de la liste des notices lues par les lecteurs de cette notice
     $rqt_autres_lectures = "SELECT oal.arc_expl_notice, oal.arc_expl_bulletin, count(*) AS total_prets,\n\t\t\t\t\ttrim(concat(ifnull(notices_m.tit1,''),ifnull(notices_s.tit1,''),' ',ifnull(bulletin_numero,''), if(mention_date, concat(' (',mention_date,')') ,if (date_date, concat(' (',date_format(date_date, '%d/%m/%Y'),')') ,'')))) as tit, if(notices_m.notice_id, notices_m.notice_id, notices_s.notice_id) as not_id \n\t\t\t\tFROM ((((pret_archive AS oal JOIN\n\t\t\t\t\t(SELECT distinct arc_id_empr FROM pret_archive nbec where (nbec.arc_expl_notice='" . $notice_id . "' AND nbec.arc_expl_bulletin='" . $bulletin_id . "') AND nbec.arc_id_empr !=0) as nbec\n\t\t\t\t\tON (oal.arc_id_empr=nbec.arc_id_empr and oal.arc_id_empr!=0 and nbec.arc_id_empr!=0))\n\t\t\t\t\tLEFT JOIN notices AS notices_m ON arc_expl_notice = notices_m.notice_id )\n\t\t\t\t\tLEFT JOIN bulletins ON arc_expl_bulletin = bulletins.bulletin_id) \n\t\t\t\t\tLEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id)\n\t\t\t\tWHERE {$restrict_date} {$pas_notice} {$pas_bulletin} oal.arc_id_empr !=0\n\t\t\t\tGROUP BY oal.arc_expl_notice, oal.arc_expl_bulletin\n\t\t\t\tHAVING total_prets>={$opac_autres_lectures_nb_mini_emprunts} \n\t\t\t\tORDER BY {$opac_autres_lectures_tri} \n\t\t\t\t";
     $res_autres_lectures = mysql_query($rqt_autres_lectures) or die("<br />" . mysql_error() . "<br />" . $rqt_autres_lectures . "<br />");
     if (mysql_num_rows($res_autres_lectures)) {
         $odd_even = 1;
         $inotvisible = 0;
         $ret = "";
         //droits d'acces emprunteur/notice
         $acces_j = '';
         if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
             $ac = new acces();
             $dom_2 = $ac->setDomain(2);
             $acces_j = $dom_2->getJoin($_SESSION['id_empr_session'], 4, 'notice_id');
         }
         if ($acces_j) {
             $statut_j = '';
             $statut_r = '';
         } else {
             $statut_j = ',notice_statut';
             $statut_r = "and statut=id_notice_statut and ((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ")";
         }
         while ($data = mysql_fetch_array($res_autres_lectures)) {
             // $inotvisible<=$opac_autres_lectures_nb_maxi
             $requete = "SELECT  1  ";
             $requete .= " FROM notices {$acces_j} {$statut_j}  WHERE notice_id='" . $data[not_id] . "' {$statut_r} ";
             $myQuery = mysql_query($requete, $dbh);
             if (mysql_num_rows($myQuery) && $inotvisible <= $opac_autres_lectures_nb_maxi) {
                 // mysql_num_rows($myQuery)
                 $inotvisible++;
                 $titre = $data['tit'];
                 // **********
                 $responsab = array("responsabilites" => array(), "auteurs" => array());
                 // les auteurs
                 $responsab = get_notice_authors($data['not_id']);
                 $as = array_search("0", $responsab["responsabilites"]);
                 if ($as !== FALSE && $as !== NULL) {
                     $auteur_0 = $responsab["auteurs"][$as];
                     $auteur = new auteur($auteur_0["id"]);
                     $mention_resp = $auteur->isbd_entry;
                 } else {
                     $aut1_libelle = array();
                     $as = array_keys($responsab["responsabilites"], "1");
                     for ($i = 0; $i < count($as); $i++) {
                         $indice = $as[$i];
                         $auteur_1 = $responsab["auteurs"][$indice];
                         $auteur = new auteur($auteur_1["id"]);
                         $aut1_libelle[] = $auteur->isbd_entry;
                     }
                     $mention_resp = implode(", ", $aut1_libelle);
                 }
                 $mention_resp ? $auteur = $mention_resp : ($auteur = "");
                 // on affiche les résultats
                 if ($odd_even == 0) {
                     $pair_impair = "odd";
                     $odd_even = 1;
                 } else {
                     if ($odd_even == 1) {
                         $pair_impair = "even";
                         $odd_even = 0;
                     }
                 }
                 if ($data['arc_expl_notice']) {
                     $tr_javascript = " class='{$pair_impair}' onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./index.php?lvl=notice_display&id=" . $data['not_id'] . "&seule=1';\" style='cursor: pointer' ";
                 } else {
                     $tr_javascript = " class='{$pair_impair}' onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./index.php?lvl=bulletin_display&id=" . $data['arc_expl_bulletin'] . "';\" style='cursor: pointer' ";
                 }
                 $ret .= "<tr {$tr_javascript}>";
                 $ret .= "<td>" . $titre . "</td>";
                 $ret .= "<td>" . $auteur . "</td>";
                 $ret .= "</tr>\n";
             }
         }
         if ($ret) {
             $ret = "<h3 class='autres_lectures'>" . $msg['autres_lectures'] . "</h3><table style='width:100%;'>" . $ret . "</table>";
         }
     } else {
         $ret = "";
     }
     return $ret;
 }
예제 #11
0
function show_lig_cde_from_sug($sugchk)
{
    global $dbh, $charset;
    global $acquisition_gestion_tva;
    global $modif_cde_row_form, $deflt3lgstatcde;
    $form = "\t\n\t<script type='text/javascript'>\t\n\t\tacquisition_force_ttc='" . $msg["acquisition_force_ttc"] . "';\n\t\tacquisition_force_ht='" . $msg["acquisition_force_ht"] . "';\n\t</script>\n\t";
    $i = 0;
    $lgstat_form = lgstat::getHtmlSelect(array(0 => $deflt3lgstatcde), FALSE, array('id' => 'lg_statut[!!i!!]', 'name' => 'lg_statut[!!i!!]'));
    $arrchk = unserialize(rawurldecode(stripslashes($sugchk)));
    foreach ($arrchk as $value) {
        $i++;
        $sug = new suggestions($value);
        $form .= $modif_cde_row_form;
        $code = "";
        $taec = "";
        $prix = '0';
        $nb = 'none';
        if ($sug->num_notice) {
            $q = "select niveau_biblio from notices where notice_id='" . $sug->num_notice . "' ";
            $r = pmb_mysql_query($q, $dbh);
            if (pmb_mysql_num_rows($r)) {
                $nb = pmb_mysql_result($r, 0, 0);
            }
        }
        switch ($nb) {
            case 'a':
                $typ_lig = 1;
                $notice = new sel_article_display($sug->num_notice, '');
                $notice->getData();
                $notice->responsabilites = get_notice_authors($sug->num_notice);
                $notice->doHeader();
                $taec = $notice->titre;
                if ($notice->auteur1) {
                    $taec .= "\n" . $notice->auteur1;
                }
                if ($notice->in_bull) {
                    $taec .= "\n" . $notice->in_bull;
                }
                $prix = $notice->prix;
                break;
            case 'm':
                $typ_lig = 1;
                $notice = new sel_mono_display($sug->num_notice, '');
                $notice->getData();
                $notice->responsabilites = get_notice_authors($sug->num_notice);
                $notice->doHeader();
                $code = $notice->code;
                $taec = $notice->titre;
                if ($notice->auteur1) {
                    $taec .= "\n" . $notice->auteur1;
                }
                if ($notice->editeur1) {
                    $taec .= "\n" . $notice->editeur1;
                }
                if ($notice->editeur1 && $notice->ed_date) {
                    $taec .= ", " . $notice->ed_date;
                } elseif ($notice->ed_date) {
                    $taec .= $notice->ed_date;
                }
                if ($notice->collection) {
                    $taec .= "\n" . $notice->collection;
                }
                $prix = $notice->prix;
                break;
            default:
                $typ_lig = 0;
                $code = htmlentities($sug->code, ENT_QUOTES, $charset);
                $taec = htmlentities($sug->titre, ENT_QUOTES, $charset);
                if ($sug->auteur != "") {
                    $taec .= "\n" . htmlentities($sug->auteur, ENT_QUOTES, $charset);
                }
                if ($sug->editeur != "") {
                    $taec .= "\n" . htmlentities($sug->editeur, ENT_QUOTES, $charset);
                    if ($sug->date_publi != "0000-00-00") {
                        $taec .= "," . htmlentities($sug->date_publi, ENT_QUOTES, $charset);
                    }
                }
                $prix = htmlentities($sug->prix, ENT_QUOTES, $charset);
                break;
        }
        $form = str_replace('!!no!!', $i, $form);
        $form = str_replace('!!code!!', $code, $form);
        $form = str_replace('!!lib!!', $taec, $form);
        $form = str_replace('!!qte!!', $sug->nb, $form);
        $form = str_replace('!!prix!!', $prix, $form);
        if ($acquisition_gestion_tva) {
            $form = str_replace('!!tva!!', $row->tva, $form);
            if ($acquisition_gestion_tva == 1) {
                $prix_ttc = round($row->prix + $row->prix / 100 * $row->tva, 2);
                $onchange_tva = "\n\t\t\t\t\tonChange='document.getElementById(\"convert_ht_ttc_{$i}\").innerHTML=\n\t\t\t\t\t\tht_to_ttc(document.getElementById(\"prix[{$i}]\").value,document.getElementById(\"tva[{$i}]\").value);\n\t\t\t\t\t' ";
                $convert_prix = "\n\t\t\t\t\tonChange='document.getElementById(\"convert_ht_ttc_{$i}\").innerHTML=\n\t\t\t\t\t\tht_to_ttc(document.getElementById(\"prix[{$i}]\").value,document.getElementById(\"tva[{$i}]\").value);\n\t\t\t\t\t' ";
                $convert_ht_ttc = "\n\t\t\t\t<span class='convert_ht_ttc' id='convert_ht_ttc_{$i}' \n\t\t\t\t\tonclick='\n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").value=\"\";\n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").style.visibility=\"visible\"; \n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").focus();\n\t\t\t\t\t'\t\t\t\t\t\t\t\n\t\t\t\t>" . $prix_ttc . "</span>\n\t\t\t\t<input style='visibility:hidden' type='text' id='input_convert_ht_ttc_{$i}' name='convert_ht_ttc_{$i}' value='' \t\t\t\t\n\t\t\t\t\tonBlur='document.getElementById(\"input_convert_ht_ttc_{$i}\").style.visibility=\"hidden\";'\t\t\t\t\n\t\t\t\t\tonChange='document.getElementById(\"prix[{$i}]\").value=\n\t\t\t\t\t\tttc_to_ht(document.getElementById(\"input_convert_ht_ttc_{$i}\").value,document.getElementById(\"tva[{$i}]\").value);\n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").style.visibility=\"hidden\"; \n\t\t\t\t\t\tdocument.getElementById(\"convert_ht_ttc_{$i}\").innerHTML=document.getElementById(\"input_convert_ht_ttc_{$i}\").value;\n\t\t\t\t\t'  \n\t\t\t\t/>";
            } elseif ($acquisition_gestion_tva == 2) {
                $prix = $row->prix;
                $tva = $row->tva;
                $prix_ht = round($prix / ($tva / 100 + 1), 2);
                $onchange_tva = "\n\t\t\t\t\tonChange='document.getElementById(\"convert_ht_ttc_{$i}\").innerHTML=\n\t\t\t\t\t\tttc_to_ht(document.getElementById(\"prix[{$i}]\").value,document.getElementById(\"tva[{$i}]\").value);\n\t\t\t\t\t' ";
                $convert_prix = "\n\t\t\t\t\tonChange='document.getElementById(\"convert_ht_ttc_{$i}\").innerHTML=\n\t\t\t\t\t\tttc_to_ht(document.getElementById(\"prix[{$i}]\").value,document.getElementById(\"tva[{$i}]\").value);\n\t\t\t\t\t' ";
                $convert_ht_ttc = "\n\t\t\t\t<span class='convert_ht_ttc' id='convert_ht_ttc_{$i}' \n\t\t\t\t\tonclick='\n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").value=\"\";\n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").style.visibility=\"visible\"; \n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").focus();\n\t\t\t\t\t'\t\t\t\t\t\t\t\n\t\t\t\t>" . $prix_ht . "</span>\n\t\t\t\t<input style='visibility:hidden' type='text' id='input_convert_ht_ttc_{$i}' name='convert_ht_ttc_{$i}' value='{$prix_ttc}' \t\t\t\t\n\t\t\t\t\tonBlur='document.getElementById(\"input_convert_ht_ttc_{$i}\").style.visibility=\"hidden\";'\t\t\t\t\n\t\t\t\t\tonChange='document.getElementById(\"prix[{$i}]\").value=\n\t\t\t\t\t\tht_to_ttc(document.getElementById(\"input_convert_ht_ttc_{$i}\").value,document.getElementById(\"tva[{$i}]\").value);\n\t\t\t\t\t\tdocument.getElementById(\"input_convert_ht_ttc_{$i}\").style.visibility=\"hidden\"; \n\t\t\t\t\t\tdocument.getElementById(\"convert_ht_ttc_{$i}\").innerHTML=document.getElementById(\"input_convert_ht_ttc_{$i}\").value;\n\t\t\t\t\t'  \n\t\t\t\t/>";
            }
            if ($row->debit_tva == 1) {
                $force_ht_ttc = "<br />\n\t\t\t\t<input type='hidden' id='force_debit[{$i}]' name='force_debit[{$i}]' value='1' />\t\t\t\t\n\t\t\t\t<span class='force_ht_ttc' id='force_ht_ttc_{$i}'\t\t\t\t\n\t\t\t\t\tonclick='\n\t\t\t\t\t\tif(document.getElementById(\"force_debit[{$i}]\").value==1){\n\t\t\t\t\t\t\tdocument.getElementById(\"force_ht_ttc_{$i}\").innerHTML=\"" . $msg["acquisition_force_ttc"] . "\";\n\t\t\t\t\t\t\tdocument.getElementById(\"force_debit[{$i}]\").value=2;\n\t\t\t\t\t\t}else{\t\t\t\t\n\t\t\t\t\t\t\tdocument.getElementById(\"force_ht_ttc_{$i}\").innerHTML=\"" . $msg["acquisition_force_ht"] . "\";\n\t\t\t\t\t\t\tdocument.getElementById(\"force_debit[{$i}]\").value=1;\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t'\t\t\t\t\n\t\t\t\t>" . $msg["acquisition_force_ht"] . "</span>";
            } else {
                $force_ht_ttc = "<br />\n\t\t\t\t<input type='hidden' id='force_debit[{$i}]' name='force_debit[{$i}]' value='2' />\t\t\t\t\n\t\t\t\t<span class='force_ht_ttc' id='force_ht_ttc_{$i}'\t\t\t\t\n\t\t\t\t\tonclick='\n\t\t\t\t\t\tif(document.getElementById(\"force_debit[{$i}]\").value==2){\n\t\t\t\t\t\t\tdocument.getElementById(\"force_ht_ttc_{$i}\").innerHTML=\"" . $msg["acquisition_force_ht"] . "\";\n\t\t\t\t\t\t\tdocument.getElementById(\"force_debit[{$i}]\").value=1;\n\t\t\t\t\t\t}else{\t\t\t\t\n\t\t\t\t\t\t\tdocument.getElementById(\"force_ht_ttc_{$i}\").innerHTML=\"" . $msg["acquisition_force_ttc"] . "\";\n\t\t\t\t\t\t\tdocument.getElementById(\"force_debit[{$i}]\").value=2;\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t'\t\t\t\t\n\t\t\t\t>" . $msg["acquisition_force_ttc"] . "</span>";
            }
        }
        $form = str_replace('!!onchange_tva!!', $onchange_tva, $form);
        $form = str_replace('!!convert_prix!!', $convert_prix, $form);
        $form = str_replace('!!convert_ht_ttc!!', $convert_ht_ttc, $form);
        $form = str_replace('!!force_ht_ttc!!', $force_ht_ttc, $form);
        $form = str_replace('!!rem!!', '0.00', $form);
        $lgstat = str_replace('!!i!!', $i, $lgstat_form);
        $form = str_replace('!!lgstat!!', $lgstat, $form);
        $form = str_replace('!!comment_lg!!', htmlentities($row->commentaires_gestion, ENT_QUOTES, $charset), $form);
        $form = str_replace('!!comment_lo!!', htmlentities($row->commentaires_opac, ENT_QUOTES, $charset), $form);
        $form = str_replace('!!typ!!', '0', $form);
        $form = str_replace('!!lib_typ!!', '', $form);
        $form = str_replace('!!rub!!', '0', $form);
        $form = str_replace('!!lib_rub!!', '', $form);
        $form = str_replace('!!id_sug!!', $sug->id_suggestion, $form);
        $form = str_replace('!!id_lig!!', '0', $form);
        $form = str_replace('!!typ_lig!!', $typ_lig, $form);
        $form = str_replace('!!id_prod!!', $sug->num_notice, $form);
    }
    $t = array(0 => $i, 1 => $form);
    return $t;
}
예제 #12
0
 $requete .= " left join lenders lend on e.expl_owner=lend.idlender ";
 $requete .= " left join notices n on e.expl_notice=n.notice_id ";
 $requete .= " WHERE e.expl_cb='" . $noex . "'";
 $requete .= " LIMIT 1";
 $result = pmb_mysql_query($requete, $dbh) or die(pmb_mysql_error() . " " . $requete);
 if (pmb_mysql_num_rows($result)) {
     $item = pmb_mysql_fetch_object($result);
     $header = "";
     if ($item->tparent_id) {
         $serie = new serie($item->tparent_id);
         $tparent = $serie->name;
     }
     $tparent ? $header = $tparent : ($header = '');
     $item->tnvol && $header ? $header .= ", {$item->tnvol}" : ($header = '');
     $header ? $header .= '. ' : ($header = '');
     $responsabilites = get_notice_authors($item->notice_id);
     $as = array_search("0", $responsabilites["responsabilites"]);
     if ($as !== FALSE && $as !== NULL) {
         $auteur_0 = $responsabilites["auteurs"][$as];
         $auteur = new auteur($auteur_0["id"]);
         $header_aut .= $auteur->isbd_entry;
     } else {
         $aut1_libelle = array();
         $as = array_keys($responsabilites["responsabilites"], "1");
         for ($i = 0; $i < count($as); $i++) {
             $indice = $as[$i];
             $auteur_1 = $responsabilites["auteurs"][$indice];
             $auteur = new auteur($auteur_1["id"]);
             $aut1_libelle[] = $auteur->isbd_entry;
         }
         $header_aut .= implode(", ", $aut1_libelle);
예제 #13
0
 function notice_resa_planning($id_resa_print)
 {
     global $msg, $dbh, $charset;
     $dates_resa_sql = " date_format(resa_date_debut, '" . $msg["format_date"] . "') as aff_resa_date_debut, date_format(resa_date_fin, '" . $msg["format_date"] . "') as aff_resa_date_fin ";
     $requete = "SELECT notice_id, resa_date_debut, resa_date_fin, trim(tit1) as tit, " . $dates_resa_sql;
     $requete .= "FROM resa_planning LEFT JOIN notices ON resa_idnotice = notice_id  ";
     $requete .= "WHERE id_resa='" . $id_resa_print . "' ";
     $res = mysql_query($requete, $dbh) or die(mysql_error() . " {$requete}");
     $expl = mysql_fetch_object($res);
     $responsabilites = get_notice_authors($expl->notice_id);
     $as = array_search("0", $responsabilites["responsabilites"]);
     if ($as !== FALSE && $as !== NULL) {
         $auteur_0 = $responsabilites["auteurs"][$as];
         $auteur = new auteur($auteur_0["id"]);
         $header_aut .= $auteur->isbd_entry;
     } else {
         $aut1_libelle = array();
         $as = array_keys($responsabilites["responsabilites"], "1");
         for ($i = 0; $i < count($as); $i++) {
             $indice = $as[$i];
             $auteur_1 = $responsabilites["auteurs"][$indice];
             $auteur = new auteur($auteur_1["id"]);
             $aut1_libelle[] = $auteur->isbd_entry;
         }
         $header_aut .= implode(", ", $aut1_libelle);
     }
     $header_aut ? $auteur = " / " . $header_aut : ($auteur = "");
     $this->notice_resa_planning .= "\t<notice_resa>\n";
     $this->notice_resa_planning .= "\t\t<tit>" . htmlspecialchars($expl->tit, ENT_QUOTES, $charset) . "</tit>\n";
     $this->notice_resa_planning .= "\t\t<author>" . htmlspecialchars($auteur, ENT_QUOTES, $charset) . "</author>\n";
     $this->notice_resa_planning .= "\t\t<start_date>" . htmlspecialchars($expl->aff_resa_date_debut, ENT_QUOTES, $charset) . "</start_date>\n";
     $this->notice_resa_planning .= "\t\t<deadline>" . htmlspecialchars($expl->aff_resa_date_fin, ENT_QUOTES, $charset) . "</deadline>\n";
     $this->notice_resa_planning .= "\t</notice_resa>\n";
 }
 function also_borrowed($notice_id = 0, $bulletin_id = 0)
 {
     global $dbh, $msg;
     global $opac_autres_lectures_tri;
     global $opac_autres_lectures_nb_mini_emprunts;
     global $opac_autres_lectures_nb_maxi;
     global $opac_autres_lectures_nb_jours_maxi;
     global $opac_autres_lectures;
     global $gestion_acces_active, $gestion_acces_empr_notice;
     $results = array();
     if (!$opac_autres_lectures || !$notice_id && !$bulletin_id) {
         return $results;
     }
     if (!$opac_autres_lectures_nb_maxi) {
         $opac_autres_lectures_nb_maxi = 999999;
     }
     if ($opac_autres_lectures_nb_jours_maxi) {
         $restrict_date = " date_add(oal.arc_fin, INTERVAL {$opac_autres_lectures_nb_jours_maxi} day)>=sysdate() AND ";
     }
     if ($notice_id) {
         $pas_notice = " oal.arc_expl_notice!={$notice_id} AND ";
     }
     if ($bulletin_id) {
         $pas_bulletin = " oal.arc_expl_bulletin!={$bulletin_id} AND ";
     }
     // Ajout ici de la liste des notices lues par les lecteurs de cette notice
     $rqt_autres_lectures = "SELECT oal.arc_expl_notice, oal.arc_expl_bulletin, count(*) AS total_prets,\n\t\t\t\t\ttrim(concat(ifnull(notices_m.tit1,''),ifnull(notices_s.tit1,''),' ',ifnull(bulletin_numero,''), if(mention_date, concat(' (',mention_date,')') ,if (date_date, concat(' (',date_format(date_date, '%d/%m/%Y'),')') ,'')))) as tit, if(notices_m.notice_id, notices_m.notice_id, notices_s.notice_id) as not_id \n\t\t\t\tFROM ((((pret_archive AS oal JOIN\n\t\t\t\t\t(SELECT distinct arc_id_empr FROM pret_archive nbec where (nbec.arc_expl_notice='" . $notice_id . "' AND nbec.arc_expl_bulletin='" . $bulletin_id . "') AND nbec.arc_id_empr !=0) as nbec\n\t\t\t\t\tON (oal.arc_id_empr=nbec.arc_id_empr and oal.arc_id_empr!=0 and nbec.arc_id_empr!=0))\n\t\t\t\t\tLEFT JOIN notices AS notices_m ON arc_expl_notice = notices_m.notice_id )\n\t\t\t\t\tLEFT JOIN bulletins ON arc_expl_bulletin = bulletins.bulletin_id) \n\t\t\t\t\tLEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id)\n\t\t\t\tWHERE {$restrict_date} {$pas_notice} {$pas_bulletin} oal.arc_id_empr !=0\n\t\t\t\tGROUP BY oal.arc_expl_notice, oal.arc_expl_bulletin\n\t\t\t\tHAVING total_prets>={$opac_autres_lectures_nb_mini_emprunts} \n\t\t\t\tORDER BY {$opac_autres_lectures_tri} \n\t\t\t\t";
     $res_autres_lectures = pmb_mysql_query($rqt_autres_lectures);
     if (!$res_autres_lectures) {
         return $results;
     }
     if (pmb_mysql_num_rows($res_autres_lectures)) {
         $odd_even = 1;
         $inotvisible = 0;
         $aresult = array();
         //droits d'acces emprunteur/notice
         $acces_j = '';
         if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
             $ac = new acces();
             $dom_2 = $ac->setDomain(2);
             $acces_j = $dom_2->getJoin($_SESSION['id_empr_session'], 4, 'notice_id');
         }
         if ($acces_j) {
             $statut_j = '';
             $statut_r = '';
         } else {
             $statut_j = ',notice_statut';
             $statut_r = "and statut=id_notice_statut and ((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ")";
         }
         while ($data = pmb_mysql_fetch_array($res_autres_lectures)) {
             // $inotvisible<=$opac_autres_lectures_nb_maxi
             $requete = "SELECT  1  ";
             $requete .= " FROM notices {$acces_j} {$statut_j}  WHERE notice_id='" . $data[not_id] . "' {$statut_r} ";
             $myQuery = pmb_mysql_query($requete, $dbh);
             if (pmb_mysql_num_rows($myQuery) && $inotvisible <= $opac_autres_lectures_nb_maxi) {
                 // pmb_mysql_num_rows($myQuery)
                 $inotvisible++;
                 $titre = $data['tit'];
                 // **********
                 $responsab = array("responsabilites" => array(), "auteurs" => array());
                 // les auteurs
                 $responsab = get_notice_authors($data['not_id']);
                 $as = array_search("0", $responsab["responsabilites"]);
                 if ($as !== FALSE && $as !== NULL) {
                     $auteur_0 = $responsab["auteurs"][$as];
                     $auteur = new auteur($auteur_0["id"]);
                     $mention_resp = $auteur->isbd_entry;
                 } else {
                     $as = array_keys($responsab["responsabilites"], "1");
                     for ($i = 0; $i < count($as); $i++) {
                         $indice = $as[$i];
                         $auteur_1 = $responsab["auteurs"][$indice];
                         $auteur = new auteur($auteur_1["id"]);
                         $aut1_libelle[] = $auteur->isbd_entry;
                     }
                     $mention_resp = implode(", ", $aut1_libelle);
                 }
                 $mention_resp ? $auteur = $mention_resp : ($auteur = "");
                 // on affiche les résultats
                 if ($odd_even == 0) {
                     $pair_impair = "odd";
                     $odd_even = 1;
                 } else {
                     if ($odd_even == 1) {
                         $pair_impair = "even";
                         $odd_even = 0;
                     }
                 }
                 $aresult["notice_id"] = $data['not_id'];
                 $aresult["notice_title"] = $titre;
                 $aresult["notice_author"] = $auteur;
                 $results[] = $aresult;
             }
         }
     }
     return $results;
 }
예제 #15
0
        echo "<table class='fiche-lecteur' width=100%>";
        echo "<tr><td class='jauge' colspan='2'>" . $msg[circ_preteur] . "</td><td class='jauge'>" . $msg[296] . "</td><td class='jauge'>" . $msg[circ_CB] . "</td><td class='jauge'>" . $msg[233] . "</td><td class='jauge'>" . $msg[234] . "</td></tr>";
        break;
    default:
        $sql = $sql . " LIMIT " . $limite_mysql . ", " . $limite_page;
        echo "<h1>" . $msg[1110] . "&nbsp;:&nbsp;" . $msg[1113] . "</h1>";
        echo "<table class='fiche-lecteur' width=100%>";
        echo "<tr><td class='jauge' colspan='2'>" . $msg[circ_preteur] . "</td><td class='jauge'>" . $msg[296] . "</td><td class='jauge'>" . $msg[circ_CB] . "</td><td class='jauge'>" . $msg[233] . "</td><td class='jauge'>" . $msg[234] . "</td></tr>";
        break;
}
// on lance la requête (mysql_query) et on impose un message d'erreur si la requête ne se passe pas bien (or die)
$req = mysql_query($sql) or die("Erreur SQL !<br />" . $sql . "<br />" . mysql_error());
// on va scanner tous les tuples un par un
$odd_even = 0;
while ($data = mysql_fetch_array($req)) {
    $responsabilites = get_notice_authors($data['m_id'] + $data['s_id']);
    $as = array_search("0", $responsabilites["responsabilites"]);
    if ($as !== FALSE && $as !== NULL) {
        $auteur_0 = $responsabilites["auteurs"][$as];
        $auteur = new auteur($auteur_0["id"]);
        $header_aut .= $auteur->isbd_entry;
    } else {
        $aut1_libelle = array();
        $as = array_keys($responsabilites["responsabilites"], "1");
        for ($i = 0; $i < count($as); $i++) {
            $indice = $as[$i];
            $auteur_1 = $responsabilites["auteurs"][$indice];
            $auteur = new auteur($auteur_1["id"]);
            $aut1_libelle[] = $auteur->isbd_entry;
        }
        $header_aut .= implode(", ", $aut1_libelle);
예제 #16
0
 function check_fields($fields)
 {
     global $opac_show_book_pics;
     global $fonction_auteur;
     global $base_path;
     // informations sur les noms et fonctions des auteurs
     if ($fields & N_VALID_AUTHORS && !($this->validfields & N_VALID_AUTHORS)) {
         $this->responsabilites = get_notice_authors($this->id);
         $this->validfields = $this->validfields | N_VALID_AUTHORS;
     }
     // informations type de document
     if ($fields & N_VALID_TYPDOC && !($this->validfields & N_VALID_TYPDOC)) {
         if ($this->typdoc) {
             require_once $base_path . "/classes/marc_table.class.php";
             $doctype = new marc_list('doctype');
             $this->typdocdisplay = $doctype->table[$this->typdoc];
         }
         $this->validfields = $this->validfields | N_VALID_TYPDOC;
     }
     // informations langue du document et langue de l'original
     if ($fields & N_VALID_LANG && !($this->validfields & N_VALID_LANG)) {
         if ($this->lang_code || $this->org_lang_code) {
             require_once $base_path . "/classes/marc_table.class.php";
             $lang = new marc_list('lang');
             if ($this->lang_code) {
                 // libellé langue de la publication
                 $this->lang = $lang->table[$this->lang_code];
             }
             if ($this->org_lang_code) {
                 // libellé de la langue originale
                 $this->org_lang = $lang->table[$this->org_lang_code];
             }
         }
         $this->validfields = $this->validfields | N_VALID_LANG;
     }
     // informations collection et sous-colection
     if ($fields & N_VALID_COLLECTION && !($this->validfields & N_VALID_COLLECTION)) {
         if ($this->coll_id) {
             require_once $base_path . "/classes/collection.class.php";
             require_once $base_path . "/classes/publisher.class.php";
             $coll = new collection($this->coll_id);
             $this->coll = $coll->name;
         }
         if ($this->subcoll_id) {
             require_once $base_path . "/classes/collection.class.php";
             require_once $base_path . "/classes/subcollection.class.php";
             $subcoll = new subcollection($this->subcoll_id);
             $this->subcoll = $subcoll->name;
         }
         $this->validfields = $this->validfields | N_VALID_COLLECTION;
     }
     // informations éditeurs
     if ($fields & N_VALID_PUBLISHERS && !($this->validfields & N_VALID_PUBLISHERS)) {
         require_once $base_path . "/classes/publisher.class.php";
         if ($this->ed1_id) {
             $publisher = new publisher($this->ed1_id);
             $this->ed1 = $publisher->display;
         }
         if ($this->ed2_id) {
             $publisher = new publisher($this->ed2_id);
             $this->ed2 = $publisher->display;
         }
         $this->validfields = $this->validfields | N_VALID_PUBLISHERS;
     }
     // libellé du titre parent
     if ($fields & N_VALID_PARENT_TITLE && !($this->validfields & N_VALID_PARENT_TITLE)) {
         if ($this->tparent_id) {
             require_once $base_path . "/classes/serie.class.php";
             $serie = new serie($this->tparent_id);
             $this->tparent = $serie->name;
         }
         $this->validfields = $this->validfields | N_VALID_PARENT_TITLE;
     }
 }
예제 #17
0
 function doForm()
 {
     $this->getData();
     $this->responsabilites = get_notice_authors($this->notice_id);
     $this->doHeader();
     $this->doContent();
     $this->finalize();
 }
예제 #18
0
 function serial_display($id, $level = '1', $action_serial = '', $action_analysis = '', $action_bulletin = '', $lien_suppr_cart = "", $lien_explnum = "", $bouton_explnum = 1, $print = 0, $show_explnum = 1, $show_statut = 0, $show_opac_hidden_fields = true, $draggable = 0, $ajax_mode = 0, $anti_loop = '', $no_link = false, $show_map = 1)
 {
     global $pmb_recherche_ajax_mode;
     $this->show_map = $show_map;
     if ($pmb_recherche_ajax_mode) {
         $this->ajax_mode = $ajax_mode;
         if ($this->ajax_mode) {
             if (is_object($id)) {
                 $param['id'] = $id->notice_id;
             } else {
                 $param['id'] = $id;
             }
             $param['function_to_call'] = "serial_display";
             //if($level)$param['level']=$level;	//6
             if ($action_serial) {
                 $param['action_serial'] = $action_serial;
             }
             if ($action_analysis) {
                 $param['action_analysis'] = $action_analysis;
             }
             if ($action_bulletin) {
                 $param['action_bulletin'] = $action_bulletin;
             }
             //			  	if($lien_suppr_cart)$param['lien_suppr_cart']=$lien_suppr_cart;
             if ($lien_explnum) {
                 $param['lien_explnum'] = $lien_explnum;
             }
             if ($bouton_explnum) {
                 $param['bouton_explnum'] = $bouton_explnum;
             }
             if ($print) {
                 $param['print'] = $print;
             }
             //	if($show_explnum)$param['show_explnum']=$show_explnum;
             //if($show_statut)$param['show_statut']=$show_statut;
             //if($show_opac_hidden_fields)$param['show_opac_hidden_fields']=$show_opac_hidden_fields;
             //if($draggable)$param['draggable']=$draggable;//1
             $this->mono_display_cmd = serialize($param);
         }
     }
     $this->lien_explnum = $lien_explnum;
     $this->bouton_explnum = $bouton_explnum;
     $this->print_mode = $print;
     $this->show_explnum = $show_explnum;
     $this->show_statut = $show_statut;
     $this->anti_loop = $anti_loop;
     $this->no_link = $no_link;
     if (!$id) {
         return;
     } else {
         if (is_object($id)) {
             $this->notice_id = $id->notice_id;
             $this->notice = $id;
         } else {
             $this->notice_id = $id;
             $this->serial_display_fetch_data();
         }
     }
     $this->show_opac_hidden_fields = $show_opac_hidden_fields;
     if (!$this->ajax_mode) {
         $this->p_perso = new parametres_perso("notices");
     }
     $this->responsabilites = get_notice_authors($this->notice_id);
     // mise à jour des catégories
     if (!$this->ajax_mode) {
         $this->categories = get_notice_categories($this->notice_id);
     }
     //récupération des langues
     $this->langues = get_notice_langues($this->notice_id, 0);
     // langues de la publication
     $this->languesorg = get_notice_langues($this->notice_id, 1);
     // langues originales
     $this->level = $level;
     $this->lien_suppr_cart = $lien_suppr_cart;
     // si la notice est a2 (dépouillement), on récupère les données du bulletinage
     if ($this->notice->niveau_biblio == 'a' && $this->notice->niveau_hierar == 2) {
         $this->get_bul_info();
     }
     // mise à jour des liens
     if (SESSrights & CATALOGAGE_AUTH) {
         $this->action_serial_org = $action_serial;
         $this->action_analysis = $action_analysis;
         $this->action_bulletin = $action_bulletin;
         if ($action_serial && $this->notice->niveau_biblio == 's' && $this->notice->niveau_hierar == '1') {
             $this->action_serial = str_replace('!!id!!', $this->notice_id, $action_serial);
         }
         if ($action_analysis && $this->notice->niveau_biblio == 'a' && $this->notice->niveau_hierar == '2') {
             $this->action_analysis = str_replace('!!id!!', $this->notice_id, $this->action_analysis);
             $this->action_analysis = str_replace('!!bul_id!!', $this->bul_id, $this->action_analysis);
         }
         $this->lien_explnum = str_replace('!!serial_id!!', $this->notice_id, $this->lien_explnum);
         $this->lien_explnum = str_replace('!!analysis_id!!', $this->notice_id, $this->lien_explnum);
         $this->lien_explnum = str_replace('!!bul_id!!', $this->bul_id, $this->lien_explnum);
         $this->drag = $draggable;
     } else {
         $this->action_serial_org = "";
         $this->action_analysis = "";
         $this->action_bulletin = "";
         $this->action_serial = "";
         $this->lien_explnum = "";
         $this->drag = "";
     }
     $this->do_header();
     if ($level) {
         $this->init_javascript();
     }
     $this->isbd = 'ISBD';
     if (!$this->ajax_mode) {
         $this->childs = array();
         $requete = "select num_notice as notice_id,relation_type from notices_relations,notices where linked_notice=" . $this->notice_id . " and num_notice=notice_id order by relation_type, rank,create_date";
         $resultat = pmb_mysql_query($requete);
         if (pmb_mysql_num_rows($resultat)) {
             while ($r = pmb_mysql_fetch_object($resultat)) {
                 $this->childs[$r->relation_type][] = $r->notice_id;
             }
         }
     }
     switch ($level) {
         case 0:
             // là, c'est le niveau 0 : juste le header
             //$this->do_header();
             $this->result = $this->header;
             break;
         default:
             global $pmb_map_activate;
             $this->map = array();
             if ($pmb_map_activate) {
                 $ids[] = $this->notice_id;
                 $this->map = new map_objects_controler(TYPE_RECORD, $ids);
                 $this->map_info = new map_info($this->notice_id);
             }
             // niveau 1 et plus : header + isbd à générer
             //$this->do_header();
             if (!$this->ajax_mode) {
                 $this->do_isbd();
             }
             if (!$this->ajax_mode) {
                 $this->finalize();
             }
             break;
     }
     return;
 }
예제 #19
0
 $groupe_libelle = $data['libelle_groupe'];
 $responsable = $data['resp_groupe'];
 $empr_nom = $data['empr_nom'];
 $empr_prenom = $data['empr_prenom'];
 $empr_mail = $data['empr_mail'];
 $id_empr = $data['id_empr'];
 $empr_cb = $data['empr_cb'];
 $aff_pret_date = $data['aff_pret_date'];
 $aff_pret_retour = $data['aff_pret_retour'];
 $retard = $data['retard'];
 $cote_expl = $data['expl_cote'];
 $id_expl = $data['expl_cb'];
 $titre = $data['tit'];
 $support = $data['tdoc_libelle'];
 $header_aut = "";
 $responsabilites = get_notice_authors($data['idnot']);
 $as = array_search("0", $responsabilites["responsabilites"]);
 if ($as !== FALSE && $as !== NULL) {
     $auteur_0 = $responsabilites["auteurs"][$as];
     $auteur = new auteur($auteur_0["id"]);
     $header_aut .= $auteur->isbd_entry;
 } else {
     $aut1_libelle = array();
     $as = array_keys($responsabilites["responsabilites"], "1");
     for ($i = 0; $i < count($as); $i++) {
         $indice = $as[$i];
         $auteur_1 = $responsabilites["auteurs"][$indice];
         $auteur = new auteur($auteur_1["id"]);
         $aut1_libelle[] = $auteur->isbd_entry;
     }
     $header_aut .= implode(", ", $aut1_libelle);
예제 #20
0
function show_lig_dev_from_sug($sugchk)
{
    global $dbh, $charset;
    global $acquisition_gestion_tva;
    global $modif_dev_row_form;
    $form = "";
    $i = 0;
    $arrchk = unserialize(rawurldecode(stripslashes($sugchk)));
    foreach ($arrchk as $value) {
        $i++;
        $sug = new suggestions($value);
        $form .= $modif_dev_row_form;
        $code = "";
        $taec = "";
        $prix = '0';
        $nb = 'none';
        if ($sug->num_notice) {
            $q = "select niveau_biblio from notices where notice_id='" . $sug->num_notice . "' ";
            $r = pmb_mysql_query($q, $dbh);
            if (pmb_mysql_num_rows($r)) {
                $nb = pmb_mysql_result($r, 0, 0);
            }
        }
        switch ($nb) {
            case 'a':
                $typ_lig = 1;
                $notice = new sel_article_display($sug->num_notice, '');
                $notice->getData();
                $notice->responsabilites = get_notice_authors($sug->num_notice);
                $notice->doHeader();
                $taec = $notice->titre;
                if ($notice->auteur1) {
                    $taec .= "\n" . $notice->auteur1;
                }
                if ($notice->in_bull) {
                    $taec .= "\n" . $notice->in_bull;
                }
                $prix = $notice->prix;
                break;
            case 'm':
                $typ_lig = 1;
                $notice = new sel_mono_display($sug->num_notice, '');
                $notice->getData();
                $notice->responsabilites = get_notice_authors($sug->num_notice);
                $notice->doHeader();
                $code = $notice->code;
                $taec = $notice->titre;
                if ($notice->auteur1) {
                    $taec .= "\n" . $notice->auteur1;
                }
                if ($notice->editeur1) {
                    $taec .= "\n" . $notice->editeur1;
                }
                if ($notice->editeur1 && $notice->ed_date) {
                    $taec .= ", " . $notice->ed_date;
                } elseif ($notice->ed_date) {
                    $taec .= $notice->ed_date;
                }
                if ($notice->collection) {
                    $taec .= "\n" . $notice->collection;
                }
                $prix = $notice->prix;
                break;
            default:
                $typ_lig = 0;
                $code = htmlentities($sug->code, ENT_QUOTES, $charset);
                $taec = htmlentities($sug->titre, ENT_QUOTES, $charset);
                if ($sug->auteur != "") {
                    $taec .= "\n" . htmlentities($sug->auteur, ENT_QUOTES, $charset);
                }
                if ($sug->editeur != "") {
                    $taec .= "\n" . htmlentities($sug->editeur, ENT_QUOTES, $charset);
                }
                $prix = htmlentities($sug->prix, ENT_QUOTES, $charset);
                break;
        }
        $form = str_replace('!!no!!', $i, $form);
        $form = str_replace('!!code!!', $code, $form);
        $form = str_replace('!!lib!!', $taec, $form);
        $form = str_replace('!!qte!!', $sug->nb, $form);
        $form = str_replace('!!prix!!', $prix, $form);
        if ($acquisition_gestion_tva) {
            $form = str_replace('!!tva!!', '0.00', $form);
        }
        $form = str_replace('!!typ!!', '0', $form);
        $form = str_replace('!!lib_typ!!', '', $form);
        $form = str_replace('!!rem!!', '0.00', $form);
        $form = str_replace('!!id_sug!!', $sug->id_suggestion, $form);
        $form = str_replace('!!id_lig!!', '0', $form);
        $form = str_replace('!!id_prod!!', $sug->num_notice, $form);
    }
    $t = array(0 => $i, 1 => $form);
    return $t;
}
예제 #21
0
 function notice($id = 0, $cb = '')
 {
     global $dbh;
     global $msg;
     global $include_path, $class_path;
     global $deflt_notice_is_new;
     //On nettoie la variable de liens entre notices
     $this->notice_link = array();
     if ($id) {
         $fonction = new marc_list('function');
         $this->id = $id;
         $this->libelle_form = $msg[278];
         // libelle du form : modification d'une notice
         $requete = "SELECT * FROM notices WHERE notice_id='{$id}' LIMIT 1 ";
         $result = @pmb_mysql_query($requete, $dbh);
         if ($result) {
             $notice = pmb_mysql_fetch_object($result);
             $this->type_doc = $notice->typdoc;
             // type du document
             $this->tit1 = $notice->tit1;
             // titre propre
             $this->tit2 = $notice->tit2;
             // titre propre 2
             $this->tit3 = $notice->tit3;
             // titre parallele
             $this->tit4 = $notice->tit4;
             // complement du titre
             $this->tparent_id = $notice->tparent_id;
             // id du titre parent
             // libelle du titre parent
             if ($this->tparent_id) {
                 $serie = new serie($this->tparent_id);
                 $this->tparent = $serie->name;
             } else {
                 $this->tparent = '';
             }
             $this->tnvol = $notice->tnvol;
             // numero de partie
             $this->responsabilites = get_notice_authors($this->id);
             $this->subcoll_id = $notice->subcoll_id;
             // id sous collection
             $this->coll_id = $notice->coll_id;
             // id collection
             $this->ed1_id = $notice->ed1_id;
             // id editeur 1
             require_once "{$class_path}/editor.class.php";
             if ($this->subcoll_id) {
                 require_once "{$class_path}/subcollection.class.php";
                 require_once "{$class_path}/collection.class.php";
                 $collection = new subcollection($this->subcoll_id);
                 $this->subcoll = $collection->name;
             }
             if ($this->coll_id) {
                 require_once "{$class_path}/collection.class.php";
                 $collection = new collection($this->coll_id);
                 $this->coll = $collection->name;
             }
             if ($this->ed1_id) {
                 $editeur = new editeur($this->ed1_id);
                 $this->ed1 = $editeur->display;
             }
             $this->year = $notice->year;
             // annee de publication
             $this->nocoll = $notice->nocoll;
             // no. dans la collection
             $this->mention_edition = $notice->mention_edition;
             // mention d'edition (1ere, deuxieme...)
             $this->ed2_id = $notice->ed2_id;
             // id editeur 2
             if ($this->ed2_id) {
                 // libelle editeur 2
                 $editeur = new editeur($this->ed2_id);
                 $this->ed2 = $editeur->display;
             }
             $this->code = $notice->code;
             // ISBN, code barre commercial ou no. commercial
             $this->npages = $notice->npages;
             // importance materielle (nombre de pages, d'elements...)
             $this->ill = $notice->ill;
             // mention d'illustration
             $this->size = $notice->size;
             // format
             $this->prix = $notice->prix;
             // Prix du document
             $this->accomp = $notice->accomp;
             // materiel d'accompagnement
             $this->n_gen = $notice->n_gen;
             // note generale
             $this->n_contenu = $notice->n_contenu;
             // note de contenu
             $this->n_resume = $notice->n_resume;
             // resume/extrait
             $this->categories = get_notice_categories($this->id);
             $this->indexint = $notice->indexint;
             // indexation interne
             $this->index_l = $notice->index_l;
             // indexation libre
             $this->langues = get_notice_langues($this->id, 0);
             // langues de la publication
             $this->languesorg = get_notice_langues($this->id, 1);
             // langues originales
             $this->lien = $notice->lien;
             // URL de la ressource electronique associee
             $this->eformat = $notice->eformat;
             // format de la ressource electronique associee
             $this->biblio_level = $notice->niveau_biblio;
             // niveau bibliographique
             $this->hierar_level = $notice->niveau_hierar;
             // niveau hierarchique
             $this->statut = $notice->statut;
             $this->date_parution = notice::get_date_parution($notice->year);
             $this->indexation_lang = $notice->indexation_lang;
             $this->is_new = $notice->notice_is_new;
             $this->date_is_new = $notice->notice_date_is_new;
             //liens vers autres notices
             $requete = "SELECT * FROM notices_relations WHERE num_notice=" . $this->id . " OR linked_notice=" . $this->id . " order by rank";
             $result_rel = pmb_mysql_query($requete);
             if (pmb_mysql_num_rows($result_rel)) {
                 $i = 0;
                 while ($r_rel = pmb_mysql_fetch_object($result_rel)) {
                     if ($r_rel->linked_notice == $this->id) {
                         //notice en cours est notice fille
                         $this->notice_link['down'][$i]['relation_direction'] = 'down';
                         $this->notice_link['down'][$i]['id_notice'] = $r_rel->num_notice;
                         $this->notice_link['down'][$i]['title_notice'] = $this->get_notice_title($r_rel->num_notice);
                         $this->notice_link['down'][$i]['rank'] = $r_rel->rank;
                         $this->notice_link['down'][$i]['relation_type'] = $r_rel->relation_type;
                     } elseif ($r_rel->num_notice == $this->id) {
                         //notice en cours est notice mere
                         $this->notice_link['up'][$i]['relation_direction'] = 'up';
                         $this->notice_link['up'][$i]['id_notice'] = $r_rel->linked_notice;
                         $this->notice_link['up'][$i]['title_notice'] = $this->get_notice_title($r_rel->linked_notice);
                         $this->notice_link['up'][$i]['rank'] = $r_rel->rank;
                         $this->notice_link['up'][$i]['relation_type'] = $r_rel->relation_type;
                     }
                     $i++;
                 }
             }
             $this->commentaire_gestion = $notice->commentaire_gestion;
             $this->thumbnail_url = $notice->thumbnail_url;
             $this->create_date = $notice->create_date;
             $this->update_date = $notice->update_date;
         } else {
             require_once "{$include_path}/user_error.inc.php";
             error_message("", $msg[280], 1, "./catalog.php");
             $this->ok = 0;
         }
         return;
     } else {
         // initialisation des valeurs (vides)
         $this->libelle_form = $msg[270];
         // libelle du form : creation d'une notice
         $this->id = 0;
         $this->code = $cb;
         // initialisation avec les parametres du user :
         global $value_deflt_lang, $value_deflt_relation;
         if ($value_deflt_lang) {
             $lang = new marc_list('lang');
             $this->langues[] = array('lang_code' => $value_deflt_lang, 'langue' => $lang->table[$value_deflt_lang]);
         }
         global $deflt_notice_statut;
         if ($deflt_notice_statut) {
             $this->statut = $deflt_notice_statut;
         } else {
             $this->statut = 1;
         }
         global $xmlta_doctype;
         $this->type_doc = $xmlta_doctype;
         global $notice_parent;
         //relation montante ou descendante
         global $notice_parent_direction;
         if ($notice_parent) {
             if (!$notice_parent_direction) {
                 // Si pas de sens, on force a relation descendante
                 $notice_parent_direction = 'down';
             }
             $this->notice_link[$notice_parent_direction][0]['relation_direction'] = $notice_parent_direction;
             $this->notice_link[$notice_parent_direction][0]['id_notice'] = $notice_parent;
             $this->notice_link[$notice_parent_direction][0]['title_notice'] = $this->get_notice_title($notice_parent);
             $this->notice_link[$notice_parent_direction][0]['rank'] = 1;
             //Recherche d'un type plausible
             $requete = "SELECT relation_type FROM notices_relations WHERE num_notice='{$notice_parent}' ORDER BY rank DESC LIMIT 1";
             $resultat = pmb_mysql_query($requete);
             if (@pmb_mysql_num_rows($resultat)) {
                 $this->notice_link[$notice_parent_direction][0]['relation_type'] = pmb_mysql_result($resultat, 0, 0);
             } elseif (preg_match('/' . $notice_parent_direction . '$/', $value_deflt_relation)) {
                 $this->notice_link[$notice_parent_direction][0]['relation_type'] = $value_deflt_relation;
             } else {
                 /*
                  * Comment forcer le sens ?
                  * peut-etre l'inverse de la valeur par defaut si celle-ci ne va pas dans le bon sens ...
                  */
             }
         }
         $this->is_new = $deflt_notice_is_new;
         // penser au test d'existence de la notice sur code-barre
         return;
     }
 }
예제 #22
0
function electronic_loan_ticket_not_bull_info_resa($id_empr, $notice, $bulletin)
{
    global $msg, $dbh;
    $dates_resa_sql = "date_format(resa_date, '" . $msg["format_date"] . "') as date_pose_resa, IF(resa_date_fin>sysdate() or resa_date_fin='0000-00-00',0,1) as perimee, if(resa_date_debut='0000-00-00', '', date_format(resa_date_debut, '" . $msg["format_date"] . "')) as aff_resa_date_debut, if(resa_date_fin='0000-00-00', '', date_format(resa_date_fin, '" . $msg["format_date"] . "')) as aff_resa_date_fin ";
    if ($notice) {
        $requete = "SELECT resa_cb, notice_id, resa_date, resa_idempr, tit1 as tit, " . $dates_resa_sql;
        $requete .= "FROM notices, resa ";
        $requete .= "WHERE notice_id='" . $notice . "' and resa_idnotice=notice_id order by resa_date ";
    } else {
        $requete = "SELECT resa_cb, notice_id, resa_date, resa_idempr, trim(concat(tit1,' ',ifnull(bulletin_numero,''), if (mention_date, concat(' (',mention_date,')') ,''))) as tit, " . $dates_resa_sql;
        $requete .= "FROM bulletins, resa, notices ";
        $requete .= "WHERE resa_idbulletin='{$bulletin}' and resa_idbulletin = bulletins.bulletin_id and bulletin_notice = notice_id order by resa_date ";
    }
    $res = mysql_query($requete, $dbh) or die("<br />" . mysql_error());
    $nb_resa = mysql_num_rows($res);
    for ($j = 0; $j < $nb_resa; $j++) {
        $resa = mysql_fetch_object($res);
        if ($resa->resa_idempr == $id_empr) {
            $responsabilites = get_notice_authors($resa->notice_id);
            $as = array_search("0", $responsabilites["responsabilites"]);
            if ($as !== FALSE && $as !== NULL) {
                $auteur_0 = $responsabilites["auteurs"][$as];
                $auteur = new auteur($auteur_0["id"]);
                $header_aut .= $auteur->isbd_entry;
            } else {
                $aut1_libelle = array();
                $as = array_keys($responsabilites["responsabilites"], "1");
                for ($i = 0; $i < count($as); $i++) {
                    $indice = $as[$i];
                    $auteur_1 = $responsabilites["auteurs"][$indice];
                    $auteur = new auteur($auteur_1["id"]);
                    $aut1_libelle[] = $auteur->isbd_entry;
                }
                $header_aut .= implode(", ", $aut1_libelle);
            }
            $header_aut ? $auteur = " / " . $header_aut : ($auteur = "");
            $ret .= "<ul><li><b>" . $resa->tit . "</b> " . $auteur . "<blockquote>";
            if ($resa->aff_resa_date_debut) {
                $tmpmsg_res = $msg['fpdf_reserve_du'] . " " . $resa->aff_resa_date_debut . " " . $msg['fpdf_adherent_au'] . " " . $resa->aff_resa_date_fin;
                $requete_expl = "SELECT expl_cb, tdoc_libelle, section_libelle, location_libelle ";
                $requete_expl .= " FROM exemplaires, docs_type, docs_section, docs_location ";
                $requete_expl .= " WHERE expl_cb='" . addslashes($resa->resa_cb) . "' and expl_typdoc = idtyp_doc and expl_section = idsection and expl_location = idlocation ";
                $res_expl = mysql_query($requete_expl, $dbh) or die("<br />" . mysql_error());
                $expl = mysql_fetch_object($res_expl);
                $tmpmsg_res .= "<br /><em>" . $expl->location_libelle . "</em>: " . $expl->section_libelle;
            } else {
                $tmpmsg_res = $msg['fpdf_attente_valid'] . " / " . $msg['fpdf_rang'] . " " . ($j + 1) . " : " . $msg['fpdf_reserv_enreg'] . " " . $resa->date_pose_resa;
            }
            $ret .= $tmpmsg_res;
            $ret .= "</blockquote></li></ul><br />";
        }
    }
    // fin for
    return $ret;
}
예제 #23
0
 /**
  * 
  * Envoi de mail auto
  * @param $type_send READER=1,GROUP=2
  * @param $ident
  */
 function sendMailLoansRunning($type_send, $ident, $location_biblio)
 {
     global $dbh, $msg, $pmb_lecteurs_localises;
     global $mailretard_1fdp, $biblio_name, $biblio_email, $PMBuseremailbcc;
     $this->infos_biblio($location_biblio);
     if (!$relance) {
         $relance = 1;
     }
     // l'objet du mail
     $objet = $msg["prets_en_cours"];
     //Date de l'édition
     $date_edition = $msg['fpdf_edite'] . " " . formatdate(date("Y-m-d", time()));
     // la formule de politesse du bas (le signataire)
     $formule = $mailretard_1fdp;
     $texte_mail = $objet . "\r\n";
     $texte_mail .= $date_edition . "\r\n\r\n";
     //		if ($id_groupe) {
     //			//requete par rapport à un groupe d'emprunteurs
     //			$rqt1 = "select id_empr, empr_nom, empr_prenom from empr_groupe, empr, pret where groupe_id='".$id_groupe."' and empr_groupe.empr_id=empr.id_empr and pret.pret_idempr=empr_groupe.empr_id group by empr_id order by empr_nom, empr_prenom";
     //			$req1 = pmb_mysql_query($rqt1) or die($msg['err_sql'].'<br />'.$rqt1.'<br />'.pmb_mysql_error());
     //		}
     //
     //		if ($id_empr) {
     //			//requete par rapport à un emprunteur
     //			$rqt1 = "select id_empr, empr_nom, empr_prenom from empr_groupe, empr, pret where id_empr='".$id_empr."' and empr_groupe.empr_id=empr.id_empr and pret.pret_idempr=empr_groupe.empr_id group by empr_id order by empr_nom, empr_prenom";
     //			$req1 = pmb_mysql_query($rqt1) or die($msg['err_sql'].'<br />'.$rqt1.'<br />'.pmb_mysql_error());
     //		}
     if ($ident) {
         if ($type_send == 1) {
             //requete par rapport à un emprunteur
             $rqt1 = "select id_empr, empr_nom, empr_prenom from empr_groupe, empr, pret where id_empr='" . $ident . "' and empr_groupe.empr_id=empr.id_empr and pret.pret_idempr=empr_groupe.empr_id group by empr_id order by empr_nom, empr_prenom";
             $req1 = pmb_mysql_query($rqt1);
         } else {
             if ($type_send == 2) {
                 //requete par rapport à un groupe d'emprunteurs
                 $rqt1 = "select id_empr, empr_nom, empr_prenom from empr_groupe, empr, pret where groupe_id='" . $ident . "' and empr_groupe.empr_id=empr.id_empr and pret.pret_idempr=empr_groupe.empr_id group by empr_id order by empr_nom, empr_prenom";
                 $req1 = pmb_mysql_query($rqt1);
             }
         }
     }
     while ($data1 = pmb_mysql_fetch_array($req1)) {
         $id_empr = $data1['id_empr'];
         $texte_mail .= $data1['empr_nom'] . " " . $data1['empr_prenom'] . "\r\n\r\n";
         //Récupération des exemplaires
         $rqt = "select expl_cb from pret, exemplaires where pret_idempr='" . $id_empr . "' and pret_idexpl=expl_id order by pret_date ";
         $req = pmb_mysql_query($rqt);
         $i = 0;
         while ($data = pmb_mysql_fetch_array($req)) {
             /* Récupération des infos exemplaires et prêt */
             $requete = "SELECT notices_m.notice_id as m_id, notices_s.notice_id as s_id, expl_cb, pret_date, pret_retour, tdoc_libelle, section_libelle, location_libelle, trim(concat(ifnull(notices_m.tit1,''),ifnull(notices_s.tit1,''),' ',ifnull(bulletin_numero,''), if (mention_date, concat(' (',mention_date,')') ,''))) as tit, ";
             $requete .= " date_format(pret_date, '" . $msg["format_date"] . "') as aff_pret_date, ";
             $requete .= " date_format(pret_retour, '" . $msg["format_date"] . "') as aff_pret_retour, ";
             $requete .= " IF(pret_retour>sysdate(),0,1) as retard, notices_m.tparent_id, notices_m.tnvol ";
             $requete .= "FROM (((exemplaires LEFT JOIN notices AS notices_m ON expl_notice = notices_m.notice_id ) LEFT JOIN bulletins ON expl_bulletin = bulletins.bulletin_id) LEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id), docs_type, docs_section, docs_location, pret ";
             $requete .= "WHERE expl_cb='" . $data['expl_cb'] . "' and expl_typdoc = idtyp_doc and expl_section = idsection and expl_location = idlocation and pret_idexpl = expl_id  ";
             $res = pmb_mysql_query($requete, $dbh);
             $expl = pmb_mysql_fetch_object($res);
             $responsabilites = array();
             $header_aut = "";
             $responsabilites = get_notice_authors($expl->m_id + $expl->s_id);
             $as = array_search("0", $responsabilites["responsabilites"]);
             if ($as !== FALSE && $as !== NULL) {
                 $auteur_0 = $responsabilites["auteurs"][$as];
                 $auteur = new auteur($auteur_0["id"]);
                 $header_aut .= $auteur->isbd_entry;
             } else {
                 $aut1_libelle = array();
                 $as = array_keys($responsabilites["responsabilites"], "1");
                 for ($i = 0; $i < count($as); $i++) {
                     $indice = $as[$i];
                     $auteur_1 = $responsabilites["auteurs"][$indice];
                     $auteur = new auteur($auteur_1["id"]);
                     $aut1_libelle[] = $auteur->isbd_entry;
                 }
                 $header_aut .= implode(", ", $aut1_libelle);
             }
             $header_aut ? $auteur = " / " . $header_aut : ($auteur = "");
             // récupération du titre de série
             if ($expl->tparent_id && $expl->m_id) {
                 $parent = new serie($expl->tparent_id);
                 $tit_serie = $parent->name;
                 if ($expl->tnvol) {
                     $tit_serie .= ', ' . $expl->tnvol;
                 }
             }
             if ($tit_serie) {
                 $expl->tit = $tit_serie . '. ' . $expl->tit;
             }
             $texte_mail .= $expl->tit . $auteur . "\r\n";
             $texte_mail .= "    -" . $msg[fpdf_date_pret] . " : " . $expl->aff_pret_date . " " . $msg[fpdf_retour_prevu] . " : " . $expl->aff_pret_retour . "\r\n";
             $texte_mail .= "    -" . $expl->location_libelle . ": " . $expl->section_libelle . " (" . $expl->expl_cb . ")\r\n\r\n";
             $i++;
         }
     }
     $texte_mail .= $formule . "\r\n\r\n" . mail_bloc_adresse();
     /* Récupération du nom, prénom et mail de l'utilisateur */
     $requete = "select id_empr, empr_mail, empr_nom, empr_prenom from empr where id_empr={$id_empr}";
     $res = pmb_mysql_query($requete);
     $coords = pmb_mysql_fetch_object($res);
     $headers .= "Content-type: text/plain; charset=" . $charset . "\n";
     $res_envoi = mailpmb($coords->empr_prenom . " " . $coords->empr_nom, $coords->empr_mail, $objet, $texte_mail, $biblio_name, $biblio_email, $headers, "", $PMBuseremailbcc, 1);
     if ($res_envoi) {
         return sprintf($msg["mail_retard_succeed"], $coords->empr_mail);
     } else {
         return sprintf($msg["mail_retard_failed"], $coords->empr_mail);
     }
 }
예제 #24
0
 function mono_display($id, $level = 1, $action = '', $expl = 1, $expl_link = '', $lien_suppr_cart = "", $explnum_link = '', $show_resa = 0, $print = 0, $show_explnum = 1, $show_statut = 0, $anti_loop = '', $draggable = 0, $no_link = false, $show_opac_hidden_fields = true, $ajax_mode = 0, $show_planning = 0, $show_map = 1)
 {
     global $pmb_recherche_ajax_mode;
     global $categ;
     global $id_empr;
     $this->show_map = $show_map;
     if ($pmb_recherche_ajax_mode) {
         $this->ajax_mode = $ajax_mode;
         if ($this->ajax_mode) {
             if (is_object($id)) {
                 $param['id'] = $id->notice_id;
             } else {
                 $param['id'] = $id;
             }
             $param['function_to_call'] = "mono_display";
             //if($level)$param['level']=$level;	// à 6
             if ($action) {
                 $param['action'] = $action;
             }
             if ($expl) {
                 $param['expl'] = $expl;
             }
             if ($expl_link) {
                 $param['expl_link'] = $expl_link;
             }
             //		  	if($lien_suppr_cart)$param['lien_suppr_cart']=$lien_suppr_cart;
             if ($explnum_link) {
                 $param['explnum_link'] = $explnum_link;
             }
             //if($show_resa)$param['show_resa']=$show_resa;
             if ($print) {
                 $param['print'] = $print;
             }
             //if($show_explnum)$param['show_explnum']=$show_explnum;
             //if($show_statut)$param['show_statut']=$show_statut;
             //if($anti_loop)$param['anti_loop']=$anti_loop;
             //if($draggable)$param['draggable']=$draggable;
             if ($no_link) {
                 $param['no_link'] = $no_link;
             }
             if ($categ) {
                 $param['categ'] = $categ;
             }
             if ($id_empr) {
                 $param['id_empr'] = $id_empr;
             }
             //if($show_opac_hidden_fields)$param['show_opac_hidden_fields']=$show_opac_hidden_fields;
             $this->mono_display_cmd = serialize($param);
         }
     }
     if (!$id) {
         return;
     } else {
         if (is_object($id)) {
             $this->notice_id = $id->notice_id;
             $this->notice = $id;
             $this->langues = get_notice_langues($this->notice_id, 0);
             // langues de la publication
             $this->languesorg = get_notice_langues($this->notice_id, 1);
             // langues originales
             $this->isbn = $id->code;
             //Récupération titre de série
             if ($id->tparent_id) {
                 $parent = new serie($id->tparent_id);
                 $this->tit_serie = $parent->name;
                 $this->tit_serie_lien_gestion = $parent->isbd_entry_lien_gestion;
             }
         } else {
             $this->notice_id = $id;
             $this->mono_display_fetch_data();
         }
         if (!$this->ajax_mode || !$level) {
             $this->childs = array();
             $requete = "select num_notice as notice_id,relation_type from notices_relations,notices where linked_notice=" . $this->notice_id . " and num_notice=notice_id order by relation_type, rank,create_date";
             $resultat = pmb_mysql_query($requete);
             if (pmb_mysql_num_rows($resultat)) {
                 while ($r = pmb_mysql_fetch_object($resultat)) {
                     $this->childs[$r->relation_type][] = $r->notice_id;
                 }
             }
         }
     }
     global $memo_p_perso_notice;
     if (!$this->ajax_mode || !$level) {
         if (!$memo_p_perso_notice) {
             $memo_p_perso_notice = new parametres_perso("notices");
         }
         $this->p_perso = $memo_p_perso_notice;
     }
     $this->level = $level;
     $this->expl = $expl;
     $this->show_resa = $show_resa;
     $this->link_expl = $expl_link;
     $this->link_explnum = $explnum_link;
     $this->lien_suppr_cart = $lien_suppr_cart;
     // mise à jour des liens
     $this->action = $action;
     $this->drag = $draggable;
     $this->print_mode = $print;
     $this->show_explnum = $show_explnum;
     $this->show_statut = $show_statut;
     $this->no_link = $no_link;
     $this->anti_loop = $anti_loop;
     //affichage ou pas des champs persos OPAC masqués
     $this->show_opac_hidden_fields = $show_opac_hidden_fields;
     $this->action = str_replace('!!id!!', $this->notice_id, $this->action);
     $this->responsabilites = get_notice_authors($this->notice_id);
     // mise à jour des catégories
     if (!$this->ajax_mode || !$level) {
         $this->categories = get_notice_categories($this->notice_id);
     }
     $this->show_planning = $show_planning;
     $this->do_header();
     switch ($level) {
         case 0:
             // là, c'est le niveau 0 : juste le header
             $this->result = $this->header;
             break;
         default:
             global $pmb_map_activate;
             $this->map = new stdClass();
             $this->map_info = new stdClass();
             if ($pmb_map_activate) {
                 $ids[] = $this->notice_id;
                 $this->map = new map_objects_controler(TYPE_RECORD, $ids);
                 $this->map_info = new map_info($this->notice_id);
             }
             // niveau 1 et plus : header + isbd à générer
             $this->init_javascript();
             if (!$this->ajax_mode) {
                 $this->do_isbd();
             }
             $this->finalize();
             break;
     }
     return;
 }
예제 #25
0
파일: fpdf.inc.php 프로젝트: hogsim/PMB
function notice_resa_planning($id_resa_print, $x, $y, $largeur, $retrait, $link)
{
    global $ourPDF;
    global $msg;
    global $pmb_pdf_font;
    $dates_resa_sql = " date_format(resa_date_debut, '" . $msg["format_date"] . "') as aff_resa_date_debut, date_format(resa_date_fin, '" . $msg["format_date"] . "') as aff_resa_date_fin ";
    $requete = "SELECT notices_m.notice_id as m_id, notices_s.notice_id as s_id, resa_date_debut, resa_date_fin, ";
    $requete .= "trim(concat(if(series_m.serie_name <>'', if(notices_m.tnvol <>'', concat(series_m.serie_name,', ',notices_m.tnvol,'. '), concat(series_m.serie_name,'. ')), if(notices_m.tnvol <>'', concat(notices_m.tnvol,'. '),'')), ";
    $requete .= "if(series_s.serie_name <>'', if(notices_s.tnvol <>'', concat(series_s.serie_name,', ',notices_s.tnvol,'. '), series_s.serie_name), if(notices_s.tnvol <>'', concat(notices_s.tnvol,'. '),'')), ";
    $requete .= "ifnull(notices_m.tit1,''),ifnull(notices_s.tit1,''),' ',ifnull(bulletin_numero,''), if (mention_date, concat(' (',mention_date,')') ,''))) as tit, " . $dates_resa_sql;
    $requete .= "FROM (((resa_planning LEFT JOIN notices AS notices_m ON resa_idnotice = notices_m.notice_id ";
    $requete .= "LEFT JOIN series AS series_m ON notices_m.tparent_id = series_m.serie_id ) ";
    $requete .= "LEFT JOIN bulletins ON resa_idbulletin = bulletins.bulletin_id) ";
    $requete .= "LEFT JOIN notices AS notices_s ON bulletin_notice = notices_s.notice_id ";
    $requete .= "LEFT JOIN series AS series_s ON notices_s.tparent_id = series_s.serie_id ) ";
    $requete .= "WHERE id_resa='" . $id_resa_print . "' ";
    $res = pmb_mysql_query($requete, $link) or die(pmb_mysql_error() . " {$requete}");
    $expl = pmb_mysql_fetch_object($res);
    $responsabilites = get_notice_authors($expl->notice_id);
    $as = array_search("0", $responsabilites["responsabilites"]);
    if ($as !== FALSE && $as !== NULL) {
        $auteur_0 = $responsabilites["auteurs"][$as];
        $auteur = new auteur($auteur_0["id"]);
        $header_aut .= $auteur->isbd_entry;
    } else {
        $aut1_libelle = array();
        $as = array_keys($responsabilites["responsabilites"], "1");
        for ($i = 0; $i < count($as); $i++) {
            $indice = $as[$i];
            $auteur_1 = $responsabilites["auteurs"][$indice];
            $auteur = new auteur($auteur_1["id"]);
            $aut1_libelle[] = $auteur->isbd_entry;
        }
        $header_aut .= implode(", ", $aut1_libelle);
    }
    $header_aut ? $auteur = " / " . $header_aut : ($auteur = "");
    $ourPDF->SetXY($x, $y);
    $ourPDF->setFont($pmb_pdf_font, 'BU', 10);
    $ourPDF->multiCell($largeur - $x, 8, $expl->tit . $auteur, 0, 'L', 0);
    $ourPDF->SetXY($x + $retrait, $y + 4);
    $ourPDF->setFont($pmb_pdf_font, '', 10);
    $ourPDF->multiCell($largeur - $retrait - $x, 8, $msg['resa_planning_date_debut'] . " " . $expl->aff_resa_date_debut . " " . $msg['resa_planning_date_fin'] . " " . $expl->aff_resa_date_fin, 0, 'L', 0);
}