dolibarr 25.0.0-alpha
admin_extrafields.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2026 Frédéric France <frederic.france@free.fr>
3 * Copyright (C) 2026 MDW <mdeweerd@users.noreply.github.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
52function extrafieldsAdminProductServiceLabel($keyBoth, $keyServiceOnly, $keyProductOnly, $noconv = false)
53{
54 return function () use ($keyBoth, $keyServiceOnly, $keyProductOnly, $noconv) {
55 global $langs;
56 $label = $noconv ? $langs->transnoentitiesnoconv($keyBoth) : $langs->trans($keyBoth);
57 if (!isModEnabled("product")) {
58 $label = $langs->trans($keyServiceOnly);
59 } elseif (!isModEnabled("service")) {
60 $label = $langs->trans($keyProductOnly);
61 }
62 return $label;
63 };
64}
65
100{
101 global $hookmanager;
102
103 $extrafieldsadminmap = array(
104 'societe' => array(
105 'headfunction' => 'societe_admin_prepare_head',
106 'headfile' => 'core/lib/company.lib.php',
107 'tabid' => 'attributes',
108 'headlabel' => 'ThirdParties',
109 'textobject' => 'ThirdParty',
110 'headpicto' => 'company',
111 'title' => 'CompanySetup',
112 'helpurl' => 'EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers',
113 'langs' => array('companies', 'admin', 'members'),
114 ),
115 'socpeople' => array(
116 'headfunction' => 'societe_admin_prepare_head',
117 'headfile' => 'core/lib/company.lib.php',
118 'tabid' => 'attributes_contacts',
119 'headlabel' => 'ThirdParties',
120 'textobject' => 'ContactsAddresses',
121 'headpicto' => 'company',
122 'title' => 'CompanySetup',
123 'helpurl' => 'EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers',
124 'langs' => array('companies', 'admin'),
125 ),
126 'product' => array(
127 'headfunction' => 'product_admin_prepare_head',
128 'headfile' => 'core/lib/product.lib.php',
129 'tabid' => 'attributes',
130 'headlabel' => extrafieldsAdminProductServiceLabel('ProductsAndServices', 'Services', 'Products', true),
131 'headpicto' => 'product',
132 'title' => extrafieldsAdminProductServiceLabel('ProductServiceSetup', 'ServiceSetup', 'ProductSetup'),
133 'helpurl' => '',
134 'langs' => array('companies', 'admin', 'products'),
135 ),
136 'product_lang' => array(
137 'headfunction' => 'product_admin_prepare_head',
138 'headfile' => 'core/lib/product.lib.php',
139 'tabid' => 'translationAttributes',
140 'headlabel' => 'ProductLangExtrafieldsSetup',
141 'textobject' => 'Product',
142 'headpicto' => 'product',
143 'title' => 'ProductLangExtrafieldsSetup',
144 'helpurl' => '',
145 'langs' => array('admin', 'products'),
146 ),
147 'product_price' => array(
148 'headfunction' => 'product_admin_prepare_head',
149 'headfile' => 'core/lib/product.lib.php',
150 'tabid' => 'levelAttributes',
151 'headlabel' => extrafieldsAdminProductServiceLabel('ProductsAndServices', 'Services', 'Products', true),
152 'headpicto' => 'product',
153 'title' => extrafieldsAdminProductServiceLabel('ProductServiceSetup', 'ServiceSetup', 'ProductSetup'),
154 'helpurl' => '',
155 'langs' => array('companies', 'admin', 'products'),
156 ),
157 'product_customer_price' => array(
158 'headfunction' => 'product_admin_prepare_head',
159 'headfile' => 'core/lib/product.lib.php',
160 'tabid' => 'customerAttributes',
161 'headlabel' => extrafieldsAdminProductServiceLabel('ProductsAndServices', 'Services', 'Products', true),
162 'headpicto' => 'product',
163 'title' => extrafieldsAdminProductServiceLabel('ProductServiceSetup', 'ServiceSetup', 'ProductSetup'),
164 'helpurl' => '',
165 'langs' => array('companies', 'admin', 'products'),
166 ),
167 'product_fournisseur_price' => array(
168 'headfunction' => 'product_admin_prepare_head',
169 'headfile' => 'core/lib/product.lib.php',
170 'tabid' => 'supplierAttributes',
171 'headlabel' => extrafieldsAdminProductServiceLabel('ProductsAndServices', 'Services', 'Products', true),
172 'headpicto' => 'product',
173 'title' => extrafieldsAdminProductServiceLabel('ProductServiceSetup', 'ServiceSetup', 'ProductSetup'),
174 'helpurl' => '',
175 'langs' => array('companies', 'admin', 'products'),
176 ),
177 'product_lot' => array(
178 'headfunction' => 'product_lot_admin_prepare_head',
179 'headfile' => 'core/lib/product.lib.php',
180 'tabid' => 'attributes',
181 'headlabel' => 'Batch',
182 'headpicto' => 'lot',
183 'title' => 'ProductLotSetup',
184 'helpurl' => '',
185 'langs' => array('companies', 'admin', 'products', 'productbatch'),
186 ),
187 'entrepot' => array(
188 'headfunction' => 'stock_admin_prepare_head',
189 'headfile' => 'core/lib/stock.lib.php',
190 'tabid' => 'attributes',
191 'headlabel' => 'StockSetup',
192 'textobject' => 'Warehouses',
193 'headpicto' => 'stock',
194 'title' => 'StockSetup',
195 'helpurl' => '',
196 'langs' => array('companies', 'admin', 'stocks'),
197 ),
198 'stock_mouvement' => array(
199 'headfunction' => 'stock_admin_prepare_head',
200 'headfile' => 'core/lib/stock.lib.php',
201 'tabid' => 'stockMouvementAttributes',
202 'headlabel' => 'StockMouvementExtraFields',
203 'textobject' => 'StockMovement',
204 'headpicto' => 'account',
205 'title' => 'StockSetup',
206 'helpurl' => '',
207 'langs' => array('stock@stock', 'admin'),
208 ),
209 'inventory' => array(
210 'headfunction' => 'stock_admin_prepare_head',
211 'headfile' => 'core/lib/stock.lib.php',
212 'tabid' => 'inventoryAttributes',
213 'headlabel' => 'InventoryExtraFields',
214 'textobject' => 'Inventory',
215 'headpicto' => 'account',
216 'title' => 'StockSetup',
217 'helpurl' => '',
218 'langs' => array('stock@stock', 'admin'),
219 ),
220 'product_attribute' => array(
221 'headfunction' => 'adminProductAttributePrepareHead',
222 'headfile' => 'variants/lib/variants.lib.php',
223 'tabid' => 'product_attribute',
224 'headlabel' => 'ProductAttributeExtrafieldsSetup',
225 'headpicto' => 'product',
226 'title' => 'ProductAttributeExtrafieldsSetup',
227 'helpurl' => '',
228 'langs' => array('admin', 'other', 'product'),
229 ),
230 'product_attribute_value' => array(
231 'headfunction' => 'adminProductAttributePrepareHead',
232 'headfile' => 'variants/lib/variants.lib.php',
233 'tabid' => 'product_attribute_value',
234 'headlabel' => 'ProductAttributeValueExtrafieldsSetup',
235 'headpicto' => 'product',
236 'title' => 'ProductAttributeValueExtrafieldsSetup',
237 'helpurl' => '',
238 'langs' => array('admin', 'other', 'sendings'),
239 ),
240 'adherent' => array(
241 'headfunction' => 'member_admin_prepare_head',
242 'headfile' => 'core/lib/member.lib.php',
243 'tabid' => 'attributes',
244 'headlabel' => 'Members',
245 'headpicto' => 'user',
246 'title' => 'MembersSetup',
247 'helpurl' => 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros|DE:Modul_Mitglieder',
248 'langs' => array('admin', 'members'),
249 ),
250 'adherent_type' => array(
251 'headfunction' => 'member_admin_prepare_head',
252 'headfile' => 'core/lib/member.lib.php',
253 'tabid' => 'attributes_type',
254 'headlabel' => 'Members',
255 'textobject' => 'MembersTypes',
256 'headpicto' => 'user',
257 'title' => 'MembersSetup',
258 'helpurl' => 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros|DE:Modul_Mitglieder',
259 'langs' => array('admin', 'members'),
260 ),
261 'bank_account' => array(
262 'headfunction' => 'bank_admin_prepare_head',
263 'headfile' => 'core/lib/bank.lib.php',
264 'tabid' => 'attributes',
265 'headlabel' => 'BankSetupModule',
266 'textobject' => 'Bank',
267 'headpicto' => 'account',
268 'title' => 'BankSetupModule',
269 'helpurl' => '',
270 'langs' => array('banks', 'admin'),
271 ),
272 'bank' => array(
273 'headfunction' => 'bank_admin_prepare_head',
274 'headfile' => 'core/lib/bank.lib.php',
275 'tabid' => 'bankline_extrafields',
276 'headlabel' => 'BankSetupModule',
277 'textobject' => 'BankTransaction',
278 'headpicto' => 'account',
279 'title' => 'BankSetupModule',
280 'helpurl' => '',
281 'langs' => array('admin', 'companies', 'bills', 'other', 'banks'),
282 ),
283 'paiement' => array(
284 'headfunction' => 'bank_admin_prepare_head',
285 'headfile' => 'core/lib/bank.lib.php',
286 'tabid' => 'bank_payments_extrafields',
287 'headlabel' => 'BankSetupModule',
288 'textobject' => 'BankTransaction',
289 'headpicto' => 'account',
290 'title' => 'BankSetupModule',
291 'helpurl' => '',
292 'langs' => array('admin', 'companies', 'bills', 'other', 'banks'),
293 ),
294 'payment_various' => array(
295 'headfunction' => 'bank_admin_prepare_head',
296 'headfile' => 'core/lib/bank.lib.php',
297 'tabid' => 'bank_various_payment_extrafields',
298 'headlabel' => 'BankSetupModule',
299 'textobject' => 'VariousPayments',
300 'headpicto' => '',
301 'title' => 'BankSetupModule',
302 'helpurl' => '',
303 'langs' => array('admin', 'banks', 'other'),
304 ),
305 'bom_bom' => array(
306 'headfunction' => 'bomAdminPrepareHead',
307 'headfile' => 'bom/lib/bom.lib.php',
308 'tabid' => 'bom_extrafields',
309 'headlabel' => 'ExtraFields',
310 'textobject' => 'BOM',
311 'headpicto' => 'account',
312 'title' => 'BOMsSetup',
313 'helpurl' => '',
314 'langs' => array('mrp', 'admin'),
315 ),
316 'bom_bomline' => array(
317 'headfunction' => 'bomAdminPrepareHead',
318 'headfile' => 'bom/lib/bom.lib.php',
319 'tabid' => 'bomline_extrafields',
320 'headlabel' => 'ExtraFields',
321 'textobject' => 'BOM',
322 'headpicto' => 'account',
323 'title' => 'BOMsSetup',
324 'helpurl' => '',
325 'langs' => array('mrp', 'admin'),
326 ),
327 'delivery' => array(
328 'headfunction' => 'expedition_admin_prepare_head',
329 'headfile' => 'core/lib/expedition.lib.php',
330 'tabid' => 'attributes_receivings',
331 'headlabel' => 'Receivings',
332 'textobject' => 'Receivings',
333 'headpicto' => 'shipment',
334 'title' => 'SendingsSetup',
335 'helpurl' => '',
336 'langs' => array('admin', 'other', 'sendings'),
337 ),
338 'deliverydet' => array(
339 'headfunction' => 'expedition_admin_prepare_head',
340 'headfile' => 'core/lib/expedition.lib.php',
341 'tabid' => 'attributeslines_receivings',
342 'headlabel' => 'Receivings',
343 'textobject' => 'Receivings',
344 'headpicto' => 'shipment',
345 'title' => 'SendingsSetup',
346 'helpurl' => '',
347 'langs' => array('admin', 'other', 'sendings'),
348 ),
349 'expedition' => array(
350 'headfunction' => 'expedition_admin_prepare_head',
351 'headfile' => 'core/lib/expedition.lib.php',
352 'tabid' => 'attributes_shipment',
353 'headlabel' => 'Sendings',
354 'textobject' => 'Sendings',
355 'headpicto' => 'shipment',
356 'title' => 'SendingsSetup',
357 'helpurl' => '',
358 'langs' => array('admin', 'other', 'sendings'),
359 ),
360 'expeditiondet' => array(
361 'headfunction' => 'expedition_admin_prepare_head',
362 'headfile' => 'core/lib/expedition.lib.php',
363 'tabid' => 'attributeslines_shipment',
364 'headlabel' => 'Sendings',
365 'textobject' => 'Sendings',
366 'headpicto' => 'shipment',
367 'title' => 'SendingsSetup',
368 'helpurl' => '',
369 'langs' => array('admin', 'other', 'sendings'),
370 ),
371 'reception' => array(
372 'headfunction' => 'reception_admin_prepare_head',
373 'headfile' => 'core/lib/reception.lib.php',
374 'tabid' => 'attributes_reception',
375 'headlabel' => 'Receptions',
376 'textobject' => 'Receptions',
377 'headpicto' => 'reception',
378 'title' => 'ReceptionsSetup',
379 'helpurl' => '',
380 'langs' => array('admin', 'other', 'receptions', 'sendings'),
381 ),
382 'receptiondet_batch' => array(
383 'headfunction' => 'reception_admin_prepare_head',
384 'headfile' => 'core/lib/reception.lib.php',
385 'tabid' => 'attributeslines_reception',
386 'headlabel' => 'Receptions',
387 'textobject' => 'Receptions',
388 'headpicto' => 'reception',
389 'title' => 'ReceptionsSetup',
390 'helpurl' => '',
391 'langs' => array('admin', 'other', 'receptions'),
392 ),
393 'ecm_directories' => array(
394 'headfunction' => 'ecm_admin_prepare_head',
395 'headfile' => 'core/lib/ecm.lib.php',
396 'tabid' => 'attributes_ecm_directories',
397 'headlabel' => '',
398 'textobject' => 'ECM',
399 'headpicto' => '',
400 'title' => 'ECMSetup',
401 'helpurl' => '',
402 'langs' => array('admin', 'other', 'ecm'),
403 ),
404 'ecm_files' => array(
405 'headfunction' => 'ecm_admin_prepare_head',
406 'headfile' => 'core/lib/ecm.lib.php',
407 'tabid' => 'attributes_ecm_files',
408 'headlabel' => '',
409 'textobject' => 'ECM',
410 'headpicto' => '',
411 'title' => 'ECMSetup',
412 'helpurl' => '',
413 'langs' => array('admin', 'other', 'ecm'),
414 ),
415 'actioncomm' => array(
416 'headfunction' => 'eventorganizationAdminPrepareHead',
417 'headfile' => 'core/lib/eventorganization.lib.php',
418 'tabid' => 'eventorganization_extrafields',
419 'headlabel' => 'ExtraFields',
420 'textobject' => 'ConferenceOrBooth',
421 'headpicto' => 'eventorganization',
422 'title' => 'EventOrganizationSetup',
423 'helpurl' => '',
424 'langs' => array('eventorganization', 'admin'),
425 ),
426 'eventorganization_conferenceorboothattendee' => array(
427 'headfunction' => 'eventorganizationAdminPrepareHead',
428 'headfile' => 'core/lib/eventorganization.lib.php',
429 'tabid' => 'conferenceorboothattendee_extrafields',
430 'headlabel' => 'ConferenceOrBoothAttendeeExtraFields',
431 'textobject' => 'ConferenceOrBoothAttendee',
432 'headpicto' => 'eventorganization',
433 'title' => 'EventOrganizationSetup',
434 'helpurl' => '',
435 'langs' => array('eventorganization', 'admin'),
436 ),
437 'agenda' => array(
438 'headfunction' => 'agenda_prepare_head',
439 'headfile' => 'core/lib/agenda.lib.php',
440 'tabid' => 'attributes',
441 'headlabel' => 'Agenda',
442 'textobject' => 'Agenda',
443 'headpicto' => 'action',
444 'title' => 'AgendaSetup',
445 'helpurl' => 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung',
446 'langs' => array('admin', 'other', 'agenda'),
447 'elementtype' => 'actioncomm',
448 ),
449 'expensereport' => array(
450 'headfunction' => 'expensereport_admin_prepare_head',
451 'headfile' => 'core/lib/expensereport.lib.php',
452 'tabid' => 'attributes',
453 'headlabel' => 'ExpenseReports',
454 'textobject' => 'ExpenseReports',
455 'headpicto' => 'trip',
456 'title' => 'ExpenseReportsSetup',
457 'helpurl' => '',
458 'langs' => array('admin', 'errors', 'trips', 'other'),
459 ),
460 'holiday' => array(
461 'headfunction' => 'holiday_admin_prepare_head',
462 'headfile' => 'core/lib/holiday.lib.php',
463 'tabid' => 'attributes',
464 'headlabel' => 'Holidays',
465 'textobject' => 'Holidays',
466 'headpicto' => 'holiday',
467 'title' => 'HolidaySetup',
468 'helpurl' => '',
469 'langs' => array('admin', 'errors', 'holiday', 'other'),
470 ),
471 'knowledgemanagement_knowledgerecord' => array(
472 'headfunction' => 'knowledgemanagementAdminPrepareHead',
473 'headfile' => 'knowledgemanagement/lib/knowledgemanagement.lib.php',
474 'tabid' => 'extra',
475 'headlabel' => 'KnowledgeRecordExtraFields',
476 'textobject' => 'KnowledgeRecord',
477 'headpicto' => 'knowledgemanagement',
478 'title' => 'KnowledgeManagementSetup',
479 'helpurl' => '',
480 'langs' => array('knowledgemanagement', 'admin'),
481 ),
482 'mrp_mo' => array(
483 'headfunction' => 'mrpAdminPrepareHead',
484 'headfile' => 'mrp/lib/mrp.lib.php',
485 'tabid' => 'mrp_extrafields',
486 'headlabel' => 'ExtraFields',
487 'textobject' => 'ManufacturingOrder',
488 'headpicto' => 'account',
489 'title' => 'MrpSetupPage',
490 'helpurl' => '',
491 'langs' => array('mrp', 'admin'),
492 ),
493 'mrp_production' => array(
494 'headfunction' => 'mrpAdminPrepareHead',
495 'headfile' => 'mrp/lib/mrp.lib.php',
496 'tabid' => 'mrp_production_extrafields',
497 'headlabel' => 'ExtraFields',
498 'textobject' => 'ManufacturingOrder',
499 'headpicto' => 'account',
500 'title' => 'MrpSetupPage',
501 'helpurl' => '',
502 'langs' => array('mrp', 'admin'),
503 ),
504 'commande' => array(
505 'headfunction' => 'order_admin_prepare_head',
506 'headfile' => 'core/lib/order.lib.php',
507 'tabid' => 'attributes',
508 'headlabel' => 'Orders',
509 'textobject' => 'Orders',
510 'headpicto' => 'order',
511 'title' => 'OrdersSetup',
512 'helpurl' => '',
513 'langs' => array('admin', 'other', 'orders'),
514 ),
515 'commandedet' => array(
516 'headfunction' => 'order_admin_prepare_head',
517 'headfile' => 'core/lib/order.lib.php',
518 'tabid' => 'attributeslines',
519 'headlabel' => 'Orders',
520 'textobject' => 'Orders',
521 'headpicto' => 'order',
522 'title' => 'OrdersSetup',
523 'helpurl' => '',
524 'langs' => array('admin', 'other', 'orders'),
525 ),
526 // The supplier order module is mid-transition between the legacy 'fournisseur'
527 // module (core/lib/fourn.lib.php, function supplierorder_admin_prepare_head())
528 // and the new split 'supplier_order' module (core/lib/supplier_order.lib.php,
529 // function supplier_order_admin_prepare_head()), selected at runtime by the
530 // MAIN_USE_NEW_SUPPLIERMOD conf option — this mirrors the exact conditional
531 // the original (now-deleted) per-object supplier order extrafields admin wrapper
532 // files used to pick which lib file to require and which head function
533 // to call. Both functions build a $head array containing the same 'supplierorder'
534 // / 'supplierorderdet' tab id, so only headfunction/headfile need to vary.
535 'commande_fournisseur' => array(
536 'headfunction' => getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') ? 'supplier_order_admin_prepare_head' : 'supplierorder_admin_prepare_head',
537 'headfile' => getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') ? 'core/lib/supplier_order.lib.php' : 'core/lib/fourn.lib.php',
538 'tabid' => 'supplierorder',
539 'headlabel' => 'Suppliers',
540 'textobject' => 'SuppliersOrders',
541 'headpicto' => 'company',
542 'title' => 'SuppliersSetup',
543 'helpurl' => '',
544 'langs' => array('admin', 'other', 'orders'),
545 ),
546 'commande_fournisseurdet' => array(
547 'headfunction' => getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') ? 'supplier_order_admin_prepare_head' : 'supplierorder_admin_prepare_head',
548 'headfile' => getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') ? 'core/lib/supplier_order.lib.php' : 'core/lib/fourn.lib.php',
549 'tabid' => 'supplierorderdet',
550 'headlabel' => 'Suppliers',
551 'textobject' => 'SuppliersOrders',
552 'headpicto' => 'company',
553 'title' => 'SuppliersSetup',
554 'helpurl' => '',
555 'langs' => array('admin', 'other', 'orders'),
556 ),
557 // The supplier invoice module is mid-transition between the legacy 'fournisseur'
558 // module (core/lib/fourn.lib.php, function supplierorder_admin_prepare_head())
559 // and the new split 'supplier_invoice' module (core/lib/supplier_invoice.lib.php,
560 // function supplier_invoice_admin_prepare_head()), selected at runtime by the
561 // MAIN_USE_NEW_SUPPLIERMOD conf option — this mirrors the exact conditional
562 // the original (now-deleted) per-object supplier invoice extrafields admin wrapper
563 // files used to pick which lib file to require and which head function
564 // to call. Both functions build a $head array containing the same
565 // 'supplierinvoice' / 'supplierinvoicedet' / 'attributesrec' / 'attributeslinesrec'
566 // tab ids, so only headfunction/headfile need to vary.
567 'facture_fourn' => array(
568 'headfunction' => getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') ? 'supplier_invoice_admin_prepare_head' : 'supplierorder_admin_prepare_head',
569 'headfile' => getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') ? 'core/lib/supplier_invoice.lib.php' : 'core/lib/fourn.lib.php',
570 'tabid' => 'supplierinvoice',
571 'headlabel' => 'Suppliers',
572 'textobject' => 'BillsSuppliers',
573 'headpicto' => 'company',
574 'title' => 'SuppliersSetup',
575 'helpurl' => '',
576 'langs' => array('admin', 'other', 'bills', 'orders', 'suppliers'),
577 ),
578 'facture_fourn_det' => array(
579 'headfunction' => getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') ? 'supplier_invoice_admin_prepare_head' : 'supplierorder_admin_prepare_head',
580 'headfile' => getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') ? 'core/lib/supplier_invoice.lib.php' : 'core/lib/fourn.lib.php',
581 'tabid' => 'supplierinvoicedet',
582 'headlabel' => 'Suppliers',
583 'textobject' => 'BillsSuppliers',
584 'headpicto' => 'company',
585 'title' => 'SuppliersSetup',
586 'helpurl' => '',
587 'langs' => array('admin', 'other', 'bills', 'orders', 'suppliers'),
588 ),
589 'facture_fourn_rec' => array(
590 'headfunction' => getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') ? 'supplier_invoice_admin_prepare_head' : 'supplierorder_admin_prepare_head',
591 'headfile' => getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') ? 'core/lib/supplier_invoice.lib.php' : 'core/lib/fourn.lib.php',
592 'tabid' => 'attributesrec',
593 'headlabel' => 'Suppliers',
594 'textobject' => 'BillsSuppliers',
595 'headpicto' => 'company',
596 'title' => 'SuppliersSetup',
597 'helpurl' => '',
598 'langs' => array('admin', 'other', 'bills', 'orders', 'suppliers'),
599 ),
600 'facture_fourn_det_rec' => array(
601 'headfunction' => getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') ? 'supplier_invoice_admin_prepare_head' : 'supplierorder_admin_prepare_head',
602 'headfile' => getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') ? 'core/lib/supplier_invoice.lib.php' : 'core/lib/fourn.lib.php',
603 'tabid' => 'attributeslinesrec',
604 'headlabel' => 'Suppliers',
605 'textobject' => 'BillsSuppliers',
606 'headpicto' => 'company',
607 'title' => 'SuppliersSetup',
608 'helpurl' => '',
609 'langs' => array('admin', 'other', 'bills', 'orders', 'suppliers'),
610 ),
611 'resource' => array(
612 'headfunction' => 'resource_admin_prepare_head',
613 'headfile' => 'core/lib/resource.lib.php',
614 'tabid' => 'attributes',
615 'headlabel' => 'ResourceSingular',
616 'textobject' => 'ResourceSingular',
617 'headpicto' => 'action',
618 'title' => 'ResourceSetup',
619 'helpurl' => '',
620 'langs' => array('admin', 'other', 'resource'),
621 ),
622 'ticket' => array(
623 'headfunction' => 'ticketAdminPrepareHead',
624 'headfile' => 'core/lib/ticket.lib.php',
625 'tabid' => 'attributes',
626 'headlabel' => 'Module56000Name',
627 'textobject' => 'Ticket',
628 'headpicto' => 'ticket',
629 'title' => 'TicketSetup',
630 'helpurl' => 'FR:Module_Ticket',
631 'langs' => array('ticket', 'admin'),
632 ),
633 'asset' => array(
634 'headfunction' => 'assetAdminPrepareHead',
635 'headfile' => 'core/lib/asset.lib.php',
636 'tabid' => 'asset_extrafields',
637 'headlabel' => 'AssetSetup',
638 'textobject' => 'Assets',
639 'headpicto' => 'asset',
640 'title' => 'AssetSetup',
641 'helpurl' => '',
642 'langs' => array('assets', 'admin', 'companies'),
643 ),
644 'asset_model' => array(
645 'headfunction' => 'assetAdminPrepareHead',
646 'headfile' => 'core/lib/asset.lib.php',
647 'tabid' => 'assetmodel_extrafields',
648 'headlabel' => 'AssetSetup',
649 'textobject' => 'AssetModels',
650 'headpicto' => 'asset',
651 'title' => 'AssetSetup',
652 'helpurl' => '',
653 'langs' => array('assets', 'admin', 'companies'),
654 ),
655 'workstation_workstation' => array(
656 'headfunction' => 'workstationAdminPrepareHead',
657 'headfile' => 'workstation/lib/workstation.lib.php',
658 'tabid' => 'workstation_extrafields',
659 'headlabel' => 'WorkstationSetup',
660 'textobject' => 'Workstation',
661 'headpicto' => 'workstation',
662 'title' => 'WorkstationSetup',
663 'helpurl' => '',
664 'langs' => array('workstation', 'admin'),
665 ),
666 'categorie' => array(
667 'headfunction' => 'categoriesadmin_prepare_head',
668 'headfile' => 'core/lib/categories.lib.php',
669 'tabid' => 'attributes_categories',
670 'headlabel' => 'Categories',
671 'textobject' => 'Categories',
672 'headpicto' => 'category',
673 'title' => 'Categories',
674 'helpurl' => 'EN:Module Categories|FR:Module Catégories|ES:Módulo Categorías|DE:Modul_Kategorien',
675 'langs' => array('categories', 'admin'),
676 ),
677 'categorie_lang' => array(
678 'headfunction' => 'categoriesadmin_prepare_head',
679 'headfile' => 'core/lib/categories.lib.php',
680 'tabid' => 'translationAttributes',
681 'headlabel' => 'CategoriesTranslationsExtrafields',
682 'textobject' => 'Category',
683 'headpicto' => 'categorie',
684 'title' => 'CategoriesTranslationsExtrafields',
685 'helpurl' => '',
686 'langs' => array('admin', 'categories'),
687 ),
688 'propal' => array(
689 'headfunction' => 'propal_admin_prepare_head',
690 'headfile' => 'core/lib/propal.lib.php',
691 'tabid' => 'attributes',
692 'headlabel' => 'Proposals',
693 'textobject' => 'Proposals',
694 'headpicto' => 'propal',
695 'title' => 'PropalSetup',
696 'helpurl' => '',
697 'langs' => array('companies', 'admin', 'propal'),
698 ),
699 'propaldet' => array(
700 'headfunction' => 'propal_admin_prepare_head',
701 'headfile' => 'core/lib/propal.lib.php',
702 'tabid' => 'attributeslines',
703 'headlabel' => 'Proposals',
704 'textobject' => 'Proposals',
705 'headpicto' => 'propal',
706 'title' => 'PropalSetup',
707 'helpurl' => '',
708 'langs' => array('admin', 'other', 'propal'),
709 ),
710 'supplier_proposal' => array(
711 'headfunction' => 'supplier_proposal_admin_prepare_head',
712 'headfile' => 'core/lib/supplier_proposal.lib.php',
713 'tabid' => 'attributes',
714 'headlabel' => 'CommRequests',
715 'textobject' => 'CommRequests',
716 'headpicto' => 'supplier_proposal',
717 'title' => 'SupplierProposalSetup',
718 'helpurl' => '',
719 'langs' => array('companies', 'admin', 'supplier_proposal'),
720 ),
721 'supplier_proposaldet' => array(
722 'headfunction' => 'supplier_proposal_admin_prepare_head',
723 'headfile' => 'core/lib/supplier_proposal.lib.php',
724 'tabid' => 'attributeslines',
725 'headlabel' => 'CommRequests',
726 'textobject' => 'CommRequests',
727 'headpicto' => 'supplier_proposal',
728 'title' => 'SupplierProposalSetup',
729 'helpurl' => '',
730 'langs' => array('admin', 'other', 'supplier_proposal'),
731 ),
732 'facture' => array(
733 'headfunction' => 'invoice_admin_prepare_head',
734 'headfile' => 'core/lib/invoice.lib.php',
735 'tabid' => 'attributes',
736 'headlabel' => 'Invoices',
737 'textobject' => function () {
738 global $langs;
739 return strtolower($langs->transnoentitiesnoconv("BillsCustomers"));
740 },
741 'headpicto' => 'bill',
742 'title' => 'BillsSetup',
743 'helpurl' => '',
744 'langs' => array('companies', 'admin', 'bills'),
745 ),
746 'facturedet' => array(
747 'headfunction' => 'invoice_admin_prepare_head',
748 'headfile' => 'core/lib/invoice.lib.php',
749 'tabid' => 'attributeslines',
750 'headlabel' => 'Invoices',
751 'textobject' => function () {
752 global $langs;
753 return strtolower($langs->transnoentitiesnoconv("BillsCustomers"));
754 },
755 'headpicto' => 'bill',
756 'title' => 'BillsSetup',
757 'helpurl' => '',
758 'langs' => array('companies', 'admin', 'bills'),
759 ),
760 'facture_rec' => array(
761 'headfunction' => 'invoice_admin_prepare_head',
762 'headfile' => 'core/lib/invoice.lib.php',
763 'tabid' => 'attributesrec',
764 'headlabel' => 'Invoices',
765 'textobject' => function () {
766 global $langs;
767 return strtolower($langs->transnoentitiesnoconv("BillsCustomers"));
768 },
769 'headpicto' => 'bill',
770 'title' => 'BillsSetup',
771 'helpurl' => '',
772 'langs' => array('companies', 'admin', 'bills'),
773 ),
774 'facturedet_rec' => array(
775 'headfunction' => 'invoice_admin_prepare_head',
776 'headfile' => 'core/lib/invoice.lib.php',
777 'tabid' => 'attributeslinesrec',
778 'headlabel' => 'Invoices',
779 'textobject' => function () {
780 global $langs;
781 return strtolower($langs->transnoentitiesnoconv("BillsCustomers"));
782 },
783 'headpicto' => 'bill',
784 'title' => 'BillsSetup',
785 'helpurl' => '',
786 'langs' => array('companies', 'admin', 'bills'),
787 ),
788 'contrat' => array(
789 'headfunction' => 'contract_admin_prepare_head',
790 'headfile' => 'core/lib/contract.lib.php',
791 'tabid' => 'attributes',
792 'headlabel' => 'Contracts',
793 'headpicto' => 'contract',
794 'title' => 'ContractsSetup',
795 'helpurl' => 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio',
796 'langs' => array('companies', 'admin', 'contracts'),
797 ),
798 'contratdet' => array(
799 'headfunction' => 'contract_admin_prepare_head',
800 'headfile' => 'core/lib/contract.lib.php',
801 'tabid' => 'attributeslines',
802 'headlabel' => 'Contracts',
803 'headpicto' => 'contract',
804 'title' => 'ContractsSetup',
805 'helpurl' => 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio',
806 'langs' => array('companies', 'admin', 'contracts'),
807 ),
808 'don' => array(
809 'headfunction' => 'donation_admin_prepare_head',
810 'headfile' => 'core/lib/donation.lib.php',
811 'tabid' => 'attributes',
812 'headlabel' => 'Donations',
813 'textobject' => 'Donations',
814 'headpicto' => 'payment',
815 'title' => 'DonationsSetup',
816 'helpurl' => '',
817 'langs' => array('companies', 'admin', 'donations'),
818 ),
819 'fichinter' => array(
820 'headfunction' => 'fichinter_admin_prepare_head',
821 'headfile' => 'core/lib/fichinter.lib.php',
822 'tabid' => 'attributes',
823 'headlabel' => 'Interventions',
824 'textobject' => 'Interventions',
825 'headpicto' => 'intervention',
826 'title' => 'InterventionsSetup',
827 'helpurl' => '',
828 'langs' => array('companies', 'admin', 'members', 'interventions'),
829 ),
830 'fichinterdet' => array(
831 'headfunction' => 'fichinter_admin_prepare_head',
832 'headfile' => 'core/lib/fichinter.lib.php',
833 'tabid' => 'attributesdet',
834 'headlabel' => 'Interventions',
835 'textobject' => 'Interventions',
836 'headpicto' => 'intervention',
837 'title' => 'InterventionsSetup',
838 'helpurl' => '',
839 'langs' => array('companies', 'admin', 'members', 'interventions'),
840 ),
841 'hrm_skill' => array(
842 'headfunction' => 'hrmAdminPrepareHead',
843 'headfile' => 'hrm/lib/hrm.lib.php',
844 'tabid' => 'skillsAttributes',
845 'headlabel' => 'HrmSetup',
846 'textobject' => 'Skills',
847 'headpicto' => 'hrm',
848 'title' => 'HrmSetup',
849 'helpurl' => '',
850 'langs' => array('hrm', 'admin'),
851 ),
852 'hrm_job' => array(
853 'headfunction' => 'hrmAdminPrepareHead',
854 'headfile' => 'hrm/lib/hrm.lib.php',
855 'tabid' => 'jobsAttributes',
856 'headlabel' => 'HrmSetup',
857 'textobject' => 'JobProfile',
858 'headpicto' => 'hrm',
859 'title' => 'HrmSetup',
860 'helpurl' => '',
861 'langs' => array('hrm', 'admin'),
862 ),
863 'hrm_evaluation' => array(
864 'headfunction' => 'hrmAdminPrepareHead',
865 'headfile' => 'hrm/lib/hrm.lib.php',
866 'tabid' => 'evaluationsAttributes',
867 'headlabel' => 'HrmSetup',
868 'textobject' => 'Evaluation',
869 'headpicto' => 'hrm',
870 'title' => 'HrmSetup',
871 'helpurl' => '',
872 'langs' => array('hrm', 'admin'),
873 ),
874 'partnership' => array(
875 'headfunction' => 'partnershipAdminPrepareHead',
876 'headfile' => 'partnership/lib/partnership.lib.php',
877 'tabid' => 'partnership_extrafields',
878 'headlabel' => 'PartnershipSetup',
879 'textobject' => 'Partnership',
880 'headpicto' => 'partnership',
881 'title' => 'PartnershipSetup',
882 'helpurl' => '',
883 'langs' => array('partnership', 'admin'),
884 ),
885 'projet' => array(
886 'headfunction' => 'project_admin_prepare_head',
887 'headfile' => 'core/lib/project.lib.php',
888 'tabid' => 'attributes',
889 'headlabel' => 'Projects',
890 'textobject' => 'Project',
891 'headpicto' => 'project',
892 'title' => 'ProjectsSetup',
893 'helpurl' => '',
894 'langs' => array('project', 'admin'),
895 ),
896 'projet_task' => array(
897 'headfunction' => 'project_admin_prepare_head',
898 'headfile' => 'core/lib/project.lib.php',
899 'tabid' => 'attributes_task',
900 'headlabel' => 'Projects',
901 'textobject' => 'Project',
902 'headpicto' => 'project',
903 'title' => 'ProjectsSetup',
904 'helpurl' => '',
905 'langs' => array('project', 'admin'),
906 ),
907 'recruitment_recruitmentjobposition' => array(
908 'headfunction' => 'recruitmentAdminPrepareHead',
909 'headfile' => 'recruitment/lib/recruitment.lib.php',
910 'tabid' => 'jobposition_extrafields',
911 'headlabel' => '',
912 'textobject' => 'JobPosition',
913 'headpicto' => '',
914 'title' => 'RecruitmentSetup',
915 'helpurl' => '',
916 'langs' => array('recruitment', 'admin'),
917 ),
918 'recruitment_recruitmentcandidature' => array(
919 'headfunction' => 'recruitmentAdminPrepareHead',
920 'headfile' => 'recruitment/lib/recruitment.lib.php',
921 'tabid' => 'candidature_extrafields',
922 'headlabel' => '',
923 'textobject' => 'Candidature',
924 'headpicto' => '',
925 'title' => 'RecruitmentSetup',
926 'helpurl' => '',
927 'langs' => array('recruitment', 'admin'),
928 ),
929 'salary' => array(
930 'headfunction' => 'salaries_admin_prepare_head',
931 'headfile' => 'core/lib/salaries.lib.php',
932 'tabid' => 'attributes',
933 'headlabel' => 'Salaries',
934 'textobject' => 'Salaries',
935 'headpicto' => 'payment',
936 'title' => 'SalariesSetup',
937 'helpurl' => '',
938 'langs' => array('admin', 'salaries'),
939 ),
940 'user' => array(
941 'headfunction' => 'user_admin_prepare_head',
942 'headfile' => 'core/lib/usergroups.lib.php',
943 'tabid' => 'attributes',
944 'headlabel' => 'MenuUsersAndGroups',
945 'textobject' => 'Users',
946 'headpicto' => 'user',
947 'title' => 'UsersSetup',
948 'helpurl' => 'EN:Module_Users|FR:Module_Utilisateurs|ES:M&oacute;dulo_Usuarios|DE:Modul_Benutzer',
949 'langs' => array('users', 'admin'),
950 ),
951 'usergroup' => array(
952 'headfunction' => 'user_admin_prepare_head',
953 'headfile' => 'core/lib/usergroups.lib.php',
954 'tabid' => 'attributes_group',
955 'headlabel' => 'MenuUsersAndGroups',
956 'textobject' => 'Groups',
957 'headpicto' => 'user',
958 'title' => 'UsersSetup',
959 'helpurl' => 'EN:Module_Users|FR:Module_Utilisateurs|ES:M&oacute;dulo_Usuarios',
960 'langs' => array('users', 'admin'),
961 ),
962 'bookcal_availabilities' => array(
963 'headfunction' => 'bookcalAdminPrepareHead',
964 'headfile' => 'bookcal/lib/bookcal.lib.php',
965 'tabid' => 'availabilities_extrafields',
966 'headlabel' => 'BookCalSetup',
967 'headpicto' => 'fa-calendar-check',
968 'title' => 'BookCalSetup',
969 'helpurl' => '',
970 'langs' => array('agenda', 'admin'),
971 ),
972 'bookcal_calendar' => array(
973 'headfunction' => 'bookcalAdminPrepareHead',
974 'headfile' => 'bookcal/lib/bookcal.lib.php',
975 'tabid' => 'calendar_extrafields',
976 'headlabel' => 'BookCalSetup',
977 'headpicto' => 'agenda',
978 'title' => 'BookCalSetup',
979 'helpurl' => '',
980 'langs' => array('agenda', 'admin'),
981 ),
982 'quickmemo_memo' => array(
983 'headfunction' => 'quickmemoAdminPrepareHead',
984 'headfile' => 'quickmemo/lib/quickmemo.lib.php',
985 'tabid' => 'memo_extrafields',
986 'headlabel' => 'QuickMemoSetup',
987 'textobject' => 'Memo',
988 'headpicto' => 'quickmemo@quickmemo',
989 'title' => 'QuickMemoSetup',
990 'helpurl' => '',
991 'langs' => array('quickmemo', 'admin'),
992 ),
993 );
994
995 // Let hooked modules contribute additional elementtype entries without editing this file.
996 // See the docblock above for the required entry shape and the core-wins collision rule.
997 if ($hookmanager instanceof HookManager) {
998 $parameters = array('extrafieldsadminmap' => $extrafieldsadminmap);
999 $tmpobject = new stdClass();
1000 $hookaction = '';
1001 $reshook = $hookmanager->executeHooks('getExtrafieldsAdminMap', $parameters, $tmpobject, $hookaction);
1002 if ($reshook >= 0 && !empty($hookmanager->resArray['extrafieldsadminmap']) && is_array($hookmanager->resArray['extrafieldsadminmap'])) {
1003 // '+=' (array union), not array_merge(): keeps the core (left-hand) entry on key
1004 // collision instead of letting a hook silently redefine an existing core page.
1005 $extrafieldsadminmap += $hookmanager->resArray['extrafieldsadminmap'];
1006 }
1007 }
1008
1009 return $extrafieldsadminmap;
1010}
getExtrafieldsAdminMap()
Return the whitelist of elementtype values accepted by htdocs/admin/extrafields.php,...
extrafieldsAdminProductServiceLabel($keyBoth, $keyServiceOnly, $keyProductOnly, $noconv=false)
Build a closure that mirrors the isModEnabled("product")/isModEnabled("service") conditional found ac...
Class to manage hooks.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.