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> </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; }
} $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 {
/** * 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; }
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; }