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