Change menu code , replace CFG by C0 or C1 , new standard

This commit is contained in:
sparkyx 2024-08-09 21:11:21 +02:00
parent b1896b410f
commit a618ef4a44
30 changed files with 62 additions and 42 deletions

View file

@ -159,9 +159,9 @@ $path = array(
"user_sec_action"=>"ajax_user_security", "user_sec_action"=>"ajax_user_security",
// Update in once all the ledgers // Update in once all the ledgers
"ledger_access_all"=>"ajax_user_security", "ledger_access_all"=>"ajax_user_security",
// From the page CFGSEC,set the actions // From the page C0SEC,set the actions
"action_access"=>"ajax_user_security", "action_access"=>"ajax_user_security",
// From the page CFGSEC,set all the actions // From the page C0SEC,set all the actions
"action_access_all"=>"ajax_user_security", "action_access_all"=>"ajax_user_security",
"todo_list"=>"ajax_todo_list", "todo_list"=>"ajax_todo_list",
// Writing operation History for a card or an accounting // Writing operation History for a card or an accounting
@ -248,7 +248,7 @@ $path = array(
"anc_accounting"=>"ajax_anc_accounting", "anc_accounting"=>"ajax_anc_accounting",
// Update name and description // Update name and description
"anc_updatedescription"=>"ajax_anc_plan", "anc_updatedescription"=>"ajax_anc_plan",
// Update, insert or delete accounting frmo CFGPCMN // Update, insert or delete accounting frmo C0PCMN
"accounting"=>"ajax_accounting", "accounting"=>"ajax_accounting",
// Show detail of an ANC operation // Show detail of an ANC operation
"anc_detail_op"=>"ajax_anc_detail_operation", "anc_detail_op"=>"ajax_anc_detail_operation",

View file

@ -1576,7 +1576,7 @@ function display_sub_menu(p_dossier, p_profile, p_dep, p_level) {
} }
/** /**
* in CFGPRO, ask to confirm before removing a submenu and its children * in C0PROFL, ask to confirm before removing a submenu and its children
* @param {type} p_dossier * @param {type} p_dossier
* @param {type} profile_menu_id * @param {type} profile_menu_id
* @returns {undefined} * @returns {undefined}
@ -3840,7 +3840,7 @@ function toggle_checkbox_onoff(icon_domid, p_value_domid) {
} }
/** /**
* in CFGLED show or hide the row depending if the warning is enable or not * in C0JRN show or hide the row depending if the warning is enable or not
* *
* @param {type} p_enable * @param {type} p_enable
* @param {type} p_row * @param {type} p_row
@ -4280,7 +4280,7 @@ function check_password_strength(p_pass_domid, p_result_domid, details) {
} }
/** /**
* activate a plugin , must comes from CFGPLUGIN * activate a plugin , must comes from C0PLG
* @param elt {string} DOMID of the element, must have the attribute gDossier, plugin and pr_id (for the profile) * @param elt {string} DOMID of the element, must have the attribute gDossier, plugin and pr_id (for the profile)
* @test * @test
*/ */

View file

@ -23,7 +23,7 @@ if (!defined('ALLOWED')) { die('Appel direct ne sont pas permis'); }
/** /**
* @file * @file
* @brief CFGCURRENCY Manage the currency and the rate * @brief C0DEV Manage the currency and the rate
* @example test_currency_mtable.php * @example test_currency_mtable.php
*/ */

View file

@ -37,7 +37,7 @@ try {
echo $e->getMessage(); echo $e->getMessage();
return; return;
} }
if ( $g_user->check_module("CFGPCMN") == 0) die(); if ( $g_user->check_module("C0PCMN") == 0) die();
$obj=new Acc_Plan_SQL($cn); $obj=new Acc_Plan_SQL($cn);

View file

@ -28,7 +28,7 @@ if (!defined('ALLOWED'))
global $g_user; global $g_user;
if ($g_user->check_module('CFGPLUGIN') == 0) die(); if ($g_user->check_module('C0PLG') == 0) die();
try { try {
$me_code = $http->get("mecode"); $me_code = $http->get("mecode");

View file

@ -37,7 +37,7 @@ if (!defined('ALLOWED'))
die('Appel direct ne sont pas permis'); die('Appel direct ne sont pas permis');
// Security // Security
if ($g_user->check_module('CFGPRO')==0) if ($g_user->check_module('C0PROFL')==0)
die(); die();
$http=new HttpInput(); $http=new HttpInput();

View file

@ -414,7 +414,7 @@ if ($op=='upgradePlugin')
$progress->set_value(55); $progress->set_value(55);
$plugin->install(); $plugin->install();
$progress->set_value(100); $progress->set_value(100);
echo _("L'extension doit être activée dans le dossier avec CFGPLUGIN"); echo _("L'extension doit être activée dans le dossier avec C0PLG");
return; return;
} }
//------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------

View file

@ -45,9 +45,9 @@ catch (Exception $ex)
/* security check */ /* security check */
/** /**
* check if module CFGCURRENCY * check if module C0DEV
*/ */
if ($g_user->check_module('CFGCURRENCY')==0) if ($g_user->check_module('C0DEV')==0)
{ {
return; return;
} }

View file

@ -21,7 +21,7 @@
/** /**
* @file * @file
* @brief call from ajax : display submenu * @brief call from ajax : display submenu
* Security : only user with the menu CFGPRO * Security : only user with the menu C0PROFL
* display the submenu of a menu or a module * display the submenu of a menu or a module
* It expects 2 parameters = p_profile (profile.p_id) and the dep (menu_ref.me_code) * It expects 2 parameters = p_profile (profile.p_id) and the dep (menu_ref.me_code)
*/ */
@ -29,7 +29,7 @@
if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis'); if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
// Security // Security
if ( $g_user->check_module('CFGPRO') == 0 ) die(); if ( $g_user->check_module('C0PROFL') == 0 ) die();
$http=new HttpInput(); $http=new HttpInput();

View file

@ -23,8 +23,8 @@ if (!defined('ALLOWED')) die('Appel direct ne sont pas permis');
global $g_user; global $g_user;
if ( $g_user->check_module('CFGDOCST') == 0 ) { if ( $g_user->check_module('C1DOC') == 0 ) {
record_log("forbidden : CFGDOCST ".__FILE__); record_log("forbidden : C1DOC ".__FILE__);
exit(); exit();
} }

View file

@ -29,7 +29,7 @@
if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis'); if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
// Security // Security
if ( $g_user->check_module('CFGPRO') == 0 ) die(); if ( $g_user->check_module('C0PROFL') == 0 ) die();
require_once NOALYSS_INCLUDE.'/database/profile_sql.class.php'; require_once NOALYSS_INCLUDE.'/database/profile_sql.class.php';
$http=new HttpInput(); $http=new HttpInput();

View file

@ -28,7 +28,7 @@ if ( ! defined ('ALLOWED') ) die(_('Non autorisé'));
$http=new HttpInput(); $http=new HttpInput();
// Security // Security
if ($g_user->check_module('CFGPRO')==0) if ($g_user->check_module('C0PROFL')==0)
die(); die();
try try
{ {

View file

@ -22,7 +22,7 @@
if (!defined('ALLOWED')) if (!defined('ALLOWED'))
die('Appel direct ne sont pas permis'); die('Appel direct ne sont pas permis');
if ( $g_user->check_module('CFGTAG') == 0 ) { if ( $g_user->check_module('C0TAG') == 0 ) {
record_log("forbidden : AJT01 ".__FILE__); record_log("forbidden : AJT01 ".__FILE__);
exit(); exit();
} }

View file

@ -12,7 +12,7 @@ $op=$http->request("op");
global $g_user; global $g_user;
$nDossier=Dossier::id(); $nDossier=Dossier::id();
///check security ///check security
if ( $g_user->check_module('CFGTAG')==0 && $g_user->check_action(TAGADD) == 0) if ( $g_user->check_module('C0TAG')==0 && $g_user->check_action(TAGADD) == 0)
{ {
die(_("non permis")); die(_("non permis"));
} }

View file

@ -28,7 +28,7 @@ if (!defined('ALLOWED'))
* @brief * @brief
*/ */
global $g_user; global $g_user;
$g_user->can_request('CFGTAG'); $g_user->can_request('C0TAG');
/* /*
* Received parameter * Received parameter

View file

@ -26,11 +26,11 @@ if (!defined('ALLOWED'))
/** /**
* @file * @file
* @brief Manage the security of a ledger , from CFGSEC module * @brief Manage the security of a ledger , from C0SEC module
* *
*/ */
global $g_user; global $g_user;
if ( $g_user->check_module("CFGSEC") == 0) if ( $g_user->check_module("C0SEC") == 0)
throw new Exception(_("Non autorisé")); throw new Exception(_("Non autorisé"));
$n_dossier_id=Dossier::id(); $n_dossier_id=Dossier::id();

View file

@ -157,7 +157,7 @@ class Acc_Currency
and currency_id=$2"; and currency_id=$2";
$value=$this->cn->get_value($sql,[$p_date,$this->get_id()]); $value=$this->cn->get_value($sql,[$p_date,$this->get_id()]);
if ($value == "") { if ($value == "") {
throw new Exception(_("Aucun taux à cette date , aller sur CFGCURRENCY")); throw new Exception(_("Aucun taux à cette date , aller sur C0DEV"));
} }
return $value; return $value;
} }

View file

@ -3027,7 +3027,7 @@ class Acc_Ledger extends jrn_def_sql
Array Array
( (
[gDossier] => 25 [gDossier] => 25
[ac] => CFG/MACC/CFGLED [ac] => CFG/MACC/C0JRN
[p_jrn] => -1 [p_jrn] => -1
[p_action] => jrn [p_action] => jrn
[sa] => add [sa] => add

View file

@ -328,7 +328,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
if ($this->bank_id=="") if ($this->bank_id=="")
{ {
echo h2("Journal de banque non configuré ".$this->get_name(), ' class="error"'); echo h2("Journal de banque non configuré ".$this->get_name(), ' class="error"');
echo '<span class="error"> vous devez donner à ce journal un compte en banque (fiche), modifiez dans CFGLED</span>'; echo '<span class="error"> vous devez donner à ce journal un compte en banque (fiche), modifiez dans C0JRN</span>';
alert("Journal de banque non configuré ".$this->get_name()); alert("Journal de banque non configuré ".$this->get_name());
} }

View file

@ -162,7 +162,7 @@ class Extension extends Menu_Ref_sql
// throw an exception if there is no dependency // throw an exception if there is no dependency
if (empty($dep_id)) if (empty($dep_id))
{ {
$msg = sprintf(_("Le menu %s dont dépend %s doit être crée ou %s doit être ajouté depuis le menu CFGPRO"), $msg = sprintf(_("Le menu %s dont dépend %s doit être crée ou %s doit être ajouté depuis le menu C0PROFL"),
$p_module,$this->me_code,$this->me_code); $p_module,$this->me_code,$this->me_code);
throw new Exception($msg, 30); throw new Exception($msg, 30);
} }

View file

@ -155,7 +155,7 @@ class Tva_Rate_MTable extends Manage_Table_SQL
$text->set_attribute('jrn', 0); $text->set_attribute('jrn', 0);
$text->set_attribute('account', 'tva_purchase'); $text->set_attribute('account', 'tva_purchase');
echo $text->input(); echo $text->input();
$url="do.php?".http_build_query(array("gDossier"=>Dossier::id(),"ac"=>'CFGPCMN','p_start'=>4)); $url="do.php?".http_build_query(array("gDossier"=>Dossier::id(),"ac"=>'C0PCMN','p_start'=>4));
echo HtmlInput::anchor(_("Configuration poste comptable"),$url,"",'target="_blank"'); echo HtmlInput::anchor(_("Configuration poste comptable"),$url,"",'target="_blank"');
} }
elseif ($key=='tva_sale') elseif ($key=='tva_sale')

View file

@ -41,7 +41,7 @@ catch (Exception $ex)
$cn=Dossier::connect(); $cn=Dossier::connect();
echo '<p class="info">'. echo '<p class="info">'.
'<a href="https://wiki.noalyss.eu/doku.php?id=menu:cfgaction" target="_blank">'. '<a href="https://wiki.noalyss.eu/doku.php?id=menu:cfgaction" target="_blank">'.
_("Aide : voir CFGACTION"). _("Aide : voir C0ACT").
'</a>'. '</a>'.
'</p>'; '</p>';
// document_option id from document_option where do_code='contact_multiple' and document_type_id=p_id // document_option id from document_option where do_code='contact_multiple' and document_type_id=p_id

View file

@ -23,7 +23,7 @@
*/ */
require_once NOALYSS_INCLUDE.'/lib/ac_common.php'; require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
if ( $g_user->check_module("CFGDOC") == 0 ) exit(); if ( $g_user->check_module("C0DOC") == 0 ) exit();
// retrieve the document // retrieve the document
$r=$cn->exec_sql("select md_id,md_lob,md_filename,md_mimetype $r=$cn->exec_sql("select md_id,md_lob,md_filename,md_mimetype
from document_modele where md_id=$1",array($_REQUEST['md_id'])); from document_modele where md_id=$1",array($_REQUEST['md_id']));

View file

@ -1044,7 +1044,7 @@ function find_default_module()
$cn->exec_sql('insert into profile_user(user_name,p_id) values ($1,1) ',array($g_user->login)); $cn->exec_sql('insert into profile_user(user_name,p_id) values ($1,1) ',array($g_user->login));
return find_default_module(); return find_default_module();
} }
echo_warning(_("Utilisateur n'a pas de profil, votre administrateur doit en configurer un dans CFGSEC")); echo_warning(_("Utilisateur n'a pas de profil, votre administrateur doit en configurer un dans C0SEC"));
exit(); exit();
} }
} }

View file

@ -160,7 +160,7 @@ if ($UserChange->admin == 0 ) :
<p class="notice"> <p class="notice">
Les autres droits doivent être réglés dans les dossiers (paramètre->sécurité), le fait de changer un utilisateur d'administrateur à utilisateur Les autres droits doivent être réglés dans les dossiers (paramètre->sécurité), le fait de changer un utilisateur d'administrateur à utilisateur
normal ne change pas le profil administrateur dans les dossiers. normal ne change pas le profil administrateur dans les dossiers.
Il faut aller dans CFGSECURITY pour diminuer ses privilèges. Il faut aller dans C0SEC pour diminuer ses privilèges.
</p> </p>
<?php <?php

View file

@ -1,8 +1,8 @@
<?php <?php
//@description:CFGPCMN Ajout d'un poste comptable //@description:C0PCMN Ajout d'un poste comptable
$_GET=array ( $_GET=array (
'gDossier' => '42', 'gDossier' => '42',
'ac' => 'PARAM/CFGPCMN', 'ac' => 'PARAM/C0PCMN',
); );
$_POST=array ( $_POST=array (
'p_action' => 'pcmn', 'p_action' => 'pcmn',

View file

@ -1,8 +1,8 @@
<?php <?php
//@description:CFGPCMN Plan comptable //@description:C0PCMN Plan comptable
$_GET=array ( $_GET=array (
'gDossier' => '42', 'gDossier' => '42',
'ac' => 'PARAM/CFGPCMN', 'ac' => 'PARAM/C0PCMN',
); );
$_POST=array ( $_POST=array (
); );

View file

@ -1,8 +1,8 @@
<?php <?php
//@description:CFGLED //@description:C0JRN
$_GET=array ( $_GET=array (
'gDossier' => '42', 'gDossier' => '42',
'ac' => 'PARAM/CFGLED', 'ac' => 'PARAM/C0JRN',
'sa' => 'detail', 'sa' => 'detail',
'p_jrn' => '1', 'p_jrn' => '1',
); );

View file

@ -1,7 +1,7 @@
<?php <?php
//@description:CFGPCMN //@description:C0PCMN
$_GET=array ( $_GET=array (
'ac' => 'PARAM/CFGPCMN', 'ac' => 'PARAM/C0PCMN',
'p_start' => '4', 'p_start' => '4',
'gDossier' => '42', 'gDossier' => '42',
); );

View file

@ -1,3 +1,23 @@
alter table attr_min add ad_default_order int; alter table attr_min add ad_default_order int;
update attr_min set ad_default_order = a1.ad_default_order from attr_def a1 where a1.ad_id = attr_min.ad_id; update attr_min set ad_default_order = a1.ad_default_order from attr_def a1 where a1.ad_id = attr_min.ad_id;
select replace_menu_code('CFGACC','C0PST');
select replace_menu_code('CFGDOC','C0DOC');
select replace_menu_code('CFGSEC','C0SEC');
select replace_menu_code('CFGPCMN','C0PCMN');
select replace_menu_code('CFGPRO','C0PROFL');
select replace_menu_code('CFGLED','C0JRN');
select replace_menu_code('CFGDOCST','C1DOC');
select replace_menu_code('CFGDEFMENU','C0MENU');
select replace_menu_code('CFGPAY','C0PAY');
select replace_menu_code('CFGCURRENCY','C0DEV');
select replace_menu_code('CFGACTION','C0ACT');
select replace_menu_code('CFGOPT1','C0OPT1');
select replace_menu_code('CFGSTOCK','C0STOCK');
select replace_menu_code('CFGPLUGIN','C0PLG');
select replace_menu_code('CFGTAG','C0TAG');
update menu_ref set me_description ='Configuration des extensions' where me_code='C0PLG';
update menu_ref set me_description ='Clef de répartition pour la comptabilité analytique' where me_code='ANCKEY';