39require
'../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
49const DICT_FORME_JURIDIQUE = 1;
50const DICT_DEPARTEMENTS = 2;
51const DICT_REGIONS = 3;
52const DICT_COUNTRY = 4;
53const DICT_CIVILITY = 5;
54const DICT_ACTIONCOMM = 6;
55const DICT_CHARGESOCIALES = 7;
57const DICT_CURRENCIES = 9;
59const DICT_TYPE_CONTACT = 11;
60const DICT_PAYMENT_TERM = 12;
61const DICT_PAIEMENT = 13;
62const DICT_ECOTAXE = 14;
63const DICT_PAPER_FORMAT = 15;
64const DICT_PROSPECTLEVEL = 16;
65const DICT_TYPE_FEES = 17;
66const DICT_SHIPMENT_MODE = 18;
67const DICT_EFFECTIF = 19;
68const DICT_INPUT_METHOD = 20;
69const DICT_AVAILABILITY = 21;
70const DICT_INPUT_REASON = 22;
71const DICT_REVENUESTAMP = 23;
72const DICT_TYPE_RESOURCE = 24;
73const DICT_TYPE_CONTAINER = 25;
75const DICT_STCOMM = 27;
76const DICT_HOLIDAY_TYPES = 28;
77const DICT_LEAD_STATUS = 29;
78const DICT_FORMAT_CARDS = 30;
79const DICT_INVOICE_SUBTYPE = 31;
80const DICT_HRM_PUBLIC_HOLIDAY = 32;
81const DICT_HRM_DEPARTMENT = 33;
82const DICT_HRM_FUNCTION = 34;
83const DICT_EXP_TAX_CAT = 35;
84const DICT_EXP_TAX_RANGE = 36;
86const DICT_SOCIALNETWORKS = 38;
87const DICT_PROSPECTCONTACTLEVEL = 39;
88const DICT_STCOMMCONTACT = 40;
89const DICT_TRANSPORT_MODE = 41;
90const DICT_PRODUCT_NATURE = 42;
91const DICT_PRODUCTBATCH_QCSTATUS = 43;
92const DICT_ASSET_DISPOSAL_TYPE = 44;
95$langs->loadLangs(array(
"errors",
"admin",
"main",
"companies",
"resource",
"holiday",
"accountancy",
"hrm",
"orders",
"contracts",
"projects",
"propal",
"bills",
"interventions",
"ticket"));
97$action =
GETPOST(
'action',
'alpha') ?
GETPOST(
'action',
'alpha') :
'view';
98$confirm =
GETPOST(
'confirm',
'alpha');
101$rowid =
GETPOST(
'rowid',
'alpha');
102$entity =
GETPOST(
'entity',
'alpha');
103$code =
GETPOST(
'code',
'alpha');
104$from =
GETPOST(
'from',
'alpha');
108$acts[0] =
"activate";
110$actl[0] =
img_picto($langs->trans(
"Disabled"),
'switch_off',
'class="size15x"');
111$actl[1] =
img_picto($langs->trans(
"Activated"),
'switch_on',
'class="size15x"');
114$listoffset =
GETPOST(
'listoffset');
115$listlimit =
GETPOST(
'listlimit') > 0 ?
GETPOST(
'listlimit') : 1000;
116$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
117$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
119if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
123$offset = $listlimit * $page;
124$pageprev = $page - 1;
125$pagenext = $page + 1;
127$search_country_id =
GETPOST(
'search_country_id',
'int');
128$search_code =
GETPOST(
'search_code',
'alpha');
129$search_active =
GETPOST(
'search_active',
'alpha');
132if (!GETPOSTISSET(
'search_country_id') && $search_country_id ==
'' && ($id == DICT_DEPARTEMENTS || $id == DICT_REGIONS || $id == DICT_TVA)) {
133 $search_country_id = $mysoc->country_id;
137$hookmanager->initHooks(array(
'admin',
'dictionaryadmin'));
139$allowed = $user->admin;
140if ($id == DICT_CHARGESOCIALES && $user->hasRight(
'accounting',
'chartofaccount')) {
143if ($id == DICT_TVA && $user->hasRight(
'accounting',
'chartofaccount')) {
146if ($id == DICT_TYPE_FEES && $user->hasRight(
'accounting',
'chartofaccount')) {
153$permissiontoadd = $allowed;
160$taborder = array(DICT_CURRENCIES, DICT_PAPER_FORMAT, DICT_FORMAT_CARDS, 0, DICT_COUNTRY, DICT_REGIONS, DICT_DEPARTEMENTS, 0, DICT_FORME_JURIDIQUE, DICT_TYPENT, DICT_EFFECTIF, DICT_PROSPECTLEVEL, DICT_PROSPECTCONTACTLEVEL, DICT_STCOMM, DICT_STCOMMCONTACT, DICT_SOCIALNETWORKS, 0, DICT_CIVILITY, DICT_TYPE_CONTACT, 0, DICT_ACTIONCOMM, DICT_TYPE_RESOURCE, 0, DICT_LEAD_STATUS, 0, DICT_HRM_DEPARTMENT, DICT_HRM_FUNCTION, DICT_HRM_PUBLIC_HOLIDAY, DICT_HOLIDAY_TYPES, DICT_TYPE_FEES, DICT_EXP_TAX_CAT, DICT_EXP_TAX_RANGE, 0, DICT_TVA, DICT_INVOICE_SUBTYPE, DICT_REVENUESTAMP, DICT_PAYMENT_TERM, DICT_PAIEMENT, DICT_CHARGESOCIALES, 0, DICT_ECOTAXE, 0, DICT_INPUT_REASON, DICT_INPUT_METHOD, DICT_SHIPMENT_MODE, DICT_AVAILABILITY, DICT_TRANSPORT_MODE, 0, DICT_UNITS, DICT_PRODUCT_NATURE, 0, DICT_PRODUCTBATCH_QCSTATUS, 0, DICT_TYPE_CONTAINER, 0, DICT_ASSET_DISPOSAL_TYPE, 0);
164$tabname[DICT_FORME_JURIDIQUE] =
"c_forme_juridique";
165$tabname[DICT_DEPARTEMENTS] =
"c_departements";
166$tabname[DICT_REGIONS] =
"c_regions";
167$tabname[DICT_COUNTRY] =
"c_country";
168$tabname[DICT_CIVILITY] =
"c_civility";
169$tabname[DICT_ACTIONCOMM] =
"c_actioncomm";
170$tabname[DICT_CHARGESOCIALES] =
"c_chargesociales";
171$tabname[DICT_TYPENT] =
"c_typent";
172$tabname[DICT_CURRENCIES] =
"c_currencies";
173$tabname[DICT_TVA] =
"c_tva";
174$tabname[DICT_TYPE_CONTACT] =
"c_type_contact";
175$tabname[DICT_PAYMENT_TERM] =
"c_payment_term";
176$tabname[DICT_PAIEMENT] =
"c_paiement";
177$tabname[DICT_ECOTAXE] =
"c_ecotaxe";
178$tabname[DICT_PAPER_FORMAT] =
"c_paper_format";
179$tabname[DICT_PROSPECTLEVEL] =
"c_prospectlevel";
180$tabname[DICT_TYPE_FEES] =
"c_type_fees";
181$tabname[DICT_SHIPMENT_MODE] =
"c_shipment_mode";
182$tabname[DICT_EFFECTIF] =
"c_effectif";
183$tabname[DICT_INPUT_METHOD] =
"c_input_method";
184$tabname[DICT_AVAILABILITY] =
"c_availability";
185$tabname[DICT_INPUT_REASON] =
"c_input_reason";
186$tabname[DICT_REVENUESTAMP] =
"c_revenuestamp";
187$tabname[DICT_TYPE_RESOURCE] =
"c_type_resource";
188$tabname[DICT_TYPE_CONTAINER] =
"c_type_container";
190$tabname[DICT_STCOMM] =
"c_stcomm";
191$tabname[DICT_HOLIDAY_TYPES] =
"c_holiday_types";
192$tabname[DICT_LEAD_STATUS] =
"c_lead_status";
193$tabname[DICT_FORMAT_CARDS] =
"c_format_cards";
194$tabname[DICT_INVOICE_SUBTYPE] =
"c_invoice_subtype";
195$tabname[DICT_HRM_PUBLIC_HOLIDAY] =
"c_hrm_public_holiday";
196$tabname[DICT_HRM_DEPARTMENT] =
"c_hrm_department";
197$tabname[DICT_HRM_FUNCTION] =
"c_hrm_function";
198$tabname[DICT_EXP_TAX_CAT] =
"c_exp_tax_cat";
199$tabname[DICT_EXP_TAX_RANGE] =
"c_exp_tax_range";
200$tabname[DICT_UNITS] =
"c_units";
201$tabname[DICT_SOCIALNETWORKS] =
"c_socialnetworks";
202$tabname[DICT_PROSPECTCONTACTLEVEL] =
"c_prospectcontactlevel";
203$tabname[DICT_STCOMMCONTACT] =
"c_stcommcontact";
204$tabname[DICT_TRANSPORT_MODE] =
"c_transport_mode";
205$tabname[DICT_PRODUCT_NATURE] =
"c_product_nature";
206$tabname[DICT_PRODUCTBATCH_QCSTATUS] =
"c_productbatch_qcstatus";
207$tabname[DICT_ASSET_DISPOSAL_TYPE] =
"c_asset_disposal_type";
211$tablib[DICT_FORME_JURIDIQUE] =
"DictionaryCompanyJuridicalType";
212$tablib[DICT_DEPARTEMENTS] =
"DictionaryCanton";
213$tablib[DICT_REGIONS] =
"DictionaryRegion";
214$tablib[DICT_COUNTRY] =
"DictionaryCountry";
215$tablib[DICT_CIVILITY] =
"DictionaryCivility";
216$tablib[DICT_ACTIONCOMM] =
"DictionaryActions";
217$tablib[DICT_CHARGESOCIALES] =
"DictionarySocialContributions";
218$tablib[DICT_TYPENT] =
"DictionaryCompanyType";
219$tablib[DICT_CURRENCIES] =
"DictionaryCurrency";
220$tablib[DICT_TVA] =
"DictionaryVAT";
221$tablib[DICT_TYPE_CONTACT] =
"DictionaryTypeContact";
222$tablib[DICT_PAYMENT_TERM] =
"DictionaryPaymentConditions";
223$tablib[DICT_PAIEMENT] =
"DictionaryPaymentModes";
224$tablib[DICT_ECOTAXE] =
"DictionaryEcotaxe";
225$tablib[DICT_PAPER_FORMAT] =
"DictionaryPaperFormat";
226$tablib[DICT_PROSPECTLEVEL] =
"DictionaryProspectLevel";
227$tablib[DICT_TYPE_FEES] =
"DictionaryFees";
228$tablib[DICT_SHIPMENT_MODE] =
"DictionarySendingMethods";
229$tablib[DICT_EFFECTIF] =
"DictionaryStaff";
230$tablib[DICT_INPUT_METHOD] =
"DictionaryOrderMethods";
231$tablib[DICT_AVAILABILITY] =
"DictionaryAvailability";
232$tablib[DICT_INPUT_REASON] =
"DictionarySource";
233$tablib[DICT_REVENUESTAMP] =
"DictionaryRevenueStamp";
234$tablib[DICT_TYPE_RESOURCE] =
"DictionaryResourceType";
235$tablib[DICT_TYPE_CONTAINER] =
"DictionaryTypeOfContainer";
237$tablib[DICT_STCOMM] =
"DictionaryProspectStatus";
238$tablib[DICT_HOLIDAY_TYPES] =
"DictionaryHolidayTypes";
239$tablib[DICT_LEAD_STATUS] =
"DictionaryOpportunityStatus";
240$tablib[DICT_FORMAT_CARDS] =
"DictionaryFormatCards";
241$tablib[DICT_INVOICE_SUBTYPE] =
"DictionaryInvoiceSubtype";
242$tablib[DICT_HRM_PUBLIC_HOLIDAY] =
"DictionaryPublicHolidays";
243$tablib[DICT_HRM_DEPARTMENT] =
"DictionaryDepartment";
244$tablib[DICT_HRM_FUNCTION] =
"DictionaryFunction";
245$tablib[DICT_EXP_TAX_CAT] =
"DictionaryExpenseTaxCat";
246$tablib[DICT_EXP_TAX_RANGE] =
"DictionaryExpenseTaxRange";
247$tablib[DICT_UNITS] =
"DictionaryMeasuringUnits";
248$tablib[DICT_SOCIALNETWORKS] =
"DictionarySocialNetworks";
249$tablib[DICT_PROSPECTCONTACTLEVEL] =
"DictionaryProspectContactLevel";
250$tablib[DICT_STCOMMCONTACT] =
"DictionaryProspectContactStatus";
251$tablib[DICT_TRANSPORT_MODE] =
"DictionaryTransportMode";
252$tablib[DICT_PRODUCT_NATURE] =
"DictionaryProductNature";
253$tablib[DICT_PRODUCTBATCH_QCSTATUS] =
"DictionaryBatchStatus";
254$tablib[DICT_ASSET_DISPOSAL_TYPE] =
"DictionaryAssetDisposalType";
258$tabsql[DICT_FORME_JURIDIQUE] =
"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";
259$tabsql[DICT_DEPARTEMENTS] =
"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";
260$tabsql[DICT_REGIONS] =
"SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM ".MAIN_DB_PREFIX.
"c_regions as r, ".MAIN_DB_PREFIX.
"c_country as c WHERE r.fk_pays=c.rowid and c.active=1";
261$tabsql[DICT_COUNTRY] =
"SELECT c.rowid as rowid, c.code, c.label, c.active, c.favorite, c.eec FROM ".MAIN_DB_PREFIX.
"c_country AS c";
262$tabsql[DICT_CIVILITY] =
"SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX.
"c_civility AS c";
263$tabsql[DICT_ACTIONCOMM] =
"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";
264$tabsql[DICT_CHARGESOCIALES] =
"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";
265$tabsql[DICT_TYPENT] =
"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";
266$tabsql[DICT_CURRENCIES] =
"SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX.
"c_currencies AS c";
267$tabsql[DICT_TVA] =
"SELECT t.rowid, t.entity, t.type_vat, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX.
"c_tva as t, ".MAIN_DB_PREFIX.
"c_country as c WHERE t.fk_pays = c.rowid AND t.entity IN (".
getEntity($tabname[DICT_TVA]).
")";
268$tabsql[DICT_TYPE_CONTACT] =
"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";
269$tabsql[DICT_PAYMENT_TERM] =
"SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.deposit_percent, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX.
"c_payment_term AS c WHERE c.entity IN (".
getEntity($tabname[DICT_PAYMENT_TERM]).
")";
270$tabsql[DICT_PAIEMENT] =
"SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX.
"c_paiement AS c WHERE c.entity IN (".
getEntity($tabname[DICT_PAIEMENT]).
")";
271$tabsql[DICT_ECOTAXE] =
"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";
272$tabsql[DICT_PAPER_FORMAT] =
"SELECT t.rowid as rowid, t.code, t.label as libelle, t.width, t.height, t.unit, t.active FROM ".MAIN_DB_PREFIX.
"c_paper_format as t";
273$tabsql[DICT_PROSPECTLEVEL] =
"SELECT t.code, t.label as libelle, t.sortorder, t.active FROM ".MAIN_DB_PREFIX.
"c_prospectlevel as t";
274$tabsql[DICT_TYPE_FEES] =
"SELECT t.id as rowid, t.code, t.label, t.accountancy_code, t.active FROM ".MAIN_DB_PREFIX.
"c_type_fees as t";
275$tabsql[DICT_SHIPMENT_MODE] =
"SELECT t.rowid as rowid, t.code, t.libelle, t.tracking, t.active FROM ".MAIN_DB_PREFIX.
"c_shipment_mode as t";
276$tabsql[DICT_EFFECTIF] =
"SELECT t.id as rowid, t.code, t.libelle, t.active FROM ".MAIN_DB_PREFIX.
"c_effectif as t";
277$tabsql[DICT_INPUT_METHOD] =
"SELECT t.rowid as rowid, t.code, t.libelle, t.active FROM ".MAIN_DB_PREFIX.
"c_input_method as t";
278$tabsql[DICT_AVAILABILITY] =
"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";
279$tabsql[DICT_INPUT_REASON] =
"SELECT t.rowid as rowid, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_input_reason as t";
280$tabsql[DICT_REVENUESTAMP] =
"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";
281$tabsql[DICT_TYPE_RESOURCE] =
"SELECT t.rowid as rowid, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_type_resource as t";
282$tabsql[DICT_TYPE_CONTAINER] =
"SELECT t.rowid as rowid, t.code, t.label, t.active, t.module FROM ".MAIN_DB_PREFIX.
"c_type_container as t WHERE t.entity IN (".
getEntity($tabname[DICT_TYPE_CONTAINER]).
")";
284$tabsql[DICT_STCOMM] =
"SELECT t.id as rowid, t.code, t.libelle, t.picto, t.active FROM ".MAIN_DB_PREFIX.
"c_stcomm as t";
285$tabsql[DICT_HOLIDAY_TYPES] =
"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 WHERE h.entity IN (".
getEntity($tabname[DICT_HOLIDAY_TYPES]).
")";
286$tabsql[DICT_LEAD_STATUS] =
"SELECT t.rowid as rowid, t.code, t.label, percent, t.position, t.active FROM ".MAIN_DB_PREFIX.
"c_lead_status as t";
287$tabsql[DICT_FORMAT_CARDS] =
"SELECT t.rowid, t.code, t.name, t.paper_size, t.orientation, t.metric, t.leftmargin, t.topmargin, t.nx, t.ny, t.spacex, t.spacey, t.width, t.height, t.font_size, t.custom_x, t.custom_y, t.active FROM ".MAIN_DB_PREFIX.
"c_format_cards as t";
288$tabsql[DICT_INVOICE_SUBTYPE] =
"SELECT t.rowid, t.code, t.label, c.label as country, c.code as country_code, t.fk_country as country_id, t.active FROM ".MAIN_DB_PREFIX.
"c_invoice_subtype as t, ".MAIN_DB_PREFIX.
"c_country as c WHERE t.fk_country = c.rowid";
289$tabsql[DICT_HRM_PUBLIC_HOLIDAY] =
"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";
290$tabsql[DICT_HRM_DEPARTMENT] =
"SELECT t.rowid, t.pos, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_hrm_department as t";
291$tabsql[DICT_HRM_FUNCTION] =
"SELECT t.rowid, t.pos, t.code, t.label, t.c_level, t.active FROM ".MAIN_DB_PREFIX.
"c_hrm_function as t";
292$tabsql[DICT_EXP_TAX_CAT] =
"SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX.
"c_exp_tax_cat as c";
293$tabsql[DICT_EXP_TAX_RANGE] =
"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";
294$tabsql[DICT_UNITS] =
"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";
295$tabsql[DICT_SOCIALNETWORKS] =
"SELECT s.rowid, s.entity, s.code, s.label, s.url, s.icon, s.active FROM ".MAIN_DB_PREFIX.
"c_socialnetworks as s WHERE s.entity IN (".
getEntity($tabname[DICT_SOCIALNETWORKS]).
")";
296$tabsql[DICT_PROSPECTCONTACTLEVEL] =
"SELECT t.code, t.label as libelle, t.sortorder, t.active FROM ".MAIN_DB_PREFIX.
"c_prospectcontactlevel as t";
297$tabsql[DICT_STCOMMCONTACT] =
"SELECT t.id as rowid, t.code, t.libelle, t.picto, t.active FROM ".MAIN_DB_PREFIX.
"c_stcommcontact as t";
298$tabsql[DICT_TRANSPORT_MODE] =
"SELECT t.rowid as rowid, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_transport_mode as t";
299$tabsql[DICT_PRODUCT_NATURE] =
"SELECT t.rowid as rowid, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_product_nature as t";
300$tabsql[DICT_PRODUCTBATCH_QCSTATUS] =
"SELECT t.rowid, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_productbatch_qcstatus as t";
301$tabsql[DICT_ASSET_DISPOSAL_TYPE] =
"SELECT t.rowid, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX.
"c_asset_disposal_type as t";
304$tabsqlsort = array();
305$tabsqlsort[DICT_FORME_JURIDIQUE] =
"country ASC, code ASC";
306$tabsqlsort[DICT_DEPARTEMENTS] =
"country ASC, code ASC";
307$tabsqlsort[DICT_REGIONS] =
"country ASC, code ASC";
308$tabsqlsort[DICT_COUNTRY] =
"code ASC";
309$tabsqlsort[DICT_CIVILITY] =
"label ASC";
310$tabsqlsort[DICT_ACTIONCOMM] =
"a.type ASC, a.module ASC, a.position ASC, a.code ASC";
311$tabsqlsort[DICT_CHARGESOCIALES] =
"c.label ASC, a.code ASC, a.libelle ASC";
312$tabsqlsort[DICT_TYPENT] =
"country DESC,".(getDolGlobalString(
'SOCIETE_SORT_ON_TYPEENT') ?
' t.position ASC,' :
'').
" libelle ASC";
313$tabsqlsort[DICT_CURRENCIES] =
"label ASC";
314$tabsqlsort[DICT_TVA] =
"country ASC, code ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
315$tabsqlsort[DICT_TYPE_CONTACT] =
"t.element ASC, t.source ASC, t.position ASC, t.code ASC";
316$tabsqlsort[DICT_PAYMENT_TERM] =
"sortorder ASC, code ASC";
317$tabsqlsort[DICT_PAIEMENT] =
"code ASC";
318$tabsqlsort[DICT_ECOTAXE] =
"country ASC, e.organization ASC, code ASC";
319$tabsqlsort[DICT_PAPER_FORMAT] =
"rowid ASC";
320$tabsqlsort[DICT_PROSPECTLEVEL] =
"sortorder ASC";
321$tabsqlsort[DICT_TYPE_FEES] =
"code ASC";
322$tabsqlsort[DICT_SHIPMENT_MODE] =
"code ASC, libelle ASC";
323$tabsqlsort[DICT_EFFECTIF] =
"id ASC";
324$tabsqlsort[DICT_INPUT_METHOD] =
"code ASC, libelle ASC";
325$tabsqlsort[DICT_AVAILABILITY] =
"position ASC, type_duration ASC, qty ASC";
326$tabsqlsort[DICT_INPUT_REASON] =
"code ASC, label ASC";
327$tabsqlsort[DICT_REVENUESTAMP] =
"country ASC, taux ASC";
328$tabsqlsort[DICT_TYPE_RESOURCE] =
"code ASC, label ASC";
329$tabsqlsort[DICT_TYPE_CONTAINER] =
"t.module ASC, t.code ASC, t.label ASC";
331$tabsqlsort[DICT_STCOMM] =
"code ASC";
332$tabsqlsort[DICT_HOLIDAY_TYPES] =
"sortorder ASC, country ASC, code ASC";
333$tabsqlsort[DICT_LEAD_STATUS] =
"position ASC";
334$tabsqlsort[DICT_FORMAT_CARDS] =
"code ASC";
335$tabsqlsort[DICT_INVOICE_SUBTYPE] =
"country ASC, code ASC";
336$tabsqlsort[DICT_HRM_PUBLIC_HOLIDAY] =
"country, year ASC, month ASC, day ASC";
337$tabsqlsort[DICT_HRM_DEPARTMENT] =
"code ASC";
338$tabsqlsort[DICT_HRM_FUNCTION] =
"code ASC";
339$tabsqlsort[DICT_EXP_TAX_CAT] =
"c.label ASC";
340$tabsqlsort[DICT_EXP_TAX_RANGE] =
"r.fk_c_exp_tax_cat ASC, r.range_ik ASC";
341$tabsqlsort[DICT_UNITS] =
"sortorder ASC";
342$tabsqlsort[DICT_SOCIALNETWORKS] =
"rowid, code ASC";
343$tabsqlsort[DICT_PROSPECTCONTACTLEVEL] =
"sortorder ASC";
344$tabsqlsort[DICT_STCOMMCONTACT] =
"code ASC";
345$tabsqlsort[DICT_TRANSPORT_MODE] =
"code ASC";
346$tabsqlsort[DICT_PRODUCT_NATURE] =
"code ASC";
347$tabsqlsort[DICT_PRODUCTBATCH_QCSTATUS] =
"code ASC";
348$tabsqlsort[DICT_ASSET_DISPOSAL_TYPE] =
"code ASC";
352$tabfield[DICT_FORME_JURIDIQUE] =
"code,libelle,country";
353$tabfield[DICT_DEPARTEMENTS] =
"code,libelle,region_id,region,country";
354$tabfield[DICT_REGIONS] =
"code,libelle,country_id,country";
355$tabfield[DICT_COUNTRY] =
"code,label";
356$tabfield[DICT_CIVILITY] =
"code,label";
357$tabfield[DICT_ACTIONCOMM] =
"code,libelle,type,color,position";
358$tabfield[DICT_CHARGESOCIALES] =
"code,libelle,country,accountancy_code";
359$tabfield[DICT_TYPENT] =
"code,libelle,country_id,country".(getDolGlobalString(
'SOCIETE_SORT_ON_TYPEENT') ?
',position' :
'');
360$tabfield[DICT_CURRENCIES] =
"code,label,unicode";
361$tabfield[DICT_TVA] =
"country_id,country,type_vat,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
362$tabfield[DICT_TYPE_CONTACT] =
"element,source,code,libelle,position";
363$tabfield[DICT_PAYMENT_TERM] =
"code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder";
364$tabfield[DICT_PAIEMENT] =
"code,libelle,type";
365$tabfield[DICT_ECOTAXE] =
"code,label,price,organization,country";
366$tabfield[DICT_PAPER_FORMAT] =
"code,libelle,width,height,unit";
367$tabfield[DICT_PROSPECTLEVEL] =
"code,libelle,sortorder";
368$tabfield[DICT_TYPE_FEES] =
"code,label,accountancy_code";
369$tabfield[DICT_SHIPMENT_MODE] =
"code,libelle,tracking";
370$tabfield[DICT_EFFECTIF] =
"code,libelle";
371$tabfield[DICT_INPUT_METHOD] =
"code,libelle";
372$tabfield[DICT_AVAILABILITY] =
"code,label,qty,type_duration,position";
373$tabfield[DICT_INPUT_REASON] =
"code,label";
374$tabfield[DICT_REVENUESTAMP] =
"country_id,country,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note";
375$tabfield[DICT_TYPE_RESOURCE] =
"code,label";
376$tabfield[DICT_TYPE_CONTAINER] =
"code,label";
378$tabfield[DICT_STCOMM] =
"code,libelle,picto";
379$tabfield[DICT_HOLIDAY_TYPES] =
"code,label,affect,delay,newbymonth,country_id,country,block_if_negative,sortorder";
380$tabfield[DICT_LEAD_STATUS] =
"code,label,percent,position";
381$tabfield[DICT_FORMAT_CARDS] =
"code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
382$tabfield[DICT_INVOICE_SUBTYPE] =
"country_id,country,code,label";
383$tabfield[DICT_HRM_PUBLIC_HOLIDAY] =
"code,dayrule,year,month,day,country_id,country";
384$tabfield[DICT_HRM_DEPARTMENT] =
"code,label";
385$tabfield[DICT_HRM_FUNCTION] =
"code,label";
386$tabfield[DICT_EXP_TAX_CAT] =
"label";
387$tabfield[DICT_EXP_TAX_RANGE] =
"range_ik,fk_c_exp_tax_cat";
388$tabfield[DICT_UNITS] =
"code,label,short_label,unit_type,scale,sortorder";
389$tabfield[DICT_SOCIALNETWORKS] =
"code,label,url,icon";
390$tabfield[DICT_PROSPECTCONTACTLEVEL] =
"code,libelle,sortorder";
391$tabfield[DICT_STCOMMCONTACT] =
"code,libelle,picto";
392$tabfield[DICT_TRANSPORT_MODE] =
"code,label";
393$tabfield[DICT_PRODUCT_NATURE] =
"code,label";
394$tabfield[DICT_PRODUCTBATCH_QCSTATUS] =
"code,label";
395$tabfield[DICT_ASSET_DISPOSAL_TYPE] =
"code,label";
398$tabfieldvalue = array();
399$tabfieldvalue[DICT_FORME_JURIDIQUE] =
"code,libelle,country";
400$tabfieldvalue[DICT_DEPARTEMENTS] =
"code,libelle,region";
401$tabfieldvalue[DICT_REGIONS] =
"code,libelle,country";
402$tabfieldvalue[DICT_COUNTRY] =
"code,label";
403$tabfieldvalue[DICT_CIVILITY] =
"code,label";
404$tabfieldvalue[DICT_ACTIONCOMM] =
"code,libelle,type,color,position";
405$tabfieldvalue[DICT_CHARGESOCIALES] =
"code,libelle,country,accountancy_code";
406$tabfieldvalue[DICT_TYPENT] =
"code,libelle,country".(getDolGlobalString(
'SOCIETE_SORT_ON_TYPEENT') ?
',position' :
'');
407$tabfieldvalue[DICT_CURRENCIES] =
"code,label,unicode";
408$tabfieldvalue[DICT_TVA] =
"country,type_vat,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
409$tabfieldvalue[DICT_TYPE_CONTACT] =
"element,source,code,libelle,position";
410$tabfieldvalue[DICT_PAYMENT_TERM] =
"code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder";
411$tabfieldvalue[DICT_PAIEMENT] =
"code,libelle,type";
412$tabfieldvalue[DICT_ECOTAXE] =
"code,label,price,organization,country";
413$tabfieldvalue[DICT_PAPER_FORMAT] =
"code,libelle,width,height,unit";
414$tabfieldvalue[DICT_PROSPECTLEVEL] =
"code,libelle,sortorder";
415$tabfieldvalue[DICT_TYPE_FEES] =
"code,label,accountancy_code";
416$tabfieldvalue[DICT_SHIPMENT_MODE] =
"code,libelle,tracking";
417$tabfieldvalue[DICT_EFFECTIF] =
"code,libelle";
418$tabfieldvalue[DICT_INPUT_METHOD] =
"code,libelle";
419$tabfieldvalue[DICT_AVAILABILITY] =
"code,label,qty,type_duration,position";
420$tabfieldvalue[DICT_INPUT_REASON] =
"code,label";
421$tabfieldvalue[DICT_REVENUESTAMP] =
"country,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note";
422$tabfieldvalue[DICT_TYPE_RESOURCE] =
"code,label";
423$tabfieldvalue[DICT_TYPE_CONTAINER] =
"code,label";
425$tabfieldvalue[DICT_STCOMM] =
"code,libelle,picto";
426$tabfieldvalue[DICT_HOLIDAY_TYPES] =
"code,label,affect,delay,newbymonth,country,block_if_negative,sortorder";
427$tabfieldvalue[DICT_LEAD_STATUS] =
"code,label,percent,position";
428$tabfieldvalue[DICT_FORMAT_CARDS] =
"code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
429$tabfieldvalue[DICT_INVOICE_SUBTYPE] =
"country,code,label";
430$tabfieldvalue[DICT_HRM_PUBLIC_HOLIDAY] =
"code,dayrule,day,month,year,country";
431$tabfieldvalue[DICT_HRM_DEPARTMENT] =
"code,label";
432$tabfieldvalue[DICT_HRM_FUNCTION] =
"code,label";
433$tabfieldvalue[DICT_EXP_TAX_CAT] =
"label";
434$tabfieldvalue[DICT_EXP_TAX_RANGE] =
"range_ik,fk_c_exp_tax_cat";
435$tabfieldvalue[DICT_UNITS] =
"code,label,short_label,unit_type,scale,sortorder";
436$tabfieldvalue[DICT_SOCIALNETWORKS] =
"code,label,url,icon";
437$tabfieldvalue[DICT_PROSPECTCONTACTLEVEL] =
"code,libelle,sortorder";
438$tabfieldvalue[DICT_STCOMMCONTACT] =
"code,libelle,picto";
439$tabfieldvalue[DICT_TRANSPORT_MODE] =
"code,label";
440$tabfieldvalue[DICT_PRODUCT_NATURE] =
"code,label";
441$tabfieldvalue[DICT_PRODUCTBATCH_QCSTATUS] =
"code,label";
442$tabfieldvalue[DICT_ASSET_DISPOSAL_TYPE] =
"code,label";
445$tabfieldinsert = array();
446$tabfieldinsert[DICT_FORME_JURIDIQUE] =
"code,libelle,fk_pays";
447$tabfieldinsert[DICT_DEPARTEMENTS] =
"code_departement,nom,fk_region";
448$tabfieldinsert[DICT_REGIONS] =
"code_region,nom,fk_pays";
449$tabfieldinsert[DICT_COUNTRY] =
"code,label";
450$tabfieldinsert[DICT_CIVILITY] =
"code,label";
451$tabfieldinsert[DICT_ACTIONCOMM] =
"code,libelle,type,color,position";
452$tabfieldinsert[DICT_CHARGESOCIALES] =
"code,libelle,fk_pays,accountancy_code";
453$tabfieldinsert[DICT_TYPENT] =
"code,libelle,fk_country".(getDolGlobalString(
'SOCIETE_SORT_ON_TYPEENT') ?
',position' :
'');
454$tabfieldinsert[DICT_CURRENCIES] =
"code_iso,label,unicode";
455$tabfieldinsert[DICT_TVA] =
"fk_pays,type_vat,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note,entity";
456$tabfieldinsert[DICT_TYPE_CONTACT] =
"element,source,code,libelle,position";
457$tabfieldinsert[DICT_PAYMENT_TERM] =
"code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder,entity";
458$tabfieldinsert[DICT_PAIEMENT] =
"code,libelle,type,entity";
459$tabfieldinsert[DICT_ECOTAXE] =
"code,label,price,organization,fk_pays";
460$tabfieldinsert[DICT_PAPER_FORMAT] =
"code,label,width,height,unit";
461$tabfieldinsert[DICT_PROSPECTLEVEL] =
"code,label,sortorder";
462$tabfieldinsert[DICT_TYPE_FEES] =
"code,label,accountancy_code";
463$tabfieldinsert[DICT_SHIPMENT_MODE] =
"code,libelle,tracking";
464$tabfieldinsert[DICT_EFFECTIF] =
"code,libelle";
465$tabfieldinsert[DICT_INPUT_METHOD] =
"code,libelle";
466$tabfieldinsert[DICT_AVAILABILITY] =
"code,label,qty,type_duration,position";
467$tabfieldinsert[DICT_INPUT_REASON] =
"code,label";
468$tabfieldinsert[DICT_REVENUESTAMP] =
"fk_pays,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note";
469$tabfieldinsert[DICT_TYPE_RESOURCE] =
"code,label";
470$tabfieldinsert[DICT_TYPE_CONTAINER] =
"code,label,entity";
472$tabfieldinsert[DICT_STCOMM] =
"code,libelle,picto";
473$tabfieldinsert[DICT_HOLIDAY_TYPES] =
"code,label,affect,delay,newbymonth,fk_country,block_if_negative,sortorder,entity";
474$tabfieldinsert[DICT_LEAD_STATUS] =
"code,label,percent,position";
475$tabfieldinsert[DICT_FORMAT_CARDS] =
"code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
476$tabfieldinsert[DICT_INVOICE_SUBTYPE] =
"fk_country,code,label";
477$tabfieldinsert[DICT_HRM_PUBLIC_HOLIDAY] =
"code,dayrule,day,month,year,fk_country";
478$tabfieldinsert[DICT_HRM_DEPARTMENT] =
"code,label";
479$tabfieldinsert[DICT_HRM_FUNCTION] =
"code,label";
480$tabfieldinsert[DICT_EXP_TAX_CAT] =
"label";
481$tabfieldinsert[DICT_EXP_TAX_RANGE] =
"range_ik,fk_c_exp_tax_cat";
482$tabfieldinsert[DICT_UNITS] =
"code,label,short_label,unit_type,scale,sortorder";
483$tabfieldinsert[DICT_SOCIALNETWORKS] =
"code,label,url,icon,entity";
484$tabfieldinsert[DICT_PROSPECTCONTACTLEVEL] =
"code,label,sortorder";
485$tabfieldinsert[DICT_STCOMMCONTACT] =
"code,libelle,picto";
486$tabfieldinsert[DICT_TRANSPORT_MODE] =
"code,label";
487$tabfieldinsert[DICT_PRODUCT_NATURE] =
"code,label";
488$tabfieldinsert[DICT_PRODUCTBATCH_QCSTATUS] =
"code,label";
489$tabfieldinsert[DICT_ASSET_DISPOSAL_TYPE] =
"code,label";
495$tabrowid[DICT_FORME_JURIDIQUE] =
"";
496$tabrowid[DICT_DEPARTEMENTS] =
"";
497$tabrowid[DICT_REGIONS] =
"";
498$tabrowid[DICT_COUNTRY] =
"rowid";
499$tabrowid[DICT_CIVILITY] =
"rowid";
500$tabrowid[DICT_ACTIONCOMM] =
"id";
501$tabrowid[DICT_CHARGESOCIALES] =
"id";
502$tabrowid[DICT_TYPENT] =
"id";
503$tabrowid[DICT_CURRENCIES] =
"code_iso";
504$tabrowid[DICT_TVA] =
"";
505$tabrowid[DICT_TYPE_CONTACT] =
"rowid";
506$tabrowid[DICT_PAYMENT_TERM] =
"";
507$tabrowid[DICT_PAIEMENT] =
"id";
508$tabrowid[DICT_ECOTAXE] =
"";
509$tabrowid[DICT_PAPER_FORMAT] =
"";
510$tabrowid[DICT_PROSPECTLEVEL] =
"code";
511$tabrowid[DICT_TYPE_FEES] =
"id";
512$tabrowid[DICT_SHIPMENT_MODE] =
"rowid";
513$tabrowid[DICT_EFFECTIF] =
"id";
514$tabrowid[DICT_INPUT_METHOD] =
"";
515$tabrowid[DICT_AVAILABILITY] =
"rowid";
516$tabrowid[DICT_INPUT_REASON] =
"rowid";
517$tabrowid[DICT_REVENUESTAMP] =
"";
518$tabrowid[DICT_TYPE_RESOURCE] =
"";
519$tabrowid[DICT_TYPE_CONTAINER] =
"";
521$tabrowid[DICT_STCOMM] =
"id";
522$tabrowid[DICT_HOLIDAY_TYPES] =
"";
523$tabrowid[DICT_LEAD_STATUS] =
"";
524$tabrowid[DICT_FORMAT_CARDS] =
"";
525$tabrowid[DICT_INVOICE_SUBTYPE] =
"";
526$tabrowid[DICT_HRM_PUBLIC_HOLIDAY] =
"id";
527$tabrowid[DICT_HRM_DEPARTMENT] =
"rowid";
528$tabrowid[DICT_HRM_FUNCTION] =
"rowid";
529$tabrowid[DICT_EXP_TAX_CAT] =
"";
530$tabrowid[DICT_EXP_TAX_RANGE] =
"";
531$tabrowid[DICT_UNITS] =
"";
532$tabrowid[DICT_SOCIALNETWORKS] =
"";
533$tabrowid[DICT_PROSPECTCONTACTLEVEL] =
"code";
534$tabrowid[DICT_STCOMMCONTACT] =
"id";
535$tabrowid[DICT_TRANSPORT_MODE] =
"";
536$tabrowid[DICT_PRODUCT_NATURE] =
"rowid";
537$tabrowid[DICT_PRODUCTBATCH_QCSTATUS] =
"rowid";
538$tabrowid[DICT_ASSET_DISPOSAL_TYPE] =
"rowid";
542$tabcond[DICT_FORME_JURIDIQUE] = (isModEnabled(
"societe"));
543$tabcond[DICT_DEPARTEMENTS] =
true;
544$tabcond[DICT_REGIONS] =
true;
545$tabcond[DICT_COUNTRY] =
true;
546$tabcond[DICT_CIVILITY] = (isModEnabled(
"societe") || isModEnabled(
'member'));
547$tabcond[DICT_ACTIONCOMM] = isModEnabled(
'agenda');
548$tabcond[DICT_CHARGESOCIALES] = isModEnabled(
'tax');
549$tabcond[DICT_TYPENT] = isModEnabled(
"societe");
550$tabcond[DICT_CURRENCIES] =
true;
551$tabcond[DICT_TVA] =
true;
552$tabcond[DICT_TYPE_CONTACT] = (isModEnabled(
"societe"));
553$tabcond[DICT_PAYMENT_TERM] = (isModEnabled(
'order') || isModEnabled(
"propal") || isModEnabled(
'invoice') || isModEnabled(
"supplier_invoice") || isModEnabled(
"supplier_order"));
554$tabcond[DICT_PAIEMENT] = (isModEnabled(
'order') || isModEnabled(
"propal") || isModEnabled(
'invoice') || isModEnabled(
"supplier_invoice") || isModEnabled(
"supplier_order"));
555$tabcond[DICT_ECOTAXE] = (isModEnabled(
"product") && (isModEnabled(
'ecotax') ||
getDolGlobalString(
'MAIN_SHOW_ECOTAX_DICTIONNARY')));
556$tabcond[DICT_PAPER_FORMAT] =
true;
557$tabcond[DICT_PROSPECTLEVEL] = (isModEnabled(
"societe") && !
getDolGlobalString(
'SOCIETE_DISABLE_PROSPECTS'));
558$tabcond[DICT_TYPE_FEES] = (isModEnabled(
'deplacement') || isModEnabled(
'expensereport'));
559$tabcond[DICT_SHIPMENT_MODE] = isModEnabled(
"shipping") || isModEnabled(
"reception");
560$tabcond[DICT_EFFECTIF] = isModEnabled(
"societe");
561$tabcond[DICT_INPUT_METHOD] = isModEnabled(
"supplier_order");
562$tabcond[DICT_AVAILABILITY] = isModEnabled(
"propal");
563$tabcond[DICT_INPUT_REASON] = (isModEnabled(
'order') || isModEnabled(
"propal"));
564$tabcond[DICT_REVENUESTAMP] =
true;
565$tabcond[DICT_TYPE_RESOURCE] = isModEnabled(
'resource');
566$tabcond[DICT_TYPE_CONTAINER] = isModEnabled(
'website');
568$tabcond[DICT_STCOMM] = isModEnabled(
"societe");
569$tabcond[DICT_HOLIDAY_TYPES] = isModEnabled(
'holiday');
570$tabcond[DICT_LEAD_STATUS] = isModEnabled(
'project');
571$tabcond[DICT_FORMAT_CARDS] = (isModEnabled(
'label') || isModEnabled(
'barcode') || isModEnabled(
'member'));
572$tabcond[DICT_INVOICE_SUBTYPE] = ((isModEnabled(
'invoice') || isModEnabled(
'supplier_invoice')) && $mysoc->country_code ==
'GR');
573$tabcond[DICT_HRM_PUBLIC_HOLIDAY] = (isModEnabled(
'holiday') || isModEnabled(
'hrm'));
574$tabcond[DICT_HRM_DEPARTMENT] = isModEnabled(
'hrm');
575$tabcond[DICT_HRM_FUNCTION] = isModEnabled(
'hrm');
576$tabcond[DICT_EXP_TAX_CAT] = isModEnabled(
'expensereport') &&
getDolGlobalString(
'MAIN_USE_EXPENSE_IK');
577$tabcond[DICT_EXP_TAX_RANGE] = isModEnabled(
'expensereport') &&
getDolGlobalString(
'MAIN_USE_EXPENSE_IK');
578$tabcond[DICT_UNITS] = isModEnabled(
"product");
579$tabcond[DICT_SOCIALNETWORKS] = isModEnabled(
'socialnetworks');
580$tabcond[DICT_PROSPECTCONTACTLEVEL] = (isModEnabled(
"societe") && !
getDolGlobalString(
'SOCIETE_DISABLE_PROSPECTS') &&
getDolGlobalString(
'THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES'));
581$tabcond[DICT_STCOMMCONTACT] = (isModEnabled(
"societe") &&
getDolGlobalString(
'THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES'));
582$tabcond[DICT_TRANSPORT_MODE] = isModEnabled(
'intracommreport');
583$tabcond[DICT_PRODUCT_NATURE] = isModEnabled(
"product");
584$tabcond[DICT_PRODUCTBATCH_QCSTATUS] = isModEnabled(
"product") && isModEnabled(
'productbatch') &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') >= 2;
585$tabcond[DICT_ASSET_DISPOSAL_TYPE] = isModEnabled(
'asset');
592 'c_forme_juridique' => array(
593 'picto' =>
'company',
594 'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))
596 'c_departements' => array(
598 'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))
600 'c_regions' => array(
602 'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))
604 'c_country' => array(
'picto' =>
'country',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
605 'c_civility' => array(
'picto' =>
'contact',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
606 'c_actioncomm' => array(
'picto' =>
'action',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"),
'color' => $langs->trans(
"ColorFormat"),
'position' => $langs->trans(
"PositionIntoComboList"))),
607 'c_chargesociales' => array(
'picto' =>
'bill',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
608 'c_typent' => array(
'picto' =>
'company',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"),
'position' => $langs->trans(
"PositionIntoComboList"))),
609 'c_currencies' => array(
'picto' =>
'multicurrency',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"),
'unicode' => $langs->trans(
"UnicodeCurrency"))),
610 '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"))),
611 'c_type_contact' => array(
'picto' =>
'contact',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"),
'position' => $langs->trans(
"PositionIntoComboList"))),
612 '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")))),
613 'c_paiement' => array(
'picto' =>
'bill',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
614 'c_ecotaxe' => array(
'picto' =>
'bill',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
615 'c_paper_format' => array(
'picto' =>
'generic',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
616 'c_prospectlevel' => array(
'picto' =>
'company',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
617 'c_type_fees' => array(
'picto' =>
'trip',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
618 'c_shipment_mode' => array(
'picto' =>
'shipment',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"),
'tracking' => $langs->trans(
"UrlTrackingDesc"))),
619 'c_effectif' => array(
'picto' =>
'company',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
620 'c_input_method' => array(
'picto' =>
'order',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
621 'c_input_reason' => array(
'picto' =>
'order',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"),
'position' => $langs->trans(
"PositionIntoComboList"))),
622 'c_availability' => array(
'picto' =>
'shipment',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
623 'c_revenuestamp' => array(
'picto' =>
'bill',
'help' => array(
'revenuestamp_type' => $langs->trans(
'FixedOrPercent'))),
624 'c_type_resource' => array(
'picto' =>
'resource',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
625 'c_type_container' => array(
'picto' =>
'website',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
626 'c_stcomm' => array(
'picto' =>
'company',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"),
'picto' => $langs->trans(
"PictoHelp"))),
627 'c_holiday_types' => array(
'picto' =>
'holiday',
'help' => array(
'affect' => $langs->trans(
"FollowedByACounter"),
'delay' => $langs->trans(
"MinimumNoticePeriod"),
'newbymonth' => $langs->trans(
"NbAddedAutomatically"))),
628 'c_lead_status' => array(
'picto' =>
'project',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"),
'percent' => $langs->trans(
"OpportunityPercent"),
'position' => $langs->trans(
"PositionIntoComboList"))),
629 'c_format_cards' => array(
'picto' =>
'generic',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"),
'name' => $langs->trans(
"LabelName"),
'paper_size' => $langs->trans(
"LabelPaperSize"))),
630 '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"))),
631 'c_hrm_department' => array(
'picto' =>
'hrm',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
632 'c_hrm_function' => array(
'picto' =>
'hrm',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
633 'c_exp_tax_cat' => array(
'picto' =>
'expensereport',
'help' => array()),
634 'c_exp_tax_range' => array(
'picto' =>
'expensereport',
'help' => array(
'range_ik' => $langs->trans(
'PrevRangeToThisRange'))),
635 'c_units' => array(
'picto' =>
'product',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"),
'unit_type' => $langs->trans(
'Measuringtype_durationDesc'),
'scale' => $langs->trans(
'MeasuringScaleDesc'))),
636 'c_socialnetworks' => array(
'picto' =>
'share-alt',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"),
'url' => $langs->trans(
'UrlSocialNetworksDesc'),
'icon' => $langs->trans(
'FafaIconSocialNetworksDesc'))),
637 'c_prospectcontactlevel' => array(
'picto' =>
'company',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
638 'c_stcommcontact' => array(
'picto' =>
'company',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"),
'picto' => $langs->trans(
"PictoHelp"))),
639 'c_transport_mode' => array(
'picto' =>
'incoterm',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
640 'c_product_nature' => array(
'picto' =>
'product',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
641 'c_productbatch_qcstatus' => array(
'picto' =>
'lot',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
642 'c_asset_disposal_type' => array(
'picto' =>
'asset',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
643 'c_invoice_subtype' => array(
'picto' =>
'bill',
'help' => array(
'code' => $langs->trans(
"EnterAnyCode"))),
648complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabcomplete);
652foreach ($tabcomplete as $key => $value) {
655 if (!isset($tabcond[$i])) {
658 $tabcomplete[$key][
'id'] = $i;
660 $tabcomplete[$key][
'cond'] = $tabcond[$i];
661 $tabcomplete[$key][
'rowid'] = $tabrowid[$i];
662 $tabcomplete[$key][
'fieldinsert'] = $tabfieldinsert[$i];
663 $tabcomplete[$key][
'fieldvalue'] = $tabfieldvalue[$i];
664 $tabcomplete[$key][
'lib'] = $tablib[$i];
665 $tabcomplete[$key][
'sql'] = $tabsql[$i];
666 $tabcomplete[$key][
'sqlsort'] = $tabsqlsort[$i];
667 $tabcomplete[$key][
'field'] = $tabfield[$i];
674 $arrayofkeys = array_keys($tabcomplete);
675 if (array_key_exists($id - 1, $arrayofkeys)) {
676 $keytable = $arrayofkeys[$id - 1];
681if (empty($sortfield)) {
682 $tmp1 = explode(
',', empty($tabcomplete[$keytable][
'sqlsort']) ?
'' : $tabcomplete[$keytable][
'sqlsort']);
683 $tmp2 = explode(
' ', $tmp1[0]);
684 $sortfield = preg_replace(
'/^.*\./',
'', $tmp2[0]);
685 $sortorder = (!empty($tmp2[1]) ? $tmp2[1] :
'');
690$elementList = array();
691$sourceList = array();
692if ($id == DICT_TYPE_CONTACT) {
693 $elementList = array(
695 'agenda' =>
img_picto(
'',
'action',
'class="pictofixedwidth"').$langs->trans(
'Agenda'),
696 'dolresource' =>
img_picto(
'',
'resource',
'class="pictofixedwidth"').$langs->trans(
'Resource'),
697 'societe' =>
img_picto(
'',
'company',
'class="pictofixedwidth"').$langs->trans(
'ThirdParty'),
703 'project' =>
img_picto(
'',
'project',
'class="pictofixedwidth"').$langs->trans(
'Project'),
704 'project_task' =>
img_picto(
'',
'projecttask',
'class="pictofixedwidth"').$langs->trans(
'Task'),
705 'propal' =>
img_picto(
'',
'propal',
'class="pictofixedwidth"').$langs->trans(
'Proposal'),
706 'commande' =>
img_picto(
'',
'order',
'class="pictofixedwidth"').$langs->trans(
'Order'),
707 'facture' =>
img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
'Bill'),
708 'fichinter' =>
img_picto(
'',
'intervention',
'class="pictofixedwidth"').$langs->trans(
'InterventionCard'),
709 'contrat' =>
img_picto(
'',
'contract',
'class="pictofixedwidth"').$langs->trans(
'Contract'),
710 'ticket' =>
img_picto(
'',
'ticket',
'class="pictofixedwidth"').$langs->trans(
'Ticket'),
711 'supplier_proposal' =>
img_picto(
'',
'supplier_proposal',
'class="pictofixedwidth"').$langs->trans(
'SupplierProposal'),
712 'order_supplier' =>
img_picto(
'',
'supplier_order',
'class="pictofixedwidth"').$langs->trans(
'SupplierOrder'),
713 'invoice_supplier' =>
img_picto(
'',
'supplier_invoice',
'class="pictofixedwidth"').$langs->trans(
'SupplierBill'),
716 $elementList[
'conferenceorbooth'] =
img_picto(
'',
'eventorganization',
'class="pictofixedwidth"').$langs->trans(
'ConferenceOrBooth');
723 'internal' => $langs->trans(
'Internal'),
724 'external' => $langs->trans(
'External')
729$type_vatList = array(
730 "0" => $langs->trans(
"All"),
731 "1" => $langs->trans(
"Sell"),
732 "2" => $langs->trans(
"Buy")
736$localtax_typeList = array(
737 "0" => $langs->trans(
"No"),
738 "1" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 1)",
739 "2" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 2)",
740 "3" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 3)",
741 "4" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 4)",
742 "5" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 5)",
743 "6" => $langs->trans(
"Yes").
' ('.$langs->trans(
"Type").
" 6)"
757 'confirm' => $confirm,
759 'taborder' => $taborder,
760 'tabname' => $tabname,
763 'tabsqlsort' => $tabsqlsort,
764 'tabfield' => $tabfield,
765 'tabfieldvalue' => $tabfieldvalue,
766 'tabfieldinsert' => $tabfieldinsert,
767 'tabrowid' => $tabrowid,
768 'tabcond' => $tabcond,
769 'tabhelp' => $tabhelp,
770 'tabcomplete' => $tabcomplete
772$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
777if (
GETPOST(
'button_removefilter',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter_x',
'alpha')) {
778 $search_country_id =
'';
783if (empty($reshook)) {
786 $listfield = explode(
',', str_replace(
' ',
'', $tabfield[$id]));
787 $listfieldinsert = explode(
',', $tabfieldinsert[$id]);
788 $listfieldmodify = explode(
',', $tabfieldinsert[$id]);
789 $listfieldvalue = explode(
',', $tabfieldvalue[$id]);
793 foreach ($listfield as $f => $value) {
795 if ($value ==
'country_id' && in_array($tablib[$id], array(
'DictionaryPublicHolidays',
'DictionaryVAT',
'DictionaryInvoiceSubtype',
'DictionaryRegion',
'DictionaryCompanyType',
'DictionaryHolidayTypes',
'DictionaryRevenueStamp',
'DictionaryAccountancysystem',
'DictionaryAccountancyCategory'))) {
798 if ($value ==
'country' && in_array($tablib[$id], array(
'DictionaryPublicHolidays',
'DictionaryCanton',
'DictionaryCompanyType',
'DictionaryHolidayTypes',
'DictionaryRevenueStamp'))) {
802 if ($value ==
'localtax1' && !
GETPOST(
'localtax1_type')) {
805 if ($value ==
'localtax2' && !
GETPOST(
'localtax2_type')) {
808 if ($value ==
'color' && !
GETPOST(
'color')) {
811 if ($value ==
'formula' && !
GETPOST(
'formula')) {
814 if ($value ==
'dayrule' && !
GETPOST(
'dayrule')) {
817 if ($value ==
'sortorder') {
820 if ((!GETPOSTISSET($value) ||
GETPOST($value) ==
'')
822 !in_array($value, array(
'decalage',
'module',
'accountancy_code',
'accountancy_code_sell',
'accountancy_code_buy',
'tracking',
'picto',
'deposit_percent'))
823 && ($id != DICT_TVA || ($value !=
'code' && $value !=
'note'))
827 $fieldnamekey = $value;
829 if ($fieldnamekey ==
'libelle' || ($fieldnamekey ==
'label')) {
830 $fieldnamekey =
'Label';
832 if ($fieldnamekey ==
'libelle_facture') {
833 $fieldnamekey =
'LabelOnDocuments';
835 if ($fieldnamekey ==
'deposit_percent') {
836 $fieldnamekey =
'DepositPercent';
838 if ($fieldnamekey ==
'nbjour') {
839 $fieldnamekey =
'NbOfDays';
841 if ($fieldnamekey ==
'decalage') {
842 $fieldnamekey =
'Offset';
844 if ($fieldnamekey ==
'module') {
845 $fieldnamekey =
'Module';
847 if ($fieldnamekey ==
'code') {
848 $fieldnamekey =
'Code';
850 if ($fieldnamekey ==
'note') {
851 $fieldnamekey =
'Note';
853 if ($fieldnamekey ==
'taux') {
854 $fieldnamekey =
'Rate';
856 if ($fieldnamekey ==
'type') {
857 $fieldnamekey =
'Type';
859 if ($fieldnamekey ==
'position') {
860 $fieldnamekey =
'Position';
862 if ($fieldnamekey ==
'unicode') {
863 $fieldnamekey =
'Unicode';
865 if ($fieldnamekey ==
'deductible') {
866 $fieldnamekey =
'Deductible';
868 if ($fieldnamekey ==
'sortorder') {
869 $fieldnamekey =
'SortOrder';
871 if ($fieldnamekey ==
'category_type') {
872 $fieldnamekey =
'Calculated';
874 if ($fieldnamekey ==
'revenuestamp_type') {
875 $fieldnamekey =
'TypeOfRevenueStamp';
877 if ($fieldnamekey ==
'use_default') {
878 $fieldnamekey =
'UseByDefault';
881 setEventMessages($langs->transnoentities(
"ErrorFieldRequired", $langs->transnoentities($fieldnamekey)),
null,
'errors');
885 if (
GETPOST(
'actionadd') && $tabname[$id] ==
"c_actioncomm" && GETPOSTISSET(
"type") && in_array(
GETPOST(
"type"), array(
'system',
'systemauto'))) {
887 setEventMessages($langs->transnoentities(
'ErrorReservedTypeSystemSystemAuto'),
null,
'errors');
889 if (GETPOSTISSET(
"code")) {
892 setEventMessages($langs->transnoentities(
'ErrorCodeCantContainZero'),
null,
'errors');
895 if (GETPOSTISSET(
"country") && (
GETPOST(
"country") ==
'0') && ($id != DICT_DEPARTEMENTS)) {
896 if (in_array($tablib[$id], array(
'DictionaryCompanyType',
'DictionaryHolidayTypes'))) {
897 $_POST[
"country"] =
'';
900 setEventMessages($langs->transnoentities(
"ErrorFieldRequired", $langs->transnoentities(
"Country")),
null,
'errors');
903 if (($id == DICT_REGIONS || $id == DICT_PRODUCT_NATURE) && !is_numeric(
GETPOST(
"code")) &&
GETPOST(
'actionadd')) {
905 setEventMessages($langs->transnoentities(
"ErrorFieldMustBeANumeric", $langs->transnoentities(
"Code")),
null,
'errors');
907 if ($id == DICT_COUNTRY && strlen(
GETPOST(
"code")) != 2) {
909 setEventMessages($langs->transnoentities(
"ErrorCountryCodeMustBe2Char", $langs->transnoentities(
"Code")),
null,
'errors');
914 $_POST[
"localtax1"] =
'0';
917 $_POST[
"localtax2"] =
'0';
919 if (
GETPOST(
"accountancy_code") <= 0) {
920 $_POST[
"accountancy_code"] =
'';
922 if (
GETPOST(
"accountancy_code_sell") <= 0) {
923 $_POST[
"accountancy_code_sell"] =
'';
925 if (
GETPOST(
"accountancy_code_buy") <= 0) {
926 $_POST[
"accountancy_code_buy"] =
'';
928 if ($id == DICT_TVA && GETPOSTISSET(
"code")) {
929 $_POST[
"code"] = preg_replace(
'/[^a-zA-Z0-9_\-\+]/',
'',
GETPOST(
"code"));
932 $tablename = $tabname[$id];
933 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
936 if ($ok &&
GETPOST(
'actionadd')) {
938 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
940 $sql =
"SELECT MAX(".$tabrowid[$id].
") as newid FROM ".MAIN_DB_PREFIX.$tablename;
941 $result = $db->query($sql);
943 $obj = $db->fetch_object($result);
944 $newid = ((int) $obj->newid) + 1;
951 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.$tablename.
" (";
953 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
954 $sql .= $tabrowid[$id].
",";
956 $sql .= $tabfieldinsert[$id];
961 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
965 foreach ($listfieldinsert as $f => $value) {
966 $keycode = (isset($listfieldvalue[$i]) ? $listfieldvalue[$i] :
'');
967 if (empty($keycode)) {
971 if ($value ==
'price' || preg_match(
'/^amount/i', $value)) {
973 } elseif ($value ==
'taux' || $value ==
'localtax1') {
975 } elseif ($value ==
'entity') {
976 $_POST[$keycode] =
getEntity($tablename);
983 if ($keycode ==
'sortorder') {
985 } elseif (
GETPOST($keycode) ==
'' && !($keycode ==
'code' && $id == DICT_TVA)) {
987 } elseif ($keycode ==
'content') {
988 $sql .=
"'".$db->escape(
GETPOST($keycode,
'restricthtml')).
"'";
989 } elseif (in_array($keycode, array(
'joinfile',
'private',
'pos',
'position',
'scale',
'use_default'))) {
992 $sql .=
"'".$db->escape(
GETPOST($keycode,
'alphanohtml')).
"'";
1000 $resql = $db->query($sql);
1002 setEventMessages($langs->transnoentities(
"RecordCreatedSuccessfully"),
null,
'mesgs');
1005 if ($id == DICT_TVA &&
GETPOSTINT(
'country') > 0) {
1008 $_POST = array(
'id' => $id);
1010 if ($db->errno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
1011 setEventMessages($langs->transnoentities(
"ErrorRecordAlreadyExists"),
null,
'errors');
1019 if ($ok &&
GETPOST(
'actionmodify')) {
1020 if ($tabrowid[$id]) {
1021 $rowidcol = $tabrowid[$id];
1023 $rowidcol =
"rowid";
1027 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET ";
1029 if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
1030 $sql .= $tabrowid[$id].
"=";
1031 $sql .=
"'".$db->escape($rowid).
"', ";
1034 foreach ($listfieldmodify as $field) {
1035 $keycode = empty($listfieldvalue[$i]) ?
'' : $listfieldvalue[$i];
1036 if (empty($keycode)) {
1040 if ($field ==
'price' || preg_match(
'/^amount/i', $field)) {
1042 } elseif ($field ==
'taux' || $field ==
'localtax1') {
1044 } elseif ($field ==
'entity') {
1045 $_POST[$keycode] =
getEntity($tablename);
1052 if ($keycode ==
'sortorder') {
1054 } elseif (
GETPOST($keycode) ==
'' && !($keycode ==
'code' && $id == DICT_TVA)) {
1056 } elseif ($keycode ==
'content') {
1057 $sql .=
"'".$db->escape(
GETPOST($keycode,
'restricthtml')).
"'";
1058 } elseif (in_array($keycode, array(
'joinfile',
'private',
'pos',
'position',
'scale',
'use_default'))) {
1061 $sql .=
"'".$db->escape(
GETPOST($keycode,
'alphanohtml')).
"'";
1066 if (in_array($rowidcol, array(
'code',
'code_iso'))) {
1067 $sql .=
" WHERE ".$db->sanitize($rowidcol).
" = '".$db->escape($rowid).
"'";
1069 $sql .=
" WHERE ".$db->sanitize($rowidcol).
" = ".((int) $rowid);
1071 if (in_array(
'entity', $listfieldmodify)) {
1072 $sql .=
" AND entity = ".((int)
getEntity($tablename, 0));
1077 $resql = $db->query($sql);
1083 if (!$ok &&
GETPOST(
'actionadd')) {
1086 if (!$ok &&
GETPOST(
'actionmodify')) {
1091 if ($action ==
'confirm_delete' && $confirm ==
'yes') {
1092 if ($tabrowid[$id]) {
1093 $rowidcol = $tabrowid[$id];
1095 $rowidcol =
"rowid";
1098 $tablename = $tabname[$id];
1099 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1101 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.$tablename.
" WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1104 $result = $db->query($sql);
1106 if ($db->errno() ==
'DB_ERROR_CHILD_EXISTS') {
1107 setEventMessages($langs->transnoentities(
"ErrorRecordIsUsedByChild"),
null,
'errors');
1115 if ($action == $acts[0]) {
1116 if ($tabrowid[$id]) {
1117 $rowidcol = $tabrowid[$id];
1119 $rowidcol =
"rowid";
1122 $tablename = $tabname[$id];
1123 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1126 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 1 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1128 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 1 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1131 $result = $db->query($sql);
1138 if ($action == $acts[1]) {
1139 if ($tabrowid[$id]) {
1140 $rowidcol = $tabrowid[$id];
1142 $rowidcol =
"rowid";
1145 $tablename = $tabname[$id];
1146 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1149 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 0 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1151 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET active = 0 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1154 $result = $db->query($sql);
1161 if ($action ==
'activate_favorite') {
1162 if ($tabrowid[$id]) {
1163 $rowidcol = $tabrowid[$id];
1165 $rowidcol =
"rowid";
1168 $tablename = $tabname[$id];
1169 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1172 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 1 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1174 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 1 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1177 $result = $db->query($sql);
1184 if ($action ==
'disable_favorite') {
1185 if ($tabrowid[$id]) {
1186 $rowidcol = $tabrowid[$id];
1188 $rowidcol =
"rowid";
1191 $tablename = $tabname[$id];
1192 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1195 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 0 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1197 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET favorite = 0 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1200 $result = $db->query($sql);
1207 if ($action ==
'activate_eec') {
1208 if ($tabrowid[$id]) {
1209 $rowidcol = $tabrowid[$id];
1211 $rowidcol =
"rowid";
1214 $tablename = $tabname[$id];
1215 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1218 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 1 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1220 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 1 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1223 $result = $db->query($sql);
1230 if ($action ==
'disable_eec') {
1231 if ($tabrowid[$id]) {
1232 $rowidcol = $tabrowid[$id];
1234 $rowidcol =
"rowid";
1237 $tablename = $tabname[$id];
1238 $tablename = preg_replace(
'/^'.preg_quote(MAIN_DB_PREFIX,
'/').
'/',
'', $tablename);
1241 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 0 WHERE ".$rowidcol.
" = '".$db->escape($rowid).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1243 $sql =
"UPDATE ".MAIN_DB_PREFIX.$tablename.
" SET eec = 0 WHERE code = '".$db->escape(
dol_escape_htmltag($code)).
"'".($entity !=
'' ?
" AND entity = ".(int) $entity :
'');
1246 $result = $db->query($sql);
1258$form =
new Form($db);
1260$title = $langs->trans(
"DictionarySetup");
1262llxHeader(
'', $title,
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-dict');
1265if ($id && empty($from)) {
1266 $title .=
' - '.$langs->trans($tablib[$id]);
1267 $linkback =
'<a href="'.$_SERVER[
'PHP_SELF'].
'">'.$langs->trans(
"BackToDictionaryList").
'</a>';
1269$titlepicto =
'title_setup';
1270if ($id == DICT_TVA &&
GETPOST(
'from') ==
'accountancy') {
1271 $title = $langs->trans(
"MenuVatAccounts");
1272 $titlepicto =
'accountancy';
1274if ($id == DICT_CHARGESOCIALES &&
GETPOST(
'from') ==
'accountancy') {
1275 $title = $langs->trans(
"MenuTaxAccounts");
1276 $titlepicto =
'accountancy';
1279$param =
'&id='.urlencode((
string) ($id));
1280if ($search_country_id || GETPOSTISSET(
'page') ||
GETPOST(
'button_removefilter',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter_x',
'alpha')) {
1281 $param .=
'&search_country_id='.urlencode((
string) ($search_country_id ? $search_country_id : -1));
1283if ($search_code !=
'') {
1284 $param .=
'&search_code='.urlencode($search_code);
1286if ($search_active !=
'') {
1287 $param .=
'&search_active='.urlencode($search_active);
1290 $param .=
'&entity='.(int) $entity;
1293 $param .=
'&from='.urlencode($from);
1295$paramwithsearch = $param;
1297 $paramwithsearch .=
'&sortorder='.urlencode($sortorder);
1300 $paramwithsearch .=
'&sortfield='.urlencode($sortfield);
1303 $paramwithsearch .=
'&from='.urlencode($from);
1308if ($action ==
'delete') {
1309 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);
1315 $sqlfields = $tabsql[$id];
1317 $tablecode =
't.code';
1319 $tableprefixarray = array(DICT_FORME_JURIDIQUE =>
'f.code', DICT_DEPARTEMENTS =>
'd.code_departement', DICT_REGIONS =>
'r.code_region', DICT_COUNTRY =>
'c.code', DICT_CIVILITY =>
'c.code', DICT_ACTIONCOMM =>
'a.code', DICT_CURRENCIES =>
'code_iso', DICT_ECOTAXE =>
'e.code', DICT_HOLIDAY_TYPES =>
'h.code', DICT_CHARGESOCIALES =>
'a.code', DICT_HRM_PUBLIC_HOLIDAY =>
'a.code', DICT_UNITS =>
'r.code', DICT_SOCIALNETWORKS =>
's.code', 45 =>
'f.code', 46 =>
'f.code', 47 =>
'f.code', 48 =>
'f.code');
1320 if (!empty($tableprefixarray[$id])) {
1321 $tablecode = $tableprefixarray[$id];
1322 $tableprefix = preg_replace(
'/\..*$/',
'.', $tablecode);
1325 if (empty($tableprefix) && preg_match(
'/SELECT ([a-z]\.)rowid/i', $sqlfields, $reg)) {
1326 $tableprefix = $reg[1];
1330 if (!preg_match(
'/ WHERE /', $sql)) {
1331 $sql .=
" WHERE 1 = 1";
1333 if ($search_country_id > 0) {
1334 $sql .=
" AND c.rowid = ".((int) $search_country_id);
1336 if ($search_code !=
'') {
1339 if ($search_active ==
'yes') {
1340 $sql .=
" AND ".$db->sanitize($tableprefix).
"active = 1";
1341 } elseif ($search_active ==
'no') {
1342 $sql .=
" AND ".$db->sanitize($tableprefix).
"active = 0";
1347 $nbtotalofrecords =
'';
1350 $sqlforcount = preg_replace(
'/^.*\sFROM\s/',
'SELECT COUNT(*) as nbtotalofrecords FROM ', $sql);
1351 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
1352 $resql = $db->query($sqlforcount);
1354 $objforcount = $db->fetch_object($resql);
1355 $nbtotalofrecords = $objforcount->nbtotalofrecords;
1360 if (($page * $listlimit) > $nbtotalofrecords) {
1369 if ($sortfield ==
'country') {
1370 $sortfield =
'country_code';
1372 $sql .= $db->order($sortfield, $sortorder);
1375 $tabsqlsort[$id] = preg_replace(
'/([a-z]+\.)?'.$sortfield.
' '.$sortorder.
',/i',
'', $tabsqlsort[$id]);
1376 $tabsqlsort[$id] = preg_replace(
'/([a-z]+\.)?'.$sortfield.
',/i',
'', $tabsqlsort[$id]);
1378 $sql .=
" ORDER BY ";
1380 $sql .= $tabsqlsort[$id];
1382 $sql .= $db->plimit($listlimit + 1, $offset);
1384 $resql = $db->query($sql);
1389 $num = $db->num_rows($resql);
1393 if (empty($tabfield[$id])) {
1394 dol_print_error($db,
'The table with id '.$id.
' has no array tabfield defined');
1397 $fieldlist = explode(
',', $tabfield[$id]);
1399 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.$id.
'" method="POST">';
1400 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1401 print
'<input type="hidden" name="from" value="'.dol_escape_htmltag($from).
'">';
1405 print
info_admin($langs->trans(
"VATIsUsedIsOff", $langs->transnoentities(
"Setup"), $langs->transnoentities(
"CompanyFoundation")));
1412 $resql = $db->query($sql);
1414 $num = $db->num_rows($resql);
1417 $massactionbutton = $linkback;
1419 $newcardbutton =
'';
1424 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/admin/dict.php?action=create'.$param.
'&backtopage='.urlencode($_SERVER[
'PHP_SELF']),
'', $permissiontoadd);
1426 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'tools', 0, $newcardbutton,
'', $listlimit, 1, 0, 1);
1429 if ($action ==
'create') {
1431 if ($tabname[$id]) {
1434 $fieldlist = explode(
',', $tabfield[$id]);
1436 print
'<div class="div-table-responsive-no-min">';
1437 print
'<table class="noborder centpercent">';
1440 print
'<!-- line title to add new entry -->';
1441 $tdsoffields =
'<tr class="liste_titre">';
1442 foreach ($fieldlist as $field => $value) {
1443 if ($value ==
'entity') {
1449 $valuetoshow = ucfirst($value);
1450 $valuetoshow = $langs->trans($valuetoshow);
1453 if ($value ==
'pos') {
1454 $valuetoshow = $langs->trans(
"Position");
1457 if ($value ==
'source') {
1458 $valuetoshow = $langs->trans(
"Contact");
1460 if ($value ==
'price') {
1461 $valuetoshow = $langs->trans(
"PriceUHT");
1463 if ($value ==
'taux') {
1464 if ($tabname[$id] !=
"c_revenuestamp") {
1465 $valuetoshow = $langs->trans(
"Rate");
1467 $valuetoshow = $langs->trans(
"Amount");
1471 if ($value ==
'localtax1_type') {
1472 $valuetoshow = $langs->trans(
"UseLocalTax").
" 2";
1476 if ($value ==
'localtax1') {
1477 $valuetoshow = $langs->trans(
"RateOfTaxN",
'2');
1480 if ($value ==
'localtax2_type') {
1481 $valuetoshow = $langs->trans(
"UseLocalTax").
" 3";
1485 if ($value ==
'localtax2') {
1486 $valuetoshow = $langs->trans(
"RateOfTaxN",
'3');
1489 if ($value ==
'type_vat') {
1490 $valuetoshow = $langs->trans(
"VATType");
1492 if ($value ==
'organization') {
1493 $valuetoshow = $langs->trans(
"Organization");
1495 if ($value ==
'lang') {
1496 $valuetoshow = $langs->trans(
"Language");
1498 if ($value ==
'type') {
1499 if ($tabname[$id] ==
"c_paiement") {
1500 $valuetoshow = $form->textwithtooltip($langs->trans(
"Type"), $langs->trans(
"TypePaymentDesc"), 2, 1,
img_help(1,
''));
1502 $valuetoshow = $langs->trans(
"Type");
1505 if ($value ==
'code') {
1506 $valuetoshow = $langs->trans(
"Code");
1507 $class =
'maxwidth100';
1509 if ($value ==
'libelle' || $value ==
'label') {
1510 $valuetoshow = $form->textwithtooltip($langs->trans(
"Label"), $langs->trans(
"LabelUsedByDefault"), 2, 1,
img_help(1,
''));
1512 if ($value ==
'libelle_facture') {
1513 $valuetoshow = $form->textwithtooltip($langs->trans(
"LabelOnDocuments"), $langs->trans(
"LabelUsedByDefault"), 2, 1,
img_help(1,
''));
1515 if ($value ==
'deposit_percent') {
1516 $valuetoshow = $langs->trans(
'DepositPercent');
1519 if ($value ==
'country') {
1520 if (in_array(
'region_id', $fieldlist)) {
1524 $valuetoshow = $langs->trans(
"Country");
1526 if ($value ==
'recuperableonly') {
1527 $valuetoshow = $langs->trans(
"NPR");
1530 if ($value ==
'nbjour') {
1531 $valuetoshow = $langs->trans(
"NbOfDays");
1534 if ($value ==
'type_cdr') {
1535 $valuetoshow = $langs->trans(
"AtEndOfMonth");
1538 if ($value ==
'decalage') {
1539 $valuetoshow = $langs->trans(
"Offset");
1542 if ($value ==
'width' || $value ==
'nx') {
1543 $valuetoshow = $langs->trans(
"Width");
1545 if ($value ==
'height' || $value ==
'ny') {
1546 $valuetoshow = $langs->trans(
"Height");
1548 if ($value ==
'unit' || $value ==
'metric') {
1549 $valuetoshow = $langs->trans(
"MeasuringUnit");
1551 if ($value ==
'region_id' || $value ==
'country_id') {
1554 if ($value ==
'accountancy_code') {
1555 $valuetoshow = $langs->trans(
"AccountancyCode");
1557 if ($value ==
'accountancy_code_sell') {
1558 $valuetoshow = $langs->trans(
"AccountancyCodeSell");
1560 if ($value ==
'accountancy_code_buy') {
1561 $valuetoshow = $langs->trans(
"AccountancyCodeBuy");
1563 if ($value ==
'pcg_version' || $value ==
'fk_pcg_version') {
1564 $valuetoshow = $langs->trans(
"Pcg_version");
1566 if ($value ==
'account_parent') {
1567 $valuetoshow = $langs->trans(
"Accountparent");
1569 if ($value ==
'pcg_type') {
1570 $valuetoshow = $langs->trans(
"Pcg_type");
1572 if ($value ==
'pcg_subtype') {
1573 $valuetoshow = $langs->trans(
"Pcg_subtype");
1575 if ($value ==
'sortorder') {
1576 $valuetoshow = $langs->trans(
"SortOrder");
1579 if ($value ==
'short_label') {
1580 $valuetoshow = $langs->trans(
"ShortLabel");
1582 if ($value ==
'fk_parent') {
1583 $valuetoshow = $langs->trans(
"ParentID");
1586 if ($value ==
'range_account') {
1587 $valuetoshow = $langs->trans(
"Range");
1589 if ($value ==
'sens') {
1590 $valuetoshow = $langs->trans(
"Sens");
1592 if ($value ==
'category_type') {
1593 $valuetoshow = $langs->trans(
"Calculated");
1595 if ($value ==
'formula') {
1596 $valuetoshow = $langs->trans(
"Formula");
1598 if ($value ==
'paper_size') {
1599 $valuetoshow = $langs->trans(
"PaperSize");
1601 if ($value ==
'orientation') {
1602 $valuetoshow = $langs->trans(
"Orientation");
1604 if ($value ==
'leftmargin') {
1605 $valuetoshow = $langs->trans(
"LeftMargin");
1607 if ($value ==
'topmargin') {
1608 $valuetoshow = $langs->trans(
"TopMargin");
1610 if ($value ==
'spacex') {
1611 $valuetoshow = $langs->trans(
"SpaceX");
1613 if ($value ==
'spacey') {
1614 $valuetoshow = $langs->trans(
"SpaceY");
1616 if ($value ==
'font_size') {
1617 $valuetoshow = $langs->trans(
"FontSize");
1619 if ($value ==
'custom_x') {
1620 $valuetoshow = $langs->trans(
"CustomX");
1622 if ($value ==
'custom_y') {
1623 $valuetoshow = $langs->trans(
"CustomY");
1625 if ($value ==
'percent') {
1626 $valuetoshow = $langs->trans(
"Percentage");
1628 if ($value ==
'affect') {
1629 $valuetoshow = $langs->trans(
"WithCounter");
1631 if ($value ==
'delay') {
1632 $valuetoshow = $langs->trans(
"NoticePeriod");
1634 if ($value ==
'newbymonth') {
1635 $valuetoshow = $langs->trans(
"NewByMonth");
1637 if ($value ==
'fk_tva') {
1638 $valuetoshow = $langs->trans(
"VAT");
1640 if ($value ==
'range_ik') {
1641 $valuetoshow = $langs->trans(
"RangeIk");
1643 if ($value ==
'fk_c_exp_tax_cat') {
1644 $valuetoshow = $langs->trans(
"CarCategory");
1646 if ($value ==
'revenuestamp_type') {
1647 $valuetoshow = $langs->trans(
'TypeOfRevenueStamp');
1649 if ($value ==
'use_default') {
1650 $valuetoshow = $langs->trans(
'Default');
1653 if ($value ==
'unit_type') {
1654 $valuetoshow = $langs->trans(
'TypeOfUnit');
1656 if ($value ==
'public' && $tablib[$id] ==
'TicketDictCategory') {
1657 $valuetoshow = $langs->trans(
'TicketGroupIsPublic');
1660 if ($value ==
'block_if_negative') {
1661 $valuetoshow = $langs->trans(
'BlockHolidayIfNegative');
1663 if ($value ==
'type_duration') {
1664 $valuetoshow = $langs->trans(
'Unit');
1667 if ($id == DICT_DEPARTEMENTS) {
1668 if ($value ==
'region_id') {
1669 $valuetoshow =
' ';
1672 if ($value ==
'region') {
1673 $valuetoshow = $langs->trans(
"Country").
'/'.$langs->trans(
"Region");
1678 if ($valuetoshow !=
'') {
1679 $tooltiphelp = (isset($tabcomplete[$tabname[$id]][
'help'][$value]) ? $tabcomplete[$tabname[$id]][
'help'][$value] :
'');
1681 $tdsoffields .=
'<th'.($class ?
' class="'.$class.
'"' :
'').
'>';
1682 if ($tooltiphelp && preg_match(
'/^http(s*):/i', $tooltiphelp)) {
1683 $tdsoffields .=
'<a href="'.$tooltiphelp.
'" target="_blank">'.$valuetoshow.
' '.
img_help(1, $valuetoshow).
'</a>';
1684 } elseif ($tooltiphelp) {
1685 $tdsoffields .= $form->textwithpicto($valuetoshow, $tooltiphelp);
1687 $tdsoffields .= $valuetoshow;
1689 $tdsoffields .=
'</th>';
1693 if ($id == DICT_COUNTRY) {
1694 $tdsoffields .=
'<th></th>';
1695 $tdsoffields .=
'<th></th>';
1697 $tdsoffields .=
'<th>';
1698 $tdsoffields .=
'<input type="hidden" name="id" value="'.$id.
'">';
1699 if (!is_null($withentity)) {
1700 $tdsoffields .=
'<input type="hidden" name="entity" value="'.$withentity.
'">';
1702 $tdsoffields .=
'</th>';
1703 $tdsoffields .=
'<th style="min-width: 26px;"></th>';
1704 $tdsoffields .=
'<th style="min-width: 26px;"></th>';
1705 $tdsoffields .=
'</tr>';
1711 print
'<!-- line input to add new entry -->';
1712 print
'<tr class="oddeven nodrag nodrop nohover">';
1717 foreach ($fieldlist as $key => $val) {
1724 $tmpaction =
'create';
1725 $parameters = array(
'fieldlist' => $fieldlist,
'tabname' => $tabname[$id]);
1726 $reshook = $hookmanager->executeHooks(
'createDictionaryFieldlist', $parameters, $obj, $tmpaction);
1727 $error = $hookmanager->error;
1728 $errors = $hookmanager->errors;
1730 if ($id == DICT_REGIONS) {
1731 unset($fieldlist[2]);
1734 if (empty($reshook)) {
1735 fieldList($fieldlist, $obj, $tabname[$id],
'add');
1738 if ($id == DICT_COUNTRY) {
1742 print
'<td colspan="3" class="center">';
1743 if ($action !=
'edit') {
1744 print
'<input type="submit" class="button button-add small" name="actionadd" value="'.$langs->trans(
"Add").
'">';
1746 print
'<input type="submit" class="button button-add small disabled" name="actionadd" value="'.$langs->trans(
"Add").
'">';
1758 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.$id.
'" method="POST">';
1759 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1760 print
'<input type="hidden" name="from" value="'.dol_escape_htmltag(
GETPOST(
'from',
'alpha')).
'">';
1765 foreach ($fieldlist as $field => $value) {
1766 if ($value ==
'entity') {
1771 if ($value ==
'region_id' || $value ==
'country_id') {
1776 if ($value ==
'country') {
1778 } elseif ($value ==
'code') {
1784 print
'<div class="div-table-responsive">';
1785 print
'<table class="noborder centpercent">';
1790 print
'<!-- line title to search record -->'.
"\n";
1791 print
'<tr class="liste_titre_filter">';
1795 print
'<td class="liste_titre center">';
1797 $searchpicto = $form->showFilterAndCheckAddButtons(0);
1804 foreach ($fieldlist as $field => $value) {
1805 if ($value ==
'entity') {
1810 if ($value ==
'region_id' || $value ==
'country_id') {
1815 if ($value ==
'country') {
1816 print
'<td class="liste_titre">';
1817 print $form->select_country($search_country_id,
'search_country_id',
'', 28,
'minwidth100 maxwidth150 maxwidthonsmartphone',
'',
' ');
1820 } elseif ($value ==
'code') {
1821 print
'<td class="liste_titre">';
1822 print
'<input type="text" class="maxwidth100" name="search_code" value="'.dol_escape_htmltag($search_code).
'">';
1826 print
'<td class="liste_titre">';
1832 if ($id == DICT_COUNTRY) {
1840 print
'<td class="liste_titre center">';
1841 print $form->selectyesno(
'search_active', $search_active, 0,
false, 1);
1847 print
'<td class="liste_titre center">';
1849 $searchpicto = $form->showFilterAndCheckAddButtons(0);
1859 print
'<!-- line title of record -->'.
"\n";
1860 print
'<tr class="liste_titre">';
1867 foreach ($fieldlist as $field => $value) {
1868 if ($value ==
'entity') {
1872 if (in_array($value, array(
'label',
'libelle',
'libelle_facture')) && empty($tabcomplete[$tabname[$id]][
'help'][$value])) {
1873 if (!isset($tabcomplete[$tabname[$id]][
'help']) || !is_array($tabcomplete[$tabname[$id]][
'help'])) {
1874 $tabcomplete[$tabname[$id]][
'help'] = array();
1876 $tabcomplete[$tabname[$id]][
'help'][$value] = $langs->trans(
'LabelUsedByDefault');
1884 $valuetoshow = ucfirst($value);
1885 $valuetoshow = $langs->trans($valuetoshow);
1888 if ($value ==
'source') {
1889 $valuetoshow = $langs->trans(
"Contact");
1891 if ($value ==
'price') {
1892 $valuetoshow = $langs->trans(
"PriceUHT");
1894 if ($value ==
'taux') {
1895 if ($tabname[$id] !=
"c_revenuestamp") {
1896 $valuetoshow = $langs->trans(
"Rate");
1898 $valuetoshow = $langs->trans(
"Amount");
1900 $cssprefix =
'center ';
1903 if ($value ==
'type_vat') {
1904 $valuetoshow = $langs->trans(
"VATType");
1905 $cssprefix =
"center ";
1908 if ($value ==
'localtax1_type') {
1909 $valuetoshow = $langs->trans(
"UseLocalTax").
" 2";
1910 $cssprefix =
"center ";
1913 if ($value ==
'localtax1') {
1914 $valuetoshow = $langs->trans(
"RateOfTaxN",
'2');
1915 $cssprefix =
"center ";
1918 if ($value ==
'localtax2_type') {
1919 $valuetoshow = $langs->trans(
"UseLocalTax").
" 3";
1920 $cssprefix =
"center ";
1923 if ($value ==
'localtax2') {
1924 $valuetoshow = $langs->trans(
"RateOfTaxN",
'3');
1925 $cssprefix =
"center ";
1928 if ($value ==
'organization') {
1929 $valuetoshow = $langs->trans(
"Organization");
1931 if ($value ==
'lang') {
1932 $valuetoshow = $langs->trans(
"Language");
1934 if ($value ==
'type') {
1935 $valuetoshow = $langs->trans(
"Type");
1937 if ($value ==
'code') {
1938 $valuetoshow = $langs->trans(
"Code");
1940 if (in_array($value, array(
'pos',
'position'))) {
1941 $valuetoshow = $langs->trans(
"Position");
1942 $cssprefix =
'right ';
1944 if ($value ==
'libelle' || $value ==
'label') {
1945 $valuetoshow = $langs->trans(
"Label");
1947 if ($value ==
'libelle_facture') {
1948 $valuetoshow = $langs->trans(
"LabelOnDocuments");
1950 if ($value ==
'deposit_percent') {
1951 $valuetoshow = $langs->trans(
'DepositPercent');
1952 $cssprefix =
'right ';
1954 if ($value ==
'country') {
1955 $valuetoshow = $langs->trans(
"Country");
1957 if ($value ==
'recuperableonly') {
1958 $valuetoshow = $langs->trans(
"NPR");
1959 $cssprefix =
"center ";
1961 if ($value ==
'nbjour') {
1962 $valuetoshow = $langs->trans(
"NbOfDays");
1963 $cssprefix =
'right ';
1965 if ($value ==
'type_cdr') {
1966 $valuetoshow = $langs->trans(
"AtEndOfMonth");
1967 $cssprefix =
"center ";
1969 if ($value ==
'decalage') {
1970 $valuetoshow = $langs->trans(
"Offset");
1971 $cssprefix =
'right ';
1973 if ($value ==
'width' || $value ==
'nx') {
1974 $valuetoshow = $langs->trans(
"Width");
1976 if ($value ==
'height' || $value ==
'ny') {
1977 $valuetoshow = $langs->trans(
"Height");
1979 if ($value ==
'unit' || $value ==
'metric') {
1980 $valuetoshow = $langs->trans(
"MeasuringUnit");
1982 if ($value ==
'accountancy_code') {
1983 $valuetoshow = $langs->trans(
"AccountancyCode");
1985 if ($value ==
'accountancy_code_sell') {
1986 $valuetoshow = $langs->trans(
"AccountancyCodeSell");
1989 if ($value ==
'accountancy_code_buy') {
1990 $valuetoshow = $langs->trans(
"AccountancyCodeBuy");
1993 if ($value ==
'fk_pcg_version') {
1994 $valuetoshow = $langs->trans(
"Pcg_version");
1996 if ($value ==
'account_parent') {
1997 $valuetoshow = $langs->trans(
"Accountsparent");
1999 if ($value ==
'pcg_type') {
2000 $valuetoshow = $langs->trans(
"Pcg_type");
2002 if ($value ==
'pcg_subtype') {
2003 $valuetoshow = $langs->trans(
"Pcg_subtype");
2005 if ($value ==
'sortorder') {
2006 $valuetoshow = $langs->trans(
"SortOrder");
2007 $cssprefix =
'center ';
2009 if ($value ==
'short_label') {
2010 $valuetoshow = $langs->trans(
"ShortLabel");
2012 if ($value ==
'fk_parent') {
2013 $valuetoshow = $langs->trans(
"ParentID");
2014 $cssprefix =
'center ';
2016 if ($value ==
'range_account') {
2017 $valuetoshow = $langs->trans(
"Range");
2019 if ($value ==
'sens') {
2020 $valuetoshow = $langs->trans(
"Sens");
2022 if ($value ==
'category_type') {
2023 $valuetoshow = $langs->trans(
"Calculated");
2025 if ($value ==
'formula') {
2026 $valuetoshow = $langs->trans(
"Formula");
2028 if ($value ==
'paper_size') {
2029 $valuetoshow = $langs->trans(
"PaperSize");
2031 if ($value ==
'orientation') {
2032 $valuetoshow = $langs->trans(
"Orientation");
2034 if ($value ==
'leftmargin') {
2035 $valuetoshow = $langs->trans(
"LeftMargin");
2037 if ($value ==
'topmargin') {
2038 $valuetoshow = $langs->trans(
"TopMargin");
2040 if ($value ==
'spacex') {
2041 $valuetoshow = $langs->trans(
"SpaceX");
2043 if ($value ==
'spacey') {
2044 $valuetoshow = $langs->trans(
"SpaceY");
2046 if ($value ==
'font_size') {
2047 $valuetoshow = $langs->trans(
"FontSize");
2049 if ($value ==
'custom_x') {
2050 $valuetoshow = $langs->trans(
"CustomX");
2052 if ($value ==
'custom_y') {
2053 $valuetoshow = $langs->trans(
"CustomY");
2055 if ($value ==
'percent') {
2056 $valuetoshow = $langs->trans(
"Percentage");
2058 if ($value ==
'affect') {
2059 $valuetoshow = $langs->trans(
"WithCounter");
2061 if ($value ==
'delay') {
2062 $valuetoshow = $langs->trans(
"NoticePeriod");
2064 if ($value ==
'newbymonth') {
2065 $valuetoshow = $langs->trans(
"NewByMonth");
2067 if ($value ==
'fk_tva') {
2068 $valuetoshow = $langs->trans(
"VAT");
2070 if ($value ==
'range_ik') {
2071 $valuetoshow = $langs->trans(
"RangeIk");
2073 if ($value ==
'fk_c_exp_tax_cat') {
2074 $valuetoshow = $langs->trans(
"CarCategory");
2076 if ($value ==
'revenuestamp_type') {
2077 $valuetoshow = $langs->trans(
'TypeOfRevenueStamp');
2079 if ($value ==
'use_default') {
2080 $valuetoshow = $langs->trans(
'Default');
2081 $cssprefix =
'center ';
2083 if ($value ==
'unit_type') {
2084 $valuetoshow = $langs->trans(
'TypeOfUnit');
2086 if ($value ==
'public' && $tablib[$id] ==
'TicketDictCategory') {
2087 $valuetoshow = $langs->trans(
'TicketGroupIsPublic');
2088 $cssprefix =
'center ';
2090 if ($value ==
'block_if_negative') {
2091 $valuetoshow = $langs->trans(
'BlockHolidayIfNegative');
2093 if ($value ==
'type_duration') {
2094 $valuetoshow = $langs->trans(
'Unit');
2097 if ($value ==
'region_id' || $value ==
'country_id') {
2103 $tooltiphelp = (isset($tabcomplete[$tabname[$id]][
'help'][$value]) ? $tabcomplete[$tabname[$id]][
'help'][$value] :
'');
2105 if ($tooltiphelp && preg_match(
'/^http(s*):/i', $tooltiphelp)) {
2106 $newvaluetoshow =
'<a href="'.$tooltiphelp.
'" target="_blank">'.$valuetoshow.
' '.
img_help(1, $valuetoshow).
'</a>';
2107 } elseif ($tooltiphelp) {
2108 $newvaluetoshow = $form->textwithpicto($valuetoshow, $tooltiphelp);
2110 $newvaluetoshow = $valuetoshow;
2113 print
getTitleFieldOfList($newvaluetoshow, 0, $_SERVER[
"PHP_SELF"], ($sortable ? $value :
''), ($page ?
'page='.$page.
'&' :
''), $param,
'', $sortfield, $sortorder, $cssprefix);
2117 if ($id == DICT_COUNTRY) {
2118 print
getTitleFieldOfList($langs->trans(
"InEEC"), 0, $_SERVER[
"PHP_SELF"],
"eec", ($page ?
'page='.$page.
'&' :
''), $param,
'align="center"', $sortfield, $sortorder,
'', 0, $langs->trans(
"CountryIsInEEC"));
2119 print
getTitleFieldOfList($langs->trans(
"Favorite"), 0, $_SERVER[
"PHP_SELF"],
"favorite", ($page ?
'page='.$page.
'&' :
''), $param,
'align="center"', $sortfield, $sortorder);
2123 print
getTitleFieldOfList($langs->trans(
"Status"), 0, $_SERVER[
"PHP_SELF"],
"active", ($page ?
'page='.$page.
'&' :
''), $param,
'align="center"', $sortfield, $sortorder);
2134 $obj = $db->fetch_object($resql);
2139 if ($id == DICT_COUNTRY) {
2140 if ($obj->code ==
'') {
2150 if (isset($obj->code) && $id != 10 && $id != 42) {
2151 if (($obj->code ==
'0' || $obj->code ==
'' || preg_match(
'/unknown/i', $obj->code))) {
2154 } elseif ($obj->code ==
'RECEP') {
2157 } elseif ($obj->code ==
'EF0') {
2162 if ($id == DICT_TYPE_CONTAINER && in_array($obj->code, array(
'banner',
'blogpost',
'menu',
'page',
'other',
'service',
'library'))) {
2165 if (in_array($obj->code, array(
'banner'))) {
2169 if (isset($obj->type) && in_array($obj->type, array(
'system',
'systemauto'))) {
2172 if (in_array(empty($obj->code) ?
'' : $obj->code, array(
'AC_OTH',
'AC_OTH_AUTO')) || in_array(empty($obj->
type) ?
'' : $obj->
type, array(
'systemauto'))) {
2176 $canbemodified = $iserasable;
2178 if (!empty($obj->code) && $obj->code ==
'RECEP') {
2181 if ($tabname[$id] ==
"c_actioncomm") {
2185 if ($tabname[$id] ==
"c_product_nature" && in_array($obj->code, array(0, 1))) {
2191 $rowidcol = empty($tabrowid[$id]) ?
'rowid' : $tabrowid[$id];
2193 if (empty($rowidcol) || in_array($id, array(DICT_ACTIONCOMM, DICT_CHARGESOCIALES, DICT_TYPENT, DICT_PAIEMENT, DICT_TYPE_FEES, DICT_EFFECTIF, DICT_STCOMM, DICT_HRM_PUBLIC_HOLIDAY))) {
2194 $rowidcol =
'rowid';
2196 $url = $_SERVER[
"PHP_SELF"].
'?'.($page ?
'page='.$page.
'&' :
'').
'sortfield='.$sortfield.
'&sortorder='.$sortorder;
2197 $url .=
'&rowid='.(isset($obj->$rowidcol) ? $obj->$rowidcol : (!empty($obj->code) ? urlencode($obj->code) :
''));
2198 $url .=
'&code='.(!empty($obj->code) ? urlencode($obj->code) :
'');
2199 if (!empty($param)) {
2202 if (!is_null($withentity)) {
2203 $url .=
'&entity='.$withentity;
2209 print
'<tr class="oddeven" id="rowid-'.(empty($obj->rowid) ?
'' : $obj->rowid).
'">';
2213 print
'<td class="center maxwidthsearch nowraponall">';
2215 if ($canbemodified) {
2216 print
'<a class="reposition editfielda marginleftonly paddingleft marginrightonly paddingright" href="'.$url.
'action=edit&token='.
newToken().
'">'.
img_edit().
'</a>';
2221 print
'<a class="reposition marginleftonly paddingleft marginrightonly paddingright" href="'.$url.
'action=delete&token='.
newToken().
'">'.
img_delete().
'</a>';
2227 if ($action ==
'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
2228 $tmpaction =
'edit';
2229 $parameters = array(
'fieldlist' => $fieldlist,
'tabname' => $tabname[$id]);
2230 $reshook = $hookmanager->executeHooks(
'editDictionaryFieldlist', $parameters, $obj, $tmpaction);
2231 $error = $hookmanager->error;
2232 $errors = $hookmanager->errors;
2235 if (empty($reshook)) {
2236 $withentity =
fieldList($fieldlist, $obj, $tabname[$id],
'edit');
2239 print
'<td colspan="3" class="center">';
2240 print
'<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).
'"></div>';
2241 print
'<input type="hidden" name="page" value="'.dol_escape_htmltag($page).
'">';
2242 print
'<input type="hidden" name="rowid" value="'.dol_escape_htmltag($rowid).
'">';
2243 if (!is_null($withentity)) {
2244 print
'<input type="hidden" name="entity" value="'.$withentity.
'">';
2246 print
'<input type="submit" class="button button-edit smallpaddingimp" name="actionmodify" value="'.$langs->trans(
"Modify").
'">';
2247 print
'<input type="submit" class="button button-cancel smallpaddingimp" name="actioncancel" value="'.$langs->trans(
"Cancel").
'">';
2250 $tmpaction =
'view';
2251 $parameters = array(
'fieldlist' => $fieldlist,
'tabname' => $tabname[$id]);
2252 $reshook = $hookmanager->executeHooks(
'viewDictionaryFieldlist', $parameters, $obj, $tmpaction);
2254 $error = $hookmanager->error;
2255 $errors = $hookmanager->errors;
2257 if (empty($reshook)) {
2260 foreach ($fieldlist as $field => $value) {
2264 $valuetoshow = empty($obj->$value) ?
'' : $obj->$value;
2267 if ($value ==
'entity') {
2268 $withentity = $valuetoshow;
2272 if ($value ==
'element') {
2273 $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
2274 } elseif ($value ==
'source') {
2275 $valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow;
2276 } elseif ($valuetoshow ==
'all') {
2277 $valuetoshow = $langs->trans(
'All');
2278 } elseif ($value ==
'country') {
2279 if (empty($obj->country_code)) {
2282 $key = $langs->trans(
"Country".strtoupper($obj->country_code));
2283 $valuetoshow = ($key !=
"Country".strtoupper($obj->country_code) ? $obj->country_code.
" - ".$key : $obj->country);
2285 } elseif ($value ==
'recuperableonly' || $value ==
'deductible' || $value ==
'category_type') {
2286 $valuetoshow =
yn($valuetoshow ? 1 : 0);
2288 } elseif ($value ==
'type_cdr') {
2289 if (empty($valuetoshow)) {
2290 $valuetoshow = $langs->trans(
'None');
2291 } elseif ($valuetoshow == 1) {
2292 $valuetoshow = $langs->trans(
'AtEndOfMonth');
2293 } elseif ($valuetoshow == 2) {
2294 $valuetoshow = $langs->trans(
'CurrentNext');
2297 } elseif ($value ==
'price' || preg_match(
'/^amount/i', $value)) {
2298 $valuetoshow =
price($valuetoshow);
2300 if (in_array($value, array(
'private',
'joinfile',
'use_default'))) {
2302 $valuetoshow =
yn($valuetoshow);
2304 } elseif ($value ==
'libelle_facture') {
2305 $langs->load(
"bills");
2306 $key = $langs->trans(
"PaymentCondition".strtoupper($obj->code));
2307 $valuetoshow = ($obj->code && $key !=
"PaymentCondition".strtoupper($obj->code) ? $key : $obj->$value);
2308 $valuetoshow = nl2br($valuetoshow);
2309 } elseif ($value ==
'label' && $tabname[$id] ==
'c_country') {
2310 $key = $langs->trans(
"Country".strtoupper($obj->code));
2311 $valuetoshow = ($obj->code && $key !=
"Country".strtoupper($obj->code) ? $key : $obj->$value);
2312 } elseif ($value ==
'label' && $tabname[$id] ==
'c_availability') {
2313 $langs->load(
"propal");
2314 $key = $langs->trans(
"AvailabilityType".strtoupper($obj->code));
2315 $valuetoshow = ($obj->code && $key !=
"AvailabilityType".strtoupper($obj->code) ? $key : $obj->$value);
2316 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_actioncomm') {
2317 $key = $langs->trans(
"Action".strtoupper($obj->code));
2318 $valuetoshow = ($obj->code && $key !=
"Action".strtoupper($obj->code) ? $key : $obj->$value);
2319 } elseif (!empty($obj->code_iso) && $value ==
'label' && $tabname[$id] ==
'c_currencies') {
2320 $key = $langs->trans(
"Currency".strtoupper($obj->code_iso));
2321 $valuetoshow = ($obj->code_iso && $key !=
"Currency".strtoupper($obj->code_iso) ? $key : $obj->$value);
2322 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_typent') {
2323 $key = $langs->trans(strtoupper($obj->code));
2324 $valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->$value);
2325 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_prospectlevel') {
2326 $key = $langs->trans(strtoupper($obj->code));
2327 $valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->$value);
2328 } elseif ($value ==
'label' && $tabname[$id] ==
'c_civility') {
2329 $key = $langs->trans(
"Civility".strtoupper($obj->code));
2330 $valuetoshow = ($obj->code && $key !=
"Civility".strtoupper($obj->code) ? $key : $obj->$value);
2331 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_type_contact') {
2332 $langs->load(
'agenda');
2333 $key = $langs->trans(
"TypeContact_".$obj->element.
"_".$obj->source.
"_".strtoupper($obj->code));
2334 $valuetoshow = ($obj->code && $key !=
"TypeContact_".$obj->element.
"_".$obj->source.
"_".strtoupper($obj->code) ? $key : $obj->$value);
2335 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_payment_term') {
2336 $langs->load(
"bills");
2337 $key = $langs->trans(
"PaymentConditionShort".strtoupper($obj->code));
2338 $valuetoshow = ($obj->code && $key !=
"PaymentConditionShort".strtoupper($obj->code) ? $key : $obj->$value);
2339 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_paiement') {
2340 $langs->load(
"bills");
2341 $key = $langs->trans(
"PaymentType".strtoupper($obj->code));
2342 $valuetoshow = ($obj->code && $key !=
"PaymentType".strtoupper($obj->code) ? $key : $obj->$value);
2343 } elseif ($value ==
'type' && $tabname[$id] ==
'c_paiement') {
2344 $payment_type_list = array(0 => $langs->trans(
'PaymentTypeCustomer'), 1 => $langs->trans(
'PaymentTypeSupplier'), 2 => $langs->trans(
'PaymentTypeBoth'));
2345 $valuetoshow = $payment_type_list[$valuetoshow];
2346 } elseif ($value ==
'label' && $tabname[$id] ==
'c_input_reason') {
2347 $key = $langs->trans(
"DemandReasonType".strtoupper($obj->code));
2348 $valuetoshow = ($obj->code && $key !=
"DemandReasonType".strtoupper($obj->code) ? $key : $obj->$value);
2349 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_input_method') {
2350 $langs->load(
"orders");
2351 $key = $langs->trans($obj->code);
2352 $valuetoshow = ($obj->code && $key != $obj->code) ? $key : $obj->$value;
2353 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_shipment_mode') {
2354 $langs->load(
"sendings");
2355 $key = $langs->trans(
"SendingMethod".strtoupper($obj->code));
2356 $valuetoshow = ($obj->code && $key !=
"SendingMethod".strtoupper($obj->code) ? $key : $obj->$value);
2357 } elseif ($value ==
'libelle' && $tabname[$id] ==
'c_paper_format') {
2358 $key = $langs->trans(
'PaperFormat'.strtoupper($obj->code));
2359 $valuetoshow = ($obj->code && $key !=
'PaperFormat'.strtoupper($obj->code) ? $key : $obj->$value);
2360 } elseif ($value ==
'label' && $tabname[$id] ==
'c_type_fees') {
2361 $langs->load(
'trips');
2362 $key = $langs->trans(strtoupper($obj->code));
2363 $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->$value);
2364 } elseif ($value ==
'region_id' || $value ==
'country_id') {
2366 } elseif ($value ==
'unicode') {
2367 $valuetoshow = $langs->getCurrencySymbol($obj->code, 1);
2368 } elseif ($value ==
'label' && $tabname[
GETPOSTINT(
"id")] ==
'c_units') {
2369 $langs->load(
"products");
2370 $valuetoshow = $langs->trans($obj->$value);
2371 } elseif ($value ==
'short_label' && $tabname[
GETPOSTINT(
"id")] ==
'c_units') {
2372 $langs->load(
"products");
2373 $valuetoshow = $langs->trans($obj->$value);
2374 } elseif (($value ==
'unit') && ($tabname[$id] ==
'c_paper_format')) {
2375 $key = $langs->trans(
'SizeUnit'.strtolower($obj->unit));
2376 $valuetoshow = ($obj->code && $key !=
'SizeUnit'.strtolower($obj->unit) ? $key : $obj->$value);
2377 } elseif ($value ==
'localtax1' || $value ==
'localtax2') {
2379 } elseif ($value ==
'type_vat') {
2380 if ($obj->type_vat != 0) {
2381 $valuetoshow = $type_vatList[$valuetoshow];
2383 $valuetoshow = $langs->transnoentitiesnoconv(
"All");
2386 } elseif ($value ==
'localtax1_type') {
2387 if ($obj->localtax1 != 0) {
2388 $valuetoshow = $localtax_typeList[$valuetoshow];
2393 } elseif ($value ==
'localtax2_type') {
2394 if ($obj->localtax2 != 0) {
2395 $valuetoshow = $localtax_typeList[$valuetoshow];
2400 } elseif ($value ==
'taux') {
2401 $valuetoshow =
price($valuetoshow, 0, $langs, 0, 0);
2403 } elseif (in_array($value, array(
'recuperableonly'))) {
2405 } elseif ($value ==
'accountancy_code' || $value ==
'accountancy_code_sell' || $value ==
'accountancy_code_buy') {
2406 if (isModEnabled(
'accounting')) {
2407 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
2409 $tmpaccountingaccount->fetch(0, $valuetoshow, 1);
2410 $titletoshow = $langs->transnoentitiesnoconv(
"Pcgtype").
': '.$tmpaccountingaccount->pcg_type;
2413 } elseif ($value ==
'fk_tva') {
2414 foreach ($form->cache_vatrates as $key => $Tab) {
2415 if ($form->cache_vatrates[$key][
'rowid'] == $valuetoshow) {
2416 $valuetoshow = $form->cache_vatrates[$key][
'label'];
2420 } elseif ($value ==
'fk_c_exp_tax_cat') {
2421 $tmpid = $valuetoshow;
2423 $valuetoshow = $langs->trans($valuetoshow ? $valuetoshow : $tmpid);
2424 } elseif ($tabname[$id] ==
'c_exp_tax_cat') {
2425 $valuetoshow = $langs->trans($valuetoshow);
2426 } elseif ($value ==
'label' && $tabname[$id] ==
'c_units') {
2427 $langs->load(
'other');
2428 $key = $langs->trans($obj->label);
2429 $valuetoshow = ($obj->label && $key != strtoupper($obj->label) ? $key : $obj->{$value});
2430 } elseif ($value ==
'label' && $tabname[$id] ==
'c_product_nature') {
2431 $langs->load(
"products");
2432 $valuetoshow = $langs->trans($obj->{$value});
2433 } elseif ($fieldlist[$field] ==
'label' && $tabname[$id] ==
'c_productbatch_qcstatus') {
2434 $langs->load(
"productbatch");
2435 $valuetoshow = $langs->trans($obj->{$value});
2436 } elseif ($value ==
'block_if_negative') {
2437 $valuetoshow =
yn($obj->{$value});
2438 } elseif ($value ==
'icon') {
2439 $valuetoshow = $obj->{$value}.
" ".
img_picto(
"", $obj->{$value});
2440 } elseif ($value ==
'type_duration') {
2441 $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'));
2442 if (!empty($obj->{$value}) && array_key_exists($obj->{$value}, $TDurationTypes)) {
2443 $valuetoshow = $TDurationTypes[$obj->{$value}];
2446 $class .= ($class ?
' ' :
'').
'tddict';
2447 if ($value ==
'note' && $id == DICT_TVA) {
2448 $class .=
' tdoverflowmax200';
2450 if ($value ==
'tracking') {
2451 $class .=
' tdoverflowauto';
2453 if (in_array($value, array(
'nbjour',
'decalage',
'pos',
'position',
'deposit_percent'))) {
2456 if (in_array($value, array(
'type_vat',
'localtax1_type',
'localtax2_type'))) {
2457 $class .=
' nowraponall';
2459 if (in_array($value, array(
'use_default',
'fk_parent',
'sortorder'))) {
2460 $class .=
' center';
2462 if ($value ==
'public') {
2463 $class .=
' center';
2467 print
'<!-- '. $value .
' --><td class="'.$class.
'"'.($titletoshow ?
' title="'.dol_escape_htmltag($titletoshow).
'"' :
'').
'>'.$valuetoshow.
'</td>';
2473 if ($id == DICT_COUNTRY) {
2474 print
'<td class="nowrap center">';
2477 print
'<a class="reposition" href="'.$url.
'action='.$acts[$obj->eec].
'_eec&token='.
newToken().
'">'.$actl[$obj->eec].
'</a>';
2479 print
'<span class="opacitymedium">'.$langs->trans(
"AlwaysActive").
'</span>';
2482 print
'<td class="nowrap center">';
2485 print
'<a class="reposition" href="'.$url.
'action='.$acts[$obj->favorite].
'_favorite&token='.
newToken().
'">'.$actl[$obj->favorite].
'</a>';
2487 print
'<span class="opacitymedium">'.$langs->trans(
"AlwaysActive").
'</span>';
2494 print
'<td class="nowrap center">';
2495 if ($canbedisabled) {
2496 print
'<a class="reposition" href="'.$url.
'action='.$acts[$obj->active].
'&token='.
newToken().
'">'.$actl[$obj->active].
'</a>';
2498 if (in_array($obj->code, array(
'AC_OTH',
'AC_OTH_AUTO'))) {
2499 print $langs->trans(
"AlwaysActive");
2500 } elseif (isset($obj->type) && in_array($obj->type, array(
'systemauto')) && empty($obj->active)) {
2501 print $langs->trans(
"Deprecated");
2502 } elseif (isset($obj->type) && in_array($obj->type, array(
'system')) && !empty($obj->active) && $obj->code !=
'AC_OTH') {
2503 print $langs->trans(
"UsedOnlyWithTypeOption");
2505 print
'<span class="opacitymedium">'.$langs->trans(
"AlwaysActive").
'</span>';
2512 print
'<td class="center maxwidthsearch nowraponall">';
2514 if ($canbemodified) {
2515 print
'<a class="reposition marginleftonly paddingleft marginrightonly paddingright editfielda" href="'.$url.
'action=edit&token='.
newToken().
'">'.
img_edit().
'</a>';
2520 print
'<a class="reposition marginleftonly paddingleft marginrightonly paddingright" href="'.$url.
'action=delete&token='.
newToken().
'">'.
img_delete().
'</a>';
2531 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2547 print
'<span class="opacitymedium">'.$langs->trans(
"DictionaryDesc");
2548 print
" ".$langs->trans(
"OnlyActiveElementsAreShown").
"<br>\n";
2549 print
'</span><br>';
2552 $lastlineisempty =
false;
2554 print
'<div class="div-table-responsive-no-min">';
2555 print
'<table class="noborder centpercent">';
2556 print
'<tr class="liste_titre">';
2557 print
'<td>'.$langs->trans(
"Dictionary").
'</td>';
2559 print
'<td class="hideonsmartphone"></td>';
2562 $showemptyline =
'';
2563 foreach ($taborder as $i) {
2564 if (isset($tabname[$i]) && empty($tabcond[$i])) {
2569 if ($showemptyline) {
2570 print
'<tr class="oddeven"><td></td><td></td><td class="hideonsmartphone"></td></tr>';
2575 $value = $tabname[$i];
2576 print
'<tr class="oddeven"><td class="minwidth200">';
2577 if (!empty($tabcond[$i])) {
2578 $tabnamenoprefix = preg_replace(
'/'.MAIN_DB_PREFIX.
'/',
'', $tabname[$i]);
2579 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$i.
'">';
2580 if (!empty($tabcomplete[$tabnamenoprefix][
'picto'])) {
2581 print
img_picto(
'', $tabcomplete[$tabnamenoprefix][
'picto'],
'class="pictofixedwidth paddingrightonly"');
2583 print $langs->trans($tablib[$i]);
2586 print $langs->trans($tablib[$i]);
2590 print
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$i.
'">';
2594 print
'<td class="right hideonsmartphone">';
2595 print $form->textwithpicto(
'', $langs->trans(
"Table").
': '.MAIN_DB_PREFIX.$tabname[$i]);
2598 $lastlineisempty =
false;
2600 if (!$lastlineisempty) {
2602 $lastlineisempty =
true;
2626function fieldList($fieldlist, $obj =
null, $tabname =
'', $context =
'')
2628 global $conf, $langs, $db, $mysoc;
2631 global $elementList, $sourceList, $localtax_typeList, $type_vatList;
2639 foreach ($fieldlist as $field => $value) {
2640 if ($value ==
'entity' && isset($obj->$value)) {
2641 $withentity = $obj->$value;
2645 if (in_array($value, array(
'code',
'libelle',
'type')) && $tabname ==
"c_actioncomm" && isset($obj->$value) && in_array($obj->type, array(
'system',
'systemauto'))) {
2646 $hidden = (!empty($obj->{$value}) ? $obj->{$value} :
'');
2648 print
'<input type="hidden" name="'. $value .
'" value="'.$hidden.
'">';
2649 print $langs->trans($hidden);
2651 } elseif ($value ==
'country') {
2652 if (in_array(
'region_id', $fieldlist)) {
2659 $selected = (!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country :
''));
2660 if (!GETPOSTISSET(
'code')) {
2661 $selected =
GETPOST(
'countryidforinsert');
2663 print $form->select_country($selected, $value,
'', 28,
'minwidth100 maxwidth150 maxwidthonsmartphone');
2665 } elseif ($value ==
'country_id') {
2666 if (!in_array(
'country', $fieldlist)) {
2667 $country_id = (!empty($obj->{$value}) ? $obj->{$value} : 0);
2668 print
'<td class="tdoverflowmax100">';
2669 print
'<input type="hidden" name="'. $value .
'" value="'.$country_id.
'">';
2672 } elseif ($value ==
'region') {
2674 $formcompany->select_region($region_id,
'region');
2676 } elseif ($value ==
'region_id') {
2677 $region_id = (!empty($obj->{$value}) ? $obj->{$value} : 0);
2679 print
'<input type="hidden" name="'. $value .
'" value="'.$region_id.
'">';
2681 } elseif ($value ==
'lang') {
2685 } elseif (in_array($value, array(
'element',
'source'))) {
2686 $tmparray = array();
2687 if ($value ==
'element') {
2688 $tmparray = $elementList;
2690 $tmparray = $sourceList;
2693 print $form->selectarray($value, $tmparray, (!empty($obj->{$value}) ? $obj->{$value} :
''), 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth250');
2695 } elseif (in_array($value, array(
'public',
'use_default'))) {
2697 print
'<td class="center">';
2699 print $form->selectyesno($value, (!empty($obj->{$value}) ? $obj->{$value} :
''), 1);
2701 } elseif ($value ==
'private') {
2704 print $form->selectyesno(
"private", (!empty($obj->{$value}) ? $obj->{$value} :
''));
2706 } elseif ($value ==
'type' && $tabname ==
"c_actioncomm") {
2707 $type = (!empty($obj->type) ? $obj->type :
'user');
2709 print $type.
'<input type="hidden" name="type" value="'.$type.
'">';
2711 } elseif ($value ==
'type' && $tabname ==
'c_paiement') {
2713 $select_list = array(0 => $langs->trans(
'PaymentTypeCustomer'), 1 => $langs->trans(
'PaymentTypeSupplier'), 2 => $langs->trans(
'PaymentTypeBoth'));
2714 print $form->selectarray($value, $select_list, (!empty($obj->{$value}) ? $obj->{$value} :
'2'));
2716 } elseif ($value ==
'recuperableonly' || $value ==
'type_cdr' || $value ==
'deductible' || $value ==
'category_type') {
2717 if ($value ==
'type_cdr') {
2718 print
'<td class="center">';
2722 if ($value ==
'type_cdr') {
2723 print $form->selectarray($value, array(0 => $langs->trans(
'None'), 1 => $langs->trans(
'AtEndOfMonth'), 2 => $langs->trans(
'CurrentNext')), (!empty($obj->{$value}) ? $obj->{$value} :
''));
2726 print $form->selectyesno($value, (!empty($obj->{$value}) ? $obj->{$value} :
''), 1);
2729 } elseif (in_array($value, array(
'nbjour',
'decalage',
'taux',
'localtax1',
'localtax2'))) {
2731 if (in_array($value, array(
'taux',
'localtax1',
'localtax2'))) {
2734 print
'<td class="'.$class.
'">';
2735 print
'<input type="text" class="flat" value="'.(isset($obj->{$value}) ? $obj->{$value} :
'').
'" size="3" name="'. $value .
'">';
2737 } elseif (in_array($value, array(
'libelle_facture'))) {
2742 if ($tabname ==
'c_payment_term') {
2743 $langs->load(
"bills");
2744 if (isset($obj->code) && !empty($obj->code)) {
2745 $transkey =
"PaymentCondition" . strtoupper($obj->code);
2746 if ($langs->trans($transkey) != $transkey) {
2748 print $form->textwithpicto($langs->trans($transkey), $langs->trans(
"GoIntoTranslationMenuToChangeThis"));
2753 print
'<textarea cols="30" rows="'.ROWS_2.
'" class="flat" name="'. $value .
'">'.(!empty($obj->{$value}) ? $obj->{$value} :
'').
'</textarea>';
2755 print
'<input type="hidden" name="'. $value .
'" value="'.$transkey.
'">';
2758 } elseif ($value ==
'price' || preg_match(
'/^amount/i', $value)) {
2759 print
'<td><input type="text" class="flat minwidth75" value="'.price((!empty($obj->{$value}) ? $obj->{$value} :
'')).
'" name="'. $value .
'"></td>';
2760 } elseif ($value ==
'code' && isset($obj->{$value})) {
2761 print
'<td><input type="text" class="flat minwidth75 maxwidth100" value="'.(!empty($obj->{$value}) ? $obj->{$value} :
'').
'" name="'. $value .
'"></td>';
2762 } elseif ($value ==
'unit') {
2765 'mm' => $langs->trans(
'SizeUnitmm'),
2766 'cm' => $langs->trans(
'SizeUnitcm'),
2767 'point' => $langs->trans(
'SizeUnitpoint'),
2768 'inch' => $langs->trans(
'SizeUnitinch')
2770 print $form->selectarray(
'unit', $units, (!empty($obj->{$value}) ? $obj->{$value} :
''), 0, 0, 0);
2772 } elseif ($value ==
'type_vat') {
2774 print
'<td class="center">';
2775 print $form->selectarray($value, $type_vatList, (!empty($obj->{$value}) ? $obj->{$value} :
''));
2777 } elseif ($value ==
'localtax1_type' || $value ==
'localtax2_type') {
2779 print
'<td class="center">';
2780 print $form->selectarray($value, $localtax_typeList, (!empty($obj->{$value}) ? $obj->{$value} :
''));
2782 } elseif ($value ==
'accountancy_code' || $value ==
'accountancy_code_sell' || $value ==
'accountancy_code_buy') {
2784 if (isModEnabled(
'accounting')) {
2785 $fieldname = $value;
2786 $accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0);
2787 print $formaccounting->select_account($accountancy_account,
'.'. $value, 1,
'', 1, 1,
'maxwidth200 maxwidthonsmartphone');
2789 $fieldname = $value;
2790 print
'<input type="text" size="10" class="flat" value="'.(isset($obj->$fieldname) ? $obj->$fieldname :
'').
'" name="'. $value .
'">';
2793 } elseif ($value ==
'fk_tva') {
2795 print $form->load_tva(
'fk_tva', $obj->taux, $mysoc,
new Societe($db), 0, 0,
'',
false, -1);
2797 } elseif ($value ==
'fk_c_exp_tax_cat') {
2799 print $form->selectExpenseCategories($obj->fk_c_exp_tax_cat);
2801 } elseif ($value ==
'fk_range') {
2803 print $form->selectExpenseRanges($obj->fk_range);
2805 } elseif ($value ==
'block_if_negative') {
2807 print $form->selectyesno(
"block_if_negative", (empty($obj->block_if_negative) ?
'' : $obj->block_if_negative), 1);
2809 } elseif ($value ==
'type_duration') {
2811 print $form->selectTypeDuration(
'', (empty($obj->type_duration) ?
'' : $obj->type_duration), array(
'i',
'h'));
2814 $fieldValue = isset($obj->{$value}) ? $obj->{$value} :
'';
2818 if ($value ==
'sortorder') {
2819 $fieldlist[$field] =
'position';
2822 if ($fieldlist[$field] ==
'code') {
2823 $class =
'maxwidth100';
2825 if (in_array($fieldlist[$field], array(
'deposit_percent'))) {
2827 $class =
'maxwidth50 right';
2829 if (in_array($fieldlist[$field], array(
'pos',
'position'))) {
2831 $class =
'maxwidth50 right';
2833 if (in_array($fieldlist[$field], array(
'dayrule',
'day',
'month',
'year',
'use_default',
'affect',
'delay',
'public',
'sortorder',
'sens',
'category_type',
'fk_parent'))) {
2834 $class =
'maxwidth50 center';
2836 if (in_array($fieldlist[$field], array(
'use_default',
'public',
'fk_parent'))) {
2837 $classtd =
'center';
2839 if (in_array($fieldlist[$field], array(
'libelle',
'label',
'tracking'))) {
2840 $class =
'quatrevingtpercent';
2843 if ($fieldlist[$field] ==
'fk_parent') {
2844 if (empty($fieldValue)) {
2851 if (in_array($fieldlist[$field], array(
'libelle',
'label'))) {
2854 case 'c_email_senderprofile':
2855 case 'c_forme_juridique':
2856 case 'c_holiday_types':
2857 case 'c_payment_term':
2858 case 'c_transport_mode':
2859 $maxlength =
' maxlength="255"';
2861 case 'c_email_templates':
2862 $maxlength =
' maxlength="180"';
2864 case 'c_socialnetworks':
2865 $maxlength =
' maxlength="150"';
2868 $maxlength =
' maxlength="128"';
2872 print
'<td class="'.$classtd.
'">';
2875 if (in_array($fieldlist[$field], array(
'label',
'libelle'))) {
2877 if ($tabname ==
'c_civility' && !empty($obj->code)) {
2878 $transkey =
"Civility".strtoupper($obj->code);
2880 if ($tabname ==
'c_payment_term' && !empty($obj->code)) {
2881 $langs->load(
"bills");
2882 $transkey =
"PaymentConditionShort".strtoupper($obj->code);
2884 if ($transkey && $langs->trans($transkey) != $transkey) {
2886 print $form->textwithpicto($langs->trans($transkey), $langs->trans(
"GoIntoTranslationMenuToChangeThis"));
2890 print
'<input type="text" class="flat'.($class ?
' '.$class :
'').
'"'.($maxlength ?
' '.$maxlength :
'').
' value="'.
dol_escape_htmltag($fieldValue).
'" name="'.$fieldlist[$field].
'">';
2892 print
'<input type="hidden" name="'.$fieldlist[$field].
'" value="'.$transkey.
'">';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous)
complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tabsql, &$tabsqlsort, &$tabfield, &$tabfieldvalue, &$tabfieldinsert, &$tabrowid, &$tabcond, &$tabhelp, &$tabcomplete)
Add external modules to list of dictionaries.
complete_elementList_with_modules(&$elementList)
Search external modules to complete the list of contact element.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage accounting accounts.
Class to manage third parties objects (customers, suppliers, prospects...)
fieldList($fieldlist, $obj=null, $tabname='', $context='')
Show fields in insert/edit mode.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_help($usehelpcursor=1, $usealttitle=1)
Show help logo with cursor "?".
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
getDictionaryValue($tablename, $field, $id, $checkentity=false, $rowidfield='rowid')
Return the value of a filed into a dictionary for the record $id.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.