From 38f3693fc737ffb9e0f0148bb9e3db228408f3f2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Apr 2021 18:18:07 +0200 Subject: [PATCH] Look and feel v14 --- htdocs/core/lib/functions.lib.php | 20 ++++++++----- htdocs/langs/en_US/modulebuilder.lang | 4 ++- htdocs/modulebuilder/index.php | 42 +++++++++++++++------------ htdocs/theme/eldy/global.inc.php | 15 +++++----- htdocs/theme/md/style.css.php | 13 +++++---- 5 files changed, 52 insertions(+), 42 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3cca19ba0ff..ef33147bb37 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1549,7 +1549,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab if ($picto) { $out .= img_picto($title, ($pictoisfullpath ? '' : 'object_').$picto, '', $pictoisfullpath, 0, 0, '', 'imgTabTitle').' '; } - $out .= ''.dol_trunc($title, $limittitle).''; + $out .= ''.dol_escape_htmltag(dol_trunc($title, $limittitle)).''; $out .= ''; } @@ -1594,7 +1594,9 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab } if ($i < $limittoshow || $isactive) { + // Add a new entry $out .= '
'; + if (isset($links[$i][2]) && $links[$i][2] == 'image') { if (!empty($links[$i][0])) { $out .= ''.$links[$i][1].''."\n"; @@ -1603,16 +1605,18 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab } } elseif (!empty($links[$i][1])) { //print "x $i $active ".$links[$i][2]." z"; - if ($isactive) { - $out .= ''; - $out .= $links[$i][1]; - $out .= ''."\n"; - } else { - $out .= ''; - $out .= $links[$i][1]; + $out .= '
'; + if (!empty($links[$i][0])) { + $out .= ''; + } + $out .= $links[$i][1]; + if (!empty($links[$i][0])) { $out .= ''."\n"; } + $out .= empty($links[$i][4]) ? '' : $links[$i][4]; + $out .= '
'; } + $out .= '
'; } else { // The popup with the other tabs diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 845dd12624d..19afb9d95ab 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -133,7 +133,9 @@ IncludeDocGeneration=I want to generate some documents from the object IncludeDocGenerationHelp=If you check this, some code will be generated to add a "Generate document" box on the record. ShowOnCombobox=Show value into combobox KeyForTooltip=Key for tooltip -CSSClass=CSS Class +CSSClass=CSS for edit/create form +CSSViewClass=CSS for read form +CSSListClass=CSS for list NotEditable=Not editable ForeignKey=Foreign key TypeOfFieldsHelp=Type of fields:
varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]] ('1' means we add a + button after the combo to create the record, 'filter' can be 'status=1 AND fk_user = __USER_ID AND entity IN (__SHARED_ENTITIES__)' for example) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 101aa6db09c..65775a0bb36 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -746,7 +746,7 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray', * 'position' is the sort order of field. * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). - * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200' * 'help' is a string visible as a tooltip on field * 'comment' is not used. You can store here any text of your choice. It is not used by application. * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record @@ -1708,10 +1708,9 @@ $head[$h][2] = 'initmodule'; $h++; $linktoenabledisable = ''; -$modulestatusinfo = ''; if (is_array($listofmodules) && count($listofmodules) > 0) { - // Define $linktoenabledisable and $modulestatusinfo + // Define $linktoenabledisable $modulelowercase = strtolower($module); $const_name = 'MAIN_MODULE_'.strtoupper($module); @@ -1732,6 +1731,8 @@ if (is_array($listofmodules) && count($listofmodules) > 0) { $linktoenabledisable .= img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', '', 1); $linktoenabledisable .= ''; + $linktoenabledisable .= $form->textwithpicto('', $langs->trans("Warning").' : '.$langs->trans("ModuleIsLive"), -1, 'warning'); + $objMod = $moduleobj; $backtourlparam = ''; $backtourlparam .= ($backtourlparam ? '&' : '?').'module='.$module; // No urlencode here, done later @@ -1751,38 +1752,33 @@ if (is_array($listofmodules) && count($listofmodules) > 0) { } else { if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) { $urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1); - $linktoenabledisable .= '   '.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''; + $linktoenabledisable .= ' '.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"').''; } else { // Case standard admin page (not a page provided by the // module but a page provided by dolibarr) $urltouse = DOL_URL_ROOT.'/admin/'.$urlpage; - $linktoenabledisable .= '   '.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''; + $linktoenabledisable .= ' '.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"').''; } } } } elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs)) { - $linktoenabledisable .= '   '.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''; + $linktoenabledisable .= '   '.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"').''; } } else { $linktoenabledisable .= ''; - $linktoenabledisable .= img_picto($langs->trans("ModuleIsNotActive", $urltomodulesetup), 'switch_off', '', false, 0, 0, '', 'classfortooltip', 1); + $linktoenabledisable .= img_picto($langs->trans("ModuleIsNotActive", $urltomodulesetup), 'switch_off', 'style="padding-right: 8px"', false, 0, 0, '', 'classfortooltip', 1); $linktoenabledisable .= "\n"; } - if (!empty($conf->$modulelowercase->enabled)) { - $modulestatusinfo = $form->textwithpicto('', $langs->trans("Warning").' : '.$langs->trans("ModuleIsLive"), -1, 'warning'); - } - // Loop to show tab of each module foreach ($listofmodules as $tmpmodule => $tmpmodulearray) { $head[$h][0] = $_SERVER["PHP_SELF"].'?module='.$tmpmodulearray['modulenamewithcase'].($forceddirread ? '@'.$dirread : ''); $head[$h][1] = $tmpmodulearray['modulenamewithcase']; $head[$h][2] = $tmpmodulearray['modulenamewithcase']; - /*if ($tmpmodule == $modulelowercase) { - $head[$h][1] .= ' '.$modulestatusinfo; - $head[$h][1] .= ' '.$linktoenabledisable; - }*/ + if ($tmpmodulearray['modulenamewithcase'] == $module) { + $head[$h][4] = ''.$linktoenabledisable.''; + } $h++; } @@ -1793,6 +1789,7 @@ $head[$h][1] = $langs->trans("DangerZone"); $head[$h][2] = 'deletemodule'; $h++; + print dol_get_fiche_head($head, $module, '', -1, '', 0, $infomodulesfound, '', 8); // Modules if ($module == 'initmodule') { @@ -1830,6 +1827,11 @@ if ($module == 'initmodule') { $head2 = array(); $h = 0; + $head2[$h][0] = ''; + $head2[$h][1] = $morehtmlleft; + $head2[$h][2] = ''; + $h++; + $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=description&module='.$module.($forceddirread ? '@'.$dirread : ''); $head2[$h][1] = $langs->trans("Description"); $head2[$h][2] = 'description'; @@ -1905,10 +1907,6 @@ if ($module == 'initmodule') { $head2[$h][2] = 'buildpackage'; $h++; - // Link to enable / disable - print '
'.$modulestatusinfo; - print ' '.$linktoenabledisable.'
'; - print '
'; // Note module is inside $dirread @@ -2608,6 +2606,7 @@ if ($module == 'initmodule') { print ''.$form->textwithpicto($langs->trans("IsAMeasure"), $langs->trans("IsAMeasureDesc")).''; print ''.$langs->trans("CSSClass").''; print ''.$langs->trans("CSSViewClass").''; + print ''.$langs->trans("CSSListClass").''; print ''.$langs->trans("KeyForTooltip").''; print ''.$langs->trans("ShowOnCombobox").''; //print ''.$langs->trans("Disabled").''; @@ -2639,6 +2638,7 @@ if ($module == 'initmodule') { print ''; print ''; print ''; + print ''; print ''; print ''; //print ''; @@ -2679,6 +2679,7 @@ if ($module == 'initmodule') { $propisameasure = $propval['isameasure']; $propcss = $propval['css']; $propcssview = $propval['cssview']; + $propcsslist = $propval['csslist']; $prophelp = $propval['help']; $propshowoncombobox = $propval['showoncombobox']; //$propdisabled=$propval['disabled']; @@ -2738,6 +2739,9 @@ if ($module == 'initmodule') { print ''; print $propcssview ? dol_escape_htmltag($propcssview) : ''; print ''; + print ''; + print $propcsslist ? dol_escape_htmltag($propcsslist) : ''; + print ''; print ''; print $prophelp ? dol_escape_htmltag($prophelp) : ''; print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 5500de16650..23f694bec2c 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3092,16 +3092,9 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { text-decoration: none; white-space: nowrap; - /*border-right: 1px solid #ddd; - border-left: 1px solid #ddd; - border-top: 1px solid #ddd; */ - border-right: 1px solid transparent; - border-left: 1px solid transparent; - border-top: 1px solid transparent; - border-bottom: 0px !important; - background-image: none !important; } + .tabactive, a.tab#active { color: var(--colortextbacktab); !important; background: var(--colorbacktabcard1) !important; @@ -3111,6 +3104,12 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { border-left: 1px solid #CCC !important; border-top: 3px solid var(--colorbackhmenu1) !important; } +.tabunactive, a.tab#unactive { + border-right: 1px solid transparent; + border-left: 1px solid transparent; + border-top: 1px solid transparent; + border-bottom: 0px !important;*/ +} a.tab:hover { /* diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index d90bde8597a..6dfb95b0911 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3111,12 +3111,6 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { background-image: none !important; } - -.tabunactive { /* We add some border on tabunactive to avoid change of position of title when switching tabs (border of tabunactive = border of tabactive) */ - border-right: 1px solid rgb(); - border-left: 1px solid rgb(); -} - .tabactive, a.tab#active { color: # !important; background: rgb() !important; @@ -3125,6 +3119,13 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { border-left: 1px solid #AAA !important; border-top: 2px solid #111 !important; } +.tabunactive, a.tab#unactive { + border-right: 1px solid transparent; + border-left: 1px solid transparent; + border-top: 1px solid transparent; + border-bottom: 0px !important;*/ +} + a.tab:hover { /*