Merge branch 'stable' into unstable

* stable: (26 commits)
  Translation
  Fix Create user , password not set
  Improve : creation db , mod1 , mod2 and account_repository remove the alter table disable all triggers
  Bug : some db doesn't have the view v_quant_detail
  Cosmetic: without z-index, the class col is behind the autocomplete div in COMPANY
  Fix Create user , password not set
  Improve : creation db , mod1 , mod2 and account_repository remove the alter table disable all triggers
  Bug : some db doesn't have the view v_quant_detail
  Fix bug CSV for P1TVA , wrong header
  Fix bug CSV for P1TVA , wrong header
  RECONCILE : VAT ND not in account
  RECONCILE : fix bug : sum incorrect if several items
  RECONCILE : remove direct access to
  Cosmetic improve widget bookmark color for hover
  Cosmetic add inner_box2
  Cosmetic
  Task #0002376: Numéro de pièce, remplissage avec des 0 code : renommage de set_pj par update_receipt
  C0MENU : bug javascript Uniquement note de débit ou crédit ne fonctionne pas
  Cosmetic #0002375: Menu COMPTA/LET/LETCARD : le nom de la fiche n'apparaît pas.
  PHP8.2 compatility : strip_tags null
  ...
This commit is contained in:
sparkyx 2024-09-07 19:30:23 +02:00
commit accb57680a
12 changed files with 1210 additions and 1920 deletions

View file

@ -855,7 +855,6 @@ input[disabled], textarea[disabled], option[disabled], optgroup[disabled], selec
a#anchorbutton, .button, a.button,div.content a.button {
color:#FFFFFF;
font-weight: bold;
text-decoration:none;
font-family: arial,verdana,sans-serif,helvetica;
background-image: url("../image/bg-submit2.gif");

View file

@ -600,36 +600,11 @@ if ($account == 0 ) {
if ( DEBUGNOALYSS == 0 ) ob_start();
$cn->exec_sql("create database ".domaine."account_repository encoding='utf8'");
$repo=new Database();
$sql_trigger_activate="
create or replace procedure public.trigger_activate(to_enable bool)
language plpgsql
as
$$
declare
rec1 record;
cmd text;
begin
for rec1 in (select relname,nspname
from pg_catalog.pg_class pc join pg_catalog.pg_namespace pn on (pn.oid=pc.relnamespace)
where pn.nspname in ('public','comptaproc') and relhastriggers is true) loop
if to_enable is false then
cmd=format('alter table %s.%s disable trigger all',rec1.nspname,rec1.relname);
else
cmd=format('alter table %s.%s enable trigger all',rec1.nspname,rec1.relname);
end if;
execute cmd;
raise notice '%',cmd;
end loop;
end
$$;
";
$repo->exec_sql($sql_trigger_activate);
$repo->start();
$repo->execute_script(NOALYSS_INCLUDE."/sql/account_repository/schema.sql");
$repo->exec_sql("call public.trigger_activate(false) ");
$repo->execute_script(NOALYSS_INCLUDE."/sql/account_repository/data.sql");
$repo->execute_script(NOALYSS_INCLUDE."/sql/account_repository/constraint.sql");
$repo->commit($cn);
/* update name administrator */
@ -638,9 +613,6 @@ $$;
$repo->exec_sql("update public.ac_users set use_login=$1,use_pass=md5($2),use_active=1 where use_id=1",
array(strtolower($cadmin),$cpassword_admin));
$repo->exec_sql("call public.trigger_activate(true) ");
$repo->exec_sql("drop procedure public.trigger_activate ");
if ( DEBUGNOALYSS == 0 )
{
ob_end_clean();
@ -654,15 +626,13 @@ $$;
$cn->exec_sql("create database ".domaine."mod1 encoding='utf8'");
$cn=new Database(1,'mod');
$cn->exec_sql($sql_trigger_activate);
$cn->start();
$cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/schema.sql');
$cn->exec_sql("call public.trigger_activate(false) ");
$cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/data.sql');
$cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/constraint.sql');
$cn->commit();
$cn->exec_sql("call public.trigger_activate(true) ");
$cn->exec_sql("drop procedure public.trigger_activate");
if ( DEBUGNOALYSS == 0 )
{
ob_end_clean();
@ -671,18 +641,15 @@ $$;
echo _("Creation of Modele 2");
$cn->exec_sql("create database ".domaine."mod2 encoding='utf8'");
$cn=new Database(2,'mod');
$cn->exec_sql($sql_trigger_activate);
$cn->start();
if ( DEBUGNOALYSS == 0 ) { ob_start(); }
$cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/schema.sql');
$cn->exec_sql("call public.trigger_activate(false) ");
$cn->execute_script(NOALYSS_INCLUDE.'/sql/mod2/data.sql');
$cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/constraint.sql');
$cn->commit();
$cn->exec_sql("call public.trigger_activate(true) ");
$cn->exec_sql("drop procedure public.trigger_activate");
if ( DEBUGNOALYSS == 0 ) ob_end_clean();
echo '<h1>'._('Important').'</h1>';
echo '<p>'._('Utilisateur administrateur'),' ',NOALYSS_ADMINISTRATOR,'</p>';

View file

@ -61,41 +61,12 @@ class Package_Template extends Package_Noalyss
$sql=sprintf(" create database %smod%d encoding='utf8'", domaine, $seq);
$cn->exec_sql($sql);
$newdb=new Database($seq, 'mod');
$sql_trigger_activate="
create or replace procedure public.trigger_activate(to_enable bool)
language plpgsql
as
$$
declare
rec1 record;
cmd text;
begin
for rec1 in (select relname,nspname
from pg_catalog.pg_class pc join pg_catalog.pg_namespace pn on (pn.oid=pc.relnamespace)
where pn.nspname in ('public','comptaproc') and relhastriggers is true) loop
if to_enable is false then
cmd=format('alter table %s.%s disable trigger all',rec1.nspname,rec1.relname);
else
cmd=format('alter table %s.%s enable trigger all',rec1.nspname,rec1.relname);
end if;
execute cmd;
raise notice '%',cmd;
end loop;
end
$$;
";
$newdb->exec_sql($sql_trigger_activate);
// Execute SQL Script
// Execute SQL Script
$newdb->execute_script($tmpdir.'/schema.sql');
$newdb->exec_sql("call public.trigger_activate(false) ");
$newdb->execute_script($tmpdir.'/data.sql');
$newdb->execute_script($tmpdir.'/constraint.sql');
$newdb->exec_sql("call public.trigger_activate(true) ");
$newdb->exec_sql("drop procedure public.trigger_activate ");
// Register into account_repository, we add the seq number for avoiding duplicate
$description = sprintf(_("Installé le %s"),date("d-m-Y h:i:s"));
$cn->exec_sql(" insert into modeledef (mod_id,mod_name,mod_desc) values ($1,$2,$3)",

View file

@ -1,4 +1,113 @@
SET client_encoding = 'utf8';
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
ALTER TABLE ONLY public.ac_dossier
ADD CONSTRAINT ac_dossier_pkey PRIMARY KEY (dos_id);
ALTER TABLE ONLY public.ac_users
ADD CONSTRAINT ac_users_pkey PRIMARY KEY (use_id);
ALTER TABLE ONLY public.ac_users
ADD CONSTRAINT ac_users_use_login_key UNIQUE (use_login);
ALTER TABLE ONLY public.audit_connect
ADD CONSTRAINT audit_connect_pkey PRIMARY KEY (ac_id);
ALTER TABLE ONLY public.dossier_sent_email
ADD CONSTRAINT de_date_dos_id_ux UNIQUE (de_date, dos_id);
ALTER TABLE ONLY public.dossier_sent_email
ADD CONSTRAINT dossier_sent_email_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.jnt_use_dos
ADD CONSTRAINT jnt_use_dos_pkey PRIMARY KEY (jnt_id);
ALTER TABLE ONLY public.modeledef
ADD CONSTRAINT modeledef_pkey PRIMARY KEY (mod_id);
ALTER TABLE ONLY public.user_global_pref
ADD CONSTRAINT pk_user_global_pref PRIMARY KEY (user_id, parameter_type);
ALTER TABLE ONLY public.progress
ADD CONSTRAINT progress_pkey PRIMARY KEY (p_id);
ALTER TABLE ONLY public.recover_pass
ADD CONSTRAINT recover_pass_pkey PRIMARY KEY (request);
ALTER TABLE ONLY public.jnt_use_dos
ADD CONSTRAINT use_id_dos_id_uniq UNIQUE (use_id, dos_id);
ALTER TABLE ONLY public.version
ADD CONSTRAINT version_pkey PRIMARY KEY (val);
CREATE INDEX audit_connect_ac_user ON public.audit_connect USING btree (ac_user);
CREATE INDEX fk_jnt_dos_id ON public.jnt_use_dos USING btree (dos_id);
CREATE INDEX fk_jnt_use_dos ON public.jnt_use_dos USING btree (use_id);
CREATE INDEX fki_ac_users_recover_pass_fk ON public.recover_pass USING btree (use_id);
CREATE TRIGGER limit_user_trg BEFORE INSERT OR UPDATE ON public.audit_connect FOR EACH ROW EXECUTE FUNCTION public.limit_user();
ALTER TABLE ONLY public.recover_pass
ADD CONSTRAINT ac_users_recover_pass_fk FOREIGN KEY (use_id) REFERENCES public.ac_users(use_id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY public.dossier_sent_email
ADD CONSTRAINT de_ac_dossier_fk FOREIGN KEY (dos_id) REFERENCES public.ac_dossier(dos_id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY public.user_global_pref
ADD CONSTRAINT fk_user_id FOREIGN KEY (user_id) REFERENCES public.ac_users(use_login) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY public.jnt_use_dos
ADD CONSTRAINT jnt_use_dos_dos_id_fkey FOREIGN KEY (dos_id) REFERENCES public.ac_dossier(dos_id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY public.jnt_use_dos
ADD CONSTRAINT jnt_use_dos_use_id_fkey FOREIGN KEY (use_id) REFERENCES public.ac_users(use_id);

View file

@ -11,8 +11,9 @@ export TEMPLATE=account_repository
pg_dump -O -U dany -s $TEMPLATE|grep -v "COMMENT ON SCHEMA public IS 'Standard public schema';" |sed "/^--/d" > schema.sql
sed -i -e "/COMMENT ON EXTENSION/d" schema.sql
sed -i -e "/CREATE EXTENSION/d" schema.sql
echo "set search_path = public,comptaproc,pg_catalog ;" > data.sql
pg_dump -O -U dany --data-only --column-inserts -O ${TEMPLATE}|sed "/^--/d" | sed -e "/SET search_path/d" >> data.sql
sed -ne '0,/ADD CONSTRAINT/p' schema.sql > tmpSchema.sql
sed -ne '/ADD CONSTRAINT/,$p' schema.sql |sed -e '1d' > constraint.sql
cp tmpSchema.sql schema.sql

View file

@ -272,116 +272,3 @@ ALTER TABLE ONLY public.dossier_sent_email ALTER COLUMN id SET DEFAULT nextval('
ALTER TABLE ONLY public.ac_dossier
ADD CONSTRAINT ac_dossier_dos_name_key UNIQUE (dos_name);
ALTER TABLE ONLY public.ac_dossier
ADD CONSTRAINT ac_dossier_pkey PRIMARY KEY (dos_id);
ALTER TABLE ONLY public.ac_users
ADD CONSTRAINT ac_users_pkey PRIMARY KEY (use_id);
ALTER TABLE ONLY public.ac_users
ADD CONSTRAINT ac_users_use_login_key UNIQUE (use_login);
ALTER TABLE ONLY public.audit_connect
ADD CONSTRAINT audit_connect_pkey PRIMARY KEY (ac_id);
ALTER TABLE ONLY public.dossier_sent_email
ADD CONSTRAINT de_date_dos_id_ux UNIQUE (de_date, dos_id);
ALTER TABLE ONLY public.dossier_sent_email
ADD CONSTRAINT dossier_sent_email_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.jnt_use_dos
ADD CONSTRAINT jnt_use_dos_pkey PRIMARY KEY (jnt_id);
ALTER TABLE ONLY public.modeledef
ADD CONSTRAINT modeledef_pkey PRIMARY KEY (mod_id);
ALTER TABLE ONLY public.user_global_pref
ADD CONSTRAINT pk_user_global_pref PRIMARY KEY (user_id, parameter_type);
ALTER TABLE ONLY public.progress
ADD CONSTRAINT progress_pkey PRIMARY KEY (p_id);
ALTER TABLE ONLY public.recover_pass
ADD CONSTRAINT recover_pass_pkey PRIMARY KEY (request);
ALTER TABLE ONLY public.jnt_use_dos
ADD CONSTRAINT use_id_dos_id_uniq UNIQUE (use_id, dos_id);
ALTER TABLE ONLY public.version
ADD CONSTRAINT version_pkey PRIMARY KEY (val);
CREATE INDEX audit_connect_ac_user ON public.audit_connect USING btree (ac_user);
CREATE INDEX fk_jnt_dos_id ON public.jnt_use_dos USING btree (dos_id);
CREATE INDEX fk_jnt_use_dos ON public.jnt_use_dos USING btree (use_id);
CREATE INDEX fki_ac_users_recover_pass_fk ON public.recover_pass USING btree (use_id);
CREATE TRIGGER limit_user_trg BEFORE INSERT OR UPDATE ON public.audit_connect FOR EACH ROW EXECUTE FUNCTION public.limit_user();
ALTER TABLE ONLY public.recover_pass
ADD CONSTRAINT ac_users_recover_pass_fk FOREIGN KEY (use_id) REFERENCES public.ac_users(use_id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY public.dossier_sent_email
ADD CONSTRAINT de_ac_dossier_fk FOREIGN KEY (dos_id) REFERENCES public.ac_dossier(dos_id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY public.user_global_pref
ADD CONSTRAINT fk_user_id FOREIGN KEY (user_id) REFERENCES public.ac_users(use_login) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY public.jnt_use_dos
ADD CONSTRAINT jnt_use_dos_dos_id_fkey FOREIGN KEY (dos_id) REFERENCES public.ac_dossier(dos_id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY public.jnt_use_dos
ADD CONSTRAINT jnt_use_dos_use_id_fkey FOREIGN KEY (use_id) REFERENCES public.ac_users(use_id);

File diff suppressed because it is too large Load diff

View file

@ -12,8 +12,8 @@ psql -X $TEMPLATE -c "delete from user_local_pref"
pg_dump -O -U dany -s $TEMPLATE|grep -v "COMMENT ON SCHEMA public IS 'Standard public schema';" |sed "/^--/d" > schema.sql
sed -i -e "/COMMENT ON EXTENSION/d" schema.sql
sed -i -e "/CREATE EXTENSION/d" schema.sql
echo "set search_path = public,comptaproc,pg_catalog ;" > data.sql
pg_dump -O -U dany --data-only --column-inserts -O ${TEMPLATE}|sed "/^--/d" | sed -e "/SET search_path/d" >> data.sql
sed -ne '0,/ADD CONSTRAINT/p' schema.sql > tmpSchema.sql
sed -ne '/ADD CONSTRAINT/,$p' schema.sql |sed -e '1d' > constraint.sql
cp tmpSchema.sql schema.sql

File diff suppressed because it is too large Load diff

View file

@ -12,8 +12,8 @@ psql -X $TEMPLATE -c "delete from user_local_pref"
pg_dump -O -U dany -s $TEMPLATE|grep -v "COMMENT ON SCHEMA public IS 'Standard public schema';" |sed "/^--/d" > schema.sql
sed -i -e "/COMMENT ON EXTENSION/d" schema.sql
sed -i -e "/CREATE EXTENSION/d" schema.sql
echo "set search_path = public,comptaproc,pg_catalog ;" > data.sql
pg_dump -O -U dany --data-only --column-inserts -O ${TEMPLATE}|sed "/^--/d" | sed -e "/SET search_path/d" >> data.sql
sed -ne '0,/ADD CONSTRAINT/p' schema.sql > tmpSchema.sql
sed -ne '/ADD CONSTRAINT/,$p' schema.sql |sed -e '1d' > constraint.sql
cp tmpSchema.sql schema.sql

View file

@ -63,12 +63,13 @@ if ( isset ($_POST["ADD"]) )
{
$exist_user=$cn->get_value("select count(*) from ac_users where use_login=lower($1)",[$login]);
if ( $exist_user == 0 ) {
$new_user->setPassword($pass5);
$new_user->insert();
$new_user->load();
put_global(array(['key'=>'use_id',"value"=>$new_user->id]));
Noalyss_user::audit_admin(sprintf('ADD USER %s %s',$new_user->id,$login));
} else {
echo_warning(_("Utilisateur existant"));
echo_warning(_("Utilisateur existant"));
$uid=$cn->get_value("select use_id from ac_users where use_login=lower($1)",[$login]);
$new_user->setId($uid);
put_global(array(['key'=>'use_id',"value"=>$new_user->id]));
@ -147,7 +148,7 @@ else if ($sbaction == "delete")
echo "code [$code] code control [$ctl_code]";
}
if ( $code != $ctl_code) {
echo _("Code invalide, effacement refusé");
echo_warning (_("Code invalide, effacement refusé"));
return;
}
$cn = new Database();

View file

@ -129,8 +129,8 @@ $it_pass->value="";
<div id="delete_user_div" class="inner_box" style="display: none">
<?=HtmlInput::title_box(_("Effacer"),'delete_user_div','hide')?>
<FORM id="user_detail_frm" METHOD="POST">
<INPUT type="hidden" NAME="lname" value="<?=_("$UserChange->name")?>">
<INPUT type="hidden" NAME="fname" value="<?=_("$UserChange->first_name")?>">
<INPUT type="hidden" NAME="lname" value="<?="$UserChange->name"?>">
<INPUT type="hidden" NAME="fname" value="<?="$UserChange->first_name"?>">
<?php echo HtmlInput::hidden('UID',$uid)?>
<?php echo HtmlInput::hidden('use_id',$uid)?>
<input type="hidden" name="sbaction" value="delete">