diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php
index 531e53ac459..08ddbd4ad6a 100644
--- a/htdocs/admin/modulehelp.php
+++ b/htdocs/admin/modulehelp.php
@@ -290,7 +290,7 @@ $text='';
if ($mode == 'desc')
{
- if ($moduledesc) $text.=$moduledesc.'
';
+ if ($moduledesc) $text .= '
'.$moduledesc.'
';
$text.=''.$langs->trans("Version").': '.$version;
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index 72eb8240c10..4056bca0ee3 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -552,7 +552,7 @@ if ($mode == 'common')
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Show list of modules
-
+ //$conf->global->MAIN_USE_KANBAN_FOR_MODULES=1;
$oldfamily = '';
foreach ($orders as $key => $value)
@@ -637,8 +637,12 @@ if ($mode == 'common')
$familytext = empty($familyinfo[$familykey]['label']) ? $familykey : $familyinfo[$familykey]['label'];
print load_fiche_titre($familytext, '', '');
- print '
| '.++$linenum.' | '; + if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) { + // Output Kanban + print $objMod->getKanbanView(); + } else { + print '||||||||||||||||||||||
| '.++$linenum.' | '; - // Picto + Name of module - print ''; - $alttext = ''; - //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version); - //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin); - if (!empty($objMod->picto)) - { - if (preg_match('/^\//i', $objMod->picto)) print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule"', 1); - else print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule"'); - } - else - { - print img_object($alttext, 'generic', 'class="valignmiddle"'); - } - print ' '.$objMod->getName().''; - print " | \n"; - - // Desc - print ''; - print nl2br($objMod->getDesc()); - print " | \n"; - - // Help - print ''; - //print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1); - print ''.img_picto($langs->trans("ClickToShowDescription"), $imginfo).''; - print ' | '; - - // Version - print ''; - print $versiontrans; - if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; - if (!empty($objMod->url_last_version)) { - $newversion = getURLContent($objMod->url_last_version); - if (isset($newversion['content'])) { - if (version_compare($newversion['content'], $versiontrans) > 0) { - print " ".$newversion['content'].""; - } - } - } - } - print " | \n"; - - // Activate/Disable and Setup (2 columns) - if (!empty($conf->global->$const_name)) // If module is already activated - { - $disableSetup = 0; - - // Link enable/disabme - print ''; - if (!empty($arrayofwarnings[$modName])) + // Picto + Name of module + print ' | '; + $alttext = ''; + //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version); + //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin); + if (!empty($objMod->picto)) { - print ''."\n"; + if (preg_match('/^\//i', $objMod->picto)) print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule"', 1); + else print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule"'); } - 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"; + else + { + print img_object($alttext, 'generic', 'class="valignmiddle"'); + } + print ' '.$objMod->getName().''; + print "\n"; - // Link config - 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; + // Desc + print ''; + print nl2br($objMod->getDesc()); + print " | \n"; - if (is_array($objMod->config_page_url)) - { - print ''; - $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"').''; - } - } - } - print " | \n"; - } - 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"').' | '; - } - } - 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 = ''; + // Help + print ' | '; + //print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1); + print ''.img_picto($langs->trans("ClickToShowDescription"), $imginfo).''; + print ' | '; + + // Version + print ''; + print $versiontrans; + if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; + if (!empty($objMod->url_last_version)) { + $newversion = getURLContent($objMod->url_last_version); + if (isset($newversion['content'])) { + if (version_compare($newversion['content'], $versiontrans) > 0) { + print " ".$newversion['content'].""; + } + } + } + } + print " | \n"; + + // Activate/Disable and Setup (2 columns) + if (!empty($conf->global->$const_name)) // If module is already activated + { + $disableSetup = 0; + + // Link enable/disabme + print ''; if (!empty($arrayofwarnings[$modName])) + { + print ''."\n"; + } + if (!empty($objMod->disabled)) { - 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); - } - } + print $langs->trans("Disabled"); } - if ($objMod->isCoreOrExternalModule() == 'external' && !empty($arrayofwarningsext)) + elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1))) { - 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(); - } - } - } - } + 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++; } - 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"; + 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 ''.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').' | '; + // Link config + 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; + + if (is_array($objMod->config_page_url)) + { + print ''; + $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"').''; + } + } + } + print " | \n"; + } + 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"').' | '; + } + } + 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"').' | '; + } + + print "