'."\n";
- if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print '| '.++$linenum.' | ';
+ if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print ''.$linenum.' | ';
// Picto + Name of module
print ' ';
@@ -723,7 +875,7 @@ if ($mode == 'common' || $mode == 'commonkanban')
// Version
print ' | ';
print $versiontrans;
- if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) {
+ if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) { // This is a bad practice to activate a synch external access during building of a page. 1 external module can hang the application.
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
if (!empty($objMod->url_last_version)) {
$newversion = getURLContent($objMod->url_last_version);
@@ -736,158 +888,15 @@ if ($mode == 'common' || $mode == 'commonkanban')
}
print " | \n";
- // Activate/Disable and Setup (2 columns)
- if (!empty($conf->global->$const_name)) // If module is already activated
- {
- $disableSetup = 0;
+ // Link enable/disable
+ print '';
+ print $codeenabledisable;
+ print " | \n";
- // Link enable/disabme
- print '';
- if (!empty($arrayofwarnings[$modName]))
- {
- print ''."\n";
- }
- if (!empty($objMod->disabled))
- {
- print $langs->trans("Disabled");
- }
- elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1)))
- {
- if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used");
- else {
- print img_picto($langs->trans("Required"), 'switch_on', '', false, 0, 0, '', 'opacitymedium');
- //print $langs->trans("Required");
- }
- if (!empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
- }
- else
- {
- if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) {
- print 'numero.'&module_position='.$module_position.'&action=reset_confirm&confirm_message_code='.$objMod->warnings_unactivation[$mysoc->country_code].'&value='.$modName.'&mode='.$mode.$param.'">';
- print img_picto($langs->trans("Activated"), 'switch_on');
- print '';
- }
- else {
- print 'numero.'&module_position='.$module_position.'&action=reset&value='.$modName.'&mode='.$mode.'&confirm=yes'.$param.'">';
- print img_picto($langs->trans("Activated"), 'switch_on');
- print '';
- }
- }
- print ' | '."\n";
-
- // Link config
- print '';
- if (!empty($objMod->config_page_url) && !$disableSetup)
- {
- $backtourlparam = '';
- if ($search_keyword != '') $backtourlparam .= ($backtourlparam ? '&' : '?').'search_keyword='.$search_keyword; // No urlencode here, done later
- if ($search_nature > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_nature='.$search_nature;
- if ($search_version > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_version='.$search_version;
- if ($search_status > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_status='.$search_status;
- $backtourl = $_SERVER["PHP_SELF"].$backtourlparam;
-
- $regs = array();
- if (is_array($objMod->config_page_url))
- {
- $i = 0;
- foreach ($objMod->config_page_url as $page)
- {
- $urlpage = $page;
- if ($i++)
- {
- print ''.img_picto(ucfirst($page), "setup").'';
- // print ''.ucfirst($page).' ';
- }
- else
- {
- if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs))
- {
- $urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1);
- print ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'';
- }
- else
- {
- $urltouse = $urlpage;
- print ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'';
- }
- }
- }
- }
- elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs))
- {
- print ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'';
- }
- else
- {
- print ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'';
- }
- }
- else
- {
- print img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"');
- }
- print ' | ';
- }
- else // Module not yet activated
- {
- // Link enable/disable
- print '';
- if (!empty($objMod->always_enabled))
- {
- // Should never happened
- }
- elseif (!empty($objMod->disabled))
- {
- print $langs->trans("Disabled");
- }
- else
- {
- // Module qualified for activation
- $warningmessage = '';
- if (!empty($arrayofwarnings[$modName]))
- {
- print ''."\n";
- foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage)
- {
- if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
- {
- $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code);
- }
- }
- }
- if ($objMod->isCoreOrExternalModule() == 'external' && !empty($arrayofwarningsext))
- {
- print ''."\n";
- foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry)
- {
- $keymodulelowercase = strtolower(preg_replace('/^mod/', '', $keymodule));
- if (in_array($keymodulelowercase, $conf->modules)) // If module that request warning is on
- {
- foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage)
- {
- if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
- {
- $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName());
- $warningmessage .= ($warningmessage ? "\n" : "").($warningmessage ? "\n" : "").$langs->trans("Module").' : '.$objMod->getName();
- if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("Publisher").' : '.$objMod->editor_name;
- if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("ModuleTriggeringThisWarning").' : '.$modules[$keymodule]->getName();
- }
- }
- }
- }
- }
- print ''."\n";
- print 'numero.'&module_position='.$module_position.'&action=set&value='.$modName.'&mode='.$mode.$param.'"';
- if ($warningmessage) print ' onclick="return confirm(\''.dol_escape_js($warningmessage).'\');"';
- print '>';
- print img_picto($langs->trans("Disabled"), 'switch_off');
- print "\n";
- }
- print " | \n";
-
- // Link config
- print ''.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').' | ';
- }
+ // Link config
+ print '';
+ print $codetoconfig;
+ print ' | ';
print "
\n";
}
diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php
index 5d82ecbd5b9..85c07be8428 100644
--- a/htdocs/admin/openinghours.php
+++ b/htdocs/admin/openinghours.php
@@ -89,7 +89,7 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit')
print '