From ec83f18944e2e216d06a356d5250149d3c799cb7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Mar 2020 13:38:25 +0100 Subject: [PATCH] Move more icon definition into CSS --- htdocs/admin/company.php | 64 ++++++++----------- htdocs/core/class/stats.class.php | 2 +- htdocs/core/lib/functions.lib.php | 19 +----- htdocs/core/lib/project.lib.php | 2 +- htdocs/cron/list.php | 12 ++-- htdocs/salaries/class/salariesstats.class.php | 1 + htdocs/societe/card.php | 16 ++--- htdocs/theme/eldy/global.inc.php | 8 +++ htdocs/theme/eldy/main_menu_fa_icons.inc.php | 23 +++++++ 9 files changed, 77 insertions(+), 70 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index b5ec2969f39..7707e5971f4 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -451,27 +451,33 @@ print ''."\n"; // Phone print ''; +print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright'); print ''; print ''."\n"; // Fax print ''; +print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright'); print ''; print ''."\n"; // Email print ''; +print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright'); print ''; print ''."\n"; // Web print ''; +print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright'); print ''; print ''."\n"; // Barcode if (!empty($conf->barcode->enabled)) { - print ''; + print ''; + print ''; + print ''; print ''; print ''; } @@ -480,15 +486,16 @@ if (!empty($conf->barcode->enabled)) { print ''; print '
'; print ''; -print '
'; +print '
'; if (!empty($mysoc->logo_mini)) { - print ''.img_delete($langs->trans("Delete")).''; if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { - print '
'; + print '
'; print ''; + print '
'; } + print ''; } else { - print ''; + print ''; } print '
'; print ''; @@ -497,15 +504,16 @@ print ''; print ''; print '
'; print ''; -print '
'; +print '
'; if (!empty($mysoc->logo_squarred_mini)) { - print ''.img_delete($langs->trans("Delete")).''; if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) { - print '
'; + print '
'; print ''; + print '
'; } + print ''; } else { - print ''; + print ''; } print '
'; print ''; @@ -524,35 +532,15 @@ print ''; print ''.$langs->trans("SocialNetworksInformation").''.$langs->trans("Value").''; print "\n"; -// Facebook -print ''; -print ''; -print ''."\n"; - -// Twitter -print ''; -print ''; -print ''."\n"; - -// LinkedIn -print ''; -print ''; -print ''."\n"; - -// Instagram -print ''; -print ''; -print ''."\n"; - -// Youtube -print ''; -print ''; -print ''."\n"; - -// Github -print ''; -print ''; -print ''."\n"; +$listofnetworks = array('facebook'=>'facebook', 'twitter'=>'twitter', 'linkedin'=>'linkedin', 'instagram'=>'instagram', 'youtube'=>'youtube', 'github'=>'github'); +foreach($listofnetworks as $networkkey => $networkicon) { + print ''; + print ''; + $networkconst = 'MAIN_INFO_SOCIETE_'.strtoupper($networkkey).'_URL'; + print ''; + print ''; + print ''."\n"; +} print ""; diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 26de63f10cc..9620612cb2e 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -198,7 +198,7 @@ abstract class Stats // $data = array('xval'=>array(0=>xlabel,1=>yval1,2=>yval2...),...) for ($i = 0; $i < 12; $i++) { - $data[$i][] = $datay[$endyear][($i + $sm) % 12]['label']; // set label + $data[$i][] = isset($datay[$endyear][($i + $sm) % 12]['label']) ? $datay[$endyear][($i + $sm) % 12]['label'] : $datay[$endyear][($i + $sm) % 12][0]; // set label $year = $startyear; while ($year <= $endyear) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 09c7c3f420e..2fcb814eccc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3131,6 +3131,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'address', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h', 'filter', 'file-code', 'grip', 'grip_title', 'language', 'list', 'listlight', 'note', + 'object_phoning', 'object_phoning_fax', 'object_email', 'object_bookmark', 'object_list', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', @@ -3153,7 +3154,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'address'=> 'address-book', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', - 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'generic'=>'folder-open', + 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'generic'=>'folder-open', 'globe'=>'external-link-alt', + 'object_phoning'=>'phone', 'object_phoning_fax'=>'fax', 'object_email'=>'at', 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'object_bookmark'=>'star', 'bookmark'=>'star', 'stats' => 'chart-bar', 'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-branch', 'object_list'=>'list-alt', 'object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table', @@ -3193,10 +3195,6 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; $facolor = '#444'; } - elseif ($pictowithouttext == 'delete') { - $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; - $facolor = '#444'; - } elseif ($pictowithouttext == 'edit') { $facolor = '#444'; $fakey = 'fa-pencil-alt'; @@ -3238,18 +3236,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = 'fa-sign-out-alt'; $marginleftonlyshort = 0; } - elseif ($pictowithouttext == 'unlink') { - $fakey = 'fa-unlink'; - $facolor = '#555'; - } elseif ($pictowithouttext == 'playdisabled') { $fakey = 'fa-play'; $facolor = '#ccc'; } - elseif ($pictowithouttext == 'play') { - $fakey = 'fa-play'; - $facolor = '#444'; - } elseif ($pictowithouttext == 'jabber') { $fakey = 'fa-comment-o'; } @@ -3261,12 +3251,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ elseif (!empty($arrayconvpictotofa[$pictowithouttext])) { $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; - //$facolor = '#444'; $marginleftonlyshort = 0; } else { $fakey = 'fa-'.$pictowithouttext; - //$facolor = '#444'; $marginleftonlyshort = 0; } @@ -3538,7 +3526,6 @@ function img_delete($titlealt = 'default', $other = 'class="pictodelete"') if ($titlealt == 'default') $titlealt = $langs->trans('Delete'); return img_picto($titlealt, 'delete.png', $other); - //return ''; } /** diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index a8af4262d58..e5550f9ddd0 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1073,7 +1073,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr if ($val['checked'] && substr($key, 0, 5) == 'efpt.') $addcolspan++; } - print ''."\n"; + print ''."\n"; print ''; print $projectstatic->getNomUrl(1, '', 0, ''.$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1); diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 0b73d95a140..e9afad3b48b 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -550,15 +550,15 @@ if ($num > 0) $backtourl = urlencode($_SERVER["PHP_SELF"].'?'.$param.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '')); if ($user->rights->cron->create) { - print "rowid."&action=edit".($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').$param; + print 'trans('Edit'))."\">".img_picto($langs->trans('Edit'), 'edit')."  "; } if ($user->rights->cron->delete) { print 'trans('CronDelete'))."\">".img_picto($langs->trans('CronDelete'), 'delete')."  "; + print "\" title=\"".dol_escape_htmltag($langs->trans('CronDelete'))."\">".img_picto($langs->trans('CronDelete'), 'delete', '', false, 0, 0, '', 'marginleftonly')."   "; } else { - print "trans('NotEnoughPermissions'))."\">".img_picto($langs->trans('NotEnoughPermissions'), 'delete')."   "; + print "trans('NotEnoughPermissions'))."\">".img_picto($langs->trans('NotEnoughPermissions'), 'delete', '', false, 0, 0, '', 'marginleftonly')."   "; } if ($user->rights->cron->execute) { @@ -567,12 +567,12 @@ if ($num > 0) print (empty($conf->global->CRON_KEY) ? '' : '&securitykey='.$conf->global->CRON_KEY); print ($sortfield ? '&sortfield='.$sortfield : ''); print ($sortorder ? '&sortorder='.$sortorder : ''); - print $param."\" title=\"".dol_escape_htmltag($langs->trans('CronExecute'))."\">".img_picto($langs->trans('CronExecute'), "play").''; + print $param."\" title=\"".dol_escape_htmltag($langs->trans('CronExecute'))."\">".img_picto($langs->trans('CronExecute'), "play", '', false, 0, 0, '', 'marginleftonly').''; } else { - print ''.img_picto($langs->trans('JobDisabled'), "playdisabled").''; + print ''.img_picto($langs->trans('JobDisabled'), "playdisabled", '', false, 0, 0, '', 'marginleftonly').''; } } else { - print ''.img_picto($langs->trans('NotEnoughPermissions'), "playdisabled").''; + print ''.img_picto($langs->trans('NotEnoughPermissions'), "playdisabled", '', false, 0, 0, '', 'marginleftonly').''; } if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined { diff --git a/htdocs/salaries/class/salariesstats.class.php b/htdocs/salaries/class/salariesstats.class.php index 41449cca0cd..37e950b1bbe 100644 --- a/htdocs/salaries/class/salariesstats.class.php +++ b/htdocs/salaries/class/salariesstats.class.php @@ -126,6 +126,7 @@ class SalariesStats extends Stats $res=$this->_getAmountByMonth($year, $sql, $format); //var_dump($res);print '
'; + return $res; } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b3fb0f4c0b7..dc6b9db0eac 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1345,17 +1345,17 @@ else } // Phone / Fax - print ''.img_picto('', 'object_phoning').' '.$form->editfieldkey('Phone', 'phone', '', $object, 0).''; - print ''; + print ''.$form->editfieldkey('Phone', 'phone', '', $object, 0).''; + print ''.img_picto('', 'object_phoning').' '; if ($conf->browser->layout == 'phone') print ''; - print ''.img_picto('', 'object_phoning_fax').' '.$form->editfieldkey('Fax', 'fax', '', $object, 0).''; - print ''; + print ''.$form->editfieldkey('Fax', 'fax', '', $object, 0).''; + print ''.img_picto('', 'object_phoning_fax').' '; // Email / Web - print ''.img_picto('', 'object_email').' '.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', $conf->global->SOCIETE_EMAIL_MANDATORY).''; - print ''; - print ''.img_picto('', 'globe').' '.$form->editfieldkey('Web', 'url', '', $object, 0).''; - print ''; + print ''.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', $conf->global->SOCIETE_EMAIL_MANDATORY).''; + print ''.img_picto('', 'object_email').' '; + print ''.$form->editfieldkey('Web', 'url', '', $object, 0).''; + print ''.img_picto('', 'globe').' '; if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 26117632dcd..2854d3582bd 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -175,6 +175,14 @@ input, select { margin-bottom:1px; margin-top:1px; } +input.button { + background: var(--butactionbg); + border-collapse: collapse; + border: none; +} +input.button:focus { + border-bottom: 0; +} input.button.massactionconfirmed { margin: 4px; } diff --git a/htdocs/theme/eldy/main_menu_fa_icons.inc.php b/htdocs/theme/eldy/main_menu_fa_icons.inc.php index 81a6aa3b4c5..45afe673248 100644 --- a/htdocs/theme/eldy/main_menu_fa_icons.inc.php +++ b/htdocs/theme/eldy/main_menu_fa_icons.inc.php @@ -143,8 +143,31 @@ div.mainmenu.generic4::before { content: "\f249"; } +/* Define color of some picto */ + +.fa-phone, .fa-fax { + opacity: 0.5; + color: #440; +} +.fa-at, .fa-external-link-alt { + opacity: 0.5; + color: #304; +} +.fa-trash { + color: #666; +} +.fa-trash:hover:before { + color: #800; +} +.fa-play { + color: #444; +} +.fa-unlink { + color: #555; +} /* Define square Dolibarr logo in pure CSS */ + .fa-dolibarr-css{ color: #235481; background: currentColor;