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:
commit
accb57680a
12 changed files with 1210 additions and 1920 deletions
|
|
@ -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>';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue