예제 #1
0
 function show_consult_form($last_modified = 0)
 {
     global $idetat, $iduser, $idempr, $user_input;
     global $date_debut, $date_fin, $id_type, $id_theme, $dmde_loc;
     global $form_consult_dmde, $charset, $msg, $dbh, $demandes_init_workflow, $form_consult_linked_record;
     global $pmb_type_audit, $opac_demandes_no_action, $opac_demandes_allow_from_record;
     $form_consult_dmde = str_replace('!!form_title!!', htmlentities($this->titre_demande, ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!sujet_dmde!!', htmlentities($this->sujet_demande, ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!etat_dmde!!', htmlentities($this->workflow->getStateCommentById($this->etat_demande), ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!date_dmde!!', htmlentities(formatdate($this->date_demande), ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!date_butoir_dmde!!', htmlentities(formatdate($this->deadline_demande), ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!date_prevue_dmde!!', htmlentities(formatdate($this->date_prevue), ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!progression_dmde!!', htmlentities($this->progression . '%', ENT_QUOTES, $charset), $form_consult_dmde);
     for ($i = 0; $i < sizeof($this->users); $i++) {
         if ($i == sizeof($this->users) - 1) {
             $users .= htmlentities($this->users[$i]['nom'], ENT_QUOTES, $charset);
         } else {
             $users .= htmlentities($this->users[$i]['nom'], ENT_QUOTES, $charset) . " / ";
         }
     }
     $carac_empr = $this->getCaracEmpr($this->num_demandeur);
     $nom = $carac_empr['nom'];
     $cb = $carac_empr['empr_cb'];
     $nom_emprunteur = "";
     if (SESSrights & CIRCULATION_AUTH) {
         $nom_emprunteur = "<a href=\"circ.php?categ=pret&form_cb={$cb}\" >" . htmlentities($nom, ENT_QUOTES, $charset) . "</a>";
     }
     $form_consult_dmde = str_replace('!!demandeur!!', $nom_emprunteur ? $nom_emprunteur : $nom, $form_consult_dmde);
     $form_consult_dmde = str_replace('!!attribution!!', $users, $form_consult_dmde);
     $form_consult_dmde = str_replace('!!iddemande!!', $this->id_demande, $form_consult_dmde);
     $form_consult_dmde = str_replace('!!theme_dmde!!', htmlentities($this->theme_libelle, ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!type_dmde!!', htmlentities($this->type_libelle, ENT_QUOTES, $charset), $form_consult_dmde);
     if ($opac_demandes_allow_from_record && $this->num_linked_notice) {
         $record_datas = record_display::get_record_datas($this->num_linked_notice);
         $form_consult_dmde = str_replace('!!form_linked_record!!', $form_consult_linked_record, $form_consult_dmde);
         $form_consult_dmde = str_replace('!!linked_record!!', htmlentities($record_datas->get_tit1(), ENT_QUOTES, $charset), $form_consult_dmde);
         $form_consult_dmde = str_replace('!!linked_record_id!!', htmlentities($this->num_linked_notice, ENT_QUOTES, $charset), $form_consult_dmde);
         $form_consult_dmde = str_replace('!!linked_record_link!!', htmlentities($record_datas->get_permalink(), ENT_QUOTES, $charset), $form_consult_dmde);
     } else {
         $form_consult_dmde = str_replace('!!form_linked_record!!', "", $form_consult_dmde);
     }
     //Champs personalisés
     $perso_aff = "";
     $p_perso = new parametres_perso("demandes");
     if (!$p_perso->no_special_fields) {
         $perso_ = $p_perso->show_fields($this->id_demande);
         for ($i = 0; $i < count($perso_["FIELDS"]); $i++) {
             $p = $perso_["FIELDS"][$i];
             if ($p["AFF"] && $p["OPAC_SHOW"]) {
                 $perso_aff .= "<br />" . $p["TITRE"] . " " . nl2br($p["AFF"]);
             }
         }
     }
     if ($perso_aff) {
         $form_consult_dmde = str_replace("!!champs_perso!!", $perso_aff, $form_consult_dmde);
     } else {
         $form_consult_dmde = str_replace("!!champs_perso!!", "", $form_consult_dmde);
     }
     if (self::is_notice_visible($this)) {
         $link_noti = "<a href='" . $opac_url_base . "index.php?lvl=notice_display&id=" . $this->num_notice . "' alt='" . $msg['demandes_see_notice'] . "' title='" . $msg['demandes_see_notice'] . "'><img src='{$base_path}/images/mois.gif' /></a>";
     } else {
         $link_noti = "";
     }
     $form_consult_dmde = str_replace('!!icone!!', $link_noti, $form_consult_dmde);
     //construction de l'url de retour
     $params_retour = '';
     if ($idetat) {
         $params_retour .= "&idetat=" . $idetat;
     }
     // 		if($iduser){
     // 			$params_retour.="&iduser="******"&idempr=".$idempr;
     // 		}
     if ($user_input) {
         $params_retour .= "&user_input=" . $user_input;
     }
     if ($date_debut) {
         $params_retour .= "&date_debut=" . $date_debut;
     }
     if ($date_fin) {
         $params_retour .= "&date_fin=" . $date_fin;
     }
     if ($id_type) {
         $params_retour .= "&id_type=" . $id_type;
     }
     if ($id_theme) {
         $params_retour .= "&id_theme=" . $id_theme;
     }
     if ($dmde_loc) {
         $params_retour .= "&dmde_loc=" . $dmde_loc;
     }
     if ($params_retour) {
         $form_consult_dmde = str_replace('!!params_retour!!', htmlentities(stripslashes($params_retour), ENT_QUOTES, $charset), $form_consult_dmde);
     } else {
         $form_consult_dmde = str_replace('!!params_retour!!', "", $form_consult_dmde);
     }
     if (sizeof($this->users) && $demandes_init_workflow !== "2" && !$opac_demandes_no_action) {
         $listActionButton = '&nbsp;' . $msg['demandes_action_type_add'] . '&nbsp;';
         if (sizeof($this->allowed_actions)) {
             foreach ($this->allowed_actions as $key => $actionType) {
                 if ($actionType['active'] == 1) {
                     $listActionButton .= "<input type='button' class='bouton' value='" . htmlentities($actionType['comment'], ENT_QUOTES, $charset) . "' onClick=\"document.location='./empr.php?tab=request&lvl=list_dmde&sub=add_action&type_action=" . $actionType['id'] . "&iddemande={$this->id_demande}'\" />";
                 }
             }
         }
         if ($listActionButton) {
             $form_consult_dmde = str_replace('!!add_actions_list!!', $listActionButton, $form_consult_dmde);
         } else {
             $form_consult_dmde = str_replace('!!add_actions_list!!', "", $form_consult_dmde);
         }
     } else {
         $form_consult_dmde = str_replace('!!add_actions_list!!', "", $form_consult_dmde);
     }
     $modify_button = "";
     foreach ($this->workflow->object_states_by_id as $key => $value) {
         //id d'etat de demande par défaut
         if ($this->workflow->object_workflow['STARTSTATE'][0]['value'] == $value && $key == $this->etat_demande) {
             $modify_button = "<input type='button' class='bouton' value='" . $msg['demandes_modify'] . "' onClick=\"document.location='./empr.php?tab=request&lvl=list_dmde&sub=add_demande&iddemande={$this->id_demande}'\" />";
         }
     }
     $form_consult_dmde = str_replace('!!demande_modify!!', $modify_button, $form_consult_dmde);
     if (sizeof($this->users) && $demandes_init_workflow !== "2") {
         //Liste des actions
         $this->fetch_data($this->id_demande, false);
         if ($this->etat_demande == 4 || $this->etat_demande == 5) {
             $form_consult_dmde .= demandes_actions::show_list_actions($this->actions, $this->id_demande);
         } elseif ($last_modified) {
             $form_consult_dmde .= demandes_actions::show_list_actions($this->actions, $this->id_demande, $last_modified);
         } elseif ($this->last_modified) {
             $form_consult_dmde .= demandes_actions::show_list_actions($this->actions, $this->id_demande, $this->last_modified->id_action);
         } else {
             $form_consult_dmde .= demandes_actions::show_list_actions($this->actions, $this->id_demande);
         }
     }
     if ($this->etat_demande == 1 && !sizeof($this->actions) && $this->dmde_read_opac == 1) {
         demandes::demande_read($this->id_demande, true, "_opac");
         $this->fetch_data($this->id_demande, false);
     }
     print $form_consult_dmde;
 }
function aff_notice_fonction_django($id, $cart, $gen_header, $use_cache, $mode_aff_notice, $depliable, $nodocnum, $enrichment, $recherche_ajax_mode, $show_map, $recordmodes)
{
    global $aff_notice_table_pos;
    global $include_path;
    global $record_css_already_included;
    $retour_aff = "";
    $current_mode = $recordmodes->get_current_mode();
    $layout = $recordmodes->get_layout($current_mode);
    $template_mode = $recordmodes->get_template_directory($current_mode);
    if (!$template_mode) {
        $template_mode = "common";
    }
    if (!$record_css_already_included) {
        if (file_exists($include_path . "/templates/record/" . $template_mode . "/styles/style.css")) {
            $retour_aff .= "<link type='text/css' href='./includes/templates/record/" . $template_mode . "/styles/style.css' rel='stylesheet'></link>";
        }
        $record_css_already_included = true;
    }
    //Début du flux
    if ($id == -1) {
        if ($layout['TYPE'] == 'table') {
            $retour_aff .= "<table class='aff_notice_django'>";
            $aff_notice_table_pos = 0;
        } else {
            $retour_aff .= "<div class='row'>";
        }
    }
    if ($id == -2) {
        if ($layout['TYPE'] == 'table') {
            for ($i = $aff_notice_table_pos; $i < $layout['COLUMS']; $i++) {
                $retour_aff .= "<td>&nbsp;</td>";
            }
            if ($aff_notice_table_pos < $layout['COLUMS']) {
                $retour_aff .= "</tr>";
            }
            $retour_aff .= "</table>";
        } else {
            $retour_aff .= "<div class='aff_notice_django row'></div>";
            $retour_aff .= "</div>";
        }
    }
    if ($id >= 0) {
        if ($layout['TYPE'] == 'table') {
            if ($aff_notice_table_pos >= $layout['COLUMS']) {
                $aff_notice_table_pos = 0;
                $retour_aff .= "</tr>";
            }
            if (!$aff_notice_table_pos) {
                $retour_aff .= "<tr>";
            }
            $aff_notice_table_pos++;
            $retour_aff .= "<td>";
        } else {
            $retour_aff .= "<div class='aff_notice_django_notice'>";
        }
        switch ($lvl) {
            case 'notice_display':
            case 'bulletin_display':
            case 'resa':
                $retour_aff .= record_display::get_display_extended($id, $template_mode);
                break;
            case 'more_result':
            default:
                if ($search_type_asked == 'perio_a2z') {
                    $retour_aff .= record_display::get_display_extended($id, $template_mode);
                } else {
                    $retour_aff .= record_display::get_display_in_result($id, $template_mode);
                }
                break;
        }
        if ($layout['TYPE'] == 'table') {
            $retour_aff .= "</td>";
        } else {
            $retour_aff .= "</div>";
        }
    }
    return $retour_aff;
}
예제 #3
0
 /**
  * Retourne les dépouillements
  * @return string Tableau des affichage des articles
  */
 public function get_articles()
 {
     if (!isset($this->articles)) {
         global $dbh;
         $this->articles = array();
         $bul_info = $this->get_bul_info();
         $bulletin_id = $bul_info['bulletin_id'];
         $query = "SELECT analysis_notice FROM analysis, notices, notice_statut WHERE analysis_bulletin=" . $bulletin_id . " AND notice_id = analysis_notice 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)" : "") . ") order by analysis_notice";
         $result = @pmb_mysql_query($query, $dbh);
         if (pmb_mysql_num_rows($result)) {
             while ($article = pmb_mysql_fetch_object($result)) {
                 $this->articles[] = record_display::get_display_in_result($article->analysis_notice);
             }
         }
     }
     return $this->articles;
 }
     }
     $record_css_already_included = true;
 }
 // On récupère le libellé de Bulletinq
 if (!count($biblio_doc)) {
     $biblio_doc = new marc_list('nivbiblio');
     $biblio_doc = $biblio_doc->table;
 }
 $obj['biblio_doc'] = $biblio_doc['b'];
 // on va chercher les infos de dépouillements
 $obj['articles'] = array();
 $query = "SELECT * FROM analysis, notices, notice_statut WHERE analysis_bulletin='{$id}' AND notice_id = analysis_notice 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)" : "") . ") order by analysis_notice";
 $result = @pmb_mysql_query($query, $dbh);
 if (pmb_mysql_num_rows($result)) {
     while ($article = pmb_mysql_fetch_array($result)) {
         $obj['articles'][] = record_display::get_display_in_result($article["analysis_notice"]);
     }
 }
 // on va cherche les infos de résa
 $resas_datas = array('nb_resas' => 0, 'href' => "#", 'onclick' => "", 'flag_max_resa' => false, 'flag_resa_visible' => true, 'flag_resa_possible' => true);
 if ($expl_visible) {
     if (!$opac_resa_planning) {
         $resa_check = check_statut(0, $id);
         if ($resa_check) {
             $requete_resa = "SELECT count(1) FROM resa WHERE resa_idbulletin='{$id}'";
             $resas_datas['nb_resas'] = pmb_mysql_result(pmb_mysql_query($requete_resa, $dbh), 0, 0);
             if ($_SESSION["user_code"] && $allow_book && $opac_resa && !$popup_resa) {
                 if ($opac_max_resa == 0 || $opac_max_resa > $resas_datas['nb_resas']) {
                     if ($opac_resa_popup) {
                         $resas_datas['onclick'] = "if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;";
                     } else {
예제 #5
0
function aff_notice($id, $nocart = 0, $gen_header = 1, $use_cache = 0, $mode_aff_notice = "", $depliable = "", $nodocnum = 0, $enrichment = 1, $recherche_ajax_mode = 0, $show_map = 1)
{
    global $liens_opac;
    global $opac_notices_format;
    global $opac_notices_depliable;
    global $opac_cart_allow;
    global $opac_cart_only_for_subscriber;
    global $opac_notice_affichage_class;
    global $opac_notice_enrichment;
    global $opac_recherche_ajax_mode;
    global $opac_notices_format_onglets;
    global $lvl, $search_type_asked;
    global $record_css_already_included;
    // Pour pas inclure la css 10 fois
    global $recordmodes;
    if ($opac_cart_allow && !$opac_cart_only_for_subscriber || $opac_cart_allow && $_SESSION["user_code"]) {
        $cart = 1;
    } else {
        $cart = 0;
    }
    if ($nocart) {
        $cart = 0;
    }
    $id += 0;
    //Recherche des fonctions d'affichage
    $entete = '';
    if ($recordmodes && $id == -1) {
        $entete .= $recordmodes->show_mode_selector();
    }
    $f = get_aff_function();
    if ($f) {
        return $entete . $f($id, $cart, $gen_header, $use_cache, $mode_aff_notice, $depliable, $nodocnum, $enrichment, $recherche_ajax_mode, $show_map, $recordmodes);
    }
    if ($id > 0) {
        if ($mode_aff_notice !== "") {
            $type_aff = $mode_aff_notice;
        } else {
            $type_aff = $opac_notices_format;
        }
        if ($depliable === "") {
            $depliable = $opac_notices_depliable;
        }
        if ($type_aff != AFF_ETA_NOTICES_TEMPLATE_DJANGO) {
            $header_only = 0;
            if ($recherche_ajax_mode && $opac_recherche_ajax_mode) {
                //Si ajax, on ne charge pas tout
                $header_only = 1;
            }
            $current = new $opac_notice_affichage_class($id, $liens_opac, $cart, 0, $header_only, !$gen_header, $show_map);
            if ($nodocnum) {
                $current->docnum_allowed = 0;
            }
            if ($gen_header) {
                $current->do_header();
            }
            if (!$current->visu_notice) {
                return "";
            }
        }
        if ($opac_recherche_ajax_mode && $recherche_ajax_mode && $depliable && $type_aff != AFF_ETA_NOTICES_REDUIT && $type_aff != AFF_ETA_NOTICES_TEMPLATE_DJANGO) {
            $current->genere_ajax($type_aff, 0);
            $retour_aff .= $current->result;
        } else {
            switch ($type_aff) {
                case AFF_ETA_NOTICES_REDUIT:
                    $retour_aff .= $current->notice_header_with_link . "<br />";
                    break;
                case AFF_ETA_NOTICES_ISBD:
                    $current->do_isbd();
                    $current->genere_simple($depliable, 'ISBD');
                    $retour_aff .= $current->result;
                    break;
                case AFF_ETA_NOTICES_PUBLIC:
                    $current->do_public();
                    $current->genere_simple($depliable, 'PUBLIC');
                    $retour_aff .= $current->result;
                    break;
                case AFF_ETA_NOTICES_BOTH:
                    $current->do_isbd();
                    $current->do_public();
                    $current->genere_double($depliable, 'PUBLIC');
                    $retour_aff .= $current->result;
                    break;
                case AFF_ETA_NOTICES_BOTH_ISBD_FIRST:
                    $current->do_isbd();
                    $current->do_public();
                    $current->genere_double($depliable, 'ISBD');
                    $retour_aff .= $current->result;
                    break;
                case AFF_ETA_NOTICES_TEMPLATE_DJANGO:
                    global $include_path;
                    global $opac_notices_format_django_directory;
                    if (!$opac_notices_format_django_directory) {
                        $opac_notices_format_django_directory = "common";
                    }
                    if (!$record_css_already_included) {
                        if (file_exists($include_path . "/templates/record/" . $opac_notices_format_django_directory . "/styles/style.css")) {
                            $retour_aff .= "<link type='text/css' href='./includes/templates/record/" . $opac_notices_format_django_directory . "/styles/style.css' rel='stylesheet'></link>";
                        }
                        $record_css_already_included = true;
                    }
                    switch ($lvl) {
                        case 'notice_display':
                        case 'bulletin_display':
                        case 'resa':
                            $retour_aff .= record_display::get_display_extended($id);
                            break;
                        case 'more_result':
                        default:
                            if ($search_type_asked == 'perio_a2z') {
                                $retour_aff .= record_display::get_display_extended($id);
                            } else {
                                $retour_aff .= record_display::get_display_in_result($id);
                            }
                            break;
                    }
                    break;
                default:
                    $current->do_isbd();
                    $current->do_public();
                    $current->genere_double($depliable, 'autre');
                    $retour_aff .= $current->result;
                    $flag_no_onglet_perso = 1;
                    break;
            }
            /*			
            			$onglets_title="";
            			$onglets_content="";
            			if($opac_notices_format_onglets){
            				$onglets=explode(",", $opac_notices_format_onglets);
            				foreach($onglets as $id_tpl){
            					$notice_onglet=new notice_onglet($id_tpl);
            					$onglets_title.="
            					<li id='onglet_tpl_".$id_tpl."_".$id."'  class='isbd_public_inactive'>
            						<a href='#' title=\"".$notice_onglet->get_onglet_header()."\" onclick=\"show_what('tpl_".$id_tpl."_', '$id'); return false;\">".$notice_onglet->get_onglet_header()."</a>
            					</li>";
            		
            					$onglets_content.="
            					<div id='div_tpl_".$id_tpl."_".$id."' class='onglet_tpl' style='display:none;'>
            					".$notice_onglet->get_onglet_content($id)."
            					</div>";
            				}
            			}	
            			$retour_aff=str_replace('<!-- onglets_perso_list -->', $onglets_title, $retour_aff);
            			$retour_aff=str_replace('<!-- onglets_perso_content -->', $onglets_content, $retour_aff);
            */
            if (!$flag_no_onglet_perso) {
                $onglet_perso = new notice_onglets();
                $retour_aff = $onglet_perso->insert_onglets($id, $retour_aff);
            }
            if (!$depliable && $opac_notice_enrichment && $enrichment == 1) {
                $retour_aff .= "<script type='text/javascript'>getEnrichment('{$id}');</script>";
            }
        }
    }
    return $entete . $retour_aff;
}
 public function aff_scan_requests()
 {
     global $msg, $opac_scan_request_activate, $allow_scan_request;
     if ($opac_scan_request_activate && $_SESSION['id_empr_session'] && $allow_scan_request && !$this->affichage_scan_requests) {
         $this->affichage_scan_requests = "<h3>" . $msg['scan_request_scan'] . "</h3>" . record_display::get_display_scan_request($this->notice_id);
     }
     return $this->affichage_scan_requests;
 }