2
0
forked from Wavyzz/dolibarr

NEW Top menu support picto of modules that are font awesome picto.

This commit is contained in:
Laurent Destailleur
2023-10-13 15:00:51 +02:00
parent 68fe6cbf26
commit c507adeef7
49 changed files with 246 additions and 394 deletions

View File

@@ -146,17 +146,6 @@ print '<td>'.$langs->trans('OptionMode').'</td><td>'.$langs->trans('Description'
print "</tr>\n"; print "</tr>\n";
print '<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>'; print '<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc')); print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
// Write info on way to count VAT
//if (!empty($conf->global->MAIN_MODULE_COMPTABILITE))
//{
// // print "<br>\n";
// // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite'));
//}
//else
//{
// // print "<br>\n";
// // print nl2br($langs->trans('OptionModeTrueInfoExpert'));
//}
print "</td></tr>\n"; print "</td></tr>\n";
print '<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode == 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeVirtual').'</td>'; print '<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode == 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeVirtual').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionModeVirtualDesc'))."</td></tr>\n"; print '<td colspan="2">'.nl2br($langs->trans('OptionModeVirtualDesc'))."</td></tr>\n";

View File

@@ -383,7 +383,7 @@ if ($action == 'edit') {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>';
// SuperAdministrator access only // SuperAdministrator access only
if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail')); print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'));
} else { } else {
$text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE')]; $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE')];
@@ -516,7 +516,7 @@ if ($action == 'edit') {
print '<tr class="oddeven smtp_oauth_service"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>'; print '<tr class="oddeven smtp_oauth_service"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>';
// SuperAdministrator access only // SuperAdministrator access only
if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE); print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE);
} else { } else {
$text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE')]; $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE')];

View File

@@ -318,7 +318,7 @@ if ($action == 'edit') {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>';
// SuperAdministrator access only // SuperAdministrator access only
if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_EMAILING); print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_EMAILING);
} else { } else {
$text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')]; $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')];
@@ -450,7 +450,7 @@ if ($action == 'edit') {
print '<tr class="oddeven smtp_oauth_service hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>'; print '<tr class="oddeven smtp_oauth_service hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>';
// SuperAdministrator access only // SuperAdministrator access only
if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING); print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING);
} else { } else {
$text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING')]; $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING')];

View File

@@ -307,7 +307,7 @@ if ($action == 'edit') {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>';
// SuperAdministrator access only // SuperAdministrator access only
if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
print $form->selectarray('MAIN_MAIL_SENDMODE_TICKET', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_TICKET); print $form->selectarray('MAIN_MAIL_SENDMODE_TICKET', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_TICKET);
} else { } else {
$text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET')]; $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET')];
@@ -437,7 +437,7 @@ if ($action == 'edit') {
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) {
print '<tr class="oddeven smtp_oauth_service hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>'; print '<tr class="oddeven smtp_oauth_service hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>';
// SuperAdministrator access only // SuperAdministrator access only
if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET); print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET);
} else { } else {
$text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET')]; $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET')];

View File

@@ -404,13 +404,13 @@ foreach ($modulesdir as $dir) {
// We discard modules according to features level (PS: if module is activated we always show it) // We discard modules according to features level (PS: if module is activated we always show it)
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod))); $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
if ($objMod->version == 'development' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2))) { if ($objMod->version == 'development' && (!isModEnabled($const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2))) {
$modulequalified = 0; $modulequalified = 0;
} }
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1))) { if ($objMod->version == 'experimental' && (!isModEnabled($const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1))) {
$modulequalified = 0; $modulequalified = 0;
} }
if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) { if (preg_match('/deprecated/', $objMod->version) && (!isModEnabled($const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) {
$modulequalified = 0; $modulequalified = 0;
} }

View File

@@ -379,7 +379,7 @@ print '<br>';
*/ */
/* Disable this, there is no trigger with elementtype 'withdraw' /* Disable this, there is no trigger with elementtype 'withdraw'
if (!empty($conf->global->MAIN_MODULE_NOTIFICATION)) if (isModEnabled('notification'))
{ {
$langs->load("mails"); $langs->load("mails");
print load_fiche_titre($langs->trans("Notifications")); print load_fiche_titre($langs->trans("Notifications"));

View File

@@ -395,7 +395,7 @@ print '<br>';
*/ */
/* Disable this, there is no trigger with elementtype 'withdraw' /* Disable this, there is no trigger with elementtype 'withdraw'
if (!empty($conf->global->MAIN_MODULE_NOTIFICATION)) if (isModEnabled('notification') )
{ {
$langs->load("mails"); $langs->load("mails");
print load_fiche_titre($langs->trans("Notifications")); print load_fiche_titre($langs->trans("Notifications"));

View File

@@ -179,7 +179,7 @@ if (!$defaultsyslogfile) {
$defaultsyslogfile = 'dolibarr.log'; $defaultsyslogfile = 'dolibarr.log';
} }
$optionmc = ''; $optionmc = '';
if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY) && $user->entity) { if (isModEnabled('multicompany') && $user->entity) {
print '<div class="error">'.$langs->trans("ContactSuperAdminForChange").'</div>'; print '<div class="error">'.$langs->trans("ContactSuperAdminForChange").'</div>';
$optionmc = 'disabled'; $optionmc = 'disabled';
} }

View File

@@ -27,7 +27,7 @@
require_once '../../main.inc.php'; require_once '../../main.inc.php';
// Enable and test if module Api is enabled // Enable and test if module Api is enabled
if (empty($conf->global->MAIN_MODULE_API)) { if (!isModEnabled('api') ) {
$langs->load("admin"); $langs->load("admin");
dol_syslog("Call of Dolibarr API interfaces with module API REST are disabled"); dol_syslog("Call of Dolibarr API interfaces with module API REST are disabled");
print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>'; print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>';

View File

@@ -112,7 +112,7 @@ if (!empty($conf->global->MAIN_NGINX_FIX)) {
} }
// Enable and test if module Api is enabled // Enable and test if module Api is enabled
if (empty($conf->global->MAIN_MODULE_API)) { if (!isModEnabled('api') ) {
$langs->load("admin"); $langs->load("admin");
dol_syslog("Call of Dolibarr API interfaces with module API REST are disabled"); dol_syslog("Call of Dolibarr API interfaces with module API REST are disabled");
print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>'; print $langs->trans("WarningModuleNotActive", 'Api').'.<br><br>';

View File

@@ -147,7 +147,7 @@ if ($calc == 0 || $calc == 1) { // Calculate on invoice for goods and services
$calcmode = $calc == 0 ? $langs->trans("CalcModeLT".$local) : $langs->trans("CalcModeLT".$local."Rec"); $calcmode = $calc == 0 ? $langs->trans("CalcModeLT".$local) : $langs->trans("CalcModeLT".$local."Rec");
$calcmode .= ' <span class="opacitymedium">('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')</span>'; $calcmode .= ' <span class="opacitymedium">('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')</span>';
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
if (!empty($conf->global->MAIN_MODULE_COMPTABILITE)) { if (isModEnabled('comptabilite')) {
$description .= '<br>'.$langs->trans("WarningDepositsNotIncluded"); $description .= '<br>'.$langs->trans("WarningDepositsNotIncluded");
} }
$description .= $fsearch; $description .= $fsearch;
@@ -165,7 +165,7 @@ if ($calc == 2) { // Invoice for goods, payment for services
$calcmode = $langs->trans("CalcModeLT2Debt"); $calcmode = $langs->trans("CalcModeLT2Debt");
$calcmode .= ' <span class="opacitymedium">('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')</span>'; $calcmode .= ' <span class="opacitymedium">('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')</span>';
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
if (!empty($conf->global->MAIN_MODULE_COMPTABILITE)) { if (isModEnabled('comptabilite')) {
$description .= '<br>'.$langs->trans("WarningDepositsNotIncluded"); $description .= '<br>'.$langs->trans("WarningDepositsNotIncluded");
} }
$description .= $fsearch; $description .= $fsearch;

View File

@@ -246,8 +246,6 @@ $description .= $langs->trans($LT);
$calcmode = $langs->trans("LTReportBuildWithOptionDefinedInModule").' '; $calcmode = $langs->trans("LTReportBuildWithOptionDefinedInModule").' ';
$calcmode .= ' <span class="opacitymedium">('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')</span>'; $calcmode .= ' <span class="opacitymedium">('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')</span>';
//if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='<br>'.$langs->trans("ThisIsAnEstimatedValue");
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
$builddate = dol_now(); $builddate = dol_now();

View File

@@ -199,7 +199,7 @@ if (! empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
$description.='<br>'.$langs->trans("SupplierDepositsAreNotIncluded"); $description.='<br>'.$langs->trans("SupplierDepositsAreNotIncluded");
} }
*/ */
if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { if (isModEnabled('accounting')) {
$description .= $langs->trans("ThisIsAnEstimatedValue"); $description .= $langs->trans("ThisIsAnEstimatedValue");
} }

View File

@@ -207,7 +207,7 @@ if ($nextquarter < 4) {
$description = $fsearch; $description = $fsearch;
$builddate = dol_now(); $builddate = dol_now();
if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { if (isModEnabled('comptabilite')) {
$description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue"); $description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue");
} }
if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') { if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') {

View File

@@ -158,7 +158,7 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
$description .= $langs->trans("SupplierDepositsAreNotIncluded"); $description .= $langs->trans("SupplierDepositsAreNotIncluded");
} }
if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { if (isModEnabled('accounting')) {
$description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue"); $description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue");
} }

View File

@@ -216,7 +216,7 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
$description .= $langs->trans("SupplierDepositsAreNotIncluded"); $description .= $langs->trans("SupplierDepositsAreNotIncluded");
} }
if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { if (isModEnabled('accounting')) {
$description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue"); $description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue");
} }

View File

@@ -168,7 +168,7 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
$description .= $langs->trans("SupplierDepositsAreNotIncluded"); $description .= $langs->trans("SupplierDepositsAreNotIncluded");
} }
if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { if (isModEnabled('accounting')) {
$description .= '<br>' . $langs->trans("ThisIsAnEstimatedValue"); $description .= '<br>' . $langs->trans("ThisIsAnEstimatedValue");
} }

View File

@@ -282,7 +282,7 @@ class FormWebsite
} }
if ($website->fk_default_home && $key == $website->fk_default_home) { if ($website->fk_default_home && $key == $website->fk_default_home) {
//$valueforoption .= ' <span class="opacitymedium">('.$langs->trans("HomePage").')</span>'; //$valueforoption .= ' <span class="opacitymedium">('.$langs->trans("HomePage").')</span>';
$valueforoption .= ' <span class="opacitymedium fa fa-home"></span>'; $valueforoption .= ' <span class="opacitymedium fas fa-home"></span>';
} }
$out .= '<option value="'.$key.'"'; $out .= '<option value="'.$key.'"';

View File

@@ -129,7 +129,7 @@ class Interfaces
if (strtolower($reg[2]) != 'all') { if (strtolower($reg[2]) != 'all') {
$module = preg_replace('/^mod/i', '', $reg[2]); $module = preg_replace('/^mod/i', '', $reg[2]);
$constparam = 'MAIN_MODULE_'.strtoupper($module); $constparam = 'MAIN_MODULE_'.strtoupper($module);
if (empty($conf->global->$constparam)) { if (!isModEnabled($constparam)) {
$qualified = false; $qualified = false;
} }
} }

View File

@@ -71,7 +71,7 @@ class Menu
} }
/** /**
* Insert a menu entry into this->liste * Insert a menu entry into this->liste (after $idafter)
* *
* @param int $idafter Array key after which inserting new entry * @param int $idafter Array key after which inserting new entry
* @param string $url Url to follow on click * @param string $url Url to follow on click

View File

@@ -730,7 +730,7 @@ class Menubase
} }
} }
$tabMenu[$b]['titre'] = $title; $tabMenu[$b]['titre'] = $title;
$tabMenu[$b]['prefix'] = $menu['prefix']; $tabMenu[$b]['prefix'] = $menu['prefix'];
$tabMenu[$b]['target'] = $menu['target']; $tabMenu[$b]['target'] = $menu['target'];
$tabMenu[$b]['mainmenu'] = $menu['mainmenu']; $tabMenu[$b]['mainmenu'] = $menu['mainmenu'];
$tabMenu[$b]['leftmenu'] = $menu['leftmenu']; $tabMenu[$b]['leftmenu'] = $menu['leftmenu'];

View File

@@ -716,7 +716,7 @@ function modules_prepare_head($nbofactivatedmodules, $nboftotalmodules, $nbmodul
$h = 0; $h = 0;
$head = array(); $head = array();
$mode = empty($conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT) ? 'commonkanban' : $conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT; $mode = getDolGlobalString('MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT', 'commonkanban');
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$mode; $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$mode;
if ($nbmodulesnotautoenabled <= getDolGlobalInt('MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) { // If only minimal initial modules enabled) if ($nbmodulesnotautoenabled <= getDolGlobalInt('MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) { // If only minimal initial modules enabled)
//$head[$h][1] = $form->textwithpicto($langs->trans("AvailableModules"), $desc); //$head[$h][1] = $form->textwithpicto($langs->trans("AvailableModules"), $desc);

View File

@@ -4658,7 +4658,7 @@ function img_picto_common($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0
} else { } else {
$path = DOL_URL_ROOT.'/theme/common/'.$picto; $path = DOL_URL_ROOT.'/theme/common/'.$picto;
if (!empty($conf->global->MAIN_MODULE_CAN_OVERWRITE_COMMONICONS)) { if (getDolGlobalInt('MAIN_MODULE_CAN_OVERWRITE_COMMONICONS')) {
$themepath = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/'.$picto; $themepath = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/'.$picto;
if (file_exists($themepath)) { if (file_exists($themepath)) {

View File

@@ -46,7 +46,7 @@ function dol_convertToWord($num, $langs, $currency = '', $centimes = false)
$num = $num * 10; $num = $num * 10;
} }
if (!empty($conf->global->MAIN_MODULE_NUMBERWORDS)) { if (isModEnabled('numberwords')) {
if ($currency) { if ($currency) {
$type = '1'; $type = '1';
} else { } else {

View File

@@ -170,7 +170,7 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout
if (empty($noout)) { if (empty($noout)) {
foreach ($menu->liste as $menuval) { foreach ($menu->liste as $menuval) {
print_start_menu_entry_auguria($menuval['idsel'], $menuval['classname'], $menuval['enabled']); print_start_menu_entry_auguria($menuval['idsel'], $menuval['classname'], $menuval['enabled']);
print_text_menu_entry_auguria($menuval['titre'], $menuval['enabled'], ($menuval['url'] != '#' ?DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target'] ? $menuval['target'] : $atarget)); print_text_menu_entry_auguria($menuval['titre'], $menuval['enabled'], ($menuval['url'] != '#' ?DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target'] ? $menuval['target'] : $atarget), $menuval);
print_end_menu_entry_auguria($menuval['enabled']); print_end_menu_entry_auguria($menuval['enabled']);
} }
} }
@@ -219,16 +219,17 @@ function print_start_menu_entry_auguria($idsel, $classname, $showmode)
/** /**
* Output menu entry * Output menu entry
* *
* @param string $text Text * @param string $text Text
* @param int $showmode 0 = hide, 1 = allowed or 2 = not allowed * @param int $showmode 0 = hide, 1 = allowed or 2 = not allowed
* @param string $url Url * @param string $url Url
* @param string $id Id * @param string $id Id
* @param string $idsel Id sel * @param string $idsel Id sel
* @param string $classname Class name * @param string $classname Class name
* @param string $atarget Target * @param string $atarget Target
* @param array $menuval All the $menuval array
* @return void * @return void
*/ */
function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $classname, $atarget) function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $classname, $atarget, $menuval = array())
{ {
global $langs, $conf; global $langs, $conf;
@@ -237,7 +238,9 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla
if ($showmode == 1) { if ($showmode == 1) {
print '<a '.$classnameimg.' tabindex="-1" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">'; print '<a '.$classnameimg.' tabindex="-1" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">';
print '<div class="'.$id.' '.$idsel.' topmenuimage aaa"><span class="'.$id.' tmenuimageforpng" id="mainmenuspan_'.$idsel.'"></span></div>'; print '<div class="'.$id.' '.$idsel.' topmenuimage aaa">';
print '<span class="'.$id.' tmenuimageforpng" id="mainmenuspan_'.$idsel.'"></span>';
print '</div>';
print '</a>'; print '</a>';
if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) { if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
print '<a '.$classnametxt.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">'; print '<a '.$classnametxt.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">';
@@ -248,7 +251,9 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla
} }
} elseif ($showmode == 2) { } elseif ($showmode == 2) {
print '<div '.$classnameimg.' title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">'; print '<div '.$classnameimg.' title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">';
print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled"><span class="'.$id.' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.'"></span></div>'; print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled">';
print '<span class="'.$id.' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.'"></span>';
print '</div>';
print '</div>'; print '</div>';
if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) { if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
print '<span '.$classnametxt.' id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">'; print '<span '.$classnametxt.' id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">';

View File

@@ -194,7 +194,7 @@ class MenuManager
if ($val['level'] == 0 && !empty($val['prefix'])) { if ($val['level'] == 0 && !empty($val['prefix'])) {
print $val['prefix']; print $val['prefix'];
} elseif ($val['level'] == 0 && $val['mainmenu'] == 'home') { } elseif ($val['level'] == 0 && $val['mainmenu'] == 'home') {
print '<span class="fa fa-home fa-fw paddingright pictofixedwidth" aria-hidden="true"></span>'; print '<span class="fas fa-home fa-fw paddingright pictofixedwidth" aria-hidden="true"></span>';
} }
print $val['titre']; print $val['titre'];

View File

@@ -87,7 +87,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'id' => $id, 'id' => $id,
'idsel' => 'home', 'idsel' => 'home',
'classname' => $classname = (empty($_SESSION["mainmenu"]) || $_SESSION["mainmenu"] == "home") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (empty($_SESSION["mainmenu"]) || $_SESSION["mainmenu"] == "home") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => '<span class="fa fa-home fa-fw paddingright"></span>', 'prefix' => '<span class="fas fa-home fa-fw"></span>',
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "home") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "home") ? 0 : 1),
'loadLangs' => array(), 'loadLangs' => array(),
'submenus' => array(), 'submenus' => array(),
@@ -112,7 +112,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'id' => $id, 'id' => $id,
'idsel' => 'members', 'idsel' => 'members',
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'member', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'member', 'class="fa-fw pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 0 : 1),
'loadLangs' => array("members"), 'loadLangs' => array("members"),
'submenus' => array(), 'submenus' => array(),
@@ -141,7 +141,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'id' => $id, 'id' => $id,
'idsel' => 'companies', 'idsel' => 'companies',
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "companies") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "companies") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'company', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'company', 'class="fa-fw pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "companies") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "companies") ? 0 : 1),
'loadLangs' => array("companies", "suppliers"), 'loadLangs' => array("companies", "suppliers"),
'submenus' => array(), 'submenus' => array(),
@@ -168,7 +168,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'id' => $id, 'id' => $id,
'idsel' => 'products', 'idsel' => 'products',
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'product', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'product', 'class="fa-fw pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 0 : 1),
'loadLangs' => array("products", "stocks"), 'loadLangs' => array("products", "stocks"),
'submenus' => array(), 'submenus' => array(),
@@ -193,7 +193,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'id' => $id, 'id' => $id,
'idsel' => 'mrp', 'idsel' => 'mrp',
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "mrp") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "mrp") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'mrp', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'mrp', 'class="fa-fw pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "mrp") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "mrp") ? 0 : 1),
'loadLangs' => array("mrp"), 'loadLangs' => array("mrp"),
'submenus' => array(), 'submenus' => array(),
@@ -231,7 +231,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'id' => $id, 'id' => $id,
'idsel' => 'project', 'idsel' => 'project',
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "project") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "project") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'project', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'project', 'class="fa-fw pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "project") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "project") ? 0 : 1),
'loadLangs' => array("projects"), 'loadLangs' => array("projects"),
'submenus' => array(), 'submenus' => array(),
@@ -280,7 +280,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'id' => $id, 'id' => $id,
'idsel' => 'commercial', 'idsel' => 'commercial',
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "commercial") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "commercial") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'contract', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'contract', 'class="fa-fw pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "commercial") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "commercial") ? 0 : 1),
'loadLangs' => array("commercial"), 'loadLangs' => array("commercial"),
'submenus' => array(), 'submenus' => array(),
@@ -314,7 +314,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'id' => $id, 'id' => $id,
'idsel' => 'billing', 'idsel' => 'billing',
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "billing") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "billing") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'bill', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'bill', 'class="fa-fw pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "billing") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "billing") ? 0 : 1),
'loadLangs' => array("compta"), 'loadLangs' => array("compta"),
'submenus' => array(), 'submenus' => array(),
@@ -339,7 +339,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'id' => $id, 'id' => $id,
'idsel' => 'bank', 'idsel' => 'bank',
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "bank") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "bank") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'bank_account', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'bank_account', 'class="fa-fw pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "bank") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "bank") ? 0 : 1),
'loadLangs' => array("compta", "banks"), 'loadLangs' => array("compta", "banks"),
'submenus' => array(), 'submenus' => array(),
@@ -364,7 +364,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'id' => $id, 'id' => $id,
'idsel' => 'accountancy', 'idsel' => 'accountancy',
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "accountancy") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "accountancy") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'accountancy', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'accountancy', 'class="fa-fw pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "accountancy") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "accountancy") ? 0 : 1),
'loadLangs' => array("compta", "accountancy", "assets", "intracommreport"), 'loadLangs' => array("compta", "accountancy", "assets", "intracommreport"),
'submenus' => array(), 'submenus' => array(),
@@ -390,7 +390,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'id' => $id, 'id' => $id,
'idsel' => 'hrm', 'idsel' => 'hrm',
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'hrm', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'hrm', 'class="fa-fw pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 0 : 1),
'loadLangs' => array("hrm", "holiday"), 'loadLangs' => array("hrm", "holiday"),
'submenus' => array(), 'submenus' => array(),
@@ -421,7 +421,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'id' => $id, 'id' => $id,
'idsel' => 'ticket', 'idsel' => 'ticket',
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'ticket', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'ticket', 'class="fa-fw pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 0 : 1),
'loadLangs' => array("ticket", "knowledgemanagement"), 'loadLangs' => array("ticket", "knowledgemanagement"),
'submenus' => array(), 'submenus' => array(),
@@ -446,7 +446,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'id' => $id, 'id' => $id,
'idsel' => 'tools', 'idsel' => 'tools',
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "tools") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "tools") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'tools', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'tools', 'class="fa-fw pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "tools") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "tools") ? 0 : 1),
'loadLangs' => array("other"), 'loadLangs' => array("other"),
'submenus' => array(), 'submenus' => array(),
@@ -575,10 +575,11 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
print_end_menu_entry(4); print_end_menu_entry(4);
} }
//var_dump($menu->liste);
if (empty($noout)) { if (empty($noout)) {
foreach ($menu->liste as $menuval) { foreach ($menu->liste as $menuval) {
print_start_menu_entry($menuval['idsel'], $menuval['classname'], $menuval['enabled']); print_start_menu_entry($menuval['idsel'], $menuval['classname'], $menuval['enabled']);
print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url'] != '#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target'] ? $menuval['target'] : $atarget)); print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url'] != '#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target'] ? $menuval['target'] : $atarget), $menuval);
print_end_menu_entry($menuval['enabled']); print_end_menu_entry($menuval['enabled']);
} }
} }
@@ -627,16 +628,17 @@ function print_start_menu_entry($idsel, $classname, $showmode)
/** /**
* Output menu entry * Output menu entry
* *
* @param string $text Text * @param string $text Text
* @param int $showmode 0 = hide, 1 = allowed or 2 = not allowed * @param int $showmode 0 = hide, 1 = allowed or 2 = not allowed
* @param string $url Url * @param string $url Url
* @param string $id Id * @param string $id Id
* @param string $idsel Id sel * @param string $idsel Id sel
* @param string $classname Class name * @param string $classname Class name
* @param string $atarget Target * @param string $atarget Target
* @param array $menuval All the $menuval array
* @return void * @return void
*/ */
function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, $atarget) function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, $atarget, $menuval = array())
{ {
global $conf, $langs; global $conf, $langs;
@@ -646,7 +648,13 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname,
//$conf->global->THEME_TOPMENU_DISABLE_TEXT=1; //$conf->global->THEME_TOPMENU_DISABLE_TEXT=1;
if ($showmode == 1) { if ($showmode == 1) {
print '<a '.$classnameimg.' tabindex="-1" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">'; print '<a '.$classnameimg.' tabindex="-1" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">';
print '<div class="'.$id.' '.$idsel.' topmenuimage"><span class="'.$id.' tmenuimageforpng" id="mainmenuspan_'.$idsel.'"></span></div>'; print '<div class="'.$id.' '.$idsel.' topmenuimage">';
if (!empty($menuval['prefix']) && strpos($menuval['prefix'], '<span') === 0) {
print $menuval['prefix'];
} else {
print '<span class="'.$id.' tmenuimageforpng" id="mainmenuspan_'.$idsel.'"></span>';
}
print '</div>';
print '</a>'; print '</a>';
if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) { if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
print '<a '.$classnametxt.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">'; print '<a '.$classnametxt.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">';
@@ -657,7 +665,13 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname,
} }
} elseif ($showmode == 2) { } elseif ($showmode == 2) {
print '<div '.$classnameimg.' title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">'; print '<div '.$classnameimg.' title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">';
print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled"><span class="'.$id.' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.'"></span></div>'; print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled">';
if (!empty($menuval['prefix']) && strpos($menuval['prefix'], '<span') === 0) {
print $menuval['prefix'];
} else {
print '<span class="'.$id.' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.'"></span>';
}
print '</div>';
print '</div>'; print '</div>';
if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) { if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
print '<span '.$classnametxt.' id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">'; print '<span '.$classnametxt.' id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">';
@@ -987,8 +1001,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
print '<span class="vmenu">'; print '<span class="vmenu">';
} }
if (!empty($menu_array[$i]['prefix'])) { if (!empty($menu_array[$i]['prefix'])) {
if (preg_match('/^fa-[a-zA-Z0-9-_]+$/', $menu_array[$i]['prefix'])) { if (preg_match('/^fa\-[a-zA-Z0-9\-_]+$/', $menu_array[$i]['prefix'])) {
print '<span class="fa '.$menu_array[$i]['prefix'].' paddingright pictofixedwidth"></span>'; print '<span class="fas '.$menu_array[$i]['prefix'].' paddingright pictofixedwidth"></span>';
} else { } else {
print $menu_array[$i]['prefix']; print $menu_array[$i]['prefix'];
} }

View File

@@ -224,7 +224,7 @@ class MenuManager
print '<a href="'.$relurl.'">'; print '<a href="'.$relurl.'">';
if ($val['level'] == 0) { if ($val['level'] == 0) {
print '<span class="fa fa-home fa-fw paddingright pictofixedwidth" aria-hidden="true"></span>'; print '<span class="fas fa-home fa-fw paddingright pictofixedwidth" aria-hidden="true"></span>';
} }
if ($langs->trans(ucfirst($val['mainmenu'])."Dashboard") == ucfirst($val['mainmenu'])."Dashboard") { // No translation if ($langs->trans(ucfirst($val['mainmenu'])."Dashboard") == ucfirst($val['mainmenu'])."Dashboard") { // No translation

View File

@@ -178,7 +178,7 @@ class MenuManager
// Add font-awesome // Add font-awesome
if ($val['level'] == 0 && $val['mainmenu'] == 'home') { if ($val['level'] == 0 && $val['mainmenu'] == 'home') {
print '<span class="fa fa-home fa-fw paddingright" aria-hidden="true"></span>'; print '<span class="fas fa-home fa-fw paddingright" aria-hidden="true"></span>';
} }
print $val['titre']; print $val['titre'];
@@ -504,16 +504,17 @@ function print_start_menu_entry_empty($idsel, $classname, $showmode)
/** /**
* Output menu entry * Output menu entry
* *
* @param string $text Text * @param string $text Text
* @param int $showmode 1 or 2 * @param int $showmode 1 or 2
* @param string $url Url * @param string $url Url
* @param string $id Id * @param string $id Id
* @param string $idsel Id sel * @param string $idsel Id sel
* @param string $classname Class name * @param string $classname Class name
* @param string $atarget Target * @param string $atarget Target
* @param array $menuval All the $menuval array
* @return void * @return void
*/ */
function print_text_menu_entry_empty($text, $showmode, $url, $id, $idsel, $classname, $atarget) function print_text_menu_entry_empty($text, $showmode, $url, $id, $idsel, $classname, $atarget, $menuval = array())
{ {
global $conf, $langs; global $conf, $langs;
@@ -522,7 +523,9 @@ function print_text_menu_entry_empty($text, $showmode, $url, $id, $idsel, $class
if ($showmode == 1) { if ($showmode == 1) {
print '<a '.$classnameimg.' tabindex="-1" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">'; print '<a '.$classnameimg.' tabindex="-1" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">';
print '<div class="'.$id.' '.$idsel.' topmenuimage"><span class="'.$id.' tmenuimageforpng" id="mainmenuspan_'.$idsel.'"></span></div>'; print '<div class="'.$id.' '.$idsel.' topmenuimage">';
print '<span class="'.$id.' tmenuimageforpng" id="mainmenuspan_'.$idsel.'"></span>';
print '</div>';
print '</a>'; print '</a>';
if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) { if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
print '<a '.$classnametxt.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').'>'; print '<a '.$classnametxt.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').'>';
@@ -534,7 +537,9 @@ function print_text_menu_entry_empty($text, $showmode, $url, $id, $idsel, $class
} }
if ($showmode == 2) { if ($showmode == 2) {
print '<div '.$classnameimg.' title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">'; print '<div '.$classnameimg.' title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">';
print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled"><span class="'.$id.' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.'"></span></div>'; print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled">';
print '<span class="'.$id.' tmenuimageforpng tmenudisabled" id="mainmenuspan_'.$idsel.'"></span>';
print '</div>';
print '</div>'; print '</div>';
if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) { if (empty($conf->global->THEME_TOPMENU_DISABLE_TEXT)) {
print '<span '.$classnametxt.' id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">'; print '<span '.$classnametxt.' id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($text.' - '.$langs->trans("NotAllowed")).'">';

View File

@@ -2273,7 +2273,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$error = 0; $error = 0;
if (is_array($this->module_parts) && !empty($this->module_parts)) { if (is_array($this->module_parts)) {
if (empty($this->module_parts['icon']) && !empty($this->picto) && preg_match('/^fa\-/', $this->picto)) {
$this->module_parts['icon'] = $this->picto;
}
foreach ($this->module_parts as $key => $value) { foreach ($this->module_parts as $key => $value) {
if (is_array($value) && count($value) == 0) { if (is_array($value) && count($value) == 0) {
continue; // Discard empty arrays continue; // Discard empty arrays
@@ -2301,32 +2305,34 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
} }
} }
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const ("; if (!empty($newvalue)) {
$sql .= "name"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
$sql .= ", type"; $sql .= "name";
$sql .= ", value"; $sql .= ", type";
$sql .= ", note"; $sql .= ", value";
$sql .= ", visible"; $sql .= ", note";
$sql .= ", entity"; $sql .= ", visible";
$sql .= ")"; $sql .= ", entity";
$sql .= " VALUES ("; $sql .= ")";
$sql .= " ".$this->db->encrypt($this->const_name."_".strtoupper($key)); $sql .= " VALUES (";
$sql .= ", 'chaine'"; $sql .= " ".$this->db->encrypt($this->const_name."_".strtoupper($key), 1);
$sql .= ", ".$this->db->encrypt($newvalue); $sql .= ", 'chaine'";
$sql .= ", null"; $sql .= ", ".$this->db->encrypt($newvalue, 1);
$sql .= ", '0'"; $sql .= ", null";
$sql .= ", ".((int) $entity); $sql .= ", '0'";
$sql .= ")"; $sql .= ", ".((int) $entity);
$sql .= ")";
dol_syslog(get_class($this)."::insert_module_parts for key=".$this->const_name."_".strtoupper($key), LOG_DEBUG); dol_syslog(get_class($this)."::insert_module_parts for key=".$this->const_name."_".strtoupper($key), LOG_DEBUG);
$resql = $this->db->query($sql, 1); $resql = $this->db->query($sql, 1);
if (!$resql) { if (!$resql) {
if ($this->db->lasterrno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') { if ($this->db->lasterrno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$error++; $error++;
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
} else { } else {
dol_syslog(get_class($this)."::insert_module_parts for ".$this->const_name."_".strtoupper($key)." Record already exists.", LOG_WARNING); dol_syslog(get_class($this)."::insert_module_parts for ".$this->const_name."_".strtoupper($key)." Record already exists.", LOG_WARNING);
}
} }
} }
} }
@@ -2347,9 +2353,13 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$err = 0; $err = 0;
if (is_array($this->module_parts) && !empty($this->module_parts)) { if (is_array($this->module_parts)) {
dol_syslog(get_class($this)."::delete_module_parts", LOG_DEBUG); dol_syslog(get_class($this)."::delete_module_parts", LOG_DEBUG);
if (empty($this->module_parts['icon']) && !empty($this->picto) && preg_match('/^fa\-/', $this->picto)) {
$this->module_parts['icon'] = $this->picto;
}
foreach ($this->module_parts as $key => $value) { foreach ($this->module_parts as $key => $value) {
// If entity is defined // If entity is defined
if (is_array($value) && isset($value['entity'])) { if (is_array($value) && isset($value['entity'])) {

View File

@@ -209,7 +209,7 @@ class modAgenda extends DolibarrModules
'fk_menu'=>0, 'fk_menu'=>0,
'type'=>'top', 'type'=>'top',
'titre'=>'TMenuAgenda', 'titre'=>'TMenuAgenda',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth"'),
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
'url'=>'/comm/action/index.php', 'url'=>'/comm/action/index.php',
'langs'=>'agenda', 'langs'=>'agenda',

View File

@@ -301,7 +301,7 @@ class modBookCal extends DolibarrModules
'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'top', // This is a Top menu entry 'type'=>'top', // This is a Top menu entry
'titre'=>'ModuleBookCalName', 'titre'=>'ModuleBookCalName',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'), 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth valignmiddle"'),
'mainmenu'=>'bookcal', 'mainmenu'=>'bookcal',
'leftmenu'=>'', 'leftmenu'=>'',
'url'=>'/bookcal/bookcalindex.php', 'url'=>'/bookcal/bookcalindex.php',

View File

@@ -123,7 +123,7 @@ class modECM extends DolibarrModules
'fk_menu'=>0, 'fk_menu'=>0,
'type'=>'top', 'type'=>'top',
'titre'=>'MenuECM', 'titre'=>'MenuECM',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth"'),
'mainmenu'=>'ecm', 'mainmenu'=>'ecm',
'url'=>'/ecm/index.php', 'url'=>'/ecm/index.php',
'langs'=>'ecm', 'langs'=>'ecm',

View File

@@ -103,7 +103,7 @@ class modExternalSite extends DolibarrModules
'fk_menu'=>0, 'fk_menu'=>0,
'type'=>'top', 'type'=>'top',
'titre'=>'__[EXTERNALSITE_LABEL]__', 'titre'=>'__[EXTERNALSITE_LABEL]__',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'), 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth em092"'),
'mainmenu'=>'externalsite', 'mainmenu'=>'externalsite',
'url'=>'/externalsite/frames.php', 'url'=>'/externalsite/frames.php',
'langs'=>'other', 'langs'=>'other',

View File

@@ -114,7 +114,7 @@ class modFTP extends DolibarrModules
$this->menu[$r] = array('fk_menu'=>0, $this->menu[$r] = array('fk_menu'=>0,
'type'=>'top', 'type'=>'top',
'titre'=>'FTP', 'titre'=>'FTP',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'), 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth em092"'),
'mainmenu'=>'ftp', 'mainmenu'=>'ftp',
'url'=>'/ftp/index.php', 'url'=>'/ftp/index.php',
'langs'=>'ftp', 'langs'=>'ftp',

View File

@@ -114,7 +114,6 @@ class modHRM extends DolibarrModules
// Constants // Constants
// Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0), // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0),
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) ); // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) );
// 2=>array('MAIN_MODULE_MYMODULE_NEEDSMARTY','chaine',1,'Constant to say module need smarty',0)
$this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities') $this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities')
$r = 0; $r = 0;

View File

@@ -91,7 +91,6 @@ class modHoliday extends DolibarrModules
// Constants // Constants
// Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0), // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0),
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) ); // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) );
// 2=>array('MAIN_MODULE_MYMODULE_NEEDSMARTY','chaine',1,'Constant to say module need smarty',0)
$this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities') $this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities')
$r = 0; $r = 0;

View File

@@ -266,7 +266,7 @@ class modKnowledgeManagement extends DolibarrModules
'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'top', // This is a Top menu entry 'type'=>'top', // This is a Top menu entry
'titre'=>'ModuleKnowledgeManagementName', 'titre'=>'ModuleKnowledgeManagementName',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'), 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth em092"'),
'mainmenu'=>'knowledgemanagement', 'mainmenu'=>'knowledgemanagement',
'leftmenu'=>'', 'leftmenu'=>'',
'url'=>'/knowledgemanagement/knowledgerecord_list.php', 'url'=>'/knowledgemanagement/knowledgerecord_list.php',

View File

@@ -217,7 +217,7 @@ class modTakePos extends DolibarrModules
'titre'=>'PointOfSaleShort', 'titre'=>'PointOfSaleShort',
'mainmenu'=>'takepos', 'mainmenu'=>'takepos',
'leftmenu'=>'', 'leftmenu'=>'',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth"'),
'url'=>'/takepos/index.php', 'url'=>'/takepos/index.php',
'langs'=>'cashdesk', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'cashdesk', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000 + $r, 'position'=>1000 + $r,

View File

@@ -285,7 +285,7 @@ class modWebhook extends DolibarrModules
'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'top', // This is a Top menu entry 'type'=>'top', // This is a Top menu entry
'titre'=>'ModuleWebhookName', 'titre'=>'ModuleWebhookName',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'), 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth valignmiddle"'),
'mainmenu'=>'webhook', 'mainmenu'=>'webhook',
'leftmenu'=>'', 'leftmenu'=>'',
'url'=>'/webhook/webhookindex.php', 'url'=>'/webhook/webhookindex.php',

View File

@@ -120,7 +120,7 @@ class modWebsite extends DolibarrModules
$this->menu[$r] = array('fk_menu'=>'0', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode $this->menu[$r] = array('fk_menu'=>'0', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'top', // This is a Left menu entry 'type'=>'top', // This is a Left menu entry
'titre'=>'WebSites', 'titre'=>'WebSites',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'), 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth em092"'),
'mainmenu'=>'website', 'mainmenu'=>'website',
'url'=>'/website/index.php', 'url'=>'/website/index.php',
'langs'=>'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.

View File

@@ -304,7 +304,7 @@ class modMyModule extends DolibarrModules
'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'top', // This is a Top menu entry 'type'=>'top', // This is a Top menu entry
'titre'=>'ModuleMyModuleName', 'titre'=>'ModuleMyModuleName',
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'), 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth valignmiddle"'),
'mainmenu'=>'mymodule', 'mainmenu'=>'mymodule',
'leftmenu'=>'', 'leftmenu'=>'',
'url'=>'/mymodule/mymoduleindex.php', 'url'=>'/mymodule/mymoduleindex.php',

View File

@@ -2834,6 +2834,7 @@ li.tmenu:hover .tmenuimage:not(.menuhider), li.tmenu:hover .tmenuimage:not(.menu
$divalreadydefined = array('home', 'companies', 'products', 'mrp', 'commercial', 'externalsite', 'accountancy', 'project', 'tools', 'members', 'agenda', 'ftp', 'holiday', 'hrm', 'bookmark', 'cashdesk', 'takepos', 'ecm', 'geoipmaxmind', 'gravatar', 'clicktodial', 'paypal', 'stripe', 'webservices', 'website'); $divalreadydefined = array('home', 'companies', 'products', 'mrp', 'commercial', 'externalsite', 'accountancy', 'project', 'tools', 'members', 'agenda', 'ftp', 'holiday', 'hrm', 'bookmark', 'cashdesk', 'takepos', 'ecm', 'geoipmaxmind', 'gravatar', 'clicktodial', 'paypal', 'stripe', 'webservices', 'website');
// Put here list of menu entries we are sure we don't want // Put here list of menu entries we are sure we don't want
$divnotrequired = array('multicurrency', 'salaries', 'ticket', 'margin', 'opensurvey', 'paybox', 'expensereport', 'incoterm', 'prelevement', 'propal', 'workflow', 'notification', 'supplier_proposal', 'cron', 'product', 'productbatch', 'expedition'); $divnotrequired = array('multicurrency', 'salaries', 'ticket', 'margin', 'opensurvey', 'paybox', 'expensereport', 'incoterm', 'prelevement', 'propal', 'workflow', 'notification', 'supplier_proposal', 'cron', 'product', 'productbatch', 'expedition');
foreach ($mainmenuusedarray as $val) { foreach ($mainmenuusedarray as $val) {
if (empty($val) || in_array($val, $divalreadydefined)) { if (empty($val) || in_array($val, $divalreadydefined)) {
continue; continue;
@@ -2841,40 +2842,46 @@ li.tmenu:hover .tmenuimage:not(.menuhider), li.tmenu:hover .tmenuimage:not(.menu
if (in_array($val, $divnotrequired)) { if (in_array($val, $divnotrequired)) {
continue; continue;
} }
//print "XXX".$val;
// Search img file in module dir
$found = 0; $url = ''; $found = 0; $url = '';
foreach ($conf->file->dol_document_root as $dirroot) { $constformoduleicon = 'MAIN_MODULE_'.strtoupper($val).'_ICON';
if (file_exists($dirroot."/".$val."/img/".$val.".png")) { $iconformodule = getDolGlobalString($constformoduleicon);
$url = dol_buildpath('/'.$val.'/img/'.$val.'.png', 1); if ($iconformodule) {
$found = 1; if (preg_match('/^fa\-/', $iconformodule)) {
break; // This is a fa icon
} else {
$url = dol_buildpath('/'.$val.'/img/'.$iconformodule.'.png', 1);
}
$found = 1;
} else {
// Search img file in module dir
foreach ($conf->file->dol_document_root as $dirroot) {
if (file_exists($dirroot."/".$val."/img/".$val.".png")) {
$url = dol_buildpath('/'.$val.'/img/'.$val.'.png', 1);
$found = 1;
break;
}
} }
} }
// Img file not found //print "XXX".$val."->".$found."\n";
// Output entry for menu icon in CSS
if (!$found) { if (!$found) {
if (!defined('DISABLE_FONT_AWSOME')) { print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one. */\n"; print 'div.mainmenu.'.$val.' span::before {'."\n";
print "/* Overwrite this definition in your own css with a different content to use your own font awesome icon. */\n"; print 'content: "\f249";'."\n";
print 'div.mainmenu.'.$val.'::before { print '}'."\n";
content: "\f249"; $generic++;
}'."\n"; } else {
} else { if ($url) {
print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
$url = dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic, 4))."_over.png", 1);
print "div.mainmenu.".$val." {\n"; print "div.mainmenu.".$val." {\n";
print " background-image: url(".$url.");\n"; print " background-image: url(".$url.");\n";
print " background-position-y: 3px;\n"; print " background-position-y: 3px;\n";
print " filter: saturate(0);\n";
print "}\n"; print "}\n";
} else {
print '/* icon for module '.$val.' is a fa icon */'."\n";
} }
$generic++;
} else {
print "div.mainmenu.".$val." {\n";
print " background-image: url(".$url.");\n";
print " background-position-y: 3px;\n";
print " filter: saturate(0);\n";
print "}\n";
} }
} }
// End of part to add more div class css // End of part to add more div class css
@@ -2883,7 +2890,7 @@ li.tmenu:hover .tmenuimage:not(.menuhider), li.tmenu:hover .tmenuimage:not(.menu
.tmenuimage { .tmenuimage {
padding:0 0 0 0 !important; padding:0 0 0 0 !important;
margin:0 0px 0 0 !important; margin:0 0 0 0 !important;
<?php if ($disableimages) { ?> <?php if ($disableimages) { ?>
display: none; display: none;
<?php } ?> <?php } ?>

View File

@@ -387,40 +387,40 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
} }
.infobox-adherent, .infobox-member { .infobox-adherent, .infobox-member {
color: #79633f !important; color: #79633f;
} }
.infobox-project{ .infobox-project{
color: #6c6aa8 !important; color: #6c6aa8;
} }
.infobox-action{ .infobox-action{
color: #b06080 !important; color: #b06080;
} }
/* Color for customer object */ /* Color for customer object */
.infobox-propal:not(.error), .infobox-propal:not(.error),
.infobox-facture:not(.error), .infobox-facture:not(.error),
.infobox-commande:not(.error) { .infobox-commande:not(.error) {
color: #65953d !important; color: #65953d;
} }
/* Color for vendor object */ /* Color for vendor object */
.infobox-supplier_proposal:not(.error), .infobox-supplier_proposal:not(.error),
.infobox-invoice_supplier:not(.error), .infobox-invoice_supplier:not(.error),
.infobox-order_supplier:not(.error) { .infobox-order_supplier:not(.error) {
color: #599caf !important; color: #599caf;
} }
.infobox-contrat, .infobox-ticket{ .infobox-contrat, .infobox-ticket{
color: #3bbfa8 !important; color: #3bbfa8;
} }
.infobox-bank_account{ .infobox-bank_account{
color: #b0bb39 !important; color: #b0bb39;
} }
.infobox-adherent, .infobox-member { .infobox-adherent, .infobox-member {
color: #79633f !important; color: #79633f;
} }
.infobox-expensereport{ .infobox-expensereport{
color: #79633f !important; color: #79633f;
} }
.infobox-holiday{ .infobox-holiday{
color: #755114 !important; color: #755114;
} }

View File

@@ -22,113 +22,6 @@ div.mainmenu.menu {
background-image: none; background-image: none;
} }
div.mainmenu.menu::before {
content: "\f0c9";
}
div.mainmenu.home::before{
content: "\f015";
}
div.mainmenu.billing::before {
content: "\f51e";
}
div.mainmenu.accountancy::before {
/* content: "\f53d"; */
content: "\f688";
font-size: 1.2em;
}
div.mainmenu.agenda::before {
content: "\f073";
}
div.mainmenu.bank::before {
content: "\f19c";
}
<?php if (getDolGlobalInt('MAIN_FEATURES_LEVEL') == 2) { ?>
/* TESTING USAGE OF SVG WITHOUT FONT */
div.mainmenu.cashdesk {
line-height: 26px;
}
div.mainmenu.cashdesk .tmenuimage {
line-height: 26px;
display: inline-block;
vertical-align: middle;
height: <?php echo $topMenuFontSize; ?>;
background-color: #<?php echo $colortextbackhmenu; ?>;
width: 100%;
-webkit-mask: url(<?php echo DOL_URL_ROOT.'/theme/common/fontawesome-5/svgs/solid/cash-register.svg' ?>) no-repeat 50% 50%; /* for old webkit browser */
mask: url(<?php echo DOL_URL_ROOT.'/theme/common/fontawesome-5/svgs/solid/cash-register.svg' ?>) no-repeat 50% 50%;
}
<?php } else { ?>
div.mainmenu.cashdesk::before {
content: "\f788";
}
<?php } ?>
div.mainmenu.takepos::before {
content: "\f788";
}
div.mainmenu.companies::before {
content: "\f1ad";
}
div.mainmenu.commercial::before {
content: "\f0f2";
}
div.mainmenu.ecm::before {
content: "\f07c";
}
div.mainmenu.externalsite::before {
content: "\f360";
}
div.mainmenu.ftp::before {
content: "\f362";
}
div.mainmenu.hrm::before {
content: "\f508";
}
div.mainmenu.members::before {
content: "\f007";
}
div.mainmenu.products::before {
content: "\f1b2";
}
div.mainmenu.mrp::before {
content: "\f1b3";
}
div.mainmenu.project::before {
content: "\f542";
}
div.mainmenu.ticket::before {
content: "\f3ff";
}
div.mainmenu.tools::before {
content: "\f0ad";
}
div.mainmenu.website::before {
content: "\f57d";
}
div.mainmenu.generic1::before { div.mainmenu.generic1::before {
content: "\f249"; content: "\f249";
@@ -198,7 +91,11 @@ div.mainmenu.generic4::before {
border-bottom: solid 60px currentColor; border-bottom: solid 60px currentColor;
margin-left: 30px; margin-left: 30px;
} }
.tmenu span.fas, .tmenu span.far {
color: unset !important;
line-height: 28px;
text-align: center;
}
.em092 { .em092 {
font-size: 0.92em; font-size: 0.92em;

View File

@@ -93,41 +93,41 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
.infobox-adherent, .infobox-member { .infobox-adherent, .infobox-member {
color: #79633f !important; color: #79633f;
} }
.infobox-project{ .infobox-project{
color: #6c6aa8 !important; color: #6c6aa8;
} }
.infobox-action{ .infobox-action{
color: #a47080 !important; color: #a47080;
} }
/* Color for customer object */ /* Color for customer object */
.infobox-propal:not(.pictotitle):not(.error), .infobox-propal:not(.pictotitle):not(.error),
.infobox-facture:not(.pictotitle):not(.error), .infobox-facture:not(.pictotitle):not(.error),
.infobox-commande:not(.pictotitle):not(.error) { .infobox-commande:not(.pictotitle):not(.error) {
color: #65953d !important; color: #65953d;
} }
/* Color for vendor object */ /* Color for vendor object */
.infobox-supplier_proposal:not(.pictotitle):not(.error), .infobox-supplier_proposal:not(.pictotitle):not(.error),
.infobox-invoice_supplier:not(.pictotitle):not(.error), .infobox-invoice_supplier:not(.pictotitle):not(.error),
.infobox-order_supplier:not(.pictotitle):not(.error) { .infobox-order_supplier:not(.pictotitle):not(.error) {
color: #599caf !important; color: #599caf;
} }
.infobox-contrat, .infobox-ticket{ .infobox-contrat, .infobox-ticket{
color: #46a676 !important; color: #46a676;
} }
.infobox-bank_account{ .infobox-bank_account{
color: #b0a53e !important; color: #b0a53e;
} }
.infobox-adherent, .infobox-member { .infobox-adherent, .infobox-member {
color: #79633f !important; color: #79633f;
} }
.infobox-expensereport{ .infobox-expensereport{
color: #79633f !important; color: #79633f;
} }
.infobox-holiday{ .infobox-holiday{
color: #755114 !important; color: #755114;
} }

View File

@@ -26,91 +26,6 @@ div.mainmenu.menu::before {
content: "\f0c9"; content: "\f0c9";
} }
div.mainmenu.home::before{
content: "\f015";
}
div.mainmenu.billing::before {
content: "\f51e";
}
div.mainmenu.accountancy::before {
/* content: "\f53d"; */
content: "\f688";
font-size: 1.2em;
}
div.mainmenu.agenda::before {
content: "\f073";
}
div.mainmenu.bank::before {
content: "\f19c";
}
div.mainmenu.cashdesk::before {
content: "\f788";
}
div.mainmenu.takepos::before {
content: "\f788";
}
div.mainmenu.companies::before {
content: "\f1ad";
}
div.mainmenu.commercial::before {
content: "\f0f2";
}
div.mainmenu.ecm::before {
content: "\f07c";
}
div.mainmenu.externalsite::before {
content: "\f360";
}
div.mainmenu.ftp::before {
content: "\f362";
}
div.mainmenu.hrm::before {
content: "\f508";
}
div.mainmenu.members::before {
content: "\f007";
}
div.mainmenu.products::before {
content: "\f1b2";
}
div.mainmenu.mrp::before {
content: "\f1b3";
}
div.mainmenu.project::before {
content: "\f542";
}
div.mainmenu.ticket::before {
content: "\f3ff";
}
div.mainmenu.tools::before {
content: "\f0ad";
}
div.mainmenu.website::before {
content: "\f57d";
}
div.mainmenu.generic1::before { div.mainmenu.generic1::before {
content: "\f249"; content: "\f249";
} }
@@ -180,6 +95,12 @@ div.mainmenu.generic4::before {
margin-left: 30px; margin-left: 30px;
} }
.tmenu span.fas, .tmenu span.far {
color: unset !important;
line-height: 28px;
text-align: center;
}
.menu_titre .em092 { .menu_titre .em092 {
font-size: 0.92em; font-size: 0.92em;
} }

View File

@@ -2981,36 +2981,44 @@ div.mainmenu.menu {
} }
//print "XXX".$val; //print "XXX".$val;
// Search img file in module dir
$found = 0; $url = ''; $found = 0; $url = '';
foreach ($conf->file->dol_document_root as $dirroot) { $constformoduleicon = 'MAIN_MODULE_'.strtoupper($val).'_ICON';
if (file_exists($dirroot."/".$val."/img/".$val.".png")) { $iconformodule = getDolGlobalString($constformoduleicon);
$url = dol_buildpath('/'.$val.'/img/'.$val.'.png', 1); if ($iconformodule) {
$found = 1; if (preg_match('/^fa\-/', $iconformodule)) {
break; // This is a fa icon
} else {
$url = dol_buildpath('/'.$val.'/img/'.$iconformodule.'.png', 1);
}
$found = 1;
} else {
// Search img file in module dir
foreach ($conf->file->dol_document_root as $dirroot) {
if (file_exists($dirroot."/".$val."/img/".$val.".png")) {
$url = dol_buildpath('/'.$val.'/img/'.$val.'.png', 1);
$found = 1;
break;
}
} }
} }
// Img file not found
// Output entry for menu icon in CSS
if (!$found) { if (!$found) {
if (!defined('DISABLE_FONT_AWSOME')) { print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one. */\n"; print 'div.mainmenu.'.$val.' span::before {'."\n";
print "/* Overwrite this definition in your own css with a different content to use your own font awesome icon. */\n"; print 'content: "\f249";'."\n";
print 'div.mainmenu.'.$val.'::before { print '}'."\n";
content: "\f249";
}'."\n";
} else {
print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
$url = dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic, 4))."_over.png", 1);
print "div.mainmenu.".$val." {\n";
print " background-image: url(".$url.");\n";
print "}\n";
}
$generic++; $generic++;
} else { } else {
print "div.mainmenu.".$val." {\n"; if ($url) {
print " background-image: url(".$url.");\n"; print "div.mainmenu.".$val." {\n";
print " filter: saturate(0);\n"; print " background-image: url(".$url.");\n";
print "}\n"; print " background-position-y: 3px;\n";
print " filter: saturate(0);\n";
print "}\n";
} else {
print '/* icon for module '.$val.' is a fa icon */'."\n";
}
} }
} }
// End of part to add more div class css // End of part to add more div class css

View File

@@ -3403,13 +3403,13 @@ if (!GETPOST('hide_websitemenu')) {
print '<span class="websiteselection">'; print '<span class="websiteselection">';
if ($object->fk_default_home > 0 && $pageid == $object->fk_default_home) { if ($object->fk_default_home > 0 && $pageid == $object->fk_default_home) {
//$disabled=' disabled="disabled"'; //$disabled=' disabled="disabled"';
//print '<span class="button bordertransp disabled"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fa fa-home"></span></span>'; //print '<span class="button bordertransp disabled"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fas fa-home"></span></span>';
//print '<input type="submit" class="button bordertransp" disabled="disabled" value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">'; //print '<input type="submit" class="button bordertransp" disabled="disabled" value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">';
print '<a href="#" class="button bordertransp disabled" disabled="disabled" title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fa fa-home valignmiddle btnTitle-icon"></span></a>'; print '<a href="#" class="button bordertransp disabled" disabled="disabled" title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fas fa-home valignmiddle btnTitle-icon"></span></a>';
} else { } else {
//$disabled=''; //$disabled='';
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">'; //print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setashome&token='.newToken().'&website='.urlencode($website->ref).'&pageid='.((int) $pageid).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fa fa-home valignmiddle btnTitle-icon"></span></a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setashome&token='.newToken().'&website='.urlencode($website->ref).'&pageid='.((int) $pageid).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fas fa-home valignmiddle btnTitle-icon"></span></a>';
} }
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("ClonePage")).'" name="createpagefromclone">'; print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("ClonePage")).'" name="createpagefromclone">';