From 072a0a26d6014fbdee1a8102f5617c789bf3c819 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2019 18:07:00 +0200 Subject: [PATCH] Use a font awesome icon to show "shippable" flag on orders. --- htdocs/commande/list.php | 16 +++------------- htdocs/core/lib/functions.lib.php | 13 +++++++------ htdocs/fourn/commande/list.php | 19 ++++++------------- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 1 + 5 files changed, 18 insertions(+), 32 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 39844ce390f..115bc46813a 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -814,10 +814,7 @@ if ($resql) $generic_commande->lines=array(); $generic_commande->getLinesArray(); - print ''; - print ''; // Show shippable Icon (create subloop, so may be slow) if ($conf->stock->enabled) @@ -903,16 +900,15 @@ if ($resql) } } } - if ($notshippable==0) { - $text_icon = img_picto('', 'object_sending'); + if ($notshippable == 0) { + $text_icon = img_picto('', 'dolly', '', false, 0, 0, '', 'green paddingleft'); $text_info = $langs->trans('Shippable').'
'.$text_info; } else { - $text_icon = img_picto('', 'error'); + $text_icon = img_picto('', 'dolly', '', false, 0, 0, '', 'error paddingleft'); $text_info = $langs->trans('NonShippable').'
'.$text_info; } } - print ''; } // Warning late icon and note - print ''; - print ''; - print '
'; print $generic_commande->getNomUrl(1, ($viewstatut != 2?0:$obj->fk_statut), 0, 0, 0, 1); - print ''; if ($nbprod) { print $form->textwithtooltip('', $text_info, 2, 1, $text_icon, '', 2); @@ -920,11 +916,9 @@ if ($resql) if ($warning) { // Always false in default mode print $form->textwithtooltip('', $langs->trans('NotEnoughForAllOrders').'
'.$text_warning, 2, 1, img_picto('', 'error'), '', 2); } - print '
'; if ($generic_commande->hasDelay()) { print img_picto($langs->trans("Late").' : '.$generic_commande->showDelay(), "warning"); } @@ -934,15 +928,11 @@ if ($resql) print ''.img_picto($langs->trans("ViewPrivateNote"), 'object_generic').''; print ''; } - print ''; $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->multidir_output[$conf->entity] . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); - print '
'; print ''; if (! $i) $totalarray['nbfield']++; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bc29f1ff93a..ded274a8683 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3029,14 +3029,14 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) if (empty($srconly) && in_array($pictowithouttext, array( '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', - 'address', 'bank', 'building', 'cash-register', 'close_title', 'cubes', 'delete', 'edit', 'ellipsis-h', 'bookmark', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', + 'address', 'bank', 'building', 'cash-register', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h', 'bookmark', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', 'object_list','object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'jabber','skype','twitter','facebook','linkedin', 'chevron-left','chevron-right','chevron-down','chevron-top', 'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'project', 'hrm', 'members', 'ticket', 'generic', - 'warning', + 'error','warning', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda' ) )) { @@ -3049,13 +3049,14 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'bookmark'=>'star', 'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-fork', 'object_list'=>'list-alt','object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table', - 'warning'=>'exclamation-triangle', + 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt' ); - if ($pictowithouttext == 'warning') { + if ($pictowithouttext == 'error' || $pictowithouttext == 'warning') { $facolor = ''; $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; $marginleftonlyshort = 0; + $morecss .= ($morecss ? ' ' : '').('picto'.$pictowithouttext); } elseif ($pictowithouttext == 'switch_off') { $facolor = '#999'; $fasize = '2em'; @@ -3156,12 +3157,12 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ elseif (! empty($arrayconvpictotofa[$pictowithouttext])) { $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; - $facolor = '#444'; + //$facolor = '#444'; $marginleftonlyshort=0; } else { $fakey = 'fa-'.$pictowithouttext; - $facolor = '#444'; + //$facolor = '#444'; $marginleftonlyshort=0; } //this snippet only needed since function img_edit accepts only one additional parameter: no separate one for css only. diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 14ac029bb27..6410f2c9e57 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -484,13 +484,13 @@ $help_url=''; $sql = 'SELECT'; if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT'; -$sql.= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; +$sql.= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.email,'; $sql.= " typent.code as typent_code,"; $sql.= " state.code_departement as state_code, state.nom as state_name,"; $sql.= " cf.rowid, cf.ref, cf.ref_supplier, cf.fk_statut, cf.billed, cf.total_ht, cf.tva as total_tva, cf.total_ttc, cf.fk_user_author, cf.date_commande as date_commande, cf.date_livraison as date_delivery,"; $sql.= ' cf.date_creation as date_creation, cf.tms as date_update,'; $sql.= " p.rowid as project_id, p.ref as project_ref, p.title as project_title,"; -$sql.= " u.firstname, u.lastname, u.photo, u.login"; +$sql.= " u.firstname, u.lastname, u.photo, u.login, u.email as user_email"; // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks @@ -946,20 +946,12 @@ if ($resql) { print ''; - print ''; // Picto + Ref - print ''; - // Warning - //print ''; // Other picto tool - print '
'; print $objectstatic->getNomUrl(1); - print ''; - //print ''; $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->fournisseur->commande->dir_output.'/' . dol_sanitizeFileName($obj->ref); print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); - print '
'; print ''."\n"; if (! $i) $totalarray['nbfield']++; @@ -987,20 +979,21 @@ if ($resql) $userstatic->firstname = $obj->firstname; $userstatic->login = $obj->login; $userstatic->photo = $obj->photo; + $userstatic->email = $obj->user_email; if (! empty($arrayfields['u.login']['checked'])) { - print ""; + print ''; if ($userstatic->id) print $userstatic->getNomUrl(1); - else print " "; print ""; if (! $i) $totalarray['nbfield']++; } // Thirdparty if (! empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; $thirdpartytmp->id = $obj->socid; $thirdpartytmp->name = $obj->name; + $thirdpartytmp->email = $obj->email; print $thirdpartytmp->getNomUrl(1, 'supplier'); print ''."\n"; if (! $i) $totalarray['nbfield']++; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index fd7a5670f8e..69865d7ab1b 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3430,6 +3430,7 @@ img.boxhandle, img.boxclose { .ok { color: #114466; } .warning { color: #887711 !important; } .error { color: #550000 !important; font-weight: bold; } +.green { color: #118822; } div.ok { color: #114466; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 25f2bde7e60..8c6bd8d4d77 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3461,6 +3461,7 @@ img.boxhandle, img.boxclose { .ok { color: #114466; } .warning { color: #887711 !important; } .error { color: #550000 !important; font-weight: bold; } +.green { color: #118822; } div.ok { color: #114466;