Removed function getImgPictoNameList from functions.lib.php (useless)

This commit is contained in:
ldestailleur
2025-10-10 14:45:07 +02:00
parent c24ebe2122
commit 77d7d17d4c
5 changed files with 519 additions and 491 deletions

View File

@@ -5437,7 +5437,13 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco
$pictowithouttext = str_replace('_nocolor', '', $pictowithouttext);
// Fix some values of $pictowithouttext
$pictoconvertkey = array('facture' => 'bill', 'shipping' => 'shipment', 'fichinter' => 'intervention', 'agenda' => 'calendar', 'invoice_supplier' => 'supplier_invoice', 'order_supplier' => 'supplier_order');
$pictoconvertkey = array(
'facture' => 'bill',
'shipping' => 'shipment',
'fichinter' => 'intervention',
'agenda' => 'calendar',
'invoice_supplier' => 'supplier_invoice',
'order_supplier' => 'supplier_order');
if (in_array($pictowithouttext, array_keys($pictoconvertkey))) {
$pictowithouttext = $pictoconvertkey[$pictowithouttext];
}
@@ -5489,7 +5495,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco
return $enabledisablehtml;
}
if (empty($srconly) && in_array($pictowithouttext, getImgPictoNameList())) {
if (empty($srconly) && !preg_match('/[\.\/@]/', $pictowithouttext)) { // If picto code does not contains a / and no . inside, it is not a path to an image file on disk
$fakey = $pictowithouttext;
$facolor = '';
$fasize = '';
@@ -5796,309 +5802,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco
return '<img src="' . $fullpathpicto . '"' . ($notitle ? '' : ' alt="' . dolPrintHTMLForAttribute($alt, 0, $allowothertags) . '"') . (($notitle || empty($titlealt)) ? '' : ' title="' . dolPrintHTMLForAttribute($titlealt, 0, $allowothertags) . '"') . ($moreatt ? ' ' . $moreatt . ($morecss ? ' class="' . $morecss . '"' : '') : ' class="inline-block' . ($morecss ? ' ' . $morecss : '') . '"') . '>'; // Alt is used for accessibility, title for popup
}
/**
* Get all usage icon key usable for img_picto(..., key)
*
* @return string[]
*/
function getImgPictoNameList()
{
return array(
'1downarrow',
'1uparrow',
'1leftarrow',
'1rightarrow',
'1uparrow_selected',
'1downarrow_selected',
'1leftarrow_selected',
'1rightarrow_selected',
'accountancy',
'accounting_account',
'account',
'accountline',
'action',
'add',
'address',
'ai',
'angle-double-down',
'angle-double-up',
'asset',
'back',
'bank_account',
'barcode',
'bank',
'bell',
'bill',
'billa',
'billr',
'billd',
'birthday-cake',
'bom',
'bookcal',
'bookmark',
'briefcase-medical',
'bug',
'building',
'card',
'calendarlist',
'calendar',
'calendarmonth',
'calendarweek',
'calendarday',
'calendarperuser',
'calendarpertype',
'hourglass',
'cash-register',
'category',
'chart',
'check',
'clock',
'clone',
'close_title',
'code',
'cog',
'collab',
'company',
'contact',
'country',
'contract',
'conversation',
'cron',
'cross',
'cubes',
'check-circle',
'check-square',
'circle',
'stop-circle',
'currency',
'multicurrency',
'chevron-left',
'chevron-right',
'chevron-down',
'chevron-up',
'chevron-double-left',
'chevron-double-right',
'chevron-double-down',
'chevron-double-top',
'commercial',
'companies',
'delete',
'dolly',
'dollyrevert',
'donation',
'download',
'dynamicprice',
'edit',
'ellipsis-h',
'email',
'entity',
'envelope',
'eraser',
'establishment',
'expensereport',
'external-link-alt',
'external-link-square-alt',
'eye',
'filter',
'file',
'file-o',
'file-code',
'file-export',
'file-import',
'file-upload',
'autofill',
'folder',
'folder-open',
'folder-plus',
'font',
'generate',
'generic',
'globe',
'globe-americas',
'graph',
'grip',
'grip_title',
'group',
'hands-helping',
'help',
'holiday',
'id-card',
'images',
'incoterm',
'info',
'info_black',
'intervention',
'inventory',
'intracommreport',
'jobprofile',
'key',
'knowledgemanagement',
'label',
'language',
'layout',
'line',
'link',
'list',
'list-alt',
'listlight',
'loan',
'lock',
'lot',
'long-arrow-alt-right',
'margin',
'map-marker-alt',
'member',
'meeting',
'minus',
'money-bill-alt',
'movement',
'mrp',
'note',
'next',
'off',
'on',
'order',
'paragraph',
'play',
'pdf',
'phone',
'phoning',
'phoning_mobile',
'phoning_fax',
'playdisabled',
'previous',
'poll',
'pos',
'printer',
'product',
'propal',
'proposal',
'puce',
'resize',
'search',
'service',
'stats',
'stock',
'security',
'setup',
'share-alt',
'sign-out',
'split',
'stripe',
'stripe-s',
'switch_off',
'switch_on',
'switch_on_grey',
'switch_on_warning',
'switch_on_red',
'tools',
'unlink',
'uparrow',
'user',
'user-tie',
'vcard',
'wrench',
'discord',
'facebook',
'flickr',
'instagram',
'linkedin',
'github',
'google',
'jabber',
'meetup',
'microsoft',
'skype',
'slack',
'twitter',
'pinterest',
'reddit',
'snapchat',
'tumblr',
'youtube',
'viadeo',
'google-plus-g',
'whatsapp',
'generic',
'home',
'hrm',
'members',
'products',
'invoicing',
'partnership',
'payment',
'payment_vat',
'pencil-ruler',
'pictoconfirm',
'preview',
'project',
'projectpub',
'projecttask',
'question',
'refresh',
'region',
'salary',
'shipment',
'state',
'supplier_invoice',
'supplier_invoicea',
'supplier_invoicer',
'supplier_invoiced',
'technic',
'ticket',
'error',
'warning',
'recent',
'reception',
'recruitmentcandidature',
'recruitmentjobposition',
'replacement',
'resource',
'recurring',
'rss',
'search-plus',
'shapes',
'skill',
'square',
'sort-numeric-down',
'status',
'stop-circle',
'supplier',
'supplier_proposal',
'supplier_order',
'supplier_invoice',
'terminal',
'tick',
'timespent',
'title_setup',
'title_accountancy',
'title_bank',
'title_hrm',
'title_agenda',
'trip',
'uncheck',
'undo',
'url',
'user-cog',
'user-injured',
'user-md',
'upload',
'vat',
'website',
'workstation',
'webhook',
'world',
'private',
'conferenceorbooth',
'eventorganization',
'stamp',
'signature',
'webportal'
);
}
/**
* Get array to convert the Dolibarr picto keys into font awesome keys
* Get array to convert the Dolibarr picto keys into Font awesome keys
*
* @param string $mode 'fa' to get conversion array for Font-Awesome
* @return string[] Array of conversion
@@ -6108,192 +5815,197 @@ function getImgPictoConv($mode = 'fa')
{
global $conf;
// Array when the fa picto key is different than the Dolibarr picto key.
$arrayconvpictotofa = array(
'account' => 'university',
'accounting_account' => 'clipboard-list',
'accountline' => 'receipt',
'accountancy' => 'search-dollar',
'action' => 'calendar-alt',
'add' => 'plus-circle',
'address' => 'address-book',
'ai' => 'magic',
'asset' => 'money-check-alt',
'autofill' => 'fill',
'back' => 'arrow-left',
'bank_account' => 'university',
'bill' => 'file-invoice-dollar',
'billa' => 'file-excel',
'billr' => 'file-invoice-dollar',
'billd' => 'file-medical',
'bookcal' => 'calendar-check',
'supplier_invoice' => 'file-invoice-dollar',
'supplier_invoicea' => 'file-excel',
'supplier_invoicer' => 'file-invoice-dollar',
'supplier_invoiced' => 'file-medical',
'bom' => 'shapes',
'card' => 'address-card',
'chart' => 'chart-line',
'company' => 'building',
'contact' => 'address-book',
'contract' => 'suitcase',
'collab' => 'people-arrows',
'conversation' => 'comments',
'country' => 'globe-americas',
'cron' => 'business-time',
'cross' => 'times',
'chevron-double-left' => 'angle-double-left',
'chevron-double-right' => 'angle-double-right',
'chevron-double-down' => 'angle-double-down',
'chevron-double-top' => 'angle-double-up',
'donation' => 'file-alt',
'dynamicprice' => 'hand-holding-usd',
'setup' => 'cog',
'companies' => 'building',
'products' => 'cube',
'commercial' => 'suitcase',
'invoicing' => 'coins',
'accounting' => 'search-dollar',
'category' => 'tag',
'dollyrevert' => 'dolly',
'file-o' => 'file',
'generate' => 'plus-square',
'hrm' => 'user-tie',
'incoterm' => 'truck-loading',
'margin' => 'calculator',
'members' => 'user-friends',
'ticket' => 'ticket-alt',
'globe' => 'external-link-alt',
'lot' => 'barcode',
'email' => 'at',
'establishment' => 'building',
'edit' => 'pencil-alt',
'entity' => 'globe',
'graph' => 'chart-line',
'grip_title' => 'arrows-alt',
'grip' => 'arrows-alt',
'help' => 'question-circle',
'generic' => 'file',
'holiday' => 'umbrella-beach',
'info' => 'info-circle',
'info_black' => 'info-circle',
'inventory' => 'boxes',
'intracommreport' => 'globe-europe',
'jobprofile' => 'cogs',
'knowledgemanagement' => 'ticket-alt',
'label' => 'layer-group',
'layout' => 'columns',
'line' => 'bars',
'loan' => 'money-bill-alt',
'member' => 'user-alt',
'meeting' => 'chalkboard-teacher',
'mrp' => 'cubes',
'next' => 'arrow-alt-circle-right',
'trip' => 'wallet',
'expensereport' => 'wallet',
'group' => 'users',
'movement' => 'people-carry',
'sign-out' => 'sign-out-alt',
'switch_off' => 'toggle-off',
'switch_on' => 'toggle-on',
'switch_on_grey' => 'toggle-on',
'switch_on_warning' => 'toggle-on',
'switch_on_red' => 'toggle-on',
'check' => 'check',
'bookmark' => 'star',
'bank' => 'university',
'close_title' => 'times',
'delete' => 'trash',
'filter' => 'filter',
'list-alt' => 'list-alt',
'calendarlist' => 'bars',
'calendar' => 'calendar-alt',
'calendarmonth' => 'calendar-alt',
'calendarweek' => 'calendar-week',
'calendarday' => 'calendar-day',
'calendarperuser' => 'table',
'calendarpertype' => 'table',
'intervention' => 'ambulance',
'invoice' => 'file-invoice-dollar',
'order' => 'file-invoice',
'error' => 'exclamation-triangle',
'warning' => 'exclamation-triangle',
'other' => 'square',
'playdisabled' => 'play',
'pdf' => 'file-pdf',
'poll' => 'check-double',
'pos' => 'cash-register',
'preview' => 'binoculars',
'project' => 'project-diagram',
'projectpub' => 'project-diagram',
'projecttask' => 'tasks',
'propal' => 'file-signature',
'proposal' => 'file-signature',
'partnership' => 'handshake',
'payment' => 'money-check-alt',
'payment_vat' => 'money-check-alt',
'pictoconfirm' => 'check-square',
'phoning' => 'phone',
'phoning_mobile' => 'mobile-alt',
'phoning_fax' => 'fax',
'previous' => 'arrow-alt-circle-left',
'printer' => 'print',
'product' => 'cube',
'puce' => 'angle-right',
'recent' => 'check-square',
'reception' => 'dolly',
'recruitmentjobposition' => 'id-card-alt',
'recruitmentcandidature' => 'id-badge',
'resize' => 'crop',
'supplier_order' => 'dol-order_supplier',
'supplier_proposal' => 'file-signature',
'refresh' => 'redo',
'region' => 'map-marked',
'replacement' => 'exchange-alt',
'resource' => 'laptop-house',
'recurring' => 'history',
'service' => 'concierge-bell',
'skill' => 'shapes',
'state' => 'map-marked-alt',
'security' => 'key',
'salary' => 'wallet',
'shipment' => 'dolly',
'stock' => 'box-open',
'stats' => 'chart-bar',
'split' => 'code-branch',
'status' => 'stop-circle',
'stripe' => 'stripe-s',
'supplier' => 'building',
'technic' => 'cogs',
'tick' => 'check',
'timespent' => 'clock',
'title_setup' => 'tools',
'title_accountancy' => 'money-check-alt',
'title_bank' => 'university',
'title_hrm' => 'umbrella-beach',
'title_agenda' => 'calendar-alt',
'uncheck' => 'times',
'uparrow' => 'share',
'url' => 'external-link-alt',
'vat' => 'money-check-alt',
'vcard' => 'arrow-alt-circle-down',
'jabber' => 'comment',
'website' => 'globe-americas',
'workstation' => 'pallet',
'webhook' => 'bullseye',
'world' => 'globe',
'private' => 'user-lock',
'conferenceorbooth' => 'chalkboard-teacher',
'eventorganization' => 'project-diagram',
'webportal' => 'door-open'
);
if (empty($mode) || $mode == 'fa') {
// Array when the fa picto key is different than the Dolibarr picto key.
$arrayconvpictotofa = array(
'account' => 'university',
'accounting_account' => 'clipboard-list',
'accountline' => 'receipt',
'accountancy' => 'search-dollar',
'action' => 'calendar-alt',
'add' => 'plus-circle',
'address' => 'address-book',
'ai' => 'magic',
'asset' => 'money-check-alt',
'autofill' => 'fill',
'back' => 'arrow-left',
'bank_account' => 'university',
'bill' => 'file-invoice-dollar',
'billa' => 'file-excel',
'billr' => 'file-invoice-dollar',
'billd' => 'file-medical',
'blockedlog' => 'file-archive',
'bookcal' => 'calendar-check',
'supplier_invoice' => 'file-invoice-dollar',
'supplier_invoicea' => 'file-excel',
'supplier_invoicer' => 'file-invoice-dollar',
'supplier_invoiced' => 'file-medical',
'bom' => 'shapes',
'card' => 'address-card',
'chart' => 'chart-line',
'company' => 'building',
'contact' => 'address-book',
'contract' => 'suitcase',
'collab' => 'people-arrows',
'conversation' => 'comments',
'country' => 'globe-americas',
'cron' => 'business-time',
'cross' => 'times',
'chevron-double-left' => 'angle-double-left',
'chevron-double-right' => 'angle-double-right',
'chevron-double-down' => 'angle-double-down',
'chevron-double-top' => 'angle-double-up',
'donation' => 'file-alt',
'dynamicprice' => 'hand-holding-usd',
'setup' => 'cog',
'companies' => 'building',
'products' => 'cube',
'commercial' => 'suitcase',
'invoicing' => 'coins',
'accounting' => 'search-dollar',
'category' => 'tag',
'dollyrevert' => 'dolly',
'file-o' => 'file',
'generate' => 'plus-square',
'hrm' => 'user-tie',
'incoterm' => 'truck-loading',
'margin' => 'calculator',
'members' => 'user-friends',
'ticket' => 'ticket-alt',
'globe' => 'external-link-alt',
'lot' => 'barcode',
'email' => 'at',
'establishment' => 'building',
'edit' => 'pencil-alt',
'entity' => 'globe',
'graph' => 'chart-line',
'grip_title' => 'arrows-alt',
'grip' => 'arrows-alt',
'help' => 'question-circle',
'generic' => 'file',
'holiday' => 'umbrella-beach',
'info' => 'info-circle',
'info_black' => 'info-circle',
'inventory' => 'boxes',
'intracommreport' => 'globe-europe',
'jobprofile' => 'cogs',
'knowledgemanagement' => 'ticket-alt',
'label' => 'layer-group',
'layout' => 'columns',
'line' => 'bars',
'loan' => 'money-bill-alt',
'member' => 'user-alt',
'meeting' => 'chalkboard-teacher',
'mrp' => 'cubes',
'next' => 'arrow-alt-circle-right',
'trip' => 'wallet',
'expensereport' => 'wallet',
'group' => 'users',
'movement' => 'people-carry',
'sign-out' => 'sign-out-alt',
'switch_off' => 'toggle-off',
'switch_on' => 'toggle-on',
'switch_on_grey' => 'toggle-on',
'switch_on_warning' => 'toggle-on',
'switch_on_red' => 'toggle-on',
'check' => 'check',
'bookmark' => 'star',
'bank' => 'university',
'close_title' => 'times',
'delete' => 'trash',
'filter' => 'filter',
'list-alt' => 'list-alt',
'calendarlist' => 'bars',
'calendar' => 'calendar-alt',
'calendarmonth' => 'calendar-alt',
'calendarweek' => 'calendar-week',
'calendarday' => 'calendar-day',
'calendarperuser' => 'table',
'calendarpertype' => 'table',
'intervention' => 'ambulance',
'invoice' => 'file-invoice-dollar',
'order' => 'file-invoice',
'error' => 'exclamation-triangle',
'warning' => 'exclamation-triangle',
'other' => 'square',
'playdisabled' => 'play',
'pdf' => 'file-pdf',
'poll' => 'check-double',
'pos' => 'cash-register',
'preview' => 'binoculars',
'project' => 'project-diagram',
'projectpub' => 'project-diagram',
'projecttask' => 'tasks',
'propal' => 'file-signature',
'proposal' => 'file-signature',
'partnership' => 'handshake',
'payment' => 'money-check-alt',
'payment_vat' => 'money-check-alt',
'pictoconfirm' => 'check-square',
'phoning' => 'phone',
'phoning_mobile' => 'mobile-alt',
'phoning_fax' => 'fax',
'previous' => 'arrow-alt-circle-left',
'printer' => 'print',
'product' => 'cube',
'puce' => 'angle-right',
'recent' => 'check-square',
'reception' => 'dolly',
'recruitmentjobposition' => 'id-card-alt',
'recruitmentcandidature' => 'id-badge',
'resize' => 'crop',
'supplier_order' => 'dol-order_supplier',
'supplier_proposal' => 'file-signature',
'refresh' => 'redo',
'region' => 'map-marked',
'replacement' => 'exchange-alt',
'resource' => 'laptop-house',
'recurring' => 'history',
'service' => 'concierge-bell',
'skill' => 'shapes',
'state' => 'map-marked-alt',
'security' => 'key',
'salary' => 'wallet',
'shipment' => 'dolly',
'stock' => 'box-open',
'stats' => 'chart-bar',
'split' => 'code-branch',
'status' => 'stop-circle',
'stripe' => 'stripe-s',
'supplier' => 'building',
'technic' => 'cogs',
'tick' => 'check',
'timespent' => 'clock',
'title_setup' => 'tools',
'title_accountancy' => 'money-check-alt',
'title_bank' => 'university',
'title_hrm' => 'umbrella-beach',
'title_agenda' => 'calendar-alt',
'uncheck' => 'times',
'uparrow' => 'share',
'url' => 'external-link-alt',
'vat' => 'money-check-alt',
'vcard' => 'arrow-alt-circle-down',
'jabber' => 'comment',
'website' => 'globe-americas',
'workstation' => 'pallet',
'webhook' => 'bullseye',
'world' => 'globe',
'private' => 'user-lock',
'conferenceorbooth' => 'chalkboard-teacher',
'eventorganization' => 'project-diagram',
'webportal' => 'door-open'
);
if ($conf->currency == 'EUR') {
$arrayconvpictotofa['currency'] = 'euro-sign';
$arrayconvpictotofa['multicurrency'] = 'dollar-sign';
if ($conf->currency == 'EUR') {
$arrayconvpictotofa['currency'] = 'euro-sign';
$arrayconvpictotofa['multicurrency'] = 'dollar-sign';
} else {
$arrayconvpictotofa['currency'] = 'dollar-sign';
$arrayconvpictotofa['multicurrency'] = 'euro-sign';
}
} else {
$arrayconvpictotofa['currency'] = 'dollar-sign';
$arrayconvpictotofa['multicurrency'] = 'euro-sign';
$arrayconvpictotofa = array();
}
return $arrayconvpictotofa;