mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
use isModEnabled
This commit is contained in:
parent
2c29399fa9
commit
fa849696fb
|
|
@ -2904,7 +2904,7 @@ if ($action == 'create') {
|
|||
}
|
||||
}
|
||||
// Create event
|
||||
/*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
/*if (isModEnabled('agenda') && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
{
|
||||
print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a></div>';
|
||||
}*/
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class box_actions extends ModeleBoxes
|
|||
|
||||
$this->db = $db;
|
||||
|
||||
$this->enabled = $conf->agenda->enabled;
|
||||
$this->enabled = isModEnabled('agenda');
|
||||
|
||||
$this->hidden = !($user->hasRight('agenda', 'myactions', 'read'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3584,7 +3584,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
|
|||
}
|
||||
}
|
||||
|
||||
//if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
||||
//if (($cid || $socid) && isModEnabled('agenda') && $user->rights->agenda->myactions->create)
|
||||
if (isModEnabled('agenda') && $user->hasRight("agenda", "myactions", "create")) {
|
||||
$type = 'AC_TEL';
|
||||
$link = '';
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__;
|
|||
-- old: (module, enabled, rowid, ...)
|
||||
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 1__+MAX_llx_menu__, '', '1', __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__);
|
||||
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '(isModEnabled("societe") && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || isModeEnabled('supplier_order') || isModEnabled('supplier_invoice')))', __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
|
||||
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 3__+MAX_llx_menu__, 'product|service', '$conf->product->enabled || $conf->service->enabled', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
|
||||
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 3__+MAX_llx_menu__, 'product|service', 'isModEnabled("product") || isModEnabled("service")', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
|
||||
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 16__+MAX_llx_menu__, 'bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__);
|
||||
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->project->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__);
|
||||
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
|
||||
|
|
@ -115,10 +115,10 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
|||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && $conf->categorie->enabled', __HANDLER__, 'left', 671__+MAX_llx_menu__, 'companies', '', 670__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&action=create&type=4', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
|
||||
|
||||
-- Product - Product
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2800__+MAX_llx_menu__, 'products', 'product', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&leftmenu=product&type=0', 'Products', 0, 'products', '$user->rights->produit->lire', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/card.php?mainmenu=products&leftmenu=product&action=create&type=0', 'NewProduct', 1, 'products', '$user->rights->produit->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=product&type=0', 'List', 1, 'products', '$user->rights->produit->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?mainmenu=products&type=0', 'MenuStocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("product")', __HANDLER__, 'left', 2800__+MAX_llx_menu__, 'products', 'product', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&leftmenu=product&type=0', 'Products', 0, 'products', '$user->rights->produit->lire', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("product")', __HANDLER__, 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/card.php?mainmenu=products&leftmenu=product&action=create&type=0', 'NewProduct', 1, 'products', '$user->rights->produit->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("product")', __HANDLER__, 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=product&type=0', 'List', 1, 'products', '$user->rights->produit->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("product")', __HANDLER__, 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?mainmenu=products&type=0', 'MenuStocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&type=0&search_subjecttolotserial=1', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 5, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2806__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stock/productlot_list.php?mainmenu=products', 'LotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 6, __ENTITY__);
|
||||
|
||||
|
|
@ -127,9 +127,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
|||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 2804__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stats/card.php?mainmenu=products&id=all&leftmenu=stats&type=0', 'Statistics', 1, 'main', '$user->rights->produit->lire', '', 2, 8, __ENTITY__);
|
||||
|
||||
-- Product - Services
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->service->enabled', __HANDLER__, 'left', 2900__+MAX_llx_menu__, 'products', 'service', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&leftmenu=service&type=1', 'Services', 0, 'products', '$user->rights->service->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->service->enabled', __HANDLER__, 'left', 2901__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/card.php?mainmenu=products&leftmenu=service&action=create&type=1', 'NewService', 1, 'products', '$user->rights->service->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->service->enabled', __HANDLER__, 'left', 2902__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=service&type=1', 'List', 1, 'products', '$user->rights->service->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("service")', __HANDLER__, 'left', 2900__+MAX_llx_menu__, 'products', 'service', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&leftmenu=service&type=1', 'Services', 0, 'products', '$user->rights->service->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("service")', __HANDLER__, 'left', 2901__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/card.php?mainmenu=products&leftmenu=service&action=create&type=1', 'NewService', 1, 'products', '$user->rights->service->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("service")', __HANDLER__, 'left', 2902__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=service&type=1', 'List', 1, 'products', '$user->rights->service->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 2903__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/stats/card.php?mainmenu=products&id=all&leftmenu=stats&type=1', 'Statistics', 1, 'main', '$user->rights->service->lire', '', 2, 5, __ENTITY__);
|
||||
|
||||
-- Product - Stocks
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class modAgenda extends DolibarrModules
|
|||
//------------
|
||||
$datestart = dol_now();
|
||||
$this->cronjobs = array(
|
||||
0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>5, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'$conf->agenda->enabled', 'datestart'=>$datestart),
|
||||
0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>5, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'isModEnabled("agenda")', 'datestart'=>$datestart),
|
||||
);
|
||||
|
||||
// Permissions
|
||||
|
|
@ -212,7 +212,7 @@ class modAgenda extends DolibarrModules
|
|||
'langs'=>'agenda',
|
||||
'position'=>86,
|
||||
'perms'=>'$user->rights->agenda->myactions->read || $user->rights->resource->read',
|
||||
'enabled'=>'$conf->agenda->enabled || $conf->resource->enabled',
|
||||
'enabled'=>'isModEnabled("agenda") || $conf->resource->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2,
|
||||
);
|
||||
|
|
@ -228,7 +228,7 @@ class modAgenda extends DolibarrModules
|
|||
'langs'=>'agenda',
|
||||
'position'=>100,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'enabled'=>'isModEnabled("agenda")',
|
||||
'target'=>'',
|
||||
'user'=>2,
|
||||
);
|
||||
|
|
@ -242,7 +242,7 @@ class modAgenda extends DolibarrModules
|
|||
'langs'=>'commercial',
|
||||
'position'=>101,
|
||||
'perms'=>'($user->hasRight("agenda", "myactions", "create")||$user->hasRight("agenda", "allactions", "create"))',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'enabled'=>'isModEnabled("agenda")',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
|
|
@ -257,7 +257,7 @@ class modAgenda extends DolibarrModules
|
|||
'langs'=>'agenda',
|
||||
'position'=>140,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'enabled'=>'isModEnabled("agenda")',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
|
|
@ -271,7 +271,7 @@ class modAgenda extends DolibarrModules
|
|||
'langs'=>'agenda',
|
||||
'position'=>141,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'enabled'=>'isModEnabled("agenda")',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
|
|
@ -285,7 +285,7 @@ class modAgenda extends DolibarrModules
|
|||
'langs'=>'agenda',
|
||||
'position'=>142,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'enabled'=>'isModEnabled("agenda")',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
|
|
@ -329,7 +329,7 @@ class modAgenda extends DolibarrModules
|
|||
'langs'=>'agenda',
|
||||
'position'=>110,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'enabled'=>'isModEnabled("agenda")',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
|
|
@ -343,7 +343,7 @@ class modAgenda extends DolibarrModules
|
|||
'langs'=>'agenda',
|
||||
'position'=>111,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'enabled'=>'isModEnabled("agenda")',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
|
|
@ -357,7 +357,7 @@ class modAgenda extends DolibarrModules
|
|||
'langs'=>'agenda',
|
||||
'position'=>112,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'enabled'=>'isModEnabled("agenda")',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
|
|
@ -400,7 +400,7 @@ class modAgenda extends DolibarrModules
|
|||
'langs'=>'agenda',
|
||||
'position'=>160,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'enabled'=>'isModEnabled("agenda")',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
);
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class modECM extends DolibarrModules
|
|||
'langs'=>'ecm',
|
||||
'position'=>82,
|
||||
'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload || $user->rights->ecm->setup',
|
||||
'enabled'=>'$conf->ecm->enabled',
|
||||
'enabled'=>'isModEnabled("ecm")',
|
||||
'target'=>'',
|
||||
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
);
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ class modProduct extends DolibarrModules
|
|||
'url'=>'/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools',
|
||||
'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>300,
|
||||
'enabled'=>'$conf->product->enabled && preg_match(\'/^(admintools|all)/\',$leftmenu)', // 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("product") && preg_match(\'/^(admintools|all)/\',$leftmenu)', // 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'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class modService extends DolibarrModules
|
|||
'url'=>'/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools',
|
||||
'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>300,
|
||||
'enabled'=>'$conf->product->enabled && preg_match(\'/^(admintools|all)/\',$leftmenu)', // 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("product") && preg_match(\'/^(admintools|all)/\',$leftmenu)', // 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'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
|
||||
|
|
@ -284,7 +284,7 @@ class modService extends DolibarrModules
|
|||
$this->export_sql_order[$r] = ' GROUP BY p.rowid'; // FIXME The group by used a generic value to say "all fields in select except function fields"
|
||||
}
|
||||
|
||||
if (empty($conf->product->enabled)) { // We enable next import templates only if module product not already enabled (to avoid duplicate entries)
|
||||
if (!isModEnabled("product")) { // We enable next import templates only if module product not already enabled (to avoid duplicate entries)
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
// Exports product multiprice
|
||||
$r++;
|
||||
|
|
@ -705,7 +705,7 @@ class modService extends DolibarrModules
|
|||
$this->import_updatekeys_array[$r] = array_merge($this->import_updatekeys_array[$r], array('p.barcode'=>'BarCode')); //only show/allow barcode as update key if Barcode module enabled
|
||||
}
|
||||
|
||||
if (empty($conf->product->enabled)) { // We enable next import templates only if module product not already enabled (to avoid duplicate entries)
|
||||
if (!isModEnabled("product")) { // We enable next import templates only if module product not already enabled (to avoid duplicate entries)
|
||||
if (isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
|
||||
// Import suppliers prices (note: this code is duplicated in module Service)
|
||||
$r++;
|
||||
|
|
|
|||
|
|
@ -1048,7 +1048,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||
'class' => 'ActionComm',
|
||||
'table' => 'actioncomm',
|
||||
'disableamount' => 1,
|
||||
'test' => $conf->agenda->enabled && $user->rights->agenda->allactions->lire
|
||||
'test' => isModEnabled('agenda') && $user->rights->agenda->allactions->lire
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ class pdf_beluga extends ModelePDFProjects
|
|||
'table'=>'actioncomm',
|
||||
'datefieldname'=>'datep',
|
||||
'disableamount'=>1,
|
||||
'test'=>$conf->agenda->enabled && $user->rights->agenda->allactions->read,
|
||||
'test'=> isModEnabled('agenda') && $user->rights->agenda->allactions->read,
|
||||
'lang'=>'agenda')
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
|||
*/
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
if (empty($conf->agenda) || empty($conf->agenda->enabled)) {
|
||||
if (!isModEnabled('agenda')) {
|
||||
return 0; // Module not active, we do nothing
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -398,9 +398,9 @@ if ($action == 'create') {
|
|||
print '<br>';
|
||||
|
||||
$title = $langs->trans("ProductsAndServices");
|
||||
if (empty($conf->service->enabled)) {
|
||||
if (!isModEnabled("service")) {
|
||||
$title = $langs->trans("Products");
|
||||
} elseif (empty($conf->product->enabled)) {
|
||||
} elseif (!isModEnabled("product")) {
|
||||
$title = $langs->trans("Services");
|
||||
}
|
||||
|
||||
|
|
@ -709,9 +709,9 @@ if ($action == 'create') {
|
|||
*/
|
||||
|
||||
$title = $langs->trans("ProductsAndServices");
|
||||
if (empty($conf->service->enabled)) {
|
||||
if (!isModEnabled("service")) {
|
||||
$title = $langs->trans("Products");
|
||||
} elseif (empty($conf->product->enabled)) {
|
||||
} elseif (!isModEnabled("product")) {
|
||||
$title = $langs->trans("Services");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1643,7 +1643,7 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
// Proposal
|
||||
if ($conf->service->enabled && isModEnabled("propal") && $object->statut > Fichinter::STATUS_DRAFT) {
|
||||
if (isModEnabled("service") && isModEnabled("propal") && $object->statut > Fichinter::STATUS_DRAFT) {
|
||||
$langs->load("propal");
|
||||
if ($object->statut < Fichinter::STATUS_BILLED) {
|
||||
if ($user->rights->propal->creer) {
|
||||
|
|
|
|||
|
|
@ -2462,7 +2462,7 @@ if ($action == 'create') {
|
|||
}
|
||||
}
|
||||
// Create event
|
||||
/*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
/*if (isModEnabled('agenda') && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a></div>';
|
||||
}*/
|
||||
|
|
|
|||
|
|
@ -1059,9 +1059,9 @@ if ($action == 'create') {
|
|||
print dol_get_fiche_end();
|
||||
|
||||
$title = $langs->trans("ProductsAndServices");
|
||||
if (empty($conf->service->enabled)) {
|
||||
if (!isModEnabled("service")) {
|
||||
$title = $langs->trans("Products");
|
||||
} elseif (empty($conf->product->enabled)) {
|
||||
} elseif (!isModEnabled("product")) {
|
||||
$title = $langs->trans("Services");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3946,7 +3946,7 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
// Create event
|
||||
/*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
/*if (isModEnabled('agenda') && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a></div>';
|
||||
}*/
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class Mo extends CommonObject
|
|||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'showoncombobox'=>'1', 'noteditable'=>1),
|
||||
'fk_bom' => array('type'=>'integer:Bom:bom/class/bom.class.php:0:(t.status:=:1)', 'filter'=>'active=1', 'label'=>'BOM', 'enabled'=>'$conf->bom->enabled', 'visible'=>1, 'position'=>33, 'notnull'=>-1, 'index'=>1, 'comment'=>"Original BOM", 'css'=>'minwidth100 maxwidth300', 'csslist'=>'nowraponall', 'picto'=>'bom'),
|
||||
'mrptype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>34, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'),
|
||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:0', 'label'=>'Product', 'enabled'=>'$conf->product->enabled', 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce", 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax100', 'picto'=>'product'),
|
||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:0', 'label'=>'Product', 'enabled'=>'isModEnabled("product")', 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce", 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax100', 'picto'=>'product'),
|
||||
'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce", 'css'=>'width75', 'default'=>1, 'isameasure'=>1),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'2', 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200', 'alwayseditable'=>1),
|
||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>'isModEnabled("societe")', 'visible'=>-1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'css'=>'maxwidth400', 'csslist'=>'tdoverflowmax150'),
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ $langs->loadLangs(array('admin', 'products'));
|
|||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
// Security check
|
||||
if (!$user->admin || (empty($conf->product->enabled) && empty($conf->service->enabled))) {
|
||||
if (!$user->admin || (!isModEnabled("product") && !isModEnabled("service"))) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -119,10 +119,10 @@ while ($result = $db->fetch_object($query)) {
|
|||
$title = $langs->trans('ProductServiceSetup');
|
||||
$tab = $langs->trans("ProductsAndServices");
|
||||
|
||||
if (empty($conf->product->enabled)) {
|
||||
if (!isModEnabled("product")) {
|
||||
$title = $langs->trans('ServiceSetup');
|
||||
$tab = $langs->trans('Services');
|
||||
} elseif (empty($conf->service->enabled)) {
|
||||
} elseif (!isModEnabled("service")) {
|
||||
$title = $langs->trans('ProductSetup');
|
||||
$tab = $langs->trans('Products');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
|
|||
$langs->loadLangs(array("admin", "products"));
|
||||
|
||||
// Security check
|
||||
if (!$user->admin || (empty($conf->product->enabled) && empty($conf->service->enabled))) {
|
||||
if (!$user->admin || (!isModEnabled("product") && !isModEnabled("service"))) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -271,10 +271,10 @@ $formbarcode = new FormBarCode($db);
|
|||
|
||||
$title = $langs->trans('ProductServiceSetup');
|
||||
$tab = $langs->trans("ProductsAndServices");
|
||||
if (empty($conf->product->enabled)) {
|
||||
if (!isModEnabled("product")) {
|
||||
$title = $langs->trans('ServiceSetup');
|
||||
$tab = $langs->trans('Services');
|
||||
} elseif (empty($conf->service->enabled)) {
|
||||
} elseif (!isModEnabled("service")) {
|
||||
$title = $langs->trans('ProductSetup');
|
||||
$tab = $langs->trans('Products');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,10 +66,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
|||
|
||||
$title = $langs->trans('ProductServiceSetup');
|
||||
$textobject = $langs->trans("ProductsAndServices");
|
||||
if (empty($conf->product->enabled)) {
|
||||
if (!isModEnabled("product")) {
|
||||
$title = $langs->trans('ServiceSetup');
|
||||
$textobject = $langs->trans('Services');
|
||||
} elseif (empty($conf->service->enabled)) {
|
||||
} elseif (!isModEnabled("service")) {
|
||||
$title = $langs->trans('ProductSetup');
|
||||
$textobject = $langs->trans('Products');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,10 +67,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
|||
|
||||
$title = $langs->trans('ProductServiceSetup');
|
||||
$textobject = $langs->trans("ProductsAndServices");
|
||||
if (empty($conf->product->enabled)) {
|
||||
if (!isModEnabled("product")) {
|
||||
$title = $langs->trans('ServiceSetup');
|
||||
$textobject = $langs->trans('Services');
|
||||
} elseif (empty($conf->service->enabled)) {
|
||||
} elseif (!isModEnabled("service")) {
|
||||
$title = $langs->trans('ProductSetup');
|
||||
$textobject = $langs->trans('Products');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,11 +73,11 @@ if (!isset($_GET["type"])) {
|
|||
$transAreaType = $langs->trans("ProductsAndServicesArea");
|
||||
$helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
||||
}
|
||||
if ((isset($_GET["type"]) && $_GET["type"] == 0) || empty($conf->service->enabled)) {
|
||||
if ((isset($_GET["type"]) && $_GET["type"] == 0) || !isModEnabled("service")) {
|
||||
$transAreaType = $langs->trans("ProductsArea");
|
||||
$helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
||||
}
|
||||
if ((isset($_GET["type"]) && $_GET["type"] == 1) || empty($conf->product->enabled)) {
|
||||
if ((isset($_GET["type"]) && $_GET["type"] == 1) || !isModEnabled("product")) {
|
||||
$transAreaType = $langs->trans("ServicesArea");
|
||||
$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -629,7 +629,7 @@ $listofreferent = array(
|
|||
'lang'=>'agenda',
|
||||
'buttonnew'=>'AddEvent',
|
||||
'testnew'=>$user->rights->agenda->myactions->create,
|
||||
'test'=>$conf->agenda->enabled && $user->rights->agenda->myactions->read),
|
||||
'test'=> isModEnabled('agenda') && $user->rights->agenda->myactions->read),
|
||||
*/
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -1458,7 +1458,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($conf->service->enabled) {
|
||||
if (isModEnabled("service")) {
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $langs->trans('ServiceToUseOnLines');
|
||||
|
|
@ -1750,7 +1750,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
|
||||
print '<td></td>';
|
||||
|
||||
if ($conf->service->enabled && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) {
|
||||
if (isModEnabled("service") && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) {
|
||||
print '<td>'.$langs->trans("Product").'</td>';
|
||||
}
|
||||
}
|
||||
|
|
@ -1829,7 +1829,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
print '<td>';
|
||||
print '</td>';
|
||||
|
||||
if ($conf->service->enabled && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) {
|
||||
if (isModEnabled("service") && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) {
|
||||
print '<td class="nowraponall">';
|
||||
print img_picto('', 'product');
|
||||
print $form->select_produits('', 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1);
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ require '../../main.inc.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
|
||||
// Security check
|
||||
if (empty($conf->agenda->enabled)) {
|
||||
if (!isModEnabled('agenda')) {
|
||||
httponly_accessforbidden('Module Agenda not enabled');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -577,7 +577,7 @@ class Thirdparties extends DolibarrApi
|
|||
throw new RestException(501, 'Module "Thirdparties" needed for this request');
|
||||
}
|
||||
|
||||
if (empty($conf->product->enabled)) {
|
||||
if (!isModEnabled("product")) {
|
||||
throw new RestException(501, 'Module "Products" needed for this request');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ if (!empty($conf->global->SOCIETE_USEPREFIX)) { // Old not used prefix field
|
|||
print '<tr><td class="titlefield">'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
|
||||
}
|
||||
|
||||
//if ($conf->agenda->enabled && $user->rights->agenda->myactions->read) $elementTypeArray['action']=$langs->transnoentitiesnoconv('Events');
|
||||
//if (isModEnabled('agenda') && $user->rights->agenda->myactions->read) $elementTypeArray['action']=$langs->transnoentitiesnoconv('Events');
|
||||
|
||||
if ($object->client) {
|
||||
print '<tr><td class="titlefield">';
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ if ($object->id > 0) {
|
|||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (!empty($conf->agenda->enabled)) {
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
|
|
@ -232,7 +232,7 @@ if ($object->id > 0) {
|
|||
|
||||
print '</div>';
|
||||
|
||||
if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||
$param = '&id='.$object->id.'&socid='.$socid;
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user