document.location='$opac_show_login_form_next';";
} else {
print "";
}
exit();
}
// connexion en cours et paramètre de rebond ailleurs que sur le compte emprunteur
if (($opac_show_login_form_next) && ($login) && ($first_log) && empty($direct_access) && ($lvl != 'change_password') && ($lvl != 'change_profil'))
die("");
if ($is_opac_included) {
$std_header = $inclus_header;
$footer = $inclus_footer;
}
// Enrichissement OPAC
if ($opac_notice_enrichment) {
require_once ($base_path . '/classes/enrichment.class.php');
$enrichment = new enrichment();
$std_header = str_replace('!!enrichment_headers!!', $enrichment->getHeaders(), $std_header);
} else
$std_header = str_replace('!!enrichment_headers!!', "", $std_header);
// si $opac_show_homeontop est à 1 alors on affiche le lien retour à l'accueil sous le nom de la bibliothèque dans la fiche empr
if ($opac_show_homeontop == 1)
$std_header = str_replace('!!home_on_top!!', $home_on_top, $std_header);
else
$std_header = str_replace('!!home_on_top!!', '', $std_header);
// mise à jour du contenu opac_biblio_main_header
$std_header = str_replace('!!main_header!!', $opac_biblio_main_header, $std_header);
// RSS
$std_header = str_replace('!!liens_rss!!', genere_link_rss(), $std_header);
// l'image $logo_rss_si_rss est calculée par genere_link_rss() en global
$liens_bas = str_replace('', $logo_rss_si_rss, $liens_bas);
if ($opac_parse_html || $cms_active) {
ob_start();
}
if(!isset($dest)) $dest = '';
if (! $dest) {
print $std_header;
require_once ($base_path . '/includes/navigator.inc.php');
require_once ($class_path . '/serialcirc_empr.class.php');
if ($opac_empr_code_info && $log_ok)
print $opac_empr_code_info;
}
if(!isset($tab)) $tab = '';
if (! $tab) {
switch ($lvl) {
case 'change_password' :
case 'valid_change_password' :
case 'message' :
case 'change_profil' :
case 'renewal' :
case 'delete_account' :
$tab = 'account';
break;
case 'all' :
case 'old' :
case 'pret' :
case 'retour' :
$tab = 'loan';
break;
case 'bannette' :
case 'bannette_gerer' :
case 'bannette_creer' :
case 'bannette_edit' :
case 'bannette_unsubscribe' :
$tab = 'dsi';
break;
case 'make_sugg' :
case 'make_multi_sugg' :
case 'import_sugg' :
case 'transform_to_sugg' :
case 'valid_sugg' :
case 'view_sugg' :
case 'suppr_sugg' :
$tab = 'sugg';
break;
case 'private_list' :
case 'public_list' :
$tab = 'lecture';
break;
case 'demande_list' :
case 'do_dmde' :
case 'list_dmde' :
$tab = 'request';
break;
case 'scan_requests_list' :
$tab = 'scan_requests';
break;
case 'pnb' :
$tab = 'pnb';
break;
default :
$tab = 'account';
break;
}
}
if ($log_ok) {
require_once ($base_path . '/empr/empr.inc.php');
if (! $dest) {
/* Affichage du bandeau action en bas de la page. A externaliser dans le template */
$empr_onglet_menu = "
- " . htmlentities($msg['empr_menu_account'], ENT_QUOTES, $charset) . "
";
if ($allow_loan || $allow_loan_hist || ($allow_book && $opac_resa)) {
$onglet_lib = array ();
if ($allow_loan || $allow_loan_hist) {
$onglet_lib[] = $msg['empr_menu_loan'];
}
if ($allow_book && $opac_resa) {
$onglet_lib[] = $msg['empr_menu_resa'];
}
$empr_onglet_menu .= "- ";
$empr_onglet_menu .= htmlentities(implode(" / ", $onglet_lib), ENT_QUOTES, $charset);
$empr_onglet_menu .= "
";
}
if (($opac_dsi_active) && ($allow_dsi || $allow_dsi_priv))
$empr_onglet_menu .= "- " . htmlentities($msg['empr_menu_dsi'], ENT_QUOTES, $charset) . "
";
if ($opac_show_suggest && $allow_sugg)
$empr_onglet_menu .= "- " . htmlentities($msg['empr_menu_sugg'], ENT_QUOTES, $charset) . "
";
if ($opac_shared_lists && $allow_liste_lecture)
$empr_onglet_menu .= "- " . htmlentities($msg['empr_menu_lecture'], ENT_QUOTES, $charset) . "
";
if ($opac_demandes_active && $allow_dema) {
$empr_onglet_menu .= "- " . htmlentities($msg['empr_menu_dmde'], ENT_QUOTES, $charset) . "
";
}
if ($opac_serialcirc_active && $allow_serialcirc) {
$empr_onglet_menu .= "- " . htmlentities($msg['empr_menu_serialcirc'], ENT_QUOTES, $charset) . "
";
}
if ($opac_scan_request_activate && $allow_scan_request) {
$empr_onglet_menu .= "- " . htmlentities($msg['empr_menu_scan_requests'], ENT_QUOTES, $charset) . "
";
}
if ($opac_contribution_area_activate && $allow_contribution) {
$empr_onglet_menu .= "- " . htmlentities($msg['empr_menu_contribution_area'], ENT_QUOTES, $charset) . "
";
}
if ($allow_pnb) {
$empr_onglet_menu .= "- " . htmlentities($msg['empr_menu_pnb'], ENT_QUOTES, $charset) . "
";
}
if (function_exists('empr_extended_bandeau')) {
empr_extended_bandeau($tab);
}
$empr_onglet_menu .= '
';
print $empr_onglet_menu;
$subitems ='';
switch ($tab) {
case 'loan' :
case 'reza' :
case 'loan_reza' :
// Prêts - Réservations
$loan_reza_item = '
';
if ($allow_loan) {
$loan_reza_item .= "
- " . htmlentities($msg['empr_bt_show_all'], ENT_QUOTES, $charset) . "
";
}
if ($allow_loan_hist) {
$loan_reza_item .= "
- " . htmlentities($msg['empr_bt_show_old'], ENT_QUOTES, $charset) . "
";
}
if ($allow_book) {
if ($opac_resa) {
$loan_reza_item .= "- " . htmlentities($msg['empr_bt_show_resa'], ENT_QUOTES, $charset) . "
";
}
if ($opac_resa_planning) {
$loan_reza_item .= '- ' . htmlentities($msg['empr_bt_show_resa_planning'], ENT_QUOTES, $charset) . '
';
}
}
if ($opac_allow_self_checkout) {
if (($opac_allow_self_checkout == 1 || $opac_allow_self_checkout == 3) && ($allow_self_checkout)) {
$loan_reza_item .= "- " . htmlentities($msg['empr_bt_checkout'], ENT_QUOTES, $charset) . "
";
}
if (($opac_allow_self_checkout == 2 || $opac_allow_self_checkout == 3) && ($allow_self_checkout)) {
$loan_reza_item .= "- " . htmlentities($msg['empr_bt_checkin'], ENT_QUOTES, $charset) . "
";
}
}
$loan_reza_item .= "
";
$subitems .= '
'. $loan_reza_item .'
';
break;
case 'dsi' :
// Mes abonnements
$abo_item = "
";
if ($opac_dsi_active && $lvl == "bannette" && empty($id_bannette)) {
$abo_item .= "
";
}
$subitems .= '
'. $abo_item .'
';
break;
case 'sugg' :
// Mes suggestions
if ($opac_show_suggest && $allow_sugg) {
$sugg_onglet = "
";
}
$subitems .= '
'. $sugg_onglet .'
';
break;
case 'lecture' :
// Mes listes de lecture
if ($opac_shared_lists && $allow_liste_lecture) {
$liste_onglet = "
";
}
$subitems .= '
'. $liste_onglet .'
';
break;
case 'request' :
// Mes demandes de recherche
if ($demandes_active && $opac_demandes_active && $allow_dema) {
$demandes_onglet = "
";
}
$subitems .= '
'. $demandes_onglet .'
';
break;
case "serialcirc" :
if ($opac_serialcirc_active) {
$nb_virtual = count(serialcirc_empr::get_virtual_abo());
$serialcirc_submenu = "
";
$subitems .= '
'. $serialcirc_submenu .'
';
break;
}
case 'scan_requests' :
// Mes demandes de numérisation
$subitems .= '
';
break;
case 'contribution_area' :
global $opac_contribution_area_activate, $allow_contribution;
global $lvl, $msg, $charset;
$contribution_area_submenu = '';
if ($opac_contribution_area_activate && $allow_contribution) {
$contribution_area_submenu = '
';
global $gestion_acces_active, $gestion_acces_contribution_moderator_empr;
if (($gestion_acces_active == 1) && ($gestion_acces_contribution_moderator_empr == 1)) {
$contribution_area_submenu .= '';
}
$contribution_area_submenu .= "
";
}
$subitems .= '
'. $contribution_area_submenu .'
';
break;
case 'pnb' :
//Mon prêt numérique
if($allow_pnb) {
$pnb_submenu = '
';
}
$subitems = '
'.$pnb_submenu.'
';
break;
default :
if (function_exists('empr_extended_tab_default')) {
if (empr_extended_tab_default($tab))
break;
}
// Mon Compte
$my_account_item ='';
if (! $empr_ldap && $allow_pwd) {
$my_account_item .= "
" . htmlentities($msg['empr_modify_password'], ENT_QUOTES, $charset) . "";
}
if(emprunteur_display::is_renewal_form_set() ){
$my_account_item .= "
" . htmlentities($msg['empr_change_profil'], ENT_QUOTES, $charset) . "";
}
global $pmb_relance_adhesion;
if ($empr_active_opac_renewal && strtotime($empr_date_expiration) <= (time() + ($pmb_relance_adhesion* 86400))) {
$my_account_item .= "
" . htmlentities($msg['empr_renewal'], ENT_QUOTES, $charset) . "";
}
if (!empty($my_account_item)){
$subitems .= '
';
}
break;
}
$subitems .= '
';
print $subitems;
}
switch ($lvl) {
case 'change_password' :
$change_password_checked = " checked";
require_once ($base_path . '/empr/change_password.inc.php');
break;
case 'change_profil' :
require_once ($base_path . '/empr/change_profil.inc.php');
break;
case 'renewal' :
require_once ($base_path . '/empr/renewal.inc.php');
break;
case 'delete_account' :
require_once ($base_path . '/empr/delete_account.inc.php');
break;
case 'message' :
$message_checked = " checked";
require_once ($base_path . '/empr/message.inc.php');
break;
case 'all' :
case 'resa_planning' :
$all_checked = " checked";
if (! $dest) {
print "\n";
print '
' . $msg['empr_loans'] . '
';
}
$critere_requete = " AND empr.empr_login='$login' order by location_libelle, pret_retour ";
require_once ($base_path . '/empr/all.inc.php');
print "";
if(dilicom::is_pnb_active()){
print "\n";
require_once ($base_path . '/empr/pnb_loan.inc.php');
print "
";
}
print '';
if ($allow_book) {
include ($base_path . '/includes/resa.inc.php');
print '
';
include ($base_path . '/includes/resa_planning.inc.php');
print '
';
} else {
print $msg['empr_no_allow_book'];
}
print '
';
break;
case 'old' :
if (! $dest) {
print "\n";
print '
' . $msg['empr_loans_old'] . '
';
}
require_once ($base_path . '/empr/old.inc.php');
print "\n";
break;
case 'bannette' :
print "\n";
if ($allow_dsi_priv || $allow_dsi)
require_once ($base_path . '/includes/bannette.inc.php');
else
print $msg['empr_no_allow_dsi'];
print "
";
break;
case 'bannette_gerer' :
print "\n";
if ($allow_dsi_priv || $allow_dsi)
require_once ($base_path . '/includes/bannette_gerer.inc.php');
else
print $msg['empr_no_allow_dsi'];
print "
";
break;
case 'bannette_creer' :
print "\n";
if ($allow_dsi_priv)
require_once ($base_path . '/includes/bannette_creer.inc.php');
else
print $msg['empr_no_allow_dsi_priv'];
print "
";
break;
case 'bannette_edit' :
print "\n";
if ($allow_dsi_priv)
require_once ($base_path . '/includes/bannette_edit.inc.php');
else
print $msg['empr_no_allow_dsi_priv'];
print "
";
break;
case 'bannette_unsubscribe' :
print "\n";
if ($allow_dsi_priv)
require_once ($base_path . '/includes/bannette_unsubscribe.inc.php');
else
print $msg['empr_no_allow_dsi_priv'];
print "
";
break;
case 'make_sugg' :
print "\n";
if ($allow_sugg)
require_once ($base_path . '/empr/make_sugg.inc.php');
else
print $msg['empr_no_allow_sugg'];
print "
";
break;
case 'make_multi_sugg' :
print "\n";
if ($allow_sugg) {
require_once ($base_path . '/empr/make_multi_sugg.inc.php');
} else
print $msg['empr_no_allow_sugg'];
print "
";
break;
case 'import_sugg' :
print "\n";
if ($allow_sugg) {
require_once ($base_path . '/empr/import_sugg.inc.php');
} else
print $msg['empr_no_allow_sugg'];
print "
";
break;
case 'transform_to_sugg' :
print "\n";
if ($allow_sugg) {
require_once ($base_path . '/empr/make_multi_sugg.inc.php');
} else
print $msg['empr_no_allow_sugg'];
print "
";
break;
case 'valid_sugg' :
print "\n";
if ($allow_sugg)
require_once ($base_path . '/empr/valid_sugg.inc.php');
else
print $msg['empr_no_allow_sugg'];
print "
";
break;
case 'view_sugg' :
print "\n";
require_once ($base_path . '/empr/view_sugg.inc.php');
print "
";
break;
case 'suppr_sugg' :
if ($allow_sugg && $id_sug) {
suggestions::delete($id_sug);
}
print "\n";
require_once ($base_path . '/empr/view_sugg.inc.php');
print "
";
break;
case 'private_list' :
case 'public_list' :
case 'demande_list' :
print "\n";
require_once ($base_path . '/empr/liste_lecture.inc.php');
print "
";
break;
case 'list_dmde' :
print "\n";
if ($allow_dema) {
$nb_themes = demandes_themes::get_qty();
$nb_types = demandes_types::get_qty();
if ($nb_themes && $nb_types) {
require_once ($class_path . '/demandes.class.php');
$tmp = demandes::get_first_tab();
if ($tmp && ! $sub) {
$sub = $tmp;
}
require_once ($base_path . '/empr/liste_demande.inc.php');
} else {
print $msg['empr_dema_not_configured'];
}
} else
print $msg['empr_no_allow_dema'];
print "
";
break;
case 'pret' :
print "\n";
print "
" . $msg['empr_checkout_title'] . "
";
require_once ($base_path . '/empr/self_checkout.inc.php');
print "";
break;
case 'retour' :
print "\n";
print "
" . $msg['empr_checkin_title'] . "
";
require_once ($base_path . '/empr/self_checkin.inc.php');
print "";
break;
// circulation des périos
case "list_abo" :
case "list_virtual_abo" :
case "add_resa" :
case "copy" :
case "point" :
case "ask" :
if ($opac_serialcirc_active) {
print "";
require_once ($base_path . '/empr/serialcirc.inc.php');
print "
";
break;
}
case "scan_requests_list" :
case "scan_request" :
print "\n";
if ($allow_scan_request) {
require_once ($base_path . '/empr/scan_requests.inc.php');
} else {
print $msg['empr_no_allow_scan_requests'];
}
print "
";
break;
case "contribution_area_new" :
case "contribution_area_list" :
case "contribution_area_list_draft" :
case "contribution_area_done" :
case "contribution_area_moderation" :
print "\n";
if ($opac_contribution_area_activate && $allow_contribution) {
require_once ($base_path . '/empr/contribution_area.inc.php');
} else {
print $msg['empr_contribution_area_not_activate'];
}
print "
";
break;
case "pnb_devices" :
case "pnb_parameters" :
print "\n";
if ($allow_pnb) {
$pnb_controller = new pnb_controller();
$pnb_controller->proceed();
} else {
print $msg['pnb_not_allowed'];
}
print "
";
break;
default :
if (function_exists('empr_extended_lvl_default')) {
if (empr_extended_lvl_default($lvl))
break;
}
print pmb_bidi($empr_identite);
break;
}
} else {
print "";
// Si la connexion n'a pas pu être établie
switch ($erreur_connexion) {
case "1" :
// L'abonnement du lecteur est expiré
print $msg['empr_expire'];
break;
case "2" :
// Le statut de l'abonné ne l'autorise pas à se connecter
print $msg['empr_connexion_interdite'];
break;
case "3" :
if(empty($_POST['login'])) {
//Accès direct par l'URL
require_once($base_path.'/includes/connexion_empr.inc.php');
print get_default_connexion_form();
} else {
// Erreur de saisie du mot de passe ou du login ou de connexion avec le ldap
print $msg['empr_bad_login'];
}
break;
default :
// La session est expirée
print sprintf($msg['session_expired'], round($opac_duration_session_auth / 60));
break;
}
print "
";
}
if ($erreur_session)
print "" . $erreur_session . "
";
// insertions des liens du bas dans le $footer si $opac_show_liensbas
if ($opac_show_liensbas == 1)
$footer = str_replace('!!div_liens_bas!!', $liens_bas, $footer);
else
$footer = str_replace('!!div_liens_bas!!', $liens_bas_disabled, $footer);
// affichage du bandeau_2 si $opac_show_bandeau_2 = 1
if ($opac_show_bandeau_2 == 0) {
$bandeau_2_contains = "";
} else {
$bandeau_2_contains = '!!contenu_bandeau_2!!
';
}
// affichage du bandeau de gauche si $opac_show_bandeaugauche = 1
if ($opac_show_bandeaugauche == 0) {
$footer = str_replace('!!contenu_bandeau!!', $bandeau_2_contains, $footer);
$footer = str_replace('!!contenu_bandeau_2!!', $opac_facette_in_bandeau_2 ? $lvl1 . $facette : "", $footer);
} else {
$footer = str_replace('!!contenu_bandeau!!', '!!contenu_bandeau!!
' . $bandeau_2_contains, $footer);
$home_on_left = str_replace('!!welcome_page!!', $msg['welcome_page'], $home_on_left);
$adresse = str_replace('!!common_tpl_address!!', $msg['common_tpl_address'], $adresse);
$adresse = str_replace('!!common_tpl_contact!!', $msg['common_tpl_contact'], $adresse);
// loading the languages avaiable in OPAC - martizva >> Eric
require_once ($base_path . '/includes/languages.inc.php');
$home_on_left = str_replace('!!common_tpl_lang_select!!', show_select_languages('empr.php'), $home_on_left);
if (! $_SESSION['user_code']) {
$loginform = str_replace('', '' . $msg['common_tpl_login_invite'] . '
', $loginform);
$loginform__ = genere_form_connexion_empr();
} else {
$loginform = str_replace('', '', $loginform);
$loginform__ = '' . $empr_prenom . ' ' . $empr_nom . '
';
if ($opac_quick_access) {
$loginform__ .= quick_access::get_selector();
$loginform__ .= '
';
} else {
$loginform__ .= "" . $msg["empr_my_account"] . "
";
}
if (! $opac_quick_access_logout || ! $opac_quick_access) {
$loginform__ .= '' . $msg['empr_logout'] . '';
}
}
$loginform = str_replace('!!login_form!!', $loginform__, $loginform);
$footer = str_replace('!!contenu_bandeau!!', ($opac_accessibility ? $accessibility : '') . $home_on_left . $loginform . $meteo . $adresse, $footer);
$footer = str_replace('!!contenu_bandeau_2!!', $opac_facette_in_bandeau_2 ? $lvl1 . $facette : '', $footer);
}
cms_build_info(array(
'input' => 'empr.php',
));
// LOG OPAC
global $pmb_logs_activate;
if ($pmb_logs_activate) {
global $log, $infos_notice, $infos_expl;
if ($_SESSION['user_code']) {
$res = pmb_mysql_query($log->get_empr_query());
if ($res) {
$empr_carac = pmb_mysql_fetch_array($res);
$log->add_log('empr', $empr_carac);
}
}
$log->add_log('num_session', session_id());
$log->add_log('expl', $infos_expl);
$log->add_log('docs', $infos_notice);
// Enregistrement multicritere
global $search;
if ($search) {
$search_stat = new search();
$log->add_log('multi_search', $search_stat->serialize_search());
$log->add_log('multi_human_query', $search_stat->make_human_query());
}
$log->save();
}
/* Fermeture de la connexion */
pmb_mysql_close($dbh);
?>