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$allowed = $user->admin;
58if ($id == 7 && $user->hasRight(
'accounting',
'chartofaccount')) {
61if ($id == 10 && $user->hasRight(
'accounting',
'chartofaccount')) {
64if ($id == 17 && $user->hasRight(
'accounting',
'chartofaccount')) {
71$acts = array(); $actl = array();
74$actl[0] =
img_picto($langs->trans(
"Disabled"),
'switch_off',
'class="size15x"');
75$actl[1] =
img_picto($langs->trans(
"Activated"),
'switch_on',
'class="size15x"');
77$listoffset =
GETPOST(
'listoffset');
81$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
82$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
83$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
84if (empty($page) || $page == -1) {
87$offset = $listlimit * $page;
91$search_country_id =
GETPOST(
'search_country_id',
'int');
92if (!GETPOSTISSET(
'search_country_id') && $search_country_id ==
'' && ($id == 2 || $id == 3 || $id == 10)) {
93 $search_country_id = $mysoc->country_id;
95$search_code =
GETPOST(
'search_code',
'alpha');
98$hookmanager->initHooks(array(
'admin',
'dictionaryadmin'));
104$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);
108$tabname[1] =
"c_forme_juridique";
109$tabname[2] =
"c_departements";
110$tabname[3] =
"c_regions";
111$tabname[4] =
"c_country";
112$tabname[5] =
"c_civility";
113$tabname[6] =
"c_actioncomm";
114$tabname[7] =
"c_chargesociales";
115$tabname[8] =
"c_typent";
116$tabname[9] =
"c_currencies";
117$tabname[10] =
"c_tva";
118$tabname[11] =
"c_type_contact";
119$tabname[12] =
"c_payment_term";
120$tabname[13] =
"c_paiement";
121$tabname[14] =
"c_ecotaxe";
122$tabname[15] =
"c_paper_format";
123$tabname[16] =
"c_prospectlevel";
124$tabname[17] =
"c_type_fees";
125$tabname[18] =
"c_shipment_mode";
126$tabname[19] =
"c_effectif";
127$tabname[20] =
"c_input_method";
128$tabname[21] =
"c_availability";
129$tabname[22] =
"c_input_reason";
130$tabname[23] =
"c_revenuestamp";
131$tabname[24] =
"c_type_resource";
132$tabname[25] =
"c_type_container";
134$tabname[27] =
"c_stcomm";
135$tabname[28] =
"c_holiday_types";
136$tabname[29] =
"c_lead_status";
137$tabname[30] =
"c_format_cards";
138$tabname[31] =
"c_invoice_subtype";
139$tabname[32] =
"c_hrm_public_holiday";
140$tabname[33] =
"c_hrm_department";
141$tabname[34] =
"c_hrm_function";
142$tabname[35] =
"c_exp_tax_cat";
143$tabname[36] =
"c_exp_tax_range";
144$tabname[37] =
"c_units";
145$tabname[38] =
"c_socialnetworks";
146$tabname[39] =
"c_prospectcontactlevel";
147$tabname[40] =
"c_stcommcontact";
148$tabname[41] =
"c_transport_mode";
149$tabname[42] =
"c_product_nature";
150$tabname[43] =
"c_productbatch_qcstatus";
151$tabname[44] =
"c_asset_disposal_type";
155$tablib[1] =
"DictionaryCompanyJuridicalType";
156$tablib[2] =
"DictionaryCanton";
157$tablib[3] =
"DictionaryRegion";
158$tablib[4] =
"DictionaryCountry";
159$tablib[5] =
"DictionaryCivility";
160$tablib[6] =
"DictionaryActions";
161$tablib[7] =
"DictionarySocialContributions";
162$tablib[8] =
"DictionaryCompanyType";
163$tablib[9] =
"DictionaryCurrency";
164$tablib[10] =
"DictionaryVAT";
165$tablib[11] =
"DictionaryTypeContact";
166$tablib[12] =
"DictionaryPaymentConditions";
167$tablib[13] =
"DictionaryPaymentModes";
168$tablib[14] =
"DictionaryEcotaxe";
169$tablib[15] =
"DictionaryPaperFormat";
170$tablib[16] =
"DictionaryProspectLevel";
171$tablib[17] =
"DictionaryFees";
172$tablib[18] =
"DictionarySendingMethods";
173$tablib[19] =
"DictionaryStaff";
174$tablib[20] =
"DictionaryOrderMethods";
175$tablib[21] =
"DictionaryAvailability";
176$tablib[22] =
"DictionarySource";
177$tablib[23] =
"DictionaryRevenueStamp";
178$tablib[24] =
"DictionaryResourceType";
179$tablib[25] =
"DictionaryTypeOfContainer";
181$tablib[27] =
"DictionaryProspectStatus";
182$tablib[28] =
"DictionaryHolidayTypes";
183$tablib[29] =
"DictionaryOpportunityStatus";
184$tablib[30] =
"DictionaryFormatCards";
185$tablib[31] =
"DictionaryInvoiceSubtype";
186$tablib[32] =
"DictionaryPublicHolidays";
187$tablib[33] =
"DictionaryDepartment";
188$tablib[34] =
"DictionaryFunction";
189$tablib[35] =
"DictionaryExpenseTaxCat";
190$tablib[36] =
"DictionaryExpenseTaxRange";
191$tablib[37] =
"DictionaryMeasuringUnits";
192$tablib[38] =
"DictionarySocialNetworks";
193$tablib[39] =
"DictionaryProspectContactLevel";
194$tablib[40] =
"DictionaryProspectContactStatus";
195$tablib[41] =
"DictionaryTransportMode";
196$tablib[42] =
"DictionaryProductNature";
197$tablib[43] =
"DictionaryBatchStatus";
198$tablib[44] =
"DictionaryAssetDisposalType";
202$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";
203$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";
204$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";
205$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";
206$tabsql[5] =
"SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX.
"c_civility AS c";
207$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";
208$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";
209$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";
210$tabsql[9] =
"SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX.
"c_currencies AS c";
211$tabsql[10] =
"SELECT t.rowid, 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";
212$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";
213$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]).
")";
214$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]).
")";
215$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";
216$tabsql[15] =
"SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX.
"c_paper_format";
217$tabsql[16] =
"SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX.
"c_prospectlevel";
218$tabsql[17] =
"SELECT id as rowid, code, label, accountancy_code, active FROM ".MAIN_DB_PREFIX.
"c_type_fees";
219$tabsql[18] =
"SELECT rowid as rowid, code, libelle, tracking, active FROM ".MAIN_DB_PREFIX.
"c_shipment_mode";
220$tabsql[19] =
"SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX.
"c_effectif";
221$tabsql[20] =
"SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX.
"c_input_method";
222$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";
223$tabsql[22] =
"SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX.
"c_input_reason";
224$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";
225$tabsql[24] =
"SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX.
"c_type_resource";
226$tabsql[25] =
"SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX.
"c_type_container as t WHERE t.entity IN (".
getEntity($tabname[25]).
")";
228$tabsql[27] =
"SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX.
"c_stcomm";
229$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";
230$tabsql[29] =
"SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX.
"c_lead_status";
231$tabsql[30] =
"SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX.
"c_format_cards";
232$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";
233$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";
234$tabsql[33] =
"SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX.
"c_hrm_department";
235$tabsql[34] =
"SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX.
"c_hrm_function";
236$tabsql[35] =
"SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX.
"c_exp_tax_cat c";
237$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";
238$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";
239$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]).
")";
240$tabsql[39] =
"SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX.
"c_prospectcontactlevel";
241$tabsql[40] =
"SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX.
"c_stcommcontact";
242$tabsql[41] =
"SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX.
"c_transport_mode";
243$tabsql[42] =
"SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX.
"c_product_nature";
244$tabsql[43] =
"SELECT rowid, code, label, active FROM ".MAIN_DB_PREFIX.
"c_productbatch_qcstatus";
245$tabsql[44] =
"SELECT rowid, code, label, active FROM ".MAIN_DB_PREFIX.
"c_asset_disposal_type";
248$tabsqlsort = array();
249$tabsqlsort[1] =
"country ASC, code ASC";
250$tabsqlsort[2] =
"country ASC, code ASC";
251$tabsqlsort[3] =
"country ASC, code ASC";
252$tabsqlsort[4] =
"code ASC";
253$tabsqlsort[5] =
"label ASC";
254$tabsqlsort[6] =
"a.type ASC, a.module ASC, a.position ASC, a.code ASC";
255$tabsqlsort[7] =
"c.label ASC, a.code ASC, a.libelle ASC";
256$tabsqlsort[8] =
"country DESC,".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ?
' t.position ASC,' :
'').
" libelle ASC";
257$tabsqlsort[9] =
"label ASC";
258$tabsqlsort[10] =
"country ASC, code ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
259$tabsqlsort[11] =
"t.element ASC, t.source ASC, t.position ASC, t.code ASC";
260$tabsqlsort[12] =
"sortorder ASC, code ASC";
261$tabsqlsort[13] =
"code ASC";
262$tabsqlsort[14] =
"country ASC, e.organization ASC, code ASC";
263$tabsqlsort[15] =
"rowid ASC";
264$tabsqlsort[16] =
"sortorder ASC";
265$tabsqlsort[17] =
"code ASC";
266$tabsqlsort[18] =
"code ASC, libelle ASC";
267$tabsqlsort[19] =
"id ASC";
268$tabsqlsort[20] =
"code ASC, libelle ASC";
269$tabsqlsort[21] =
"position ASC, type_duration ASC, qty ASC";
270$tabsqlsort[22] =
"code ASC, label ASC";
271$tabsqlsort[23] =
"country ASC, taux ASC";
272$tabsqlsort[24] =
"code ASC, label ASC";
273$tabsqlsort[25] =
"t.module ASC, t.code ASC, t.label ASC";
275$tabsqlsort[27] =
"code ASC";
276$tabsqlsort[28] =
"sortorder ASC, country ASC, code ASC";
277$tabsqlsort[29] =
"position ASC";
278$tabsqlsort[30] =
"code ASC";
279$tabsqlsort[31] =
"country ASC, code ASC";
280$tabsqlsort[32] =
"country, year ASC, month ASC, day ASC";
281$tabsqlsort[33] =
"code ASC";
282$tabsqlsort[34] =
"code ASC";
283$tabsqlsort[35] =
"c.label ASC";
284$tabsqlsort[36] =
"r.fk_c_exp_tax_cat ASC, r.range_ik ASC";
285$tabsqlsort[37] =
"sortorder ASC";
286$tabsqlsort[38] =
"rowid, code ASC";
287$tabsqlsort[39] =
"sortorder ASC";
288$tabsqlsort[40] =
"code ASC";
289$tabsqlsort[41] =
"code ASC";
290$tabsqlsort[42] =
"code ASC";
291$tabsqlsort[43] =
"code ASC";
292$tabsqlsort[44] =
"code ASC";
296$tabfield[1] =
"code,libelle,country";
297$tabfield[2] =
"code,libelle,region_id,region,country";
298$tabfield[3] =
"code,libelle,country_id,country";
299$tabfield[4] =
"code,label";
300$tabfield[5] =
"code,label";
301$tabfield[6] =
"code,libelle,type,color,position";
302$tabfield[7] =
"code,libelle,country,accountancy_code";
303$tabfield[8] =
"code,libelle,country_id,country".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ?
',position' :
'');
304$tabfield[9] =
"code,label,unicode";
305$tabfield[10] =
"country_id,country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
306$tabfield[11] =
"element,source,code,libelle,position";
307$tabfield[12] =
"code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder";
308$tabfield[13] =
"code,libelle,type";
309$tabfield[14] =
"code,label,price,organization,country";
310$tabfield[15] =
"code,libelle,width,height,unit";
311$tabfield[16] =
"code,libelle,sortorder";
312$tabfield[17] =
"code,label,accountancy_code";
313$tabfield[18] =
"code,libelle,tracking";
314$tabfield[19] =
"code,libelle";
315$tabfield[20] =
"code,libelle";
316$tabfield[21] =
"code,label,qty,type_duration,position";
317$tabfield[22] =
"code,label";
318$tabfield[23] =
"country_id,country,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note";
319$tabfield[24] =
"code,label";
320$tabfield[25] =
"code,label";
322$tabfield[27] =
"code,libelle,picto";
323$tabfield[28] =
"code,label,affect,delay,newbymonth,country_id,country,block_if_negative,sortorder";
324$tabfield[29] =
"code,label,percent,position";
325$tabfield[30] =
"code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
326$tabfield[31] =
"country_id,country,code,label";
327$tabfield[32] =
"code,dayrule,year,month,day,country_id,country";
328$tabfield[33] =
"code,label";
329$tabfield[34] =
"code,label";
330$tabfield[35] =
"label";
331$tabfield[36] =
"range_ik,fk_c_exp_tax_cat";
332$tabfield[37] =
"code,label,short_label,unit_type,scale,sortorder";
333$tabfield[38] =
"code,label,url,icon";
334$tabfield[39] =
"code,libelle,sortorder";
335$tabfield[40] =
"code,libelle,picto";
336$tabfield[41] =
"code,label";
337$tabfield[42] =
"code,label";
338$tabfield[43] =
"code,label";
339$tabfield[44] =
"code,label";
342$tabfieldvalue = array();
343$tabfieldvalue[1] =
"code,libelle,country";
344$tabfieldvalue[2] =
"code,libelle,region";
345$tabfieldvalue[3] =
"code,libelle,country";
346$tabfieldvalue[4] =
"code,label";
347$tabfieldvalue[5] =
"code,label";
348$tabfieldvalue[6] =
"code,libelle,type,color,position";
349$tabfieldvalue[7] =
"code,libelle,country,accountancy_code";
350$tabfieldvalue[8] =
"code,libelle,country".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ?
',position' :
'');
351$tabfieldvalue[9] =
"code,label,unicode";
352$tabfieldvalue[10] =
"country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
353$tabfieldvalue[11] =
"element,source,code,libelle,position";
354$tabfieldvalue[12] =
"code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder";
355$tabfieldvalue[13] =
"code,libelle,type";
356$tabfieldvalue[14] =
"code,label,price,organization,country";
357$tabfieldvalue[15] =
"code,libelle,width,height,unit";
358$tabfieldvalue[16] =
"code,libelle,sortorder";
359$tabfieldvalue[17] =
"code,label,accountancy_code";
360$tabfieldvalue[18] =
"code,libelle,tracking";
361$tabfieldvalue[19] =
"code,libelle";
362$tabfieldvalue[20] =
"code,libelle";
363$tabfieldvalue[21] =
"code,label,qty,type_duration,position";
364$tabfieldvalue[22] =
"code,label";
365$tabfieldvalue[23] =
"country,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note";
366$tabfieldvalue[24] =
"code,label";
367$tabfieldvalue[25] =
"code,label";
369$tabfieldvalue[27] =
"code,libelle,picto";
370$tabfieldvalue[28] =
"code,label,affect,delay,newbymonth,country,block_if_negative,sortorder";
371$tabfieldvalue[29] =
"code,label,percent,position";
372$tabfieldvalue[30] =
"code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
373$tabfieldvalue[31] =
"country,code,label";
374$tabfieldvalue[32] =
"code,dayrule,day,month,year,country";
375$tabfieldvalue[33] =
"code,label";
376$tabfieldvalue[34] =
"code,label";
377$tabfieldvalue[35] =
"label";
378$tabfieldvalue[36] =
"range_ik,fk_c_exp_tax_cat";
379$tabfieldvalue[37] =
"code,label,short_label,unit_type,scale,sortorder";
380$tabfieldvalue[38] =
"code,label,url,icon";
381$tabfieldvalue[39] =
"code,libelle,sortorder";
382$tabfieldvalue[40] =
"code,libelle,picto";
383$tabfieldvalue[41] =
"code,label";
384$tabfieldvalue[42] =
"code,label";
385$tabfieldvalue[43] =
"code,label";
386$tabfieldvalue[44] =
"code,label";
389$tabfieldinsert = array();
390$tabfieldinsert[1] =
"code,libelle,fk_pays";
391$tabfieldinsert[2] =
"code_departement,nom,fk_region";
392$tabfieldinsert[3] =
"code_region,nom,fk_pays";
393$tabfieldinsert[4] =
"code,label";
394$tabfieldinsert[5] =
"code,label";
395$tabfieldinsert[6] =
"code,libelle,type,color,position";
396$tabfieldinsert[7] =
"code,libelle,fk_pays,accountancy_code";
397$tabfieldinsert[8] =
"code,libelle,fk_country".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ?
',position' :
'');
398$tabfieldinsert[9] =
"code_iso,label,unicode";
399$tabfieldinsert[10] =
"fk_pays,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
400$tabfieldinsert[11] =
"element,source,code,libelle,position";
401$tabfieldinsert[12] =
"code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder,entity";
402$tabfieldinsert[13] =
"code,libelle,type,entity";
403$tabfieldinsert[14] =
"code,label,price,organization,fk_pays";
404$tabfieldinsert[15] =
"code,label,width,height,unit";
405$tabfieldinsert[16] =
"code,label,sortorder";
406$tabfieldinsert[17] =
"code,label,accountancy_code";
407$tabfieldinsert[18] =
"code,libelle,tracking";
408$tabfieldinsert[19] =
"code,libelle";
409$tabfieldinsert[20] =
"code,libelle";
410$tabfieldinsert[21] =
"code,label,qty,type_duration,position";
411$tabfieldinsert[22] =
"code,label";
412$tabfieldinsert[23] =
"fk_pays,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note";
413$tabfieldinsert[24] =
"code,label";
414$tabfieldinsert[25] =
"code,label,entity";
416$tabfieldinsert[27] =
"code,libelle,picto";
417$tabfieldinsert[28] =
"code,label,affect,delay,newbymonth,fk_country,block_if_negative,sortorder";
418$tabfieldinsert[29] =
"code,label,percent,position";
419$tabfieldinsert[30] =
"code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
420$tabfieldinsert[31] =
"fk_country,code,label";
421$tabfieldinsert[32] =
"code,dayrule,day,month,year,fk_country";
422$tabfieldinsert[33] =
"code,label";
423$tabfieldinsert[34] =
"code,label";
424$tabfieldinsert[35] =
"label";
425$tabfieldinsert[36] =
"range_ik,fk_c_exp_tax_cat";
426$tabfieldinsert[37] =
"code,label,short_label,unit_type,scale,sortorder";
427$tabfieldinsert[38] =
"code,label,url,icon,entity";
428$tabfieldinsert[39] =
"code,label,sortorder";
429$tabfieldinsert[40] =
"code,libelle,picto";
430$tabfieldinsert[41] =
"code,label";
431$tabfieldinsert[42] =
"code,label";
432$tabfieldinsert[43] =
"code,label";
433$tabfieldinsert[44] =
"code,label";
442$tabrowid[4] =
"rowid";
443$tabrowid[5] =
"rowid";
447$tabrowid[9] =
"code_iso";
449$tabrowid[11] =
"rowid";
454$tabrowid[16] =
"code";
456$tabrowid[18] =
"rowid";
459$tabrowid[21] =
"rowid";
460$tabrowid[22] =
"rowid";
471$tabrowid[33] =
"rowid";
472$tabrowid[34] =
"rowid";
477$tabrowid[39] =
"code";
480$tabrowid[42] =
"rowid";
481$tabrowid[43] =
"rowid";
482$tabrowid[44] =
"rowid";
486$tabcond[1] = (isModEnabled(
"societe"));
490$tabcond[5] = (isModEnabled(
"societe") || isModEnabled(
'adherent'));
491$tabcond[6] = isModEnabled(
'agenda');
492$tabcond[7] = isModEnabled(
'tax');
493$tabcond[8] = isModEnabled(
"societe");
496$tabcond[11] = (isModEnabled(
"societe"));
497$tabcond[12] = (isModEnabled(
'commande') || isModEnabled(
"propal") || isModEnabled(
'facture') || isModEnabled(
"supplier_invoice") || isModEnabled(
"supplier_order"));
498$tabcond[13] = (isModEnabled(
'commande') || isModEnabled(
"propal") || isModEnabled(
'facture') || isModEnabled(
"supplier_invoice") || isModEnabled(
"supplier_order"));
499$tabcond[14] = (isModEnabled(
"product") && (isModEnabled(
'ecotax') || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY)));
501$tabcond[16] = (isModEnabled(
"societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS));
502$tabcond[17] = (isModEnabled(
'deplacement') || isModEnabled(
'expensereport'));
503$tabcond[18] = isModEnabled(
"expedition") || isModEnabled(
"reception");
504$tabcond[19] = isModEnabled(
"societe");
505$tabcond[20] = isModEnabled(
"supplier_order");
506$tabcond[21] = isModEnabled(
"propal");
507$tabcond[22] = (isModEnabled(
'commande') || isModEnabled(
"propal"));
509$tabcond[24] = isModEnabled(
'resource');
510$tabcond[25] = isModEnabled(
'website');
512$tabcond[27] = isModEnabled(
"societe");
513$tabcond[28] = isModEnabled(
'holiday');
514$tabcond[29] = isModEnabled(
'project');
515$tabcond[30] = (isModEnabled(
'label') || isModEnabled(
'barcode') || isModEnabled(
'adherent'));
516$tabcond[31] = ((isModEnabled(
'facture') || isModEnabled(
'supplier_invoice')) && $mysoc->country_code ==
'GR');
517$tabcond[32] = (isModEnabled(
'holiday') || isModEnabled(
'hrm'));
518$tabcond[33] = isModEnabled(
'hrm');
519$tabcond[34] = isModEnabled(
'hrm');
520$tabcond[35] = isModEnabled(
'expensereport') && !empty($conf->global->MAIN_USE_EXPENSE_IK);
521$tabcond[36] = isModEnabled(
'expensereport') && !empty($conf->global->MAIN_USE_EXPENSE_IK);
522$tabcond[37] = isModEnabled(
"product");
523$tabcond[38] = isModEnabled(
'socialnetworks');
524$tabcond[39] = (isModEnabled(
"societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
525$tabcond[40] = (isModEnabled(
"societe") && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
526$tabcond[41] = isModEnabled(
'intracommreport');
527$tabcond[42] = isModEnabled(
"product");
528$tabcond[43] = isModEnabled(
"product") && isModEnabled(
'productbatch') && $conf->global->MAIN_FEATURES_LEVEL >= 2;
529$tabcond[44] = isModEnabled(
'asset');
536 'c_forme_juridique'=>array(
'picto'=>
'company',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
537 'c_departements'=>array(
'picto'=>
'state',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
538 'c_regions'=>array(
'picto'=>
'region',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
539 'c_country'=>array(
'picto'=>
'country',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
540 'c_civility'=>array(
'picto'=>
'contact',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
541 'c_actioncomm'=>array(
'picto'=>
'action',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'color'=>$langs->trans(
"ColorFormat"),
'position'=>$langs->trans(
"PositionIntoComboList"))),
542 'c_chargesociales'=>array(
'picto'=>
'bill',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
543 'c_typent'=>array(
'picto'=>
'company',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'position'=>$langs->trans(
"PositionIntoComboList"))),
544 'c_currencies'=>array(
'picto'=>
'multicurrency',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'unicode'=>$langs->trans(
"UnicodeCurrency"))),
545 '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"))),
546 'c_type_contact'=>array(
'picto'=>
'contact',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'position'=>$langs->trans(
"PositionIntoComboList"))),
547 '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")))),
548 'c_paiement'=>array(
'picto'=>
'bill',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
549 'c_ecotaxe'=>array(
'picto'=>
'bill',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
550 'c_paper_format'=>array(
'picto'=>
'generic',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
551 'c_prospectlevel'=>array(
'picto'=>
'company',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
552 'c_type_fees'=>array(
'picto'=>
'trip',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
553 'c_shipment_mode'=>array(
'picto'=>
'shipment',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'tracking'=>$langs->trans(
"UrlTrackingDesc"))),
554 'c_effectif'=>array(
'picto'=>
'company',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
555 'c_input_method'=>array(
'picto'=>
'order',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
556 'c_input_reason'=>array(
'picto'=>
'order',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'position'=>$langs->trans(
"PositionIntoComboList"))),
557 'c_availability'=>array(
'picto'=>
'shipment',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
558 'c_revenuestamp'=>array(
'picto'=>
'bill',
'help'=>array(
'revenuestamp_type'=>$langs->trans(
'FixedOrPercent'))),
559 'c_type_resource'=>array(
'picto'=>
'resource',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
560 'c_type_container'=>array(
'picto'=>
'website',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
561 'c_stcomm'=>array(
'picto'=>
'company',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'picto'=>$langs->trans(
"PictoHelp"))),
562 'c_holiday_types'=>array(
'picto'=>
'holiday',
'help'=>array(
'affect'=>$langs->trans(
"FollowedByACounter"),
'delay'=>$langs->trans(
"MinimumNoticePeriod"),
'newbymonth'=>$langs->trans(
"NbAddedAutomatically"))),
563 'c_lead_status'=>array(
'picto'=>
'project',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'percent'=>$langs->trans(
"OpportunityPercent"),
'position'=>$langs->trans(
"PositionIntoComboList"))),
564 'c_format_cards'=>array(
'picto'=>
'generic',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'name'=>$langs->trans(
"LabelName"),
'paper_size'=>$langs->trans(
"LabelPaperSize"))),
565 '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"))),
566 'c_hrm_department'=>array(
'picto'=>
'hrm',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
567 'c_hrm_function'=>array(
'picto'=>
'hrm',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
568 'c_exp_tax_cat'=>array(
'picto'=>
'expensereport',
'help'=>array()),
569 'c_exp_tax_range'=>array(
'picto'=>
'expensereport',
'help'=>array(
'range_ik'=>$langs->trans(
'PrevRangeToThisRange'))),
570 'c_units'=>array(
'picto'=>
'product',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'unit_type' => $langs->trans(
'Measuringtype_durationDesc'),
'scale' => $langs->trans(
'MeasuringScaleDesc'))),
571 'c_socialnetworks'=>array(
'picto'=>
'share-alt',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'url' => $langs->trans(
'UrlSocialNetworksDesc'),
'icon' => $langs->trans(
'FafaIconSocialNetworksDesc'))),
572 'c_prospectcontactlevel'=>array(
'picto'=>
'company',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
573 'c_stcommcontact'=>array(
'picto'=>
'company',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"),
'picto'=>$langs->trans(
"PictoHelp"))),
574 'c_transport_mode'=>array(
'picto'=>
'incoterm',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
575 'c_product_nature'=>array(
'picto'=>
'product',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
576 'c_productbatch_qcstatus'=>array(
'picto'=>
'lot',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
577 'c_asset_disposal_type'=>array(
'picto'=>
'asset',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
578 'c_invoice_subtype'=>array(
'picto'=>
'bill',
'help'=>array(
'code'=>$langs->trans(
"EnterAnyCode"))),
583complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabcomplete);
587foreach ($tabcomplete as $key => $value) {
590 if (!isset($tabcond[$i])) {
593 $tabcomplete[$key][
'id'] = $i;
594 $tabcomplete[$key][
'cond'] = $tabcond[$i];
595 $tabcomplete[$key][
'rowid'] = $tabrowid[$i];
596 $tabcomplete[$key][
'fieldinsert'] = $tabfieldinsert[$i];
597 $tabcomplete[$key][
'fieldvalue'] = $tabfieldvalue[$i];
598 $tabcomplete[$key][
'lib'] = $tablib[$i];
599 $tabcomplete[$key][
'sql'] = $tabsql[$i];
600 $tabcomplete[$key][
'sqlsort'] = $tabsqlsort[$i];
601 $tabcomplete[$key][
'field'] = $tabfield[$i];
607 $arrayofkeys = array_keys($tabcomplete);
608 if (array_key_exists($id -1, $arrayofkeys)) {
609 $keytable = $arrayofkeys[$id - 1];
614if (empty($sortfield)) {
615 $tmp1 = explode(
',', empty($tabcomplete[$keytable][
'sqlsort']) ?
'' : $tabcomplete[$keytable][
'sqlsort']);
616 $tmp2 = explode(
' ', $tmp1[0]);
617 $sortfield = preg_replace(
'/^.*\./',
'', $tmp2[0]);
618 $sortorder = (!empty($tmp2[1]) ? $tmp2[1] :
'');
623$elementList = array();
624$sourceList = array();
626 $elementList = array(
628 'agenda' =>
img_picto(
'',
'action',
'class="pictofixedwidth"').$langs->trans(
'Agenda'),
629 'dolresource' =>
img_picto(
'',
'resource',
'class="pictofixedwidth"').$langs->trans(
'Resource'),
630 'societe' =>
img_picto(
'',
'company',
'class="pictofixedwidth"').$langs->trans(
'ThirdParty'),
636 'project' =>
img_picto(
'',
'project',
'class="pictofixedwidth"').$langs->trans(
'Project'),
637 'project_task' =>
img_picto(
'',
'projecttask',
'class="pictofixedwidth"').$langs->trans(
'Task'),
638 'propal' =>
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
'Proposal'),
639 'commande' =>
img_picto(
'',
'order',
'class="pictofixedwidth"').$langs->trans(
'Order'),
640 'facture' =>
img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
'Bill'),
641 'fichinter' =>
img_picto(
'',
'intervention',
'class="pictofixedwidth"').$langs->trans(
'InterventionCard'),
642 'contrat' =>
img_picto(
'',
'contract',
'class="pictofixedwidth"').$langs->trans(
'Contract'),
643 'ticket' =>
img_picto(
'',
'ticket',
'class="pictofixedwidth"').$langs->trans(
'Ticket'),
644 'supplier_proposal' =>
img_picto(
'',
'supplier_proposal',
'class="pictofixedwidth"').$langs->trans(
'SupplierProposal'),
645 'order_supplier' =>
img_picto(
'',
'supplier_order',
'class="pictofixedwidth"').$langs->trans(
'SupplierOrder'),
646 'invoice_supplier' =>
img_picto(
'',
'supplier_invoice',
'class="pictofixedwidth"').$langs->trans(
'SupplierBill'),
648 if (!empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) {
649 $elementList[
'conferenceorbooth'] =
img_picto(
'',
'eventorganization',
'class="pictofixedwidth"').$langs->trans(
'ConferenceOrBooth');
656 'internal' => $langs->trans(
'Internal'),
657 'external' => $langs->trans(
'External')
662$localtax_typeList = array(
663 "0" => $langs->trans(
"No"),
664 "1" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 1)",
665 "2" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 2)",
666 "3" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 3)",
667 "4" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 4)",
668 "5" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 5)",
669 "6" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 6)"
677$object =
new stdClass();
682 'confirm' =>$confirm,
684 'taborder' =>$taborder,
685 'tabname' =>$tabname,
688 'tabsqlsort' =>$tabsqlsort,
689 'tabfield' =>$tabfield,
690 'tabfieldvalue' =>$tabfieldvalue,
691 'tabfieldinsert'=>$tabfieldinsert,
692 'tabrowid' =>$tabrowid,
693 'tabcond' =>$tabcond,
694 'tabhelp' =>$tabhelp,
695 'tabcomplete' =>$tabcomplete
697$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
702if (
GETPOST(
'button_removefilter',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter_x',
'alpha')) {
703 $search_country_id =
'';
707if (empty($reshook)) {
710 $listfield = explode(
',', str_replace(
' ',
'', $tabfield[$id]));
711 $listfieldinsert = explode(
',', $tabfieldinsert[$id]);
712 $listfieldmodify = explode(
',', $tabfieldinsert[$id]);
713 $listfieldvalue = explode(
',', $tabfieldvalue[$id]);
717 foreach ($listfield as $f => $value) {
719 if ($value ==
'country_id' && in_array($tablib[$id], array(
'DictionaryPublicHolidays',
'DictionaryVAT',
'DictionaryInvoiceSubtype',
'DictionaryRegion',
'DictionaryCompanyType',
'DictionaryHolidayTypes',
'DictionaryRevenueStamp',
'DictionaryAccountancysystem',
'DictionaryAccountancyCategory'))) {
722 if ($value ==
'country' && in_array($tablib[$id], array(
'DictionaryPublicHolidays',
'DictionaryCanton',
'DictionaryCompanyType',
'DictionaryHolidayTypes',
'DictionaryRevenueStamp'))) {
726 if ($value ==
'localtax1' && !
GETPOST(
'localtax1_type')) {
729 if ($value ==
'localtax2' && !
GETPOST(
'localtax2_type')) {
732 if ($value ==
'color' && !
GETPOST(
'color')) {
735 if ($value ==
'formula' && !
GETPOST(
'formula')) {
738 if ($value ==
'dayrule' && !
GETPOST(
'dayrule')) {
741 if ($value ==
'sortorder') {
744 if ((!GETPOSTISSET($value) ||
GETPOST($value) ==
'')
745 && (!in_array($value, array(
'decalage',
'module',
'accountancy_code',
'accountancy_code_sell',
'accountancy_code_buy',
'tracking',
'picto',
'deposit_percent'))
746 && ($id != 10 || ($value !=
'code' && $value !=
'note'))
750 $fieldnamekey = $value;
752 if ($fieldnamekey ==
'libelle' || ($fieldnamekey ==
'label')) {
753 $fieldnamekey =
'Label';
755 if ($fieldnamekey ==
'libelle_facture') {
756 $fieldnamekey =
'LabelOnDocuments';
758 if ($fieldnamekey ==
'deposit_percent') {
759 $fieldnamekey =
'DepositPercent';
761 if ($fieldnamekey ==
'nbjour') {
762 $fieldnamekey =
'NbOfDays';
764 if ($fieldnamekey ==
'decalage') {
765 $fieldnamekey =
'Offset';
767 if ($fieldnamekey ==
'module') {
768 $fieldnamekey =
'Module';
770 if ($fieldnamekey ==
'code') {
771 $fieldnamekey =
'Code';
773 if ($fieldnamekey ==
'note') {
774 $fieldnamekey =
'Note';
776 if ($fieldnamekey ==
'taux') {
777 $fieldnamekey =
'Rate';
779 if ($fieldnamekey ==
'type') {
780 $fieldnamekey =
'Type';
782 if ($fieldnamekey ==
'position') {
783 $fieldnamekey =
'Position';
785 if ($fieldnamekey ==
'unicode') {
786 $fieldnamekey =
'Unicode';
788 if ($fieldnamekey ==
'deductible') {
789 $fieldnamekey =
'Deductible';
791 if ($fieldnamekey ==
'sortorder') {
792 $fieldnamekey =
'SortOrder';
794 if ($fieldnamekey ==
'category_type') {
795 $fieldnamekey =
'Calculated';
797 if ($fieldnamekey ==
'revenuestamp_type') {
798 $fieldnamekey =
'TypeOfRevenueStamp';
800 if ($fieldnamekey ==
'use_default') {
801 $fieldnamekey =
'UseByDefault';
804 setEventMessages($langs->transnoentities(
"ErrorFieldRequired", $langs->transnoentities($fieldnamekey)),
null,
'errors');
808 if (
GETPOST(
'actionadd') && $tabname[$id] ==
"c_actioncomm" && GETPOSTISSET(
"type") && in_array(
GETPOST(
"type"), array(
'system',
'systemauto'))) {
810 setEventMessages($langs->transnoentities(
'ErrorReservedTypeSystemSystemAuto'),
null,
'errors');
812 if (GETPOSTISSET(
"code")) {
815 setEventMessages($langs->transnoentities(
'ErrorCodeCantContainZero'),
null,
'errors');
818 if (GETPOSTISSET(
"country") && (
GETPOST(
"country") ==
'0') && ($id != 2)) {
819 if (in_array($tablib[$id], array(
'DictionaryCompanyType',
'DictionaryHolidayTypes'))) {
820 $_POST[
"country"] =
'';
823 setEventMessages($langs->transnoentities(
"ErrorFieldRequired", $langs->transnoentities(
"Country")),
null,
'errors');
826 if (($id == 3 || $id == 42) && !is_numeric(
GETPOST(
"code")) &&
GETPOST(
'actionadd')) {
828 setEventMessages($langs->transnoentities(
"ErrorFieldMustBeANumeric", $langs->transnoentities(
"Code")),
null,
'errors');
833 $_POST[
"localtax1"] =
'0';
836 $_POST[
"localtax2"] =
'0';
838 if (
GETPOST(
"accountancy_code") <= 0) {
839 $_POST[
"accountancy_code"] =
'';
841 if (
GETPOST(
"accountancy_code_sell") <= 0) {
842 $_POST[
"accountancy_code_sell"] =
'';
844 if (
GETPOST(
"accountancy_code_buy") <= 0) {
845 $_POST[
"accountancy_code_buy"] =
'';
847 if ($id == 10 && GETPOSTISSET(
"code")) {
848 $_POST[
"code"] = preg_replace(
'/[^a-zA-Z0-9_\-\+]/',
'',
GETPOST(
"code"));
851 $tablename = $tabname[$id];
852 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
855 if ($ok &&
GETPOST(
'actionadd')) {
856 if ($tabrowid[$id]) {
859 $sql =
"SELECT MAX(".$tabrowid[$id].
") as newid FROM ".MAIN_DB_PREFIX.$tablename;
860 $result = $db->query($sql);
862 $obj = $db->fetch_object($result);
863 $newid = ($obj->newid + 1);
870 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.$tablename.
" (";
872 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
873 $sql .= $tabrowid[$id].
",";
875 $sql .= $tabfieldinsert[$id];
880 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
884 foreach ($listfieldinsert as $f => $value) {
885 $keycode = (isset($listfieldvalue[$i]) ? $listfieldvalue[$i] :
'');
886 if (empty($keycode)) {
890 if ($value ==
'price' || preg_match(
'/^amount/i', $value)) {
892 } elseif ($value ==
'taux' || $value ==
'localtax1') {
894 } elseif ($value ==
'entity') {
895 $_POST[$keycode] =
getEntity($tablename);
902 if ($keycode ==
'sortorder') {
903 $sql .= (int)
GETPOST(
'position',
'int');
904 } elseif (
GETPOST($keycode) ==
'' && !($keycode ==
'code' && $id == 10)) {
906 } elseif ($keycode ==
'content') {
907 $sql .=
"'".$db->escape(
GETPOST($keycode,
'restricthtml')).
"'";
908 } elseif (in_array($keycode, array(
'joinfile',
'private',
'pos',
'position',
'scale',
'use_default'))) {
909 $sql .= (int)
GETPOST($keycode,
'int');
911 $sql .=
"'".$db->escape(
GETPOST($keycode,
'alphanohtml')).
"'";
919 $resql = $db->query($sql);
921 setEventMessages($langs->transnoentities(
"RecordCreatedSuccessfully"),
null,
'mesgs');
924 if ($id == 10 &&
GETPOST(
'country',
'int') > 0) {
925 $search_country_id =
GETPOST(
'country',
'int');
927 $_POST = array(
'id'=>$id);
929 if ($db->errno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
930 setEventMessages($langs->transnoentities(
"ErrorRecordAlreadyExists"),
null,
'errors');
938 if ($ok &&
GETPOST(
'actionmodify')) {
939 if ($tabrowid[$id]) {
940 $rowidcol = $tabrowid[$id];
946 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET ";
948 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
949 $sql .= $tabrowid[$id].
"=";
950 $sql .=
"'".$db->escape($rowid).
"', ";
953 foreach ($listfieldmodify as $field) {
954 $keycode = $listfieldvalue[$i];
955 if (empty($keycode)) {
959 if ($field ==
'price' || preg_match(
'/^amount/i', $field)) {
961 } elseif ($field ==
'taux' || $field ==
'localtax1') {
963 } elseif ($field ==
'entity') {
964 $_POST[$keycode] =
getEntity($tablename);
971 if ($listfieldvalue[$i] ==
'sortorder') {
972 $sql .= (int)
GETPOST(
'position',
'int');
973 } elseif (
GETPOST($keycode) ==
'' && !($keycode ==
'code' && $id == 10)) {
975 } elseif ($keycode ==
'content') {
976 $sql .=
"'".$db->escape(
GETPOST($keycode,
'restricthtml')).
"'";
977 } elseif (in_array($keycode, array(
'joinfile',
'private',
'pos',
'position',
'scale',
'use_default'))) {
978 $sql .= (int)
GETPOST($keycode,
'int');
980 $sql .=
"'".$db->escape(
GETPOST($keycode,
'alphanohtml')).
"'";
985 if (in_array($rowidcol, array(
'code',
'code_iso'))) {
986 $sql .=
" WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'";
988 $sql .=
" WHERE ".$rowidcol.
" = ".((int) $rowid);
990 if (in_array(
'entity', $listfieldmodify)) {
991 $sql .=
" AND entity = ".((int)
getEntity($tablename, 0));
996 $resql = $db->query($sql);
1003 if ($action ==
'confirm_delete' && $confirm ==
'yes') {
1004 if ($tabrowid[$id]) {
1005 $rowidcol = $tabrowid[$id];
1007 $rowidcol =
"rowid";
1010 $tablename = $tabname[$id];
1011 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1013 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.$tablename.
" WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1016 $result = $db->query($sql);
1018 if ($db->errno() ==
'DB_ERROR_CHILD_EXISTS') {
1019 setEventMessages($langs->transnoentities(
"ErrorRecordIsUsedByChild"),
null,
'errors');
1027 if ($action == $acts[0]) {
1028 if ($tabrowid[$id]) {
1029 $rowidcol = $tabrowid[$id];
1031 $rowidcol =
"rowid";
1034 $tablename = $tabname[$id];
1035 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1038 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 1 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1040 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 1 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1043 $result = $db->query($sql);
1050 if ($action == $acts[1]) {
1051 if ($tabrowid[$id]) {
1052 $rowidcol = $tabrowid[$id];
1054 $rowidcol =
"rowid";
1057 $tablename = $tabname[$id];
1058 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1061 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 0 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1063 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 0 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1066 $result = $db->query($sql);
1073 if ($action ==
'activate_favorite') {
1074 if ($tabrowid[$id]) {
1075 $rowidcol = $tabrowid[$id];
1077 $rowidcol =
"rowid";
1080 $tablename = $tabname[$id];
1081 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1084 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 1 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1086 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 1 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1089 $result = $db->query($sql);
1096 if ($action ==
'disable_favorite') {
1097 if ($tabrowid[$id]) {
1098 $rowidcol = $tabrowid[$id];
1100 $rowidcol =
"rowid";
1103 $tablename = $tabname[$id];
1104 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1107 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 0 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1109 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 0 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1112 $result = $db->query($sql);
1119 if ($action ==
'activate_eec') {
1120 if ($tabrowid[$id]) {
1121 $rowidcol = $tabrowid[$id];
1123 $rowidcol =
"rowid";
1126 $tablename = $tabname[$id];
1127 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1130 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 1 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1132 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 1 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1135 $result = $db->query($sql);
1142 if ($action ==
'disable_eec') {
1143 if ($tabrowid[$id]) {
1144 $rowidcol = $tabrowid[$id];
1146 $rowidcol =
"rowid";
1149 $tablename = $tabname[$id];
1150 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1153 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 0 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1155 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 0 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1158 $result = $db->query($sql);
1170$form =
new Form($db);
1173$title = $langs->trans(
"DictionarySetup");
1179 $title .=
' - '.$langs->trans($tablib[$id]);
1180 $linkback =
'<a href="'.$_SERVER[
'PHP_SELF'].
'">'.$langs->trans(
"BackToDictionaryList").
'</a>';
1182$titlepicto =
'title_setup';
1183if ($id == 10 &&
GETPOST(
'from') ==
'accountancy') {
1184 $title = $langs->trans(
"MenuVatAccounts");
1185 $titlepicto =
'accountancy';
1187if ($id == 7 &&
GETPOST(
'from') ==
'accountancy') {
1188 $title = $langs->trans(
"MenuTaxAccounts");
1189 $titlepicto =
'accountancy';
1195 print
'<span class="opacitymedium">'.$langs->trans(
"DictionaryDesc");
1196 print
" ".$langs->trans(
"OnlyActiveElementsAreShown").
"<br>\n";
1197 print
'</span><br>';
1201$param =
'&id='.urlencode($id);
1202if ($search_country_id || GETPOSTISSET(
'page') ||
GETPOST(
'button_removefilter',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter_x',
'alpha')) {
1203 $param .=
'&search_country_id='.urlencode($search_country_id);
1205if ($search_code !=
'') {
1206 $param .=
'&search_code='.urlencode($search_code);
1209 $param .=
'&entity='.(int) $entity;
1211$paramwithsearch = $param;
1213 $paramwithsearch .=
'&sortorder='.urlencode($sortorder);
1216 $paramwithsearch .=
'&sortfield='.urlencode($sortfield);
1219 $paramwithsearch .=
'&from='.urlencode(
GETPOST(
'from',
'alpha'));
1224if ($action ==
'delete') {
1225 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);
1233 $sql = $tabsql[$id];
1235 if (!preg_match(
'/ WHERE /', $sql)) {
1236 $sql .=
" WHERE 1 = 1";
1238 if ($search_country_id > 0) {
1239 $sql .=
" AND c.rowid = ".((int) $search_country_id);
1241 if ($search_code !=
'' && $id == 9) {
1243 } elseif ($search_code !=
'' && $id == 28) {
1245 } elseif ($search_code !=
'' && ($id == 7 || $id == 32)) {
1247 } elseif ($search_code !=
'' && $id == 3) {
1249 } elseif ($search_code !=
'' && ($id == 8 || $id == 10)) {
1251 } elseif ($search_code !=
'' && $id == 1) {
1253 } elseif ($search_code !=
'' && $id == 2) {
1255 } elseif ($search_code !=
'' && $id == 14) {
1257 } elseif ($search_code !=
'' && $id != 9) {
1263 if ($sortfield ==
'country') {
1264 $sortfield =
'country_code';
1266 $sql .= $db->order($sortfield, $sortorder);
1269 $tabsqlsort[$id] = preg_replace(
'/([a-z]+\.)?'.$sortfield.
' '.$sortorder.
',/i',
'', $tabsqlsort[$id]);
1270 $tabsqlsort[$id] = preg_replace(
'/([a-z]+\.)?'.$sortfield.
',/i',
'', $tabsqlsort[$id]);
1272 $sql .=
" ORDER BY ";
1274 $sql .= $tabsqlsort[$id];
1275 $sql .= $db->plimit($listlimit + 1, $offset);
1278 if (empty($tabfield[$id])) {
1279 dol_print_error($db,
'The table with id '.$id.
' has no array tabfield defined');
1282 $fieldlist = explode(
',', $tabfield[$id]);
1284 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.$id.
'" method="POST">';
1285 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1286 print
'<input type="hidden" name="from" value="'.dol_escape_htmltag(
GETPOST(
'from',
'alpha')).
'">';
1288 if ($id == 10 && empty($conf->global->FACTURE_TVAOPTION)) {
1289 print
info_admin($langs->trans(
"VATIsUsedIsOff", $langs->transnoentities(
"Setup"), $langs->transnoentities(
"CompanyFoundation")));
1294 if ($tabname[$id]) {
1297 $fieldlist = explode(
',', $tabfield[$id]);
1299 print
'<div class="div-table-responsive-no-min">';
1300 print
'<table class="noborder centpercent">';
1303 print
'<!-- line title to add new entry -->';
1304 $tdsoffields =
'<tr class="liste_titre">';
1305 foreach ($fieldlist as $field => $value) {
1306 if ($value ==
'entity') {
1312 $valuetoshow = ucfirst($value);
1313 $valuetoshow = $langs->trans($valuetoshow);
1316 if ($value ==
'pos') {
1317 $valuetoshow = $langs->trans(
"Position"); $class =
'right';
1319 if ($value ==
'source') {
1320 $valuetoshow = $langs->trans(
"Contact");
1322 if ($value ==
'price') {
1323 $valuetoshow = $langs->trans(
"PriceUHT");
1325 if ($value ==
'taux') {
1326 if ($tabname[$id] !=
"c_revenuestamp") {
1327 $valuetoshow = $langs->trans(
"Rate");
1329 $valuetoshow = $langs->trans(
"Amount");
1333 if ($value ==
'localtax1_type') {
1334 $valuetoshow = $langs->trans(
"UseLocalTax").
" 2"; $class =
"center"; $sortable = 0;
1336 if ($value ==
'localtax1') {
1337 $valuetoshow = $langs->trans(
"RateOfTaxN",
'2'); $class =
"center";
1339 if ($value ==
'localtax2_type') {
1340 $valuetoshow = $langs->trans(
"UseLocalTax").
" 3"; $class =
"center"; $sortable = 0;
1342 if ($value ==
'localtax2') {
1343 $valuetoshow = $langs->trans(
"RateOfTaxN",
'3'); $class =
"center";
1345 if ($value ==
'organization') {
1346 $valuetoshow = $langs->trans(
"Organization");
1348 if ($value ==
'lang') {
1349 $valuetoshow = $langs->trans(
"Language");
1351 if ($value ==
'type') {
1352 if ($tabname[$id] ==
"c_paiement") {
1353 $valuetoshow = $form->textwithtooltip($langs->trans(
"Type"), $langs->trans(
"TypePaymentDesc"), 2, 1,
img_help(1,
''));
1355 $valuetoshow = $langs->trans(
"Type");
1358 if ($value ==
'code') {
1359 $valuetoshow = $langs->trans(
"Code"); $class =
'maxwidth100';
1361 if ($value ==
'libelle' || $value ==
'label') {
1362 $valuetoshow = $form->textwithtooltip($langs->trans(
"Label"), $langs->trans(
"LabelUsedByDefault"), 2, 1,
img_help(1,
''));
1364 if ($value ==
'libelle_facture') {
1365 $valuetoshow = $form->textwithtooltip($langs->trans(
"LabelOnDocuments"), $langs->trans(
"LabelUsedByDefault"), 2, 1,
img_help(1,
''));
1367 if ($value ==
'deposit_percent') {
1368 $valuetoshow = $langs->trans(
'DepositPercent');
1371 if ($value ==
'country') {
1372 if (in_array(
'region_id', $fieldlist)) {
1376 $valuetoshow = $langs->trans(
"Country");
1378 if ($value ==
'recuperableonly') {
1379 $valuetoshow = $langs->trans(
"NPR"); $class =
"center";
1381 if ($value ==
'nbjour') {
1382 $valuetoshow = $langs->trans(
"NbOfDays");
1385 if ($value ==
'type_cdr') {
1386 $valuetoshow = $langs->trans(
"AtEndOfMonth"); $class =
"center";
1388 if ($value ==
'decalage') {
1389 $valuetoshow = $langs->trans(
"Offset");
1392 if ($value ==
'width' || $value ==
'nx') {
1393 $valuetoshow = $langs->trans(
"Width");
1395 if ($value ==
'height' || $value ==
'ny') {
1396 $valuetoshow = $langs->trans(
"Height");
1398 if ($value ==
'unit' || $value ==
'metric') {
1399 $valuetoshow = $langs->trans(
"MeasuringUnit");
1401 if ($value ==
'region_id' || $value ==
'country_id') {
1404 if ($value ==
'accountancy_code') {
1405 $valuetoshow = $langs->trans(
"AccountancyCode");
1407 if ($value ==
'accountancy_code_sell') {
1408 $valuetoshow = $langs->trans(
"AccountancyCodeSell");
1410 if ($value ==
'accountancy_code_buy') {
1411 $valuetoshow = $langs->trans(
"AccountancyCodeBuy");
1413 if ($value ==
'pcg_version' || $value ==
'fk_pcg_version') {
1414 $valuetoshow = $langs->trans(
"Pcg_version");
1416 if ($value ==
'account_parent') {
1417 $valuetoshow = $langs->trans(
"Accountparent");
1419 if ($value ==
'pcg_type') {
1420 $valuetoshow = $langs->trans(
"Pcg_type");
1422 if ($value ==
'pcg_subtype') {
1423 $valuetoshow = $langs->trans(
"Pcg_subtype");
1425 if ($value ==
'sortorder') {
1426 $valuetoshow = $langs->trans(
"SortOrder");
1429 if ($value ==
'short_label') {
1430 $valuetoshow = $langs->trans(
"ShortLabel");
1432 if ($value ==
'fk_parent') {
1433 $valuetoshow = $langs->trans(
"ParentID"); $class =
'center';
1435 if ($value ==
'range_account') {
1436 $valuetoshow = $langs->trans(
"Range");
1438 if ($value ==
'sens') {
1439 $valuetoshow = $langs->trans(
"Sens");
1441 if ($value ==
'category_type') {
1442 $valuetoshow = $langs->trans(
"Calculated");
1444 if ($value ==
'formula') {
1445 $valuetoshow = $langs->trans(
"Formula");
1447 if ($value ==
'paper_size') {
1448 $valuetoshow = $langs->trans(
"PaperSize");
1450 if ($value ==
'orientation') {
1451 $valuetoshow = $langs->trans(
"Orientation");
1453 if ($value ==
'leftmargin') {
1454 $valuetoshow = $langs->trans(
"LeftMargin");
1456 if ($value ==
'topmargin') {
1457 $valuetoshow = $langs->trans(
"TopMargin");
1459 if ($value ==
'spacex') {
1460 $valuetoshow = $langs->trans(
"SpaceX");
1462 if ($value ==
'spacey') {
1463 $valuetoshow = $langs->trans(
"SpaceY");
1465 if ($value ==
'font_size') {
1466 $valuetoshow = $langs->trans(
"FontSize");
1468 if ($value ==
'custom_x') {
1469 $valuetoshow = $langs->trans(
"CustomX");
1471 if ($value ==
'custom_y') {
1472 $valuetoshow = $langs->trans(
"CustomY");
1474 if ($value ==
'percent') {
1475 $valuetoshow = $langs->trans(
"Percentage");
1477 if ($value ==
'affect') {
1478 $valuetoshow = $langs->trans(
"WithCounter");
1480 if ($value ==
'delay') {
1481 $valuetoshow = $langs->trans(
"NoticePeriod");
1483 if ($value ==
'newbymonth') {
1484 $valuetoshow = $langs->trans(
"NewByMonth");
1486 if ($value ==
'fk_tva') {
1487 $valuetoshow = $langs->trans(
"VAT");
1489 if ($value ==
'range_ik') {
1490 $valuetoshow = $langs->trans(
"RangeIk");
1492 if ($value ==
'fk_c_exp_tax_cat') {
1493 $valuetoshow = $langs->trans(
"CarCategory");
1495 if ($value ==
'revenuestamp_type') {
1496 $valuetoshow = $langs->trans(
'TypeOfRevenueStamp');
1498 if ($value ==
'use_default') {
1499 $valuetoshow = $langs->trans(
'Default'); $class =
'center';
1501 if ($value ==
'unit_type') {
1502 $valuetoshow = $langs->trans(
'TypeOfUnit');
1504 if ($value ==
'public' && $tablib[$id] ==
'TicketDictCategory') {
1505 $valuetoshow = $langs->trans(
'TicketGroupIsPublic'); $class =
'center';
1507 if ($value ==
'block_if_negative') {
1508 $valuetoshow = $langs->trans(
'BlockHolidayIfNegative');
1510 if ($value ==
'type_duration') {
1511 $valuetoshow = $langs->trans(
'Unit');
1515 if ($value ==
'region_id') {
1516 $valuetoshow =
' '; $showfield = 1;
1518 if ($value ==
'region') {
1519 $valuetoshow = $langs->trans(
"Country").
'/'.$langs->trans(
"Region"); $showfield = 1;
1523 if ($valuetoshow !=
'') {
1524 $tooltiphelp = (isset($tabcomplete[$tabname[$id]][
'help'][$value]) ? $tabcomplete[$tabname[$id]][
'help'][$value] :
'');
1526 $tdsoffields .=
'<th'.($class ?
' class="'.$class.
'"' :
'').
'>';
1527 if ($tooltiphelp && preg_match(
'/^http(s*):/i', $tooltiphelp)) {
1528 $tdsoffields .=
'<a href="'.$tooltiphelp.
'" target="_blank">'.$valuetoshow.
' '.
img_help(1, $valuetoshow).
'</a>';
1529 } elseif ($tooltiphelp) {
1530 $tdsoffields .= $form->textwithpicto($valuetoshow, $tooltiphelp);
1532 $tdsoffields .= $valuetoshow;
1534 $tdsoffields .=
'</th>';
1539 $tdsoffields .=
'<th></th>';
1540 $tdsoffields .=
'<th></th>';
1542 $tdsoffields .=
'<th>';
1543 $tdsoffields .=
'<input type="hidden" name="id" value="'.$id.
'">';
1544 if (!is_null($withentity)) {
1545 $tdsoffields .=
'<input type="hidden" name="entity" value="'.$withentity.
'">';
1547 $tdsoffields .=
'</th>';
1548 $tdsoffields .=
'<th style="min-width: 26px;"></th>';
1549 $tdsoffields .=
'<th style="min-width: 26px;"></th>';
1550 $tdsoffields .=
'</tr>';
1556 print
'<!-- line input to add new entry -->';
1557 print
'<tr class="oddeven nodrag nodrop nohover">';
1559 $obj =
new stdClass();
1562 foreach ($fieldlist as $key => $val) {
1569 $tmpaction =
'create';
1570 $parameters = array(
'fieldlist'=>$fieldlist,
'tabname'=>$tabname[$id]);
1571 $reshook = $hookmanager->executeHooks(
'createDictionaryFieldlist', $parameters, $obj, $tmpaction);
1572 $error = $hookmanager->error; $errors = $hookmanager->errors;
1575 unset($fieldlist[2]);
1578 if (empty($reshook)) {
1579 fieldList($fieldlist, $obj, $tabname[$id],
'add');
1586 print
'<td colspan="3" class="center">';
1587 if ($action !=
'edit') {
1588 print
'<input type="submit" class="button button-add small" name="actionadd" value="'.$langs->trans(
"Add").
'">';
1590 print
'<input type="submit" class="button button-add small disabled" name="actionadd" value="'.$langs->trans(
"Add").
'">';
1606 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.$id.
'" method="POST">';
1607 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1608 print
'<input type="hidden" name="from" value="'.dol_escape_htmltag(
GETPOST(
'from',
'alpha')).
'">';
1613 $resql = $db->query($sql);
1615 $num = $db->num_rows($resql);
1619 if (($num > $listlimit) || $page) {
1620 print_fleche_navigation($page, $_SERVER[
"PHP_SELF"], $paramwithsearch, ($num > $listlimit),
'<li class="pagination"><span>'.$langs->trans(
"Page").
' '.($page + 1).
'</span></li>');
1621 print
'<div class="clearboth"></div>';
1625 foreach ($fieldlist as $field => $value) {
1626 if ($value ==
'entity') {
1631 if ($value ==
'region_id' || $value ==
'country_id') {
1636 if ($value ==
'country') {
1638 } elseif ($value ==
'code') {
1644 print
'<div class="div-table-responsive">';
1645 print
'<table class="noborder centpercent">';
1650 print
'<!-- line title to search record -->'.
"\n";
1651 print
'<tr class="liste_titre_filter">';
1655 print
'<td class="liste_titre center">';
1657 $searchpicto = $form->showFilterAndCheckAddButtons(0);
1664 foreach ($fieldlist as $field => $value) {
1665 if ($value ==
'entity') {
1670 if ($value ==
'region_id' || $value ==
'country_id') {
1675 if ($value ==
'country') {
1676 print
'<td class="liste_titre">';
1677 print $form->select_country($search_country_id,
'search_country_id',
'', 28,
'minwidth100 maxwidth150 maxwidthonsmartphone');
1680 } elseif ($value ==
'code') {
1681 print
'<td class="liste_titre">';
1682 print
'<input type="text" class="maxwidth100" name="search_code" value="'.dol_escape_htmltag($search_code).
'">';
1686 print
'<td class="liste_titre">';
1699 print
'<td class="liste_titre"></td>';
1704 print
'<td class="liste_titre center">';
1706 $searchpicto = $form->showFilterAndCheckAddButtons(0);
1716 print
'<!-- line title of record -->'.
"\n";
1717 print
'<tr class="liste_titre">';
1724 foreach ($fieldlist as $field => $value) {
1725 if ($value ==
'entity') {
1729 if (in_array($value, array(
'label',
'libelle',
'libelle_facture')) && empty($tabcomplete[$tabname[$id]][
'help'][$value])) {
1730 if (!is_array($tabcomplete[$tabname[$id]][
'help'])) {
1731 $tabcomplete[$tabname[$id]][
'help'] = array();
1733 $tabcomplete[$tabname[$id]][
'help'][$value] = $langs->trans(
'LabelUsedByDefault');
1741 $valuetoshow = ucfirst($value);
1742 $valuetoshow = $langs->trans($valuetoshow);
1745 if ($value ==
'source') {
1746 $valuetoshow = $langs->trans(
"Contact");
1748 if ($value ==
'price') {
1749 $valuetoshow = $langs->trans(
"PriceUHT");
1751 if ($value ==
'taux') {
1752 if ($tabname[$id] !=
"c_revenuestamp") {
1753 $valuetoshow = $langs->trans(
"Rate");
1755 $valuetoshow = $langs->trans(
"Amount");
1757 $cssprefix =
'center ';
1760 if ($value ==
'localtax1_type') {
1761 $valuetoshow = $langs->trans(
"UseLocalTax").
" 2"; $cssprefix =
"center "; $sortable = 0;
1763 if ($value ==
'localtax1') {
1764 $valuetoshow = $langs->trans(
"RateOfTaxN",
'2'); $cssprefix =
"center "; $sortable = 0;
1766 if ($value ==
'localtax2_type') {
1767 $valuetoshow = $langs->trans(
"UseLocalTax").
" 3"; $cssprefix =
"center "; $sortable = 0;
1769 if ($value ==
'localtax2') {
1770 $valuetoshow = $langs->trans(
"RateOfTaxN",
'3'); $cssprefix =
"center "; $sortable = 0;
1772 if ($value ==
'organization') {
1773 $valuetoshow = $langs->trans(
"Organization");
1775 if ($value ==
'lang') {
1776 $valuetoshow = $langs->trans(
"Language");
1778 if ($value ==
'type') {
1779 $valuetoshow = $langs->trans(
"Type");
1781 if ($value ==
'code') {
1782 $valuetoshow = $langs->trans(
"Code");
1784 if (in_array($value, array(
'pos',
'position'))) {
1785 $valuetoshow = $langs->trans(
"Position"); $cssprefix =
'right ';
1787 if ($value ==
'libelle' || $value ==
'label') {
1788 $valuetoshow = $langs->trans(
"Label");
1790 if ($value ==
'libelle_facture') {
1791 $valuetoshow = $langs->trans(
"LabelOnDocuments");
1793 if ($value ==
'deposit_percent') {
1794 $valuetoshow = $langs->trans(
'DepositPercent');
1795 $cssprefix =
'right ';
1797 if ($value ==
'country') {
1798 $valuetoshow = $langs->trans(
"Country");
1800 if ($value ==
'recuperableonly') {
1801 $valuetoshow = $langs->trans(
"NPR"); $cssprefix =
"center ";
1803 if ($value ==
'nbjour') {
1804 $valuetoshow = $langs->trans(
"NbOfDays");
1805 $cssprefix =
'right ';
1807 if ($value ==
'type_cdr') {
1808 $valuetoshow = $langs->trans(
"AtEndOfMonth"); $cssprefix =
"center ";
1810 if ($value ==
'decalage') {
1811 $valuetoshow = $langs->trans(
"Offset");
1812 $cssprefix =
'right ';
1814 if ($value ==
'width' || $value ==
'nx') {
1815 $valuetoshow = $langs->trans(
"Width");
1817 if ($value ==
'height' || $value ==
'ny') {
1818 $valuetoshow = $langs->trans(
"Height");
1820 if ($value ==
'unit' || $value ==
'metric') {
1821 $valuetoshow = $langs->trans(
"MeasuringUnit");
1823 if ($value ==
'accountancy_code') {
1824 $valuetoshow = $langs->trans(
"AccountancyCode");
1826 if ($value ==
'accountancy_code_sell') {
1827 $valuetoshow = $langs->trans(
"AccountancyCodeSell"); $sortable = 0;
1829 if ($value ==
'accountancy_code_buy') {
1830 $valuetoshow = $langs->trans(
"AccountancyCodeBuy"); $sortable = 0;
1832 if ($value ==
'fk_pcg_version') {
1833 $valuetoshow = $langs->trans(
"Pcg_version");
1835 if ($value ==
'account_parent') {
1836 $valuetoshow = $langs->trans(
"Accountsparent");
1838 if ($value ==
'pcg_type') {
1839 $valuetoshow = $langs->trans(
"Pcg_type");
1841 if ($value ==
'pcg_subtype') {
1842 $valuetoshow = $langs->trans(
"Pcg_subtype");
1844 if ($value ==
'sortorder') {
1845 $valuetoshow = $langs->trans(
"SortOrder");
1846 $cssprefix =
'center ';
1848 if ($value ==
'short_label') {
1849 $valuetoshow = $langs->trans(
"ShortLabel");
1851 if ($value ==
'fk_parent') {
1852 $valuetoshow = $langs->trans(
"ParentID"); $cssprefix =
'center ';
1854 if ($value ==
'range_account') {
1855 $valuetoshow = $langs->trans(
"Range");
1857 if ($value ==
'sens') {
1858 $valuetoshow = $langs->trans(
"Sens");
1860 if ($value ==
'category_type') {
1861 $valuetoshow = $langs->trans(
"Calculated");
1863 if ($value ==
'formula') {
1864 $valuetoshow = $langs->trans(
"Formula");
1866 if ($value ==
'paper_size') {
1867 $valuetoshow = $langs->trans(
"PaperSize");
1869 if ($value ==
'orientation') {
1870 $valuetoshow = $langs->trans(
"Orientation");
1872 if ($value ==
'leftmargin') {
1873 $valuetoshow = $langs->trans(
"LeftMargin");
1875 if ($value ==
'topmargin') {
1876 $valuetoshow = $langs->trans(
"TopMargin");
1878 if ($value ==
'spacex') {
1879 $valuetoshow = $langs->trans(
"SpaceX");
1881 if ($value ==
'spacey') {
1882 $valuetoshow = $langs->trans(
"SpaceY");
1884 if ($value ==
'font_size') {
1885 $valuetoshow = $langs->trans(
"FontSize");
1887 if ($value ==
'custom_x') {
1888 $valuetoshow = $langs->trans(
"CustomX");
1890 if ($value ==
'custom_y') {
1891 $valuetoshow = $langs->trans(
"CustomY");
1893 if ($value ==
'percent') {
1894 $valuetoshow = $langs->trans(
"Percentage");
1896 if ($value ==
'affect') {
1897 $valuetoshow = $langs->trans(
"WithCounter");
1899 if ($value ==
'delay') {
1900 $valuetoshow = $langs->trans(
"NoticePeriod");
1902 if ($value ==
'newbymonth') {
1903 $valuetoshow = $langs->trans(
"NewByMonth");
1905 if ($value ==
'fk_tva') {
1906 $valuetoshow = $langs->trans(
"VAT");
1908 if ($value ==
'range_ik') {
1909 $valuetoshow = $langs->trans(
"RangeIk");
1911 if ($value ==
'fk_c_exp_tax_cat') {
1912 $valuetoshow = $langs->trans(
"CarCategory");
1914 if ($value ==
'revenuestamp_type') {
1915 $valuetoshow = $langs->trans(
'TypeOfRevenueStamp');
1917 if ($value ==
'use_default') {
1918 $valuetoshow = $langs->trans(
'Default'); $cssprefix =
'center ';
1920 if ($value ==
'unit_type') {
1921 $valuetoshow = $langs->trans(
'TypeOfUnit');
1923 if ($value ==
'public' && $tablib[$id] ==
'TicketDictCategory') {
1924 $valuetoshow = $langs->trans(
'TicketGroupIsPublic'); $cssprefix =
'center ';
1926 if ($value ==
'block_if_negative') {
1927 $valuetoshow = $langs->trans(
'BlockHolidayIfNegative');
1929 if ($value ==
'type_duration') {
1930 $valuetoshow = $langs->trans(
'Unit');
1933 if ($value ==
'region_id' || $value ==
'country_id') {
1939 $tooltiphelp = (isset($tabcomplete[$tabname[$id]][
'help'][$value]) ? $tabcomplete[$tabname[$id]][
'help'][$value] :
'');
1941 if ($tooltiphelp && preg_match(
'/^http(s*):/i', $tooltiphelp)) {
1942 $newvaluetoshow =
'<a href="'.$tooltiphelp.
'" target="_blank">'.$valuetoshow.
' '.
img_help(1, $valuetoshow).
'</a>';
1943 } elseif ($tooltiphelp) {
1944 $newvaluetoshow = $form->textwithpicto($valuetoshow, $tooltiphelp);
1946 $newvaluetoshow = $valuetoshow;
1949 print
getTitleFieldOfList($newvaluetoshow, 0, $_SERVER[
"PHP_SELF"], ($sortable ? $value :
''), ($page ?
'page='.$page.
'&' :
''), $param,
'', $sortfield, $sortorder, $cssprefix);
1954 print
getTitleFieldOfList($langs->trans(
"InEEC"), 0, $_SERVER[
"PHP_SELF"],
"eec", ($page ?
'page='.$page.
'&' :
''), $param,
'align="center"', $sortfield, $sortorder,
'', 0, $langs->trans(
"CountryIsInEEC"));
1955 print
getTitleFieldOfList($langs->trans(
"Favorite"), 0, $_SERVER[
"PHP_SELF"],
"favorite", ($page ?
'page='.$page.
'&' :
''), $param,
'align="center"', $sortfield, $sortorder);
1959 print
getTitleFieldOfList($langs->trans(
"Status"), 0, $_SERVER[
"PHP_SELF"],
"active", ($page ?
'page='.$page.
'&' :
''), $param,
'align="center"', $sortfield, $sortorder);
1970 $obj = $db->fetch_object($resql);
1977 if (isset($obj->code) && $id != 10 && $id != 42) {
1978 if (($obj->code ==
'0' || $obj->code ==
'' || preg_match(
'/unknown/i', $obj->code))) {
1979 $iserasable = 0; $canbedisabled = 0;
1980 } elseif ($obj->code ==
'RECEP') {
1981 $iserasable = 0; $canbedisabled = 0;
1982 } elseif ($obj->code ==
'EF0') {
1983 $iserasable = 0; $canbedisabled = 0;
1986 if ($id == 25 && in_array($obj->code, array(
'banner',
'blogpost',
'other',
'page'))) {
1987 $iserasable = 0; $canbedisabled = 0;
1988 if (in_array($obj->code, array(
'banner'))) {
1992 if (isset($obj->type) && in_array($obj->type, array(
'system',
'systemauto'))) {
1995 if (in_array(empty($obj->code) ?
'' : $obj->code, array(
'AC_OTH',
'AC_OTH_AUTO')) || in_array(empty($obj->
type) ?
'' : $obj->
type, array(
'systemauto'))) {
1996 $canbedisabled = 0; $canbedisabled = 0;
1998 $canbemodified = $iserasable;
2000 if (!empty($obj->code) && $obj->code ==
'RECEP') {
2003 if ($tabname[$id] ==
"c_actioncomm") {
2007 if ($tabname[$id] ==
"c_product_nature" && in_array($obj->code, array(0, 1))) {
2013 $rowidcol = $tabrowid[$id];
2015 if (empty($rowidcol) || in_array($id, array(6, 7, 8, 13, 17, 19, 27, 32))) {
2016 $rowidcol =
'rowid';
2018 $url = $_SERVER[
"PHP_SELF"].
'?'.($page ?
'page='.$page.
'&' :
'').
'sortfield='.$sortfield.
'&sortorder='.$sortorder;
2019 $url .=
'&rowid='.(isset($obj->$rowidcol) ? $obj->$rowidcol : (!empty($obj->code) ? urlencode($obj->code) :
''));
2020 $url .=
'&code='.(!empty($obj->code) ?urlencode($obj->code) :
'');
2021 if (!empty($param)) {
2024 if (!is_null($withentity)) {
2025 $url .=
'&entity='.$withentity;
2031 print
'<tr class="oddeven" id="rowid-'.(empty($obj->rowid) ?
'' : $obj->rowid).
'">';
2035 print
'<td class="center maxwidthsearch nowraponall">';
2037 if ($canbemodified) {
2038 print
'<a class="reposition editfielda marginleftonly paddingleft marginrightonly paddingright" href="'.$url.
'action=edit&token='.newToken().
'">'.
img_edit().
'</a>';
2043 print
'<a class="reposition marginleftonly paddingleft marginrightonly paddingright" href="'.$url.
'action=delete&token='.newToken().
'">'.
img_delete().
'</a>';
2049 if ($action ==
'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
2050 $tmpaction =
'edit';
2051 $parameters = array(
'fieldlist'=>$fieldlist,
'tabname'=>$tabname[$id]);
2052 $reshook = $hookmanager->executeHooks(
'editDictionaryFieldlist', $parameters, $obj, $tmpaction);
2053 $error = $hookmanager->error; $errors = $hookmanager->errors;
2056 if (empty($reshook)) {
2057 $withentity =
fieldList($fieldlist, $obj, $tabname[$id],
'edit');
2060 print
'<td colspan="3" class="center">';
2061 print
'<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).
'"></div>';
2062 print
'<input type="hidden" name="page" value="'.dol_escape_htmltag($page).
'">';
2063 print
'<input type="hidden" name="rowid" value="'.dol_escape_htmltag($rowid).
'">';
2064 if (!is_null($withentity)) {
2065 print
'<input type="hidden" name="entity" value="'.$withentity.
'">';
2067 print
'<input type="submit" class="button button-edit small" name="actionmodify" value="'.$langs->trans(
"Modify").
'">';
2068 print
'<input type="submit" class="button button-cancel small" name="actioncancel" value="'.$langs->trans(
"Cancel").
'">';
2071 $tmpaction =
'view';
2072 $parameters = array(
'fieldlist'=>$fieldlist,
'tabname'=>$tabname[$id]);
2073 $reshook = $hookmanager->executeHooks(
'viewDictionaryFieldlist', $parameters, $obj, $tmpaction);
2075 $error = $hookmanager->error; $errors = $hookmanager->errors;
2077 if (empty($reshook)) {
2080 foreach ($fieldlist as $field => $value) {
2084 $valuetoshow = empty($obj->$value) ?
'' : $obj->$value;
2087 if ($value ==
'entity') {
2088 $withentity = $valuetoshow;
2092 if ($value ==
'element') {
2093 $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
2094 } elseif ($value ==
'source') {
2095 $valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow;
2096 } elseif ($valuetoshow ==
'all') {
2097 $valuetoshow = $langs->trans(
'All');
2098 } elseif ($value ==
'country') {
2099 if (empty($obj->country_code)) {
2102 $key = $langs->trans(
"Country".strtoupper($obj->country_code));
2103 $valuetoshow = ($key !=
"Country".strtoupper($obj->country_code) ? $obj->country_code.
" - ".$key : $obj->country);
2105 } elseif ($value ==
'recuperableonly' || $value ==
'deductible' || $value ==
'category_type') {
2106 $valuetoshow =
yn($valuetoshow ? 1 : 0);
2108 } elseif ($value ==
'type_cdr') {
2109 if (empty($valuetoshow)) {
2110 $valuetoshow = $langs->trans(
'None');
2111 } elseif ($valuetoshow == 1) {
2112 $valuetoshow = $langs->trans(
'AtEndOfMonth');
2113 } elseif ($valuetoshow == 2) {
2114 $valuetoshow = $langs->trans(
'CurrentNext');
2117 } elseif ($value ==
'price' || preg_match(
'/^amount/i', $value)) {
2118 $valuetoshow =
price($valuetoshow);
2120 if ($value ==
'private') {
2121 $valuetoshow =
yn($valuetoshow);
2122 } elseif ($value ==
'libelle_facture') {
2123 $langs->load(
"bills");
2124 $key = $langs->trans(
"PaymentCondition".strtoupper($obj->code));
2125 $valuetoshow = ($obj->code && $key !=
"PaymentCondition".strtoupper($obj->code) ? $key : $obj->$value);
2126 $valuetoshow = nl2br($valuetoshow);
2127 } elseif ($value ==
'label' && $tabname[$id] ==
'c_country') {
2128 $key = $langs->trans(
"Country".strtoupper($obj->code));
2129 $valuetoshow = ($obj->code && $key !=
"Country".strtoupper($obj->code) ? $key : $obj->$value);
2130 } elseif ($value ==
'label' && $tabname[$id] ==
'c_availability') {
2131 $langs->load(
"propal");
2132 $key = $langs->trans(
"AvailabilityType".strtoupper($obj->code));
2133 $valuetoshow = ($obj->code && $key !=
"AvailabilityType".strtoupper($obj->code) ? $key : $obj->$value);
2134 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_actioncomm') {
2135 $key = $langs->trans(
"Action".strtoupper($obj->code));
2136 $valuetoshow = ($obj->code && $key !=
"Action".strtoupper($obj->code) ? $key : $obj->$value);
2137 } elseif (!empty($obj->code_iso) && $value ==
'label' && $tabname[$id] ==
'c_currencies') {
2138 $key = $langs->trans(
"Currency".strtoupper($obj->code_iso));
2139 $valuetoshow = ($obj->code_iso && $key !=
"Currency".strtoupper($obj->code_iso) ? $key : $obj->$value);
2140 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_typent') {
2141 $key = $langs->trans(strtoupper($obj->code));
2142 $valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->$value);
2143 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_prospectlevel') {
2144 $key = $langs->trans(strtoupper($obj->code));
2145 $valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->$value);
2146 } elseif ($value ==
'label' && $tabname[$id] ==
'c_civility') {
2147 $key = $langs->trans(
"Civility".strtoupper($obj->code));
2148 $valuetoshow = ($obj->code && $key !=
"Civility".strtoupper($obj->code) ? $key : $obj->$value);
2149 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_type_contact') {
2150 $langs->load(
'agenda');
2151 $key = $langs->trans(
"TypeContact_".$obj->element.
"_".$obj->source.
"_".strtoupper($obj->code));
2152 $valuetoshow = ($obj->code && $key !=
"TypeContact_".$obj->element.
"_".$obj->source.
"_".strtoupper($obj->code) ? $key : $obj->$value);
2153 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_payment_term') {
2154 $langs->load(
"bills");
2155 $key = $langs->trans(
"PaymentConditionShort".strtoupper($obj->code));
2156 $valuetoshow = ($obj->code && $key !=
"PaymentConditionShort".strtoupper($obj->code) ? $key : $obj->$value);
2157 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_paiement') {
2158 $langs->load(
"bills");
2159 $key = $langs->trans(
"PaymentType".strtoupper($obj->code));
2160 $valuetoshow = ($obj->code && $key !=
"PaymentType".strtoupper($obj->code) ? $key : $obj->$value);
2161 } elseif ($value ==
'type' && $tabname[$id] ==
'c_paiement') {
2162 $payment_type_list = array(0=>$langs->trans(
'PaymentTypeCustomer'), 1=>$langs->trans(
'PaymentTypeSupplier'), 2=>$langs->trans(
'PaymentTypeBoth'));
2163 $valuetoshow = $payment_type_list[$valuetoshow];
2164 } elseif ($value ==
'label' && $tabname[$id] ==
'c_input_reason') {
2165 $key = $langs->trans(
"DemandReasonType".strtoupper($obj->code));
2166 $valuetoshow = ($obj->code && $key !=
"DemandReasonType".strtoupper($obj->code) ? $key : $obj->$value);
2167 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_input_method') {
2168 $langs->load(
"orders");
2169 $key = $langs->trans($obj->code);
2170 $valuetoshow = ($obj->code && $key != $obj->code) ? $key : $obj->$value;
2171 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_shipment_mode') {
2172 $langs->load(
"sendings");
2173 $key = $langs->trans(
"SendingMethod".strtoupper($obj->code));
2174 $valuetoshow = ($obj->code && $key !=
"SendingMethod".strtoupper($obj->code) ? $key : $obj->$value);
2175 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_paper_format') {
2176 $key = $langs->trans(
'PaperFormat'.strtoupper($obj->code));
2177 $valuetoshow = ($obj->code && $key !=
'PaperFormat'.strtoupper($obj->code) ? $key : $obj->$value);
2178 } elseif ($value ==
'label' && $tabname[$id] ==
'c_type_fees') {
2179 $langs->load(
'trips');
2180 $key = $langs->trans(strtoupper($obj->code));
2181 $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->$value);
2182 } elseif ($value ==
'region_id' || $value ==
'country_id') {
2184 } elseif ($value ==
'unicode') {
2185 $valuetoshow = $langs->getCurrencySymbol($obj->code, 1);
2186 } elseif ($value ==
'label' && $tabname[
GETPOST(
"id",
'int')] ==
'c_units') {
2187 $langs->load(
"products");
2188 $valuetoshow = $langs->trans($obj->$value);
2189 } elseif ($value ==
'short_label' && $tabname[
GETPOST(
"id",
'int')] ==
'c_units') {
2190 $langs->load(
"products");
2191 $valuetoshow = $langs->trans($obj->$value);
2192 } elseif (($value ==
'unit') && ($tabname[$id] ==
'c_paper_format')) {
2193 $key = $langs->trans(
'SizeUnit'.strtolower($obj->unit));
2194 $valuetoshow = ($obj->code && $key !=
'SizeUnit'.strtolower($obj->unit) ? $key : $obj->$value);
2195 } elseif ($value ==
'localtax1' || $value ==
'localtax2') {
2197 } elseif ($value ==
'localtax1_type') {
2198 if ($obj->localtax1 != 0) {
2199 $valuetoshow = $localtax_typeList[$valuetoshow];
2204 } elseif ($value ==
'localtax2_type') {
2205 if ($obj->localtax2 != 0) {
2206 $valuetoshow = $localtax_typeList[$valuetoshow];
2211 } elseif ($value ==
'taux') {
2212 $valuetoshow =
price($valuetoshow, 0, $langs, 0, 0);
2214 } elseif (in_array($value, array(
'recuperableonly'))) {
2216 } elseif ($value ==
'accountancy_code' || $value ==
'accountancy_code_sell' || $value ==
'accountancy_code_buy') {
2217 if (isModEnabled(
'accounting')) {
2218 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
2220 $tmpaccountingaccount->fetch(0, $valuetoshow, 1);
2221 $titletoshow = $langs->transnoentitiesnoconv(
"Pcgtype").
': '.$tmpaccountingaccount->pcg_type;
2224 } elseif ($value ==
'fk_tva') {
2225 foreach ($form->cache_vatrates as $key => $Tab) {
2226 if ($form->cache_vatrates[$key][
'rowid'] == $valuetoshow) {
2227 $valuetoshow = $form->cache_vatrates[$key][
'label'];
2231 } elseif ($value ==
'fk_c_exp_tax_cat') {
2232 $tmpid = $valuetoshow;
2234 $valuetoshow = $langs->trans($valuetoshow ? $valuetoshow : $tmpid);
2235 } elseif ($tabname[$id] ==
'c_exp_tax_cat') {
2236 $valuetoshow = $langs->trans($valuetoshow);
2237 } elseif ($value ==
'label' && $tabname[$id] ==
'c_units') {
2238 $langs->load(
'other');
2239 $key = $langs->trans($obj->label);
2240 $valuetoshow = ($obj->label && $key != strtoupper($obj->label) ? $key : $obj->{$value});
2243 } elseif ($value ==
'label' && $tabname[$id] ==
'c_product_nature') {
2244 $langs->load(
"products");
2245 $valuetoshow = $langs->trans($obj->{$value});
2246 } elseif ($fieldlist[$field] ==
'label' && $tabname[$id] ==
'c_productbatch_qcstatus') {
2247 $langs->load(
"productbatch");
2248 $valuetoshow = $langs->trans($obj->{$value});
2249 } elseif ($value ==
'block_if_negative') {
2250 $valuetoshow =
yn($obj->{$value});
2251 } elseif ($value ==
'icon') {
2252 $valuetoshow = $obj->{$value}.
" ".
img_picto(
"", $obj->{$value});
2253 } elseif ($value ==
'type_duration') {
2254 $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'));
2255 if (!empty($obj->{$value}) && array_key_exists($obj->{$value}, $TDurationTypes)) {
2256 $valuetoshow = $TDurationTypes[$obj->{$value}];
2259 $class .= ($class ?
' ' :
'').
'tddict';
2260 if ($value ==
'note' && $id == 10) {
2261 $class .=
' tdoverflowmax200';
2263 if ($value ==
'tracking') {
2264 $class .=
' tdoverflowauto';
2266 if (in_array($value, array(
'nbjour',
'decalage',
'pos',
'position',
'deposit_percent'))) {
2269 if (in_array($value, array(
'localtax1_type',
'localtax2_type'))) {
2270 $class .=
' nowraponall';
2272 if (in_array($value, array(
'use_default',
'fk_parent',
'sortorder'))) {
2273 $class .=
' center';
2275 if ($value ==
'public') {
2276 $class .=
' center';
2280 print
'<!-- '. $value .
' --><td class="'.$class.
'"'.($titletoshow ?
' title="'.dol_escape_htmltag($titletoshow).
'"' :
'').
'>'.$valuetoshow.
'</td>';
2288 print
'<td class="nowrap center">';
2291 print
'<a class="reposition" href="'.$url.
'action='.$acts[$obj->eec].
'_eec&token='.newToken().
'">'.$actl[$obj->eec].
'</a>';
2293 print
'<span class="opacitymedium">'.$langs->trans(
"AlwaysActive").
'</span>';
2296 print
'<td class="nowrap center">';
2299 print
'<a class="reposition" href="'.$url.
'action='.$acts[$obj->favorite].
'_favorite&token='.newToken().
'">'.$actl[$obj->favorite].
'</a>';
2301 print
'<span class="opacitymedium">'.$langs->trans(
"AlwaysActive").
'</span>';
2307 print
'<td class="nowrap center">';
2308 if ($canbedisabled) {
2309 print
'<a class="reposition" href="'.$url.
'action='.$acts[$obj->active].
'&token='.newToken().
'">'.$actl[$obj->active].
'</a>';
2311 if (in_array($obj->code, array(
'AC_OTH',
'AC_OTH_AUTO'))) {
2312 print $langs->trans(
"AlwaysActive");
2313 } elseif (isset($obj->type) && in_array($obj->type, array(
'systemauto')) && empty($obj->active)) {
2314 print $langs->trans(
"Deprecated");
2315 } elseif (isset($obj->type) && in_array($obj->type, array(
'system')) && !empty($obj->active) && $obj->code !=
'AC_OTH') {
2316 print $langs->trans(
"UsedOnlyWithTypeOption");
2318 print
'<span class="opacitymedium">'.$langs->trans(
"AlwaysActive").
'</span>';
2325 print
'<td class="center maxwidthsearch nowraponall">';
2327 if ($canbemodified) {
2328 print
'<a class="reposition marginleftonly paddingleft marginrightonly paddingright editfielda" href="'.$url.
'action=edit&token='.newToken().
'">'.
img_edit().
'</a>';
2333 print
'<a class="reposition marginleftonly paddingleft marginrightonly paddingright" href="'.$url.
'action=delete&token='.newToken().
'">'.
img_delete().
'</a>';
2344 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2359 $lastlineisempty =
false;
2361 print
'<div class="div-table-responsive-no-min">';
2362 print
'<table class="noborder centpercent">';
2363 print
'<tr class="liste_titre">';
2364 print
'<td>'.$langs->trans(
"Dictionary").
'</td>';
2366 print
'<td class="hideonsmartphone"></td>';
2369 $showemptyline =
'';
2370 foreach ($taborder as $i) {
2371 if (isset($tabname[$i]) && empty($tabcond[$i])) {
2376 if ($showemptyline) {
2377 print
'<tr class="oddeven"><td></td><td></td><td class="hideonsmartphone"></td></tr>';
2382 $value = $tabname[$i];
2383 print
'<tr class="oddeven"><td class="minwidth200">';
2384 if (!empty($tabcond[$i])) {
2385 $tabnamenoprefix = preg_replace(
'/'.MAIN_DB_PREFIX.
'/',
'', $tabname[$i]);
2386 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$i.
'">';
2387 if (!empty($tabcomplete[$tabnamenoprefix][
'picto'])) {
2388 print
img_picto(
'', $tabcomplete[$tabnamenoprefix][
'picto'],
'class="pictofixedwidth paddingrightonly"');
2390 print $langs->trans($tablib[$i]);
2393 print $langs->trans($tablib[$i]);
2397 print
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$i.
'">';
2401 print
'<td class="right hideonsmartphone">';
2402 print $form->textwithpicto(
'', $langs->trans(
"Table").
': '.MAIN_DB_PREFIX.$tabname[$i]);
2405 $lastlineisempty =
false;
2407 if (!$lastlineisempty) {
2409 $lastlineisempty =
true;
2433function fieldList($fieldlist, $obj =
'', $tabname =
'', $context =
'')
2435 global $conf, $langs, $db, $mysoc;
2438 global $elementList, $sourceList, $localtax_typeList;
2446 foreach ($fieldlist as $field => $value) {
2447 if ($value ==
'entity' && isset($obj->$value)) {
2448 $withentity = $obj->$value;
2452 if (in_array($value, array(
'code',
'libelle',
'type')) && $tabname ==
"c_actioncomm" && isset($obj->$value) && in_array($obj->type, array(
'system',
'systemauto'))) {
2453 $hidden = (!empty($obj->{$value}) ? $obj->{$value}:
'');
2455 print
'<input type="hidden" name="'. $value .
'" value="'.$hidden.
'">';
2456 print $langs->trans($hidden);
2458 } elseif ($value ==
'country') {
2459 if (in_array(
'region_id', $fieldlist)) {
2466 $selected = (!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country :
''));
2467 if (!GETPOSTISSET(
'code')) {
2468 $selected =
GETPOST(
'countryidforinsert');
2470 print $form->select_country($selected, $value,
'', 28,
'minwidth100 maxwidth150 maxwidthonsmartphone');
2472 } elseif ($value ==
'country_id') {
2473 if (!in_array(
'country', $fieldlist)) {
2474 $country_id = (!empty($obj->{$value}) ? $obj->{$value} : 0);
2475 print
'<td class="tdoverflowmax100">';
2476 print
'<input type="hidden" name="'. $value .
'" value="'.$country_id.
'">';
2479 } elseif ($value ==
'region') {
2481 $formcompany->select_region($region_id,
'region');
2483 } elseif ($value ==
'region_id') {
2484 $region_id = (!empty($obj->{$value}) ? $obj->{$value}:0);
2486 print
'<input type="hidden" name="'. $value .
'" value="'.$region_id.
'">';
2488 } elseif ($value ==
'lang') {
2490 print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,
'lang');
2492 } elseif (in_array($value, array(
'element',
'source'))) {
2493 $tmparray = array();
2494 if ($value ==
'element') {
2495 $tmparray = $elementList;
2497 $tmparray = $sourceList;
2500 print $form->selectarray($value, $tmparray, (!empty($obj->{$value}) ? $obj->{$value}:
''), 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth250');
2502 } elseif (in_array($value, array(
'public',
'use_default'))) {
2504 print
'<td class="center">';
2505 print $form->selectyesno($value, (!empty($obj->{$value}) ? $obj->{$value}:
''), 1);
2507 } elseif ($value ==
'private') {
2510 print $form->selectyesno(
"private", (!empty($obj->{$value}) ? $obj->{$value}:
''));
2512 } elseif ($value ==
'type' && $tabname ==
"c_actioncomm") {
2513 $type = (!empty($obj->type) ? $obj->type :
'user');
2515 print $type.
'<input type="hidden" name="type" value="'.$type.
'">';
2517 } elseif ($value ==
'type' && $tabname ==
'c_paiement') {
2519 $select_list = array(0=>$langs->trans(
'PaymentTypeCustomer'), 1=>$langs->trans(
'PaymentTypeSupplier'), 2=>$langs->trans(
'PaymentTypeBoth'));
2520 print $form->selectarray($value, $select_list, (!empty($obj->{$value}) ? $obj->{$value}:
'2'));
2522 } elseif ($value ==
'recuperableonly' || $value ==
'type_cdr' || $value ==
'deductible' || $value ==
'category_type') {
2523 if ($value ==
'type_cdr') {
2524 print
'<td class="center">';
2528 if ($value ==
'type_cdr') {
2529 print $form->selectarray($value, array(0=>$langs->trans(
'None'), 1=>$langs->trans(
'AtEndOfMonth'), 2=>$langs->trans(
'CurrentNext')), (!empty($obj->{$value}) ? $obj->{$value}:
''));
2531 print $form->selectyesno($value, (!empty($obj->{$value}) ? $obj->{$value}:
''), 1);
2534 } elseif (in_array($value, array(
'nbjour',
'decalage',
'taux',
'localtax1',
'localtax2'))) {
2536 if (in_array($value, array(
'taux',
'localtax1',
'localtax2'))) {
2539 print
'<td class="'.$class.
'">';
2540 print
'<input type="text" class="flat" value="'.(isset($obj->{$value}) ? $obj->{$value} :
'').
'" size="3" name="'. $value .
'">';
2542 } elseif (in_array($value, array(
'libelle_facture'))) {
2547 if ($tabname ==
'c_payment_term') {
2548 $langs->load(
"bills");
2549 if (isset($obj->code) && !empty($obj->code)) {
2550 $transkey =
"PaymentCondition" . strtoupper($obj->code);
2551 if ($langs->trans($transkey) != $transkey) {
2553 print $form->textwithpicto($langs->trans($transkey), $langs->trans(
"GoIntoTranslationMenuToChangeThis"));
2558 print
'<textarea cols="30" rows="'.ROWS_2.
'" class="flat" name="'. $value .
'">'.(!empty($obj->{$value}) ? $obj->{$value}:
'').
'</textarea>';
2560 print
'<input type="hidden" name="'. $value .
'" value="'.$transkey.
'">';
2563 } elseif ($value ==
'price' || preg_match(
'/^amount/i', $value)) {
2564 print
'<td><input type="text" class="flat minwidth75" value="'.price((!empty($obj->{$value}) ? $obj->{$value}:
'')).
'" name="'. $value .
'"></td>';
2565 } elseif ($value ==
'code' && isset($obj->{$value})) {
2566 print
'<td><input type="text" class="flat minwidth75 maxwidth100" value="'.(!empty($obj->{$value}) ? $obj->{$value}:
'').
'" name="'. $value .
'"></td>';
2567 } elseif ($value ==
'unit') {
2570 'mm' => $langs->trans(
'SizeUnitmm'),
2571 'cm' => $langs->trans(
'SizeUnitcm'),
2572 'point' => $langs->trans(
'SizeUnitpoint'),
2573 'inch' => $langs->trans(
'SizeUnitinch')
2575 print $form->selectarray(
'unit', $units, (!empty($obj->{$value}) ? $obj->{$value}:
''), 0, 0, 0);
2577 } elseif ($value ==
'localtax1_type' || $value ==
'localtax2_type') {
2579 print
'<td class="center">';
2580 print $form->selectarray($value, $localtax_typeList, (!empty($obj->{$value}) ? $obj->{$value}:
''));
2582 } elseif ($value ==
'accountancy_code' || $value ==
'accountancy_code_sell' || $value ==
'accountancy_code_buy') {
2584 if (isModEnabled(
'accounting')) {
2585 $fieldname = $value;
2586 $accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0);
2587 print $formaccounting->select_account($accountancy_account,
'.'. $value, 1,
'', 1, 1,
'maxwidth200 maxwidthonsmartphone');
2589 $fieldname = $value;
2590 print
'<input type="text" size="10" class="flat" value="'.(isset($obj->$fieldname) ? $obj->$fieldname :
'').
'" name="'. $value .
'">';
2593 } elseif ($value ==
'fk_tva') {
2595 print $form->load_tva(
'fk_tva', $obj->taux, $mysoc,
new Societe($db), 0, 0,
'',
false, -1);
2597 } elseif ($value ==
'fk_c_exp_tax_cat') {
2599 print $form->selectExpenseCategories($obj->fk_c_exp_tax_cat);
2601 } elseif ($value ==
'fk_range') {
2603 print $form->selectExpenseRanges($obj->fk_range);
2605 } elseif ($value ==
'block_if_negative') {
2607 print $form->selectyesno(
"block_if_negative", (empty($obj->block_if_negative) ?
'' : $obj->block_if_negative), 1);
2609 } elseif ($value ==
'type_duration') {
2611 print $form->selectTypeDuration(
'', (empty($obj->type_duration) ?
'' : $obj->type_duration), array(
'i',
'h'));
2614 $fieldValue = isset($obj->{$value}) ? $obj->{$value}:
'';
2615 $classtd =
''; $class =
'';
2617 if ($value ==
'sortorder') {
2618 $fieldlist[$field] =
'position';
2621 if ($fieldlist[$field] ==
'code') {
2622 $class =
'maxwidth100';
2624 if (in_array($fieldlist[$field], array(
'deposit_percent'))) {
2625 $classtd =
'right'; $class =
'maxwidth50 right';
2627 if (in_array($fieldlist[$field], array(
'pos',
'position'))) {
2628 $classtd =
'right'; $class =
'maxwidth50 right';
2630 if (in_array($fieldlist[$field], array(
'dayrule',
'day',
'month',
'year',
'use_default',
'affect',
'delay',
'public',
'sortorder',
'sens',
'category_type',
'fk_parent'))) {
2631 $class =
'maxwidth50 center';
2633 if (in_array($fieldlist[$field], array(
'use_default',
'public',
'fk_parent'))) {
2634 $classtd =
'center';
2636 if (in_array($fieldlist[$field], array(
'libelle',
'label',
'tracking'))) {
2637 $class =
'quatrevingtpercent';
2640 if ($fieldlist[$field] ==
'fk_parent') {
2641 if (empty($fieldValue)) {
2648 if (in_array($fieldlist[$field], array(
'libelle',
'label'))) {
2651 case 'c_email_senderprofile':
2652 case 'c_forme_juridique':
2653 case 'c_holiday_types':
2654 case 'c_payment_term':
2655 case 'c_transport_mode':
2656 $maxlength =
' maxlength="255"';
2658 case 'c_email_templates':
2659 $maxlength =
' maxlength="180"';
2661 case 'c_socialnetworks':
2662 $maxlength =
' maxlength="150"';
2665 $maxlength =
' maxlength="128"';
2669 print
'<td class="'.$classtd.
'">';
2672 if (in_array($fieldlist[$field], array(
'label',
'libelle'))) {
2674 if ($tabname ==
'c_civility' && !empty($obj->code)) {
2675 $transkey =
"Civility".strtoupper($obj->code);
2677 if ($tabname ==
'c_payment_term' && !empty($obj->code)) {
2678 $langs->load(
"bills");
2679 $transkey =
"PaymentConditionShort".strtoupper($obj->code);
2681 if ($transkey && $langs->trans($transkey) != $transkey) {
2683 print $form->textwithpicto($langs->trans($transkey), $langs->trans(
"GoIntoTranslationMenuToChangeThis"));
2687 print
'<input type="text" class="flat'.($class ?
' '.$class :
'').
'"'.($maxlength ?
' '.$maxlength :
'').
' value="'.
dol_escape_htmltag($fieldValue).
'" name="'.$fieldlist[$field].
'">';
2689 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='', $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.
print_fleche_navigation($page, $file, $options='', $nextpage=0, $betweenarrows='', $afterarrows='', $limit=-1, $totalnboflines=0, $hideselectlimit=0, $beforearrows='', $hidenavigation=0)
Function to show navigation arrows into lists.
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...
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.
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.
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.