diff --git a/html/admin/setup.php b/html/admin/setup.php index 0e4545c52..47f32683c 100644 --- a/html/admin/setup.php +++ b/html/admin/setup.php @@ -96,6 +96,10 @@ function GetVersion($p_cn) { */ function ExecuteScript($p_cn,$script) { $hf=fopen($script,'r'); + if ( $hf == false ) { + echo 'Ne peut ouvrir '.$script; + exit(); + } $sql=""; $flag_function=false; while (!feof($hf)) { diff --git a/html/admin/sql/patch/ac-upgrade7.sql b/html/admin/sql/patch/ac-upgrade7.sql index 4b2a6d95d..2b5ffb674 100644 --- a/html/admin/sql/patch/ac-upgrade7.sql +++ b/html/admin/sql/patch/ac-upgrade7.sql @@ -1,6 +1,6 @@ begin; insert into Theme values ('Colored','style-color.css',null); -delete from theme where the_filestyle='style-aqua.css' or the_filestyle='style-elegant.css' +delete from theme where the_filestyle='style-aqua.css' or the_filestyle='style-elegant.css'; update version set val=8; commit; diff --git a/html/admin/sql/patch/upgrade12.sql b/html/admin/sql/patch/upgrade12.sql index baae8c61c..b1193b9ab 100644 --- a/html/admin/sql/patch/upgrade12.sql +++ b/html/admin/sql/patch/upgrade12.sql @@ -6,6 +6,6 @@ drop table user_pref; -- trim the space update parm_code set p_code=trim(p_code); -upgrade version set val=13; +update version set val=13; commit; diff --git a/html/admin/sql/patch/upgrade13.sql b/html/admin/sql/patch/upgrade13.sql index c40d16571..5bb82f57b 100644 --- a/html/admin/sql/patch/upgrade13.sql +++ b/html/admin/sql/patch/upgrade13.sql @@ -393,7 +393,7 @@ create table document d_mimetype text ); -alter table document add constraint fk_ag_id foreign key (ag_id) references action_gestion(ag_id); + comment on table document is 'This table contains all the documents : summary and lob files'; @@ -417,8 +417,8 @@ INSERT INTO document_state VALUES (2, 'Brouillon'); INSERT INTO document_state VALUES (3, 'A envoyer'); ALTER TABLE ONLY document_state ADD CONSTRAINT document_state_pkey PRIMARY KEY (s_id); - -insert into attr_def (ad_id,ad_text) values (24,'Ville'); +alter sequence s_attr_def restart with 24; +insert into attr_def (ad_text) values ('Ville'); insert into attr_min values(9,24); insert into attr_min values(8,24); insert into attr_min values(14,24); @@ -442,9 +442,13 @@ create table action_gestion ( ); comment on table action_gestion is 'Action for Managing'; + + -- add contact -insert into fiche_def_ref(frd_text) values ('Contact'); -insert into attr_def(ad_text) values ('Société'); +alter sequence s_fiche_def_ref restart 16; +insert into fiche_def_ref(frd_text) values ('Contact'); + +insert into attr_def(ad_text) values ('Société'); insert into attr_def(ad_text) values ('Fax'); insert into attr_min values(16,1); insert into attr_min values(16,17); @@ -529,6 +533,9 @@ create view vw_supplier as SELECT a.f_id, a.av_text AS name, a1.av_text AS quick WHERE jnt_fic_att_value.ad_id = 18) h USING (f_id) WHERE a.frd_id = 8; +insert into parameter (pr_id) values ('MY_TEL'); +insert into parameter (pr_id) values ('MY_PAYS'); +insert into parameter (pr_id) values ('MY_FAX'); update version set val=14; diff --git a/html/parametre.php b/html/parametre.php index 591474d9a..8eb1a83eb 100644 --- a/html/parametre.php +++ b/html/parametre.php @@ -158,6 +158,9 @@ if ( $p_action=='company') { $m->MY_NUMBER=$p_no; $m->MY_CP=$p_cp; $m->MY_COMMUNE=$p_Commune; + $m->MY_TEL=$p_tel; + $m->MY_FAX=$p_fax; + $m->MY_PAYS=$p_pays; $m->Save(); } @@ -167,12 +170,15 @@ if ( $p_action=='company') { echo '