Look and feel v14

This commit is contained in:
Laurent Destailleur 2021-04-06 18:18:07 +02:00
parent a16f70ca09
commit 38f3693fc7
5 changed files with 52 additions and 42 deletions

View File

@ -1549,7 +1549,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
if ($picto) { if ($picto) {
$out .= img_picto($title, ($pictoisfullpath ? '' : 'object_').$picto, '', $pictoisfullpath, 0, 0, '', 'imgTabTitle').' '; $out .= img_picto($title, ($pictoisfullpath ? '' : 'object_').$picto, '', $pictoisfullpath, 0, 0, '', 'imgTabTitle').' ';
} }
$out .= '<span class="tabTitleText">'.dol_trunc($title, $limittitle).'</span>'; $out .= '<span class="tabTitleText">'.dol_escape_htmltag(dol_trunc($title, $limittitle)).'</span>';
$out .= '</a>'; $out .= '</a>';
} }
@ -1594,7 +1594,9 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
} }
if ($i < $limittoshow || $isactive) { if ($i < $limittoshow || $isactive) {
// Add a new entry
$out .= '<div class="inline-block tabsElem'.($isactive ? ' tabsElemActive' : '').((!$isactive && !empty($conf->global->MAIN_HIDE_INACTIVETAB_ON_PRINT)) ? ' hideonprint' : '').'"><!-- id tab = '.(empty($links[$i][2]) ? '' : $links[$i][2]).' -->'; $out .= '<div class="inline-block tabsElem'.($isactive ? ' tabsElemActive' : '').((!$isactive && !empty($conf->global->MAIN_HIDE_INACTIVETAB_ON_PRINT)) ? ' hideonprint' : '').'"><!-- id tab = '.(empty($links[$i][2]) ? '' : $links[$i][2]).' -->';
if (isset($links[$i][2]) && $links[$i][2] == 'image') { if (isset($links[$i][2]) && $links[$i][2] == 'image') {
if (!empty($links[$i][0])) { if (!empty($links[$i][0])) {
$out .= '<a class="tabimage'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; $out .= '<a class="tabimage'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
@ -1603,16 +1605,18 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
} }
} elseif (!empty($links[$i][1])) { } elseif (!empty($links[$i][1])) {
//print "x $i $active ".$links[$i][2]." z"; //print "x $i $active ".$links[$i][2]." z";
if ($isactive) { $out .= '<div class="tab tab'.($isactive?'active':'unactive').'" style="margin: 0 !important">';
$out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tabactive tab inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'; if (!empty($links[$i][0])) {
$out .= $links[$i][1]; $out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tab inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">';
$out .= '</a>'."\n"; }
} else { $out .= $links[$i][1];
$out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tabunactive tab inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'; if (!empty($links[$i][0])) {
$out .= $links[$i][1];
$out .= '</a>'."\n"; $out .= '</a>'."\n";
} }
$out .= empty($links[$i][4]) ? '' : $links[$i][4];
$out .= '</div>';
} }
$out .= '</div>'; $out .= '</div>';
} else { } else {
// The popup with the other tabs // The popup with the other tabs

View File

@ -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. IncludeDocGenerationHelp=If you check this, some code will be generated to add a "Generate document" box on the record.
ShowOnCombobox=Show value into combobox ShowOnCombobox=Show value into combobox
KeyForTooltip=Key for tooltip 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 NotEditable=Not editable
ForeignKey=Foreign key ForeignKey=Foreign key
TypeOfFieldsHelp=Type of fields:<br>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) TypeOfFieldsHelp=Type of fields:<br>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)

View File

@ -746,7 +746,7 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray',
* 'position' is the sort order of field. * '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. * '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). * '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 * '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. * '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 * '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++; $h++;
$linktoenabledisable = ''; $linktoenabledisable = '';
$modulestatusinfo = '';
if (is_array($listofmodules) && count($listofmodules) > 0) { if (is_array($listofmodules) && count($listofmodules) > 0) {
// Define $linktoenabledisable and $modulestatusinfo // Define $linktoenabledisable
$modulelowercase = strtolower($module); $modulelowercase = strtolower($module);
$const_name = 'MAIN_MODULE_'.strtoupper($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 .= img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', '', 1);
$linktoenabledisable .= '</a>'; $linktoenabledisable .= '</a>';
$linktoenabledisable .= $form->textwithpicto('', $langs->trans("Warning").' : '.$langs->trans("ModuleIsLive"), -1, 'warning');
$objMod = $moduleobj; $objMod = $moduleobj;
$backtourlparam = ''; $backtourlparam = '';
$backtourlparam .= ($backtourlparam ? '&' : '?').'module='.$module; // No urlencode here, done later $backtourlparam .= ($backtourlparam ? '&' : '?').'module='.$module; // No urlencode here, done later
@ -1751,38 +1752,33 @@ if (is_array($listofmodules) && count($listofmodules) > 0) {
} else { } else {
if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) { if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) {
$urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1); $urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1);
$linktoenabledisable .= ' &nbsp; <a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>'; $linktoenabledisable .= ' <a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"').'</a>';
} else { } else {
// Case standard admin page (not a page provided by the // Case standard admin page (not a page provided by the
// module but a page provided by dolibarr) // module but a page provided by dolibarr)
$urltouse = DOL_URL_ROOT.'/admin/'.$urlpage; $urltouse = DOL_URL_ROOT.'/admin/'.$urlpage;
$linktoenabledisable .= ' &nbsp; <a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>'; $linktoenabledisable .= ' <a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"').'</a>';
} }
} }
} }
} elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs)) { } elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs)) {
$linktoenabledisable .= ' &nbsp; <a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>'; $linktoenabledisable .= ' &nbsp; <a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"').'</a>';
} }
} else { } else {
$linktoenabledisable .= '<a class="reposition asetresetmodule valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$moduleobj->numero.'&action=set&token='.newToken().'&value=mod'.$module.$param.'">'; $linktoenabledisable .= '<a class="reposition asetresetmodule valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$moduleobj->numero.'&action=set&token='.newToken().'&value=mod'.$module.$param.'">';
$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 .= "</a>\n"; $linktoenabledisable .= "</a>\n";
} }
if (!empty($conf->$modulelowercase->enabled)) {
$modulestatusinfo = $form->textwithpicto('', $langs->trans("Warning").' : '.$langs->trans("ModuleIsLive"), -1, 'warning');
}
// Loop to show tab of each module // Loop to show tab of each module
foreach ($listofmodules as $tmpmodule => $tmpmodulearray) { foreach ($listofmodules as $tmpmodule => $tmpmodulearray) {
$head[$h][0] = $_SERVER["PHP_SELF"].'?module='.$tmpmodulearray['modulenamewithcase'].($forceddirread ? '@'.$dirread : ''); $head[$h][0] = $_SERVER["PHP_SELF"].'?module='.$tmpmodulearray['modulenamewithcase'].($forceddirread ? '@'.$dirread : '');
$head[$h][1] = $tmpmodulearray['modulenamewithcase']; $head[$h][1] = $tmpmodulearray['modulenamewithcase'];
$head[$h][2] = $tmpmodulearray['modulenamewithcase']; $head[$h][2] = $tmpmodulearray['modulenamewithcase'];
/*if ($tmpmodule == $modulelowercase) { if ($tmpmodulearray['modulenamewithcase'] == $module) {
$head[$h][1] .= ' '.$modulestatusinfo; $head[$h][4] = '<span class="inline-block">'.$linktoenabledisable.'</span>';
$head[$h][1] .= ' '.$linktoenabledisable; }
}*/
$h++; $h++;
} }
@ -1793,6 +1789,7 @@ $head[$h][1] = $langs->trans("DangerZone");
$head[$h][2] = 'deletemodule'; $head[$h][2] = 'deletemodule';
$h++; $h++;
print dol_get_fiche_head($head, $module, '', -1, '', 0, $infomodulesfound, '', 8); // Modules print dol_get_fiche_head($head, $module, '', -1, '', 0, $infomodulesfound, '', 8); // Modules
if ($module == 'initmodule') { if ($module == 'initmodule') {
@ -1830,6 +1827,11 @@ if ($module == 'initmodule') {
$head2 = array(); $head2 = array();
$h = 0; $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][0] = $_SERVER["PHP_SELF"].'?tab=description&module='.$module.($forceddirread ? '@'.$dirread : '');
$head2[$h][1] = $langs->trans("Description"); $head2[$h][1] = $langs->trans("Description");
$head2[$h][2] = 'description'; $head2[$h][2] = 'description';
@ -1905,10 +1907,6 @@ if ($module == 'initmodule') {
$head2[$h][2] = 'buildpackage'; $head2[$h][2] = 'buildpackage';
$h++; $h++;
// Link to enable / disable
print '<div class="center">'.$modulestatusinfo;
print ' '.$linktoenabledisable.'</div>';
print '<br>'; print '<br>';
// Note module is inside $dirread // Note module is inside $dirread
@ -2608,6 +2606,7 @@ if ($module == 'initmodule') {
print '<th class="center">'.$form->textwithpicto($langs->trans("IsAMeasure"), $langs->trans("IsAMeasureDesc")).'</th>'; print '<th class="center">'.$form->textwithpicto($langs->trans("IsAMeasure"), $langs->trans("IsAMeasureDesc")).'</th>';
print '<th class="center">'.$langs->trans("CSSClass").'</th>'; print '<th class="center">'.$langs->trans("CSSClass").'</th>';
print '<th class="center">'.$langs->trans("CSSViewClass").'</th>'; print '<th class="center">'.$langs->trans("CSSViewClass").'</th>';
print '<th class="center">'.$langs->trans("CSSListClass").'</th>';
print '<th class="center">'.$langs->trans("KeyForTooltip").'</th>'; print '<th class="center">'.$langs->trans("KeyForTooltip").'</th>';
print '<th class="center">'.$langs->trans("ShowOnCombobox").'</th>'; print '<th class="center">'.$langs->trans("ShowOnCombobox").'</th>';
//print '<th class="center">'.$langs->trans("Disabled").'</th>'; //print '<th class="center">'.$langs->trans("Disabled").'</th>';
@ -2639,6 +2638,7 @@ if ($module == 'initmodule') {
print '<td class="center"><input class="text" size="2" name="propisameasure" value="'.dol_escape_htmltag(GETPOST('propisameasure', 'alpha')).'"></td>'; print '<td class="center"><input class="text" size="2" name="propisameasure" value="'.dol_escape_htmltag(GETPOST('propisameasure', 'alpha')).'"></td>';
print '<td class="center"><input class="text" size="2" name="propcss" value="'.dol_escape_htmltag(GETPOST('propcss', 'alpha')).'"></td>'; print '<td class="center"><input class="text" size="2" name="propcss" value="'.dol_escape_htmltag(GETPOST('propcss', 'alpha')).'"></td>';
print '<td class="center"><input class="text" size="2" name="propcssview" value="'.dol_escape_htmltag(GETPOST('propcssview', 'alpha')).'"></td>'; print '<td class="center"><input class="text" size="2" name="propcssview" value="'.dol_escape_htmltag(GETPOST('propcssview', 'alpha')).'"></td>';
print '<td class="center"><input class="text" size="2" name="propcsslist" value="'.dol_escape_htmltag(GETPOST('propcsslist', 'alpha')).'"></td>';
print '<td class="center"><input class="text" size="2" name="prophelp" value="'.dol_escape_htmltag(GETPOST('prophelp', 'alpha')).'"></td>'; print '<td class="center"><input class="text" size="2" name="prophelp" value="'.dol_escape_htmltag(GETPOST('prophelp', 'alpha')).'"></td>';
print '<td class="center"><input class="text" size="2" name="propshowoncombobox" value="'.dol_escape_htmltag(GETPOST('propshowoncombobox', 'alpha')).'"></td>'; print '<td class="center"><input class="text" size="2" name="propshowoncombobox" value="'.dol_escape_htmltag(GETPOST('propshowoncombobox', 'alpha')).'"></td>';
//print '<td class="center"><input class="text" size="2" name="propdisabled" value="'.dol_escape_htmltag(GETPOST('propdisabled', 'alpha')).'"></td>'; //print '<td class="center"><input class="text" size="2" name="propdisabled" value="'.dol_escape_htmltag(GETPOST('propdisabled', 'alpha')).'"></td>';
@ -2679,6 +2679,7 @@ if ($module == 'initmodule') {
$propisameasure = $propval['isameasure']; $propisameasure = $propval['isameasure'];
$propcss = $propval['css']; $propcss = $propval['css'];
$propcssview = $propval['cssview']; $propcssview = $propval['cssview'];
$propcsslist = $propval['csslist'];
$prophelp = $propval['help']; $prophelp = $propval['help'];
$propshowoncombobox = $propval['showoncombobox']; $propshowoncombobox = $propval['showoncombobox'];
//$propdisabled=$propval['disabled']; //$propdisabled=$propval['disabled'];
@ -2738,6 +2739,9 @@ if ($module == 'initmodule') {
print '<td class="center">'; print '<td class="center">';
print $propcssview ? dol_escape_htmltag($propcssview) : ''; print $propcssview ? dol_escape_htmltag($propcssview) : '';
print '</td>'; print '</td>';
print '<td class="center">';
print $propcsslist ? dol_escape_htmltag($propcsslist) : '';
print '</td>';
print '<td class="tdoverflowmax200">'; print '<td class="tdoverflowmax200">';
print $prophelp ? dol_escape_htmltag($prophelp) : ''; print $prophelp ? dol_escape_htmltag($prophelp) : '';
print '</td>'; print '</td>';

View File

@ -3092,16 +3092,9 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active {
text-decoration: none; text-decoration: none;
white-space: nowrap; 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; background-image: none !important;
} }
.tabactive, a.tab#active { .tabactive, a.tab#active {
color: var(--colortextbacktab); !important; color: var(--colortextbacktab); !important;
background: var(--colorbacktabcard1) !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-left: 1px solid #CCC !important;
border-top: 3px solid var(--colorbackhmenu1) !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 a.tab:hover
{ {
/* /*

View File

@ -3111,12 +3111,6 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active {
background-image: none !important; 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(<?php echo $colorbackbody; ?>);
border-left: 1px solid rgb(<?php echo $colorbackbody; ?>);
}
.tabactive, a.tab#active { .tabactive, a.tab#active {
color: #<?php echo $colortextbacktab; ?> !important; color: #<?php echo $colortextbacktab; ?> !important;
background: rgb(<?php echo $colorbacktabcard1; ?>) !important; background: rgb(<?php echo $colorbacktabcard1; ?>) !important;
@ -3125,6 +3119,13 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active {
border-left: 1px solid #AAA !important; border-left: 1px solid #AAA !important;
border-top: 2px solid #111 !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 a.tab:hover
{ {
/* /*