37 require
'../main.inc.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
41 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
42 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
44 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
47 $langs->loadLangs(array(
"errors",
"admin",
"main",
"companies",
"resource",
"holiday",
"accountancy",
"hrm",
"orders",
"contracts",
"projects",
"propal",
"bills",
"interventions",
"ticket"));
49 $action =
GETPOST(
'action',
'alpha') ?
GETPOST(
'action',
'alpha') :
'view';
50 $confirm =
GETPOST(
'confirm',
'alpha');
52 $rowid =
GETPOST(
'rowid',
'alpha');
53 $entity =
GETPOST(
'entity',
'int');
54 $code =
GETPOST(
'code',
'alpha');
56 $allowed = $user->admin;
57 if ($id == 7 && !empty($user->rights->accounting->chartofaccount)) {
60 if ($id == 10 && !empty($user->rights->accounting->chartofaccount)) {
63 if ($id == 17 && !empty($user->rights->accounting->chartofaccount)) {
70 $acts = array(); $actl = array();
71 $acts[0] =
"activate";
73 $actl[0] =
img_picto($langs->trans(
"Disabled"),
'switch_off',
'class="size15x"');
74 $actl[1] =
img_picto($langs->trans(
"Activated"),
'switch_on',
'class="size15x"');
76 $listoffset =
GETPOST(
'listoffset');
77 $listlimit =
GETPOST(
'listlimit') > 0 ?
GETPOST(
'listlimit') : 1000;
80 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
81 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
83 if (empty($page) || $page == -1) {
86 $offset = $listlimit * $page;
87 $pageprev = $page - 1;
88 $pagenext = $page + 1;
90 $search_country_id =
GETPOST(
'search_country_id',
'int');
91 if (!
GETPOSTISSET(
'search_country_id') && $search_country_id ==
'' && ($id == 2 || $id == 3 || $id == 10)) {
92 $search_country_id = $mysoc->country_id;
94 $search_code =
GETPOST(
'search_code',
'alpha');
97 $hookmanager->initHooks(array(
'admin',
'dictionaryadmin'));
103 $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, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 37, 42, 0, 43, 0, 25, 0, 44, 0);
107 $tabname[1] =
"c_forme_juridique";
108 $tabname[2] =
"c_departements";
109 $tabname[3] =
"c_regions";
110 $tabname[4] =
"c_country";
111 $tabname[5] =
"c_civility";
112 $tabname[6] =
"c_actioncomm";
113 $tabname[7] =
"c_chargesociales";
114 $tabname[8] =
"c_typent";
115 $tabname[9] =
"c_currencies";
116 $tabname[10] =
"c_tva";
117 $tabname[11] =
"c_type_contact";
118 $tabname[12] =
"c_payment_term";
119 $tabname[13] =
"c_paiement";
120 $tabname[14] =
"c_ecotaxe";
121 $tabname[15] =
"c_paper_format";
122 $tabname[16] =
"c_prospectlevel";
123 $tabname[17] =
"c_type_fees";
124 $tabname[18] =
"c_shipment_mode";
125 $tabname[19] =
"c_effectif";
126 $tabname[20] =
"c_input_method";
127 $tabname[21] =
"c_availability";
128 $tabname[22] =
"c_input_reason";
129 $tabname[23] =
"c_revenuestamp";
130 $tabname[24] =
"c_type_resource";
131 $tabname[25] =
"c_type_container";
133 $tabname[27] =
"c_stcomm";
134 $tabname[28] =
"c_holiday_types";
135 $tabname[29] =
"c_lead_status";
136 $tabname[30] =
"c_format_cards";
138 $tabname[32] =
"c_hrm_public_holiday";
139 $tabname[33] =
"c_hrm_department";
140 $tabname[34] =
"c_hrm_function";
141 $tabname[35] =
"c_exp_tax_cat";
142 $tabname[36] =
"c_exp_tax_range";
143 $tabname[37] =
"c_units";
144 $tabname[38] =
"c_socialnetworks";
145 $tabname[39] =
"c_prospectcontactlevel";
146 $tabname[40] =
"c_stcommcontact";
147 $tabname[41] =
"c_transport_mode";
148 $tabname[42] =
"c_product_nature";
149 $tabname[43] =
"c_productbatch_qcstatus";
150 $tabname[44] =
"c_asset_disposal_type";
154 $tablib[1] =
"DictionaryCompanyJuridicalType";
155 $tablib[2] =
"DictionaryCanton";
156 $tablib[3] =
"DictionaryRegion";
157 $tablib[4] =
"DictionaryCountry";
158 $tablib[5] =
"DictionaryCivility";
159 $tablib[6] =
"DictionaryActions";
160 $tablib[7] =
"DictionarySocialContributions";
161 $tablib[8] =
"DictionaryCompanyType";
162 $tablib[9] =
"DictionaryCurrency";
163 $tablib[10] =
"DictionaryVAT";
164 $tablib[11] =
"DictionaryTypeContact";
165 $tablib[12] =
"DictionaryPaymentConditions";
166 $tablib[13] =
"DictionaryPaymentModes";
167 $tablib[14] =
"DictionaryEcotaxe";
168 $tablib[15] =
"DictionaryPaperFormat";
169 $tablib[16] =
"DictionaryProspectLevel";
170 $tablib[17] =
"DictionaryFees";
171 $tablib[18] =
"DictionarySendingMethods";
172 $tablib[19] =
"DictionaryStaff";
173 $tablib[20] =
"DictionaryOrderMethods";
174 $tablib[21] =
"DictionaryAvailability";
175 $tablib[22] =
"DictionarySource";
176 $tablib[23] =
"DictionaryRevenueStamp";
177 $tablib[24] =
"DictionaryResourceType";
178 $tablib[25] =
"DictionaryTypeOfContainer";
180 $tablib[27] =
"DictionaryProspectStatus";
181 $tablib[28] =
"DictionaryHolidayTypes";
182 $tablib[29] =
"DictionaryOpportunityStatus";
183 $tablib[30] =
"DictionaryFormatCards";
185 $tablib[32] =
"DictionaryPublicHolidays";
186 $tablib[33] =
"DictionaryDepartment";
187 $tablib[34] =
"DictionaryFunction";
188 $tablib[35] =
"DictionaryExpenseTaxCat";
189 $tablib[36] =
"DictionaryExpenseTaxRange";
190 $tablib[37] =
"DictionaryMeasuringUnits";
191 $tablib[38] =
"DictionarySocialNetworks";
192 $tablib[39] =
"DictionaryProspectContactLevel";
193 $tablib[40] =
"DictionaryProspectContactStatus";
194 $tablib[41] =
"DictionaryTransportMode";
195 $tablib[42] =
"DictionaryProductNature";
196 $tablib[43] =
"DictionaryBatchStatus";
197 $tablib[44] =
"DictionaryAssetDisposalType";
201 $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";
202 $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";
203 $tabsql[3] =
"SELECT r.rowid as rowid, r.code_region as state_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";
204 $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";
205 $tabsql[5] =
"SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX.
"c_civility AS c";
206 $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";
207 $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";
208 $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";
209 $tabsql[9] =
"SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX.
"c_currencies AS c";
210 $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";
211 $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";
212 $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 = ".
getEntity($tabname[12]);
213 $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 = ".
getEntity($tabname[13]);
214 $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";
215 $tabsql[15] =
"SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX.
"c_paper_format";
216 $tabsql[16] =
"SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX.
"c_prospectlevel";
217 $tabsql[17] =
"SELECT id as rowid, code, label, accountancy_code, active FROM ".MAIN_DB_PREFIX.
"c_type_fees";
218 $tabsql[18] =
"SELECT rowid as rowid, code, libelle, tracking, active FROM ".MAIN_DB_PREFIX.
"c_shipment_mode";
219 $tabsql[19] =
"SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX.
"c_effectif";
220 $tabsql[20] =
"SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX.
"c_input_method";
221 $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";
222 $tabsql[22] =
"SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX.
"c_input_reason";
223 $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";
224 $tabsql[24] =
"SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX.
"c_type_resource";
225 $tabsql[25] =
"SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX.
"c_type_container as t WHERE t.entity = ".
getEntity($tabname[25]);
227 $tabsql[27] =
"SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX.
"c_stcomm";
228 $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";
229 $tabsql[29] =
"SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX.
"c_lead_status";
230 $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[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";
233 $tabsql[33] =
"SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX.
"c_hrm_department";
234 $tabsql[34] =
"SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX.
"c_hrm_function";
235 $tabsql[35] =
"SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX.
"c_exp_tax_cat c";
236 $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";
237 $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";
238 $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 = ".
getEntity($tabname[38]);
239 $tabsql[39] =
"SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX.
"c_prospectcontactlevel";
240 $tabsql[40] =
"SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX.
"c_stcommcontact";
241 $tabsql[41] =
"SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX.
"c_transport_mode";
242 $tabsql[42] =
"SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX.
"c_product_nature";
243 $tabsql[43] =
"SELECT rowid, code, label, active FROM ".MAIN_DB_PREFIX.
"c_productbatch_qcstatus";
244 $tabsql[44] =
"SELECT rowid, code, label, active FROM ".MAIN_DB_PREFIX.
"c_asset_disposal_type";
247 $tabsqlsort = array();
248 $tabsqlsort[1] =
"country ASC, code ASC";
249 $tabsqlsort[2] =
"country ASC, code ASC";
250 $tabsqlsort[3] =
"country ASC, code ASC";
251 $tabsqlsort[4] =
"code ASC";
252 $tabsqlsort[5] =
"label ASC";
253 $tabsqlsort[6] =
"a.type ASC, a.module ASC, a.position ASC, a.code ASC";
254 $tabsqlsort[7] =
"c.label ASC, a.code ASC, a.libelle ASC";
255 $tabsqlsort[8] =
"country DESC,".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ?
' t.position ASC,' :
'').
" libelle ASC";
256 $tabsqlsort[9] =
"label ASC";
257 $tabsqlsort[10] =
"country ASC, code ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
258 $tabsqlsort[11] =
"t.element ASC, t.source ASC, t.position ASC, t.code ASC";
259 $tabsqlsort[12] =
"sortorder ASC, code ASC";
260 $tabsqlsort[13] =
"code ASC";
261 $tabsqlsort[14] =
"country ASC, e.organization ASC, code ASC";
262 $tabsqlsort[15] =
"rowid ASC";
263 $tabsqlsort[16] =
"sortorder ASC";
264 $tabsqlsort[17] =
"code ASC";
265 $tabsqlsort[18] =
"code ASC, libelle ASC";
266 $tabsqlsort[19] =
"id ASC";
267 $tabsqlsort[20] =
"code ASC, libelle ASC";
268 $tabsqlsort[21] =
"position ASC, type_duration ASC, qty ASC";
269 $tabsqlsort[22] =
"code ASC, label ASC";
270 $tabsqlsort[23] =
"country ASC, taux ASC";
271 $tabsqlsort[24] =
"code ASC, label ASC";
272 $tabsqlsort[25] =
"t.module ASC, t.code ASC, t.label ASC";
274 $tabsqlsort[27] =
"code ASC";
275 $tabsqlsort[28] =
"sortorder ASC, country ASC, code ASC";
276 $tabsqlsort[29] =
"position ASC";
277 $tabsqlsort[30] =
"code ASC";
279 $tabsqlsort[32] =
"country, year ASC, month ASC, day ASC";
280 $tabsqlsort[33] =
"code ASC";
281 $tabsqlsort[34] =
"code ASC";
282 $tabsqlsort[35] =
"c.label ASC";
283 $tabsqlsort[36] =
"r.fk_c_exp_tax_cat ASC, r.range_ik ASC";
284 $tabsqlsort[37] =
"sortorder ASC";
285 $tabsqlsort[38] =
"rowid, code ASC";
286 $tabsqlsort[39] =
"sortorder ASC";
287 $tabsqlsort[40] =
"code ASC";
288 $tabsqlsort[41] =
"code ASC";
289 $tabsqlsort[42] =
"code ASC";
290 $tabsqlsort[43] =
"code ASC";
291 $tabsqlsort[44] =
"code ASC";
295 $tabfield[1] =
"code,libelle,country";
296 $tabfield[2] =
"code,libelle,region_id,region,country";
297 $tabfield[3] =
"code,libelle,country_id,country";
298 $tabfield[4] =
"code,label";
299 $tabfield[5] =
"code,label";
300 $tabfield[6] =
"code,libelle,type,color,position";
301 $tabfield[7] =
"code,libelle,country,accountancy_code";
302 $tabfield[8] =
"code,libelle,country_id,country".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ?
',position' :
'');
303 $tabfield[9] =
"code,label,unicode";
304 $tabfield[10] =
"country_id,country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
305 $tabfield[11] =
"element,source,code,libelle,position";
306 $tabfield[12] =
"code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder,entity";
307 $tabfield[13] =
"code,libelle,type,entity";
308 $tabfield[14] =
"code,label,price,organization,country";
309 $tabfield[15] =
"code,libelle,width,height,unit";
310 $tabfield[16] =
"code,libelle,sortorder";
311 $tabfield[17] =
"code,label,accountancy_code";
312 $tabfield[18] =
"code,libelle,tracking";
313 $tabfield[19] =
"code,libelle";
314 $tabfield[20] =
"code,libelle";
315 $tabfield[21] =
"code,label,qty,type_duration,position";
316 $tabfield[22] =
"code,label";
317 $tabfield[23] =
"country_id,country,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note";
318 $tabfield[24] =
"code,label";
319 $tabfield[25] =
"code,label";
321 $tabfield[27] =
"code,libelle,picto";
322 $tabfield[28] =
"code,label,affect,delay,newbymonth,country_id,country,block_if_negative,sortorder";
323 $tabfield[29] =
"code,label,percent,position";
324 $tabfield[30] =
"code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
326 $tabfield[32] =
"code,dayrule,year,month,day,country_id,country";
327 $tabfield[33] =
"code,label";
328 $tabfield[34] =
"code,label";
329 $tabfield[35] =
"label";
330 $tabfield[36] =
"range_ik,fk_c_exp_tax_cat";
331 $tabfield[37] =
"code,label,short_label,unit_type,scale,sortorder";
332 $tabfield[38] =
"code,label,url,icon,entity";
333 $tabfield[39] =
"code,libelle,sortorder";
334 $tabfield[40] =
"code,libelle,picto";
335 $tabfield[41] =
"code,label";
336 $tabfield[42] =
"code,label";
337 $tabfield[43] =
"code,label";
338 $tabfield[44] =
"code,label";
341 $tabfieldvalue = array();
342 $tabfieldvalue[1] =
"code,libelle,country";
343 $tabfieldvalue[2] =
"code,libelle,region";
344 $tabfieldvalue[3] =
"code,libelle,country";
345 $tabfieldvalue[4] =
"code,label";
346 $tabfieldvalue[5] =
"code,label";
347 $tabfieldvalue[6] =
"code,libelle,type,color,position";
348 $tabfieldvalue[7] =
"code,libelle,country,accountancy_code";
349 $tabfieldvalue[8] =
"code,libelle,country".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ?
',position' :
'');
350 $tabfieldvalue[9] =
"code,label,unicode";
351 $tabfieldvalue[10] =
"country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
352 $tabfieldvalue[11] =
"element,source,code,libelle,position";
353 $tabfieldvalue[12] =
"code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder";
354 $tabfieldvalue[13] =
"code,libelle,type";
355 $tabfieldvalue[14] =
"code,label,price,organization,country";
356 $tabfieldvalue[15] =
"code,libelle,width,height,unit";
357 $tabfieldvalue[16] =
"code,libelle,sortorder";
358 $tabfieldvalue[17] =
"code,label,accountancy_code";
359 $tabfieldvalue[18] =
"code,libelle,tracking";
360 $tabfieldvalue[19] =
"code,libelle";
361 $tabfieldvalue[20] =
"code,libelle";
362 $tabfieldvalue[21] =
"code,label,qty,type_duration,position";
363 $tabfieldvalue[22] =
"code,label";
364 $tabfieldvalue[23] =
"country,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note";
365 $tabfieldvalue[24] =
"code,label";
366 $tabfieldvalue[25] =
"code,label";
368 $tabfieldvalue[27] =
"code,libelle,picto";
369 $tabfieldvalue[28] =
"code,label,affect,delay,newbymonth,country,block_if_negative,sortorder";
370 $tabfieldvalue[29] =
"code,label,percent,position";
371 $tabfieldvalue[30] =
"code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
373 $tabfieldvalue[32] =
"code,dayrule,day,month,year,country";
374 $tabfieldvalue[33] =
"code,label";
375 $tabfieldvalue[34] =
"code,label";
376 $tabfieldvalue[35] =
"label";
377 $tabfieldvalue[36] =
"range_ik,fk_c_exp_tax_cat";
378 $tabfieldvalue[37] =
"code,label,short_label,unit_type,scale,sortorder";
379 $tabfieldvalue[38] =
"code,label,url,icon";
380 $tabfieldvalue[39] =
"code,libelle,sortorder";
381 $tabfieldvalue[40] =
"code,libelle,picto";
382 $tabfieldvalue[41] =
"code,label";
383 $tabfieldvalue[42] =
"code,label";
384 $tabfieldvalue[43] =
"code,label";
385 $tabfieldvalue[44] =
"code,label";
388 $tabfieldinsert = array();
389 $tabfieldinsert[1] =
"code,libelle,fk_pays";
390 $tabfieldinsert[2] =
"code_departement,nom,fk_region";
391 $tabfieldinsert[3] =
"code_region,nom,fk_pays";
392 $tabfieldinsert[4] =
"code,label";
393 $tabfieldinsert[5] =
"code,label";
394 $tabfieldinsert[6] =
"code,libelle,type,color,position";
395 $tabfieldinsert[7] =
"code,libelle,fk_pays,accountancy_code";
396 $tabfieldinsert[8] =
"code,libelle,fk_country".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ?
',position' :
'');
397 $tabfieldinsert[9] =
"code_iso,label,unicode";
398 $tabfieldinsert[10] =
"fk_pays,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
399 $tabfieldinsert[11] =
"element,source,code,libelle,position";
400 $tabfieldinsert[12] =
"code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder,entity";
401 $tabfieldinsert[13] =
"code,libelle,type,entity";
402 $tabfieldinsert[14] =
"code,label,price,organization,fk_pays";
403 $tabfieldinsert[15] =
"code,label,width,height,unit";
404 $tabfieldinsert[16] =
"code,label,sortorder";
405 $tabfieldinsert[17] =
"code,label,accountancy_code";
406 $tabfieldinsert[18] =
"code,libelle,tracking";
407 $tabfieldinsert[19] =
"code,libelle";
408 $tabfieldinsert[20] =
"code,libelle";
409 $tabfieldinsert[21] =
"code,label,qty,type_duration,position";
410 $tabfieldinsert[22] =
"code,label";
411 $tabfieldinsert[23] =
"fk_pays,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note";
412 $tabfieldinsert[24] =
"code,label";
413 $tabfieldinsert[25] =
"code,label";
415 $tabfieldinsert[27] =
"code,libelle,picto";
416 $tabfieldinsert[28] =
"code,label,affect,delay,newbymonth,fk_country,block_if_negative,sortorder";
417 $tabfieldinsert[29] =
"code,label,percent,position";
418 $tabfieldinsert[30] =
"code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
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";
451 $tabrowid[13] =
"id";
454 $tabrowid[16] =
"code";
455 $tabrowid[17] =
"id";
456 $tabrowid[18] =
"rowid";
457 $tabrowid[19] =
"id";
459 $tabrowid[21] =
"rowid";
460 $tabrowid[22] =
"rowid";
465 $tabrowid[27] =
"id";
470 $tabrowid[32] =
"id";
471 $tabrowid[33] =
"rowid";
472 $tabrowid[34] =
"rowid";
477 $tabrowid[39] =
"code";
478 $tabrowid[40] =
"id";
480 $tabrowid[42] =
"rowid";
481 $tabrowid[43] =
"rowid";
482 $tabrowid[44] =
"rowid";
486 $tabcond[1] = (!empty($conf->societe->enabled));
490 $tabcond[5] = (!empty($conf->societe->enabled) || !empty($conf->adherent->enabled));
492 $tabcond[7] = !empty($conf->tax->enabled);
493 $tabcond[8] = !empty($conf->societe->enabled);
496 $tabcond[11] = (!empty($conf->societe->enabled));
497 $tabcond[12] = (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) ||
isModEnabled(
'facture') || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled) || !empty($conf->supplier_order->enabled));
498 $tabcond[13] = (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) ||
isModEnabled(
'facture') || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled) || !empty($conf->supplier_order->enabled));
499 $tabcond[14] = (!empty($conf->product->enabled) && (!empty($conf->ecotax->enabled) || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY)));
501 $tabcond[16] = (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS));
502 $tabcond[17] = (!empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled));
503 $tabcond[18] = !empty($conf->expedition->enabled) || !empty($conf->reception->enabled);
504 $tabcond[19] = !empty($conf->societe->enabled);
505 $tabcond[20] = (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled);
506 $tabcond[21] = !empty($conf->propal->enabled);
507 $tabcond[22] = (!empty($conf->commande->enabled) || !empty($conf->propal->enabled));
509 $tabcond[24] = !empty($conf->resource->enabled);
510 $tabcond[25] = !empty($conf->website->enabled);
512 $tabcond[27] = !empty($conf->societe->enabled);
513 $tabcond[28] = !empty($conf->holiday->enabled);
514 $tabcond[29] = !empty($conf->project->enabled);
515 $tabcond[30] = !empty($conf->label->enabled);
517 $tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled));
518 $tabcond[33] = !empty($conf->hrm->enabled);
519 $tabcond[34] = !empty($conf->hrm->enabled);
520 $tabcond[35] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK);
521 $tabcond[36] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK);
522 $tabcond[37] = !empty($conf->product->enabled);
523 $tabcond[38] = !empty($conf->socialnetworks->enabled);
524 $tabcond[39] = (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
525 $tabcond[40] = (!empty($conf->societe->enabled) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
526 $tabcond[41] = !empty($conf->intracommreport->enabled);
527 $tabcond[42] = !empty($conf->product->enabled);
528 $tabcond[43] = !empty($conf->product->enabled) && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2;
529 $tabcond[44] = !empty($conf->asset->enabled);
535 $tabcomplete = array(
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"))),
582 complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabcomplete);
586 foreach ($tabcomplete as $key => $value) {
589 if (!isset($tabcond[$i])) {
592 $tabcomplete[$key][
'id'] = $i;
593 $tabcomplete[$key][
'cond'] = $tabcond[$i];
594 $tabcomplete[$key][
'rowid'] = $tabrowid[$i];
595 $tabcomplete[$key][
'fieldinsert'] = $tabfieldinsert[$i];
596 $tabcomplete[$key][
'fieldvalue'] = $tabfieldvalue[$i];
597 $tabcomplete[$key][
'lib'] = $tablib[$i];
598 $tabcomplete[$key][
'sql'] = $tabsql[$i];
599 $tabcomplete[$key][
'sqlsort'] = $tabsqlsort[$i];
600 $tabcomplete[$key][
'field'] = $tabfield[$i];
605 $arrayofkeys = array_keys($tabcomplete);
606 $keytable = $arrayofkeys[$id - 1];
610 if (empty($sortfield)) {
611 $tmp1 = explode(
',', empty($tabcomplete[$keytable][
'sqlsort']) ?
'' : $tabcomplete[$keytable][
'sqlsort']);
612 $tmp2 = explode(
' ', $tmp1[0]);
613 $sortfield = preg_replace(
'/^.*\./',
'', $tmp2[0]);
614 $sortorder = (!empty($tmp2[1]) ? $tmp2[1] :
'');
620 $elementList = array();
621 $sourceList = array();
623 $elementList = array(
625 'agenda' =>
img_picto(
'',
'action',
'class="pictofixedwidth"').$langs->trans(
'Agenda'),
626 'dolresource' =>
img_picto(
'',
'resource',
'class="pictofixedwidth"').$langs->trans(
'Resource'),
627 'societe' =>
img_picto(
'',
'company',
'class="pictofixedwidth"').$langs->trans(
'ThirdParty'),
633 'project' =>
img_picto(
'',
'project',
'class="pictofixedwidth"').$langs->trans(
'Project'),
634 'project_task' =>
img_picto(
'',
'projecttask',
'class="pictofixedwidth"').$langs->trans(
'Task'),
635 'propal' =>
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
'Proposal'),
636 'commande' =>
img_picto(
'',
'order',
'class="pictofixedwidth"').$langs->trans(
'Order'),
637 'facture' =>
img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
'Bill'),
638 'fichinter' =>
img_picto(
'',
'intervention',
'class="pictofixedwidth"').$langs->trans(
'InterventionCard'),
639 'contrat' =>
img_picto(
'',
'contract',
'class="pictofixedwidth"').$langs->trans(
'Contract'),
640 'ticket' =>
img_picto(
'',
'ticket',
'class="pictofixedwidth"').$langs->trans(
'Ticket'),
641 'supplier_proposal' =>
img_picto(
'',
'supplier_proposal',
'class="pictofixedwidth"').$langs->trans(
'SupplierProposal'),
642 'order_supplier' =>
img_picto(
'',
'supplier_order',
'class="pictofixedwidth"').$langs->trans(
'SupplierOrder'),
643 'invoice_supplier' =>
img_picto(
'',
'supplier_invoice',
'class="pictofixedwidth"').$langs->trans(
'SupplierBill'),
645 if (!empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) {
646 $elementList[
'conferenceorbooth'] =
img_picto(
'',
'eventorganization',
'class="pictofixedwidth"').$langs->trans(
'ConferenceOrBooth');
653 'internal' => $langs->trans(
'Internal'),
654 'external' => $langs->trans(
'External')
659 $localtax_typeList = array(
660 "0" => $langs->trans(
"No"),
661 "1" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 1)",
662 "2" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 2)",
663 "3" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 3)",
664 "4" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 4)",
665 "5" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 5)",
666 "6" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 6)"
674 $object =
new stdClass();
679 'confirm' =>$confirm,
681 'taborder' =>$taborder,
682 'tabname' =>$tabname,
685 'tabsqlsort' =>$tabsqlsort,
686 'tabfield' =>$tabfield,
687 'tabfieldvalue' =>$tabfieldvalue,
688 'tabfieldinsert'=>$tabfieldinsert,
689 'tabrowid' =>$tabrowid,
690 'tabcond' =>$tabcond,
691 'tabhelp' =>$tabhelp,
692 'tabcomplete' =>$tabcomplete
694 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
699 if (
GETPOST(
'button_removefilter',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter_x',
'alpha')) {
700 $search_country_id =
'';
704 if (empty($reshook)) {
707 $listfield = explode(
',', str_replace(
' ',
'', $tabfield[$id]));
708 $listfieldinsert = explode(
',', $tabfieldinsert[$id]);
709 $listfieldmodify = explode(
',', $tabfieldinsert[$id]);
710 $listfieldvalue = explode(
',', $tabfieldvalue[$id]);
714 foreach ($listfield as $f => $value) {
716 if ($value ==
'country_id' && in_array($tablib[$id], array(
'DictionaryPublicHolidays',
'DictionaryVAT',
'DictionaryRegion',
'DictionaryCompanyType',
'DictionaryHolidayTypes',
'DictionaryRevenueStamp',
'DictionaryAccountancysystem',
'DictionaryAccountancyCategory'))) {
719 if ($value ==
'country' && in_array($tablib[$id], array(
'DictionaryPublicHolidays',
'DictionaryCanton',
'DictionaryCompanyType',
'DictionaryHolidayTypes',
'DictionaryRevenueStamp'))) {
723 if ($value ==
'localtax1' && !
GETPOST(
'localtax1_type')) {
726 if ($value ==
'localtax2' && !
GETPOST(
'localtax2_type')) {
729 if ($value ==
'color' && !
GETPOST(
'color')) {
732 if ($value ==
'formula' && !
GETPOST(
'formula')) {
735 if ($value ==
'dayrule' && !
GETPOST(
'dayrule')) {
738 if ($value ==
'sortorder') {
742 && (!in_array($value, array(
'decalage',
'module',
'accountancy_code',
'accountancy_code_sell',
'accountancy_code_buy',
'tracking',
'picto',
'deposit_percent'))
743 && ($id != 10 || ($value !=
'code' && $value !=
'note'))
747 $fieldnamekey = $value;
749 if ($fieldnamekey ==
'libelle' || ($fieldnamekey ==
'label')) {
750 $fieldnamekey =
'Label';
752 if ($fieldnamekey ==
'libelle_facture') {
753 $fieldnamekey =
'LabelOnDocuments';
755 if ($fieldnamekey ==
'deposit_percent') {
756 $fieldnamekey =
'DepositPercent';
758 if ($fieldnamekey ==
'nbjour') {
759 $fieldnamekey =
'NbOfDays';
761 if ($fieldnamekey ==
'decalage') {
762 $fieldnamekey =
'Offset';
764 if ($fieldnamekey ==
'module') {
765 $fieldnamekey =
'Module';
767 if ($fieldnamekey ==
'code') {
768 $fieldnamekey =
'Code';
770 if ($fieldnamekey ==
'note') {
771 $fieldnamekey =
'Note';
773 if ($fieldnamekey ==
'taux') {
774 $fieldnamekey =
'Rate';
776 if ($fieldnamekey ==
'type') {
777 $fieldnamekey =
'Type';
779 if ($fieldnamekey ==
'position') {
780 $fieldnamekey =
'Position';
782 if ($fieldnamekey ==
'unicode') {
783 $fieldnamekey =
'Unicode';
785 if ($fieldnamekey ==
'deductible') {
786 $fieldnamekey =
'Deductible';
788 if ($fieldnamekey ==
'sortorder') {
789 $fieldnamekey =
'SortOrder';
791 if ($fieldnamekey ==
'category_type') {
792 $fieldnamekey =
'Calculated';
794 if ($fieldnamekey ==
'revenuestamp_type') {
795 $fieldnamekey =
'TypeOfRevenueStamp';
797 if ($fieldnamekey ==
'use_default') {
798 $fieldnamekey =
'UseByDefault';
801 setEventMessages($langs->transnoentities(
"ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null,
'errors');
805 if (
GETPOST(
'actionadd') && $tabname[$id] ==
"c_actioncomm" &&
GETPOSTISSET(
"type") && in_array(
GETPOST(
"type"), array(
'system',
'systemauto'))) {
807 setEventMessages($langs->transnoentities(
'ErrorReservedTypeSystemSystemAuto'), null,
'errors');
812 setEventMessages($langs->transnoentities(
'ErrorCodeCantContainZero'), null,
'errors');
816 if (in_array($tablib[$id], array(
'DictionaryCompanyType',
'DictionaryHolidayTypes'))) {
817 $_POST[
"country"] =
'';
820 setEventMessages($langs->transnoentities(
"ErrorFieldRequired", $langs->transnoentities(
"Country")), null,
'errors');
823 if (($id == 3 || $id == 42) && !is_numeric(
GETPOST(
"code"))) {
825 setEventMessages($langs->transnoentities(
"ErrorFieldMustBeANumeric", $langs->transnoentities(
"Code")), null,
'errors');
830 $_POST[
"localtax1"] =
'0';
833 $_POST[
"localtax2"] =
'0';
835 if (
GETPOST(
"accountancy_code") <= 0) {
836 $_POST[
"accountancy_code"] =
'';
838 if (
GETPOST(
"accountancy_code_sell") <= 0) {
839 $_POST[
"accountancy_code_sell"] =
'';
841 if (
GETPOST(
"accountancy_code_buy") <= 0) {
842 $_POST[
"accountancy_code_buy"] =
'';
845 $_POST[
"code"] = preg_replace(
'/[^a-zA-Z0-9\-\+]/',
'',
GETPOST(
"code"));
848 $tablename = $tabname[$id];
849 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
852 if ($ok &&
GETPOST(
'actionadd')) {
853 if ($tabrowid[$id]) {
856 $sql =
"SELECT MAX(".$tabrowid[$id].
") as newid FROM ".MAIN_DB_PREFIX.$tablename;
857 $result = $db->query($sql);
859 $obj = $db->fetch_object($result);
860 $newid = ($obj->newid + 1);
867 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.$tablename.
" (";
869 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
870 $sql .= $tabrowid[$id].
",";
872 $sql .= $tabfieldinsert[$id];
877 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
881 foreach ($listfieldinsert as $f => $value) {
882 $keycode = $listfieldvalue[$i];
883 if (empty($keycode)) {
887 if ($value ==
'price' || preg_match(
'/^amount/i', $value)) {
889 } elseif ($value ==
'taux' || $value ==
'localtax1') {
891 } elseif ($value ==
'entity') {
892 $_POST[$keycode] =
getEntity($tablename);
899 if ($keycode ==
'sortorder') {
900 $sql .= (int)
GETPOST(
'position',
'int');
901 } elseif (
GETPOST($keycode) ==
'' && !($keycode ==
'code' && $id == 10)) {
903 } elseif ($keycode ==
'content') {
904 $sql .=
"'".$db->escape(
GETPOST($keycode,
'restricthtml')).
"'";
905 } elseif (in_array($keycode, array(
'joinfile',
'private',
'pos',
'position',
'scale',
'use_default'))) {
906 $sql .= (int)
GETPOST($keycode,
'int');
908 $sql .=
"'".$db->escape(
GETPOST($keycode,
'alphanohtml')).
"'";
916 $resql = $db->query($sql);
918 setEventMessages($langs->transnoentities(
"RecordCreatedSuccessfully"), null,
'mesgs');
921 if ($id == 10 &&
GETPOST(
'country',
'int') > 0) {
922 $search_country_id =
GETPOST(
'country',
'int');
924 $_POST = array(
'id'=>$id);
926 if ($db->errno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
927 setEventMessages($langs->transnoentities(
"ErrorRecordAlreadyExists"), null,
'errors');
935 if ($ok &&
GETPOST(
'actionmodify')) {
936 if ($tabrowid[$id]) {
937 $rowidcol = $tabrowid[$id];
943 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET ";
945 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
946 $sql .= $tabrowid[$id].
"=";
947 $sql .=
"'".$db->escape($rowid).
"', ";
950 foreach ($listfieldmodify as $field) {
951 $keycode = $listfieldvalue[$i];
952 if (empty($keycode)) {
956 if ($field ==
'price' || preg_match(
'/^amount/i', $field)) {
958 } elseif ($field ==
'taux' || $field ==
'localtax1') {
960 } elseif ($field ==
'entity') {
961 $_POST[$keycode] =
getEntity($tablename);
968 if ($listfieldvalue[$i] ==
'sortorder') {
969 $sql .= (int)
GETPOST(
'position',
'int');
970 } elseif (
GETPOST($keycode) ==
'' && !($keycode ==
'code' && $id == 10)) {
972 } elseif ($keycode ==
'content') {
973 $sql .=
"'".$db->escape(
GETPOST($keycode,
'restricthtml')).
"'";
974 } elseif (in_array($keycode, array(
'joinfile',
'private',
'pos',
'position',
'scale',
'use_default'))) {
975 $sql .= (int)
GETPOST($keycode,
'int');
977 $sql .=
"'".$db->escape(
GETPOST($keycode,
'alphanohtml')).
"'";
982 if (in_array($rowidcol, array(
'code',
'code_iso'))) {
983 $sql .=
" WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'";
985 $sql .=
" WHERE ".$rowidcol.
" = ".((int) $rowid);
987 if (in_array(
'entity', $listfieldmodify)) {
988 $sql .=
" AND entity = ".((int)
getEntity($tablename, 0));
993 $resql = $db->query($sql);
1000 if ($action ==
'confirm_delete' && $confirm ==
'yes') {
1001 if ($tabrowid[$id]) {
1002 $rowidcol = $tabrowid[$id];
1004 $rowidcol =
"rowid";
1007 $tablename = $tabname[$id];
1008 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1010 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.$tablename.
" WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1013 $result = $db->query($sql);
1015 if ($db->errno() ==
'DB_ERROR_CHILD_EXISTS') {
1016 setEventMessages($langs->transnoentities(
"ErrorRecordIsUsedByChild"), null,
'errors');
1024 if ($action == $acts[0]) {
1025 if ($tabrowid[$id]) {
1026 $rowidcol = $tabrowid[$id];
1028 $rowidcol =
"rowid";
1031 $tablename = $tabname[$id];
1032 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1035 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 1 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1037 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 1 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1040 $result = $db->query($sql);
1047 if ($action == $acts[1]) {
1048 if ($tabrowid[$id]) {
1049 $rowidcol = $tabrowid[$id];
1051 $rowidcol =
"rowid";
1054 $tablename = $tabname[$id];
1055 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1058 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 0 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1060 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 0 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1063 $result = $db->query($sql);
1070 if ($action ==
'activate_favorite') {
1071 if ($tabrowid[$id]) {
1072 $rowidcol = $tabrowid[$id];
1074 $rowidcol =
"rowid";
1077 $tablename = $tabname[$id];
1078 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1081 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 1 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1083 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 1 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1086 $result = $db->query($sql);
1093 if ($action ==
'disable_favorite') {
1094 if ($tabrowid[$id]) {
1095 $rowidcol = $tabrowid[$id];
1097 $rowidcol =
"rowid";
1100 $tablename = $tabname[$id];
1101 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1104 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 0 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1106 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 0 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1109 $result = $db->query($sql);
1116 if ($action ==
'activate_eec') {
1117 if ($tabrowid[$id]) {
1118 $rowidcol = $tabrowid[$id];
1120 $rowidcol =
"rowid";
1123 $tablename = $tabname[$id];
1124 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1127 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 1 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1129 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 1 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1132 $result = $db->query($sql);
1139 if ($action ==
'disable_eec') {
1140 if ($tabrowid[$id]) {
1141 $rowidcol = $tabrowid[$id];
1143 $rowidcol =
"rowid";
1146 $tablename = $tabname[$id];
1147 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1150 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 0 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1152 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 0 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1155 $result = $db->query($sql);
1170 $title = $langs->trans(
"DictionarySetup");
1176 $title .=
' - '.$langs->trans($tablib[$id]);
1177 $linkback =
'<a href="'.$_SERVER[
'PHP_SELF'].
'">'.$langs->trans(
"BackToDictionaryList").
'</a>';
1179 $titlepicto =
'title_setup';
1180 if ($id == 10 &&
GETPOST(
'from') ==
'accountancy') {
1181 $title = $langs->trans(
"MenuVatAccounts");
1182 $titlepicto =
'accountancy';
1184 if ($id == 7 &&
GETPOST(
'from') ==
'accountancy') {
1185 $title = $langs->trans(
"MenuTaxAccounts");
1186 $titlepicto =
'accountancy';
1192 print
'<span class="opacitymedium">'.$langs->trans(
"DictionaryDesc");
1193 print
" ".$langs->trans(
"OnlyActiveElementsAreShown").
"<br>\n";
1194 print
'</span><br>';
1198 $param =
'&id='.urlencode($id);
1199 if ($search_country_id > 0) {
1200 $param .=
'&search_country_id='.urlencode($search_country_id);
1202 if ($search_code !=
'') {
1203 $param .=
'&search_code='.urlencode($search_country_id);
1205 if ($entity !=
'') {
1206 $param .=
'&entity='.(int) $entity;
1208 $paramwithsearch = $param;
1210 $paramwithsearch .=
'&sortorder='.urlencode($sortorder);
1213 $paramwithsearch .=
'&sortfield='.urlencode($sortfield);
1216 $paramwithsearch .=
'&from='.urlencode(
GETPOST(
'from',
'alpha'));
1221 if ($action ==
'delete') {
1222 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);
1231 $sql = $tabsql[$id];
1233 if (!preg_match(
'/ WHERE /', $sql)) {
1234 $sql .=
" WHERE 1 = 1";
1236 if ($search_country_id > 0) {
1237 $sql .=
" AND c.rowid = ".((int) $search_country_id);
1239 if ($search_code !=
'' && $id == 9) {
1241 } elseif ($search_code !=
'' && $id == 28) {
1243 } elseif ($search_code !=
'' && ($id == 7 || $id == 32)) {
1245 } elseif ($search_code !=
'' && $id == 3) {
1247 } elseif ($search_code !=
'' && ($id == 8 || $id == 10)) {
1249 } elseif ($search_code !=
'' && $id == 1) {
1251 } elseif ($search_code !=
'' && $id == 2) {
1253 } elseif ($search_code !=
'' && $id != 9) {
1259 if ($sortfield ==
'country') {
1260 $sortfield =
'country_code';
1262 $sql .= $db->order($sortfield, $sortorder);
1265 $tabsqlsort[$id] = preg_replace(
'/([a-z]+\.)?'.$sortfield.
' '.$sortorder.
',/i',
'', $tabsqlsort[$id]);
1266 $tabsqlsort[$id] = preg_replace(
'/([a-z]+\.)?'.$sortfield.
',/i',
'', $tabsqlsort[$id]);
1268 $sql .=
" ORDER BY ";
1270 $sql .= $tabsqlsort[$id];
1271 $sql .= $db->plimit($listlimit + 1, $offset);
1274 if (empty($tabfield[$id])) {
1275 dol_print_error($db,
'The table with id '.$id.
' has no array tabfield defined');
1278 $fieldlist = explode(
',', $tabfield[$id]);
1280 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.$id.
'" method="POST">';
1281 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1282 print
'<input type="hidden" name="from" value="'.dol_escape_htmltag(
GETPOST(
'from',
'alpha')).
'">';
1284 if ($id == 10 && empty($conf->global->FACTURE_TVAOPTION)) {
1285 print
info_admin($langs->trans(
"VATIsUsedIsOff", $langs->transnoentities(
"Setup"), $langs->transnoentities(
"CompanyFoundation")));
1290 if ($tabname[$id]) {
1293 $fieldlist = explode(
',', $tabfield[$id]);
1295 print
'<div class="div-table-responsive-no-min">';
1296 print
'<table class="noborder centpercent">';
1299 print
'<!-- line title to add new entry -->';
1300 $tdsoffields =
'<tr class="liste_titre">';
1301 foreach ($fieldlist as $field => $value) {
1302 if ($value ==
'entity') {
1308 $valuetoshow = ucfirst($value);
1309 $valuetoshow = $langs->trans($valuetoshow);
1312 if ($value ==
'pos') {
1313 $valuetoshow = $langs->trans(
"Position"); $class =
'right';
1315 if ($value ==
'source') {
1316 $valuetoshow = $langs->trans(
"Contact");
1318 if ($value ==
'price') {
1319 $valuetoshow = $langs->trans(
"PriceUHT");
1321 if ($value ==
'taux') {
1322 if ($tabname[$id] !=
"c_revenuestamp") {
1323 $valuetoshow = $langs->trans(
"Rate");
1325 $valuetoshow = $langs->trans(
"Amount");
1329 if ($value ==
'localtax1_type') {
1330 $valuetoshow = $langs->trans(
"UseLocalTax").
" 2"; $class =
"center"; $sortable = 0;
1332 if ($value ==
'localtax1') {
1333 $valuetoshow = $langs->trans(
"RateOfTaxN",
'2'); $class =
"center";
1335 if ($value ==
'localtax2_type') {
1336 $valuetoshow = $langs->trans(
"UseLocalTax").
" 3"; $class =
"center"; $sortable = 0;
1338 if ($value ==
'localtax2') {
1339 $valuetoshow = $langs->trans(
"RateOfTaxN",
'3'); $class =
"center";
1341 if ($value ==
'organization') {
1342 $valuetoshow = $langs->trans(
"Organization");
1344 if ($value ==
'lang') {
1345 $valuetoshow = $langs->trans(
"Language");
1347 if ($value ==
'type') {
1348 if ($tabname[$id] ==
"c_paiement") {
1349 $valuetoshow =
$form->textwithtooltip($langs->trans(
"Type"), $langs->trans(
"TypePaymentDesc"), 2, 1,
img_help(1,
''));
1351 $valuetoshow = $langs->trans(
"Type");
1354 if ($value ==
'code') {
1355 $valuetoshow = $langs->trans(
"Code"); $class =
'maxwidth100';
1357 if ($value ==
'libelle' || $value ==
'label') {
1358 $valuetoshow =
$form->textwithtooltip($langs->trans(
"Label"), $langs->trans(
"LabelUsedByDefault"), 2, 1,
img_help(1,
''));
1360 if ($value ==
'libelle_facture') {
1361 $valuetoshow =
$form->textwithtooltip($langs->trans(
"LabelOnDocuments"), $langs->trans(
"LabelUsedByDefault"), 2, 1,
img_help(1,
''));
1363 if ($value ==
'deposit_percent') {
1364 $valuetoshow = $langs->trans(
'DepositPercent');
1367 if ($value ==
'country') {
1368 if (in_array(
'region_id', $fieldlist)) {
1369 print
'<td> </td>';
continue;
1371 $valuetoshow = $langs->trans(
"Country");
1373 if ($value ==
'recuperableonly') {
1374 $valuetoshow = $langs->trans(
"NPR"); $class =
"center";
1376 if ($value ==
'nbjour') {
1377 $valuetoshow = $langs->trans(
"NbOfDays");
1380 if ($value ==
'type_cdr') {
1381 $valuetoshow = $langs->trans(
"AtEndOfMonth"); $class =
"center";
1383 if ($value ==
'decalage') {
1384 $valuetoshow = $langs->trans(
"Offset");
1387 if ($value ==
'width' || $value ==
'nx') {
1388 $valuetoshow = $langs->trans(
"Width");
1390 if ($value ==
'height' || $value ==
'ny') {
1391 $valuetoshow = $langs->trans(
"Height");
1393 if ($value ==
'unit' || $value ==
'metric') {
1394 $valuetoshow = $langs->trans(
"MeasuringUnit");
1396 if ($value ==
'region_id' || $value ==
'country_id') {
1399 if ($value ==
'accountancy_code') {
1400 $valuetoshow = $langs->trans(
"AccountancyCode");
1402 if ($value ==
'accountancy_code_sell') {
1403 $valuetoshow = $langs->trans(
"AccountancyCodeSell");
1405 if ($value ==
'accountancy_code_buy') {
1406 $valuetoshow = $langs->trans(
"AccountancyCodeBuy");
1408 if ($value ==
'pcg_version' || $value ==
'fk_pcg_version') {
1409 $valuetoshow = $langs->trans(
"Pcg_version");
1411 if ($value ==
'account_parent') {
1412 $valuetoshow = $langs->trans(
"Accountparent");
1414 if ($value ==
'pcg_type') {
1415 $valuetoshow = $langs->trans(
"Pcg_type");
1417 if ($value ==
'pcg_subtype') {
1418 $valuetoshow = $langs->trans(
"Pcg_subtype");
1420 if ($value ==
'sortorder') {
1421 $valuetoshow = $langs->trans(
"SortOrder");
1424 if ($value ==
'short_label') {
1425 $valuetoshow = $langs->trans(
"ShortLabel");
1427 if ($value ==
'fk_parent') {
1428 $valuetoshow = $langs->trans(
"ParentID"); $class =
'center';
1430 if ($value ==
'range_account') {
1431 $valuetoshow = $langs->trans(
"Range");
1433 if ($value ==
'sens') {
1434 $valuetoshow = $langs->trans(
"Sens");
1436 if ($value ==
'category_type') {
1437 $valuetoshow = $langs->trans(
"Calculated");
1439 if ($value ==
'formula') {
1440 $valuetoshow = $langs->trans(
"Formula");
1442 if ($value ==
'paper_size') {
1443 $valuetoshow = $langs->trans(
"PaperSize");
1445 if ($value ==
'orientation') {
1446 $valuetoshow = $langs->trans(
"Orientation");
1448 if ($value ==
'leftmargin') {
1449 $valuetoshow = $langs->trans(
"LeftMargin");
1451 if ($value ==
'topmargin') {
1452 $valuetoshow = $langs->trans(
"TopMargin");
1454 if ($value ==
'spacex') {
1455 $valuetoshow = $langs->trans(
"SpaceX");
1457 if ($value ==
'spacey') {
1458 $valuetoshow = $langs->trans(
"SpaceY");
1460 if ($value ==
'font_size') {
1461 $valuetoshow = $langs->trans(
"FontSize");
1463 if ($value ==
'custom_x') {
1464 $valuetoshow = $langs->trans(
"CustomX");
1466 if ($value ==
'custom_y') {
1467 $valuetoshow = $langs->trans(
"CustomY");
1469 if ($value ==
'percent') {
1470 $valuetoshow = $langs->trans(
"Percentage");
1472 if ($value ==
'affect') {
1473 $valuetoshow = $langs->trans(
"WithCounter");
1475 if ($value ==
'delay') {
1476 $valuetoshow = $langs->trans(
"NoticePeriod");
1478 if ($value ==
'newbymonth') {
1479 $valuetoshow = $langs->trans(
"NewByMonth");
1481 if ($value ==
'fk_tva') {
1482 $valuetoshow = $langs->trans(
"VAT");
1484 if ($value ==
'range_ik') {
1485 $valuetoshow = $langs->trans(
"RangeIk");
1487 if ($value ==
'fk_c_exp_tax_cat') {
1488 $valuetoshow = $langs->trans(
"CarCategory");
1490 if ($value ==
'revenuestamp_type') {
1491 $valuetoshow = $langs->trans(
'TypeOfRevenueStamp');
1493 if ($value ==
'use_default') {
1494 $valuetoshow = $langs->trans(
'Default'); $class =
'center';
1496 if ($value ==
'unit_type') {
1497 $valuetoshow = $langs->trans(
'TypeOfUnit');
1499 if ($value ==
'public' && $tablib[$id] ==
'TicketDictCategory') {
1500 $valuetoshow = $langs->trans(
'TicketGroupIsPublic'); $class =
'center';
1502 if ($value ==
'block_if_negative') {
1503 $valuetoshow = $langs->trans(
'BlockHolidayIfNegative');
1505 if ($value ==
'type_duration') {
1506 $valuetoshow = $langs->trans(
'Unit');
1510 if ($value ==
'region_id') {
1511 $valuetoshow =
' '; $showfield = 1;
1513 if ($value ==
'region') {
1514 $valuetoshow = $langs->trans(
"Country").
'/'.$langs->trans(
"Region"); $showfield = 1;
1518 if ($valuetoshow !=
'') {
1519 $tooltiphelp = (isset($tabcomplete[$tabname[$id]][
'help'][$value]) ? $tabcomplete[$tabname[$id]][
'help'][$value] :
'');
1521 $tdsoffields .=
'<th'.($class ?
' class="'.$class.
'"' :
'').
'>';
1522 if ($tooltiphelp && preg_match(
'/^http(s*):/i', $tooltiphelp)) {
1523 $tdsoffields .=
'<a href="'.$tooltiphelp.
'" target="_blank">'.$valuetoshow.
' '.
img_help(1, $valuetoshow).
'</a>';
1524 } elseif ($tooltiphelp) {
1525 $tdsoffields .=
$form->textwithpicto($valuetoshow, $tooltiphelp);
1527 $tdsoffields .= $valuetoshow;
1529 $tdsoffields .=
'</th>';
1534 $tdsoffields .=
'<th></th>';
1535 $tdsoffields .=
'<th></th>';
1537 $tdsoffields .=
'<th>';
1538 $tdsoffields .=
'<input type="hidden" name="id" value="'.$id.
'">';
1539 if (!is_null($withentity)) {
1540 $tdsoffields .=
'<input type="hidden" name="entity" value="'.$withentity.
'">';
1542 $tdsoffields .=
'</th>';
1543 $tdsoffields .=
'<th style="min-width: 26px;"></th>';
1544 $tdsoffields .=
'<th style="min-width: 26px;"></th>';
1545 $tdsoffields .=
'</tr>';
1551 print
'<!-- line input to add new entry -->';
1552 print
'<tr class="oddeven nodrag nodrop nohover">';
1554 $obj =
new stdClass();
1557 foreach ($fieldlist as $key => $val) {
1564 $tmpaction =
'create';
1565 $parameters = array(
'fieldlist'=>$fieldlist,
'tabname'=>$tabname[$id]);
1566 $reshook = $hookmanager->executeHooks(
'createDictionaryFieldlist', $parameters, $obj, $tmpaction);
1567 $error = $hookmanager->error; $errors = $hookmanager->errors;
1570 unset($fieldlist[2]);
1574 if (empty($reshook)) {
1575 fieldList($fieldlist, $obj, $tabname[$id],
'add');
1582 print
'<td colspan="3" class="center">';
1583 if ($action !=
'edit') {
1584 print
'<input type="submit" class="button button-add" name="actionadd" value="'.$langs->trans(
"Add").
'">';
1600 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.$id.
'" method="POST">';
1601 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1602 print
'<input type="hidden" name="from" value="'.dol_escape_htmltag(
GETPOST(
'from',
'alpha')).
'">';
1607 $resql = $db->query($sql);
1609 $num = $db->num_rows(
$resql);
1613 if ($num > $listlimit || $page) {
1614 print_fleche_navigation($page, $_SERVER[
"PHP_SELF"], $paramwithsearch, ($num > $listlimit),
'<li class="pagination"><span>'.$langs->trans(
"Page").
' '.($page + 1).
'</span></li>');
1615 print
'<div class="clearboth"></div>';
1618 print
'<div class="div-table-responsive">';
1619 print
'<table class="noborder centpercent">';
1622 print
'<!-- line title to search record -->'.
"\n";
1623 print
'<tr class="liste_titre_filter">';
1625 foreach ($fieldlist as $field => $value) {
1626 if ($value ==
'entity') {
1632 if ($value ==
'region_id' || $value ==
'country_id') {
1637 if ($value ==
'country') {
1638 print
'<td class="liste_titre">';
1639 print
$form->select_country($search_country_id,
'search_country_id',
'', 28,
'maxwidth150 maxwidthonsmartphone');
1642 } elseif ($value ==
'code') {
1643 print
'<td class="liste_titre">';
1644 print
'<input type="text" class="maxwidth100" name="search_code" value="'.dol_escape_htmltag($search_code).
'">';
1648 print
'<td class="liste_titre">';
1657 print
'<td class="liste_titre"></td>';
1658 print
'<td class="liste_titre right" colspan="2">';
1660 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
1667 print
'<!-- line title of record -->'.
"\n";
1668 print
'<tr class="liste_titre">';
1669 foreach ($fieldlist as $field => $value) {
1670 if ($value ==
'entity') {
1674 if (in_array($value, array(
'label',
'libelle',
'libelle_facture')) && empty($tabcomplete[$tabname[$id]][
'help'][$value])) {
1675 $tabcomplete[$tabname[$id]][
'help'][$value] = $langs->trans(
'LabelUsedByDefault');
1683 $valuetoshow = ucfirst($value);
1684 $valuetoshow = $langs->trans($valuetoshow);
1687 if ($value ==
'source') {
1688 $valuetoshow = $langs->trans(
"Contact");
1690 if ($value ==
'price') {
1691 $valuetoshow = $langs->trans(
"PriceUHT");
1693 if ($value ==
'taux') {
1694 if ($tabname[$id] !=
"c_revenuestamp") {
1695 $valuetoshow = $langs->trans(
"Rate");
1697 $valuetoshow = $langs->trans(
"Amount");
1699 $cssprefix =
'center ';
1702 if ($value ==
'localtax1_type') {
1703 $valuetoshow = $langs->trans(
"UseLocalTax").
" 2"; $cssprefix =
"center "; $sortable = 0;
1705 if ($value ==
'localtax1') {
1706 $valuetoshow = $langs->trans(
"RateOfTaxN",
'2'); $cssprefix =
"center "; $sortable = 0;
1708 if ($value ==
'localtax2_type') {
1709 $valuetoshow = $langs->trans(
"UseLocalTax").
" 3"; $cssprefix =
"center "; $sortable = 0;
1711 if ($value ==
'localtax2') {
1712 $valuetoshow = $langs->trans(
"RateOfTaxN",
'3'); $cssprefix =
"center "; $sortable = 0;
1714 if ($value ==
'organization') {
1715 $valuetoshow = $langs->trans(
"Organization");
1717 if ($value ==
'lang') {
1718 $valuetoshow = $langs->trans(
"Language");
1720 if ($value ==
'type') {
1721 $valuetoshow = $langs->trans(
"Type");
1723 if ($value ==
'code') {
1724 $valuetoshow = $langs->trans(
"Code");
1726 if (in_array($value, array(
'pos',
'position'))) {
1727 $valuetoshow = $langs->trans(
"Position"); $cssprefix =
'right ';
1729 if ($value ==
'libelle' || $value ==
'label') {
1730 $valuetoshow = $langs->trans(
"Label");
1732 if ($value ==
'libelle_facture') {
1733 $valuetoshow = $langs->trans(
"LabelOnDocuments");
1735 if ($value ==
'deposit_percent') {
1736 $valuetoshow = $langs->trans(
'DepositPercent');
1737 $cssprefix =
'right ';
1739 if ($value ==
'country') {
1740 $valuetoshow = $langs->trans(
"Country");
1742 if ($value ==
'recuperableonly') {
1743 $valuetoshow = $langs->trans(
"NPR"); $cssprefix =
"center ";
1745 if ($value ==
'nbjour') {
1746 $valuetoshow = $langs->trans(
"NbOfDays");
1747 $cssprefix =
'right ';
1749 if ($value ==
'type_cdr') {
1750 $valuetoshow = $langs->trans(
"AtEndOfMonth"); $cssprefix =
"center ";
1752 if ($value ==
'decalage') {
1753 $valuetoshow = $langs->trans(
"Offset");
1754 $cssprefix =
'right ';
1756 if ($value ==
'width' || $value ==
'nx') {
1757 $valuetoshow = $langs->trans(
"Width");
1759 if ($value ==
'height' || $value ==
'ny') {
1760 $valuetoshow = $langs->trans(
"Height");
1762 if ($value ==
'unit' || $value ==
'metric') {
1763 $valuetoshow = $langs->trans(
"MeasuringUnit");
1765 if ($value ==
'accountancy_code') {
1766 $valuetoshow = $langs->trans(
"AccountancyCode");
1768 if ($value ==
'accountancy_code_sell') {
1769 $valuetoshow = $langs->trans(
"AccountancyCodeSell"); $sortable = 0;
1771 if ($value ==
'accountancy_code_buy') {
1772 $valuetoshow = $langs->trans(
"AccountancyCodeBuy"); $sortable = 0;
1774 if ($value ==
'fk_pcg_version') {
1775 $valuetoshow = $langs->trans(
"Pcg_version");
1777 if ($value ==
'account_parent') {
1778 $valuetoshow = $langs->trans(
"Accountsparent");
1780 if ($value ==
'pcg_type') {
1781 $valuetoshow = $langs->trans(
"Pcg_type");
1783 if ($value ==
'pcg_subtype') {
1784 $valuetoshow = $langs->trans(
"Pcg_subtype");
1786 if ($value ==
'sortorder') {
1787 $valuetoshow = $langs->trans(
"SortOrder");
1788 $cssprefix =
'center ';
1790 if ($value ==
'short_label') {
1791 $valuetoshow = $langs->trans(
"ShortLabel");
1793 if ($value ==
'fk_parent') {
1794 $valuetoshow = $langs->trans(
"ParentID"); $cssprefix =
'center ';
1796 if ($value ==
'range_account') {
1797 $valuetoshow = $langs->trans(
"Range");
1799 if ($value ==
'sens') {
1800 $valuetoshow = $langs->trans(
"Sens");
1802 if ($value ==
'category_type') {
1803 $valuetoshow = $langs->trans(
"Calculated");
1805 if ($value ==
'formula') {
1806 $valuetoshow = $langs->trans(
"Formula");
1808 if ($value ==
'paper_size') {
1809 $valuetoshow = $langs->trans(
"PaperSize");
1811 if ($value ==
'orientation') {
1812 $valuetoshow = $langs->trans(
"Orientation");
1814 if ($value ==
'leftmargin') {
1815 $valuetoshow = $langs->trans(
"LeftMargin");
1817 if ($value ==
'topmargin') {
1818 $valuetoshow = $langs->trans(
"TopMargin");
1820 if ($value ==
'spacex') {
1821 $valuetoshow = $langs->trans(
"SpaceX");
1823 if ($value ==
'spacey') {
1824 $valuetoshow = $langs->trans(
"SpaceY");
1826 if ($value ==
'font_size') {
1827 $valuetoshow = $langs->trans(
"FontSize");
1829 if ($value ==
'custom_x') {
1830 $valuetoshow = $langs->trans(
"CustomX");
1832 if ($value ==
'custom_y') {
1833 $valuetoshow = $langs->trans(
"CustomY");
1835 if ($value ==
'percent') {
1836 $valuetoshow = $langs->trans(
"Percentage");
1838 if ($value ==
'affect') {
1839 $valuetoshow = $langs->trans(
"WithCounter");
1841 if ($value ==
'delay') {
1842 $valuetoshow = $langs->trans(
"NoticePeriod");
1844 if ($value ==
'newbymonth') {
1845 $valuetoshow = $langs->trans(
"NewByMonth");
1847 if ($value ==
'fk_tva') {
1848 $valuetoshow = $langs->trans(
"VAT");
1850 if ($value ==
'range_ik') {
1851 $valuetoshow = $langs->trans(
"RangeIk");
1853 if ($value ==
'fk_c_exp_tax_cat') {
1854 $valuetoshow = $langs->trans(
"CarCategory");
1856 if ($value ==
'revenuestamp_type') {
1857 $valuetoshow = $langs->trans(
'TypeOfRevenueStamp');
1859 if ($value ==
'use_default') {
1860 $valuetoshow = $langs->trans(
'Default'); $cssprefix =
'center ';
1862 if ($value ==
'unit_type') {
1863 $valuetoshow = $langs->trans(
'TypeOfUnit');
1865 if ($value ==
'public' && $tablib[$id] ==
'TicketDictCategory') {
1866 $valuetoshow = $langs->trans(
'TicketGroupIsPublic'); $cssprefix =
'center ';
1868 if ($value ==
'block_if_negative') {
1869 $valuetoshow = $langs->trans(
'BlockHolidayIfNegative');
1871 if ($value ==
'type_duration') {
1872 $valuetoshow = $langs->trans(
'Unit');
1875 if ($value ==
'region_id' || $value ==
'country_id') {
1881 $tooltiphelp = (isset($tabcomplete[$tabname[$id]][
'help'][$value]) ? $tabcomplete[$tabname[$id]][
'help'][$value] :
'');
1883 if ($tooltiphelp && preg_match(
'/^http(s*):/i', $tooltiphelp)) {
1884 $newvaluetoshow =
'<a href="'.$tooltiphelp.
'" target="_blank">'.$valuetoshow.
' '.
img_help(1, $valuetoshow).
'</a>';
1885 } elseif ($tooltiphelp) {
1886 $newvaluetoshow =
$form->textwithpicto($valuetoshow, $tooltiphelp);
1888 $newvaluetoshow = $valuetoshow;
1891 print
getTitleFieldOfList($newvaluetoshow, 0, $_SERVER[
"PHP_SELF"], ($sortable ? $value :
''), ($page ?
'page='.$page.
'&' :
''), $param,
'', $sortfield, $sortorder, $cssprefix);
1896 print
getTitleFieldOfList($langs->trans(
"InEEC"), 0, $_SERVER[
"PHP_SELF"],
"eec", ($page ?
'page='.$page.
'&' :
''), $param,
'align="center"', $sortfield, $sortorder,
'', 0, $langs->trans(
"CountryIsInEEC"));
1897 print
getTitleFieldOfList($langs->trans(
"Favorite"), 0, $_SERVER[
"PHP_SELF"],
"favorite", ($page ?
'page='.$page.
'&' :
''), $param,
'align="center"', $sortfield, $sortorder);
1900 print
getTitleFieldOfList($langs->trans(
"Status"), 0, $_SERVER[
"PHP_SELF"],
"active", ($page ?
'page='.$page.
'&' :
''), $param,
'align="center"', $sortfield, $sortorder);
1908 $obj = $db->fetch_object(
$resql);
1910 print
'<tr class="oddeven" id="rowid-'.(empty($obj->rowid) ?
'' : $obj->rowid).
'">';
1911 if ($action ==
'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
1912 $tmpaction =
'edit';
1913 $parameters = array(
'fieldlist'=>$fieldlist,
'tabname'=>$tabname[$id]);
1914 $reshook = $hookmanager->executeHooks(
'editDictionaryFieldlist', $parameters, $obj, $tmpaction);
1915 $error = $hookmanager->error; $errors = $hookmanager->errors;
1918 if (empty($reshook)) {
1919 $withentity =
fieldList($fieldlist, $obj, $tabname[$id],
'edit');
1922 print
'<td colspan="3" class="center">';
1923 print
'<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).
'"></div>';
1924 print
'<input type="hidden" name="page" value="'.dol_escape_htmltag($page).
'">';
1925 print
'<input type="hidden" name="rowid" value="'.dol_escape_htmltag($rowid).
'">';
1926 if (!is_null($withentity)) {
1927 print
'<input type="hidden" name="entity" value="'.$withentity.
'">';
1929 print
'<input type="submit" class="button button-edit" name="actionmodify" value="'.$langs->trans(
"Modify").
'">';
1930 print
'<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans(
"Cancel").
'">';
1933 $tmpaction =
'view';
1934 $parameters = array(
'fieldlist'=>$fieldlist,
'tabname'=>$tabname[$id]);
1935 $reshook = $hookmanager->executeHooks(
'viewDictionaryFieldlist', $parameters, $obj, $tmpaction);
1937 $error = $hookmanager->error; $errors = $hookmanager->errors;
1939 if (empty($reshook)) {
1942 foreach ($fieldlist as $field => $value) {
1946 $valuetoshow = empty($obj->{$value}) ?
'' : $obj->{$value};
1949 if ($value ==
'entity') {
1950 $withentity = $valuetoshow;
1954 if ($value ==
'element') {
1955 $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
1956 } elseif ($value ==
'source') {
1957 $valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow;
1958 } elseif ($valuetoshow ==
'all') {
1959 $valuetoshow = $langs->trans(
'All');
1960 } elseif ($value ==
'country') {
1961 if (empty($obj->country_code)) {
1964 $key = $langs->trans(
"Country".strtoupper($obj->country_code));
1965 $valuetoshow = ($key !=
"Country".strtoupper($obj->country_code) ? $obj->country_code.
" - ".$key : $obj->country);
1967 } elseif ($value ==
'recuperableonly' || $value ==
'deductible' || $value ==
'category_type') {
1968 $valuetoshow =
yn($valuetoshow);
1970 } elseif ($value ==
'type_cdr') {
1971 if (empty($valuetoshow)) {
1972 $valuetoshow = $langs->trans(
'None');
1973 } elseif ($valuetoshow == 1) {
1974 $valuetoshow = $langs->trans(
'AtEndOfMonth');
1975 } elseif ($valuetoshow == 2) {
1976 $valuetoshow = $langs->trans(
'CurrentNext');
1979 } elseif ($value ==
'price' || preg_match(
'/^amount/i', $value)) {
1980 $valuetoshow =
price($valuetoshow);
1982 if ($value ==
'private') {
1983 $valuetoshow =
yn($valuetoshow);
1984 } elseif ($value ==
'libelle_facture') {
1985 $langs->load(
"bills");
1986 $key = $langs->trans(
"PaymentCondition".strtoupper($obj->code));
1987 $valuetoshow = ($obj->code && $key !=
"PaymentCondition".strtoupper($obj->code) ? $key : $obj->{$value});
1988 $valuetoshow = nl2br($valuetoshow);
1989 } elseif ($value ==
'label' && $tabname[$id] ==
'c_country') {
1990 $key = $langs->trans(
"Country".strtoupper($obj->code));
1991 $valuetoshow = ($obj->code && $key !=
"Country".strtoupper($obj->code) ? $key : $obj->{$value});
1992 } elseif ($value ==
'label' && $tabname[$id] ==
'c_availability') {
1993 $langs->load(
"propal");
1994 $key = $langs->trans(
"AvailabilityType".strtoupper($obj->code));
1995 $valuetoshow = ($obj->code && $key !=
"AvailabilityType".strtoupper($obj->code) ? $key : $obj->{$value});
1996 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_actioncomm') {
1997 $key = $langs->trans(
"Action".strtoupper($obj->code));
1998 $valuetoshow = ($obj->code && $key !=
"Action".strtoupper($obj->code) ? $key : $obj->{$value});
1999 } elseif (!empty($obj->code_iso) && $value ==
'label' && $tabname[$id] ==
'c_currencies') {
2000 $key = $langs->trans(
"Currency".strtoupper($obj->code_iso));
2001 $valuetoshow = ($obj->code_iso && $key !=
"Currency".strtoupper($obj->code_iso) ? $key : $obj->{$value});
2002 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_typent') {
2003 $key = $langs->trans(strtoupper($obj->code));
2004 $valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->{$value});
2005 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_prospectlevel') {
2006 $key = $langs->trans(strtoupper($obj->code));
2007 $valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->{$value});
2008 } elseif ($value ==
'label' && $tabname[$id] ==
'c_civility') {
2009 $key = $langs->trans(
"Civility".strtoupper($obj->code));
2010 $valuetoshow = ($obj->code && $key !=
"Civility".strtoupper($obj->code) ? $key : $obj->{$value});
2011 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_type_contact') {
2012 $langs->load(
'agenda');
2013 $key = $langs->trans(
"TypeContact_".$obj->element.
"_".$obj->source.
"_".strtoupper($obj->code));
2014 $valuetoshow = ($obj->code && $key !=
"TypeContact_".$obj->element.
"_".$obj->source.
"_".strtoupper($obj->code) ? $key : $obj->{$value});
2015 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_payment_term') {
2016 $langs->load(
"bills");
2017 $key = $langs->trans(
"PaymentConditionShort".strtoupper($obj->code));
2018 $valuetoshow = ($obj->code && $key !=
"PaymentConditionShort".strtoupper($obj->code) ? $key : $obj->{$value});
2019 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_paiement') {
2020 $langs->load(
"bills");
2021 $key = $langs->trans(
"PaymentType".strtoupper($obj->code));
2022 $valuetoshow = ($obj->code && $key !=
"PaymentType".strtoupper($obj->code) ? $key : $obj->{$value});
2023 } elseif ($value ==
'type' && $tabname[$id] ==
'c_paiement') {
2024 $payment_type_list = array(0=>$langs->trans(
'PaymentTypeCustomer'), 1=>$langs->trans(
'PaymentTypeSupplier'), 2=>$langs->trans(
'PaymentTypeBoth'));
2025 $valuetoshow = $payment_type_list[$valuetoshow];
2026 } elseif ($value ==
'label' && $tabname[$id] ==
'c_input_reason') {
2027 $key = $langs->trans(
"DemandReasonType".strtoupper($obj->code));
2028 $valuetoshow = ($obj->code && $key !=
"DemandReasonType".strtoupper($obj->code) ? $key : $obj->{$value});
2029 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_input_method') {
2030 $langs->load(
"orders");
2031 $key = $langs->trans($obj->code);
2032 $valuetoshow = ($obj->code && $key != $obj->code) ? $key : $obj->{$value};
2033 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_shipment_mode') {
2034 $langs->load(
"sendings");
2035 $key = $langs->trans(
"SendingMethod".strtoupper($obj->code));
2036 $valuetoshow = ($obj->code && $key !=
"SendingMethod".strtoupper($obj->code) ? $key : $obj->{$value});
2037 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_paper_format') {
2038 $key = $langs->trans(
'PaperFormat'.strtoupper($obj->code));
2039 $valuetoshow = ($obj->code && $key !=
'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$value});
2040 } elseif ($value ==
'label' && $tabname[$id] ==
'c_type_fees') {
2041 $langs->load(
'trips');
2042 $key = $langs->trans(strtoupper($obj->code));
2043 $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$value});
2044 } elseif ($value ==
'region_id' || $value ==
'country_id') {
2046 } elseif ($value ==
'unicode') {
2047 $valuetoshow = $langs->getCurrencySymbol($obj->code, 1);
2048 } elseif ($value ==
'label' && $tabname[
GETPOST(
"id",
'int')] ==
'c_units') {
2049 $langs->load(
"products");
2050 $valuetoshow = $langs->trans($obj->{$value});
2051 } elseif ($value ==
'short_label' && $tabname[
GETPOST(
"id",
'int')] ==
'c_units') {
2052 $langs->load(
"products");
2053 $valuetoshow = $langs->trans($obj->{$value});
2054 } elseif (($value ==
'unit') && ($tabname[$id] ==
'c_paper_format')) {
2055 $key = $langs->trans(
'SizeUnit'.strtolower($obj->unit));
2056 $valuetoshow = ($obj->code && $key !=
'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$value});
2057 } elseif ($value ==
'localtax1' || $value ==
'localtax2') {
2059 } elseif ($value ==
'localtax1_type') {
2060 if ($obj->localtax1 != 0) {
2061 $valuetoshow = $localtax_typeList[$valuetoshow];
2066 } elseif ($value ==
'localtax2_type') {
2067 if ($obj->localtax2 != 0) {
2068 $valuetoshow = $localtax_typeList[$valuetoshow];
2073 } elseif ($value ==
'taux') {
2074 $valuetoshow =
price($valuetoshow, 0, $langs, 0, 0);
2076 } elseif (in_array($value, array(
'recuperableonly'))) {
2078 } elseif ($value ==
'accountancy_code' || $value ==
'accountancy_code_sell' || $value ==
'accountancy_code_buy') {
2079 if (!empty($conf->accounting->enabled)) {
2080 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
2082 $tmpaccountingaccount->fetch(0, $valuetoshow, 1);
2083 $titletoshow = $langs->transnoentitiesnoconv(
"Pcgtype").
': '.$tmpaccountingaccount->pcg_type;
2086 } elseif ($value ==
'fk_tva') {
2087 foreach (
$form->cache_vatrates as $key => $Tab) {
2088 if (
$form->cache_vatrates[$key][
'rowid'] == $valuetoshow) {
2089 $valuetoshow =
$form->cache_vatrates[$key][
'label'];
2093 } elseif ($value ==
'fk_c_exp_tax_cat') {
2094 $tmpid = $valuetoshow;
2096 $valuetoshow = $langs->trans($valuetoshow ? $valuetoshow : $tmpid);
2097 } elseif ($tabname[$id] ==
'c_exp_tax_cat') {
2098 $valuetoshow = $langs->trans($valuetoshow);
2099 } elseif ($value ==
'label' && $tabname[$id] ==
'c_units') {
2100 $langs->load(
'other');
2101 $key = $langs->trans($obj->label);
2102 $valuetoshow = ($obj->label && $key != strtoupper($obj->label) ? $key : $obj->{$value});
2103 } elseif ($value ==
'code' && $id == 3) {
2104 $valuetoshow = $obj->state_code;
2105 } elseif ($value ==
'label' && $tabname[$id] ==
'c_product_nature') {
2106 $langs->load(
"products");
2107 $valuetoshow = $langs->trans($obj->{$value});
2108 } elseif ($fieldlist[$field] ==
'label' && $tabname[$id] ==
'c_productbatch_qcstatus') {
2109 $langs->load(
"productbatch");
2110 $valuetoshow = $langs->trans($obj->{$value});
2111 } elseif ($value ==
'block_if_negative') {
2112 $valuetoshow =
yn($obj->{$value});
2113 } elseif ($value ==
'icon') {
2114 $valuetoshow = $obj->{$value}.
" ".
img_picto(
"", $obj->{$value});
2115 } elseif ($value ==
'type_duration') {
2116 $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'));
2117 $valuetoshow =$TDurationTypes[$obj->{$value}];
2119 $class .= ($class ?
' ' :
'').
'tddict';
2120 if ($value ==
'note' && $id == 10) {
2121 $class .=
' tdoverflowmax200';
2123 if ($value ==
'tracking') {
2124 $class .=
' tdoverflowauto';
2126 if (in_array($value, array(
'nbjour',
'decalage',
'pos',
'position',
'deposit_percent'))) {
2129 if (in_array($value, array(
'localtax1_type',
'localtax2_type'))) {
2130 $class .=
' nowrap';
2132 if (in_array($value, array(
'use_default',
'fk_parent',
'sortorder'))) {
2133 $class .=
' center';
2135 if ($value ==
'public') {
2136 $class .=
' center';
2140 print
'<!-- '. $value .
' --><td class="'.$class.
'"'.($titletoshow ?
' title="'.dol_escape_htmltag($titletoshow).
'"' :
'').
'>'.$valuetoshow.
'</td>';
2150 if (isset($obj->code) && $id != 10 && $id != 42) {
2151 if (($obj->code ==
'0' || $obj->code ==
'' || preg_match(
'/unknown/i', $obj->code))) {
2152 $iserasable = 0; $canbedisabled = 0;
2153 } elseif ($obj->code ==
'RECEP') {
2154 $iserasable = 0; $canbedisabled = 0;
2155 } elseif ($obj->code ==
'EF0') {
2156 $iserasable = 0; $canbedisabled = 0;
2159 if ($id == 25 && in_array($obj->code, array(
'banner',
'blogpost',
'other',
'page'))) {
2160 $iserasable = 0; $canbedisabled = 0;
2161 if (in_array($obj->code, array(
'banner'))) {
2165 if (isset($obj->type) && in_array($obj->type, array(
'system',
'systemauto'))) {
2168 if (in_array(empty($obj->code) ?
'' : $obj->code, array(
'AC_OTH',
'AC_OTH_AUTO')) || in_array(empty($obj->type) ?
'' : $obj->type, array(
'systemauto'))) {
2169 $canbedisabled = 0; $canbedisabled = 0;
2171 $canbemodified = $iserasable;
2173 if (!empty($obj->code) && $obj->code ==
'RECEP') {
2176 if ($tabname[$id] ==
"c_actioncomm") {
2181 $rowidcol = $tabrowid[$id];
2183 if (empty($rowidcol) || in_array($id, array(6, 7, 8, 13, 17, 19, 27, 32))) {
2184 $rowidcol =
'rowid';
2186 $url = $_SERVER[
"PHP_SELF"].
'?'.($page ?
'page='.$page.
'&' :
'').
'sortfield='.$sortfield.
'&sortorder='.$sortorder.
'&rowid='.(isset($obj->{$rowidcol}) ? $obj->{$rowidcol} : (!empty($obj->code) ? urlencode($obj->code) :
'')).
'&code='.(!empty($obj->
code) ?urlencode($obj->
code) :
'');
2187 if (!empty($param)) {
2190 if (!is_null($withentity)) {
2191 $url .=
'&entity='.$withentity;
2198 print
'<td class="nowrap center">';
2201 print
'<a class="reposition" href="'.$url.
'action='.$acts[$obj->eec].
'_eec&token='.
newToken().
'">'.$actl[$obj->eec].
'</a>';
2203 print
'<span class="opacitymedium">'.$langs->trans(
"AlwaysActive").
'</span>';
2206 print
'<td class="nowrap center">';
2209 print
'<a class="reposition" href="'.$url.
'action='.$acts[$obj->favorite].
'_favorite&token='.
newToken().
'">'.$actl[$obj->favorite].
'</a>';
2211 print
'<span class="opacitymedium">'.$langs->trans(
"AlwaysActive").
'</span>';
2217 print
'<td class="nowrap center">';
2218 if ($canbedisabled) {
2219 print
'<a class="reposition" href="'.$url.
'action='.$acts[$obj->active].
'&token='.
newToken().
'">'.$actl[$obj->active].
'</a>';
2221 if (in_array($obj->code, array(
'AC_OTH',
'AC_OTH_AUTO'))) {
2222 print $langs->trans(
"AlwaysActive");
2223 } elseif (isset($obj->type) && in_array($obj->type, array(
'systemauto')) && empty($obj->active)) {
2224 print $langs->trans(
"Deprecated");
2225 } elseif (isset($obj->type) && in_array($obj->type, array(
'system')) && !empty($obj->active) && $obj->code !=
'AC_OTH') {
2226 print $langs->trans(
"UsedOnlyWithTypeOption");
2228 print
'<span class="opacitymedium">'.$langs->trans(
"AlwaysActive").
'</span>';
2234 if ($canbemodified) {
2235 print
'<td align="center"><a class="reposition editfielda" href="'.$url.
'action=edit&token='.
newToken().
'">'.
img_edit().
'</a></td>';
2237 print
'<td> </td>';
2242 print
'<td class="center">';
2244 print
'<a class="reposition" href="'.$url.
'action=delete&token='.
newToken().
'">'.
img_delete().
'</a>';
2249 print
'<td> </td>';
2270 $lastlineisempty =
false;
2272 print
'<div class="div-table-responsive-no-min">';
2273 print
'<table class="noborder centpercent">';
2274 print
'<tr class="liste_titre">';
2275 print
'<td colspan="2">'.$langs->trans(
"Dictionary").
'</td>';
2279 $showemptyline =
'';
2280 foreach ($taborder as $i) {
2281 if (isset($tabname[$i]) && empty($tabcond[$i])) {
2286 if ($showemptyline) {
2287 print
'<tr class="oddeven"><td width="50%"> </td><td> </td><td> </td></tr>';
2292 $value = $tabname[$i];
2293 print
'<tr class="oddeven"><td width="50%">';
2294 if (!empty($tabcond[$i])) {
2295 $tabnamenoprefix = preg_replace(
'/'.MAIN_DB_PREFIX.
'/',
'', $tabname[$i]);
2296 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$i.
'">';
2297 if (!empty($tabcomplete[$tabnamenoprefix][
'picto'])) {
2298 print
img_picto(
'', $tabcomplete[$tabnamenoprefix][
'picto'],
'class="pictofixedwidth paddingrightonly"');
2300 print $langs->trans($tablib[$i]);
2303 print $langs->trans($tablib[$i]);
2307 print
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$i.
'">';
2311 print
'<td class="right">';
2312 print
$form->textwithpicto(
'', $langs->trans(
"Table").
': '.MAIN_DB_PREFIX.$tabname[$i]);
2315 $lastlineisempty =
false;
2317 if (!$lastlineisempty) {
2319 $lastlineisempty =
true;
2343 function fieldList($fieldlist, $obj =
'', $tabname =
'', $context =
'')
2345 global $conf, $langs, $db, $mysoc;
2348 global $elementList, $sourceList, $localtax_typeList;
2356 foreach ($fieldlist as $field => $value) {
2357 if ($value ==
'entity') {
2358 $withentity = $obj->{$value};
2362 if (in_array($value, array(
'code',
'libelle',
'type')) && $tabname ==
"c_actioncomm" && in_array($obj->type, array(
'system',
'systemauto'))) {
2363 $hidden = (!empty($obj->{$value}) ? $obj->{$value}:
'');
2365 print
'<input type="hidden" name="'. $value .
'" value="'.$hidden.
'">';
2366 print $langs->trans($hidden);
2368 } elseif ($value ==
'country') {
2369 if (in_array(
'region_id', $fieldlist)) {
2375 $fieldname =
'country';
2376 print
$form->select_country((!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country :
'')), $fieldname,
'', 28,
'maxwidth150 maxwidthonsmartphone');
2378 } elseif ($value ==
'country_id') {
2379 if (!in_array(
'country', $fieldlist)) {
2380 $country_id = (!empty($obj->{$value}) ? $obj->{$value} : 0);
2381 print
'<td class="tdoverflowmax100">';
2382 print
'<input type="hidden" name="'. $value .
'" value="'.$country_id.
'">';
2385 } elseif ($value ==
'region') {
2387 $formcompany->select_region($region_id,
'region');
2389 } elseif ($value ==
'region_id') {
2390 $region_id = (!empty($obj->{$value}) ? $obj->{$value}:0);
2392 print
'<input type="hidden" name="'. $value .
'" value="'.$region_id.
'">';
2394 } elseif ($value ==
'lang') {
2396 print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,
'lang');
2398 } elseif (in_array($value, array(
'element',
'source'))) {
2399 $tmparray = array();
2400 if ($value ==
'element') {
2401 $tmparray = $elementList;
2403 $tmparray = $sourceList;
2406 print
$form->selectarray($value, $tmparray, (!empty($obj->{$value}) ? $obj->{$value}:
''), 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth250');
2408 } elseif (in_array($value, array(
'public',
'use_default'))) {
2410 print
'<td class="center">';
2411 print
$form->selectyesno($value, (!empty($obj->{$value}) ? $obj->{$value}:
''), 1);
2413 } elseif ($value ==
'private') {
2416 print
$form->selectyesno(
"private", (!empty($obj->{$value}) ? $obj->{$value}:
''));
2418 } elseif ($value ==
'type' && $tabname ==
"c_actioncomm") {
2419 $type = (!empty($obj->type) ? $obj->type :
'user');
2421 print $type.
'<input type="hidden" name="type" value="'.$type.
'">';
2423 } elseif ($value ==
'type' && $tabname ==
'c_paiement') {
2425 $select_list = array(0=>$langs->trans(
'PaymentTypeCustomer'), 1=>$langs->trans(
'PaymentTypeSupplier'), 2=>$langs->trans(
'PaymentTypeBoth'));
2426 print
$form->selectarray($value, $select_list, (!empty($obj->{$value}) ? $obj->{$value}:
'2'));
2428 } elseif ($value ==
'recuperableonly' || $value ==
'type_cdr' || $value ==
'deductible' || $value ==
'category_type') {
2429 if ($value ==
'type_cdr') {
2430 print
'<td class="center">';
2434 if ($value ==
'type_cdr') {
2435 print
$form->selectarray($value, array(0=>$langs->trans(
'None'), 1=>$langs->trans(
'AtEndOfMonth'), 2=>$langs->trans(
'CurrentNext')), (!empty($obj->{$value}) ? $obj->{$value}:
''));
2437 print
$form->selectyesno($value, (!empty($obj->{$value}) ? $obj->{$value}:
''), 1);
2440 } elseif (in_array($value, array(
'nbjour',
'decalage',
'taux',
'localtax1',
'localtax2'))) {
2442 if (in_array($value, array(
'taux',
'localtax1',
'localtax2'))) {
2445 print
'<td class="'.$class.
'">';
2446 print
'<input type="text" class="flat" value="'.(isset($obj->{$value}) ? $obj->{$value} :
'').
'" size="3" name="'. $value .
'">';
2448 } elseif (in_array($value, array(
'libelle_facture'))) {
2453 if ($tabname ==
'c_payment_term') {
2454 $langs->load(
"bills");
2455 $transkey =
"PaymentCondition".strtoupper($obj->code);
2456 if ($langs->trans($transkey) != $transkey) {
2458 print
$form->textwithpicto($langs->trans($transkey), $langs->trans(
"GoIntoTranslationMenuToChangeThis"));
2462 print
'<textarea cols="30" rows="'.ROWS_2.
'" class="flat" name="'. $value .
'">'.(!empty($obj->{$value}) ? $obj->{$value}:
'').
'</textarea>';
2464 print
'<input type="hidden" name="'. $value .
'" value="'.$transkey.
'">';
2467 } elseif ($value ==
'price' || preg_match(
'/^amount/i', $value)) {
2468 print
'<td><input type="text" class="flat minwidth75" value="'.price((!empty($obj->{$value}) ? $obj->{$value}:
'')).
'" name="'. $value .
'"></td>';
2469 } elseif ($value ==
'code' && isset($obj->{$value})) {
2470 print
'<td><input type="text" class="flat minwidth75 maxwidth100" value="'.(!empty($obj->{$value}) ? $obj->{$value}:
'').
'" name="'. $value .
'"></td>';
2471 } elseif ($value ==
'unit') {
2474 'mm' => $langs->trans(
'SizeUnitmm'),
2475 'cm' => $langs->trans(
'SizeUnitcm'),
2476 'point' => $langs->trans(
'SizeUnitpoint'),
2477 'inch' => $langs->trans(
'SizeUnitinch')
2479 print
$form->selectarray(
'unit', $units, (!empty($obj->{$value}) ? $obj->{$value}:
''), 0, 0, 0);
2481 } elseif ($value ==
'localtax1_type' || $value ==
'localtax2_type') {
2483 print
'<td class="center">';
2484 print
$form->selectarray($value, $localtax_typeList, (!empty($obj->{$value}) ? $obj->{$value}:
''));
2486 } elseif ($value ==
'accountancy_code' || $value ==
'accountancy_code_sell' || $value ==
'accountancy_code_buy') {
2488 if (!empty($conf->accounting->enabled)) {
2489 $fieldname = $value;
2490 $accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0);
2491 print $formaccounting->select_account($accountancy_account,
'.'. $value, 1,
'', 1, 1,
'maxwidth200 maxwidthonsmartphone');
2493 $fieldname = $value;
2494 print
'<input type="text" size="10" class="flat" value="'.(isset($obj->$fieldname) ? $obj->$fieldname :
'').
'" name="'. $value .
'">';
2497 } elseif ($value ==
'fk_tva') {
2499 print
$form->load_tva(
'fk_tva', $obj->taux, $mysoc,
new Societe($db), 0, 0,
'',
false, -1);
2501 } elseif ($value ==
'fk_c_exp_tax_cat') {
2503 print
$form->selectExpenseCategories($obj->fk_c_exp_tax_cat);
2505 } elseif ($value ==
'fk_range') {
2507 print
$form->selectExpenseRanges($obj->fk_range);
2509 } elseif ($value ==
'block_if_negative') {
2511 print
$form->selectyesno(
"block_if_negative", (!empty($obj->{$value}) ? $obj->{$value}:
''), 1);
2513 } elseif ($value ==
'type_duration') {
2515 print
$form->selectTypeDuration(
'', $obj->{$value}, array(
'i',
'h'));
2518 $fieldValue = isset($obj->{$value}) ? $obj->{$value}:
'';
2519 $classtd =
''; $class =
'';
2521 if ($value ==
'sortorder') {
2522 $fieldlist[$field] =
'position';
2525 if ($fieldlist[$field] ==
'code') {
2526 $class =
'maxwidth100';
2528 if (in_array($fieldlist[$field], array(
'deposit_percent'))) {
2529 $classtd =
'right'; $class =
'maxwidth50 right';
2531 if (in_array($fieldlist[$field], array(
'pos',
'position'))) {
2532 $classtd =
'center'; $class =
'maxwidth50 center';
2534 if (in_array($fieldlist[$field], array(
'dayrule',
'day',
'month',
'year',
'use_default',
'affect',
'delay',
'public',
'sortorder',
'sens',
'category_type',
'fk_parent'))) {
2535 $class =
'maxwidth50 center';
2537 if (in_array($fieldlist[$field], array(
'use_default',
'public',
'fk_parent'))) {
2538 $classtd =
'center';
2540 if (in_array($fieldlist[$field], array(
'libelle',
'label',
'tracking'))) {
2541 $class =
'quatrevingtpercent';
2544 if ($fieldlist[$field] ==
'fk_parent') {
2545 if (empty($fieldValue)) {
2552 if (in_array($fieldlist[$field], array(
'libelle',
'label'))) {
2554 case 'c_accounting_category':
2556 case 'c_email_senderprofile':
2557 case 'c_forme_juridique':
2558 case 'c_holiday_types':
2559 case 'c_payment_term':
2560 case 'c_transport_mode':
2561 $maxlength =
' maxlength="255"';
2563 case 'c_email_templates':
2564 $maxlength =
' maxlength="180"';
2566 case 'c_socialnetworks':
2567 $maxlength =
' maxlength="150"';
2570 $maxlength =
' maxlength="128"';
2574 print
'<td class="'.$classtd.
'">';
2577 if (in_array($fieldlist[$field], array(
'label',
'libelle'))) {
2579 if ($tabname ==
'c_civility' && !empty($obj->code)) {
2580 $transkey =
"Civility".strtoupper($obj->code);
2582 if ($tabname ==
'c_payment_term' && !empty($obj->code)) {
2583 $langs->load(
"bills");
2584 $transkey =
"PaymentConditionShort".strtoupper($obj->code);
2586 if ($transkey && $langs->trans($transkey) != $transkey) {
2588 print
$form->textwithpicto($langs->trans($transkey), $langs->trans(
"GoIntoTranslationMenuToChangeThis"));
2592 print
'<input type="text" class="flat'.($class ?
' '.$class :
'').
'"'.($maxlength ?
' '.$maxlength :
'').
' value="'.
dol_escape_htmltag($fieldValue).
'" name="'.$fieldlist[$field].
'">';
2594 print
'<input type="hidden" name="'.$fieldlist[$field].
'" value="'.$transkey.
'">';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDictionaryValue($tablename, $field, $id, $checkentity=false, $rowidfield= 'rowid')
Return the value of a filed into a dictionary for the record $id.
img_edit($titlealt= 'default', $float=0, $other= '')
Show logo editer/modifier fiche.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
complete_elementList_with_modules(&$elementList)
Search external modules to complete the list of contact element.
img_help($usehelpcursor=1, $usealttitle=1)
Show help logo with cursor "?".
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
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...
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form...
Class to manage third parties objects (customers, suppliers, prospects...)
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
print *****$script_file(".$version.") pid code
! Closing after partial payment: discount_vat, badcustomer or badsupplier, bankcharge, other ! Closing when no payment: replaced, abandoned
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin= '1', $morecss= 'hideonsmartphone', $textfordropdown= '')
Show information for admin users or standard users.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is '...
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
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...
complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tabsql, &$tabsqlsort, &$tabfield, &$tabfieldvalue, &$tabfieldinsert, &$tabrowid, &$tabcond, &$tabhelp, &$tabcomplete)
Add external modules to list of dictionaries.
if(isModEnabled('facture')&&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur')&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)&&$user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice')&&$user->rights->supplier_invoice->lire)) if(isModEnabled('don')&&!empty($user->rights->don->lire)) if(isModEnabled('tax')&&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture')&&isModEnabled('commande')&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
print_fleche_navigation($page, $file, $options= '', $nextpage=0, $betweenarrows= '', $afterarrows= '', $limit=-1, $totalnboflines=0, $hideselectlimit=0, $beforearrows= '')
Function to show navigation arrows into lists.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
isModEnabled($module)
Is Dolibarr module enabled.
Class to manage accounting accounts.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip= '', $forcenowrapcolumntitle=0)
Get title line of an array.
fieldList($fieldlist, $obj= '', $tabname= '', $context= '')
Show fields in insert/edit mode.
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous) ...
img_delete($titlealt= 'default', $other= 'class="pictodelete"', $morecss= '')
Show delete logo.