From 809c741d1199dd64b0c7cdd78423db4a7de6d2c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Apr 2020 15:34:28 +0200 Subject: [PATCH] Can use font awesome as picto of object and modules. --- htdocs/admin/modulehelp.php | 2 +- htdocs/core/lib/functions.lib.php | 10 ++++++---- htdocs/core/modules/modCashDesk.class.php | 2 +- htdocs/core/modules/modTakePos.class.php | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 1429888405c..5a52dc99e3a 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -325,7 +325,7 @@ if ($mode == 'desc') if ($objMod->editor_name != 'dolibarr') $textexternal.='
'.$langs->trans("Publisher").': '.(empty($objMod->editor_name)?$langs->trans("Unknown"):$objMod->editor_name); $editor_url = $objMod->editor_url; if (! preg_match('/^http/', $editor_url)) $editor_url = 'http://'.$editor_url; - if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i', $objMod->editor_url)) $textexternal.= ($objMod->editor_name != 'dolibarr' ? ' - ' : '').img_object('', 'globe').' '.$objMod->editor_url.''; + if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i', $objMod->editor_url)) $textexternal.= ($objMod->editor_name != 'dolibarr' ? ' - ' : '').img_picto('', 'globe').' '.$objMod->editor_url.''; $text.=$textexternal; $text.='
'; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 751e3ebb0a6..45ddc03e98d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3136,6 +3136,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ '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', + 'object_cash-register', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', @@ -3154,14 +3155,15 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if (in_array($pictowithouttext, array('skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp'))) { $fa = 'fab'; } + $pictowithouttext = str_replace('object_', '', $pictowithouttext); $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', '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', + 'phoning'=>'phone', 'phoning_fax'=>'fax', 'email'=>'at', + 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', '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', + 'list'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', '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', 'preview'=>'binoculars', 'project'=>'sitemap' @@ -3250,7 +3252,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = 'fa-comment-o'; } // Img for type of views - elseif (in_array($pictowithouttext, array('object_list', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser'))) { + elseif (in_array($pictowithouttext, array('list', 'calendar', 'calendarweek', 'calendarmonth', 'calendarday', 'calendarperuser'))) { $fakey = 'imgforviewmode fa-'.$arrayconvpictotofa[$pictowithouttext]; $marginleftonlyshort = 0; } diff --git a/htdocs/core/modules/modCashDesk.class.php b/htdocs/core/modules/modCashDesk.class.php index 9bff4afdaf8..b27a1ae30e4 100644 --- a/htdocs/core/modules/modCashDesk.class.php +++ b/htdocs/core/modules/modCashDesk.class.php @@ -55,7 +55,7 @@ class modCashDesk extends DolibarrModules $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - $this->picto = 'list'; + $this->picto = 'cash-register'; // Data directories to create when module is enabled $this->dirs = array(); diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index 8357cb42b2d..400ff6c9b7d 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -71,7 +71,7 @@ class modTakePos extends DolibarrModules // Name of image file used for this module. // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' - $this->picto = 'list'; + $this->picto = 'cash-register'; // Defined all module parts (triggers, login, substitutions, menus, css, etc...) // for default path (eg: /takepos/core/xxxxx) (0=disable, 1=enable)