diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index dedf6b55677..24dc394d0f8 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -361,13 +361,17 @@ llxHeader('', $langs->trans("Setup"), $help_url, '', '', '', $morejs, $morecss, // Search modules dirs $modulesdir = dolGetModulesDirs(); -$arrayofnatures = array('core' => $langs->transnoentitiesnoconv("NativeModules"), 'external' => $langs->transnoentitiesnoconv("External").' - ['.$langs->trans("AllPublishers").']'); +$arrayofnatures = array( + 'core' => array('label' => $langs->transnoentitiesnoconv("NativeModules")), + 'external' => array('label' => $langs->transnoentitiesnoconv("External").' - ['.$langs->trans("AllPublishers").']') +); $arrayofwarnings = array(); // Array of warning each module want to show when activated $arrayofwarningsext = array(); // Array of warning each module want to show when we activate an external module $filename = array(); $modules = array(); $orders = array(); $categ = array(); +$publisherlogoarray = array(); $i = 0; // is a sequencer of modules found $j = 0; // j is module number. Automatically affected if module number not defined. @@ -427,9 +431,16 @@ foreach ($modulesdir as $dir) { $external = ($objMod->isCoreOrExternalModule() == 'external'); if ($external) { if ($publisher) { - $arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher; + // Check if there is a logo forpublisher + /* Do not show the company logo in combo. Make combo list dirty. + if (!empty($objMod->editor_squarred_logo)) { + $publisherlogoarray['external_'.$publisher] = img_picto('', $objMod->editor_squarred_logo, 'class="publisherlogoinline"'); + } + $publisherlogo = empty($publisherlogoarray['external_'.$publisher]) ? '' : $publisherlogoarray['external_'.$publisher]; + */ + $arrayofnatures['external_'.$publisher] = array('label' => $langs->trans("External").' - '.$publisher, 'data-html' => $langs->trans("External").' - '.$publisher.''); } else { - $arrayofnatures['external_'] = $langs->trans("External").' - '.$langs->trans("UnknownPublishers"); + $arrayofnatures['external_'] = array('label' => $langs->trans("External").' - ['.$langs->trans("UnknownPublishers").']'); } } ksort($arrayofnatures); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 801cbe72869..a7589be4860 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -38,30 +38,33 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it into unActivateModule to be able to disable a module whose files were removed. { /** - * @var DoliDB Database handler + * @var DoliDB Database handler */ public $db; /** - * @var int Module unique ID + * @var int Module unique ID * @see https://wiki.dolibarr.org/index.php/List_of_modules_id */ public $numero; /** - * @var string Publisher name - * @since 4.0.0 + * @var string Publisher name */ public $editor_name; /** - * @var string URL of module at publisher site - * @since 4.0.0 + * @var string URL of module at publisher site */ public $editor_url; /** - * @var string Family + * @var string URL of logo of the publisher. Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@mymodule'. + */ + public $editor_squarred_logo; + + /** + * @var string Family * @see $familyinfo * * Native values: 'crm', 'financial', 'hr', 'projects', 'products', 'ecm', 'technic', 'other'. @@ -84,12 +87,12 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it public $familyinfo; /** - * @var string Module position on 2 digits + * @var string Module position on 2 digits */ public $module_position = '50'; /** - * @var string Module name + * @var string Module name * * Only used if Module[ID]Name translation string is not found. * diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index c288ca7f3d9..7d0f0941b0b 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -42,6 +42,7 @@ class modMyModule extends DolibarrModules public function __construct($db) { global $langs, $conf; + $this->db = $db; // Id for module (must be unique). @@ -70,7 +71,8 @@ class modMyModule extends DolibarrModules // Author $this->editor_name = 'Editor name'; - $this->editor_url = 'https://www.example.com'; + $this->editor_url = 'https://www.example.com'; // Must be an external online web site + $this->editor_squarred_logo = ''; // Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@mymodule' // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z' $this->version = '1.0'; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 215a2ed46a8..6358bc69e3a 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1095,6 +1095,12 @@ i.fa-mars::before, i.fa-venus::before, i.fa-genderless::before, i.fa-transgender .stockmovement { font-size: 1.4em; } +.publisherlogoinline { + vertical-align: middle; + height: 14px; + width: 14px; + margin-left: 5px; +} body[class*="colorblind-"] .text-warning{ color : diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 4bd932b6700..5f15a6cc082 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1273,6 +1273,12 @@ i.fa-mars::before, i.fa-venus::before, i.fa-genderless::before, i.fa-transgender .stockmovement { font-size: 1.4em; } +.publisherlogoinline { + vertical-align: middle; + height: 14px; + width: 14px; + margin-left: 5px; +} .text-warning{ color :