mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-07 10:08:27 +01:00
Debug v23
This commit is contained in:
@@ -11608,7 +11608,7 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid =
|
||||
* Check if a variable with name $var start with $regextext.
|
||||
* Can be used to forge dol_eval() conditions.
|
||||
*
|
||||
* @param string $var Variable
|
||||
* @param string $var Variable name ('mainmenu' or 'leftmenu', ...)
|
||||
* @param string $regextext Text that must be a valid regex string
|
||||
* @param int<0,1> $matchrule 1=Test if start with, 0=Test if equal
|
||||
* @return boolean|string True or False, text if bad usage.
|
||||
|
||||
@@ -132,8 +132,8 @@ class modAsset extends DolibarrModules
|
||||
// Array to add new pages in new tabs
|
||||
$this->tabs = array();
|
||||
// Example:
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@assets:$user->rights->assets->read:/asset/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@assets:$user->rights->othermodule->read:/asset/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@assets:$user->hasRight("assets","read"):/asset/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@assets:$user->hasRight("othermodule","read"):/asset/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||
// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
|
||||
//
|
||||
// Where objecttype can be
|
||||
|
||||
@@ -118,8 +118,8 @@ class modFTP extends DolibarrModules
|
||||
'url'=>'/ftp/index.php',
|
||||
'langs'=>'ftp',
|
||||
'position'=>100,
|
||||
'enabled'=>'$conf->ftp->enabled',
|
||||
'perms'=>'$user->rights->ftp->read || $user->rights->ftp->write || $user->rights->ftp->setup',
|
||||
'enabled'=>'isModEnabled("ftp")',
|
||||
'perms'=>'$user->hasRight("ftp", "read") || $user->hasRight("ftp", "write") || $user->hasRight("ftp", "setup")',
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
|
||||
@@ -354,7 +354,7 @@ class modKnowledgeManagement extends DolibarrModules
|
||||
'url' => '/categories/categorie_list.php?type=13',
|
||||
'langs' => 'knowledgemanagement',
|
||||
'position' => 112,
|
||||
'enabled' => 'isModEnabled("knowledgemanagement") && isModenabled("category")',
|
||||
'enabled' => 'isModEnabled("knowledgemanagement") && isModEnabled("category")',
|
||||
'perms' => '$user->hasRight("knowledgemanagement", "knowledgerecord", "read")',
|
||||
'target' => '',
|
||||
'user' => 0
|
||||
|
||||
@@ -116,7 +116,7 @@ class modMargin extends DolibarrModules
|
||||
'langs' => 'margins', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position' => 100,
|
||||
'enabled' => 'isModEnabled("margin")', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled.
|
||||
'perms' => '$user->hasRight("margins","liretous")', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules
|
||||
'perms' => '$user->hasRight("margins", "liretous")',
|
||||
'target' => '',
|
||||
'user' => 2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
);
|
||||
|
||||
@@ -114,7 +114,7 @@ class modOauth extends DolibarrModules
|
||||
// 'langs'=>'oauth', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>300,
|
||||
// 'enabled'=>'$conf->oauth->enabled && preg_match(\'/^(admintools|all)/\',$leftmenu)',
|
||||
// 'perms'=>'$user->rights->oauth->read', // Use 'perms'=>'1' if you want your menu with no permission rules
|
||||
// 'perms'=>'$user->hasRight("oauth", "read")', // Use 'perms'=>'1' if you want your menu with no permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
|
||||
|
||||
@@ -132,8 +132,6 @@ class modOauth extends DolibarrModules
|
||||
*/
|
||||
public function init($options = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// Clean before activation
|
||||
$this->remove($options);
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ class modPaypal extends DolibarrModules
|
||||
'url'=>'/paypal/importpayments.php',
|
||||
'langs'=>'paypal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>501,
|
||||
'enabled'=>'$conf->paypal->enabled && isModEnabled("banque") && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'enabled'=>'isModEnabled("paypal") && isModEnabled("banque") && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->banque->consolidate', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
|
||||
@@ -110,8 +110,8 @@ class modPrinting extends DolibarrModules
|
||||
'url'=>'/printing/index.php?mainmenu=home&leftmenu=admintools',
|
||||
'langs'=>'printing', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>300,
|
||||
'enabled'=>'$conf->printing->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)',
|
||||
'perms'=>'$user->rights->printing->read', // Use 'perms'=>'1' if you want your menu with no permission rules
|
||||
'enabled'=>'isModEnabled("printing") && isStringVarMatching("leftmenu", "/^(admintools|all)/")',
|
||||
'perms'=>'$user->hasRight("printing", "read")', // Use 'perms'=>'1' if you want your menu with no permission rules
|
||||
'target'=>'',
|
||||
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
|
||||
|
||||
|
||||
@@ -278,8 +278,8 @@ class modRecruitment extends DolibarrModules
|
||||
'url' => '/recruitment/recruitmentjobposition_card.php?action=create',
|
||||
'langs' => 'recruitment', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position' => 1000 + $r,
|
||||
'enabled' => '$conf->recruitment->enabled', // Define condition to show or hide menu entry. Use '$conf->recruitment->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms' => '$user->rights->recruitment->recruitmentjobposition->write', // Use 'perms'=>'$user->rights->recruitment->level1->level2' if you want your menu with a permission rules
|
||||
'enabled' => 'isModEnabled("recruitment")', // Define condition to show or hide menu entry. Use '$conf->recruitment->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms' => '$user->hasRight("recruitment","recruitmentjobposition", "write")', // Use 'perms'=>'$user->rights->recruitment->level1->level2' if you want your menu with a permission rules
|
||||
'target' => '',
|
||||
'user' => 2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
);
|
||||
@@ -292,7 +292,7 @@ class modRecruitment extends DolibarrModules
|
||||
'url' => '/recruitment/recruitmentjobposition_list.php',
|
||||
'langs' => 'recruitment', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position' => 1000 + $r,
|
||||
'enabled' => '$conf->recruitment->enabled', // Define condition to show or hide menu entry. Use '$conf->recruitment->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'enabled' => 'isModEnabled("recruitment")', // Define condition to show or hide menu entry. Use '$conf->recruitment->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms' => '$user->hasRight("recruitment", "recruitmentjobposition", "read")', // Use 'perms'=>'$user->rights->recruitment->level1->level2' if you want your menu with a permission rules
|
||||
'target' => '',
|
||||
'user' => 2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
@@ -306,8 +306,8 @@ class modRecruitment extends DolibarrModules
|
||||
'url' => '/recruitment/recruitmentcandidature_card.php?action=create',
|
||||
'langs' => 'recruitment', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position' => 1000 + $r,
|
||||
'enabled' => '$conf->recruitment->enabled', // Define condition to show or hide menu entry. Use '$conf->recruitment->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms' => '$user->rights->recruitment->recruitmentjobposition->write', // Use 'perms'=>'$user->rights->recruitment->level1->level2' if you want your menu with a permission rules
|
||||
'enabled' => 'isModEnabled("recruitment")', // Define condition to show or hide menu entry. Use '$conf->recruitment->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms' => '$user->hasRight("recruitment","recruitmentjobposition", "write")', // Use 'perms'=>'$user->rights->recruitment->level1->level2' if you want your menu with a permission rules
|
||||
'target' => '',
|
||||
'user' => 2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
);
|
||||
@@ -320,7 +320,7 @@ class modRecruitment extends DolibarrModules
|
||||
'url' => '/recruitment/recruitmentcandidature_list.php',
|
||||
'langs' => 'recruitment', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position' => 1000 + $r,
|
||||
'enabled' => '$conf->recruitment->enabled', // Define condition to show or hide menu entry. Use '$conf->recruitment->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'enabled' => 'isModEnabled("recruitment")', // Define condition to show or hide menu entry. Use '$conf->recruitment->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms' => '$user->hasRight("recruitment", "recruitmentjobposition", "read")', // Use 'perms'=>'$user->rights->recruitment->level1->level2' if you want your menu with a permission rules
|
||||
'target' => '',
|
||||
'user' => 2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
|
||||
@@ -196,7 +196,7 @@ class modResource extends DolibarrModules
|
||||
'langs' => 'resource',
|
||||
'position' => 100,
|
||||
'enabled' => '1',
|
||||
'perms' => '$user->rights->resource->read',
|
||||
'perms' => '$user->hasRight("resource", "read")',
|
||||
'user' => 0
|
||||
);
|
||||
$r++;
|
||||
@@ -211,7 +211,7 @@ class modResource extends DolibarrModules
|
||||
'langs' => 'resource',
|
||||
'position' => 101,
|
||||
'enabled' => '1',
|
||||
'perms' => '$user->rights->resource->write',
|
||||
'perms' => '$user->hasRight("resource", "write")',
|
||||
'target' => '',
|
||||
'user' => 0
|
||||
);
|
||||
@@ -226,7 +226,7 @@ class modResource extends DolibarrModules
|
||||
'langs' => 'resource',
|
||||
'position' => 102,
|
||||
'enabled' => '1',
|
||||
'perms' => '$user->rights->resource->read',
|
||||
'perms' => '$user->hasRight("resource", "read")',
|
||||
'target' => '',
|
||||
'user' => 0
|
||||
);
|
||||
|
||||
@@ -101,9 +101,9 @@ class modStripe extends DolibarrModules
|
||||
'titre'=>'StripeImportPayment',
|
||||
'url'=>'/stripe/importpayments.php',
|
||||
'langs'=>'stripe', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>500,
|
||||
'enabled'=>'$conf->stripe->enabled && isModEnabled("banque") && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->banque->modifier', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
'position' => 500,
|
||||
'enabled' => 'isModEnabled("stripe") && isModEnabled("banque") && getDolGlobalString("MAIN_FEATURES_LEVEL") >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms' => '$user->hasRight("banque", "modifier")', // Use 'perms' => '$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
); // 0=Menu for internal users, 1=external users, 2=both
|
||||
@@ -119,8 +119,8 @@ class modStripe extends DolibarrModules
|
||||
'url' => '',
|
||||
'langs' => 'stripe',
|
||||
'position' => 100,
|
||||
'enabled' => 'isModEnabled("stripe") && isModenabled("banque")',
|
||||
'perms' => '$user->rights->banque->lire',
|
||||
'enabled' => 'isModEnabled("stripe") && isModEnabled("banque")',
|
||||
'perms' => '$user->hasRight("banque", "read")',
|
||||
'target' => '',
|
||||
'user' => 0
|
||||
);
|
||||
@@ -133,8 +133,8 @@ class modStripe extends DolibarrModules
|
||||
'url' => '/stripe/charge.php',
|
||||
'langs' => 'stripe',
|
||||
'position' => 102,
|
||||
'enabled' => 'isModEnabled("stripe") && isModenabled("banque") && getDolGlobalInt("MAIN_FEATURES_LEVEL") >= 1',
|
||||
'perms' => '$user->rights->banque->lire',
|
||||
'enabled' => 'isModEnabled("stripe") && isModEnabled("banque") && getDolGlobalInt("MAIN_FEATURES_LEVEL") >= 1',
|
||||
'perms' => '$user->hasRight("banque", "read")',
|
||||
'target' => '',
|
||||
'user' => 0
|
||||
);
|
||||
@@ -147,8 +147,8 @@ class modStripe extends DolibarrModules
|
||||
'url' => '/stripe/transaction.php',
|
||||
'langs' => 'stripe',
|
||||
'position' => 102,
|
||||
'enabled' => 'isModEnabled("stripe") && isModenabled("banque") && getDolGlobalInt("MAIN_FEATURES_LEVEL") >= 2',
|
||||
'perms' => '$user->rights->banque->lire',
|
||||
'enabled' => 'isModEnabled("stripe") && isModEnabled("banque") && getDolGlobalInt("MAIN_FEATURES_LEVEL") >= 2',
|
||||
'perms' => '$user->hasRight("banque", "read")',
|
||||
'target' => '',
|
||||
'user' => 0
|
||||
);
|
||||
@@ -161,8 +161,8 @@ class modStripe extends DolibarrModules
|
||||
'url' => '/stripe/payout.php',
|
||||
'langs' => 'stripe',
|
||||
'position' => 103,
|
||||
'enabled' => 'isModEnabled("stripe") && isModenabled("banque")',
|
||||
'perms' => '$user->rights->banque->lire',
|
||||
'enabled' => 'isModEnabled("stripe") && isModEnabled("banque")',
|
||||
'perms' => '$user->hasRight("banque", "read")',
|
||||
'target' => '',
|
||||
'user' => 0
|
||||
);
|
||||
|
||||
@@ -307,7 +307,7 @@ class modTicket extends DolibarrModules
|
||||
'langs' => 'ticket',
|
||||
'position' => 102,
|
||||
'enabled' => 'isModEnabled("ticket")',
|
||||
'perms' => '$user->rights->ticket->write',
|
||||
'perms' => '$user->hasRight("ticket", "write")',
|
||||
'target' => '',
|
||||
'user' => 2);
|
||||
$r++;
|
||||
|
||||
@@ -126,8 +126,8 @@ class modWorkflow extends DolibarrModules
|
||||
'url'=>'/workflow/index.php',
|
||||
'langs'=>'@workflow',
|
||||
'position'=>100,
|
||||
'perms'=>'$user->rights->workflow->read',
|
||||
'enabled'=>'$conf->workflow->enabled',
|
||||
'perms'=>'$user->hasRights("workflow", "read")',
|
||||
'enabled'=>'isModEnabled("workflow")',
|
||||
'target'=>'',
|
||||
'user'=>0);
|
||||
$r++;
|
||||
@@ -139,8 +139,8 @@ class modWorkflow extends DolibarrModules
|
||||
'url'=>'/workflow/index.php',
|
||||
'langs'=>'@workflow',
|
||||
'position'=>101,
|
||||
'enabled'=>1,
|
||||
'perms'=>'$user->rights->workflow->read',
|
||||
'enabled'=>'isModEnabled("workflow")',
|
||||
'perms'=>'$user->hasRight("workflow", "read")',
|
||||
'target'=>'',
|
||||
'user'=>0);
|
||||
$r++;
|
||||
|
||||
Reference in New Issue
Block a user