diff --git a/htdocs/modulebuilder/template/class/actions_mymodule.class.php b/htdocs/modulebuilder/template/class/actions_mymodule.class.php index 8559411a3d4..24be0243b8d 100644 --- a/htdocs/modulebuilder/template/class/actions_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/actions_mymodule.class.php @@ -303,5 +303,56 @@ class ActionsMyModule return 0; } + /** + * Execute action completeTabsHead + * + * @param array $parameters Array of parameters + * @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) + * @param string $action 'add', 'update', 'view' + * @param Hookmanager $hookmanager hookmanager + * @return int <0 if KO, + * =0 if OK but we want to process standard actions too, + * >0 if OK and we want to replace standard actions. + */ + public function completeTabsHead(&$parameters, &$object, &$action, $hookmanager) + { + global $langs, $conf, $user; + + if (!isset($parameters['object']->element)) { + return 0; + } + if ($parameters['mode'] == 'remove') { + // utilisé si on veut faire disparaitre des onglets. + return 0; + } elseif ($parameters['mode'] == 'add') { + $langs->load('mymodule@mymodule'); + // utilisé si on veut ajouter des onglets. + $counter = count($parameters['head']); + $element = $parameters['object']->element; + $id = $parameters['object']->id; + // verifier le type d'onglet comme member_stats où ça ne doit pas apparaitre + // if (in_array($element, ['societe', 'member', 'contrat', 'fichinter', 'project', 'propal', 'commande', 'facture', 'order_supplier', 'invoice_supplier'])) { + if (in_array($element, ['context1', 'context2'])) { + $datacount = 0; + + $parameters['head'][$counter][0] = dol_buildpath('/mymodule/mymodule_tab.php', 1) . '?id=' . $id . '&module='.$element; + $parameters['head'][$counter][1] = $langs->trans('MyModuleTab'); + if ($datacount > 0) { + $parameters['head'][$counter][1] .= '' . $datacount . ''; + } + $parameters['head'][$counter][2] = 'mymoduleemails'; + $counter++; + } + if ($counter > 0 && (int) DOL_VERSION < 14) { + $this->results = $parameters['head']; + // return 1 to replace standard code + return 1; + } else { + // en V14 et + $parameters['head'] est modifiable par référence + return 0; + } + } + } + /* Add here any other hooked methods... */ } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 912cf21a1de..3518518a5ef 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -6767,9 +6767,9 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before /* ============================================================================== */ span.clipboardCPValue.hidewithsize { - width: 0 !important; - display: inline-block; - color: transparent; + width: 0 !important; + display: inline-block; + color: transparent; } .clipboardCPShowOnHover .clipboardCPButton { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 8152e56e945..4a6c3899d93 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -6611,9 +6611,9 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before /* ============================================================================== */ span.clipboardCPValue.hidewithsize { - width: 0 !important; - display: inline-block; - color: transparent; + width: 0 !important; + display: inline-block; + color: transparent; } .clipboardCPShowOnHover .clipboardCPButton {