38require
'../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
48$langs->loadLangs(array(
"errors",
"admin",
"main",
"companies",
"resource",
"holiday",
"accountancy",
"hrm",
"orders",
"contracts",
"projects",
"propal",
"bills",
"interventions",
"ticket"));
50$action =
GETPOST(
'action',
'alpha') ?
GETPOST(
'action',
'alpha') :
'view';
51$confirm =
GETPOST(
'confirm',
'alpha');
53$rowid =
GETPOST(
'rowid',
'alpha');
54$entity =
GETPOST(
'entity',
'int');
55$code =
GETPOST(
'code',
'alpha');
57$acts = array(); $actl = array();
60$actl[0] =
img_picto($langs->trans(
"Disabled"),
'switch_off',
'class="size15x"');
61$actl[1] =
img_picto($langs->trans(
"Activated"),
'switch_on',
'class="size15x"');
64$listoffset =
GETPOST(
'listoffset');
65$listlimit =
GETPOST(
'listlimit') > 0 ?
GETPOST(
'listlimit') : 1000;
66$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
67$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
68$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
69if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
73$offset = $listlimit * $page;
77$search_country_id =
GETPOST(
'search_country_id',
'int');
78$search_code =
GETPOST(
'search_code',
'alpha');
79$search_active =
GETPOST(
'search_active',
'alpha');
82if (!GETPOSTISSET(
'search_country_id') && $search_country_id ==
'' && ($id == 2 || $id == 3 || $id == 10)) {
83 $search_country_id = $mysoc->country_id;
87$hookmanager->initHooks(array(
'admin',
'dictionaryadmin'));
89$allowed = $user->admin;
90if ($id == 7 && $user->hasRight(
'accounting',
'chartofaccount')) {
93if ($id == 10 && $user->hasRight(
'accounting',
'chartofaccount')) {
96if ($id == 17 && $user->hasRight(
'accounting',
'chartofaccount')) {
103$permissiontoadd = $allowed;
110$taborder = array(9, 15, 30, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 24, 0, 29, 0, 33, 34, 32, 28, 17, 35, 36, 0, 10, 31, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 37, 42, 0, 43, 0, 25, 0, 44, 0);
114$tabname[1] =
"c_forme_juridique";
115$tabname[2] =
"c_departements";
116$tabname[3] =
"c_regions";
117$tabname[4] =
"c_country";
118$tabname[5] =
"c_civility";
119$tabname[6] =
"c_actioncomm";
120$tabname[7] =
"c_chargesociales";
121$tabname[8] =
"c_typent";
122$tabname[9] =
"c_currencies";
123$tabname[10] =
"c_tva";
124$tabname[11] =
"c_type_contact";
125$tabname[12] =
"c_payment_term";
126$tabname[13] =
"c_paiement";
127$tabname[14] =
"c_ecotaxe";
128$tabname[15] =
"c_paper_format";
129$tabname[16] =
"c_prospectlevel";
130$tabname[17] =
"c_type_fees";
131$tabname[18] =
"c_shipment_mode";
132$tabname[19] =
"c_effectif";
133$tabname[20] =
"c_input_method";
134$tabname[21] =
"c_availability";
135$tabname[22] =
"c_input_reason";
136$tabname[23] =
"c_revenuestamp";
137$tabname[24] =
"c_type_resource";
138$tabname[25] =
"c_type_container";
140$tabname[27] =
"c_stcomm";
141$tabname[28] =
"c_holiday_types";
142$tabname[29] =
"c_lead_status";
143$tabname[30] =
"c_format_cards";
144$tabname[31] =
"c_invoice_subtype";
145$tabname[32] =
"c_hrm_public_holiday";
146$tabname[33] =
"c_hrm_department";
147$tabname[34] =
"c_hrm_function";
148$tabname[35] =
"c_exp_tax_cat";
149$tabname[36] =
"c_exp_tax_range";
150$tabname[37] =
"c_units";
151$tabname[38] =
"c_socialnetworks";
152$tabname[39] =
"c_prospectcontactlevel";
153$tabname[40] =
"c_stcommcontact";
154$tabname[41] =
"c_transport_mode";
155$tabname[42] =
"c_product_nature";
156$tabname[43] =
"c_productbatch_qcstatus";
157$tabname[44] =
"c_asset_disposal_type";
161$tablib[1] =
"DictionaryCompanyJuridicalType";
162$tablib[2] =
"DictionaryCanton";
163$tablib[3] =
"DictionaryRegion";
164$tablib[4] =
"DictionaryCountry";
165$tablib[5] =
"DictionaryCivility";
166$tablib[6] =
"DictionaryActions";
167$tablib[7] =
"DictionarySocialContributions";
168$tablib[8] =
"DictionaryCompanyType";
169$tablib[9] =
"DictionaryCurrency";
170$tablib[10] =
"DictionaryVAT";
171$tablib[11] =
"DictionaryTypeContact";
172$tablib[12] =
"DictionaryPaymentConditions";
173$tablib[13] =
"DictionaryPaymentModes";
174$tablib[14] =
"DictionaryEcotaxe";
175$tablib[15] =
"DictionaryPaperFormat";
176$tablib[16] =
"DictionaryProspectLevel";
177$tablib[17] =
"DictionaryFees";
178$tablib[18] =
"DictionarySendingMethods";
179$tablib[19] =
"DictionaryStaff";
180$tablib[20] =
"DictionaryOrderMethods";
181$tablib[21] =
"DictionaryAvailability";
182$tablib[22] =
"DictionarySource";
183$tablib[23] =
"DictionaryRevenueStamp";
184$tablib[24] =
"DictionaryResourceType";
185$tablib[25] =
"DictionaryTypeOfContainer";
187$tablib[27] =
"DictionaryProspectStatus";
188$tablib[28] =
"DictionaryHolidayTypes";
189$tablib[29] =
"DictionaryOpportunityStatus";
190$tablib[30] =
"DictionaryFormatCards";
191$tablib[31] =
"DictionaryInvoiceSubtype";
192$tablib[32] =
"DictionaryPublicHolidays";
193$tablib[33] =
"DictionaryDepartment";
194$tablib[34] =
"DictionaryFunction";
195$tablib[35] =
"DictionaryExpenseTaxCat";
196$tablib[36] =
"DictionaryExpenseTaxRange";
197$tablib[37] =
"DictionaryMeasuringUnits";
198$tablib[38] =
"DictionarySocialNetworks";
199$tablib[39] =
"DictionaryProspectContactLevel";
200$tablib[40] =
"DictionaryProspectContactStatus";
201$tablib[41] =
"DictionaryTransportMode";
202$tablib[42] =
"DictionaryProductNature";
203$tablib[43] =
"DictionaryBatchStatus";
204$tablib[44] =
"DictionaryAssetDisposalType";
208$tabsql[1] =
"SELECT f.rowid as rowid, f.code, f.libelle, c.code as country_code, c.label as country, f.active FROM ".MAIN_DB_PREFIX.
"c_forme_juridique as f, ".MAIN_DB_PREFIX.
"c_country as c WHERE f.fk_pays=c.rowid";
209$tabsql[2] =
"SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, c.code as country_code, c.label as country, d.active FROM ".MAIN_DB_PREFIX.
"c_departements as d, ".MAIN_DB_PREFIX.
"c_regions as r, ".MAIN_DB_PREFIX.
"c_country as c WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and r.active=1 and c.active=1";
210$tabsql[3] =
"SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM ".MAIN_DB_PREFIX.
"c_regions as r, ".MAIN_DB_PREFIX.
"c_country as c WHERE r.fk_pays=c.rowid and c.active=1";
211$tabsql[4] =
"SELECT c.rowid as rowid, c.code, c.label, c.active, c.favorite, c.eec FROM ".MAIN_DB_PREFIX.
"c_country AS c";
212$tabsql[5] =
"SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX.
"c_civility AS c";
213$tabsql[6] =
"SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM ".MAIN_DB_PREFIX.
"c_actioncomm AS a";
214$tabsql[7] =
"SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX.
"c_chargesociales AS a, ".MAIN_DB_PREFIX.
"c_country as c WHERE a.fk_pays = c.rowid and c.active = 1";
215$tabsql[8] =
"SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.position, t.active FROM ".MAIN_DB_PREFIX.
"c_typent as t LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as c ON t.fk_country=c.rowid";
216$tabsql[9] =
"SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX.
"c_currencies AS c";
217$tabsql[10] =
"SELECT t.rowid, t.entity, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX.
"c_tva as t, ".MAIN_DB_PREFIX.
"c_country as c WHERE t.fk_pays = c.rowid AND t.entity IN (".
getEntity($tabname[10]).
")";
218$tabsql[11] =
"SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX.
"c_type_contact AS t";
219$tabsql[12] =
"SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.deposit_percent, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX.
"c_payment_term AS c WHERE c.entity IN (".
getEntity($tabname[12]).
")";
220$tabsql[13] =
"SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX.
"c_paiement AS c WHERE c.entity IN (".
getEntity($tabname[13]).
")";
221$tabsql[14] =
"SELECT e.rowid as rowid, e.code as code, e.label, e.price, e.organization, e.fk_pays as country_id, c.code as country_code, c.label as country, e.active FROM ".MAIN_DB_PREFIX.
"c_ecotaxe AS e, ".MAIN_DB_PREFIX.
"c_country as c WHERE e.fk_pays=c.rowid and c.active=1";
222$tabsql[15] =
"SELECT t.rowid as rowid, t.code, t.label as libelle, t.width, t.height, t.unit, t.active FROM ".MAIN_DB_PREFIX.
"c_paper_format as t";
223$tabsql[16] =
"SELECT t.code, t.label as libelle, t.sortorder, t.active FROM ".MAIN_DB_PREFIX.
"c_prospectlevel as t";
224$tabsql[17] =
"SELECT t.id as rowid, t.code, t.label, t.accountancy_code, t.active FROM ".MAIN_DB_PREFIX.
"c_type_fees as t";
225$tabsql[18] =
"SELECT t.rowid as rowid, t.code, t.libelle, t.tracking, t.active FROM ".MAIN_DB_PREFIX.
"c_shipment_mode as t";
226$tabsql[19] =
"SELECT t.id as rowid, t.code, t.libelle, t.active FROM ".MAIN_DB_PREFIX.
"c_effectif as t";
227$tabsql[20] =
"SELECT t.rowid as rowid, t.code, t.libelle, t.active FROM ".MAIN_DB_PREFIX.
"c_input_method as t";
228$tabsql[21] =
"SELECT c.rowid as rowid, c.code, c.label, c.type_duration, c.qty, c.active, c.position FROM ".MAIN_DB_PREFIX.
"c_availability AS c";
229$tabsql[22] =
"SELECT t.rowid as rowid, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_input_reason as t";
230$tabsql[23] =
"SELECT t.rowid as rowid, t.taux, t.revenuestamp_type, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX.
"c_revenuestamp as t, ".MAIN_DB_PREFIX.
"c_country as c WHERE t.fk_pays=c.rowid";
231$tabsql[24] =
"SELECT t.rowid as rowid, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_type_resource as t";
232$tabsql[25] =
"SELECT t.rowid as rowid, t.code, t.label, t.active, t.module FROM ".MAIN_DB_PREFIX.
"c_type_container as t WHERE t.entity IN (".
getEntity($tabname[25]).
")";
234$tabsql[27] =
"SELECT t.id as rowid, t.code, t.libelle, t.picto, t.active FROM ".MAIN_DB_PREFIX.
"c_stcomm as t";
235$tabsql[28] =
"SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.block_if_negative, h.sortorder, h.active FROM ".MAIN_DB_PREFIX.
"c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as c ON h.fk_country=c.rowid";
236$tabsql[29] =
"SELECT t.rowid as rowid, t.code, t.label, percent, t.position, t.active FROM ".MAIN_DB_PREFIX.
"c_lead_status as t";
237$tabsql[30] =
"SELECT t.rowid, t.code, t.name, t.paper_size, t.orientation, t.metric, t.leftmargin, t.topmargin, t.nx, t.ny, t.spacex, t.spacey, t.width, t.height, t.font_size, t.custom_x, t.custom_y, t.active FROM ".MAIN_DB_PREFIX.
"c_format_cards as t";
238$tabsql[31] =
"SELECT t.rowid, t.code, t.label, c.label as country, c.code as country_code, t.fk_country as country_id, t.active FROM ".MAIN_DB_PREFIX.
"c_invoice_subtype as t, ".MAIN_DB_PREFIX.
"c_country as c WHERE t.fk_country = c.rowid";
239$tabsql[32] =
"SELECT a.id as rowid, a.entity, a.code, a.fk_country as country_id, c.code as country_code, c.label as country, a.dayrule, a.day, a.month, a.year, a.active FROM ".MAIN_DB_PREFIX.
"c_hrm_public_holiday as a LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as c ON a.fk_country=c.rowid AND c.active=1";
240$tabsql[33] =
"SELECT t.rowid, t.pos, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_hrm_department as t";
241$tabsql[34] =
"SELECT t.rowid, t.pos, t.code, t.label, t.c_level, t.active FROM ".MAIN_DB_PREFIX.
"c_hrm_function as t";
242$tabsql[35] =
"SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX.
"c_exp_tax_cat as c";
243$tabsql[36] =
"SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX.
"c_exp_tax_range r";
244$tabsql[37] =
"SELECT r.rowid, r.code, r.sortorder, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX.
"c_units r";
245$tabsql[38] =
"SELECT s.rowid, s.entity, s.code, s.label, s.url, s.icon, s.active FROM ".MAIN_DB_PREFIX.
"c_socialnetworks as s WHERE s.entity IN (".
getEntity($tabname[38]).
")";
246$tabsql[39] =
"SELECT t.code, t.label as libelle, t.sortorder, t.active FROM ".MAIN_DB_PREFIX.
"c_prospectcontactlevel as t";
247$tabsql[40] =
"SELECT t.id as rowid, t.code, t.libelle, t.picto, t.active FROM ".MAIN_DB_PREFIX.
"c_stcommcontact as t";
248$tabsql[41] =
"SELECT t.rowid as rowid, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_transport_mode as t";
249$tabsql[42] =
"SELECT t.rowid as rowid, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_product_nature as t";
250$tabsql[43] =
"SELECT t.rowid, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_productbatch_qcstatus as t";
251$tabsql[44] =
"SELECT t.rowid, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_asset_disposal_type as t";
254$tabsqlsort = array();
255$tabsqlsort[1] =
"country ASC, code ASC";
256$tabsqlsort[2] =
"country ASC, code ASC";
257$tabsqlsort[3] =
"country ASC, code ASC";
258$tabsqlsort[4] =
"code ASC";
259$tabsqlsort[5] =
"label ASC";
260$tabsqlsort[6] =
"a.type ASC, a.module ASC, a.position ASC, a.code ASC";
261$tabsqlsort[7] =
"c.label ASC, a.code ASC, a.libelle ASC";
262$tabsqlsort[8] =
"country DESC,".(getDolGlobalString(
'SOCIETE_SORT_ON_TYPEENT') ?
' t.position ASC,' :
'').
" libelle ASC";
263$tabsqlsort[9] =
"label ASC";
264$tabsqlsort[10] =
"country ASC, code ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
265$tabsqlsort[11] =
"t.element ASC, t.source ASC, t.position ASC, t.code ASC";
266$tabsqlsort[12] =
"sortorder ASC, code ASC";
267$tabsqlsort[13] =
"code ASC";
268$tabsqlsort[14] =
"country ASC, e.organization ASC, code ASC";
269$tabsqlsort[15] =
"rowid ASC";
270$tabsqlsort[16] =
"sortorder ASC";
271$tabsqlsort[17] =
"code ASC";
272$tabsqlsort[18] =
"code ASC, libelle ASC";
273$tabsqlsort[19] =
"id ASC";
274$tabsqlsort[20] =
"code ASC, libelle ASC";
275$tabsqlsort[21] =
"position ASC, type_duration ASC, qty ASC";
276$tabsqlsort[22] =
"code ASC, label ASC";
277$tabsqlsort[23] =
"country ASC, taux ASC";
278$tabsqlsort[24] =
"code ASC, label ASC";
279$tabsqlsort[25] =
"t.module ASC, t.code ASC, t.label ASC";
281$tabsqlsort[27] =
"code ASC";
282$tabsqlsort[28] =
"sortorder ASC, country ASC, code ASC";
283$tabsqlsort[29] =
"position ASC";
284$tabsqlsort[30] =
"code ASC";
285$tabsqlsort[31] =
"country ASC, code ASC";
286$tabsqlsort[32] =
"country, year ASC, month ASC, day ASC";
287$tabsqlsort[33] =
"code ASC";
288$tabsqlsort[34] =
"code ASC";
289$tabsqlsort[35] =
"c.label ASC";
290$tabsqlsort[36] =
"r.fk_c_exp_tax_cat ASC, r.range_ik ASC";
291$tabsqlsort[37] =
"sortorder ASC";
292$tabsqlsort[38] =
"rowid, code ASC";
293$tabsqlsort[39] =
"sortorder ASC";
294$tabsqlsort[40] =
"code ASC";
295$tabsqlsort[41] =
"code ASC";
296$tabsqlsort[42] =
"code ASC";
297$tabsqlsort[43] =
"code ASC";
298$tabsqlsort[44] =
"code ASC";
302$tabfield[1] =
"code,libelle,country";
303$tabfield[2] =
"code,libelle,region_id,region,country";
304$tabfield[3] =
"code,libelle,country_id,country";
305$tabfield[4] =
"code,label";
306$tabfield[5] =
"code,label";
307$tabfield[6] =
"code,libelle,type,color,position";
308$tabfield[7] =
"code,libelle,country,accountancy_code";
309$tabfield[8] =
"code,libelle,country_id,country".(getDolGlobalString(
'SOCIETE_SORT_ON_TYPEENT') ?
',position' :
'');
310$tabfield[9] =
"code,label,unicode";
311$tabfield[10] =
"country_id,country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
312$tabfield[11] =
"element,source,code,libelle,position";
313$tabfield[12] =
"code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder";
314$tabfield[13] =
"code,libelle,type";
315$tabfield[14] =
"code,label,price,organization,country";
316$tabfield[15] =
"code,libelle,width,height,unit";
317$tabfield[16] =
"code,libelle,sortorder";
318$tabfield[17] =
"code,label,accountancy_code";
319$tabfield[18] =
"code,libelle,tracking";
320$tabfield[19] =
"code,libelle";
321$tabfield[20] =
"code,libelle";
322$tabfield[21] =
"code,label,qty,type_duration,position";
323$tabfield[22] =
"code,label";
324$tabfield[23] =
"country_id,country,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note";
325$tabfield[24] =
"code,label";
326$tabfield[25] =
"code,label";
328$tabfield[27] =
"code,libelle,picto";
329$tabfield[28] =
"code,label,affect,delay,newbymonth,country_id,country,block_if_negative,sortorder";
330$tabfield[29] =
"code,label,percent,position";
331$tabfield[30] =
"code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
332$tabfield[31] =
"country_id,country,code,label";
333$tabfield[32] =
"code,dayrule,year,month,day,country_id,country";
334$tabfield[33] =
"code,label";
335$tabfield[34] =
"code,label";
336$tabfield[35] =
"label";
337$tabfield[36] =
"range_ik,fk_c_exp_tax_cat";
338$tabfield[37] =
"code,label,short_label,unit_type,scale,sortorder";
339$tabfield[38] =
"code,label,url,icon";
340$tabfield[39] =
"code,libelle,sortorder";
341$tabfield[40] =
"code,libelle,picto";
342$tabfield[41] =
"code,label";
343$tabfield[42] =
"code,label";
344$tabfield[43] =
"code,label";
345$tabfield[44] =
"code,label";
348$tabfieldvalue = array();
349$tabfieldvalue[1] =
"code,libelle,country";
350$tabfieldvalue[2] =
"code,libelle,region";
351$tabfieldvalue[3] =
"code,libelle,country";
352$tabfieldvalue[4] =
"code,label";
353$tabfieldvalue[5] =
"code,label";
354$tabfieldvalue[6] =
"code,libelle,type,color,position";
355$tabfieldvalue[7] =
"code,libelle,country,accountancy_code";
356$tabfieldvalue[8] =
"code,libelle,country".(getDolGlobalString(
'SOCIETE_SORT_ON_TYPEENT') ?
',position' :
'');
357$tabfieldvalue[9] =
"code,label,unicode";
358$tabfieldvalue[10] =
"country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
359$tabfieldvalue[11] =
"element,source,code,libelle,position";
360$tabfieldvalue[12] =
"code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder";
361$tabfieldvalue[13] =
"code,libelle,type";
362$tabfieldvalue[14] =
"code,label,price,organization,country";
363$tabfieldvalue[15] =
"code,libelle,width,height,unit";
364$tabfieldvalue[16] =
"code,libelle,sortorder";
365$tabfieldvalue[17] =
"code,label,accountancy_code";
366$tabfieldvalue[18] =
"code,libelle,tracking";
367$tabfieldvalue[19] =
"code,libelle";
368$tabfieldvalue[20] =
"code,libelle";
369$tabfieldvalue[21] =
"code,label,qty,type_duration,position";
370$tabfieldvalue[22] =
"code,label";
371$tabfieldvalue[23] =
"country,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note";
372$tabfieldvalue[24] =
"code,label";
373$tabfieldvalue[25] =
"code,label";
375$tabfieldvalue[27] =
"code,libelle,picto";
376$tabfieldvalue[28] =
"code,label,affect,delay,newbymonth,country,block_if_negative,sortorder";
377$tabfieldvalue[29] =
"code,label,percent,position";
378$tabfieldvalue[30] =
"code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
379$tabfieldvalue[31] =
"country,code,label";
380$tabfieldvalue[32] =
"code,dayrule,day,month,year,country";
381$tabfieldvalue[33] =
"code,label";
382$tabfieldvalue[34] =
"code,label";
383$tabfieldvalue[35] =
"label";
384$tabfieldvalue[36] =
"range_ik,fk_c_exp_tax_cat";
385$tabfieldvalue[37] =
"code,label,short_label,unit_type,scale,sortorder";
386$tabfieldvalue[38] =
"code,label,url,icon";
387$tabfieldvalue[39] =
"code,libelle,sortorder";
388$tabfieldvalue[40] =
"code,libelle,picto";
389$tabfieldvalue[41] =
"code,label";
390$tabfieldvalue[42] =
"code,label";
391$tabfieldvalue[43] =
"code,label";
392$tabfieldvalue[44] =
"code,label";
395$tabfieldinsert = array();
396$tabfieldinsert[1] =
"code,libelle,fk_pays";
397$tabfieldinsert[2] =
"code_departement,nom,fk_region";
398$tabfieldinsert[3] =
"code_region,nom,fk_pays";
399$tabfieldinsert[4] =
"code,label";
400$tabfieldinsert[5] =
"code,label";
401$tabfieldinsert[6] =
"code,libelle,type,color,position";
402$tabfieldinsert[7] =
"code,libelle,fk_pays,accountancy_code";
403$tabfieldinsert[8] =
"code,libelle,fk_country".(getDolGlobalString(
'SOCIETE_SORT_ON_TYPEENT') ?
',position' :
'');
404$tabfieldinsert[9] =
"code_iso,label,unicode";
405$tabfieldinsert[10] =
"fk_pays,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note,entity";
406$tabfieldinsert[11] =
"element,source,code,libelle,position";
407$tabfieldinsert[12] =
"code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder,entity";
408$tabfieldinsert[13] =
"code,libelle,type,entity";
409$tabfieldinsert[14] =
"code,label,price,organization,fk_pays";
410$tabfieldinsert[15] =
"code,label,width,height,unit";
411$tabfieldinsert[16] =
"code,label,sortorder";
412$tabfieldinsert[17] =
"code,label,accountancy_code";
413$tabfieldinsert[18] =
"code,libelle,tracking";
414$tabfieldinsert[19] =
"code,libelle";
415$tabfieldinsert[20] =
"code,libelle";
416$tabfieldinsert[21] =
"code,label,qty,type_duration,position";
417$tabfieldinsert[22] =
"code,label";
418$tabfieldinsert[23] =
"fk_pays,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note";
419$tabfieldinsert[24] =
"code,label";
420$tabfieldinsert[25] =
"code,label,entity";
422$tabfieldinsert[27] =
"code,libelle,picto";
423$tabfieldinsert[28] =
"code,label,affect,delay,newbymonth,fk_country,block_if_negative,sortorder";
424$tabfieldinsert[29] =
"code,label,percent,position";
425$tabfieldinsert[30] =
"code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
426$tabfieldinsert[31] =
"fk_country,code,label";
427$tabfieldinsert[32] =
"code,dayrule,day,month,year,fk_country";
428$tabfieldinsert[33] =
"code,label";
429$tabfieldinsert[34] =
"code,label";
430$tabfieldinsert[35] =
"label";
431$tabfieldinsert[36] =
"range_ik,fk_c_exp_tax_cat";
432$tabfieldinsert[37] =
"code,label,short_label,unit_type,scale,sortorder";
433$tabfieldinsert[38] =
"code,label,url,icon,entity";
434$tabfieldinsert[39] =
"code,label,sortorder";
435$tabfieldinsert[40] =
"code,libelle,picto";
436$tabfieldinsert[41] =
"code,label";
437$tabfieldinsert[42] =
"code,label";
438$tabfieldinsert[43] =
"code,label";
439$tabfieldinsert[44] =
"code,label";
448$tabrowid[4] =
"rowid";
449$tabrowid[5] =
"rowid";
453$tabrowid[9] =
"code_iso";
455$tabrowid[11] =
"rowid";
460$tabrowid[16] =
"code";
462$tabrowid[18] =
"rowid";
465$tabrowid[21] =
"rowid";
466$tabrowid[22] =
"rowid";
477$tabrowid[33] =
"rowid";
478$tabrowid[34] =
"rowid";
483$tabrowid[39] =
"code";
486$tabrowid[42] =
"rowid";
487$tabrowid[43] =
"rowid";
488$tabrowid[44] =
"rowid";
492$tabcond[1] = (isModEnabled(
"societe"));
496$tabcond[5] = (isModEnabled(
"societe") || isModEnabled(
'adherent'));
497$tabcond[6] = isModEnabled(
'agenda');
498$tabcond[7] = isModEnabled(
'tax');
499$tabcond[8] = isModEnabled(
"societe");
502$tabcond[11] = (isModEnabled(
"societe"));
503$tabcond[12] = (isModEnabled(
'commande') || isModEnabled(
"propal") || isModEnabled(
'facture') || isModEnabled(
"supplier_invoice") || isModEnabled(
"supplier_order"));
504$tabcond[13] = (isModEnabled(
'commande') || isModEnabled(
"propal") || isModEnabled(
'facture') || isModEnabled(
"supplier_invoice") || isModEnabled(
"supplier_order"));
505$tabcond[14] = (isModEnabled(
"product") && (isModEnabled(
'ecotax') ||
getDolGlobalString(
'MAIN_SHOW_ECOTAX_DICTIONNARY')));
507$tabcond[16] = (isModEnabled(
"societe") && !
getDolGlobalString(
'SOCIETE_DISABLE_PROSPECTS'));
508$tabcond[17] = (isModEnabled(
'deplacement') || isModEnabled(
'expensereport'));
509$tabcond[18] = isModEnabled(
"expedition") || isModEnabled(
"reception");
510$tabcond[19] = isModEnabled(
"societe");
511$tabcond[20] = isModEnabled(
"supplier_order");
512$tabcond[21] = isModEnabled(
"propal");
513$tabcond[22] = (isModEnabled(
'commande') || isModEnabled(
"propal"));
515$tabcond[24] = isModEnabled(
'resource');
516$tabcond[25] = isModEnabled(
'website');
518$tabcond[27] = isModEnabled(
"societe");
519$tabcond[28] = isModEnabled(
'holiday');
520$tabcond[29] = isModEnabled(
'project');
521$tabcond[30] = (isModEnabled(
'label') || isModEnabled(
'barcode') || isModEnabled(
'adherent'));
522$tabcond[31] = ((isModEnabled(
'facture') || isModEnabled(
'supplier_invoice')) && $mysoc->country_code ==
'GR');
523$tabcond[32] = (isModEnabled(
'holiday') || isModEnabled(
'hrm'));
524$tabcond[33] = isModEnabled(
'hrm');
525$tabcond[34] = isModEnabled(
'hrm');
526$tabcond[35] = isModEnabled(
'expensereport') &&
getDolGlobalString(
'MAIN_USE_EXPENSE_IK');
527$tabcond[36] = isModEnabled(
'expensereport') &&
getDolGlobalString(
'MAIN_USE_EXPENSE_IK');
528$tabcond[37] = isModEnabled(
"product");
529$tabcond[38] = isModEnabled(
'socialnetworks');
531$tabcond[40] = (isModEnabled(
"societe") &&
getDolGlobalString(
'THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES'));
532$tabcond[41] = isModEnabled(
'intracommreport');
533$tabcond[42] = isModEnabled(
"product");
534$tabcond[43] = isModEnabled(
"product") && isModEnabled(
'productbatch') &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') >= 2;
535$tabcond[44] = isModEnabled(
'asset');
542 'c_forme_juridique'=>array(
544 'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))
546 'c_departements'=>array(
548 'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))
552 'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))
554 'c_country'=>array(
'picto'=>
'country',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
555 'c_civility'=>array(
'picto'=>
'contact',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
556 'c_actioncomm'=>array(
'picto'=>
'action',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'color'=>$langs->trans(
"ColorFormat"),
'position'=>$langs->trans(
"PositionIntoComboList"))),
557 'c_chargesociales'=>array(
'picto'=>
'bill',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
558 'c_typent'=>array(
'picto'=>
'company',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'position'=>$langs->trans(
"PositionIntoComboList"))),
559 'c_currencies'=>array(
'picto'=>
'multicurrency',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'unicode'=>$langs->trans(
"UnicodeCurrency"))),
560 'c_tva'=>array(
'picto'=>
'bill',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'taux'=>$langs->trans(
"SellTaxRate"),
'recuperableonly'=>$langs->trans(
"RecuperableOnly"),
'localtax1_type'=>$langs->trans(
"LocalTaxDesc"),
'localtax2_type'=>$langs->trans(
"LocalTaxDesc"))),
561 'c_type_contact'=>array(
'picto'=>
'contact',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'position'=>$langs->trans(
"PositionIntoComboList"))),
562 'c_payment_term'=>array(
'picto'=>
'bill',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'type_cdr'=>$langs->trans(
"TypeCdr", $langs->transnoentitiesnoconv(
"NbOfDays"), $langs->transnoentitiesnoconv(
"Offset"), $langs->transnoentitiesnoconv(
"NbOfDays"), $langs->transnoentitiesnoconv(
"Offset")))),
563 'c_paiement'=>array(
'picto'=>
'bill',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
564 'c_ecotaxe'=>array(
'picto'=>
'bill',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
565 'c_paper_format'=>array(
'picto'=>
'generic',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
566 'c_prospectlevel'=>array(
'picto'=>
'company',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
567 'c_type_fees'=>array(
'picto'=>
'trip',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
568 'c_shipment_mode'=>array(
'picto'=>
'shipment',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'tracking'=>$langs->trans(
"UrlTrackingDesc"))),
569 'c_effectif'=>array(
'picto'=>
'company',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
570 'c_input_method'=>array(
'picto'=>
'order',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
571 'c_input_reason'=>array(
'picto'=>
'order',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'position'=>$langs->trans(
"PositionIntoComboList"))),
572 'c_availability'=>array(
'picto'=>
'shipment',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
573 'c_revenuestamp'=>array(
'picto'=>
'bill',
'help'=>array(
'revenuestamp_type'=>$langs->trans(
'FixedOrPercent'))),
574 'c_type_resource'=>array(
'picto'=>
'resource',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
575 'c_type_container'=>array(
'picto'=>
'website',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
576 'c_stcomm'=>array(
'picto'=>
'company',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'picto'=>$langs->trans(
"PictoHelp"))),
577 'c_holiday_types'=>array(
'picto'=>
'holiday',
'help'=>array(
'affect'=>$langs->trans(
"FollowedByACounter"),
'delay'=>$langs->trans(
"MinimumNoticePeriod"),
'newbymonth'=>$langs->trans(
"NbAddedAutomatically"))),
578 'c_lead_status'=>array(
'picto'=>
'project',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'percent'=>$langs->trans(
"OpportunityPercent"),
'position'=>$langs->trans(
"PositionIntoComboList"))),
579 'c_format_cards'=>array(
'picto'=>
'generic',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'name'=>$langs->trans(
"LabelName"),
'paper_size'=>$langs->trans(
"LabelPaperSize"))),
580 'c_hrm_public_holiday'=>array(
'picto'=>
'holiday',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'dayrule'=>
"Keep empty for a date defined with month and day (most common case).<br>Use a keyword like 'easter', 'eastermonday', ... for a date predefined by complex rules.",
'country'=>$langs->trans(
"CountryIfSpecificToOneCountry"),
'year'=>$langs->trans(
"ZeroMeansEveryYear"))),
581 'c_hrm_department'=>array(
'picto'=>
'hrm',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
582 'c_hrm_function'=>array(
'picto'=>
'hrm',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
583 'c_exp_tax_cat'=>array(
'picto'=>
'expensereport',
'help'=>array()),
584 'c_exp_tax_range'=>array(
'picto'=>
'expensereport',
'help'=>array(
'range_ik'=>$langs->trans(
'PrevRangeToThisRange'))),
585 'c_units'=>array(
'picto'=>
'product',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'unit_type' => $langs->trans(
'Measuringtype_durationDesc'),
'scale' => $langs->trans(
'MeasuringScaleDesc'))),
586 'c_socialnetworks'=>array(
'picto'=>
'share-alt',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'url' => $langs->trans(
'UrlSocialNetworksDesc'),
'icon' => $langs->trans(
'FafaIconSocialNetworksDesc'))),
587 'c_prospectcontactlevel'=>array(
'picto'=>
'company',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
588 'c_stcommcontact'=>array(
'picto'=>
'company',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'picto'=>$langs->trans(
"PictoHelp"))),
589 'c_transport_mode'=>array(
'picto'=>
'incoterm',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
590 'c_product_nature'=>array(
'picto'=>
'product',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
591 'c_productbatch_qcstatus'=>array(
'picto'=>
'lot',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
592 'c_asset_disposal_type'=>array(
'picto'=>
'asset',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
593 'c_invoice_subtype'=>array(
'picto'=>
'bill',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
598complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabcomplete);
602foreach ($tabcomplete as $key => $value) {
605 if (!isset($tabcond[$i])) {
608 $tabcomplete[$key][
'id'] = $i;
610 $tabcomplete[$key][
'cond'] = $tabcond[$i];
611 $tabcomplete[$key][
'rowid'] = $tabrowid[$i];
612 $tabcomplete[$key][
'fieldinsert'] = $tabfieldinsert[$i];
613 $tabcomplete[$key][
'fieldvalue'] = $tabfieldvalue[$i];
614 $tabcomplete[$key][
'lib'] = $tablib[$i];
615 $tabcomplete[$key][
'sql'] = $tabsql[$i];
616 $tabcomplete[$key][
'sqlsort'] = $tabsqlsort[$i];
617 $tabcomplete[$key][
'field'] = $tabfield[$i];
624 $arrayofkeys = array_keys($tabcomplete);
625 if (array_key_exists($id -1, $arrayofkeys)) {
626 $keytable = $arrayofkeys[$id - 1];
631if (empty($sortfield)) {
632 $tmp1 = explode(
',', empty($tabcomplete[$keytable][
'sqlsort']) ?
'' : $tabcomplete[$keytable][
'sqlsort']);
633 $tmp2 = explode(
' ', $tmp1[0]);
634 $sortfield = preg_replace(
'/^.*\./',
'', $tmp2[0]);
635 $sortorder = (!empty($tmp2[1]) ? $tmp2[1] :
'');
640$elementList = array();
641$sourceList = array();
643 $elementList = array(
645 'agenda' =>
img_picto(
'',
'action',
'class="pictofixedwidth"').$langs->trans(
'Agenda'),
646 'dolresource' =>
img_picto(
'',
'resource',
'class="pictofixedwidth"').$langs->trans(
'Resource'),
647 'societe' =>
img_picto(
'',
'company',
'class="pictofixedwidth"').$langs->trans(
'ThirdParty'),
653 'project' =>
img_picto(
'',
'project',
'class="pictofixedwidth"').$langs->trans(
'Project'),
654 'project_task' =>
img_picto(
'',
'projecttask',
'class="pictofixedwidth"').$langs->trans(
'Task'),
655 'propal' =>
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
'Proposal'),
656 'commande' =>
img_picto(
'',
'order',
'class="pictofixedwidth"').$langs->trans(
'Order'),
657 'facture' =>
img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
'Bill'),
658 'fichinter' =>
img_picto(
'',
'intervention',
'class="pictofixedwidth"').$langs->trans(
'InterventionCard'),
659 'contrat' =>
img_picto(
'',
'contract',
'class="pictofixedwidth"').$langs->trans(
'Contract'),
660 'ticket' =>
img_picto(
'',
'ticket',
'class="pictofixedwidth"').$langs->trans(
'Ticket'),
661 'supplier_proposal' =>
img_picto(
'',
'supplier_proposal',
'class="pictofixedwidth"').$langs->trans(
'SupplierProposal'),
662 'order_supplier' =>
img_picto(
'',
'supplier_order',
'class="pictofixedwidth"').$langs->trans(
'SupplierOrder'),
663 'invoice_supplier' =>
img_picto(
'',
'supplier_invoice',
'class="pictofixedwidth"').$langs->trans(
'SupplierBill'),
666 $elementList[
'conferenceorbooth'] =
img_picto(
'',
'eventorganization',
'class="pictofixedwidth"').$langs->trans(
'ConferenceOrBooth');
673 'internal' => $langs->trans(
'Internal'),
674 'external' => $langs->trans(
'External')
679$localtax_typeList = array(
680 "0" => $langs->trans(
"No"),
681 "1" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 1)",
682 "2" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 2)",
683 "3" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 3)",
684 "4" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 4)",
685 "5" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 5)",
686 "6" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 6)"
700 'confirm' =>$confirm,
702 'taborder' =>$taborder,
703 'tabname' =>$tabname,
706 'tabsqlsort' =>$tabsqlsort,
707 'tabfield' =>$tabfield,
708 'tabfieldvalue' =>$tabfieldvalue,
709 'tabfieldinsert'=>$tabfieldinsert,
710 'tabrowid' =>$tabrowid,
711 'tabcond' =>$tabcond,
712 'tabhelp' =>$tabhelp,
713 'tabcomplete' =>$tabcomplete
715$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
720if (
GETPOST(
'button_removefilter',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter_x',
'alpha')) {
721 $search_country_id =
'';
726if (empty($reshook)) {
729 $listfield = explode(
',', str_replace(
' ',
'', $tabfield[$id]));
730 $listfieldinsert = explode(
',', $tabfieldinsert[$id]);
731 $listfieldmodify = explode(
',', $tabfieldinsert[$id]);
732 $listfieldvalue = explode(
',', $tabfieldvalue[$id]);
736 foreach ($listfield as $f => $value) {
738 if ($value ==
'country_id' && in_array($tablib[$id], array(
'DictionaryPublicHolidays',
'DictionaryVAT',
'DictionaryInvoiceSubtype',
'DictionaryRegion',
'DictionaryCompanyType',
'DictionaryHolidayTypes',
'DictionaryRevenueStamp',
'DictionaryAccountancysystem',
'DictionaryAccountancyCategory'))) {
741 if ($value ==
'country' && in_array($tablib[$id], array(
'DictionaryPublicHolidays',
'DictionaryCanton',
'DictionaryCompanyType',
'DictionaryHolidayTypes',
'DictionaryRevenueStamp'))) {
745 if ($value ==
'localtax1' && !
GETPOST(
'localtax1_type')) {
748 if ($value ==
'localtax2' && !
GETPOST(
'localtax2_type')) {
751 if ($value ==
'color' && !
GETPOST(
'color')) {
754 if ($value ==
'formula' && !
GETPOST(
'formula')) {
757 if ($value ==
'dayrule' && !
GETPOST(
'dayrule')) {
760 if ($value ==
'sortorder') {
763 if ((!GETPOSTISSET($value) ||
GETPOST($value) ==
'')
765 !in_array($value, array(
'decalage',
'module',
'accountancy_code',
'accountancy_code_sell',
'accountancy_code_buy',
'tracking',
'picto',
'deposit_percent'))
766 && ($id != 10 || ($value !=
'code' && $value !=
'note'))
770 $fieldnamekey = $value;
772 if ($fieldnamekey ==
'libelle' || ($fieldnamekey ==
'label')) {
773 $fieldnamekey =
'Label';
775 if ($fieldnamekey ==
'libelle_facture') {
776 $fieldnamekey =
'LabelOnDocuments';
778 if ($fieldnamekey ==
'deposit_percent') {
779 $fieldnamekey =
'DepositPercent';
781 if ($fieldnamekey ==
'nbjour') {
782 $fieldnamekey =
'NbOfDays';
784 if ($fieldnamekey ==
'decalage') {
785 $fieldnamekey =
'Offset';
787 if ($fieldnamekey ==
'module') {
788 $fieldnamekey =
'Module';
790 if ($fieldnamekey ==
'code') {
791 $fieldnamekey =
'Code';
793 if ($fieldnamekey ==
'note') {
794 $fieldnamekey =
'Note';
796 if ($fieldnamekey ==
'taux') {
797 $fieldnamekey =
'Rate';
799 if ($fieldnamekey ==
'type') {
800 $fieldnamekey =
'Type';
802 if ($fieldnamekey ==
'position') {
803 $fieldnamekey =
'Position';
805 if ($fieldnamekey ==
'unicode') {
806 $fieldnamekey =
'Unicode';
808 if ($fieldnamekey ==
'deductible') {
809 $fieldnamekey =
'Deductible';
811 if ($fieldnamekey ==
'sortorder') {
812 $fieldnamekey =
'SortOrder';
814 if ($fieldnamekey ==
'category_type') {
815 $fieldnamekey =
'Calculated';
817 if ($fieldnamekey ==
'revenuestamp_type') {
818 $fieldnamekey =
'TypeOfRevenueStamp';
820 if ($fieldnamekey ==
'use_default') {
821 $fieldnamekey =
'UseByDefault';
824 setEventMessages($langs->transnoentities(
"ErrorFieldRequired", $langs->transnoentities($fieldnamekey)),
null,
'errors');
828 if (
GETPOST(
'actionadd') && $tabname[$id] ==
"c_actioncomm" && GETPOSTISSET(
"type") && in_array(
GETPOST(
"type"), array(
'system',
'systemauto'))) {
830 setEventMessages($langs->transnoentities(
'ErrorReservedTypeSystemSystemAuto'),
null,
'errors');
832 if (GETPOSTISSET(
"code")) {
835 setEventMessages($langs->transnoentities(
'ErrorCodeCantContainZero'),
null,
'errors');
838 if (GETPOSTISSET(
"country") && (
GETPOST(
"country") ==
'0') && ($id != 2)) {
839 if (in_array($tablib[$id], array(
'DictionaryCompanyType',
'DictionaryHolidayTypes'))) {
840 $_POST[
"country"] =
'';
843 setEventMessages($langs->transnoentities(
"ErrorFieldRequired", $langs->transnoentities(
"Country")),
null,
'errors');
846 if (($id == 3 || $id == 42) && !is_numeric(
GETPOST(
"code")) &&
GETPOST(
'actionadd')) {
848 setEventMessages($langs->transnoentities(
"ErrorFieldMustBeANumeric", $langs->transnoentities(
"Code")),
null,
'errors');
850 if ($id == 4 && strlen(
GETPOST(
"code")) != 2) {
852 setEventMessages($langs->transnoentities(
"ErrorCountryCodeMustBe2Char", $langs->transnoentities(
"Code")),
null,
'errors');
857 $_POST[
"localtax1"] =
'0';
860 $_POST[
"localtax2"] =
'0';
862 if (
GETPOST(
"accountancy_code") <= 0) {
863 $_POST[
"accountancy_code"] =
'';
865 if (
GETPOST(
"accountancy_code_sell") <= 0) {
866 $_POST[
"accountancy_code_sell"] =
'';
868 if (
GETPOST(
"accountancy_code_buy") <= 0) {
869 $_POST[
"accountancy_code_buy"] =
'';
871 if ($id == 10 && GETPOSTISSET(
"code")) {
872 $_POST[
"code"] = preg_replace(
'/[^a-zA-Z0-9_\-\+]/',
'',
GETPOST(
"code"));
875 $tablename = $tabname[$id];
876 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
879 if ($ok &&
GETPOST(
'actionadd')) {
881 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
883 $sql =
"SELECT MAX(".$tabrowid[$id].
") as newid FROM ".MAIN_DB_PREFIX.$tablename;
884 $result = $db->query($sql);
886 $obj = $db->fetch_object($result);
887 $newid = ((int) $obj->newid) + 1;
894 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.$tablename.
" (";
896 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
897 $sql .= $tabrowid[$id].
",";
899 $sql .= $tabfieldinsert[$id];
904 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
908 foreach ($listfieldinsert as $f => $value) {
909 $keycode = (isset($listfieldvalue[$i]) ? $listfieldvalue[$i] :
'');
910 if (empty($keycode)) {
914 if ($value ==
'price' || preg_match(
'/^amount/i', $value)) {
916 } elseif ($value ==
'taux' || $value ==
'localtax1') {
918 } elseif ($value ==
'entity') {
919 $_POST[$keycode] =
getEntity($tablename);
926 if ($keycode ==
'sortorder') {
927 $sql .= (int)
GETPOST(
'position',
'int');
928 } elseif (
GETPOST($keycode) ==
'' && !($keycode ==
'code' && $id == 10)) {
930 } elseif ($keycode ==
'content') {
931 $sql .=
"'".$db->escape(
GETPOST($keycode,
'restricthtml')).
"'";
932 } elseif (in_array($keycode, array(
'joinfile',
'private',
'pos',
'position',
'scale',
'use_default'))) {
933 $sql .= (int)
GETPOST($keycode,
'int');
935 $sql .=
"'".$db->escape(
GETPOST($keycode,
'alphanohtml')).
"'";
943 $resql = $db->query($sql);
945 setEventMessages($langs->transnoentities(
"RecordCreatedSuccessfully"),
null,
'mesgs');
948 if ($id == 10 &&
GETPOST(
'country',
'int') > 0) {
949 $search_country_id =
GETPOST(
'country',
'int');
951 $_POST = array(
'id'=>$id);
953 if ($db->errno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
954 setEventMessages($langs->transnoentities(
"ErrorRecordAlreadyExists"),
null,
'errors');
962 if ($ok &&
GETPOST(
'actionmodify')) {
963 if ($tabrowid[$id]) {
964 $rowidcol = $tabrowid[$id];
970 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET ";
972 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
973 $sql .= $tabrowid[$id].
"=";
974 $sql .=
"'".$db->escape($rowid).
"', ";
977 foreach ($listfieldmodify as $field) {
978 $keycode = $listfieldvalue[$i];
979 if (empty($keycode)) {
983 if ($field ==
'price' || preg_match(
'/^amount/i', $field)) {
985 } elseif ($field ==
'taux' || $field ==
'localtax1') {
987 } elseif ($field ==
'entity') {
988 $_POST[$keycode] =
getEntity($tablename);
995 if ($listfieldvalue[$i] ==
'sortorder') {
996 $sql .= (int)
GETPOST(
'position',
'int');
997 } elseif (
GETPOST($keycode) ==
'' && !($keycode ==
'code' && $id == 10)) {
999 } elseif ($keycode ==
'content') {
1000 $sql .=
"'".$db->escape(
GETPOST($keycode,
'restricthtml')).
"'";
1001 } elseif (in_array($keycode, array(
'joinfile',
'private',
'pos',
'position',
'scale',
'use_default'))) {
1002 $sql .= (int)
GETPOST($keycode,
'int');
1004 $sql .=
"'".$db->escape(
GETPOST($keycode,
'alphanohtml')).
"'";
1009 if (in_array($rowidcol, array(
'code',
'code_iso'))) {
1010 $sql .=
" WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'";
1012 $sql .=
" WHERE ".$rowidcol.
" = ".((int) $rowid);
1014 if (in_array(
'entity', $listfieldmodify)) {
1015 $sql .=
" AND entity = ".((int)
getEntity($tablename, 0));
1020 $resql = $db->query($sql);
1026 if (!$ok &&
GETPOST(
'actionadd')) {
1029 if (!$ok &&
GETPOST(
'actionmodify')) {
1034 if ($action ==
'confirm_delete' && $confirm ==
'yes') {
1035 if ($tabrowid[$id]) {
1036 $rowidcol = $tabrowid[$id];
1038 $rowidcol =
"rowid";
1041 $tablename = $tabname[$id];
1042 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1044 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.$tablename.
" WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1047 $result = $db->query($sql);
1049 if ($db->errno() ==
'DB_ERROR_CHILD_EXISTS') {
1050 setEventMessages($langs->transnoentities(
"ErrorRecordIsUsedByChild"),
null,
'errors');
1058 if ($action == $acts[0]) {
1059 if ($tabrowid[$id]) {
1060 $rowidcol = $tabrowid[$id];
1062 $rowidcol =
"rowid";
1065 $tablename = $tabname[$id];
1066 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1069 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 1 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1071 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 1 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1074 $result = $db->query($sql);
1081 if ($action == $acts[1]) {
1082 if ($tabrowid[$id]) {
1083 $rowidcol = $tabrowid[$id];
1085 $rowidcol =
"rowid";
1088 $tablename = $tabname[$id];
1089 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1092 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 0 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1094 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 0 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1097 $result = $db->query($sql);
1104 if ($action ==
'activate_favorite') {
1105 if ($tabrowid[$id]) {
1106 $rowidcol = $tabrowid[$id];
1108 $rowidcol =
"rowid";
1111 $tablename = $tabname[$id];
1112 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1115 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 1 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1117 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 1 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1120 $result = $db->query($sql);
1127 if ($action ==
'disable_favorite') {
1128 if ($tabrowid[$id]) {
1129 $rowidcol = $tabrowid[$id];
1131 $rowidcol =
"rowid";
1134 $tablename = $tabname[$id];
1135 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1138 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 0 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1140 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 0 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1143 $result = $db->query($sql);
1150 if ($action ==
'activate_eec') {
1151 if ($tabrowid[$id]) {
1152 $rowidcol = $tabrowid[$id];
1154 $rowidcol =
"rowid";
1157 $tablename = $tabname[$id];
1158 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1161 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 1 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1163 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 1 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1166 $result = $db->query($sql);
1173 if ($action ==
'disable_eec') {
1174 if ($tabrowid[$id]) {
1175 $rowidcol = $tabrowid[$id];
1177 $rowidcol =
"rowid";
1180 $tablename = $tabname[$id];
1181 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1184 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 0 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1186 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 0 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1189 $result = $db->query($sql);
1201$form =
new Form($db);
1203$title = $langs->trans(
"DictionarySetup");
1209 $title .=
' - '.$langs->trans($tablib[$id]);
1210 $linkback =
'<a href="'.$_SERVER[
'PHP_SELF'].
'">'.$langs->trans(
"BackToDictionaryList").
'</a>';
1212$titlepicto =
'title_setup';
1213if ($id == 10 &&
GETPOST(
'from') ==
'accountancy') {
1214 $title = $langs->trans(
"MenuVatAccounts");
1215 $titlepicto =
'accountancy';
1217if ($id == 7 &&
GETPOST(
'from') ==
'accountancy') {
1218 $title = $langs->trans(
"MenuTaxAccounts");
1219 $titlepicto =
'accountancy';
1222$param =
'&id='.urlencode($id);
1223if ($search_country_id || GETPOSTISSET(
'page') ||
GETPOST(
'button_removefilter',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter_x',
'alpha')) {
1224 $param .=
'&search_country_id='.urlencode($search_country_id ? $search_country_id : -1);
1226if ($search_code !=
'') {
1227 $param .=
'&search_code='.urlencode($search_code);
1229if ($search_active !=
'') {
1230 $param .=
'&search_active='.urlencode($search_active);
1233 $param .=
'&entity='.(int) $entity;
1235$paramwithsearch = $param;
1237 $paramwithsearch .=
'&sortorder='.urlencode($sortorder);
1240 $paramwithsearch .=
'&sortfield='.urlencode($sortfield);
1243 $paramwithsearch .=
'&from='.urlencode(
GETPOST(
'from',
'alpha'));
1248if ($action ==
'delete') {
1249 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?'.($page ?
'page='.$page.
'&' :
'').
'rowid='.urlencode($rowid).
'&code='.urlencode($code).$paramwithsearch, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_delete',
'', 0, 1);
1255 $sqlfields = $tabsql[$id];
1257 $tablecode =
't.code';
1259 $tableprefixarray = array(1 =>
'f.code', 2 =>
'd.code_departement', 3 =>
'r.code_region', 4 =>
'c.code', 5 =>
'c.code', 6 =>
'a.code', 9 =>
'code_iso', 14 =>
'e.code', 28 =>
'h.code', 7 =>
'a.code', 32 =>
'a.code', 37 =>
'r.code', 38 =>
's.code', 45 =>
'f.code', 46 =>
'f.code', 47 =>
'f.code', 48 =>
'f.code');
1260 if (!empty($tableprefixarray[$id])) {
1261 $tablecode = $tableprefixarray[$id];
1262 $tableprefix = preg_replace(
'/\..*$/',
'.', $tablecode);
1265 if (empty($tableprefix) && preg_match(
'/SELECT ([a-z]\.)rowid/i', $sqlfields, $reg)) {
1266 $tableprefix = $reg[1];
1270 if (!preg_match(
'/ WHERE /', $sql)) {
1271 $sql .=
" WHERE 1 = 1";
1273 if ($search_country_id > 0) {
1274 $sql .=
" AND c.rowid = ".((int) $search_country_id);
1276 if ($search_code !=
'') {
1279 if ($search_active ==
'yes') {
1280 $sql .=
" AND ".$tableprefix.
"active = 1";
1281 } elseif ($search_active ==
'no') {
1282 $sql .=
" AND ".$tableprefix.
"active = 0";
1287 $nbtotalofrecords =
'';
1290 $sqlforcount = preg_replace(
'/^.*\sFROM\s/',
'SELECT COUNT(*) as nbtotalofrecords FROM ', $sql);
1291 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
1292 $resql = $db->query($sqlforcount);
1294 $objforcount = $db->fetch_object($resql);
1295 $nbtotalofrecords = $objforcount->nbtotalofrecords;
1300 if (($page * $listlimit) > $nbtotalofrecords) {
1309 if ($sortfield ==
'country') {
1310 $sortfield =
'country_code';
1312 $sql .= $db->order($sortfield, $sortorder);
1315 $tabsqlsort[$id] = preg_replace(
'/([a-z]+\.)?'.$sortfield.
' '.$sortorder.
',/i',
'', $tabsqlsort[$id]);
1316 $tabsqlsort[$id] = preg_replace(
'/([a-z]+\.)?'.$sortfield.
',/i',
'', $tabsqlsort[$id]);
1318 $sql .=
" ORDER BY ";
1320 $sql .= $tabsqlsort[$id];
1322 $sql .= $db->plimit($listlimit + 1, $offset);
1324 $resql = $db->query($sql);
1329 $num = $db->num_rows($resql);
1333 if (empty($tabfield[$id])) {
1334 dol_print_error($db,
'The table with id '.$id.
' has no array tabfield defined');
1337 $fieldlist = explode(
',', $tabfield[$id]);
1339 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.$id.
'" method="POST">';
1340 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1341 print
'<input type="hidden" name="from" value="'.dol_escape_htmltag(
GETPOST(
'from',
'alpha')).
'">';
1345 print
info_admin($langs->trans(
"VATIsUsedIsOff", $langs->transnoentities(
"Setup"), $langs->transnoentities(
"CompanyFoundation")));
1352 $resql = $db->query($sql);
1354 $num = $db->num_rows($resql);
1357 $massactionbutton = $linkback;
1359 $newcardbutton =
'';
1364 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/admin/dict.php?action=create'.$param.
'&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
1366 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'tools', 0, $newcardbutton,
'', $listlimit, 1, 0, 1);
1369 if ($action ==
'create') {
1371 if ($tabname[$id]) {
1374 $fieldlist = explode(
',', $tabfield[$id]);
1376 print
'<div class="div-table-responsive-no-min">';
1377 print
'<table class="noborder centpercent">';
1380 print
'<!-- line title to add new entry -->';
1381 $tdsoffields =
'<tr class="liste_titre">';
1382 foreach ($fieldlist as $field => $value) {
1383 if ($value ==
'entity') {
1389 $valuetoshow = ucfirst($value);
1390 $valuetoshow = $langs->trans($valuetoshow);
1393 if ($value ==
'pos') {
1394 $valuetoshow = $langs->trans(
"Position");
1397 if ($value ==
'source') {
1398 $valuetoshow = $langs->trans(
"Contact");
1400 if ($value ==
'price') {
1401 $valuetoshow = $langs->trans(
"PriceUHT");
1403 if ($value ==
'taux') {
1404 if ($tabname[$id] !=
"c_revenuestamp") {
1405 $valuetoshow = $langs->trans(
"Rate");
1407 $valuetoshow = $langs->trans(
"Amount");
1411 if ($value ==
'localtax1_type') {
1412 $valuetoshow = $langs->trans(
"UseLocalTax").
" 2";
1416 if ($value ==
'localtax1') {
1417 $valuetoshow = $langs->trans(
"RateOfTaxN",
'2');
1420 if ($value ==
'localtax2_type') {
1421 $valuetoshow = $langs->trans(
"UseLocalTax").
" 3";
1425 if ($value ==
'localtax2') {
1426 $valuetoshow = $langs->trans(
"RateOfTaxN",
'3');
1429 if ($value ==
'organization') {
1430 $valuetoshow = $langs->trans(
"Organization");
1432 if ($value ==
'lang') {
1433 $valuetoshow = $langs->trans(
"Language");
1435 if ($value ==
'type') {
1436 if ($tabname[$id] ==
"c_paiement") {
1437 $valuetoshow = $form->textwithtooltip($langs->trans(
"Type"), $langs->trans(
"TypePaymentDesc"), 2, 1,
img_help(1,
''));
1439 $valuetoshow = $langs->trans(
"Type");
1442 if ($value ==
'code') {
1443 $valuetoshow = $langs->trans(
"Code");
1444 $class =
'maxwidth100';
1446 if ($value ==
'libelle' || $value ==
'label') {
1447 $valuetoshow = $form->textwithtooltip($langs->trans(
"Label"), $langs->trans(
"LabelUsedByDefault"), 2, 1,
img_help(1,
''));
1449 if ($value ==
'libelle_facture') {
1450 $valuetoshow = $form->textwithtooltip($langs->trans(
"LabelOnDocuments"), $langs->trans(
"LabelUsedByDefault"), 2, 1,
img_help(1,
''));
1452 if ($value ==
'deposit_percent') {
1453 $valuetoshow = $langs->trans(
'DepositPercent');
1456 if ($value ==
'country') {
1457 if (in_array(
'region_id', $fieldlist)) {
1461 $valuetoshow = $langs->trans(
"Country");
1463 if ($value ==
'recuperableonly') {
1464 $valuetoshow = $langs->trans(
"NPR");
1467 if ($value ==
'nbjour') {
1468 $valuetoshow = $langs->trans(
"NbOfDays");
1471 if ($value ==
'type_cdr') {
1472 $valuetoshow = $langs->trans(
"AtEndOfMonth");
1475 if ($value ==
'decalage') {
1476 $valuetoshow = $langs->trans(
"Offset");
1479 if ($value ==
'width' || $value ==
'nx') {
1480 $valuetoshow = $langs->trans(
"Width");
1482 if ($value ==
'height' || $value ==
'ny') {
1483 $valuetoshow = $langs->trans(
"Height");
1485 if ($value ==
'unit' || $value ==
'metric') {
1486 $valuetoshow = $langs->trans(
"MeasuringUnit");
1488 if ($value ==
'region_id' || $value ==
'country_id') {
1491 if ($value ==
'accountancy_code') {
1492 $valuetoshow = $langs->trans(
"AccountancyCode");
1494 if ($value ==
'accountancy_code_sell') {
1495 $valuetoshow = $langs->trans(
"AccountancyCodeSell");
1497 if ($value ==
'accountancy_code_buy') {
1498 $valuetoshow = $langs->trans(
"AccountancyCodeBuy");
1500 if ($value ==
'pcg_version' || $value ==
'fk_pcg_version') {
1501 $valuetoshow = $langs->trans(
"Pcg_version");
1503 if ($value ==
'account_parent') {
1504 $valuetoshow = $langs->trans(
"Accountparent");
1506 if ($value ==
'pcg_type') {
1507 $valuetoshow = $langs->trans(
"Pcg_type");
1509 if ($value ==
'pcg_subtype') {
1510 $valuetoshow = $langs->trans(
"Pcg_subtype");
1512 if ($value ==
'sortorder') {
1513 $valuetoshow = $langs->trans(
"SortOrder");
1516 if ($value ==
'short_label') {
1517 $valuetoshow = $langs->trans(
"ShortLabel");
1519 if ($value ==
'fk_parent') {
1520 $valuetoshow = $langs->trans(
"ParentID");
1523 if ($value ==
'range_account') {
1524 $valuetoshow = $langs->trans(
"Range");
1526 if ($value ==
'sens') {
1527 $valuetoshow = $langs->trans(
"Sens");
1529 if ($value ==
'category_type') {
1530 $valuetoshow = $langs->trans(
"Calculated");
1532 if ($value ==
'formula') {
1533 $valuetoshow = $langs->trans(
"Formula");
1535 if ($value ==
'paper_size') {
1536 $valuetoshow = $langs->trans(
"PaperSize");
1538 if ($value ==
'orientation') {
1539 $valuetoshow = $langs->trans(
"Orientation");
1541 if ($value ==
'leftmargin') {
1542 $valuetoshow = $langs->trans(
"LeftMargin");
1544 if ($value ==
'topmargin') {
1545 $valuetoshow = $langs->trans(
"TopMargin");
1547 if ($value ==
'spacex') {
1548 $valuetoshow = $langs->trans(
"SpaceX");
1550 if ($value ==
'spacey') {
1551 $valuetoshow = $langs->trans(
"SpaceY");
1553 if ($value ==
'font_size') {
1554 $valuetoshow = $langs->trans(
"FontSize");
1556 if ($value ==
'custom_x') {
1557 $valuetoshow = $langs->trans(
"CustomX");
1559 if ($value ==
'custom_y') {
1560 $valuetoshow = $langs->trans(
"CustomY");
1562 if ($value ==
'percent') {
1563 $valuetoshow = $langs->trans(
"Percentage");
1565 if ($value ==
'affect') {
1566 $valuetoshow = $langs->trans(
"WithCounter");
1568 if ($value ==
'delay') {
1569 $valuetoshow = $langs->trans(
"NoticePeriod");
1571 if ($value ==
'newbymonth') {
1572 $valuetoshow = $langs->trans(
"NewByMonth");
1574 if ($value ==
'fk_tva') {
1575 $valuetoshow = $langs->trans(
"VAT");
1577 if ($value ==
'range_ik') {
1578 $valuetoshow = $langs->trans(
"RangeIk");
1580 if ($value ==
'fk_c_exp_tax_cat') {
1581 $valuetoshow = $langs->trans(
"CarCategory");
1583 if ($value ==
'revenuestamp_type') {
1584 $valuetoshow = $langs->trans(
'TypeOfRevenueStamp');
1586 if ($value ==
'use_default') {
1587 $valuetoshow = $langs->trans(
'Default');
1590 if ($value ==
'unit_type') {
1591 $valuetoshow = $langs->trans(
'TypeOfUnit');
1593 if ($value ==
'public' && $tablib[$id] ==
'TicketDictCategory') {
1594 $valuetoshow = $langs->trans(
'TicketGroupIsPublic');
1597 if ($value ==
'block_if_negative') {
1598 $valuetoshow = $langs->trans(
'BlockHolidayIfNegative');
1600 if ($value ==
'type_duration') {
1601 $valuetoshow = $langs->trans(
'Unit');
1605 if ($value ==
'region_id') {
1606 $valuetoshow =
' ';
1609 if ($value ==
'region') {
1610 $valuetoshow = $langs->trans(
"Country").
'/'.$langs->trans(
"Region");
1615 if ($valuetoshow !=
'') {
1616 $tooltiphelp = (isset($tabcomplete[$tabname[$id]][
'help'][$value]) ? $tabcomplete[$tabname[$id]][
'help'][$value] :
'');
1618 $tdsoffields .=
'<th'.($class ?
' class="'.$class.
'"' :
'').
'>';
1619 if ($tooltiphelp && preg_match(
'/^http(s*):/i', $tooltiphelp)) {
1620 $tdsoffields .=
'<a href="'.$tooltiphelp.
'" target="_blank">'.$valuetoshow.
' '.
img_help(1, $valuetoshow).
'</a>';
1621 } elseif ($tooltiphelp) {
1622 $tdsoffields .= $form->textwithpicto($valuetoshow, $tooltiphelp);
1624 $tdsoffields .= $valuetoshow;
1626 $tdsoffields .=
'</th>';
1631 $tdsoffields .=
'<th></th>';
1632 $tdsoffields .=
'<th></th>';
1634 $tdsoffields .=
'<th>';
1635 $tdsoffields .=
'<input type="hidden" name="id" value="'.$id.
'">';
1636 if (!is_null($withentity)) {
1637 $tdsoffields .=
'<input type="hidden" name="entity" value="'.$withentity.
'">';
1639 $tdsoffields .=
'</th>';
1640 $tdsoffields .=
'<th style="min-width: 26px;"></th>';
1641 $tdsoffields .=
'<th style="min-width: 26px;"></th>';
1642 $tdsoffields .=
'</tr>';
1648 print
'<!-- line input to add new entry -->';
1649 print
'<tr class="oddeven nodrag nodrop nohover">';
1654 foreach ($fieldlist as $key => $val) {
1661 $tmpaction =
'create';
1662 $parameters = array(
'fieldlist'=>$fieldlist,
'tabname'=>$tabname[$id]);
1663 $reshook = $hookmanager->executeHooks(
'createDictionaryFieldlist', $parameters, $obj, $tmpaction);
1664 $error = $hookmanager->error;
1665 $errors = $hookmanager->errors;
1668 unset($fieldlist[2]);
1671 if (empty($reshook)) {
1672 fieldList($fieldlist, $obj, $tabname[$id],
'add');
1679 print
'<td colspan="3" class="center">';
1680 if ($action !=
'edit') {
1681 print
'<input type="submit" class="button button-add small" name="actionadd" value="'.$langs->trans(
"Add").
'">';
1683 print
'<input type="submit" class="button button-add small disabled" name="actionadd" value="'.$langs->trans(
"Add").
'">';
1695 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.$id.
'" method="POST">';
1696 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1697 print
'<input type="hidden" name="from" value="'.dol_escape_htmltag(
GETPOST(
'from',
'alpha')).
'">';
1702 foreach ($fieldlist as $field => $value) {
1703 if ($value ==
'entity') {
1708 if ($value ==
'region_id' || $value ==
'country_id') {
1713 if ($value ==
'country') {
1715 } elseif ($value ==
'code') {
1721 print
'<div class="div-table-responsive">';
1722 print
'<table class="noborder centpercent">';
1727 print
'<!-- line title to search record -->'.
"\n";
1728 print
'<tr class="liste_titre_filter">';
1732 print
'<td class="liste_titre center">';
1734 $searchpicto = $form->showFilterAndCheckAddButtons(0);
1741 foreach ($fieldlist as $field => $value) {
1742 if ($value ==
'entity') {
1747 if ($value ==
'region_id' || $value ==
'country_id') {
1752 if ($value ==
'country') {
1753 print
'<td class="liste_titre">';
1754 print $form->select_country($search_country_id,
'search_country_id',
'', 28,
'minwidth100 maxwidth150 maxwidthonsmartphone',
'',
' ');
1757 } elseif ($value ==
'code') {
1758 print
'<td class="liste_titre">';
1759 print
'<input type="text" class="maxwidth100" name="search_code" value="'.dol_escape_htmltag($search_code).
'">';
1763 print
'<td class="liste_titre">';
1777 print
'<td class="liste_titre center">';
1778 print $form->selectyesno(
'search_active', $search_active, 0,
false, 1);
1784 print
'<td class="liste_titre center">';
1786 $searchpicto = $form->showFilterAndCheckAddButtons(0);
1796 print
'<!-- line title of record -->'.
"\n";
1797 print
'<tr class="liste_titre">';
1804 foreach ($fieldlist as $field => $value) {
1805 if ($value ==
'entity') {
1809 if (in_array($value, array(
'label',
'libelle',
'libelle_facture')) && empty($tabcomplete[$tabname[$id]][
'help'][$value])) {
1810 if (!isset($tabcomplete[$tabname[$id]][
'help']) || !is_array($tabcomplete[$tabname[$id]][
'help'])) {
1811 $tabcomplete[$tabname[$id]][
'help'] = array();
1813 $tabcomplete[$tabname[$id]][
'help'][$value] = $langs->trans(
'LabelUsedByDefault');
1821 $valuetoshow = ucfirst($value);
1822 $valuetoshow = $langs->trans($valuetoshow);
1825 if ($value ==
'source') {
1826 $valuetoshow = $langs->trans(
"Contact");
1828 if ($value ==
'price') {
1829 $valuetoshow = $langs->trans(
"PriceUHT");
1831 if ($value ==
'taux') {
1832 if ($tabname[$id] !=
"c_revenuestamp") {
1833 $valuetoshow = $langs->trans(
"Rate");
1835 $valuetoshow = $langs->trans(
"Amount");
1837 $cssprefix =
'center ';
1840 if ($value ==
'localtax1_type') {
1841 $valuetoshow = $langs->trans(
"UseLocalTax").
" 2";
1842 $cssprefix =
"center ";
1845 if ($value ==
'localtax1') {
1846 $valuetoshow = $langs->trans(
"RateOfTaxN",
'2');
1847 $cssprefix =
"center ";
1850 if ($value ==
'localtax2_type') {
1851 $valuetoshow = $langs->trans(
"UseLocalTax").
" 3";
1852 $cssprefix =
"center ";
1855 if ($value ==
'localtax2') {
1856 $valuetoshow = $langs->trans(
"RateOfTaxN",
'3');
1857 $cssprefix =
"center ";
1860 if ($value ==
'organization') {
1861 $valuetoshow = $langs->trans(
"Organization");
1863 if ($value ==
'lang') {
1864 $valuetoshow = $langs->trans(
"Language");
1866 if ($value ==
'type') {
1867 $valuetoshow = $langs->trans(
"Type");
1869 if ($value ==
'code') {
1870 $valuetoshow = $langs->trans(
"Code");
1872 if (in_array($value, array(
'pos',
'position'))) {
1873 $valuetoshow = $langs->trans(
"Position");
1874 $cssprefix =
'right ';
1876 if ($value ==
'libelle' || $value ==
'label') {
1877 $valuetoshow = $langs->trans(
"Label");
1879 if ($value ==
'libelle_facture') {
1880 $valuetoshow = $langs->trans(
"LabelOnDocuments");
1882 if ($value ==
'deposit_percent') {
1883 $valuetoshow = $langs->trans(
'DepositPercent');
1884 $cssprefix =
'right ';
1886 if ($value ==
'country') {
1887 $valuetoshow = $langs->trans(
"Country");
1889 if ($value ==
'recuperableonly') {
1890 $valuetoshow = $langs->trans(
"NPR");
1891 $cssprefix =
"center ";
1893 if ($value ==
'nbjour') {
1894 $valuetoshow = $langs->trans(
"NbOfDays");
1895 $cssprefix =
'right ';
1897 if ($value ==
'type_cdr') {
1898 $valuetoshow = $langs->trans(
"AtEndOfMonth");
1899 $cssprefix =
"center ";
1901 if ($value ==
'decalage') {
1902 $valuetoshow = $langs->trans(
"Offset");
1903 $cssprefix =
'right ';
1905 if ($value ==
'width' || $value ==
'nx') {
1906 $valuetoshow = $langs->trans(
"Width");
1908 if ($value ==
'height' || $value ==
'ny') {
1909 $valuetoshow = $langs->trans(
"Height");
1911 if ($value ==
'unit' || $value ==
'metric') {
1912 $valuetoshow = $langs->trans(
"MeasuringUnit");
1914 if ($value ==
'accountancy_code') {
1915 $valuetoshow = $langs->trans(
"AccountancyCode");
1917 if ($value ==
'accountancy_code_sell') {
1918 $valuetoshow = $langs->trans(
"AccountancyCodeSell");
1921 if ($value ==
'accountancy_code_buy') {
1922 $valuetoshow = $langs->trans(
"AccountancyCodeBuy");
1925 if ($value ==
'fk_pcg_version') {
1926 $valuetoshow = $langs->trans(
"Pcg_version");
1928 if ($value ==
'account_parent') {
1929 $valuetoshow = $langs->trans(
"Accountsparent");
1931 if ($value ==
'pcg_type') {
1932 $valuetoshow = $langs->trans(
"Pcg_type");
1934 if ($value ==
'pcg_subtype') {
1935 $valuetoshow = $langs->trans(
"Pcg_subtype");
1937 if ($value ==
'sortorder') {
1938 $valuetoshow = $langs->trans(
"SortOrder");
1939 $cssprefix =
'center ';
1941 if ($value ==
'short_label') {
1942 $valuetoshow = $langs->trans(
"ShortLabel");
1944 if ($value ==
'fk_parent') {
1945 $valuetoshow = $langs->trans(
"ParentID");
1946 $cssprefix =
'center ';
1948 if ($value ==
'range_account') {
1949 $valuetoshow = $langs->trans(
"Range");
1951 if ($value ==
'sens') {
1952 $valuetoshow = $langs->trans(
"Sens");
1954 if ($value ==
'category_type') {
1955 $valuetoshow = $langs->trans(
"Calculated");
1957 if ($value ==
'formula') {
1958 $valuetoshow = $langs->trans(
"Formula");
1960 if ($value ==
'paper_size') {
1961 $valuetoshow = $langs->trans(
"PaperSize");
1963 if ($value ==
'orientation') {
1964 $valuetoshow = $langs->trans(
"Orientation");
1966 if ($value ==
'leftmargin') {
1967 $valuetoshow = $langs->trans(
"LeftMargin");
1969 if ($value ==
'topmargin') {
1970 $valuetoshow = $langs->trans(
"TopMargin");
1972 if ($value ==
'spacex') {
1973 $valuetoshow = $langs->trans(
"SpaceX");
1975 if ($value ==
'spacey') {
1976 $valuetoshow = $langs->trans(
"SpaceY");
1978 if ($value ==
'font_size') {
1979 $valuetoshow = $langs->trans(
"FontSize");
1981 if ($value ==
'custom_x') {
1982 $valuetoshow = $langs->trans(
"CustomX");
1984 if ($value ==
'custom_y') {
1985 $valuetoshow = $langs->trans(
"CustomY");
1987 if ($value ==
'percent') {
1988 $valuetoshow = $langs->trans(
"Percentage");
1990 if ($value ==
'affect') {
1991 $valuetoshow = $langs->trans(
"WithCounter");
1993 if ($value ==
'delay') {
1994 $valuetoshow = $langs->trans(
"NoticePeriod");
1996 if ($value ==
'newbymonth') {
1997 $valuetoshow = $langs->trans(
"NewByMonth");
1999 if ($value ==
'fk_tva') {
2000 $valuetoshow = $langs->trans(
"VAT");
2002 if ($value ==
'range_ik') {
2003 $valuetoshow = $langs->trans(
"RangeIk");
2005 if ($value ==
'fk_c_exp_tax_cat') {
2006 $valuetoshow = $langs->trans(
"CarCategory");
2008 if ($value ==
'revenuestamp_type') {
2009 $valuetoshow = $langs->trans(
'TypeOfRevenueStamp');
2011 if ($value ==
'use_default') {
2012 $valuetoshow = $langs->trans(
'Default');
2013 $cssprefix =
'center ';
2015 if ($value ==
'unit_type') {
2016 $valuetoshow = $langs->trans(
'TypeOfUnit');
2018 if ($value ==
'public' && $tablib[$id] ==
'TicketDictCategory') {
2019 $valuetoshow = $langs->trans(
'TicketGroupIsPublic');
2020 $cssprefix =
'center ';
2022 if ($value ==
'block_if_negative') {
2023 $valuetoshow = $langs->trans(
'BlockHolidayIfNegative');
2025 if ($value ==
'type_duration') {
2026 $valuetoshow = $langs->trans(
'Unit');
2029 if ($value ==
'region_id' || $value ==
'country_id') {
2035 $tooltiphelp = (isset($tabcomplete[$tabname[$id]][
'help'][$value]) ? $tabcomplete[$tabname[$id]][
'help'][$value] :
'');
2037 if ($tooltiphelp && preg_match(
'/^http(s*):/i', $tooltiphelp)) {
2038 $newvaluetoshow =
'<a href="'.$tooltiphelp.
'" target="_blank">'.$valuetoshow.
' '.
img_help(1, $valuetoshow).
'</a>';
2039 } elseif ($tooltiphelp) {
2040 $newvaluetoshow = $form->textwithpicto($valuetoshow, $tooltiphelp);
2042 $newvaluetoshow = $valuetoshow;
2045 print
getTitleFieldOfList($newvaluetoshow, 0, $_SERVER[
"PHP_SELF"], ($sortable ? $value :
''), ($page ?
'page='.$page.
'&' :
''), $param,
'', $sortfield, $sortorder, $cssprefix);
2050 print
getTitleFieldOfList($langs->trans(
"InEEC"), 0, $_SERVER[
"PHP_SELF"],
"eec", ($page ?
'page='.$page.
'&' :
''), $param,
'align="center"', $sortfield, $sortorder,
'', 0, $langs->trans(
"CountryIsInEEC"));
2051 print
getTitleFieldOfList($langs->trans(
"Favorite"), 0, $_SERVER[
"PHP_SELF"],
"favorite", ($page ?
'page='.$page.
'&' :
''), $param,
'align="center"', $sortfield, $sortorder);
2055 print
getTitleFieldOfList($langs->trans(
"Status"), 0, $_SERVER[
"PHP_SELF"],
"active", ($page ?
'page='.$page.
'&' :
''), $param,
'align="center"', $sortfield, $sortorder);
2066 $obj = $db->fetch_object($resql);
2072 if ($obj->code ==
'') {
2082 if (isset($obj->code) && $id != 10 && $id != 42) {
2083 if (($obj->code ==
'0' || $obj->code ==
'' || preg_match(
'/unknown/i', $obj->code))) {
2086 } elseif ($obj->code ==
'RECEP') {
2089 } elseif ($obj->code ==
'EF0') {
2094 if ($id == 25 && in_array($obj->code, array(
'banner',
'blogpost',
'menu',
'page',
'other'))) {
2097 if (in_array($obj->code, array(
'banner'))) {
2101 if (isset($obj->type) && in_array($obj->type, array(
'system',
'systemauto'))) {
2104 if (in_array(empty($obj->code) ?
'' : $obj->code, array(
'AC_OTH',
'AC_OTH_AUTO')) || in_array(empty($obj->
type) ?
'' : $obj->
type, array(
'systemauto'))) {
2108 $canbemodified = $iserasable;
2110 if (!empty($obj->code) && $obj->code ==
'RECEP') {
2113 if ($tabname[$id] ==
"c_actioncomm") {
2118 $rowidcol = empty($tabrowid[$id]) ?
'rowid' : $tabrowid[$id];
2120 if (empty($rowidcol) || in_array($id, array(6, 7, 8, 13, 17, 19, 27, 32))) {
2121 $rowidcol =
'rowid';
2123 $url = $_SERVER[
"PHP_SELF"].
'?'.($page ?
'page='.$page.
'&' :
'').
'sortfield='.$sortfield.
'&sortorder='.$sortorder;
2124 $url .=
'&rowid='.(isset($obj->$rowidcol) ? $obj->$rowidcol : (!empty($obj->code) ? urlencode($obj->code) :
''));
2125 $url .=
'&code='.(!empty($obj->code) ? urlencode($obj->code) :
'');
2126 if (!empty($param)) {
2129 if (!is_null($withentity)) {
2130 $url .=
'&entity='.$withentity;
2136 print
'<tr class="oddeven" id="rowid-'.(empty($obj->rowid) ?
'' : $obj->rowid).
'">';
2140 print
'<td class="center maxwidthsearch nowraponall">';
2142 if ($canbemodified) {
2143 print
'<a class="reposition editfielda marginleftonly paddingleft marginrightonly paddingright" href="'.$url.
'action=edit&token='.newToken().
'">'.
img_edit().
'</a>';
2148 print
'<a class="reposition marginleftonly paddingleft marginrightonly paddingright" href="'.$url.
'action=delete&token='.newToken().
'">'.
img_delete().
'</a>';
2154 if ($action ==
'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
2155 $tmpaction =
'edit';
2156 $parameters = array(
'fieldlist'=>$fieldlist,
'tabname'=>$tabname[$id]);
2157 $reshook = $hookmanager->executeHooks(
'editDictionaryFieldlist', $parameters, $obj, $tmpaction);
2158 $error = $hookmanager->error;
2159 $errors = $hookmanager->errors;
2162 if (empty($reshook)) {
2163 $withentity =
fieldList($fieldlist, $obj, $tabname[$id],
'edit');
2166 print
'<td colspan="3" class="center">';
2167 print
'<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).
'"></div>';
2168 print
'<input type="hidden" name="page" value="'.dol_escape_htmltag($page).
'">';
2169 print
'<input type="hidden" name="rowid" value="'.dol_escape_htmltag($rowid).
'">';
2170 if (!is_null($withentity)) {
2171 print
'<input type="hidden" name="entity" value="'.$withentity.
'">';
2173 print
'<input type="submit" class="button button-edit small" name="actionmodify" value="'.$langs->trans(
"Modify").
'">';
2174 print
'<input type="submit" class="button button-cancel small" name="actioncancel" value="'.$langs->trans(
"Cancel").
'">';
2177 $tmpaction =
'view';
2178 $parameters = array(
'fieldlist'=>$fieldlist,
'tabname'=>$tabname[$id]);
2179 $reshook = $hookmanager->executeHooks(
'viewDictionaryFieldlist', $parameters, $obj, $tmpaction);
2181 $error = $hookmanager->error;
2182 $errors = $hookmanager->errors;
2184 if (empty($reshook)) {
2187 foreach ($fieldlist as $field => $value) {
2191 $valuetoshow = empty($obj->$value) ?
'' : $obj->$value;
2194 if ($value ==
'entity') {
2195 $withentity = $valuetoshow;
2199 if ($value ==
'element') {
2200 $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
2201 } elseif ($value ==
'source') {
2202 $valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow;
2203 } elseif ($valuetoshow ==
'all') {
2204 $valuetoshow = $langs->trans(
'All');
2205 } elseif ($value ==
'country') {
2206 if (empty($obj->country_code)) {
2209 $key = $langs->trans(
"Country".strtoupper($obj->country_code));
2210 $valuetoshow = ($key !=
"Country".strtoupper($obj->country_code) ? $obj->country_code.
" - ".$key : $obj->country);
2212 } elseif ($value ==
'recuperableonly' || $value ==
'deductible' || $value ==
'category_type') {
2213 $valuetoshow =
yn($valuetoshow ? 1 : 0);
2215 } elseif ($value ==
'type_cdr') {
2216 if (empty($valuetoshow)) {
2217 $valuetoshow = $langs->trans(
'None');
2218 } elseif ($valuetoshow == 1) {
2219 $valuetoshow = $langs->trans(
'AtEndOfMonth');
2220 } elseif ($valuetoshow == 2) {
2221 $valuetoshow = $langs->trans(
'CurrentNext');
2224 } elseif ($value ==
'price' || preg_match(
'/^amount/i', $value)) {
2225 $valuetoshow =
price($valuetoshow);
2227 if ($value ==
'private') {
2228 $valuetoshow =
yn($valuetoshow);
2229 } elseif ($value ==
'libelle_facture') {
2230 $langs->load(
"bills");
2231 $key = $langs->trans(
"PaymentCondition".strtoupper($obj->code));
2232 $valuetoshow = ($obj->code && $key !=
"PaymentCondition".strtoupper($obj->code) ? $key : $obj->$value);
2233 $valuetoshow = nl2br($valuetoshow);
2234 } elseif ($value ==
'label' && $tabname[$id] ==
'c_country') {
2235 $key = $langs->trans(
"Country".strtoupper($obj->code));
2236 $valuetoshow = ($obj->code && $key !=
"Country".strtoupper($obj->code) ? $key : $obj->$value);
2237 } elseif ($value ==
'label' && $tabname[$id] ==
'c_availability') {
2238 $langs->load(
"propal");
2239 $key = $langs->trans(
"AvailabilityType".strtoupper($obj->code));
2240 $valuetoshow = ($obj->code && $key !=
"AvailabilityType".strtoupper($obj->code) ? $key : $obj->$value);
2241 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_actioncomm') {
2242 $key = $langs->trans(
"Action".strtoupper($obj->code));
2243 $valuetoshow = ($obj->code && $key !=
"Action".strtoupper($obj->code) ? $key : $obj->$value);
2244 } elseif (!empty($obj->code_iso) && $value ==
'label' && $tabname[$id] ==
'c_currencies') {
2245 $key = $langs->trans(
"Currency".strtoupper($obj->code_iso));
2246 $valuetoshow = ($obj->code_iso && $key !=
"Currency".strtoupper($obj->code_iso) ? $key : $obj->$value);
2247 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_typent') {
2248 $key = $langs->trans(strtoupper($obj->code));
2249 $valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->$value);
2250 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_prospectlevel') {
2251 $key = $langs->trans(strtoupper($obj->code));
2252 $valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->$value);
2253 } elseif ($value ==
'label' && $tabname[$id] ==
'c_civility') {
2254 $key = $langs->trans(
"Civility".strtoupper($obj->code));
2255 $valuetoshow = ($obj->code && $key !=
"Civility".strtoupper($obj->code) ? $key : $obj->$value);
2256 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_type_contact') {
2257 $langs->load(
'agenda');
2258 $key = $langs->trans(
"TypeContact_".$obj->element.
"_".$obj->source.
"_".strtoupper($obj->code));
2259 $valuetoshow = ($obj->code && $key !=
"TypeContact_".$obj->element.
"_".$obj->source.
"_".strtoupper($obj->code) ? $key : $obj->$value);
2260 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_payment_term') {
2261 $langs->load(
"bills");
2262 $key = $langs->trans(
"PaymentConditionShort".strtoupper($obj->code));
2263 $valuetoshow = ($obj->code && $key !=
"PaymentConditionShort".strtoupper($obj->code) ? $key : $obj->$value);
2264 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_paiement') {
2265 $langs->load(
"bills");
2266 $key = $langs->trans(
"PaymentType".strtoupper($obj->code));
2267 $valuetoshow = ($obj->code && $key !=
"PaymentType".strtoupper($obj->code) ? $key : $obj->$value);
2268 } elseif ($value ==
'type' && $tabname[$id] ==
'c_paiement') {
2269 $payment_type_list = array(0=>$langs->trans(
'PaymentTypeCustomer'), 1=>$langs->trans(
'PaymentTypeSupplier'), 2=>$langs->trans(
'PaymentTypeBoth'));
2270 $valuetoshow = $payment_type_list[$valuetoshow];
2271 } elseif ($value ==
'label' && $tabname[$id] ==
'c_input_reason') {
2272 $key = $langs->trans(
"DemandReasonType".strtoupper($obj->code));
2273 $valuetoshow = ($obj->code && $key !=
"DemandReasonType".strtoupper($obj->code) ? $key : $obj->$value);
2274 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_input_method') {
2275 $langs->load(
"orders");
2276 $key = $langs->trans($obj->code);
2277 $valuetoshow = ($obj->code && $key != $obj->code) ? $key : $obj->$value;
2278 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_shipment_mode') {
2279 $langs->load(
"sendings");
2280 $key = $langs->trans(
"SendingMethod".strtoupper($obj->code));
2281 $valuetoshow = ($obj->code && $key !=
"SendingMethod".strtoupper($obj->code) ? $key : $obj->$value);
2282 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_paper_format') {
2283 $key = $langs->trans(
'PaperFormat'.strtoupper($obj->code));
2284 $valuetoshow = ($obj->code && $key !=
'PaperFormat'.strtoupper($obj->code) ? $key : $obj->$value);
2285 } elseif ($value ==
'label' && $tabname[$id] ==
'c_type_fees') {
2286 $langs->load(
'trips');
2287 $key = $langs->trans(strtoupper($obj->code));
2288 $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->$value);
2289 } elseif ($value ==
'region_id' || $value ==
'country_id') {
2291 } elseif ($value ==
'unicode') {
2292 $valuetoshow = $langs->getCurrencySymbol($obj->code, 1);
2293 } elseif ($value ==
'label' && $tabname[
GETPOST(
"id",
'int')] ==
'c_units') {
2294 $langs->load(
"products");
2295 $valuetoshow = $langs->trans($obj->$value);
2296 } elseif ($value ==
'short_label' && $tabname[
GETPOST(
"id",
'int')] ==
'c_units') {
2297 $langs->load(
"products");
2298 $valuetoshow = $langs->trans($obj->$value);
2299 } elseif (($value ==
'unit') && ($tabname[$id] ==
'c_paper_format')) {
2300 $key = $langs->trans(
'SizeUnit'.strtolower($obj->unit));
2301 $valuetoshow = ($obj->code && $key !=
'SizeUnit'.strtolower($obj->unit) ? $key : $obj->$value);
2302 } elseif ($value ==
'localtax1' || $value ==
'localtax2') {
2304 } elseif ($value ==
'localtax1_type') {
2305 if ($obj->localtax1 != 0) {
2306 $valuetoshow = $localtax_typeList[$valuetoshow];
2311 } elseif ($value ==
'localtax2_type') {
2312 if ($obj->localtax2 != 0) {
2313 $valuetoshow = $localtax_typeList[$valuetoshow];
2318 } elseif ($value ==
'taux') {
2319 $valuetoshow =
price($valuetoshow, 0, $langs, 0, 0);
2321 } elseif (in_array($value, array(
'recuperableonly'))) {
2323 } elseif ($value ==
'accountancy_code' || $value ==
'accountancy_code_sell' || $value ==
'accountancy_code_buy') {
2324 if (isModEnabled(
'accounting')) {
2325 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
2327 $tmpaccountingaccount->fetch(0, $valuetoshow, 1);
2328 $titletoshow = $langs->transnoentitiesnoconv(
"Pcgtype").
': '.$tmpaccountingaccount->pcg_type;
2331 } elseif ($value ==
'fk_tva') {
2332 foreach ($form->cache_vatrates as $key => $Tab) {
2333 if ($form->cache_vatrates[$key][
'rowid'] == $valuetoshow) {
2334 $valuetoshow = $form->cache_vatrates[$key][
'label'];
2338 } elseif ($value ==
'fk_c_exp_tax_cat') {
2339 $tmpid = $valuetoshow;
2341 $valuetoshow = $langs->trans($valuetoshow ? $valuetoshow : $tmpid);
2342 } elseif ($tabname[$id] ==
'c_exp_tax_cat') {
2343 $valuetoshow = $langs->trans($valuetoshow);
2344 } elseif ($value ==
'label' && $tabname[$id] ==
'c_units') {
2345 $langs->load(
'other');
2346 $key = $langs->trans($obj->label);
2347 $valuetoshow = ($obj->label && $key != strtoupper($obj->label) ? $key : $obj->{$value});
2348 } elseif ($value ==
'label' && $tabname[$id] ==
'c_product_nature') {
2349 $langs->load(
"products");
2350 $valuetoshow = $langs->trans($obj->{$value});
2351 } elseif ($fieldlist[$field] ==
'label' && $tabname[$id] ==
'c_productbatch_qcstatus') {
2352 $langs->load(
"productbatch");
2353 $valuetoshow = $langs->trans($obj->{$value});
2354 } elseif ($value ==
'block_if_negative') {
2355 $valuetoshow =
yn($obj->{$value});
2356 } elseif ($value ==
'icon') {
2357 $valuetoshow = $obj->{$value}.
" ".
img_picto(
"", $obj->{$value});
2358 } elseif ($value ==
'type_duration') {
2359 $TDurationTypes = array(
'y'=>$langs->trans(
'Years'),
'm'=>$langs->trans(
'Month'),
'w'=>$langs->trans(
'Weeks'),
'd'=>$langs->trans(
'Days'),
'h'=>$langs->trans(
'Hours'),
'i'=>$langs->trans(
'Minutes'));
2360 if (!empty($obj->{$value}) && array_key_exists($obj->{$value}, $TDurationTypes)) {
2361 $valuetoshow = $TDurationTypes[$obj->{$value}];
2364 $class .= ($class ?
' ' :
'').
'tddict';
2365 if ($value ==
'note' && $id == 10) {
2366 $class .=
' tdoverflowmax200';
2368 if ($value ==
'tracking') {
2369 $class .=
' tdoverflowauto';
2371 if (in_array($value, array(
'nbjour',
'decalage',
'pos',
'position',
'deposit_percent'))) {
2374 if (in_array($value, array(
'localtax1_type',
'localtax2_type'))) {
2375 $class .=
' nowraponall';
2377 if (in_array($value, array(
'use_default',
'fk_parent',
'sortorder'))) {
2378 $class .=
' center';
2380 if ($value ==
'public') {
2381 $class .=
' center';
2385 print
'<!-- '. $value .
' --><td class="'.$class.
'"'.($titletoshow ?
' title="'.dol_escape_htmltag($titletoshow).
'"' :
'').
'>'.$valuetoshow.
'</td>';
2392 print
'<td class="nowrap center">';
2395 print
'<a class="reposition" href="'.$url.
'action='.$acts[$obj->eec].
'_eec&token='.newToken().
'">'.$actl[$obj->eec].
'</a>';
2397 print
'<span class="opacitymedium">'.$langs->trans(
"AlwaysActive").
'</span>';
2400 print
'<td class="nowrap center">';
2403 print
'<a class="reposition" href="'.$url.
'action='.$acts[$obj->favorite].
'_favorite&token='.newToken().
'">'.$actl[$obj->favorite].
'</a>';
2405 print
'<span class="opacitymedium">'.$langs->trans(
"AlwaysActive").
'</span>';
2412 print
'<td class="nowrap center">';
2413 if ($canbedisabled) {
2414 print
'<a class="reposition" href="'.$url.
'action='.$acts[$obj->active].
'&token='.newToken().
'">'.$actl[$obj->active].
'</a>';
2416 if (in_array($obj->code, array(
'AC_OTH',
'AC_OTH_AUTO'))) {
2417 print $langs->trans(
"AlwaysActive");
2418 } elseif (isset($obj->type) && in_array($obj->type, array(
'systemauto')) && empty($obj->active)) {
2419 print $langs->trans(
"Deprecated");
2420 } elseif (isset($obj->type) && in_array($obj->type, array(
'system')) && !empty($obj->active) && $obj->code !=
'AC_OTH') {
2421 print $langs->trans(
"UsedOnlyWithTypeOption");
2423 print
'<span class="opacitymedium">'.$langs->trans(
"AlwaysActive").
'</span>';
2430 print
'<td class="center maxwidthsearch nowraponall">';
2432 if ($canbemodified) {
2433 print
'<a class="reposition marginleftonly paddingleft marginrightonly paddingright editfielda" href="'.$url.
'action=edit&token='.newToken().
'">'.
img_edit().
'</a>';
2438 print
'<a class="reposition marginleftonly paddingleft marginrightonly paddingright" href="'.$url.
'action=delete&token='.newToken().
'">'.
img_delete().
'</a>';
2449 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2465 print
'<span class="opacitymedium">'.$langs->trans(
"DictionaryDesc");
2466 print
" ".$langs->trans(
"OnlyActiveElementsAreShown").
"<br>\n";
2467 print
'</span><br>';
2469 $lastlineisempty =
false;
2471 print
'<div class="div-table-responsive-no-min">';
2472 print
'<table class="noborder centpercent">';
2473 print
'<tr class="liste_titre">';
2474 print
'<td>'.$langs->trans(
"Dictionary").
'</td>';
2476 print
'<td class="hideonsmartphone"></td>';
2479 $showemptyline =
'';
2480 foreach ($taborder as $i) {
2481 if (isset($tabname[$i]) && empty($tabcond[$i])) {
2486 if ($showemptyline) {
2487 print
'<tr class="oddeven"><td></td><td></td><td class="hideonsmartphone"></td></tr>';
2492 $value = $tabname[$i];
2493 print
'<tr class="oddeven"><td class="minwidth200">';
2494 if (!empty($tabcond[$i])) {
2495 $tabnamenoprefix = preg_replace(
'/'.MAIN_DB_PREFIX.
'/',
'', $tabname[$i]);
2496 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$i.
'">';
2497 if (!empty($tabcomplete[$tabnamenoprefix][
'picto'])) {
2498 print
img_picto(
'', $tabcomplete[$tabnamenoprefix][
'picto'],
'class="pictofixedwidth paddingrightonly"');
2500 print $langs->trans($tablib[$i]);
2503 print $langs->trans($tablib[$i]);
2507 print
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$i.
'">';
2511 print
'<td class="right hideonsmartphone">';
2512 print $form->textwithpicto(
'', $langs->trans(
"Table").
': '.MAIN_DB_PREFIX.$tabname[$i]);
2515 $lastlineisempty =
false;
2517 if (!$lastlineisempty) {
2519 $lastlineisempty =
true;
2543function fieldList($fieldlist, $obj =
null, $tabname =
'', $context =
'')
2545 global $conf, $langs, $db, $mysoc;
2548 global $elementList, $sourceList, $localtax_typeList;
2556 foreach ($fieldlist as $field => $value) {
2557 if ($value ==
'entity' && isset($obj->$value)) {
2558 $withentity = $obj->$value;
2562 if (in_array($value, array(
'code',
'libelle',
'type')) && $tabname ==
"c_actioncomm" && isset($obj->$value) && in_array($obj->type, array(
'system',
'systemauto'))) {
2563 $hidden = (!empty($obj->{$value}) ? $obj->{$value} :
'');
2565 print
'<input type="hidden" name="'. $value .
'" value="'.$hidden.
'">';
2566 print $langs->trans($hidden);
2568 } elseif ($value ==
'country') {
2569 if (in_array(
'region_id', $fieldlist)) {
2576 $selected = (!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country :
''));
2577 if (!GETPOSTISSET(
'code')) {
2578 $selected =
GETPOST(
'countryidforinsert');
2580 print $form->select_country($selected, $value,
'', 28,
'minwidth100 maxwidth150 maxwidthonsmartphone');
2582 } elseif ($value ==
'country_id') {
2583 if (!in_array(
'country', $fieldlist)) {
2584 $country_id = (!empty($obj->{$value}) ? $obj->{$value} : 0);
2585 print
'<td class="tdoverflowmax100">';
2586 print
'<input type="hidden" name="'. $value .
'" value="'.$country_id.
'">';
2589 } elseif ($value ==
'region') {
2591 $formcompany->select_region($region_id,
'region');
2593 } elseif ($value ==
'region_id') {
2594 $region_id = (!empty($obj->{$value}) ? $obj->{$value} : 0);
2596 print
'<input type="hidden" name="'. $value .
'" value="'.$region_id.
'">';
2598 } elseif ($value ==
'lang') {
2600 print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,
'lang');
2602 } elseif (in_array($value, array(
'element',
'source'))) {
2603 $tmparray = array();
2604 if ($value ==
'element') {
2605 $tmparray = $elementList;
2607 $tmparray = $sourceList;
2610 print $form->selectarray($value, $tmparray, (!empty($obj->{$value}) ? $obj->{$value} :
''), 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth250');
2612 } elseif (in_array($value, array(
'public',
'use_default'))) {
2614 print
'<td class="center">';
2615 print $form->selectyesno($value, (!empty($obj->{$value}) ? $obj->{$value} :
''), 1);
2617 } elseif ($value ==
'private') {
2620 print $form->selectyesno(
"private", (!empty($obj->{$value}) ? $obj->{$value} :
''));
2622 } elseif ($value ==
'type' && $tabname ==
"c_actioncomm") {
2623 $type = (!empty($obj->type) ? $obj->type :
'user');
2625 print $type.
'<input type="hidden" name="type" value="'.$type.
'">';
2627 } elseif ($value ==
'type' && $tabname ==
'c_paiement') {
2629 $select_list = array(0=>$langs->trans(
'PaymentTypeCustomer'), 1=>$langs->trans(
'PaymentTypeSupplier'), 2=>$langs->trans(
'PaymentTypeBoth'));
2630 print $form->selectarray($value, $select_list, (!empty($obj->{$value}) ? $obj->{$value} :
'2'));
2632 } elseif ($value ==
'recuperableonly' || $value ==
'type_cdr' || $value ==
'deductible' || $value ==
'category_type') {
2633 if ($value ==
'type_cdr') {
2634 print
'<td class="center">';
2638 if ($value ==
'type_cdr') {
2639 print $form->selectarray($value, array(0=>$langs->trans(
'None'), 1=>$langs->trans(
'AtEndOfMonth'), 2=>$langs->trans(
'CurrentNext')), (!empty($obj->{$value}) ? $obj->{$value} :
''));
2641 print $form->selectyesno($value, (!empty($obj->{$value}) ? $obj->{$value} :
''), 1);
2644 } elseif (in_array($value, array(
'nbjour',
'decalage',
'taux',
'localtax1',
'localtax2'))) {
2646 if (in_array($value, array(
'taux',
'localtax1',
'localtax2'))) {
2649 print
'<td class="'.$class.
'">';
2650 print
'<input type="text" class="flat" value="'.(isset($obj->{$value}) ? $obj->{$value} :
'').
'" size="3" name="'. $value .
'">';
2652 } elseif (in_array($value, array(
'libelle_facture'))) {
2657 if ($tabname ==
'c_payment_term') {
2658 $langs->load(
"bills");
2659 if (isset($obj->code) && !empty($obj->code)) {
2660 $transkey =
"PaymentCondition" . strtoupper($obj->code);
2661 if ($langs->trans($transkey) != $transkey) {
2663 print $form->textwithpicto($langs->trans($transkey), $langs->trans(
"GoIntoTranslationMenuToChangeThis"));
2668 print
'<textarea cols="30" rows="'.ROWS_2.
'" class="flat" name="'. $value .
'">'.(!empty($obj->{$value}) ? $obj->{$value} :
'').
'</textarea>';
2670 print
'<input type="hidden" name="'. $value .
'" value="'.$transkey.
'">';
2673 } elseif ($value ==
'price' || preg_match(
'/^amount/i', $value)) {
2674 print
'<td><input type="text" class="flat minwidth75" value="'.price((!empty($obj->{$value}) ? $obj->{$value} :
'')).
'" name="'. $value .
'"></td>';
2675 } elseif ($value ==
'code' && isset($obj->{$value})) {
2676 print
'<td><input type="text" class="flat minwidth75 maxwidth100" value="'.(!empty($obj->{$value}) ? $obj->{$value} :
'').
'" name="'. $value .
'"></td>';
2677 } elseif ($value ==
'unit') {
2680 'mm' => $langs->trans(
'SizeUnitmm'),
2681 'cm' => $langs->trans(
'SizeUnitcm'),
2682 'point' => $langs->trans(
'SizeUnitpoint'),
2683 'inch' => $langs->trans(
'SizeUnitinch')
2685 print $form->selectarray(
'unit', $units, (!empty($obj->{$value}) ? $obj->{$value} :
''), 0, 0, 0);
2687 } elseif ($value ==
'localtax1_type' || $value ==
'localtax2_type') {
2689 print
'<td class="center">';
2690 print $form->selectarray($value, $localtax_typeList, (!empty($obj->{$value}) ? $obj->{$value} :
''));
2692 } elseif ($value ==
'accountancy_code' || $value ==
'accountancy_code_sell' || $value ==
'accountancy_code_buy') {
2694 if (isModEnabled(
'accounting')) {
2695 $fieldname = $value;
2696 $accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0);
2697 print $formaccounting->select_account($accountancy_account,
'.'. $value, 1,
'', 1, 1,
'maxwidth200 maxwidthonsmartphone');
2699 $fieldname = $value;
2700 print
'<input type="text" size="10" class="flat" value="'.(isset($obj->$fieldname) ? $obj->$fieldname :
'').
'" name="'. $value .
'">';
2703 } elseif ($value ==
'fk_tva') {
2705 print $form->load_tva(
'fk_tva', $obj->taux, $mysoc,
new Societe($db), 0, 0,
'',
false, -1);
2707 } elseif ($value ==
'fk_c_exp_tax_cat') {
2709 print $form->selectExpenseCategories($obj->fk_c_exp_tax_cat);
2711 } elseif ($value ==
'fk_range') {
2713 print $form->selectExpenseRanges($obj->fk_range);
2715 } elseif ($value ==
'block_if_negative') {
2717 print $form->selectyesno(
"block_if_negative", (empty($obj->block_if_negative) ?
'' : $obj->block_if_negative), 1);
2719 } elseif ($value ==
'type_duration') {
2721 print $form->selectTypeDuration(
'', (empty($obj->type_duration) ?
'' : $obj->type_duration), array(
'i',
'h'));
2724 $fieldValue = isset($obj->{$value}) ? $obj->{$value} :
'';
2728 if ($value ==
'sortorder') {
2729 $fieldlist[$field] =
'position';
2732 if ($fieldlist[$field] ==
'code') {
2733 $class =
'maxwidth100';
2735 if (in_array($fieldlist[$field], array(
'deposit_percent'))) {
2737 $class =
'maxwidth50 right';
2739 if (in_array($fieldlist[$field], array(
'pos',
'position'))) {
2741 $class =
'maxwidth50 right';
2743 if (in_array($fieldlist[$field], array(
'dayrule',
'day',
'month',
'year',
'use_default',
'affect',
'delay',
'public',
'sortorder',
'sens',
'category_type',
'fk_parent'))) {
2744 $class =
'maxwidth50 center';
2746 if (in_array($fieldlist[$field], array(
'use_default',
'public',
'fk_parent'))) {
2747 $classtd =
'center';
2749 if (in_array($fieldlist[$field], array(
'libelle',
'label',
'tracking'))) {
2750 $class =
'quatrevingtpercent';
2753 if ($fieldlist[$field] ==
'fk_parent') {
2754 if (empty($fieldValue)) {
2761 if (in_array($fieldlist[$field], array(
'libelle',
'label'))) {
2764 case 'c_email_senderprofile':
2765 case 'c_forme_juridique':
2766 case 'c_holiday_types':
2767 case 'c_payment_term':
2768 case 'c_transport_mode':
2769 $maxlength =
' maxlength="255"';
2771 case 'c_email_templates':
2772 $maxlength =
' maxlength="180"';
2774 case 'c_socialnetworks':
2775 $maxlength =
' maxlength="150"';
2778 $maxlength =
' maxlength="128"';
2782 print
'<td class="'.$classtd.
'">';
2785 if (in_array($fieldlist[$field], array(
'label',
'libelle'))) {
2787 if ($tabname ==
'c_civility' && !empty($obj->code)) {
2788 $transkey =
"Civility".strtoupper($obj->code);
2790 if ($tabname ==
'c_payment_term' && !empty($obj->code)) {
2791 $langs->load(
"bills");
2792 $transkey =
"PaymentConditionShort".strtoupper($obj->code);
2794 if ($transkey && $langs->trans($transkey) != $transkey) {
2796 print $form->textwithpicto($langs->trans($transkey), $langs->trans(
"GoIntoTranslationMenuToChangeThis"));
2800 print
'<input type="text" class="flat'.($class ?
' '.$class :
'').
'"'.($maxlength ?
' '.$maxlength :
'').
' value="'.
dol_escape_htmltag($fieldValue).
'" name="'.$fieldlist[$field].
'">';
2802 print
'<input type="hidden" name="'.$fieldlist[$field].
'" value="'.$transkey.
'">';
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous)
complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tabsql, &$tabsqlsort, &$tabfield, &$tabfieldvalue, &$tabfieldinsert, &$tabrowid, &$tabcond, &$tabhelp, &$tabcomplete)
Add external modules to list of dictionaries.
complete_elementList_with_modules(&$elementList)
Search external modules to complete the list of contact element.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage accounting accounts.
Class to manage third parties objects (customers, suppliers, prospects...)
fieldList($fieldlist, $obj=null, $tabname='', $context='')
Show fields in insert/edit mode.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_help($usehelpcursor=1, $usealttitle=1)
Show help logo with cursor "?".
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
getDictionaryValue($tablename, $field, $id, $checkentity=false, $rowidfield='rowid')
Return the value of a filed into a dictionary for the record $id.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.