authority = $authority; } public function proceed($entity_type,$context=array()){ global $facettes_tpl; global $charset; facettes_root::set_facet_type('notices'); if(!isset($this->authority) || !is_object($this->authority)) { //Autorité inconnue return; } static::$template_directory = ""; $frbr_build = $this->get_frbr_build_instance($entity_type); $facettes_tpl = ''; $display_graph = false; if($frbr_build->has_page() && $frbr_build->has_cadres()) { //Nous avons aussi besoin de calculer les notices si les facettes sont affichées if($frbr_build->get_page()->get_parameter_value('records_list') || $frbr_build->get_page()->get_parameter_value('facettes_list')) { // LISTE DE NOTICES ASSOCIEES if ($frbr_build->get_page()->get_parameter_value('record_template_directory')) { static::$template_directory = $frbr_build->get_page()->get_parameter_value('record_template_directory'); } $this->authority->set_recordslist($this->get_recordslist()); } //récupération des données des jeux de données $datanodes_data = $frbr_build->get_datanodes_data(); $this->dom = new DOMDocument(); $this->dom->encoding = $charset; $old_errors_value = false; if(libxml_use_internal_errors(true)){ $old_errors_value = true; } $html = $this->authority->render($context); if($charset == "utf-8"){ $this->dom->loadHTML("".$html); }else{ $this->dom->loadHTML($html); } if (!$this->dom->getElementById('aut_details')) { $this->dom = $this->setAllId($this->dom); } foreach ($frbr_build->get_cadres() as $cadre) { if ($cadre['place_visibility']) { if($cadre['cadre_type']) { switch ($cadre['cadre_type']) { case 'isbd': $this->dom->getElementById("aut_details")->parentNode->appendChild($this->dom->importNode($this->dom->getElementById("aut_see"),true)); break; case 'records_list': $this->dom->getElementById("aut_details")->parentNode->appendChild($this->dom->importNode($this->dom->getElementById("aut_details_liste"),true)); break; case 'frbr_graph' : $graph_node = $this->dom->createElement("div"); $graph_node->setAttribute('id', 'frbr_entity_graph'); $this->dom->getElementById("aut_details")->parentNode->appendChild($graph_node); break; } } else { $view_instance = new $cadre['cadre_object']($cadre['id']); $html = $view_instance->show_cadre($datanodes_data); $tmp_dom = new domDocument(); if($charset == "utf-8"){ @$tmp_dom->loadHTML("".$html); }else{ @$tmp_dom->loadHTML($html); } if (!$tmp_dom->getElementById($view_instance->get_dom_id())) { $tmp_dom = $this->setAllId($tmp_dom); } $this->dom->getElementById("aut_details")->parentNode->appendChild($this->dom->importNode($tmp_dom->getElementById($view_instance->get_dom_id()),true)); } } if ($cadre['cadre_visible_in_graph']) { $display_graph = true; } } if(!$frbr_build->get_page()->get_parameter_value('isbd')) { $this->dom->getElementById("aut_details_container")->removeChild($this->dom->getElementById('aut_see')); } if(!$frbr_build->get_page()->get_parameter_value('records_list')) { $this->dom->getElementById("aut_details_container")->removeChild($this->dom->getElementById('aut_details_liste')); } //frbr_graph if ($this->dom->getElementById("frbr_entity_graph")) { if ($display_graph) { $this->build_graph(); } else { $this->dom->getElementById("frbr_entity_graph")->parentNode->removeChild($this->dom->getElementById("frbr_entity_graph")); } } print $this->dom->saveHTML(); libxml_use_internal_errors($old_errors_value); if($frbr_build->get_page()->get_parameter_value('facettes_list')) { // FACETTES $facettes_tpl = $this->get_facetteslist(); } } else { // LISTE DE NOTICES ASSOCIEES $this->authority->set_recordslist($this->get_recordslist()); print $this->authority->render($context); // FACETTES $facettes_tpl = $this->get_facetteslist(); } } protected function calculate_restrict_access_rights() { global $gestion_acces_active, $gestion_acces_empr_notice; $this->acces_j=''; if ($gestion_acces_active==1 && $gestion_acces_empr_notice==1) { $ac= new acces(); $dom_2= $ac->setDomain(2); $this->acces_j = $dom_2->getJoin($_SESSION['id_empr_session'],4,'notice_id'); } if($this->acces_j) { $this->statut_j=''; $this->statut_r=''; } else { $this->statut_j=',notice_statut'; if (!empty($this->get_clause_authority_id_recordslist())) { $this->statut_r .= 'and '; } $this->statut_r .= "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)":"").")"; } if(isset($_SESSION["opac_view"]) && $_SESSION["opac_view"] && isset($_SESSION["opac_view_query"]) && $_SESSION["opac_view_query"] ){ $opac_view_restrict=" notice_id in (select opac_view_num_notice from opac_view_notices_".$_SESSION["opac_view"].") "; $this->statut_r.=" and ".$opac_view_restrict; } } /** * Retourne les notices associées */ public function get_recordslist($only_records = false) { global $msg, $base_path, $class_path, $include_path; global $opac_visionneuse_allow, $opac_photo_filtre_mimetype, $link_to_visionneuse, $sendToVisionneuseByGet; global $opac_allow_bannette_priv, $allow_dsi_priv; global $opac_nb_aut_rec_per_page; global $opac_search_allow_refinement, $opac_allow_external_search; global $nbr_lignes, $page; global $opac_notices_depliable; global $begin_result_liste; global $add_cart_link; global $from; global $nb_per_page_custom; //droits d'acces emprunteur/notice $this->calculate_restrict_access_rights(); // comptage des notices associées if(!$nbr_lignes) { $requete = "SELECT COUNT(distinct notice_id) FROM notices ".$this->get_join_recordslist()." ".$this->acces_j." ".$this->statut_j; $requete.= " where ".$this->get_clause_authority_id_recordslist()." $this->statut_r "; $res = pmb_mysql_query($requete); $nbr_lignes = pmb_mysql_result($res, 0, 0); //Recherche des types doc $requete = "select distinct notices.typdoc from notices ".$this->get_join_recordslist()." ".$this->acces_j." ".$this->statut_j; $clause = " where ".$this->get_clause_authority_id_recordslist()." ".$this->statut_r." group by notices.typdoc"; if ($opac_visionneuse_allow){ $requete_noti = "select distinct notices.typdoc, count(explnum_id) as nbexplnum from notices ".$this->get_join_recordslist()." left join explnum on explnum_mimetype in ($opac_photo_filtre_mimetype) and explnum_notice = notice_id ".$this->acces_j." ".$this->statut_j." "; $requete_bull = "select distinct notices.typdoc, count(explnum_id) as nbexplnum from notices ".$this->get_join_recordslist()." left join bulletins on bulletins.num_notice = notice_id and bulletins.num_notice != 0 left join explnum on explnum_mimetype in ($opac_photo_filtre_mimetype) and explnum_bulletin != 0 and explnum_bulletin = bulletin_id ".$this->acces_j." ".$this->statut_j." "; $requete = "select distinct uni.typdoc, sum(nbexplnum) as nbexplnum from ($requete_noti $clause union $requete_bull $clause) as uni group by uni.typdoc"; }else{ $requete.= $clause; } $res = pmb_mysql_query($requete); $t_typdoc=array(); $nbexplnum_to_photo=0; if($res) { while ($tpd=pmb_mysql_fetch_object($res)) { $t_typdoc[]=$tpd->typdoc; if ($opac_visionneuse_allow) $nbexplnum_to_photo += $tpd->nbexplnum; } } $l_typdoc=implode(",",$t_typdoc); }else if ($opac_visionneuse_allow){ $clause = "where ".$this->get_clause_authority_id_recordslist()." ".$this->statut_r." group by notices.typdoc"; $requete_noti = "select distinct notices.typdoc, count(explnum_id) as nbexplnum from notices ".$this->get_join_recordslist()." left join explnum on explnum_mimetype in ($opac_photo_filtre_mimetype) and explnum_notice = notice_id ".$this->acces_j." ".$this->statut_j." "; $requete_bull = "select distinct notices.typdoc, count(explnum_id) as nbexplnum from notices ".$this->get_join_recordslist()." left join bulletins on bulletins.num_notice = notice_id and bulletins.num_notice != 0 left join explnum on explnum_mimetype in ($opac_photo_filtre_mimetype) and explnum_bulletin != 0 and explnum_bulletin = bulletin_id ".$this->acces_j." ".$this->statut_j." "; $requete = "select distinct uni.typdoc, sum(nbexplnum) as nbexplnum from ($requete_noti $clause union $requete_bull $clause) as uni group by uni.typdoc"; $res = pmb_mysql_query($requete); $nbexplnum_to_photo = 0; if($res) { while ($tpd=pmb_mysql_fetch_object($res)) { $nbexplnum_to_photo += $tpd->nbexplnum; } } } $recordslist = "
\n"; $only_recordslist.= aff_notice(-1); $nb=0; $recherche_ajax_mode=0; while(($obj=pmb_mysql_fetch_object($res))) { global $infos_notice; if($nb++>4) $recherche_ajax_mode=1; $only_recordslist.= pmb_bidi(aff_notice($obj->notice_id, 0, 1, 0, "", "", 0, 0, $recherche_ajax_mode, 1, static::$template_directory)); $infos_notice['nb_pages'] = ceil($nbr_lignes/$opac_nb_aut_rec_per_page); } $only_recordslist.= aff_notice(-2); $only_recordslist.= "\n"; pmb_mysql_free_result($res); if ($only_records) { return $only_recordslist; } $recordslist.= $only_recordslist; // $recordslist.= "
".$msg['categ_empty'].""; break; case 'authority_page_category': $recordslist.= $msg["categ_empty"]; global $auto_postage_form; if($auto_postage_form) $recordslist.= "