diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index 3d870271977..4d824b3805b 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -112,6 +112,7 @@ $_SESSION["mode"]=$mode;
$help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
llxHeader('',$langs->trans("Setup"),$help_url);
+$arrayofnatures=array('core'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External").' - '.$langs->trans("AllPublishers"));
// Search modules dirs
$modulesdir = dolGetModulesDirs();
@@ -166,26 +167,37 @@ foreach ($modulesdir as $dir)
}
$j = $objMod->numero;
- $modulequalified=true;
+ $modulequalified=1;
// 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)));
- if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=false;
- if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=false;
- if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) $modulequalified=false;
- if ($search_version)
+ if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0;
+ if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0;
+ if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) $modulequalified=0;
+
+ // We discard modules according to property disabled
+ if (! empty($objMod->hidden)) $modulequalified=0;
+
+ if ($modulequalified > 0)
{
- if (($objMod->version == 'development' || $objMod->version == 'experimental' || preg_match('/deprecated/', $objMod->version)) && $search_version == 'stable') $modulequalified=false;
- if ($objMod->version != 'development' && ($search_version == 'development')) $modulequalified=false;
- if ($objMod->version != 'experimental' && ($search_version == 'experimental')) $modulequalified=false;
- if (! preg_match('/deprecated/', $objMod->version) && ($search_version == 'deprecated')) $modulequalified=false;
+ $publisher=dol_escape_htmltag($objMod->getPublisher());
+ $external=($objMod->isCoreOrExternalModule() == 'external');
+ if ($external)
+ {
+ if ($publisher)
+ {
+ $arrayofnatures['external_'.$publisher]=$langs->trans("External").' - '.$publisher;
+ }
+ else
+ {
+ $arrayofnatures['external_']=$langs->trans("External").' - '.$langs->trans("UnknownPublishers");
+ }
+ }
+ ksort($arrayofnatures);
}
- // We discard modules according to property disabled
- if (! empty($objMod->hidden)) $modulequalified=false;
-
// Define array $categ with categ with at least one qualified module
- if ($modulequalified)
+ if ($modulequalified > 0)
{
$modules[$i] = $objMod;
$filename[$i]= $modName;
@@ -313,7 +325,7 @@ if ($mode != 'marketplace')
$moreforfilter.= $langs->trans('Status') . ': '.$form->selectarray('search_status', array('active'=>$langs->transnoentitiesnoconv("Enabled"), 'disabled'=>$langs->transnoentitiesnoconv("Disabled")), $search_status, 1);
$moreforfilter.= '';
$moreforfilter.='
';
- $moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', array('standard'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External")), $search_nature, 1);
+ $moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, $search_nature, 1);
$moreforfilter.= '
';
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
{
@@ -379,6 +391,8 @@ if ($mode != 'marketplace')
$moduledesc=$objMod->getDesc();
$moduledesclong=$objMod->getDescLong();
$moduleauthor=$objMod->getPublisher();
+
+ // We discard showing according to filters
if ($search_keyword)
{
$qualified=0;
@@ -396,8 +410,22 @@ if ($mode != 'marketplace')
}
if ($search_nature)
{
- if ($search_nature == 'external' && $objMod->isCoreOrExternalModule() != 'external') continue;
- if ($search_nature == 'standard' && $objMod->isCoreOrExternalModule() == 'external') continue;
+ if (preg_match('/^external/',$search_nature) && $objMod->isCoreOrExternalModule() != 'external') continue;
+ if (preg_match('/^external_(.*)$/',$search_nature, $reg))
+ {
+ //print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher());
+ $publisher=dol_escape_htmltag($objMod->getPublisher());
+ if ($reg[1] && $reg[1] != $publisher) continue;
+ if (! $reg[1] && ! empty($publisher)) continue;
+ }
+ if ($search_nature == 'core' && $objMod->isCoreOrExternalModule() == 'external') continue;
+ }
+ if ($search_version)
+ {
+ if (($objMod->version == 'development' || $objMod->version == 'experimental' || preg_match('/deprecated/', $objMod->version)) && $search_version == 'stable') continue;
+ if ($objMod->version != 'development' && ($search_version == 'development')) continue;
+ if ($objMod->version != 'experimental' && ($search_version == 'experimental')) continue;
+ if (! preg_match('/deprecated/', $objMod->version) && ($search_version == 'deprecated')) continue;
}
// Load all lang files of module
@@ -415,7 +443,7 @@ if ($mode != 'marketplace')
if ($familykey!=$oldfamily)
{
print ''."\n";
- print '| ';
+ print ' | ';
$familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label'];
print $familytext;
print " | \n";
@@ -463,18 +491,159 @@ if ($mode != 'marketplace')
print nl2br($objMod->getDesc());
print "\n";
+ // Help
+ print '';
+ $text='';
+ if ($objMod->getDescLong()) $text.=$objMod->getDesc().' '.$objMod->getDescLong().' ';
+ else $text.=$objMod->getDesc().' ';
+
+ if ($objMod->isCoreOrExternalModule() == 'external')
+ {
+ $text.=' '.$langs->trans("Origin").': '.$langs->trans("ExternalModule",$dirofmodule);
+ if (! empty($objMod->editor_name) && $objMod->editor_name != 'dolibarr') $text.=' '.$langs->trans("Author").': '.$objMod->editor_name;
+ if (! empty($objMod->editor_url) && $objMod->editor_url != 'www.dolibarr.org') $text.=' '.$langs->trans("Url").': '.$objMod->editor_url;
+ $text.=' ';
+ }
+ else
+ {
+ $text.=' '.$langs->trans("Origin").': '.$langs->trans("Core").' ';
+ }
+ $text.=' '.$langs->trans("AddRemoveTabs").': ';
+ if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs))
+ {
+ $i=0;
+ foreach($objMod->tabs as $val)
+ {
+ $tmp=explode(':',$val,3);
+ $text.=($i?', ':'').$tmp[0].':'.$tmp[1];
+ $i++;
+ }
+ }
+ else $text.=$langs->trans("No");
+
+ $text.=' '.$langs->trans("AddDictionaries").': ';
+ if (isset($objMod->dictionaries) && isset($objMod->dictionaries['tablib']) && is_array($objMod->dictionaries['tablib']) && count($objMod->dictionaries['tablib']))
+ {
+ $i=0;
+ foreach($objMod->dictionaries['tablib'] as $val)
+ {
+ $text.=($i?', ':'').$val;
+ $i++;
+ }
+ }
+ else $text.=$langs->trans("No");
+
+ $text.=' '.$langs->trans("AddBoxes").': ';
+ if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes))
+ {
+ $i=0;
+ foreach($objMod->boxes as $val)
+ {
+ $text.=($i?', ':'').($val['file']?$val['file']:$val[0]);
+ $i++;
+ }
+ }
+ else $text.=$langs->trans("No");
+
+ $text.=' '.$langs->trans("AddModels").': ';
+ if (isset($objMod->module_parts) && isset($objMod->module_parts['models']) && $objMod->module_parts['models'])
+ {
+ $text.=$langs->trans("Yes");
+ }
+ else $text.=$langs->trans("No");
+
+ $text.=' '.$langs->trans("AddSubstitutions").': ';
+ if (isset($objMod->module_parts) && isset($objMod->module_parts['substitutions']) && $objMod->module_parts['substitutions'])
+ {
+ $text.=$langs->trans("Yes");
+ }
+ else $text.=$langs->trans("No");
+
+ $text.=' '.$langs->trans("AddSheduledJobs").': ';
+ if (isset($objMod->cronjobs) && is_array($objMod->cronjobs) && count($objMod->cronjobs))
+ {
+ $i=0;
+ foreach($objMod->cronjobs as $val)
+ {
+ $text.=($i?', ':'').($val['label']);
+ $i++;
+ }
+ }
+ else $text.=$langs->trans("No");
+
+ $text.=' '.$langs->trans("AddTriggers").': ';
+ if (isset($objMod->module_parts) && isset($objMod->module_parts['triggers']) && $objMod->module_parts['triggers'])
+ {
+ $text.=$langs->trans("Yes");
+ }
+ else $text.=$langs->trans("No");
+
+ $text.=' '.$langs->trans("AddHooks").': ';
+ if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks']))
+ {
+ $i=0;
+ foreach($objMod->module_parts['hooks'] as $val)
+ {
+ $text.=($i?', ':'').($val);
+ $i++;
+ }
+ }
+ else $text.=$langs->trans("No");
+
+ $text.=' '.$langs->trans("AddPermissions").': ';
+ if (isset($objMod->rights) && is_array($objMod->rights) && count($objMod->rights))
+ {
+ $i=0;
+ foreach($objMod->rights as $val)
+ {
+ $text.=($i?', ':'').($val[1]);
+ $i++;
+ }
+ }
+ else $text.=$langs->trans("No");
+
+ $text.=' '.$langs->trans("AddMenus").': ';
+ if (isset($objMod->menu) && is_array($objMod->menu) && $objMod->menu)
+ {
+ $text.=$langs->trans("Yes");
+ }
+ else $text.=$langs->trans("No");
+
+ $text.=' '.$langs->trans("AddExportProfiles").': ';
+ if (isset($objMod->export_label) && is_array($objMod->export_label) && count($objMod->export_label))
+ {
+ $i=0;
+ foreach($objMod->export_label as $val)
+ {
+ $text.=($i?', ':'').($val);
+ $i++;
+ }
+ }
+ else $text.=$langs->trans("No");
+
+ $text.=' '.$langs->trans("AddImportProfiles").': ';
+ if (isset($objMod->import_label) && is_array($objMod->import_label) && count($objMod->import_label))
+ {
+ $i=0;
+ foreach($objMod->import_label as $val)
+ {
+ $text.=($i?', ':'').($val);
+ $i++;
+ }
+ }
+ else $text.=$langs->trans("No");
+
+ $text.=' '.$langs->trans("AddOtherPagesOrServices").': ';
+ $text.=$langs->trans("DetectionNotPossible");
+
+ print $form->textwithpicto('', $text, 1, 'help');
+ print ' | ';
+
// Version
print '';
$version=$objMod->getVersion();
$dirofmodule=$dirmod[$key];
- if ($objMod->isCoreOrExternalModule() == 'external')
- {
- $text=$langs->trans("ExternalModule",$dirofmodule);
- if (! empty($objMod->editor_name) && $objMod->editor_name != 'dolibarr') $text.=' - '.$objMod->editor_name;
- if (! empty($objMod->editor_web) && $objMod->editor_web != 'www.dolibarr.org') $text.=' - '.$objMod->editor_web;
- print $form->textwithpicto($version, $text, 1, 'help');
- }
- else print $version;
+ print $version;
print " | \n";
// Activate/Disable and Setup (2 columns)
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index fc9f503ca83..e9139462a9b 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -469,6 +469,8 @@ class DolibarrModules // Can not be abstract, because we need to insta
global $langs;
$langs->load("admin");
+ if (empty($this->descriptionlong)) return '';
+
// If module description translation does not exist using its unique id, we can use its name to find translation
if (is_array($this->langfiles))
{
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 9f3998c6a01..7decc602dbe 100755
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1720,4 +1720,20 @@ ExampleOfNewsMessageForMaintenanceRelease=Dolibarr ERP & CRM %s is available. Ve
MultiPriceRuleDesc=When option "Several level of prices per product/service" is on, you can define different prices (one per price level) for each product. To save you time, you can enter here rule to have price for each level autocalculated according to price of first level, so you will have to enter only price for first level on each product. This page is here to save you time and can be usefull only if your prices for each leve are relative to first level. You can ignore this page in most cases.
ModelModulesProduct=Templates for product documents
ToGenerateCodeDefineAutomaticRuleFirst=To be able to generate automatically codes, you must first define a manager to auto define barcode number.
-SeeSubstitutionVars=See * note for list of possible substitution variables
\ No newline at end of file
+SeeSubstitutionVars=See * note for list of possible substitution variables
+AllPublishers=All publishers
+UnknownPublishers=Unknown publishers
+AddRemoveTabs=Add or remove tabs
+AddDictionaries=Add dictionaries
+AddBoxes=Add boxes
+AddSheduledJobs=Add scheduled jobs
+AddHooks=Add hooks
+AddTriggers=Add triggers
+AddMenus=Add menus
+AddPermissions=Add permissions
+AddExportProfiles=Add export profiles
+AddImportProfiles=Add import profiles
+AddOtherPagesOrServices=Add other pages or services
+AddModels=Add document or numbering templates
+AddSubstitutions=Add keys substitutions
+DetectionNotPossible=Detection not possible