".$msg[1804]."$maj_a_faire !
";
echo form_relance ($maj_a_faire);
break;
case "v5.00":
$maj_a_faire = "v5.01";
echo "".$msg[1804]."$maj_a_faire !
";
echo form_relance ($maj_a_faire);
break;
case "v5.01":
$maj_a_faire = "v5.02";
echo "".$msg[1804]."$maj_a_faire !
";
echo form_relance ($maj_a_faire);
break;
case "v5.02":
$maj_a_faire = "v5.03";
echo "".$msg[1804]."$maj_a_faire !
";
echo form_relance ($maj_a_faire);
break;
case "v5.03":
case "v5.04":
$maj_a_faire = "v5.05";
echo "".$msg[1804]."$maj_a_faire !
";
echo form_relance ($maj_a_faire);
break;
case "v5.05":
$maj_a_faire = "v5.06";
echo "".$msg[1804]."$maj_a_faire !
";
echo form_relance ($maj_a_faire);
break;
case "v5.06":
$maj_a_faire = "v5.07";
echo "".$msg[1804]."$maj_a_faire !
";
echo form_relance ($maj_a_faire);
break;
case "v5.07":
$maj_a_faire = "v5.08";
echo "".$msg[1804]."$maj_a_faire !
";
echo form_relance ($maj_a_faire);
break;
case "v5.08":
$maj_a_faire = "v5.09";
echo "".$msg[1804]."$maj_a_faire !
";
echo form_relance ($maj_a_faire);
break;
case "v5.09":
$maj_a_faire = "v5.10";
echo "".$msg[1804]."$maj_a_faire !
";
echo form_relance ($maj_a_faire);
break;
case "v5.10":
echo "".$msg[1805].$version_pmb_bdd." !
";
break;
default:
echo "".$msg[1806].$version_pmb_bdd." !
";
break;
}
break;
case "v5.00":
echo "".$msg['admin_misc_action']." | ".$msg['admin_misc_resultat']." |
";
// +-------------------------------------------------+
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='opac_view_activate' "))==0){
$rqt="INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (NULL, 'pmb', 'opac_view_activate', '0', 'Activer les vues OPAC:\n 0 : non activé \n 1 : activé', '', '0')";
echo traite_rqt($rqt,"insert pmb_opac_view_activate='0' into parametres ");
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='opac_view_activate' "))==0){
$rqt="INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (NULL, 'opac', 'opac_view_activate', '0', 'Activer les vues OPAC:\n 0 : non activé \n 1 : activé', 'a_general', '0')";
echo traite_rqt($rqt,"insert opac_opac_view_activate='0' into parametres ");
}
//Gestion des vues Opac
$rqt = "CREATE TABLE if not exists opac_views (
opac_view_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
opac_view_name VARCHAR( 255 ) NOT NULL default '',
opac_view_query TEXT NOT NULL,
opac_view_human_query TEXT NOT NULL,
opac_view_param TEXT NOT NULL,
opac_view_visible INT( 1 ) UNSIGNED NOT NULL default 0,
opac_view_comment TEXT NOT NULL)";
echo traite_rqt($rqt,"CREATE TABLE opac_views ") ;
//Gestion des filtres de module ( pour vues Opac )
$rqt = "CREATE TABLE if not exists opac_filters (
opac_filter_view_num INT UNSIGNED NOT NULL default 0 ,
opac_filter_path VARCHAR( 20 ) NOT NULL default '',
opac_filter_param TEXT NOT NULL,
PRIMARY KEY(opac_filter_view_num,opac_filter_path))";
echo traite_rqt($rqt,"CREATE TABLE opac_filters ") ;
//Gestion générique des subst de parametre ( pour vues Opac )
$rqt = "CREATE TABLE if not exists param_subst (
subst_module_param VARCHAR( 20 ) NOT NULL default '',
subst_module_num INT( 2 ) UNSIGNED NOT NULL default 0,
subst_type_param VARCHAR( 20 ) NOT NULL default '',
subst_sstype_param VARCHAR( 255 ) NOT NULL default '',
subst_valeur_param TEXT NOT NULL,
subst_comment_param longtext NOT NULL,
PRIMARY KEY(subst_module_param, subst_module_num, subst_type_param, subst_sstype_param))";
echo traite_rqt($rqt,"CREATE TABLE param_subst ") ;
$rqt = "CREATE TABLE if not exists opac_views_empr (
emprview_view_num INT UNSIGNED NOT NULL default 0 ,
emprview_empr_num INT UNSIGNED NOT NULL default 0 ,
emprview_default INT UNSIGNED NOT NULL default 0 ,
PRIMARY KEY(emprview_view_num,emprview_empr_num))";
echo traite_rqt($rqt,"CREATE TABLE opac_views_empr ") ;
// Gestion des sur-localisations
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='sur_location_activate' "))==0){
$rqt="INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (NULL, 'pmb', 'sur_location_activate', '0', 'Activer les sur-localisations:\n 0 : non activé \n 1 : activé', '', '0')";
echo traite_rqt($rqt,"insert pmb_sur_location_activate='0' into parametres ");
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='sur_location_activate' "))==0){
$rqt="INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (NULL, 'opac', 'sur_location_activate', '0', 'Activer les sur-localisations:\n 0 : non activé \n 1 : activé', 'a_general', '0')";
echo traite_rqt($rqt,"insert opac_sur_location_activate='0' into parametres ");
}
$rqt = "CREATE TABLE if not exists sur_location (
surloc_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
surloc_libelle VARCHAR( 255 ) NOT NULL default '',
surloc_pic VARCHAR( 255 ) NOT NULL default '',
surloc_visible_opac tinyint( 1 ) UNSIGNED NOT NULL default 1,
surloc_name VARCHAR( 255 ) NOT NULL default '',
surloc_adr1 VARCHAR( 255 ) NOT NULL default '',
surloc_adr2 VARCHAR( 255 ) NOT NULL default '',
surloc_cp VARCHAR( 15 ) NOT NULL default '',
surloc_town VARCHAR( 100 ) NOT NULL default '',
surloc_state VARCHAR( 100 ) NOT NULL default '',
surloc_country VARCHAR( 100 ) NOT NULL default '',
surloc_phone VARCHAR( 100 ) NOT NULL default '',
surloc_email VARCHAR( 100 ) NOT NULL default '',
surloc_website VARCHAR( 100 ) NOT NULL default '',
surloc_logo VARCHAR( 100 ) NOT NULL default '',
surloc_comment TEXT NOT NULL,
surloc_num_infopage INT( 6 ) UNSIGNED NOT NULL default 0,
surloc_css_style VARCHAR( 100 ) NOT NULL default '')";
echo traite_rqt($rqt,"CREATE TABLE sur_location ") ;
$rqt = "ALTER TABLE docs_location ADD surloc_num INT NOT NULL default 0";
echo traite_rqt($rqt,"alter table docs_location add surloc_num");
$rqt = "ALTER TABLE docs_location ADD surloc_used tinyint( 1 ) NOT NULL default 0";
echo traite_rqt($rqt,"alter table docs_location add surloc_used");
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='opac_view_class' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param) VALUES (0, 'pmb', 'opac_view_class', '', 'Nom de la classe substituant la class opac_view pour la personnalisation de la gestion des vues Opac','')";
echo traite_rqt($rqt,"insert pmb_opac_view_class='' into parametres");
}
// +-------------------------------------------------+
echo "
";
$rqt = "update parametres set valeur_param='".$action."' where type_param='pmb' and sstype_param='bdd_version' " ;
$res = mysql_query($rqt, $dbh) ;
echo "".$msg[1807].$action." !
";
echo form_relance ("v5.01");
break;
case "v5.01":
echo "".$msg['admin_misc_action']." | ".$msg['admin_misc_resultat']." |
";
// +-------------------------------------------------+
// Favicon, reporté de la 4.94 - ER
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='faviconurl' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param) VALUES (0, 'opac', 'faviconurl', '', 'URL du favicon, si vide favicon=celui de PMB','a_general')";
echo traite_rqt($rqt,"insert opac_faviconurl='' into parametres");
}
//on précise si une source est interrogée directement en ajax dans l'OPAC
$rqt = "ALTER TABLE connectors_sources ADD opac_affiliate_search INT NOT NULL default 0";
echo traite_rqt($rqt,"alter table connectors_sources add opac_affiliate_search");
// Activation des recherches affiliées dans les sources externes
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='allow_affiliate_search' "))==0){
$rqt="INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (NULL, 'opac', 'allow_affiliate_search', '0', 'Activer les recherches affiliées en OPAC:\n 0 : non \n 1 : oui', 'c_recherche', '0')";
echo traite_rqt($rqt,"insert opac_allow_affiliate_search='0' into parametres ");
}
$rqt = "ALTER TABLE users CHANGE explr_invisible explr_invisible TEXT NULL ";
echo traite_rqt($rqt,"ALTER TABLE users CHANGE explr_invisible explr_invisible TEXT NULL");
$rqt = "ALTER TABLE users CHANGE explr_visible_mod explr_visible_mod TEXT NULL ";
echo traite_rqt($rqt,"ALTER TABLE users CHANGE explr_visible_mod explr_visible_mod TEXT NULL");
$rqt = "ALTER TABLE users CHANGE explr_visible_unmod explr_visible_unmod TEXT NULL ";
echo traite_rqt($rqt,"ALTER TABLE users CHANGE explr_visible_unmod explr_visible_unmod TEXT NULL");
//ajout table statuts de lignes d'actes
$rqt = "CREATE TABLE lignes_actes_statuts (
id_statut INT(3) NOT NULL AUTO_INCREMENT,
libelle TEXT NOT NULL,
relance INT(3) NOT NULL DEFAULT 0,
PRIMARY KEY (id_statut)
) ";
echo traite_rqt($rqt,"create table lignes_actes_statuts");
$rqt = "CREATE TABLE lignes_actes_relances (
num_ligne INT UNSIGNED NOT NULL ,
date_relance DATE NOT NULL default '0000-00-00',
type_ligne int(3) unsigned NOT NULL DEFAULT 0,
num_acte int(8) unsigned NOT NULL DEFAULT 0,
lig_ref int(15) unsigned NOT NULL DEFAULT 0,
num_acquisition int(12) unsigned NOT NULL DEFAULT 0,
num_rubrique int(8) unsigned NOT NULL DEFAULT 0,
num_produit int(8) unsigned NOT NULL DEFAULT 0,
num_type int(8) unsigned NOT NULL DEFAULT 0,
libelle text NOT NULL,
code varchar(255) NOT NULL DEFAULT '',
prix float(8,2) NOT NULL DEFAULT 0,
tva float(8,2) unsigned NOT NULL DEFAULT 0,
nb int(5) unsigned NOT NULL DEFAULT 1,
date_ech date NOT NULL DEFAULT '0000-00-00',
date_cre date NOT NULL DEFAULT '0000-00-00',
statut int(3) unsigned NOT NULL DEFAULT 1,
remise float(8,2) NOT NULL DEFAULT 0,
index_ligne text NOT NULL,
ligne_ordre smallint(2) unsigned NOT NULL DEFAULT 0,
debit_tva smallint(2) unsigned NOT NULL DEFAULT 0,
commentaires_gestion text NOT NULL,
commentaires_opac text NOT NULL,
PRIMARY KEY (num_ligne, date_relance)
) ";
echo traite_rqt($rqt,"create table lignes_actes_relances");
//ajout d'un statut de lignes d'actes par défaut
if (mysql_num_rows(mysql_query("select 1 from lignes_actes_statuts where id_statut='1' "))==0) {
$rqt = "INSERT INTO lignes_actes_statuts (id_statut,libelle,relance) VALUES (1 ,'Traitement normal', '1') ";
echo traite_rqt($rqt,"insert default lignes_actes_statuts");
}
//raz des statuts de lignes d'actes
$rqt = "UPDATE lignes_actes set statut='1' ";
echo traite_rqt($rqt,"alter lignes_actes raz statut");
//ajout d'un statut de ligne d'acte par défaut par utilisateur pour les devis
$rqt = "ALTER TABLE users ADD deflt3lgstatdev int(3) not null default 1 ";
echo traite_rqt($rqt,"ALTER TABLE users ADD default lg state dev");
//ajout d'un statut de ligne d'acte par défaut par utilisateur pour les commandes
$rqt = "ALTER TABLE users ADD deflt3lgstatcde int(3) not null default 1 ";
echo traite_rqt($rqt,"ALTER TABLE users ADD default lg state cde");
//ajout d'un commentaire de gestion pour les lignes d'actes
$rqt = "ALTER TABLE lignes_actes ADD commentaires_gestion TEXT NOT NULL";
echo traite_rqt($rqt,"alter table lignes_actes add commentaires_gestion");
//ajout d'un commentaire OPAC pour les lignes d'actes
$rqt = "ALTER TABLE lignes_actes ADD commentaires_opac TEXT NOT NULL";
echo traite_rqt($rqt,"alter table lignes_actes add commentaires_opac");
//ajout d'un nom (pour les commandes)
$rqt = "ALTER TABLE actes ADD nom_acte VARCHAR(255) NOT NULL DEFAULT '' ";
echo traite_rqt($rqt,"alter table actes add nom_acte");
//Paramètres de mise en page des relances d'acquisitions
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_format_page' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_format_page','210x297','Largeur x Hauteur de la page en mm','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_format_page into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_orient_page' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_orient_page','P','Orientation de la page: P=Portrait, L=Paysage','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_orient_page into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_marges_page' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_marges_page','10,20,10,10','Marges de page en mm : Haut,Bas,Droite,Gauche','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_marges_page into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_pos_logo' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_pos_logo','10,10,20,20','Position du logo: Distance par rapport au bord gauche de la page,Distance par rapport au haut de la page,Largeur,Hauteur','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_pos_logo into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_pos_raison' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_pos_raison','35,10,100,10,16','Position Raison sociale: Distance par rapport au bord gauche de la page,Distance par rapport au haut de la page,Largeur,Hauteur,Taille police','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_pos_raison into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_pos_date' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_pos_date','170,10,0,6,8','Position Date: Distance par rapport au bord gauche de la page,Distance par rapport au haut de la page,Largeur,Hauteur,Taille police','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_pos_date into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_pos_adr_rel' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_pos_adr_rel','10,35,60,5,10','Position Adresse de relance: Distance par rapport au bord gauche de la page,Distance par rapport au haut de la page,Largeur,Hauteur,Taille police','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_pos_adr_rel into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_pos_adr_fou' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_pos_adr_fou','100,55,100,6,14','Position Adresse fournisseur: Distance par rapport au bord gauche de la page,Distance par rapport au haut de la page,Largeur,Hauteur,Taille police','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_pos_adr_fou into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_pos_num_cli' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_pos_num_cli','10,80,0,10,16','Position numéro de client: Distance par rapport au bord gauche de la page,Distance par rapport au haut de la page,Largeur,Hauteur,Taille police','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_pos_num_cli into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_pos_num' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_pos_num','10,0,10,16','Position numéro de commande/devis: Distance par rapport au bord gauche de la page,Largeur,Hauteur,Taille police','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_pos_num into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_text_size' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_text_size','10','Taille de la police texte','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_text_size into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_pos_titre' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_pos_titre','10,90,100,10,16','Position titre: Distance par rapport au bord gauche de la page,Distance par rapport au haut de la page,Largeur,Hauteur,Taille police','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_pos_titre into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_text_before' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_text_before','','Texte avant le tableau de relances','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_text_before into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_text_after' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_text_after','','Texte après le tableau de relances','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_text_after into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_tab_rel' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_tab_rel','5,10','Tableau de relances: Hauteur ligne,Taille police','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_tab_rel into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_pos_footer' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_pos_footer','15,8','Position bas de page: Distance par rapport au bas de page, Taille police','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_pos_footer into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_pos_sign' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_pos_sign','10,60,5,10','Position signature: Distance par rapport au bord gauche de la page, Largeur, Hauteur ligne,Taille police','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_pos_sign into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_text_sign' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_text_sign','Le responsable de la bibliothèque.','Texte signature','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_text_sign into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_by_mail' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_by_mail','1','Effectuer les relances par mail :\n 0 : non \n 1 : oui','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_by_mail into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_text_mail' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_text_mail','Bonjour, \r\n\r\nVous trouverez ci-joint un état des commandes en cours.\r\n\r\nMerci de nous préciser par retour vos délais d\'envoi.\r\n\r\nCordialement,\r\n\r\nLe responsable de la bibliothèque.','Texte du mail','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_text_mail into parametres") ;
}
//ajout bulletinage avec document numérique
$rqt = "ALTER TABLE abts_abts ADD abt_numeric int(1) not null default 0 ";
echo traite_rqt($rqt,"ALTER TABLE abts_abts ADD abt_numeric ");
//ajout dans les bannettes la possibilité de ne pas tenir compte du statut des notices
$rqt = "ALTER TABLE bannettes ADD statut_not_account INT( 1 ) UNSIGNED NOT NULL default 0 ";
echo traite_rqt($rqt,"alter table bannettes add statut_not_account");
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='show_perio_browser' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'opac','show_perio_browser','0','Affichage du navigateur de périodiques en page d\'accueil OPAC.\n 0 : Non.\n 1 : Oui.','f_modules',0)" ;
echo traite_rqt($rqt,"insert opac_show_perio_browser into parametres") ;
}
// Gestion des relances des périodiques
$rqt = "CREATE TABLE perio_relance (
rel_id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
rel_abt_num int(10) unsigned NOT NULL DEFAULT 0,
rel_date_parution date NOT NULL default '0000-00-00',
rel_libelle_numero varchar(255) default NULL,
rel_comment_gestion TEXT NOT NULL,
rel_comment_opac TEXT NOT NULL ,
rel_nb int unsigned NOT NULL DEFAULT 0,
rel_date date NOT NULL default '0000-00-00',
PRIMARY KEY (rel_id) ) ";
echo traite_rqt($rqt,"create table perio_relance ");
//relances d'acquisitions en pdf/rtf
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_pdfrtf' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_pdfrtf','0','Envoi des relances en :\n 0 : pdf\n 1 : rtf','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_pdfrtf into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='show_onglet_perio_a2z' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'opac','show_onglet_perio_a2z','0','Activer l\'onglet du navigateur de périodiques en OPAC.\n 0 : Non.\n 1 : Oui.','c_recherche',0)" ;
echo traite_rqt($rqt,"insert opac_show_onglet_perio_a2z into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='avis_note_display_mode' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'opac','avis_note_display_mode','1','Mode d\'affichage de la note pour les avis de notices.\n 0 : Note non visible.\n 1 : Affichage de la note sous la forme d\'étoiles.\n 2 : Affichage de la note sous la forme textuelle.\n 3 : Affichage de la note sous la forme textuelle et d\'étoiles.','a_general',0)" ;
echo traite_rqt($rqt,"insert opac_avis_note_display_mode into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='avis_display_mode' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'opac','avis_display_mode','0','Mode d\'affichage des avis de notices.\n 0 : Visible en lien à coté de l\'onglet Public/ISBD de la notice.\n 1 : Visible dans la notice.','a_general',0)" ;
echo traite_rqt($rqt,"insert opac_avis_display_mode into parametres") ;
}
$rqt = "ALTER TABLE avis ADD avis_rank INT UNSIGNED NOT NULL DEFAULT 0 ";
echo traite_rqt($rqt,"ALTER TABLE avis ADD avis_rank") ;
//Module Gestionnaire de tâches
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='planificateur_allow' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion) VALUES (0, 'pmb', 'planificateur_allow', '0', 'Planificateur activé.\n 0 : Non.\n 1 : Oui.', '',0) ";
echo traite_rqt($rqt, "insert pmb_planificateur_allow=0 into parameters");
}
$rqt = "CREATE TABLE taches_type (
id_type_tache int(11) unsigned NOT NULL,
parameters text NOT NULL,
timeout int(11) NOT NULL default '5',
histo_day int(11) NOT NULL default '7',
histo_number int(11) NOT NULL default '3',
PRIMARY KEY (id_type_tache)
)";
echo traite_rqt($rqt, "CREATE TABLE taches_type ");
// Création des tables nécessaires au gestionnaire de tâches
$rqt="CREATE TABLE taches (
id_tache int(11) unsigned auto_increment,
num_planificateur int(11),
start_at datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
end_at datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
status varchar(128),
msg_statut blob,
commande int(8) NOT NULL default 0,
next_state int(8) NOT NULL default 0,
msg_commande blob,
indicat_progress int(3),
rapport text,
id_process int(8),
primary key (id_tache));";
echo traite_rqt($rqt,"CREATE TABLE taches ");
$rqt="CREATE TABLE planificateur (
id_planificateur int(11) unsigned auto_increment,
num_type_tache int(11) NOT NULL,
libelle_tache VARCHAR(255) NOT NULL,
desc_tache VARCHAR(255),
num_user int(11) NOT NULL,
param text,
statut tinyint(1) unsigned DEFAULT 0,
rep_upload int(8),
path_upload text,
perio_heure varchar(28),
perio_minute varchar(28) DEFAULT '01',
perio_jour varchar(128),
perio_mois varchar(128),
calc_next_heure_deb varchar(28),
calc_next_date_deb date,
primary key (id_planificateur))";
echo traite_rqt($rqt,"CREATE TABLE planificateur ");
$rqt="CREATE TABLE taches_docnum (
id_tache_docnum int(11) unsigned auto_increment,
tache_docnum_nomfichier varchar(255) NOT NULL,
tache_docnum_mimetype VARCHAR(255) NOT NULL,
tache_docnum_data mediumblob NOT NULL,
tache_docnum_extfichier varchar(20),
tache_docnum_repertoire int(8),
tache_docnum_path text NOT NULL,
num_tache int(11) NOT NULL,
primary key (id_tache_docnum))";
echo traite_rqt($rqt,"CREATE TABLE taches_docnum ");
//modification de la longueur du champ numero de la table actes
$rqt = "ALTER TABLE actes MODIFY numero varchar(255) NOT NULL default '' ";
echo traite_rqt($rqt,"alter table actes modify numero");
//ajout d'un statut par défaut en réception pour les suggestions
$rqt = "ALTER TABLE users ADD deflt3receptsugstat int(3) not null default 32 ";
echo traite_rqt($rqt,"ALTER TABLE users ADD default recept sug state");
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfrel_obj_mail' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfrel_obj_mail','Etat des en-cours','Objet du mail','pdfrel',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfrel_obj_mail into parametres") ;
}
//ajout de paramètres pour l'envoi de commandes par mail
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfcde_by_mail' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfcde_by_mail','1','Effectuer les envois de commandes par mail :\n 0 : non \n 1 : oui','pdfcde',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfcde_by_mail into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfcde_obj_mail' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfcde_obj_mail','Commande','Objet du mail','pdfcde',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfcde_obj_mail into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfcde_text_mail' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfcde_text_mail','Bonjour, \r\n\r\nVous trouverez ci-joint une commande à traiter.\r\n\r\nMerci de nous confirmer par retour vos délais d\'envoi.\r\n\r\nCordialement,\r\n\r\nLe responsable de la bibliothèque.','Texte du mail','pdfcde',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfcde_text_mail into parametres") ;
}
//ajout de paramètres pour l'envoi de devis par mail
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfdev_by_mail' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfdev_by_mail','1','Effectuer les envois de demandes de devis par mail :\n 0 : non \n 1 : oui','pdfdev',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfdev_by_mail into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfdev_obj_mail' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfdev_obj_mail','Demande de devis','Objet du mail','pdfdev',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfdev_obj_mail into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'acquisition' and sstype_param='pdfdev_text_mail' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'acquisition','pdfdev_text_mail','Bonjour, \r\n\r\nVous trouverez ci-joint une demande de devis.\r\n\r\nCordialement,\r\n\r\nLe responsable de la bibliothèque.','Texte du mail','pdfdev',0)" ;
echo traite_rqt($rqt,"insert acquisition_pdfcdev_text_mail into parametres") ;
}
// masquer la possibilité d'uploader les docnum en base
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='docnum_in_database_allow' "))==0){
if (mysql_num_rows(mysql_query("select * from upload_repertoire "))==0) $upd_param_docnum_in_database_allow = 1;
else $upd_param_docnum_in_database_allow=0;
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'pmb', 'docnum_in_database_allow', '$upd_param_docnum_in_database_allow', 'Autoriser le stockage de document numérique en base ? \n 0 : Non.\n 1 : Oui.', '',0) ";
echo traite_rqt($rqt, "insert pmb_docnum_in_database_allow=$upd_param_docnum_in_database_allow into parameters
SET this parameter to 1 to (re)allow file storage in database !");
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='recherche_ajax_mode' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (NULL, 'opac', 'recherche_ajax_mode', '1', 'Affichage accéléré des résultats de recherche: header uniquement, la suite est chargée lors du click sur le \"+\".\n 0: Inactif\n 1: Actif (par lot)\n 2: Actif (par notice)', 'c_recherche', '0')" ;
echo traite_rqt($rqt,"insert opac_recherche_ajax_mode=1 into parametres") ;
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='avis_note_display_mode' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'pmb','avis_note_display_mode','1','Mode d\'affichage de la note pour les avis de notices.\n 0 : Note non visible.\n 1 : Affichage de la note sous la forme d\'étoiles.\n 2 : Affichage de la note sous la forme textuelle.\n 3 : Affichage de la note sous la forme textuelle et d\'étoiles.','',0)" ;
echo traite_rqt($rqt,"insert pmb_avis_note_display_mode into parametres") ;
}
// +-------------------------------------------------+
echo "
";
$rqt = "update parametres set valeur_param='".$action."' where type_param='pmb' and sstype_param='bdd_version' " ;
$res = mysql_query($rqt, $dbh) ;
echo "".$msg[1807].$action." !
";
echo form_relance ("v5.02");
break;
case "v5.02":
echo "".$msg['admin_misc_action']." | ".$msg['admin_misc_resultat']." |
";
// +-------------------------------------------------+
//Module CMS
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'cms' and sstype_param='active' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'cms', 'active', '0', 'Module \'Portail\' activé.\n 0 : Non.\n 1 : Oui.', '',0) ";
echo traite_rqt($rqt, "insert cms_active=0 into parameters");
}
//langue d'indexation par défaut
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='indexation_lang' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'pmb', 'indexation_lang', '', 'Choix de la langue d\'indexation par défaut. (ex : fr_FR,en_UK,...,ar), si vide c\'est la langue de l\'interface du catalogueur qui est utilisée.', '',0) ";
echo traite_rqt($rqt, "insert pmb_indexation_lang into parameters");
}
//ajout du champ permettant la pré-selection du connecteur en OPAC
$rqt = "ALTER TABLE connectors_sources ADD opac_selected int(3) unsigned not null default 0 ";
echo traite_rqt($rqt,"ALTER TABLE connectors_sources ADD opac_selected");
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='websubscribe_show_location' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (NULL, 'opac', 'websubscribe_show_location', '0', 'Afficher la possibilité pour le lecteur de choisir sa localisation lors de son inscription en ligne.\n 0: Non\n 1: Oui', 'f_modules', '0')" ;
echo traite_rqt($rqt,"insert opac_websubscribe_show_location=0 into parametres") ;
}
// CMS PMB
//rubriques
$rqt="create table if not exists cms_sections(
id_section int unsigned not null auto_increment primary key,
section_title varchar(255) not null default '',
section_resume text not null,
section_logo mediumblob not null,
section_publication_state varchar(50) not null,
section_start_date datetime,
section_end_date datetime,
section_num_parent int not null default 0,
index i_cms_section_title(section_title),
index i_cms_section_publication_state(section_publication_state),
index i_cms_section_num_parent(section_num_parent)
)";
echo traite_rqt($rqt, "create table cms_sections");
$rqt = "create table if not exists cms_sections_descriptors(
num_section int not null default 0,
num_noeud int not null default 0,
section_descriptor_order int not null default 0,
primary key (num_section,num_noeud)
)";
echo traite_rqt($rqt, "create table cms_sections_descriptors");
$rqt="create table if not exists cms_articles(
id_article int unsigned not null auto_increment primary key,
article_title varchar(255) not null default '',
article_resume text not null,
article_contenu text not null,
article_logo mediumblob not null,
article_publication_state varchar(50) not null default '',
article_start_date datetime,
article_end_date datetime,
num_section int not null default 0,
index i_cms_article_title(article_title),
index i_cms_article_publication_state(article_publication_state),
index i_cms_article_num_parent(num_section)
)";
echo traite_rqt($rqt, "create table cms_articles");
$rqt = "create table if not exists cms_articles_descriptors(
num_article int not null default 0,
num_noeud int not null default 0,
article_descriptor_order int not null default 0,
primary key (num_article,num_noeud)
)";
echo traite_rqt($rqt, "create table cms_articles_descriptors");
$rqt = "create table if not exists cms_editorial_publications_states(
id_publication_state int unsigned not null auto_increment primary key,
editorial_publication_state_label varchar(255) not null default '',
editorial_publication_state_opac_show int(1) not null default 0,
editorial_publication_state_auth_opac_show int(1) not null default 0
)";
echo traite_rqt($rqt, "create table cms_editorial_publications_states");
$rqt="create table if not exists cms_build (
id_build int unsigned not null auto_increment primary key,
build_obj varchar(255) not null default '',
build_parent varchar(255) not null default '',
build_child_after varchar(255) not null default '',
build_css text not null
)";
echo traite_rqt($rqt, "create table cms_build");
//paramétrage de la pondération des champs persos...
// dans le notices
$rqt = "alter table notices_custom add pond int not null default 100";
echo traite_rqt($rqt,"alter table notices_custom add pond");
//dans les exemplaires
$rqt = "alter table expl_custom add pond int not null default 100";
echo traite_rqt($rqt,"alter table expl_custom add pond ");
//dans les états des collections
$rqt = "alter table collstate_custom add pond int not null default 100";
echo traite_rqt($rqt,"alter table collstate_custom add pond");
//dans les lecteurs, pour rester homogène...
$rqt = "alter table empr_custom add pond int not null default 100";
echo traite_rqt($rqt,"alter table empr_custom add pond");
//tri sur les états des collections en OPAC
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='collstate_order' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param,section_param)
VALUES (0, 'opac', 'collstate_order', 'archempla_libelle,collstate_cote','Ordre d\'affichage des états des collections, dans l\'ordre donné, séparé par des virgules : archempla_libelle,collstate_cote','e_aff_notice')";
echo traite_rqt($rqt,"insert opac_collstate_order=archempla_libelle,collstate_cote into parametres");
}
//la pondération dans les fiches ne sert à rien mais pour rester homogène avec les autres champs persos...
$rqt = "alter table gestfic0_custom add pond int not null default 100";
echo traite_rqt($rqt,"alter table gestfic0_custom add pond");
//AR new search !
@set_time_limit(0);
flush();
$rqt = "truncate table notices_mots_global_index";
echo traite_rqt($rqt,"truncate table notices_mots_global_index");
//Changement du type de code_champ dans notices_mots_global_index
$rqt = "alter table notices_mots_global_index change code_champ code_champ int(3) not null default 0";
echo traite_rqt($rqt,"alter table notices_mots_global_index change code_champ");
//ajout de code_ss_champ dans notices_mots_global_index
$rqt = "alter table notices_mots_global_index add code_ss_champ int(3) not null default 0 after code_champ";
echo traite_rqt($rqt,"alter table notices_mots_global_index add code_ss_champ");
//ajout de pond dans notices_mots_global_index
$rqt = "alter table notices_mots_global_index add pond int(4) not null default 100";
echo traite_rqt($rqt,"alter table notices_mots_global_index add pond");
//ajout de position dans notices_mots_global_index
$rqt = "alter table notices_mots_global_index add position int not null default 1";
echo traite_rqt($rqt,"alter table notices_mots_global_index add position");
//ajout de lang dans notices_mots_global_index
$rqt = "alter table notices_mots_global_index add lang varchar(10) not null default ''";
echo traite_rqt($rqt,"alter table notices_mots_global_index add lang");
//changement de clé primaire
$rqt = "alter table notices_mots_global_index drop primary key, add primary key(id_notice,code_champ,code_ss_champ,mot)";
echo traite_rqt($rqt,"alter table notices_mots_global_index change primary key(id_notice,code_champ,code_ss_champ,mot");
//index
$rqt = "alter table notices_mots_global_index drop index i_mot";
echo traite_rqt($rqt,"alter table notices_mots_global_index drop index i_mot");
$rqt = "alter table notices_mots_global_index add index i_mot(mot)";
echo traite_rqt($rqt,"alter table notices_mots_global_index add index i_mot");
$rqt = "alter table notices_mots_global_index drop index i_id_mot";
echo traite_rqt($rqt,"alter table notices_mots_global_index drop index i_id_mot");
$rqt = "alter table notices_mots_global_index add index i_id_mot(id_notice,mot)";
echo traite_rqt($rqt,"alter table notices_mots_global_index add index i_id_mot");
//une nouvelle table pour les recherches exactes...
$rqt="create table if not exists notices_fields_global_index (
id_notice mediumint(8) not null default 0,
code_champ int(3) not null default 0,
code_ss_champ int(3) not null default 0,
ordre int(4) not null default 0,
value text not null,
pond int(4) not null default 100,
lang varchar(10) not null default '',
primary key(id_notice,code_champ,code_ss_champ,ordre),
index i_value(value(300)),
index i_id_value(id_notice,value(300))
)";
echo traite_rqt($rqt, "create table notices_fields_global_index");
$rqt = "create table if not exists search_cache (
object_id varchar(255) not null default '',
delete_on_date datetime not null default '0000-00-00 00:00:00',
value mediumblob not null,
PRIMARY KEY (object_id)
)";
echo traite_rqt($rqt, "create table search_cache");
// ajout d'un paramètre de tri par défaut
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='default_sort' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'opac','default_sort','d_num_6,c_text_28','Tri par défaut des recherches OPAC.\nDe la forme, c_num_6 (c pour croissant, d pour décroissant, puis num ou text pour numérique ou texte et enfin l\'identifiant du champ (voir fichier xml sort.xml))','d_aff_recherche',0)" ;
echo traite_rqt($rqt,"insert opac_default_sort into parametres") ;
}
flush();
//AR /new search !
//maj valeurs possibles pour empr_filter_rows
$rqt = "update parametres set comment_param='Colonnes disponibles pour filtrer la liste des emprunteurs : \n v: ville\n l: localisation\n c: catégorie\n s: statut\n g: groupe\n y: année de naissance\n cp: code postal\n cs : code statistique\n #n : id des champs personnalisés' where type_param= 'empr' and sstype_param='filter_rows' ";
echo traite_rqt($rqt,"update empr_filter_rows into parametres");
//Précision affichage amendes
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='fine_precision' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, gestion) VALUES (0, 'pmb', 'fine_precision', '2', 'Nombre de décimales pour l\'affichage des amendes',1)";
echo traite_rqt($rqt,"insert fine_precision=2 into parametres");
}
//Rafraichissement des vues opac
$rqt = "alter table opac_views add opac_view_last_gen datetime default null";
echo traite_rqt($rqt,"alter table opac_views add opac_view_last_gen");
$rqt = "alter table opac_views add opac_view_ttl int not null default 86400";
echo traite_rqt($rqt,"alter table opac_views add opac_view_ttl");
// paramétrage du cache en OPAC
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='search_cache_duration' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'opac','search_cache_duration','600','Durée de validité (en secondes) du cache des recherches OPAC','c_recherche',0)" ;
echo traite_rqt($rqt,"insert opac_search_cache_duration into parametres") ;
}
// ajout d'un paramètre utilisateur de statut par défaut en import (report de l'alter V4, modif tardive en 3.4)
$rqt = "alter table users add deflt_integration_notice_statut int(6) not null default 1 after deflt_notice_statut";
echo traite_rqt($rqt,"alter table users add deflt_integration_notice_statut");
// Info de réindexation
$rqt = " select 1 " ;
echo traite_rqt($rqt,"VOUS DEVEZ REINDEXER / YOU MUST REINDEX : Admin > Outils > Nettoyage de base ") ;
// +-------------------------------------------------+
echo "
";
$rqt = "update parametres set valeur_param='".$action."' where type_param='pmb' and sstype_param='bdd_version' " ;
$res = mysql_query($rqt, $dbh) ;
echo "".$msg[1807].$action." !
";
echo form_relance ("v5.03");
break;
case "v5.03":
case "v5.04":
case "v5.05":
echo "".$msg['admin_misc_action']." | ".$msg['admin_misc_resultat']." |
";
// +-------------------------------------------------+
//Type de document par défaut en création de périodique
$rqt = "ALTER TABLE users ADD xmlta_doctype_serial varchar(2) NOT NULL DEFAULT '' after xmlta_doctype";
echo traite_rqt($rqt,"ALTER TABLE users ADD default xmlta_doctype_serial after xmlta_doctype");
//Type de document par défaut en création de bulletin
$rqt = "ALTER TABLE users ADD xmlta_doctype_bulletin varchar(2) NOT NULL DEFAULT '' after xmlta_doctype_serial";
echo traite_rqt($rqt,"ALTER TABLE users ADD default xmlta_doctype_bulletin after xmlta_doctype_serial");
//Type de document par défaut en création d'article
$rqt = "ALTER TABLE users ADD xmlta_doctype_analysis varchar(2) NOT NULL DEFAULT '' after xmlta_doctype_bulletin";
echo traite_rqt($rqt,"ALTER TABLE users ADD default xmlta_doctype_analysis after xmlta_doctype_bulletin");
// Mise à jour des valeurs en fonction du type de document par défaut en création de notice, si la valeur est vide !
if ($res = mysql_query("select userid, xmlta_doctype,xmlta_doctype_serial,xmlta_doctype_bulletin,xmlta_doctype_analysis from users")){
while ( $row = mysql_fetch_object($res)) {
if ($row->xmlta_doctype_serial == '') mysql_query("update users set xmlta_doctype_serial='".$row->xmlta_doctype."' where userid=".$row->userid);
if ($row->xmlta_doctype_bulletin == '') mysql_query("update users set xmlta_doctype_bulletin='".$row->xmlta_doctype."' where userid=".$row->userid);
if ($row->xmlta_doctype_analysis == '') mysql_query("update users set xmlta_doctype_analysis='".$row->xmlta_doctype."' where userid=".$row->userid);
}
}
// Ajout affichage a2z par localisation
$rqt = "alter table docs_location add show_a2z int(1) unsigned not null default 0 ";
echo traite_rqt($rqt,"ALTER TABLE docs_location ADD show_a2z");
// demande GM : index sur
$rqt = "alter table pret drop index i_pret_arc_id";
echo traite_rqt($rqt,"alter table pret drop index i_pret_arc_id");
$rqt = "alter table pret add index i_pret_arc_id(pret_arc_id)";
echo traite_rqt($rqt,"alter table pret add index i_pret_arc_id");
$rqt = "CREATE TABLE if not exists facettes (
id_facette int unsigned auto_increment,
facette_name varchar(255) not null default '',
facette_critere int(5) not null default 0,
facette_ss_critere int(5) not null default 0,
facette_nb_result int(2) not null default 0,
facette_visible tinyint(1) not null default 0,
facette_type_sort int(1) not null default 0,
facette_order_sort int(1) not null default 0,
primary key (id_facette))";
echo traite_rqt($rqt,"CREATE TABLE facettes");
// début circulation périodiques
//ajout du champ expl_abt_num permettant de lier l'exemplaire a un abonnement de pério
$rqt = "ALTER TABLE exemplaires ADD expl_abt_num int unsigned not null default 0 ";
echo traite_rqt($rqt,"ALTER TABLE exemplaires ADD expl_abt_num");
$rqt="create table if not exists serialcirc (
id_serialcirc int unsigned not null auto_increment primary key,
num_serialcirc_abt int unsigned not null default 0,
serialcirc_type int unsigned not null default 0,
serialcirc_virtual int unsigned not null default 0,
serialcirc_duration int unsigned not null default 0,
serialcirc_checked int unsigned not null default 0,
serialcirc_retard_mode int unsigned not null default 0,
serialcirc_allow_resa int unsigned not null default 0,
serialcirc_allow_copy int unsigned not null default 0,
serialcirc_allow_send_ask int unsigned not null default 0,
serialcirc_allow_subscription int unsigned not null default 0,
serialcirc_duration_before_send int unsigned not null default 0,
serialcirc_expl_statut_circ int unsigned not null default 0,
serialcirc_expl_statut_circ_after int unsigned not null default 0,
serialcirc_state int unsigned not null default 0
)";
echo traite_rqt($rqt, "create table serialcirc");
$rqt="create table if not exists serialcirc_diff (
id_serialcirc_diff int unsigned not null auto_increment primary key,
num_serialcirc_diff_serialcirc int unsigned not null default 0,
serialcirc_diff_empr_type int unsigned not null default 0,
serialcirc_diff_type_diff int unsigned not null default 0,
num_serialcirc_diff_empr int unsigned not null default 0,
serialcirc_diff_group_name varchar(255) not null default '',
serialcirc_diff_duration int unsigned not null default 0,
serialcirc_diff_order int unsigned not null default 0
)";
echo traite_rqt($rqt, "create table serialcirc_diff");
$rqt="create table if not exists serialcirc_group (
id_serialcirc_group int unsigned not null auto_increment primary key,
num_serialcirc_group_diff int unsigned not null default 0,
num_serialcirc_group_empr int unsigned not null default 0,
serialcirc_group_responsable int unsigned not null default 0,
serialcirc_group_order int unsigned not null default 0
)";
echo traite_rqt($rqt, "create table serialcirc_group");
$rqt="create table if not exists serialcirc_expl (
id_serialcirc_expl int unsigned not null auto_increment primary key,
num_serialcirc_expl_id int unsigned not null default 0,
num_serialcirc_expl_serialcirc int unsigned not null default 0,
serialcirc_expl_bulletine_date date NOT NULL default '0000-00-00',
serialcirc_expl_state_circ int unsigned not null default 0,
num_serialcirc_expl_serialcirc_diff int unsigned not null default 0,
serialcirc_expl_ret_asked int unsigned not null default 0,
serialcirc_expl_trans_asked int unsigned not null default 0,
serialcirc_expl_trans_doc_asked int unsigned not null default 0,
num_serialcirc_expl_current_empr int unsigned not null default 0,
serialcirc_expl_start_date date NOT NULL default '0000-00-00'
)";
echo traite_rqt($rqt, "create table serialcirc_expl");
$rqt="create table if not exists serialcirc_circ (
id_serialcirc_circ int unsigned not null auto_increment primary key,
num_serialcirc_circ_diff int unsigned not null default 0,
num_serialcirc_circ_expl int unsigned not null default 0,
num_serialcirc_circ_empr int unsigned not null default 0,
num_serialcirc_circ_serialcirc int unsigned not null default 0,
serialcirc_circ_order int unsigned not null default 0,
serialcirc_circ_subscription int unsigned not null default 0,
serialcirc_circ_ret_asked int unsigned not null default 0,
serialcirc_circ_trans_asked int unsigned not null default 0,
serialcirc_circ_trans_doc_asked int unsigned not null default 0,
serialcirc_circ_expected_date datetime,
serialcirc_circ_pointed_date datetime
)";
//, primary key(id_serialcirc_circ, num_serialcirc_circ_diff,num_serialcirc_circ_expl,num_serialcirc_circ_empr,num_serialcirc_circ_serialcirc)
echo traite_rqt($rqt,"create table serialcirc_circ");
//path_pmb planificateur
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='path_php' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'pmb', 'path_php', '', 'Chemin absolu de l\'interpréteur PHP, local ou distant', '',0) ";
echo traite_rqt($rqt, "insert pmb_path_php into parameters");
}
//modification taille du champ expl_comment de la table exemplaires
$rqt = "ALTER TABLE exemplaires MODIFY expl_comment TEXT ";
echo traite_rqt($rqt,"ALTER TABLE exemplaires MODIFY expl_comment");
//tri sur les documents numériques en OPAC
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='explnum_order' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param,section_param)
VALUES (0, 'opac', 'explnum_order', 'explnum_mimetype, explnum_nom, explnum_id','Ordre d\'affichage des documents numériques, dans l\'ordre donné, séparé par des virgules : explnum_mimetype, explnum_nom, explnum_id','e_aff_notice')";
echo traite_rqt($rqt,"insert opac_explnum_order=explnum_mimetype, explnum_nom, explnum_id into parametres");
}
//modification taille du champ resa_idempr de la table resa
$rqt = "ALTER TABLE resa MODIFY resa_idempr int(10) unsigned NOT NULL default 0";
echo traite_rqt($rqt,"ALTER TABLE resa MODIFY resa_idempr");
// +-------------------------------------------------+
echo "
";
$rqt = "update parametres set valeur_param='".$action."' where type_param='pmb' and sstype_param='bdd_version' " ;
$res = mysql_query($rqt, $dbh) ;
echo "".$msg[1807].$action." !
";
echo form_relance ("v5.06");
break;
case "v5.06":
echo "".$msg['admin_misc_action']." | ".$msg['admin_misc_resultat']." |
";
// +-------------------------------------------------+
@set_time_limit(0);
//ajout d'un flag pour la résa en ciculation
$rqt = "alter table serialcirc_circ add serialcirc_circ_hold_asked int not null default 0 after serialcirc_circ_subscription";
echo traite_rqt($rqt,"alter table serialcirc_circ add serialcirc_circ_hold_asked");
//table de gestion des demandes de reproduction
$rqt="create table if not exists serialcirc_copy (
id_serialcirc_copy int not null auto_increment primary key,
num_serialcirc_copy_empr int not null default 0,
num_serialcirc_copy_bulletin int not null default 0,
serialcirc_copy_analysis text,
serialcirc_copy_date date not null default '0000-00-00',
serialcirc_copy_state int not null default 0,
serialcirc_copy_comment text not null
)";
echo traite_rqt($rqt,"create table serialcirc_copy");
$rqt="create table if not exists serialcirc_ask (
id_serialcirc_ask int unsigned not null auto_increment primary key,
num_serialcirc_ask_perio int unsigned not null default 0,
num_serialcirc_ask_serialcirc int unsigned not null default 0,
num_serialcirc_ask_empr int unsigned not null default 0,
serialcirc_ask_type int unsigned not null default 0,
serialcirc_ask_statut int unsigned not null default 0,
serialcirc_ask_date date NOT NULL default '0000-00-00',
serialcirc_ask_comment text not null
)";
echo traite_rqt($rqt,"create table serialcirc_ask");
// Création table facettes foireuse en développement
$rqt = "ALTER TABLE facettes add facette_type_sort int(1) not null default 0 AFTER facette_visible";
echo traite_rqt($rqt,"ALTER TABLE facettes add facette_type_sort ");
$rqt = "ALTER TABLE facettes add facette_order_sort int(1) not null default 0 AFTER facette_type_sort";
echo traite_rqt($rqt,"ALTER TABLE facettes add facette_order_sort ");
// comptabilisation de l'amende : à partir de la date de retour, à partir du délai de grâce
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='amende_comptabilisation' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param,section_param)
VALUES (0, 'pmb', 'amende_comptabilisation', '0','Date à laquelle le début de l\'amende sera comptabilisée \r\n 0 : à partir de la date de retour \r\n 1 : à partir du délai de grâce','')";
echo traite_rqt($rqt,"insert pmb_amende_comptabilisation=0 into parametres");
}
// prêt en retard : compter le jour de la date de retour ou la date de relance comme un retard ?
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='pret_calcul_retard_date_debut_incluse' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param,section_param)
VALUES (0, 'pmb', 'pret_calcul_retard_date_debut_incluse', '0','Compter le jour de retour ou de relance comme un jour de retard pour le calcul de l\'amende ? \r\n 0 : Non \r\n 1 : Oui','')";
echo traite_rqt($rqt,"insert pmb_pret_calcul_retard_date_debut_incluse=0 into parametres");
}
//modification taille du champ comment_gestion de la table bannettes
$rqt = "ALTER TABLE bannettes MODIFY comment_gestion text NOT NULL ";
echo traite_rqt($rqt,"ALTER TABLE bannettes MODIFY comment_gestion");
//modification taille du champ comment_public de la table bannettes
$rqt = "ALTER TABLE bannettes MODIFY comment_public text NOT NULL ";
echo traite_rqt($rqt,"ALTER TABLE bannettes MODIFY comment_public");
//AR
//Exclusion de champs dans la recherche tous les champs en OPAC
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='exclude_fields' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param,section_param)
VALUES (0, 'opac', 'exclude_fields', '','Identifiants des champs à exclure de la recherche tous les champs (liste dispo dans le fichier includes/indexation/champ_base.xml)','c_recherche')";
echo traite_rqt($rqt,"insert opac_exclude_fields into parametres");
}
//ajout dates log dans table des vues
$rqt = "ALTER TABLE statopac_vues ADD date_debut_log DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
ADD date_fin_log DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' ";
echo traite_rqt($rqt,"ALTER TABLE statopac_vues add log dates");
//Ajout champ serialcirc_tpl pour l'impression de la fiche de circulation
$rqt = "ALTER TABLE serialcirc ADD serialcirc_tpl TEXT NOT NULL";
echo traite_rqt($rqt,"ALTER TABLE serialcirc ADD serialcirc_tpl ");
//AR
//Onglet Abonnement du compte emprunteur visible ou non...
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='serialcirc_active' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param,section_param)
VALUES (0, 'opac', 'serialcirc_active', 0,'Activer la circulation des pédioques dans l\'OPAC \r\n 0: Non \r\n 1: Oui','f_modules')";
echo traite_rqt($rqt,"insert opac_serialcirc_active into parametres");
}
//AR
//Ajout d'un droit sur le statut pour la circulation des périos
$rqt = "alter table empr_statut add allow_serialcirc int unsigned not null default 0";
echo traite_rqt($rqt,"alter table empr_statut add allow_serialcirc");
// création $pmb_bdd_subversion
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='bdd_subversion' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param)
VALUES (0, 'pmb', 'bdd_subversion', '0', 'Sous-version de la base de données')";
echo traite_rqt($rqt,"insert pmb_bdd_subversion=0 into parametres");
}
//AR - Ajout d'un paramètre pour définir la classe d'import des autorités...
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='import_modele_authorities' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param,section_param)
VALUES (0, 'pmb', 'import_modele_authorities', 'notice_authority_import','Quelle classe d\'import utiliser pour les notices d\'autorités ?','')";
echo traite_rqt($rqt,"insert pmb_import_modele_authorities into parametres");
}
//AR - pris dans le tapis entre 2 versions...
//création de la table origin_authorities
$rqt = "create table if not exists origin_authorities (
id_origin_authorities int(10) unsigned NOT NULL AUTO_INCREMENT,
origin_authorities_name varchar(255) NOT NULL DEFAULT '',
origin_authorities_country varchar(10) NOT NULL DEFAULT '',
origin_authorities_diffusible int(10) unsigned NOT NULL DEFAULT 0,
primary key (id_origin_authorities)
)";
echo traite_rqt($rqt,"create table origin_authorities");
//AR - ajout de valeurs par défault...
$rqt = "insert into origin_authorities
(id_origin_authorities,origin_authorities_name,origin_authorities_country,origin_authorities_diffusible)
values
(1,'Catalogue Interne','FR',1),
(2,'BnF','FR',1)";
echo traite_rqt($rqt,"insert default values into origin_authorities");
//AR - création de la table authorities_source
$rqt = "create table if not exists authorities_sources (
id_authority_source int(10) unsigned NOT NULL AUTO_INCREMENT,
num_authority int(10) unsigned NOT NULL DEFAULT 0,
authority_number varchar(50) NOT NULL DEFAULT '',
authority_type varchar(20) NOT NULL DEFAULT '',
num_origin_authority int(10) unsigned NOT NULL DEFAULT 0,
authority_favorite int(10) unsigned NOT NULL DEFAULT 0,
import_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
update_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
primary key (id_authority_source) )";
echo traite_rqt($rqt,"create table authorities_sources");
//AR - création de la table notices_authorities_sources
$rqt ="create table if not exists notices_authorities_sources (
num_authority_source int(10) unsigned NOT NULL DEFAULT 0,
num_notice int(10) unsigned NOT NULL DEFAULT 0,
primary key (num_authority_source,num_notice)
)";
echo traite_rqt($rqt,"create table notices_authorities_sources");
//AR - modification du champ aut_link_type
$rqt = "alter table aut_link change aut_link_type aut_link_type varchar(2) not null default ''";
echo traite_rqt($rqt,"alter table aut_link change aut_link_type varchar");
//MB - Modification de l'explication du paramètre d'affichage des dates d'exemplaire
$rqt="UPDATE parametres SET comment_param='Afficher les dates des exemplaires ? \n 0 : Aucune date.\n 1 : Date de création et modification.\n 2 : Date de dépôt et retour (BDP).\n 3 : Date de création, modification, dépôt et retour.' WHERE type_param='pmb' AND sstype_param='expl_show_dates'";
$res = mysql_query($rqt, $dbh) ;
//DG
// localisation des prévisions
if (mysql_num_rows(mysql_query("SELECT 1 FROM parametres WHERE type_param= 'pmb' and sstype_param='location_resa_planning' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, gestion, comment_param)
VALUES (0, 'pmb', 'location_resa_planning', '0', '0', 'Utiliser la gestion de la prévision localisée?\n 0: Non\n 1: Oui') ";
echo traite_rqt($rqt,"INSERT location_resa_planning INTO parametres") ;
}
//Localisation par défaut sur la visualisation des états des collections
$rqt = "ALTER TABLE users ADD deflt_collstate_location int(6) UNSIGNED DEFAULT 0 after deflt_docs_location";
echo traite_rqt($rqt,"ALTER TABLE users ADD deflt_collstate_location after deflt_docs_location");
//maj valeurs possibles pour empr_filter_rows
$rqt = "update parametres set comment_param='Colonnes disponibles pour filtrer la liste des emprunteurs : \n v: ville\n l: localisation\n c: catégorie\n s: statut\n g: groupe\n y: année de naissance\n cp: code postal\n cs : code statistique\n ab : type d\'abonnement\n #n : id des champs personnalisés' where type_param= 'empr' and sstype_param='filter_rows' ";
echo traite_rqt($rqt,"update empr_filter_rows into parametres");
//maj valeurs possibles pour empr_show_rows
$rqt = "update parametres set comment_param='Colonnes affichées en liste de lecteurs, saisir les colonnes séparées par des virgules. Les colonnes disponibles pour l\'affichage de la liste des emprunteurs sont : \n n: nom+prénom \n a: adresse \n b: code-barre \n c: catégories \n g: groupes \n l: localisation \n s: statut \n cp: code postal \n v: ville \n y: année de naissance \n ab: type d\'abonnement \n #n : id des champs personnalisés \n 1: icône panier' where type_param= 'empr' and sstype_param='show_rows' ";
echo traite_rqt($rqt,"update empr_show_rows into parametres");
//maj valeurs possibles pour empr_sort_rows
$rqt = "update parametres set comment_param='Colonnes qui seront disponibles pour le tri des emprunteurs. Les colonnes possibles sont : \n n: nom+prénom \n c: catégories \n g: groupes \n l: localisation \n s: statut \n cp: code postal \n v: ville \n y: année de naissance \n ab: type d\'abonnement \n #n : id des champs personnalisés' where type_param= 'empr' and sstype_param='sort_rows' ";
echo traite_rqt($rqt,"update empr_sort_rows into parametres");
//maj commentaire sms_msg_retard
$rqt = "update parametres set comment_param='Texte du sms envoyé lors d\'un retard' where type_param= 'empr' and sstype_param='sms_msg_retard' ";
echo traite_rqt($rqt,"update empr_sms_msg_retard into parametres");
//maj commentaire afficher_numero_lecteur_lettres
$rqt = "update parametres set comment_param='Afficher le numéro et le mail du lecteur sous l\'adresse dans les différentes lettres' where type_param= 'pmb' and sstype_param='afficher_numero_lecteur_lettres' ";
echo traite_rqt($rqt,"update pmb_afficher_numero_lecteur_lettres into parametres");
//DB
//modification du paramètre empr_sms_activation
$rqt = "select valeur_param from parametres where type_param= 'empr' and sstype_param='sms_activation' ";
$res = mysql_query($rqt);
if (mysql_num_rows($res)) {
$old_value = mysql_result($res,0,0);
if ($old_value==1) {
$new_value='1,1,1,1';
$rqt = "update parametres set valeur_param='".$new_value."', comment_param='Activation de l\'envoi de sms. : relance 1,relance 2,relance 3,resa\n\n 0: Inactif\n 1: Actif' where type_param= 'empr' and sstype_param='sms_activation' ";
echo traite_rqt($rqt,"update sms_activation");
} elseif ($old_value==0) {
$new_value='0,0,0,0';
$rqt = "update parametres set valeur_param='".$new_value."', comment_param='Activation de l\'envoi de sms. : relance 1,relance 2,relance 3,resa\n\n 0: Inactif\n 1: Actif' where type_param= 'empr' and sstype_param='sms_activation' ";
echo traite_rqt($rqt,"update empr_sms_activation");
}
}
//Ajout de la durée de consultation pour la circulation des périos
$rqt = "alter table abts_periodicites add consultation_duration int unsigned not null default 0";
echo traite_rqt($rqt,"alter table abts_periodicites add consultation_duration");
// suppr index inutile
$rqt = "alter table notices_fields_global_index drop index i_id_value";
echo traite_rqt($rqt,"alter table notices_fields_global_index drop index i_id_value");
//Modification du commentaire du paramètre opac_notice_reduit_format pour ajout format titre uniquement
$rqt = "update parametres set comment_param = 'Format d\'affichage des réduits de notices :\n 0 = titre+auteur principal\n 1 = titre+auteur principal+date édition\n 2 = titre+auteur principal+date édition + ISBN\n 3 = titre seul\n P 1,2,3 = tit+aut+champs persos id 1 2 3\n E 1,2,3 = tit+aut+édit+champs persos id 1 2 3\n T = tit1+tit4' where type_param='opac' and sstype_param='notice_reduit_format'";
echo traite_rqt($rqt,"update parametre opac_notice_reduit_format");
// Ajout du module Havest: Moissonneur de notice
$rqt="create table if not exists harvest_profil (
id_harvest_profil int unsigned not null auto_increment primary key,
harvest_profil_name varchar(255) not null default ''
)";
echo traite_rqt($rqt,"create table harvest");
$rqt="create table if not exists harvest_field (
id_harvest_field int unsigned not null auto_increment primary key,
num_harvest_profil int unsigned not null default 0,
harvest_field_xml_id int unsigned not null default 0,
harvest_field_first_flag int unsigned not null default 0,
harvest_field_order int unsigned not null default 0
)";
echo traite_rqt($rqt,"create table harvest_field");
$rqt="create table if not exists harvest_src (
id_harvest_src int unsigned not null auto_increment primary key,
num_harvest_field int unsigned not null default 0,
num_source int unsigned not null default 0,
harvest_src_unimacfield varchar(255) not null default '',
harvest_src_unimacsubfield varchar(255) not null default '',
harvest_src_pmb_unimacfield varchar(255) not null default '',
harvest_src_pmb_unimacsubfield varchar(255) not null default '',
harvest_src_prec_flag int unsigned not null default 0,
harvest_src_order int unsigned not null default 0
)";
echo traite_rqt($rqt,"create table harvest_src");
$rqt="create table if not exists harvest_profil_import (
id_harvest_profil_import int unsigned not null auto_increment primary key,
harvest_profil_import_name varchar(255) not null default ''
)";
echo traite_rqt($rqt,"create table harvest_profil_import");
$rqt="create table if not exists harvest_profil_import_field (
num_harvest_profil_import int unsigned not null default 0,
harvest_profil_import_field_xml_id int unsigned not null default 0,
harvest_profil_import_field_flag int unsigned not null default 0,
harvest_profil_import_field_order int unsigned not null default 0,
PRIMARY KEY (num_harvest_profil_import, harvest_profil_import_field_xml_id)
)";
echo traite_rqt($rqt,"create table harvest_profil_import_field");
$rqt = "CREATE TABLE if not exists harvest_search_field (
num_harvest_profil int unsigned not null default 0,
num_source int unsigned not null default 0,
num_field int unsigned not null default 0,
num_ss_field int unsigned not null default 0 ,
PRIMARY KEY (num_harvest_profil, num_source)
)";
echo traite_rqt($rqt,"CREATE TABLE harvest_search_field");
//AR - Ajout d'un paramètre de blocage d'import dans les autorités
$rqt = "alter table noeuds add authority_import_denied int unsigned not null default 0";
echo traite_rqt($rqt,"alter table noeuds add authority_import_denied");
$rqt = "alter table authors add author_import_denied int unsigned not null default 0";
echo traite_rqt($rqt,"alter table authors add author_import_denied");
$rqt = "alter table titres_uniformes add tu_import_denied int unsigned not null default 0";
echo traite_rqt($rqt,"alter table titres_uniformes add tu_import_denied");
$rqt = "alter table sub_collections add authority_import_denied int unsigned not null default 0";
echo traite_rqt($rqt,"alter table sub_collections add authority_import_denied");
$rqt = "alter table collections add authority_import_denied int unsigned not null default 0";
echo traite_rqt($rqt,"alter table collections add authority_import_denied");
//AR - Modification d'un paramètre pour définir la classe d'import des autorités...
$rqt = "update parametres set valeur_param = 'authority_import' where type_param= 'pmb' and sstype_param = 'import_modele_authorities'";
echo traite_rqt($rqt,"update parametres set pmb_import_modele_authorities = 'authority_import'");
//Ajout d'un index sur le champ ref dans les tables entrepots
//Récupération de la liste des sources
$sql_liste_sources = "SELECT source_id FROM connectors_sources ";
$res_liste_sources = mysql_query($sql_liste_sources, $dbh) or die(mysql_error());
//Pour chaque source
while ($row=mysql_fetch_row($res_liste_sources)) {
$sql_alter_table = "alter table entrepot_source_".$row[0]." drop index i_ref ";
echo traite_rqt($sql_alter_table, "alter table entrepot_source_".$row[0]." drop index i_ref");
$sql_alter_table = "alter table entrepot_source_".$row[0]." add index i_ref (ref) ";
echo traite_rqt($sql_alter_table, "alter table entrepot_source_".$row[0]." add index i_ref");
}
//Ajout d'un parametre permettant de préciser si l'on informe par email de l'évolution des demandes
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'demandes' and sstype_param='email_demandes' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'demandes', 'email_demandes', '1',
'Information par email de l\'évolution des demandes.\n 0 : Non\n 1 : Oui',
'',0) ";
echo traite_rqt($rqt, "insert demandes_email_demandes into parameters");
}
//AR - Ajout d'un paramètre utilisateur (choix d'un thésaurus par défaut en import d'autorités
$rqt = "alter table users add deflt_import_thesaurus int not null default 1 after deflt_thesaurus";
echo traite_rqt($rqt,"alter table users add deflt_import_thesaurus'");
//AR - On lui met un bonne valeur par défaut...
$rqt = "update users set deflt_import_thesaurus = ".$thesaurus_defaut;
echo traite_rqt($rqt,"update users set deflt_import_thesaurus");
//AR - Ajout d'une colonne sur la table connectors_sources pour définir les types d'enrichissements autorisés dans une source
$rqt = "alter table connectors_sources add type_enrichment_allowed text not null";
echo traite_rqt($rqt,"alter table connectors_sources add type_enrichment_allowed");
// ER - index notices.statut
$rqt = "ALTER TABLE notices DROP INDEX i_not_statut " ;
echo traite_rqt($rqt,"ALTER TABLE notices DROP INDEX i_not_statut ") ;
$rqt = "ALTER TABLE notices ADD INDEX i_not_statut (statut)" ;
echo traite_rqt($rqt,"ALTER TABLE notices ADD INDEX i_not_statut (statut)") ;
// Création cms
$rqt="create table if not exists cms_cadres (
id_cadre int unsigned not null auto_increment primary key,
cadre_hash varchar(255) not null default '',
cadre_name varchar(255) not null default '',
cadre_styles text not null,
cadre_dom_parent varchar(255) not null default '',
cadre_dom_after varchar(255) not null default ''
)";
echo traite_rqt($rqt,"create table cms_cadres");
$rqt="create table if not exists cms_cadre_content (
id_cadre_content int unsigned not null auto_increment primary key,
cadre_content_hash varchar(255) not null default '',
cadre_content_type varchar(255) not null default '',
cadre_content_num_cadre int(10) unsigned not null default 0,
cadre_content_data text not null,
cadre_content_num_cadre_content int unsigned not null default 0
)";
echo traite_rqt($rqt,"create table cms_cadre_content");
$rqt="create table if not exists cms_pages (
id_page int unsigned not null auto_increment primary key,
page_hash varchar(255) not null default '',
page_name varchar(255) not null default '',
page_description text not null
)";
echo traite_rqt($rqt,"create table cms_pages");
$rqt="create table if not exists cms_vars (
id_var int unsigned not null auto_increment primary key,
var_num_page int unsigned not null default 0,
var_name varchar(255) not null default '',
var_comment varchar(255) not null default ''
)";
echo traite_rqt($rqt,"create table cms_vars");
$rqt="create table if not exists cms_pages_env (
page_env_num_page int unsigned not null auto_increment primary key,
page_env_name varchar(255) not null default '',
page_env_id_selector varchar(255) not null default ''
)";
echo traite_rqt($rqt,"create table cms_pages_env");
$rqt="create table if not exists cms_hash (
hash varchar(255) not null default '' primary key
)";
echo traite_rqt($rqt,"create table cms_hash ");
//DB - parametre gestion de pret court
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='short_loan_management' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param)
VALUES (0, 'pmb', 'short_loan_management', '0', 'Gestion des prêts courts\n 0: Non\n 1: Oui')";
echo traite_rqt($rqt,"insert pmb_short_loan_management=0 into parametres");
}
//DB - ajout colonne duree pret court dans la table docs_type
$rqt="ALTER TABLE docs_type ADD short_loan_duration INT(6) UNSIGNED NOT NULL DEFAULT 1 ";
echo traite_rqt($rqt,"alter table docs_type add short_loan_duration");
//DB - correction origine notices
$rqt = "update notices set origine_catalogage='1' where origine_catalogage='0' ";
echo traite_rqt($rqt,"alter table notices correct origine_catalogage");
//DB - ajout flag pret court dans table pret
$rqt = "ALTER TABLE pret ADD short_loan_flag INT(1) NOT NULL DEFAULT 0 ";
echo traite_rqt($rqt,"alter table pret add short_loan_flag");
//DB - ajout flag pret court dans table pret_archive
$rqt = "ALTER TABLE pret_archive ADD arc_short_loan_flag INT(1) NOT NULL DEFAULT 0 ";
echo traite_rqt($rqt,"alter table pret_archive add arc_short_loan_flag");
//DB - parametre gestion de monopole de pret
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='loan_trust_management' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param)
VALUES (0, 'pmb', 'loan_trust_management', '0', 'Gestion de monopole de prêt\n 0: Non\n x: nombre de jours entre 2 prêts d\'un exemplaire d\'une même notice (ou bulletin)')";
echo traite_rqt($rqt,"insert pmb_loan_trust_management=0 into parametres");
}
// +-------------------------------------------------+
echo "
";
$rqt = "update parametres set valeur_param='".$action."' where type_param='pmb' and sstype_param='bdd_version' " ;
$res = mysql_query($rqt, $dbh) ;
echo "".$msg[1807].$action." !
";
echo form_relance ("v5.07");
break;
case "v5.07":
echo "".$msg['admin_misc_action']." | ".$msg['admin_misc_resultat']." |
";
// +-------------------------------------------------+
// ER : pour le gars au pull rouge
$rqt = "ALTER TABLE exemplaires MODIFY expl_cote varchar(255) ";
echo traite_rqt($rqt,"ALTER TABLE exemplaires MODIFY expl_cote varchar(255) ");
$rqt = "ALTER TABLE exemplaires MODIFY expl_cb varchar(255) ";
echo traite_rqt($rqt,"ALTER TABLE exemplaires MODIFY expl_cb varchar(255) ");
//AR - Ajout d'un champ dans cms_cadres
$rqt = "alter table cms_cadres add cadre_object varchar(255) not null default '' after cadre_hash";
echo traite_rqt($rqt,"alter table cms_cadre add cadre_object");
//JP - Ajout tri en opac pour champs persos de notice
$rqt = "ALTER TABLE collstate_custom ADD opac_sort INT NOT NULL DEFAULT 0";
echo traite_rqt($rqt,"ALTER TABLE collstate_custom ADD opac_sort INT NOT NULL DEFAULT 0");
$rqt = "ALTER TABLE empr_custom ADD opac_sort INT NOT NULL DEFAULT 0";
echo traite_rqt($rqt,"ALTER TABLE empr_custom ADD opac_sort INT NOT NULL DEFAULT 0");
$rqt = "ALTER TABLE expl_custom ADD opac_sort INT NOT NULL DEFAULT 0";
echo traite_rqt($rqt,"ALTER TABLE expl_custom ADD opac_sort INT NOT NULL DEFAULT 0");
$rqt = "ALTER TABLE gestfic0_custom ADD opac_sort INT NOT NULL DEFAULT 0";
echo traite_rqt($rqt,"ALTER TABLE gestfic0_custom ADD opac_sort INT NOT NULL DEFAULT 0");
$rqt = "ALTER TABLE notices_custom ADD opac_sort INT NOT NULL DEFAULT 1";
echo traite_rqt($rqt,"ALTER TABLE notices_custom ADD opac_sort INT NOT NULL DEFAULT 1");
//JP : Ajout d'un paramètre permettant de choisir une navigation abécédaire ou non en navigation dans les périodiques en OPAC
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='perio_a2z_abc_search' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'opac', 'perio_a2z_abc_search', '0',
'Recherche abécédaire dans le navigateur de périodiques en OPAC.\n0 : Non.\n1 : Oui.',
'c_recherche',0) ";
echo traite_rqt($rqt, "insert opac_perio_a2z_abc_search 0 into parameters");
}
//JP : Ajout d'un paramètre permettant de choisir le nombre maximum de notices par onglet en navigation dans les périodiques en OPAC
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='perio_a2z_max_per_onglet' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'opac', 'perio_a2z_max_per_onglet', '10',
'Recherche dans le navigateur de périodiques en OPAC : nombre maximum de notices par onglet.',
'c_recherche',0) ";
echo traite_rqt($rqt, "insert opac_perio_a2z_max_per_onglet 10 into parameters");
}
//DG - Mail de rappel au référent
$rqt = "ALTER TABLE groupe ADD mail_rappel INT( 1 ) UNSIGNED DEFAULT 0 NOT NULL ";
echo traite_rqt($rqt,"ALTER TABLE groupe ADD mail_rappel default 0");
//DG - Modification du commentaire du paramètre opac_notice_reduit_format pour ajout format titre uniquement
$rqt = "update parametres set comment_param = 'Format d\'affichage des réduits de notices :\n 0 = titre+auteur principal\n 1 = titre+auteur principal+date édition\n 2 = titre+auteur principal+date édition + ISBN\n 3 = titre seul\n P 1,2,3 = tit+aut+champs persos id 1 2 3\n E 1,2,3 = tit+aut+édit+champs persos id 1 2 3\n T = tit1+tit4\n 4 = titre+titre parallèle+auteur principal' where type_param='opac' and sstype_param='notice_reduit_format'";
echo traite_rqt($rqt,"update parametre opac_notice_reduit_format");
//DG - Alerter l'utilisateur par mail des nouvelles demandes en OPAC ?
$rqt = "ALTER TABLE users ADD user_alert_demandesmail INT(1) UNSIGNED NOT NULL DEFAULT 0 after user_alert_resamail";
echo traite_rqt($rqt,"ALTER TABLE users add user_alert_demandesmail default 0");
$rqt = "ALTER TABLE cms_cadre_content ADD cadre_content_object VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER cadre_content_type";
echo traite_rqt($rqt,"ALTER TABLE cms_cadre_content ADD cadre_content_object");
$rqt = "ALTER TABLE cms_build ADD build_page int(11) NOT NULL DEFAULT 0 AFTER build_obj";
echo traite_rqt($rqt,"ALTER TABLE cms_build ADD build_page");
//DG - Ordre des langues pour les notices
$rqt = "ALTER TABLE notices_langues ADD ordre_langue smallint(2) UNSIGNED NOT NULL DEFAULT 0";
echo traite_rqt($rqt,"ALTER TABLE notices_langues ADD ordre_langue") ;
//DB - grilles emprunteurs
$rqt = "create table empr_grilles (
empr_grille_categ int(5) not null default 0,
empr_grille_location int(5) not null default 0,
empr_grille_format longtext,
primary key (empr_grille_categ,empr_grille_location))";
echo traite_rqt($rqt,"create table empr_grilles") ;
//DB - parametres de gestion d'accès aux programmes externes pour l'indexation des documents numeriques
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='indexation_docnum_ext' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'pmb', 'indexation_docnum_ext', '',
'Paramètres de gestion d\'accès aux programmes externes pour l\'indexation des documents numériques :\n\n Chaque paramètre est défini par un couple : \"nom=valeur\"\n Les paramètres sont séparés par un \"point-virgule\".\n\n\n Exemples d\'utilisation de \"pyodconverter\", \"jodconverter\" et \"pdftotext\" :\n\npyodconverter_cmd=/opt/openoffice.org3/program/python /opt/ooo_converter/DocumentConverter.py %1s %2s;\njodconverter_cmd=/usr/bin/java -jar /opt/ooo_converter/jodconverter-2.2.2/lib/jodconverter-cli-2.2.2.jar %1s %2s;\njodconverter_url=http://localhost:8080/converter/converted/%1s;\npdftotext_cmd=/usr/bin/pdftotext -enc UTF-8 %1s -;',
'',0) ";
echo traite_rqt($rqt, "insert indexation_docnum_ext into parameters");
}
//Onglet perso en affichage de notice
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='notices_format_onglets' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param,section_param)
VALUES (0, 'opac', 'notices_format_onglets', '','Liste des id de template de notice pour ajouter des onglets personnalisés en affichage de notice\nExemple: 1,3','e_aff_notice')";
echo traite_rqt($rqt,"insert opac_notices_format_onglets into parametres");
}
//DG - Ajout de la localisation de l'emprunteur pour les stats
$rqt="ALTER TABLE pret_archive ADD arc_empr_location INT( 6 ) UNSIGNED DEFAULT 0 NOT NULL AFTER arc_empr_statut ";
echo traite_rqt($rqt,"alter table pret_archive add arc_empr_location default 0");
//DG - Ajout du type d'abonnement de l'emprunteur pour les stats
$rqt="ALTER TABLE pret_archive ADD arc_type_abt INT( 6 ) UNSIGNED DEFAULT 0 NOT NULL AFTER arc_empr_location ";
echo traite_rqt($rqt,"alter table pret_archive add arc_type_abt default 0");
//DG - Libellé OPAC des statuts d'exemplaires
$rqt = "ALTER TABLE docs_statut ADD statut_libelle_opac VARCHAR(255) DEFAULT '' after statut_libelle";
echo traite_rqt($rqt,"ALTER TABLE docs_statut add statut_libelle_opac default ''");
//DG - Visibilité OPAC des statuts d'exemplaires
$rqt = "ALTER TABLE docs_statut ADD statut_visible_opac TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT 1";
echo traite_rqt($rqt,"ALTER TABLE docs_statut ADD statut_visible_opac") ;
//DB - parametres d'alerte avant affichage des documents numériques
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='visionneuse_alert' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'opac', 'visionneuse_alert', '', 'Message d\'alerte à l\'ouverture des documents numériques.', 'm_photo',0) ";
echo traite_rqt($rqt, "insert opac_visionneuse_alert into parameters");
}
$rqt = "ALTER TABLE cms_build ADD build_fixed int(11) NOT NULL DEFAULT 0 AFTER id_build";
echo traite_rqt($rqt,"ALTER TABLE cms_build ADD build_fixed");
$rqt = "ALTER TABLE cms_build ADD build_child_before varchar(255) not null default '' AFTER build_parent";
echo traite_rqt($rqt,"ALTER TABLE cms_build ADD build_child_before");
//AR - création d'une boite noire pour les modules du portail
$rqt="create table if not exists cms_managed_modules (
managed_module_name varchar(255) not null default '',
managed_module_box text not null,
primary key (managed_module_name))";
echo traite_rqt($rqt, "create table if not exists cms_managed_modules");
$rqt = "alter table cms_cadres add cadre_fixed int(11) not null default 0 after cadre_name";
echo traite_rqt($rqt,"alter table cms_cadres add cadre_fixed");
//DG - Fixer l'âge minimum d'accès à la catégorie de lecteurs
$rqt = "ALTER TABLE empr_categ ADD age_min INT(3) UNSIGNED NOT NULL DEFAULT 0";
echo traite_rqt($rqt,"ALTER TABLE empr_categ ADD age_min default 0");
//DG - Fixer l'âge maximum d'accès à la catégorie de lecteurs
$rqt = "ALTER TABLE empr_categ ADD age_max INT(3) UNSIGNED NOT NULL DEFAULT 0";
echo traite_rqt($rqt,"ALTER TABLE empr_categ ADD age_max default 0");
// Liste des cms
$rqt="create table if not exists cms (
id_cms int unsigned not null auto_increment primary key,
cms_name varchar(255) not null default '',
cms_comment text not null
)";
echo traite_rqt($rqt,"create table cms");
// évolutions des cms
$rqt="create table if not exists cms_version (
id_version int unsigned not null auto_increment primary key,
version_cms_num int unsigned not null default 0 ,
version_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
version_comment text not null,
version_public int unsigned not null default 0,
version_user int unsigned not null default 0
)";
echo traite_rqt($rqt,"create table cms_version");
$rqt = "alter table cms_build add build_version_num int not null default 0 after id_build";
echo traite_rqt($rqt,"alter table cms_build add build_version_num");
//id du cms à utiliser en Opac
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='cms' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param,section_param)
VALUES (0, 'opac', 'cms', 0,'id du CMS utilisé en OPAC','a_general')";
echo traite_rqt($rqt,"insert opac_cms into parametres");
}
//DG - Colonnes exemplaires affichées en gestion
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='expl_data' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param,section_param)
VALUES (0, 'pmb', 'expl_data', 'expl_cb,expl_cote,location_libelle,section_libelle,statut_libelle,tdoc_libelle', 'Colonne des exemplaires, dans l\'ordre donné, séparé par des virgules : expl_cb,expl_cote,location_libelle,section_libelle,statut_libelle,tdoc_libelle #n : id des champs personnalisés \r\n expl_cb est obligatoire et sera ajouté si absent','')";
echo traite_rqt($rqt,"insert pmb_expl_data=expl_cb,expl_cote,location_libelle,section_libelle,statut_libelle,codestat_libelle,lender_libelle,tdoc_libelle into parametres");
}
//DB - parametre gestion de monopole de pret
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='expl_display_location_without_expl' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param)
VALUES (0, 'pmb', 'expl_display_location_without_expl', '0', 'Affichage de la liste des localisations sans exemplaire\n 0: Non\n 1: oui')";
echo traite_rqt($rqt,"insert pmb_expl_display_location_without_expl=0 into parametres");
}
// Voir les prets de son groupe de lecteur
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='show_group_checkout' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param,section_param)
VALUES (0, 'opac', 'show_group_checkout', '0', 'Le responsable du groupe de lecteur voit les prêts de son groupe\n 0: Non\n 1: oui','a_general')";
echo traite_rqt($rqt,"insert opac_show_group_checkout=0 into parametres");
}
// Archivage DSI
$rqt="create table if not exists dsi_archive (
num_banette_arc int unsigned not null default 0,
num_notice_arc int unsigned not null default 0,
date_diff_arc date not null default '0000-00-00',
primary key (num_banette_arc,num_notice_arc,date_diff_arc)
)";
echo traite_rqt($rqt,"create table dsi_archive");
//Nombre d'archive à mémoriser en dsi
$rqt = "ALTER TABLE bannettes ADD archive_number INT UNSIGNED NOT NULL default 0 ";
echo traite_rqt($rqt,"alter table bannettes add archive_number");
//AR - Erreur dans le type de colonne
$rqt = "ALTER TABLE cms_pages MODIFY page_hash varchar(255) ";
echo traite_rqt($rqt,"ALTER TABLE exemplaires MODIFY expl_cote varchar(255) ");
//AR - L'authentification Digest impose une valeur en clair...
$rqt= "alter table users add user_digest varchar(255) not null default '' after pwd";
echo traite_rqt($rqt,"alter table users add user_digest");
//Ajout de deux paramètres pour la navigation par facette
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='facette_in_bandeau_2' "))==0){
$rqt = "insert into parametres values(0,'opac','facette_in_bandeau_2',0,'La navigation par facettes apparait dans le bandeau ou dans le bandeau 2\n0 : dans le bandeau\n1 : Dans le bandeau 2','c_recherche',0)";
echo traite_rqt($rqt,"insert opac_facette_in_bandeau_2=0 into parametres");
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='autolevel2' "))==0){
$rqt = "insert into parametres values(0,'opac','autolevel2',0,'0 : mode normal de recherche\n1 : Affiche directement le résultat de la recherche tous les champs sans passer par la présentation du niveau 1 de recherche','c_recherche',0)";
echo traite_rqt($rqt,"insert opac_autolevel2=0 into parametres");
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='first_page_params' "))==0){
$rqt = "insert into parametres values(0,'opac','first_page_params','','Structure Json récapitulant les paramètres à initialiser pour la page d\\'accueil :\nExemple : \n{\n\"lvl\":\"cmspage\",\n\"pageid\":2\n}','b_aff_general',0)";
echo traite_rqt($rqt,"insert opac_first_page_params='' into parametres");
}
$rqt = "ALTER TABLE cms_build ADD build_type varchar(255) not null default 'cadre' AFTER build_version_num";
echo traite_rqt($rqt,"ALTER TABLE cms_build ADD build_type");
//Création d'un div class raw
$rqt = "ALTER TABLE cms_build ADD build_div INT UNSIGNED NOT NULL default 0 ";
echo traite_rqt($rqt,"alter table cms_build add build_div");
// Ajout tpl de notice pour générer le header
$rqt = "update parametres set comment_param = 'Format d\'affichage des réduits de notices :\n 0 = titre+auteur principal\n 1 = titre+auteur principal+date édition\n 2 = titre+auteur principal+date édition + ISBN\n 3 = titre seul\n P 1,2,3 = tit+aut+champs persos id 1 2 3\n E 1,2,3 = tit+aut+édit+champs persos id 1 2 3\n T = tit1+tit4\n 4 = titre+titre parallèle+auteur principal\n H 1 = id d\'un template de notice' where type_param='opac' and sstype_param='notice_reduit_format'";
echo traite_rqt($rqt,"update parametre opac_notice_reduit_format");
// +-------------------------------------------------+
echo "
";
$rqt = "update parametres set valeur_param='".$action."' where type_param='pmb' and sstype_param='bdd_version' " ;
$res = mysql_query($rqt, $dbh) ;
echo "".$msg[1807].$action." !
";
echo form_relance ("v5.08");
break;
case "v5.08":
echo "".$msg['admin_misc_action']." | ".$msg['admin_misc_resultat']." |
";
// +-------------------------------------------------+
set_time_limit(0);
mysql_query("set wait_timeout=28800");
//AR - paramètre activant les liens vers les documents numériques non visibles
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='show_links_invisible_docnums' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'opac', 'show_links_invisible_docnums', '0',
'Afficher les liens vers les documents numériques non visible en mode non connecté. (Ne fonctionne pas avec les droits d\'accès).\n 0 : Non.\n1 : Oui.',
'e_aff_notice',0) ";
echo traite_rqt($rqt, "insert opac_show_links_invisible_docnums into parameters");
}
// Générer un document (dsi)
$rqt = "ALTER TABLE bannettes ADD document_generate INT UNSIGNED NOT NULL default 0 ";
echo traite_rqt($rqt,"alter table bannettes add document_generate");
// Template de notice en génération de document (dsi)
$rqt = "ALTER TABLE bannettes ADD document_notice_tpl INT UNSIGNED NOT NULL default 0 ";
echo traite_rqt($rqt,"alter table bannettes add document_notice_tpl");
// Générer un document avec les doc num (dsi)
$rqt = "ALTER TABLE bannettes ADD document_insert_docnum INT UNSIGNED NOT NULL default 0 ";
echo traite_rqt($rqt,"alter table bannettes add document_insert_docnum");
// Grouper les documents (dsi)
$rqt = "ALTER TABLE bannettes ADD document_group INT UNSIGNED NOT NULL default 0 ";
echo traite_rqt($rqt,"alter table bannettes add document_group");
// Ajouter un sommaire (dsi)
$rqt = "ALTER TABLE bannettes ADD document_add_summary INT UNSIGNED NOT NULL default 0 ";
echo traite_rqt($rqt,"alter table bannettes add document_add_summary");
//DG - Index
$rqt = "alter table explnum drop index explnum_repertoire";
echo traite_rqt($rqt,"alter table explnum drop index explnum_repertoire");
$rqt = "alter table explnum add index explnum_repertoire(explnum_repertoire)";
echo traite_rqt($rqt,"alter table explnum add index explnum_repertoire");
// Ajout du module template de mail
$rqt="create table if not exists mailtpl (
id_mailtpl int unsigned not null auto_increment primary key,
mailtpl_name varchar(255) not null default '',
mailtpl_objet varchar(255) not null default '',
mailtpl_tpl text not null,
mailtpl_users varchar(255) not null default ''
)";
echo traite_rqt($rqt,"create table mailtpl");
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='img_folder' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'pmb', 'img_folder', '', 'Répertoire de stockage des images', '', 0) ";
echo traite_rqt($rqt, "insert pmb_img_folder into parameters");
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='img_url' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'pmb', 'img_url', '', 'URL d\'accès du répertoire des images (pmb_img_folder)', '', 0) ";
echo traite_rqt($rqt, "insert pmb_img_url into parameters");
}
// Ajout de la possibilité de joindre les images dans le mail ( pmb_mail_html_format=2 )
$rqt = "update parametres set comment_param = 'Format d\'envoi des mails à partir de l\'opac: \n 0: Texte brut\n 1: HTML \n 2: HTML, images incluses\nAttention, ne fonctionne qu\'en mode d\'envoi smtp !' where type_param='pmb' and sstype_param='mail_html_format'";
echo traite_rqt($rqt,"update parametre pmb_mail_html_format");
// Ajout de la possibilité de joindre les images dans le mail ( opac_mail_html_format=2 )
$rqt = "update parametres set comment_param = 'Format d\'envoi des mails à partir de l\'opac: \n 0: Texte brut\n 1: HTML \n 2: HTML, images incluses\nAttention, ne fonctionne qu\'en mode d\'envoi smtp !' where type_param='opac' and sstype_param='mail_html_format'";
echo traite_rqt($rqt,"update parametre opac_mail_html_format");
//AR - Ajout d'une colonne pour marquer un set comme étant en cours de rafraississement
$rqt = "alter table connectors_out_sets add being_refreshed int unsigned not null default 0";
echo traite_rqt($rqt,"alter table connectors_out_sets add bien_refreshed");
//DG - Infobulle lors du survol des vignettes (gestion)
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='book_pics_msg' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param,section_param) VALUES (0, 'pmb', 'book_pics_msg', '', 'Message sur le survol des vignettes des notices correspondant au chemin fourni par le paramètre book_pics_url','')";
echo traite_rqt($rqt,"insert pmb_book_pics_msg='' into parametres");
}
//DG - Infobulle lors du survol des vignettes (opac)
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='book_pics_msg' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param,section_param) VALUES (0, 'opac', 'book_pics_msg', '', 'Message sur le survol des vignettes des notices correspondant au chemin fourni par le paramètre book_pics_url','e_aff_notice')";
echo traite_rqt($rqt,"insert opac_book_pics_msg='' into parametres");
}
//AR - Utilisation des quotas pour la définition des vues disponibles pour un emprunteur
$rqt = "create table if not exists quotas_opac_views (
quota_type int(10) unsigned not null default 0,
constraint_type varchar(255) not null default '',
elements int(10) unsigned not null default 0,
value text not null,
primary key(quota_type,constraint_type,elements)
)";
echo traite_rqt($rqt,"create table quotas_opac_views");
//AR - table de mots
$rqt = "create table if not exists words (
id_word int unsigned not null auto_increment primary key,
word varchar(255) not null default '',
lang varchar(10) not null default '',
unique i_word_lang (word,lang)
)";
echo traite_rqt($rqt,"create table words");
$rqt = "select id_word from words limit 1";
$res = mysql_query($rqt);
//la méthode du chef reste la meilleure
if(!mysql_num_rows($res)){
set_time_limit(0);
//on ajoute un index bien pratique...
$rqt ="alter table notices_mots_global_index add index mot_lang(mot,lang)";
echo traite_rqt($rqt,"alter table notices_mots_global_index add index");
//remplissage de la table mots
$rqt ="insert into words (word,lang) select distinct mot,lang from notices_mots_global_index";
echo traite_rqt($rqt,"insert into words");
//on utilise une table tampon
$rqt ="create table transition select id_notice,code_champ,code_ss_champ,mot,id_word from notices_mots_global_index join words on (mot=word and notices_mots_global_index.lang=words.lang);";
echo traite_rqt($rqt,"create table transition");
//on y ajoute les index qui vont bien
$rqt ="alter table transition add primary key (id_notice,code_champ,code_ss_champ,mot)";
echo traite_rqt($rqt,"alter table transition add primary key");
//on ajout la clé étrangère num_word dans notices_mots_global_index
$rqt ="alter table notices_mots_global_index add num_word int(10) unsigned not null default 0 after mot";
echo traite_rqt($rqt,"alter table notices_mots_global_index add num_word");
//on l'affecte
$rqt ="update notices_mots_global_index as a0 join transition as a1 on (a0.id_notice=a1.id_notice and a0.code_champ=a1.code_champ and a0.code_ss_champ=a1.code_ss_champ and a0.mot=a1.mot) set num_word=id_word";
echo traite_rqt($rqt,"update notices_mots_global_index set num_word=id_word");
//on peut se passer de certains index et mettre les nouveaux
$rqt ="drop index i_mot on notices_mots_global_index";
echo traite_rqt($rqt,"drop index i_mot on notices_mots_global_index");
$rqt ="drop index i_id_mot on notices_mots_global_index";
echo traite_rqt($rqt,"drop index i_id_mot on notices_mots_global_index");
$rqt ="alter table notices_mots_global_index add index i_id_mot(num_word,id_notice)";
echo traite_rqt($rqt,"alter table notices_mots_global_index add index i_id_mot");
$rqt ="alter table notices_mots_global_index drop primary key";
echo traite_rqt($rqt,"alter table notices_mots_global_index drop primary key");
$rqt ="alter table notices_mots_global_index add primary key (id_notice,code_champ,code_ss_champ,num_word,position)";
echo traite_rqt($rqt,"alter table notices_mots_global_index add primary key");
//on supprime l'index pratique
$rqt ="drop index mot_lang on notices_mots_global_index";
echo traite_rqt($rqt,"drop index mot_lang on notices_mots_global_index");
//certains champs n'ont plus d'utilité dans notices_mots_global_index
$rqt ="alter table notices_mots_global_index drop mot";
echo traite_rqt($rqt,"alter table notices_mots_global_index drop mot");
$rqt ="alter table notices_mots_global_index drop nbr_mot";
echo traite_rqt($rqt,"alter table notices_mots_global_index drop nbr_mot");
$rqt ="alter table notices_mots_global_index drop lang";
echo traite_rqt($rqt,"alter table notices_mots_global_index drop lang");
//on supprime l'index pratique
//on supprime la table de transition
$rqt ="drop table transition";
echo traite_rqt($rqt,"drop table transition");
}
//AR - modification du paramètre de gestion des vues
$rqt = "update parametres set comment_param = 'Activer les vues OPAC :\n 0 : non activé\n 1 : activé avec gestion classique\n 2 : activé avec gestion avancée' where type_param = 'pmb' and sstype_param = 'opac_view_activate'";
echo traite_rqt($rqt,"update parametres pmb_opac_view_activate");
//DB - modification du paramètre utiliser_calendrier
$rqt = "update parametres set comment_param = 'Utiliser le calendrier des jours d\'ouverture ?\n 0 : non\n 1 : oui, pour le calcul des dates de retour et des retards\n 2 : oui, pour le calcul des dates de retour uniquement' where type_param = 'pmb' and sstype_param = 'utiliser_calendrier'";
echo traite_rqt($rqt,"update parametres pmb_utiliser_calendrier");
//NG - Ajout dans les statuts d'exemplaire la possibilité de rendre réservable ou non
$rqt = "ALTER TABLE docs_statut ADD statut_allow_resa INT( 1 ) UNSIGNED NOT NULL default 0 ";
echo traite_rqt($rqt,"alter table docs_statut add statut_allow_resa");
$rqt = "UPDATE docs_statut set statut_allow_resa=1 where pret_flag=1 ";
echo traite_rqt($rqt,"UPDATE docs_statut set statut_allow_resa=1 where pret_flag=1");
// Ajout CMS actif par défaut en Opac
$rqt = "alter table cms add cms_opac_default int unsigned not null default 0";
echo traite_rqt($rqt,"alter table cms add cms_opac_default");
$rqt = "create table if not exists cms_editorial_types (
id_editorial_type int unsigned not null auto_increment primary key,
editorial_type_element varchar(20) not null default '',
editorial_type_label varchar(255) not null default '',
editorial_type_comment text not null
)";
echo traite_rqt($rqt,"create table cms_editorial_types");
//AR - on ajoute le type de contenu sur les tables cms_articles et cms_sections
$rqt = "alter table cms_articles add article_num_type int unsigned not null default 0";
echo traite_rqt($rqt,"alter table cms_articles add article_num_type");
$rqt = "alter table cms_sections add section_num_type int unsigned not null default 0";
echo traite_rqt($rqt,"alter table cms_sections add section_num_type");
//AR - Un type de contenu c'est quoi? c'est une définition de grille de champs perso
$rqt = "create table if not exists cms_editorial_custom (
idchamp int(10) unsigned NOT NULL auto_increment,
num_type int unsigned not null default 0,
name varchar(255) NOT NULL default '',
titre varchar(255) default NULL,
type varchar(10) NOT NULL default 'text',
datatype varchar(10) NOT NULL default '',
options text,
multiple int(11) NOT NULL default 0,
obligatoire int(11) NOT NULL default 0,
ordre int(11) default NULL,
search INT(1) unsigned NOT NULL DEFAULT 0,
export INT(1) unsigned NOT NULL DEFAULT 0,
exclusion_obligatoire INT(1) unsigned NOT NULL DEFAULT 0,
pond int not null default 100,
opac_sort INT NOT NULL DEFAULT 0,
PRIMARY KEY (idchamp)) ";
echo traite_rqt($rqt,"create table cms_editorial_custom ");
$rqt = "create table if not exists cms_editorial_custom_lists (
cms_editorial_custom_champ int(10) unsigned NOT NULL default 0,
cms_editorial_custom_list_value varchar(255) default NULL,
cms_editorial_custom_list_lib varchar(255) default NULL,
ordre int(11) default NULL,
KEY editorial_custom_champ (cms_editorial_custom_champ),
KEY editorial_champ_list_value (cms_editorial_custom_champ,cms_editorial_custom_list_value)) " ;
echo traite_rqt($rqt,"create table if not exists cms_editorial_custom_lists ");
$rqt = "create table if not exists cms_editorial_custom_values (
cms_editorial_custom_champ int(10) unsigned NOT NULL default 0,
cms_editorial_custom_origine int(10) unsigned NOT NULL default 0,
cms_editorial_custom_small_text varchar(255) default NULL,
cms_editorial_custom_text text,
cms_editorial_custom_integer int(11) default NULL,
cms_editorial_custom_date date default NULL,
cms_editorial_custom_float float default NULL,
KEY editorial_custom_champ (cms_editorial_custom_champ),
KEY editorial_custom_origine (cms_editorial_custom_origine)) " ;
echo traite_rqt($rqt,"create table if not exists cms_editorial_custom_values ");
//NG - Ajout de l'url permetant de retouver la page Opac contenant le cadre
$rqt = "alter table cms_cadres add cadre_url text not null ";
echo traite_rqt($rqt,"alter table cms_cadre add cadre_url");
//MB - Ajout d'une colonne pour les noeuds utilisables ou non en indexation
$rqt = "ALTER TABLE noeuds ADD not_use_in_indexation INT( 1 ) UNSIGNED NOT NULL default 0 ";
echo traite_rqt($rqt,"alter table noeuds add not_use_in_indexation");
//MB - Modification du commentaire du paramètre show_categ_browser
$rqt = "UPDATE parametres SET comment_param = 'Affichage des catégories en page d\'accueil OPAC:\n0: Non\n1: Oui\n1 3,1: Oui, avec thésaurus id 3 puis 1 (préciser les thésaurus à afficher et l\'ordre)' where type_param = 'opac' and sstype_param = 'show_categ_browser'";
echo traite_rqt($rqt,"update parametres show_categ_browser");
//MB - Remplacement du code de lien d'autorité 2 par z car c'est le même libellé et z est normé
$rqt = "UPDATE aut_link SET aut_link_type = 'z' where aut_link_type = '2' ";
echo traite_rqt($rqt,"update aut_link");
//AR indexons correctement le contenu éditorial
$rqt = "create table if not exists cms_editorial_words_global_index(
num_obj int unsigned not null default 0,
type varchar(20) not null default '',
code_champ int not null default 0,
code_ss_champ int not null default 0,
num_word int not null default 0,
pond int not null default 100,
position int not null default 1,
primary key (num_obj,type,code_champ,code_ss_champ,num_word,position)
)";
echo traite_rqt($rqt,"create table cms_editorial_words_global_index ");
$rqt = "create table if not exists cms_editorial_fields_global_index(
num_obj int unsigned not null default 0,
type varchar(20) not null default '',
code_champ int(3) not null default 0,
code_ss_champ int(3) not null default 0,
ordre int(4) not null default 0,
value text not null,
pond int(4) not null default 100,
lang varchar(10) not null default '',
primary key(num_obj,type,code_champ,code_ss_champ,ordre),
index i_value(value(300))
)";
echo traite_rqt($rqt,"create table cms_editorial_fields_global_index ");
//DB - parametre d'alerte avant affichage des documents numériques
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='visionneuse_alert_doctype' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'opac', 'visionneuse_alert_doctype', '', 'Liste des types de documents pour lesquels une alerte est générée (séparés par une virgule).', 'm_photo',0) ";
echo traite_rqt($rqt, "insert opac_visionneuse_alert_doctype into parameters");
}
$rqt = "alter table cms_cadres add cadre_memo_url int not null default 0 after cadre_url";
echo traite_rqt($rqt,"alter table cms_cadres add cadre_memo_url");
//DB - entrepot d'archivage à la suppression des notices
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='archive_warehouse' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'pmb', 'archive_warehouse', '0', 'Identifiant de l\'entrepôt d\'archivage à la suppression des notices.', '',0) ";
echo traite_rqt($rqt, "insert archive_warehouse into parameters");
}
$rqt = "alter table cms_cadres add cadre_classement varchar(255) not null default ''";
echo traite_rqt($rqt,"alter table cms_cadres add cadre_classement");
//NG - Imprimante ticket
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='printer_name' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (0, 'pmb', 'printer_name', '', 'Nom de l\'imprimante de ticket de prêt, utilisant l\'applet jzebra. Le nom de l\'imprimante doit correspondre à la class développée spécifiquement pour la piloter.\nExemple: Nommer l\'imprimante \'metapace\' pour utiliser le driver classes/printer/metapace.class.php', '',0) ";
echo traite_rqt($rqt, "insert pmb_printer_name into parameters");
}
//DG - Localisation par défaut sur la visualisation des réservations
$rqt = "ALTER TABLE users ADD deflt_resas_location int(6) UNSIGNED DEFAULT 0 after deflt_collstate_location";
echo traite_rqt($rqt,"ALTER TABLE users ADD deflt_resas_location after deflt_collstate_location");
//DG - parametre localisation des groupes de lecteurs
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'empr' and sstype_param='groupes_localises' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param)
VALUES (0, 'empr', 'groupes_localises', '0', 'Groupes de lecteurs localisés par rapport au responsable \n0: Non \n1: oui')";
echo traite_rqt($rqt,"insert empr_groupes_localises=0 into parametres");
}
// Activation des recherches similaires
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='allow_simili_search' "))==0){
$rqt="INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (NULL, 'opac', 'allow_simili_search', '0', 'Activer les recherches similaires en OPAC:\n 0 : non \n 1 : oui', 'c_recherche', '0')";
echo traite_rqt($rqt,"insert opac_allow_simili_search='0' into parametres ");
}
//ajout d'une date de création pour les articles et les rubriques
$rqt ="alter table cms_articles add article_creation_date date";
echo traite_rqt($rqt,"alter table cms_articles add article_creation_date date");
$rqt ="alter table cms_sections add section_creation_date date";
echo traite_rqt($rqt,"alter table cms_sections add section_creation_date date");
//index d'on se lève tous pour la bannette de Camille
$rqt = "alter table bannette_abon drop index i_num_empr";
echo traite_rqt($rqt,"alter table bannette_abon drop index i_num_empr");
$rqt = "alter table bannette_abon add index i_num_empr(num_empr)";
echo traite_rqt($rqt,"alter table bannette_abon add index i_num_empr(num_empr)");
// MB - Modification du plus Opac devant les notices
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='notices_depliable_plus' "))==0){
$rqt="INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (NULL, 'opac', 'notices_depliable_plus', 'plus.gif', 'Image à utiliser devant un titre de notice pliée', 'e_aff_notice', '0')";
echo traite_rqt($rqt,"insert notices_depliable_plus into parametres ");
}
// MB - Modification du plus Opac devant les notices
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='notices_depliable_moins' "))==0){
$rqt="INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (NULL, 'opac', 'notices_depliable_moins', 'minus.gif', 'Image à utiliser devant un titre de notice dépliée', 'e_aff_notice', '0')";
echo traite_rqt($rqt,"insert notices_depliable_moins into parametres ");
}
//MB - Modification du commentaire du paramètre notices_depliable
$rqt = "UPDATE parametres SET comment_param = 'Affichage dépliable des notices en résultat de recherche:\n0: Non dépliable\n1: Dépliable en cliquant que sur l\'icone\n2: Déplibable en cliquant sur toute la ligne du titre' where type_param = 'opac' and sstype_param = 'notices_depliable'";
echo traite_rqt($rqt,"update parametres notices_depliable");
// Ajout du regroupement d'exemplaires pour le prêt
$rqt = "create table if not exists groupexpl (
id_groupexpl int(10) unsigned NOT NULL auto_increment,
groupexpl_resp_expl_num int(10) unsigned NOT NULL default 0,
groupexpl_name varchar(255) NOT NULL default '',
groupexpl_comment varchar(255) NOT NULL default '',
groupexpl_location int(10) unsigned NOT NULL default 0,
groupexpl_statut_resp int(10) unsigned NOT NULL default 0,
groupexpl_statut_others int(10) unsigned NOT NULL default 0,
PRIMARY KEY (id_groupexpl)) ";
echo traite_rqt($rqt,"create table groupexpl ");
// Ajout du regroupement d'exemplaires pour le prêt
$rqt = "create table if not exists groupexpl_expl (
groupexpl_num int(10) unsigned NOT NULL default 0,
groupexpl_expl_num int(10) unsigned NOT NULL default 0,
groupexpl_checked int unsigned NOT NULL default 0,
PRIMARY KEY (groupexpl_num, groupexpl_expl_num)) ";
echo traite_rqt($rqt,"create table groupexpl_expl ");
// Activation du prêt d'exemplaires groupés
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pmb' and sstype_param='pret_groupement' "))==0){
$rqt="INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES (NULL, 'pmb', 'pret_groupement', '0', 'Activer le prêt d\'exemplaires regroupés en un seul lot. La gestion des groupes se gére en Circulation / Groupe d\'exemplaires :\n 0 : non \n 1 : oui', '', '0')";
echo traite_rqt($rqt,"insert pmb_pret_groupement='0' into parametres ");
}
//AR - refonte éditions...
$rqt = "create table if not exists editions_states (
id_editions_state int unsigned not null auto_increment primary key,
editions_state_name varchar(255) not null default '',
editions_state_num_classement int not null default 0,
editions_state_used_datasource varchar(50) not null default '',
editions_state_comment text not null,
editions_state_fieldslist text not null,
editions_state_fieldsparams text not null
)";
echo traite_rqt($rqt,"create table if not exists editions_states");
// cms: Classement des pages
$rqt = "alter table cms_pages add page_classement varchar(255) not null default ''";
echo traite_rqt($rqt,"alter table cms_pages add page_classement");
// Transfert: regroupement des départs
if (mysql_num_rows(mysql_query("SELECT 1 FROM parametres WHERE type_param= 'transferts' and sstype_param='regroupement_depart' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, gestion, comment_param)
VALUES (0, 'transferts', 'regroupement_depart', '0', '1', 'Active le regroupement des départs\n 0: Non \n 1: Oui') ";
echo traite_rqt($rqt,"INSERT transferts_regroupement_depart INTO parametres") ;
}
//index Camille (comment ça encore ?)
$rqt = "alter table coordonnees drop index i_num_entite";
echo traite_rqt($rqt,"alter table coordonnees drop index i_num_entite");
$rqt = "alter table coordonnees add index i_num_entite (num_entite)";
echo traite_rqt($rqt,"alter table coordonnees add index i_num_entite (num_entite)");
// +-------------------------------------------------+
echo "
";
$rqt = "update parametres set valeur_param='".$action."' where type_param='pmb' and sstype_param='bdd_version' " ;
$res = mysql_query($rqt, $dbh) ;
echo "".$msg[1807].$action." !
";
echo form_relance ("v5.09");
break;
case "v5.09":
echo "".$msg['admin_misc_action']." | ".$msg['admin_misc_resultat']." |
";
// +-------------------------------------------------+
set_time_limit(0);
mysql_query("set wait_timeout=28800");
//AR - On revoit une clé primaire
$rqt ="alter table notices_fields_global_index drop primary key";
echo traite_rqt($rqt,"alter table notices_fields_global_index drop primary key");
$rqt ="alter table notices_fields_global_index add primary key(id_notice,code_champ,code_ss_champ,lang,ordre)";
echo traite_rqt($rqt,"alter table notices_fields_global_index add primary key(id_notice,code_champ,code_ss_champ,lang,ordre)");
//AR - ajout du partitionnement de manière systématique
$rqt="show table status where name='notices_mots_global_index' or name='notices_fields_global_index'";
$result = mysql_query($rqt);
if(mysql_num_rows($result)){
while($row = mysql_fetch_object($result)){
if($row->Create_options != "partitioned"){
$rqt="alter table ".$row->Name." partition by key(code_champ,code_ss_champ) partitions 50";
echo traite_rqt($rqt,"alter table ".$row->Name." partition by key");
}
}
}
// RFID: ajout de la gestion de l'antivol par afi
if (mysql_num_rows(mysql_query("SELECT 1 FROM parametres WHERE type_param= 'pmb' and sstype_param='rfid_afi_security_codes' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, gestion, comment_param)
VALUES (0, 'pmb', 'rfid_afi_security_codes', '', '0', 'Gestion de l\'antivol par le registre AFI.\nLa première valeur est celle de l\'antivol actif, la deuxième est celle de l\antivol inactif.\nExemple: 07,C2 ') ";
echo traite_rqt($rqt,"INSERT pmb_rfid_afi_security_codes INTO parametres") ;
}
// CMS: ajout de l'url de construction de l'opac
if (mysql_num_rows(mysql_query("SELECT 1 FROM parametres WHERE type_param= 'pmb' and sstype_param='url_base_cms_build' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, gestion, comment_param)
VALUES (0, 'pmb', 'url_base_cms_build', '', '0', 'url de construction du CMS de l\'OPAC') ";
echo traite_rqt($rqt,"INSERT pmb_url_base_cms_build INTO parametres") ;
}
//AR - on stocke le double metaphone de chaque mot !
$rqt = "alter table words add double_metaphone varchar(255) not null default ''";
echo traite_rqt($rqt,"alter table words add double_metaphone");
$rqt = "alter table words add stem varchar(255) not null default ''";
echo traite_rqt($rqt,"alter table words add stem");
//AR - Suggestions de mots dans la saisie en recherche simple
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='simple_search_suggestions' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'opac','simple_search_suggestions','0','Activer la suggestion de mots en recherche simple via la complétion\n0 : Désactiver\n1 : Activer\n\nNB : Cette fonction nécessite l\'installation de l\'extention levenshtein dans MySQL','c_recherche',0)" ;
echo traite_rqt($rqt,"insert opac_simple_search_suggestions into parametres") ;
}
//AR - Suggestions de mots dans la saisie en recherche simple
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'opac' and sstype_param='stemming_active' "))==0){
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, comment_param, section_param, gestion)
VALUES(0,'opac','stemming_active','0','Activer le stemming dans la recherche\n0 : Désactiver\n1 : Activer\n','c_recherche',0)" ;
echo traite_rqt($rqt,"insert opac_stemming_active into parametres") ;
}
$rqt = "delete from parametres where sstype_param like 'url_base_cms_build%' " ;
$res = mysql_query($rqt, $dbh) ;
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, gestion, comment_param)
VALUES (0, 'cms', 'url_base_cms_build', '', '0', 'url de construction du CMS de l\'OPAC') ";
echo traite_rqt($rqt,"INSERT pmb_url_base_cms_build INTO parametres") ;
//DG - Modification de la taille du champ content_infopage de la table infopages
$rqt = "ALTER TABLE infopages MODIFY content_infopage longblob NOT NULL default ''";
echo traite_rqt($rqt,"alter table infopages modify content_infopage");
//DG - Modification du commentaire du paramètre pmb_blocage_delai
$rqt = "UPDATE parametres SET comment_param = 'Délai à partir duquel le retard est pris en compte pour le blocage' where type_param = 'pmb' and sstype_param = 'blocage_delai'";
echo traite_rqt($rqt,"update parametres pmb_blocage_delai");
$rqt = "delete from parametres where sstype_param like 'url_base_cms_build%' " ;
$res = mysql_query($rqt, $dbh) ;
$rqt = "INSERT INTO parametres (id_param, type_param, sstype_param, valeur_param, gestion, comment_param)
VALUES (0, 'cms', 'url_base_cms_build', '', '0', 'url de construction du CMS de l\'OPAC') ";
echo traite_rqt($rqt,"INSERT pmb_url_base_cms_build INTO parametres") ;
//index Camille (c'est que le début d'accord d'accord ?)
$rqt = "alter table resa drop index i_idbulletin";
echo traite_rqt($rqt,"alter table resa drop index i_idbulletin");
$rqt = "alter table resa add index i_idbulletin (resa_idbulletin)";
echo traite_rqt($rqt,"alter table resa add index i_idbulletin (resa_idbulletin)");
$rqt = "alter table resa drop index i_idnotice";
echo traite_rqt($rqt,"alter table resa drop index i_idnotice");
$rqt = "alter table resa add index i_idnotice (resa_idnotice)";
echo traite_rqt($rqt,"alter table resa add index i_idnotice (resa_idnotice)");
// +-------------------------------------------------+
echo "
";
$rqt = "update parametres set valeur_param='".$action."' where type_param='pmb' and sstype_param='bdd_version' " ;
$res = mysql_query($rqt, $dbh) ;
echo "".$msg[1807].$action." !
";
echo form_relance ("v5.10");
break;
case "v5.10":
echo "".$msg['admin_misc_action']." | ".$msg['admin_misc_resultat']." |
";
// +-------------------------------------------------+
//AR - ajout de type de contenu générique pour les articles et rubriques...
if(!mysql_num_rows(mysql_query("select id_editorial_type from cms_editorial_types where editorial_type_element ='article_generic'"))){
$rqt = "insert into cms_editorial_types set editorial_type_element = 'article_generic', editorial_type_label ='CP pour Article'";
echo traite_rqt($rqt,"insert into cms_editorial_types set editorial_type_element = 'article_generic'") ;
$rqt = "insert into cms_editorial_types set editorial_type_element = 'section_generic', editorial_type_label ='CP pour Rubrique'";
echo traite_rqt($rqt,"insert into cms_editorial_types set editorial_type_element = 'section_generic'") ;
}
//DG - Ajout du champ index_libelle dans la table frais
$rqt = "ALTER TABLE frais ADD index_libelle TEXT";
echo traite_rqt($rqt,"alter table frais add index_libelle");
//DG - Paramètres pour les lettres de retard par groupe
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pdflettreretard' and sstype_param='1before_list_group' "))==0){
$rqt = "select valeur_param,comment_param from parametres where type_param= 'pdflettreretard' and sstype_param='1before_list' ";
$res = mysql_query($rqt);
$value_param = mysql_result($res,0,0);
$comment_param = mysql_result($res,0,1);
$rqt = "INSERT INTO parametres (type_param, sstype_param, valeur_param,comment_param) VALUES ('pdflettreretard', '1before_list_group', '".addslashes($value_param)."', '".addslashes($comment_param)."') " ;
echo traite_rqt($rqt,"insert pdflettreretard,1before_list_group into parametres");
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pdflettreretard' and sstype_param='1after_list_group' "))==0){
$rqt = "select valeur_param,comment_param from parametres where type_param= 'pdflettreretard' and sstype_param='1after_list' ";
$res = mysql_query($rqt);
$value_param = mysql_result($res,0,0);
$comment_param = mysql_result($res,0,1);
$rqt = "INSERT INTO parametres (type_param, sstype_param, valeur_param,comment_param) VALUES ('pdflettreretard', '1after_list_group', '".addslashes($value_param)."', '".addslashes($comment_param)."') " ;
echo traite_rqt($rqt,"insert pdflettreretard,1after_list_group into parametres");
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pdflettreretard' and sstype_param='1fdp_group' "))==0){
$rqt = "select valeur_param,comment_param from parametres where type_param= 'pdflettreretard' and sstype_param='1fdp' ";
$res = mysql_query($rqt);
$value_param = mysql_result($res,0,0);
$comment_param = mysql_result($res,0,1);
$rqt = "INSERT INTO parametres (type_param, sstype_param, valeur_param,comment_param) VALUES ('pdflettreretard', '1fdp_group', '".addslashes($value_param)."', '".addslashes($comment_param)."') " ;
echo traite_rqt($rqt,"insert pdflettreretard,1fdp_group into parametres");
}
if (mysql_num_rows(mysql_query("select 1 from parametres where type_param= 'pdflettreretard' and sstype_param='1madame_monsieur_group' "))==0){
$rqt = "select valeur_param,comment_param from parametres where type_param= 'pdflettreretard' and sstype_param='1madame_monsieur' ";
$res = mysql_query($rqt);
$value_param = mysql_result($res,0,0);
$comment_param = mysql_result($res,0,1);
$rqt = "INSERT INTO parametres (type_param, sstype_param, valeur_param,comment_param) VALUES ('pdflettreretard', '1madame_monsieur_group', '".addslashes($value_param)."', '".addslashes($comment_param)."') " ;
echo traite_rqt($rqt,"insert pdflettreretard,1madame_monsieur_group into parametres");
}
//DG - Impression du nom du groupe sur la lettre de rappel
$rqt = "ALTER TABLE groupe ADD lettre_rappel_show_nomgroup INT( 1 ) UNSIGNED DEFAULT 0 NOT NULL ";
echo traite_rqt($rqt,"ALTER TABLE groupe ADD lettre_rappel_show_nomgroup default 0");
$rqt = "update groupe set lettre_rappel_show_nomgroup=lettre_rappel ";
echo traite_rqt($rqt,"update groupe set lettre_rappel_show_nomgroup=lettre_rappel");
//AR - Ajout des extensions de formulaire pour les types de contenus
$rqt = "alter table cms_editorial_types add editorial_type_extension text not null";
echo traite_rqt($rqt,"alter table cms_editorial_types add editorial_type_extension");
//AR - Ajout de la table de stockages des infos des extension
$rqt = "create table cms_modules_extensions_datas (
id_extension_datas int(10) not null auto_increment primary key,
extension_datas_module varchar(255) not null default '',
extension_datas_type varchar(255) not null default '',
extension_datas_type_element varchar(255) not null default '',
extension_datas_num_element int(10) not null default 0,
extension_datas_datas blob
)";
echo traite_rqt($rqt,"create table cms_modules_extensions_datas");
//NG - Ordre des facettes
$rqt = "alter table facettes add facette_order int not null default 1";
echo traite_rqt($rqt,"alter table facettes add facette_order");
//NG - limit_plus des facettes
$rqt = "alter table facettes add facette_limit_plus int not null default 0";
echo traite_rqt($rqt,"alter table facettes add facette_limit_plus");
//MB - Modification de l'identifiant 28 en 1 pour le trie car il est présent en double dans sort.xml
$rqt = "update parametres set valeur_param=REPLACE(valeur_param, '_28', '_1') WHERE type_param='opac' AND sstype_param='default_sort' AND valeur_param REGEXP '_28[^0-9]|_28$'";
echo traite_rqt($rqt,"update param opac_default_sort");
//NG pb de placement de main_hors_footer et footer
$rqt = "update cms_build set build_parent='main' where build_obj='main_header' or build_obj='main_hors_footer' or build_obj='footer' ";
echo traite_rqt($rqt,"update cms_build set build_parent");
//NG pb de placement des zones du contener
$rqt = "update cms_build set build_child_before='', build_child_after='intro' where build_obj='main' ";
echo traite_rqt($rqt,"update cms_build where build_obj='main'");
$rqt = "update cms_build set build_child_before='main', build_child_after='bandeau' where build_obj='intro' ";
echo traite_rqt($rqt,"update cms_build where build_obj='intro'");
$rqt = "update cms_build set build_child_before='intro', build_child_after='bandeau_2' where build_obj='bandeau' ";
echo traite_rqt($rqt,"update cms_build where build_obj='bandeau'");
$rqt = "update cms_build set build_child_before='bandeau', build_child_after='' where build_obj='bandeau_2' ";
echo traite_rqt($rqt,"update cms_build where build_obj='bandeau_2' ");
// +-------------------------------------------------+
echo "
";
$rqt = "update parametres set valeur_param='".$action."' where type_param='pmb' and sstype_param='bdd_version' " ;
$res = mysql_query($rqt, $dbh) ;
echo "".$msg[1807].$action." !
";
break;
default:
include("$include_path/messages/help/$lang/alter.txt");
break;
}
/*
A mettre en 5.07
// en attente ER
ALTER TABLE explnum ADD explnum_vignette_mimetype VARCHAR(255) NOT NULL default '' AFTER explnum_vignette
update explnum set explnum_vignette_mimetype=explnum_mimetype where explnum_mimetype != ''
//ajout d'un champ section_comment dans la table docs_section // abandonné pour l'instant ER/DG 17/11/2011
//$rqt = "ALTER TABLE docs_section ADD section_comment TEXT ";
//echo traite_rqt($rqt,"ALTER TABLE docs_section ADD section_comment ");
// DG en attente
//ajout du champ groupe_lecteurs dans la table bannettes
$rqt = "ALTER TABLE bannettes ADD groupe_lecteurs INT(8) UNSIGNED NOT NULL default 0";
echo traite_rqt($rqt,"alter table bannettes add groupe_lecteurs");
//NG ajout de field_position dans notices_mots_global_index
$rqt = "alter table notices_mots_global_index add field_position int not null default 1";
echo traite_rqt($rqt,"alter table notices_mots_global_index add field_position");
// A METTTRE AILLEURS
require_once($class_path."/double_metaphone.class.php");
require_once($class_path."/stemming.class.php");
$rqt = "select id_word,word from words";
$res = mysql_query($rqt);
if(mysql_num_rows($res)){
while($row = mysql_fetch_object($res)){
$dmeta = new DoubleMetaPhone($row->word);
$stemming = new stemming($row->word);
$element_to_update = "";
if($dmeta->primary || $dmeta->secondary){
$element_to_update.="
double_metaphone = '".$dmeta->primary." ".$dmeta->secondary."'";
}
if($element_to_update) $element_to_update.=",";
$element_to_update.="stem = '".$stemming->stem."'";
if ($element_to_update){
mysql_query("update words set ".$element_to_update." where id_word = '".$row->id_word."'");
}
}
}
**/