diff --git a/html/install.php b/html/install.php index f7bba3bd8..381448783 100644 --- a/html/install.php +++ b/html/install.php @@ -75,7 +75,12 @@ session_start();
"; content[206]=""; content[207]=""; content[208]=""; +content[209]=""; ✖"; $succeed="✓"; @@ -218,7 +228,7 @@ $locale=HtmlInput::default_value_request("clocale", "1"); $ctmp=HtmlInput::default_value_request("ctmp", "/tmp"); $cpath=HtmlInput::default_value_request("cpath", "/usr/bin"); $db_name=HtmlInput::default_value_request("cdbname", ""); - +$cmodelemono=HtmlInput::default_value_request('cmodelemono',MONO_TEMPLATE_UPGRADE); //------------------------------------------------------------------------- // warn only if we can not write in include //------------------------------------------------------------------------- @@ -590,24 +600,19 @@ $cn=new Database(); echo "' . $failed ; - printf (_('La base de donnée %s est vide, - veuillez vous y connecter et executer noalyss/contrib/mono-dossier/mono.sql - avec phpPgAdmin ou pgAdmin3 ou en commande en ligne - puis faites un seul de ces choix : '),dbname); - echo '
"._("Tout est installé"). $succeed; diff --git a/include/config.inc b/include/config.inc index 7f0b1c44c..9a239e82d 100644 --- a/include/config.inc +++ b/include/config.inc @@ -23,30 +23,30 @@ /*!\file * \brief user setting */ + +// To allow to access the Info system +// define ("SYSINFO_DISPLAY",true); diff --git a/include/lib/class_database.php b/include/lib/class_database.php index 530ec8275..05f0a5abe 100644 --- a/include/lib/class_database.php +++ b/include/lib/class_database.php @@ -110,7 +110,7 @@ class Database $this->db=$a; $this->is_open=TRUE; if ($this->exist_schema('comptaproc')) - pg_exec($this->db, 'set search_path to public,comptaproc;'); + pg_exec($this->db, 'set search_path to public,comptaproc,pg_catalog;'); pg_exec($this->db, 'set DateStyle to ISO, MDY;'); ob_end_clean(); } diff --git a/include/lib/config_file.php b/include/lib/config_file.php index 3ac51baa7..a0034c506 100644 --- a/include/lib/config_file.php +++ b/include/lib/config_file.php @@ -66,9 +66,10 @@ function config_file_form($p_array=null) $cport=5432; $cdomain=''; $clocale=1; - $multi=1; - $cdbname="database_noalyss"; + $multi="N"; + $cdbname=""; $chost="localhost"; + $cmodelemono=MONO_TEMPLATE_UPGRADE; } else extract ($p_array); @@ -95,9 +96,21 @@ function config_file_form($p_array=null) */ $smulti=new ICheckBox('multi'); $smulti->javascript=' onchange="show_dbname(this)" '; - $smulti->value='Y'; + $smulti->value = 'Y'; + if ( $multi == 'Y') { + $smulti->selected=true; + + } $icdbname=new IText('cdbname'); - + $icdbname->value=$cdbname; + $icmodelemono=new ISelect('cmodelemono'); + $icmodelemono->value=array( + array('label'=>'***'._('Mise à jour').'***',"value"=>MONO_TEMPLATE_UPGRADE), + array('label'=>'Basique comptabilité France',"value"=>MONO_TEMPLATE_FRANCE), + array('label'=>'Basique comptabilité Belgique',"value"=>MONO_TEMPLATE_BELGIUM), + array('label'=>'***'._('Vide').'***',"value"=>MONO_TEMPLATE_EMPTY) + ); + $icmodelemono->selected=$cmodelemono; require NOALYSS_TEMPLATE.'/template_config_form.php'; } /** @@ -193,7 +206,6 @@ function display_file_config($p_array,$from_setup=1,$p_os=1) print ( '// define ("SITE_UPDATE_PLUGIN","");'."\r\n"); print ( '// To allow to access the Info system'."\r\n"); print ( '// define ("SYSINFO_DISPLAY",true);'."\r\n"); - print ('?>'); } /*!\brief create the config file */ diff --git a/contrib/mono-dossier/mono.sql b/include/sql/mono/mono.sql similarity index 79% rename from contrib/mono-dossier/mono.sql rename to include/sql/mono/mono.sql index fe4fef052..927460f87 100644 --- a/contrib/mono-dossier/mono.sql +++ b/include/sql/mono/mono.sql @@ -4,29 +4,29 @@ SET statement_timeout = 0; SET client_encoding = 'UTF8'; -SET standard_conforming_strings = off; +SET standard_conforming_strings = on; SET check_function_bodies = false; SET client_min_messages = warning; -SET escape_string_warning = off; -- --- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: - +-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - -- -SET search_path = public, pg_catalog; +SET search_path = public, pg_catalog,comptaproc; -- -- Name: limit_user(); Type: FUNCTION; Schema: public; Owner: - -- CREATE FUNCTION limit_user() RETURNS trigger - LANGUAGE plpgsql AS $$ begin NEW.ac_user := substring(NEW.ac_user from 1 for 80); return NEW; -end; $$; +end; +$$ +LANGUAGE plpgsql; SET default_tablespace = ''; @@ -34,7 +34,7 @@ SET default_tablespace = ''; SET default_with_oids = false; -- --- Name: ac_dossier; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: ac_dossier; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE ac_dossier ( @@ -46,7 +46,7 @@ CREATE TABLE ac_dossier ( -- --- Name: ac_users; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: ac_users; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE ac_users ( @@ -62,7 +62,7 @@ CREATE TABLE ac_users ( -- --- Name: audit_connect; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: audit_connect; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE audit_connect ( @@ -84,8 +84,8 @@ CREATE TABLE audit_connect ( CREATE SEQUENCE audit_connect_ac_id_seq START WITH 1 INCREMENT BY 1 - NO MAXVALUE NO MINVALUE + NO MAXVALUE CACHE 1; @@ -96,13 +96,6 @@ CREATE SEQUENCE audit_connect_ac_id_seq ALTER SEQUENCE audit_connect_ac_id_seq OWNED BY audit_connect.ac_id; --- --- Name: audit_connect_ac_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - --- - -SELECT pg_catalog.setval('audit_connect_ac_id_seq', 287, true); - - -- -- Name: dossier_id; Type: SEQUENCE; Schema: public; Owner: - -- @@ -110,20 +103,13 @@ SELECT pg_catalog.setval('audit_connect_ac_id_seq', 287, true); CREATE SEQUENCE dossier_id START WITH 1 INCREMENT BY 1 - NO MAXVALUE NO MINVALUE + NO MAXVALUE CACHE 1; -- --- Name: dossier_id; Type: SEQUENCE SET; Schema: public; Owner: - --- - -SELECT pg_catalog.setval('dossier_id', 29, true); - - --- --- Name: jnt_use_dos; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: jnt_use_dos; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE jnt_use_dos ( @@ -134,7 +120,7 @@ CREATE TABLE jnt_use_dos ( -- --- Name: modeledef; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: modeledef; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE modeledef ( @@ -145,7 +131,7 @@ CREATE TABLE modeledef ( -- --- Name: priv_user; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: priv_user; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE priv_user ( @@ -155,6 +141,15 @@ CREATE TABLE priv_user ( ); +-- +-- Name: repo_version; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- + +CREATE TABLE repo_version ( + val integer NOT NULL +); + + -- -- Name: s_modid; Type: SEQUENCE; Schema: public; Owner: - -- @@ -162,18 +157,11 @@ CREATE TABLE priv_user ( CREATE SEQUENCE s_modid START WITH 1 INCREMENT BY 1 - NO MAXVALUE NO MINVALUE + NO MAXVALUE CACHE 1; --- --- Name: s_modid; Type: SEQUENCE SET; Schema: public; Owner: - --- - -SELECT pg_catalog.setval('s_modid', 8, true); - - -- -- Name: seq_jnt_use_dos; Type: SEQUENCE; Schema: public; Owner: - -- @@ -181,18 +169,11 @@ SELECT pg_catalog.setval('s_modid', 8, true); CREATE SEQUENCE seq_jnt_use_dos START WITH 1 INCREMENT BY 1 - NO MAXVALUE NO MINVALUE + NO MAXVALUE CACHE 1; --- --- Name: seq_jnt_use_dos; Type: SEQUENCE SET; Schema: public; Owner: - --- - -SELECT pg_catalog.setval('seq_jnt_use_dos', 33, true); - - -- -- Name: seq_priv_user; Type: SEQUENCE; Schema: public; Owner: - -- @@ -200,20 +181,13 @@ SELECT pg_catalog.setval('seq_jnt_use_dos', 33, true); CREATE SEQUENCE seq_priv_user START WITH 1 INCREMENT BY 1 - NO MAXVALUE NO MINVALUE + NO MAXVALUE CACHE 1; -- --- Name: seq_priv_user; Type: SEQUENCE SET; Schema: public; Owner: - --- - -SELECT pg_catalog.setval('seq_priv_user', 16, true); - - --- --- Name: theme; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: theme; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE theme ( @@ -224,7 +198,7 @@ CREATE TABLE theme ( -- --- Name: user_global_pref; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: user_global_pref; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE user_global_pref ( @@ -269,27 +243,11 @@ COMMENT ON COLUMN user_global_pref.parameter_value IS 'the value of parameter '; CREATE SEQUENCE users_id START WITH 1 INCREMENT BY 1 - NO MAXVALUE NO MINVALUE + NO MAXVALUE CACHE 1; --- --- Name: users_id; Type: SEQUENCE SET; Schema: public; Owner: - --- - -SELECT pg_catalog.setval('users_id', 5, true); - - --- --- Name: version; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE repo_version ( - val integer NOT NULL -); - - -- -- Name: ac_id; Type: DEFAULT; Schema: public; Owner: - -- @@ -301,18 +259,14 @@ ALTER TABLE ONLY audit_connect ALTER COLUMN ac_id SET DEFAULT nextval('audit_con -- Data for Name: ac_dossier; Type: TABLE DATA; Schema: public; Owner: - -- -COPY ac_dossier (dos_id, dos_name, dos_description, dos_jnt_user) FROM stdin; -25 Dossier Dossier par défaut 0 -\. +INSERT INTO ac_dossier VALUES (25, 'Dossier', 'Dossier par défaut', 0); -- -- Data for Name: ac_users; Type: TABLE DATA; Schema: public; Owner: - -- -COPY ac_users (use_id, use_first_name, use_name, use_login, use_active, use_pass, use_admin) FROM stdin; -1 \N \N phpcompta 1 b1cc88e1907cde80cb2595fa793b3da9 1 -\. +INSERT INTO ac_users VALUES (1, NULL, NULL, 'phpcompta', 1, 'b1cc88e1907cde80cb2595fa793b3da9', 1); -- @@ -321,68 +275,98 @@ COPY ac_users (use_id, use_first_name, use_name, use_login, use_active, use_pass +-- +-- Name: audit_connect_ac_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - +-- + +SELECT pg_catalog.setval('audit_connect_ac_id_seq', 287, true); + + +-- +-- Name: dossier_id; Type: SEQUENCE SET; Schema: public; Owner: - +-- + +SELECT pg_catalog.setval('dossier_id', 29, true); + + -- -- Data for Name: jnt_use_dos; Type: TABLE DATA; Schema: public; Owner: - -- -COPY jnt_use_dos (jnt_id, use_id, dos_id) FROM stdin; -29 1 25 -\. +INSERT INTO jnt_use_dos VALUES (29, 1, 25); -- -- Data for Name: modeledef; Type: TABLE DATA; Schema: public; Owner: - -- -COPY modeledef (mod_id, mod_name, mod_desc) FROM stdin; -1 (BE) Basique Comptabilité Belge, à adapter -2 (FR) Basique Comptabilité Française, à adapter -\. +INSERT INTO modeledef VALUES (1, '(BE) Basique', 'Comptabilité Belge, à adapter'); +INSERT INTO modeledef VALUES (2, '(FR) Basique', 'Comptabilité Française, à adapter'); -- -- Data for Name: priv_user; Type: TABLE DATA; Schema: public; Owner: - -- -COPY priv_user (priv_id, priv_jnt, priv_priv) FROM stdin; -\. + + +-- +-- Data for Name: repo_version; Type: TABLE DATA; Schema: public; Owner: - +-- + +INSERT INTO repo_version VALUES (15); + + +-- +-- Name: s_modid; Type: SEQUENCE SET; Schema: public; Owner: - +-- + +SELECT pg_catalog.setval('s_modid', 8, true); + + +-- +-- Name: seq_jnt_use_dos; Type: SEQUENCE SET; Schema: public; Owner: - +-- + +SELECT pg_catalog.setval('seq_jnt_use_dos', 33, true); + + +-- +-- Name: seq_priv_user; Type: SEQUENCE SET; Schema: public; Owner: - +-- + +SELECT pg_catalog.setval('seq_priv_user', 16, true); -- -- Data for Name: theme; Type: TABLE DATA; Schema: public; Owner: - -- -COPY theme (the_name, the_filestyle, the_filebutton) FROM stdin; -classic style.css \N -Light style-light.css \N -Colored style-color.css \N -EPad style-epad.css \N -\. +INSERT INTO theme VALUES ('Light', 'style-light.css', NULL); +INSERT INTO theme VALUES ('Mandarine', 'style-mandarine.css', NULL); +INSERT INTO theme VALUES ('Mobile', 'style-mobile.css', NULL); +INSERT INTO theme VALUES ('Classique', 'style-classic.css', NULL); -- -- Data for Name: user_global_pref; Type: TABLE DATA; Schema: public; Owner: - -- -COPY user_global_pref (user_id, parameter_type, parameter_value) FROM stdin; -phpcompta TOPMENU TEXT -phpcompta PAGESIZE 50 -phpcompta THEME classic -phpcompta LANG fr_FR.utf8 -\. +INSERT INTO user_global_pref VALUES ('phpcompta', 'TOPMENU', 'TEXT'); +INSERT INTO user_global_pref VALUES ('phpcompta', 'PAGESIZE', '50'); +INSERT INTO user_global_pref VALUES ('phpcompta', 'LANG', 'fr_FR.utf8'); +INSERT INTO user_global_pref VALUES ('phpcompta', 'THEME', 'Classique'); -- --- Data for Name: version; Type: TABLE DATA; Schema: public; Owner: - +-- Name: users_id; Type: SEQUENCE SET; Schema: public; Owner: - -- -COPY repo_version (val) FROM stdin; -14 -\. +SELECT pg_catalog.setval('users_id', 5, true); -- --- Name: ac_dossier_dos_name_key; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: ac_dossier_dos_name_key; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY ac_dossier @@ -390,7 +374,7 @@ ALTER TABLE ONLY ac_dossier -- --- Name: ac_dossier_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: ac_dossier_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY ac_dossier @@ -398,7 +382,7 @@ ALTER TABLE ONLY ac_dossier -- --- Name: ac_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: ac_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY ac_users @@ -406,7 +390,7 @@ ALTER TABLE ONLY ac_users -- --- Name: ac_users_use_login_key; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: ac_users_use_login_key; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY ac_users @@ -414,7 +398,7 @@ ALTER TABLE ONLY ac_users -- --- Name: audit_connect_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: audit_connect_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY audit_connect @@ -422,7 +406,7 @@ ALTER TABLE ONLY audit_connect -- --- Name: jnt_use_dos_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: jnt_use_dos_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY jnt_use_dos @@ -430,7 +414,7 @@ ALTER TABLE ONLY jnt_use_dos -- --- Name: modeledef_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: modeledef_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY modeledef @@ -438,7 +422,7 @@ ALTER TABLE ONLY modeledef -- --- Name: pk_user_global_pref; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: pk_user_global_pref; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY user_global_pref @@ -446,7 +430,7 @@ ALTER TABLE ONLY user_global_pref -- --- Name: priv_user_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: priv_user_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY priv_user @@ -454,29 +438,29 @@ ALTER TABLE ONLY priv_user -- --- Name: version_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: repo_version_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- -ALTER TABLE ONLY version - ADD CONSTRAINT version_pkey PRIMARY KEY (val); +ALTER TABLE ONLY repo_version + ADD CONSTRAINT repo_version_pkey PRIMARY KEY (val); -- --- Name: audit_connect_ac_user; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: audit_connect_ac_user; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX audit_connect_ac_user ON audit_connect USING btree (ac_user); -- --- Name: fk_jnt_dos_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: fk_jnt_dos_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX fk_jnt_dos_id ON jnt_use_dos USING btree (dos_id); -- --- Name: fk_jnt_use_dos; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: fk_jnt_use_dos; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX fk_jnt_use_dos ON jnt_use_dos USING btree (use_id); @@ -486,10 +470,7 @@ CREATE INDEX fk_jnt_use_dos ON jnt_use_dos USING btree (use_id); -- Name: limit_user_trg; Type: TRIGGER; Schema: public; Owner: - -- -CREATE TRIGGER limit_user_trg - BEFORE INSERT OR UPDATE ON audit_connect - FOR EACH ROW - EXECUTE PROCEDURE limit_user(); +CREATE TRIGGER limit_user_trg BEFORE INSERT OR UPDATE ON audit_connect FOR EACH ROW EXECUTE PROCEDURE limit_user(); -- @@ -528,11 +509,3 @@ ALTER TABLE ONLY priv_user -- PostgreSQL database dump complete -- -begin; -update theme set the_name='Mandarine' ,the_filestyle='style-mandarine.css' where the_name='Colored'; -update theme set the_name='Mobile' ,the_filestyle='style-mobile.css' where the_name='EPad'; -update theme set the_name = 'Classique' where the_name='classic'; -update user_global_pref set parameter_value='Classique' where parameter_type='THEME'; -update theme set the_filestyle='style-classic.css' where the_filestyle='style.css'; -update repo_version set val=15; -commit; diff --git a/include/template/template_config_form.php b/include/template/template_config_form.php index 6007d0081..3df715473 100644 --- a/include/template/template_config_form.php +++ b/include/template/template_config_form.php @@ -95,4 +95,12 @@ function show_dbname(obj) { alert_box(e.getMessage); } } +selected == true) : +?> + show_dbname($('multi')); + \ No newline at end of file