dolibarr 23.0.3
societe.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
4 * Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
5 * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
6 * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
7 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
8 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
30// Load Dolibarr environment
31require '../../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
41require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
42require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
43require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
44
45$langs->loadLangs(array("admin", "accountancy", "companies", "other"));
46
47$action = GETPOST('action', 'aZ09');
48$value = GETPOST('value', 'alpha');
49$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
50
51if (!$user->admin) {
53}
54
55$formcompany = new FormCompany($db);
56
57
58
59/*
60 * Actions
61 */
62
63$error = 0;
64
65include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
66
67if ($action == 'setcodeclient') {
68 $result = dolibarr_set_const($db, "SOCIETE_CODECLIENT_ADDON", $value, 'chaine', 0, '', $conf->entity);
69 if ($result <= 0) {
70 dol_print_error($db);
71 }
72}
73
74if ($action == 'setcodecompta') {
75 $result = dolibarr_set_const($db, "SOCIETE_CODECOMPTA_ADDON", $value, 'chaine', 0, '', $conf->entity);
76 if ($result <= 0) {
77 dol_print_error($db);
78 }
79}
80
81if ($action == 'updateoptions') {
82 if (GETPOSTISSET('COMPANY_USE_SEARCH_TO_SELECT')) {
83 $companysearch = GETPOST('activate_COMPANY_USE_SEARCH_TO_SELECT', 'alpha');
84 $res = dolibarr_set_const($db, "COMPANY_USE_SEARCH_TO_SELECT", $companysearch, 'chaine', 0, '', $conf->entity);
85 if (!($res > 0)) {
86 $error++;
87 }
88 if (!$error) {
89 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
90 } else {
91 setEventMessages($langs->trans("Error"), null, 'errors');
92 }
93 }
94
95 if (GETPOSTISSET('CONTACT_USE_SEARCH_TO_SELECT')) {
96 $contactsearch = GETPOST('activate_CONTACT_USE_SEARCH_TO_SELECT', 'alpha');
97 $res = dolibarr_set_const($db, "CONTACT_USE_SEARCH_TO_SELECT", $contactsearch, 'chaine', 0, '', $conf->entity);
98 if (!($res > 0)) {
99 $error++;
100 }
101 if (!$error) {
102 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
103 } else {
104 setEventMessages($langs->trans("Error"), null, 'errors');
105 }
106 }
107
108 if (GETPOSTISSET('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')) {
109 $customertypedefault = GETPOSTINT('defaultcustomertype');
110 $res = dolibarr_set_const($db, "THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT", $customertypedefault, 'chaine', 0, '', $conf->entity);
111 if (!($res > 0)) {
112 $error++;
113 }
114 if (!$error) {
115 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
116 } else {
117 setEventMessages($langs->trans("Error"), null, 'errors');
118 }
119 }
120
121 if (GETPOSTISARRAY('CONTACTS_DEFAULT_ROLES')) {
122 $rolessearch = GETPOST('activate_CONTACTS_DEFAULT_ROLES', 'array:aZ09');
123 $res = dolibarr_set_const($db, "CONTACTS_DEFAULT_ROLES", implode(',', $rolessearch), 'chaine', 0, '', $conf->entity);
124 if (!($res > 0)) {
125 $error++;
126 }
127 if (!$error) {
128 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
129 } else {
130 setEventMessages($langs->trans("Error"), null, 'errors');
131 }
132 }
133}
134
135// Activate a document generator module
136if ($action == 'set') {
137 $label = GETPOST('label', 'alpha');
138 $scandir = GETPOST('scan_dir', 'alpha');
139
140 $type = 'company';
141
142 $ret = delDocumentModel($value, $type);
143 if ($ret > 0) {
144 $ret = addDocumentModel($value, $type, $label, $scandir);
145 }
146}
147
148// Disable a document generator module
149if ($action == 'del') {
150 $type = 'company';
151 $ret = delDocumentModel($value, $type);
152}
153
154// Define default generator
155if ($action == 'setdoc') {
156 $label = GETPOST('label', 'alpha');
157 $scandir = GETPOST('scan_dir', 'alpha');
158
159 $db->begin();
160
161 dolibarr_set_const($db, "COMPANY_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity);
162
163 // On active le modele
164 $type = 'company';
165 $ret = delDocumentModel(GETPOST('value', 'alpha'), $type);
166 if ($ret > 0) {
167 $ret = addDocumentModel($value, $type, $label, $scandir);
168 }
169
170 if ($ret) {
171 $db->commit();
172 } else {
173 $db->rollback();
174 }
175}
176
177//Activate Set accountancy code customer invoice mandatory
178if ($action == "setaccountancycodecustomerinvoicemandatory") {
179 $setaccountancycodecustomerinvoicemandatory = GETPOSTINT('value');
180 $res = dolibarr_set_const($db, "SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_INVOICE_MANDATORY", $setaccountancycodecustomerinvoicemandatory, 'yesno', 0, '', $conf->entity);
181 if (!($res > 0)) {
182 $error++;
183 }
184 if (!$error) {
185 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
186 } else {
187 setEventMessages($langs->trans("Error"), null, 'errors');
188 }
189}
190
191//Activate Set ref in list
192if ($action == "setaddrefinlist") {
193 $setaddrefinlist = GETPOSTINT('value');
194 $res = dolibarr_set_const($db, "SOCIETE_ADD_REF_IN_LIST", $setaddrefinlist, 'yesno', 0, '', $conf->entity);
195 if (!($res > 0)) {
196 $error++;
197 }
198 if (!$error) {
199 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
200 } else {
201 setEventMessages($langs->trans("Error"), null, 'errors');
202 }
203}
204
205//Activate Set vat in list
206if ($action == "setvatinlist") {
207 $setvatinlist = GETPOSTINT('value');
208 $res = dolibarr_set_const($db, "SOCIETE_SHOW_VAT_IN_LIST", $setvatinlist, 'yesno', 0, '', $conf->entity);
209 if (!($res > 0)) {
210 $error++;
211 }
212 if (!$error) {
213 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
214 } else {
215 setEventMessages($langs->trans("Error"), null, 'errors');
216 }
217}
218
219//Activate Set address in list
220if ($action == "setaddadressinlist") {
221 $val = GETPOSTINT('value');
222 $res = dolibarr_set_const($db, "COMPANY_SHOW_ADDRESS_SELECTLIST", $val, 'yesno', 0, '', $conf->entity);
223 if (!($res > 0)) {
224 $error++;
225 }
226 if (!$error) {
227 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
228 } else {
229 setEventMessages($langs->trans("Error"), null, 'errors');
230 }
231}
232
233//Activate Set email phone town in contact list
234if ($action == "setaddemailphonetownincontactlist") {
235 $val = GETPOSTINT('value');
236 $res = dolibarr_set_const($db, "CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST", $val, 'yesno', 0, '', $conf->entity);
237 if (!($res > 0)) {
238 $error++;
239 }
240 if (!$error) {
241 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
242 } else {
243 setEventMessages($langs->trans("Error"), null, 'errors');
244 }
245}
246
247//Activate Ask For Preferred Shipping Method
248if ($action == "setaskforshippingmet") {
249 $setaskforshippingmet = GETPOSTINT('value');
250 $res = dolibarr_set_const($db, "SOCIETE_ASK_FOR_SHIPPING_METHOD", $setaskforshippingmet, 'yesno', 0, '', $conf->entity);
251 if (!($res > 0)) {
252 $error++;
253 }
254 if (!$error) {
255 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
256 } else {
257 setEventMessages($langs->trans("Error"), null, 'errors');
258 }
259}
260
261// Activate "Disable prospect/customer type"
262if ($action == "setdisableprospectcustomer") {
263 $setdisableprospectcustomer = GETPOSTINT('value');
264 $res = dolibarr_set_const($db, "SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer, 'yesno', 0, '', $conf->entity);
265 if (!($res > 0)) {
266 $error++;
267 }
268 if (!$error) {
269 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
270 } else {
271 setEventMessages($langs->trans("Error"), null, 'errors');
272 }
273}
274
275//Activate ProfId unique
276if ($action == 'setprofid') {
277 $status = GETPOST('status', 'alpha');
278
279 $idprof = "SOCIETE_".$value."_UNIQUE";
280 $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity);
281 if ($result <= 0) {
282 dol_print_error($db);
283 }
284}
285
286//Activate ProfId mandatory
287if ($action == 'setprofidmandatory') {
288 $status = GETPOST('status', 'alpha');
289
290 $idprof = "SOCIETE_".$value."_MANDATORY";
291 $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity);
292 if ($result <= 0) {
293 dol_print_error($db);
294 }
295}
296
297//Activate ProfId invoice mandatory
298if ($action == 'setprofidinvoicemandatory' || $action == 'setprofidinvoicemandatoryeeconly') {
299 $status = GETPOST('status', 'alpha');
300 if ($status == '1' && $action == 'setprofidinvoicemandatoryeeconly') {
301 $status = 'eeconly';
302 }
303 $idprof = "SOCIETE_".$value."_INVOICE_MANDATORY";
304 $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity);
305 if ($result <= 0) {
306 dol_print_error($db);
307 }
308}
309
310//Set hide closed customer into combox or select
311if ($action == 'sethideinactivethirdparty') {
312 $status = GETPOST('status', 'alpha');
313
314 $result = dolibarr_set_const($db, "COMPANY_HIDE_INACTIVE_IN_COMBOBOX", $status, 'chaine', 0, '', $conf->entity);
315 if ($result <= 0) {
316 dol_print_error($db);
317 }
318}
319if ($action == 'setonsearchandlistgooncustomerorsuppliercard') {
320 $setonsearchandlistgooncustomerorsuppliercard = GETPOSTINT('value');
321 $res = dolibarr_set_const($db, "SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard, 'yesno', 0, '', $conf->entity);
322 if (!($res > 0)) {
323 $error++;
324 }
325 if (!$error) {
326 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
327 } else {
328 setEventMessages($langs->trans("Error"), null, 'errors');
329 }
330}
331
332
333/*
334 * View
335 */
336
337clearstatcache();
338
339$form = new Form($db);
340
341$help_url = 'EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers|ES:Configuración_del_módulo_terceros';
342llxHeader('', $langs->trans("CompanySetup"), $help_url);
343
344$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
345
346print load_fiche_titre($langs->trans("CompanySetup"), $linkback, 'title_setup');
347
348
350
351print dol_get_fiche_head($head, 'general', $langs->trans("ThirdParties"), -1, 'company');
352
353$dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
354foreach ($conf->modules_parts['models'] as $mo) {
355 $dirsociete[] = $mo.'core/modules/societe/'; //Add more models
356}
357
358// Module to manage customer/supplier code
359
360print load_fiche_titre($langs->trans("CompanyCodeChecker"), '', '');
361
362print '<div class="div-table-responsive-no-min">';
363print '<table class="noborder centpercent">'."\n";
364print '<tr class="liste_titre">'."\n";
365print ' <td>'.$langs->trans("Name").'</td>';
366print ' <td>'.$langs->trans("Description").'</td>';
367print ' <td>'.$langs->trans("Example").'</td>';
368print ' <td class="center" width="80">'.$langs->trans("Status").'</td>';
369print ' <td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
370print "</tr>\n";
371
372$arrayofmodules = array();
373
374foreach ($dirsociete as $dirroot) {
375 $dir = dol_buildpath($dirroot, 0);
376
377 $handle = @opendir($dir);
378 if (is_resource($handle)) {
379 // Loop on each module find in opened directory
380 while (($file = readdir($handle)) !== false) {
381 if (substr($file, 0, 15) == 'mod_codeclient_' && substr($file, -3) == 'php') {
382 $file = substr($file, 0, dol_strlen($file) - 4);
383
384 try {
385 dol_include_once($dirroot.$file.'.php');
386 } catch (Exception $e) {
387 dol_syslog($e->getMessage(), LOG_ERR);
388 }
389
391 $modCodeTiers = new $file($db);
392 '@phan-var-force ModeleThirdPartyCode $modCodeTiers';
393
394 // Show modules according to features level
395 if ($modCodeTiers->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
396 continue;
397 }
398 if ($modCodeTiers->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
399 continue;
400 }
401
402 $arrayofmodules[$file] = $modCodeTiers;
403 }
404 }
405 closedir($handle);
406 }
407}
408
409$arrayofmodules = dol_sort_array($arrayofmodules, 'position');
410// '@phan-var-force array<string,ModeleThirdPartyCode> $arrayofmodules'; // Repeat type because of dol_sort_array
411
412foreach ($arrayofmodules as $file => $modCodeTiers) {
413 print '<tr class="oddeven">'."\n";
414 print '<td width="140">'.$modCodeTiers->name.'</td>'."\n";
415 print '<td>'.$modCodeTiers->info($langs).'</td>'."\n";
416 print '<td class="nowrap">'.$modCodeTiers->getExample($langs).'</td>'."\n";
417
418 if (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') == (string) $file) {
419 print '<td class="center">'."\n";
420 print img_picto($langs->trans("Activated"), 'switch_on');
421 print "</td>\n";
422 } else {
423 $disabled = (isModEnabled('multicompany') && ((is_object($mc) && !empty($mc->sharings['referent'])) && ($mc->sharings['referent'] != $conf->entity)));
424 print '<td class="center">';
425 if (!$disabled) {
426 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setcodeclient&token='.newToken().'&value='.urlencode($file).'">';
427 }
428 print img_picto($langs->trans("Disabled"), 'switch_off');
429 if (!$disabled) {
430 print '</a>';
431 }
432 print '</td>';
433 }
434
435 print '<td class="center">';
436 $s = $modCodeTiers->getToolTip($langs, null, -1);
437 print $form->textwithpicto('', $s, 1);
438 print '</td>';
439
440 print '</tr>';
441}
442print '</table>';
443print '</div>';
444
445print "<br>";
446
447
448// Select accountancy code numbering module
449
450print load_fiche_titre($langs->trans("AccountCodeManager"), '', '');
451
452print '<div class="div-table-responsive-no-min">';
453print '<table class="noborder centpercent">';
454print '<tr class="liste_titre">';
455print '<td width="140">'.$langs->trans("Name").'</td>';
456print '<td>'.$langs->trans("Description").'</td>';
457print '<td>'.$langs->trans("Example").'</td>';
458print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
459print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
460print "</tr>\n";
461
462$arrayofmodules = array();
463
464foreach ($dirsociete as $dirroot) {
465 $dir = dol_buildpath($dirroot, 0);
466
467 $handle = @opendir($dir);
468 if (is_resource($handle)) {
469 while (($file = readdir($handle)) !== false) {
470 if (substr($file, 0, 15) == 'mod_codecompta_' && substr($file, -3) == 'php') {
471 $file = substr($file, 0, dol_strlen($file) - 4);
472
473 try {
474 dol_include_once($dirroot.$file.'.php');
475 } catch (Exception $e) {
476 dol_syslog($e->getMessage(), LOG_ERR);
477 }
478
479 $modCodeCompta = new $file();
480 '@phan-var-force ModeleAccountancyCode $modCodeTiers';
481
482 $arrayofmodules[$file] = $modCodeCompta;
483 }
484 }
485 closedir($handle);
486 }
487}
488
489$arrayofmodules = dol_sort_array($arrayofmodules, 'position');
490'@phan-var-force array<string,ModeleAccountancyCode> $arrayofmodules';
491
492
493foreach ($arrayofmodules as $file => $modCodeCompta) {
494 print '<tr class="oddeven">';
495 print '<td>'.$modCodeCompta->name."</td><td>\n";
496 print $modCodeCompta->info($langs);
497 print '</td>';
498 print '<td class="nowrap">'.$modCodeCompta->getExample($langs)."</td>\n";
499
500 if (getDolGlobalString('SOCIETE_CODECOMPTA_ADDON') == "$file") {
501 print '<td class="center">';
502 print img_picto($langs->trans("Activated"), 'switch_on');
503 print '</td>';
504 } else {
505 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setcodecompta&token='.newToken().'&value='.urlencode($file).'">';
506 print img_picto($langs->trans("Disabled"), 'switch_off');
507 print '</a></td>';
508 }
509 print '<td class="center">';
510 $s = $modCodeCompta->getToolTip($langs, null, -1);
511 print $form->textwithpicto('', $s, 1);
512 print '</td>';
513 print "</tr>\n";
514}
515print "</table>\n";
516print '</div>';
517
518
519/*
520 * Document templates generators
521 */
522print '<br>';
523print load_fiche_titre($langs->trans("ModelModules"), '', '');
524
525// Load array def with activated templates
526$def = array();
527// TODO Replace with $def = getListOfModels($db, $type);
528$sql = "SELECT nom";
529$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
530$sql .= " WHERE type = 'company'";
531$sql .= " AND entity = ".$conf->entity;
532$resql = $db->query($sql);
533if ($resql) {
534 $i = 0;
535 $num_rows = $db->num_rows($resql);
536 while ($i < $num_rows) {
537 $array = $db->fetch_array($resql);
538 if (is_array($array)) {
539 array_push($def, $array[0]);
540 }
541 $i++;
542 }
543} else {
544 dol_print_error($db);
545}
546
547print '<div class="div-table-responsive-no-min">';
548print '<table class="noborder centpercent">';
549print '<tr class="liste_titre">';
550print '<td width="140">'.$langs->trans("Name").'</td>';
551print '<td>'.$langs->trans("Description").'</td>';
552print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
553print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
554print '<td class="center" width="60">'.$langs->trans("Preview").'</td>';
555print "</tr>\n";
556
557foreach ($dirsociete as $dirroot) {
558 $dir = dol_buildpath($dirroot.'doc/', 0);
559
560 $handle = @opendir($dir);
561 if (is_resource($handle)) {
562 while (($file = readdir($handle)) !== false) {
563 if (preg_match('/\.modules\.php$/i', $file)) {
564 $name = substr($file, 4, dol_strlen($file) - 16);
565 $classname = substr($file, 0, dol_strlen($file) - 12);
566
567 try {
568 dol_include_once($dirroot.'doc/'.$file);
569 } catch (Exception $e) {
570 dol_syslog($e->getMessage(), LOG_ERR);
571 }
572
573 $module = new $classname($db);
574 '@phan-var-force ModeleThirdPartyDoc $module';
575
576 $modulequalified = 1;
577 if (!empty($module->version)) {
578 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
579 $modulequalified = 0;
580 } elseif ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
581 $modulequalified = 0;
582 }
583 }
584
585 if ($modulequalified) {
586 print '<tr class="oddeven"><td width="100">';
587 print dol_escape_htmltag($module->name);
588 print "</td><td>\n";
589 if (method_exists($module, 'info')) {
590 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
591 } else {
592 print $module->description;
593 }
594 print '</td>';
595
596 // Activate / Disable
597 if (in_array($name, $def)) {
598 print '<td class="center">'."\n";
599 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&token='.newToken().'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
600 print img_picto($langs->trans("Enabled"), 'switch_on');
601 print '</a>';
602 print "</td>";
603 } else {
604 if (versioncompare($module->phpmin, versionphparray()) > 0) {
605 print '<td class="center">'."\n";
606 print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion", implode('.', $module->phpmin))), 'switch_off', 'class="opacitymedium"');
607 print "</td>";
608 } else {
609 print '<td class="center">'."\n";
610 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.urlencode($name).'&token='.newToken().'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
611 print "</td>";
612 }
613 }
614
615 // Info
616 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
617 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
618 if ($module->type == 'pdf') {
619 $htmltooltip .= '<br>'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur;
620 }
621 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
622 $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraft").': '.yn((isset($module->option_draft_watermark) ? $module->option_draft_watermark : ''), 1, 1);
623
624 print '<td class="center nowrap">';
625 print $form->textwithpicto('', $htmltooltip, 1, 'info');
626 print '</td>';
627
628 // Preview
629 print '<td class="center nowrap">';
630 if ($module->type == 'pdf') {
631 $linkspec = '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=specimen&token='.newToken().'&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
632 } else {
633 $linkspec = img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
634 }
635 print $linkspec;
636 print '</td>';
637
638 print "</tr>\n";
639 }
640 }
641 }
642 closedir($handle);
643 }
644}
645print '</table>';
646print '</div>';
647
648print '<br>';
649
650//IDProf
651print load_fiche_titre($langs->trans("CompanyIdProfChecker"), '', '');
652
653print '<div class="div-table-responsive-no-min">';
654print '<table class="noborder centpercent">';
655print '<tr class="liste_titre">';
656print '<td>'.$langs->trans("Name").'</td>';
657print '<td>'.$langs->trans("Description").'</td>';
658print '<td class="center">'.$langs->trans("MustBeUnique").'</td>';
659print '<td class="center">'.$langs->trans("MustBeMandatory").'</td>';
660print '<td class="center">'.$langs->trans("MustBeInvoiceMandatory").'</td>';
661print "</tr>\n";
662
663$profid = array('IDPROF1' => array(), 'IDPROF2' => array(), 'IDPROF3' => array(), 'IDPROF4' => array(), 'IDPROF5' => array(),'IDPROF6' => array(), 'EMAIL' => array());
664$profid['IDPROF1'][0] = $langs->trans("ProfId1");
665$profid['IDPROF1'][1] = $langs->transcountry('ProfId1', $mysoc->country_code);
666$profid['IDPROF2'][0] = $langs->trans("ProfId2");
667$profid['IDPROF2'][1] = $langs->transcountry('ProfId2', $mysoc->country_code);
668$profid['IDPROF3'][0] = $langs->trans("ProfId3");
669$profid['IDPROF3'][1] = $langs->transcountry('ProfId3', $mysoc->country_code);
670$profid['IDPROF4'][0] = $langs->trans("ProfId4");
671$profid['IDPROF4'][1] = $langs->transcountry('ProfId4', $mysoc->country_code);
672$profid['IDPROF5'][0] = $langs->trans("ProfId5");
673$profid['IDPROF5'][1] = $langs->transcountry('ProfId5', $mysoc->country_code);
674$profid['IDPROF6'][0] = $langs->trans("ProfId6");
675$profid['IDPROF6'][1] = $langs->transcountry('ProfId6', $mysoc->country_code);
676$profid['EMAIL'][0] = $langs->trans("EMail");
677$profid['EMAIL'][1] = $langs->trans('Email');
678if (isModEnabled('accounting')) {
679 $profid['ACCOUNTANCY_CODE_CUSTOMER'] = array();
680 $profid['ACCOUNTANCY_CODE_CUSTOMER'][0] = $langs->trans("CustomerAccountancyCodeShort");
681 $profid['ACCOUNTANCY_CODE_CUSTOMER'][1] = $langs->trans('CustomerAccountancyCodeShort');
682 $profid['ACCOUNTANCY_CODE_SUPPLIER'] = array();
683 $profid['ACCOUNTANCY_CODE_SUPPLIER'][0] = $langs->trans("SupplierAccountancyCodeShort");
684 $profid['ACCOUNTANCY_CODE_SUPPLIER'][1] = $langs->trans('SupplierAccountancyCodeShort');
685}
686
687$nbofloop = count($profid);
688foreach ($profid as $key => $val) {
689 if ($profid[$key][1] != '-') {
690 print '<tr class="oddeven">';
691 print '<td>'.$profid[$key][0]."</td><td>\n";
692 print $profid[$key][1];
693 print '</td>';
694
695 $idprof_unique = 'SOCIETE_'.$key.'_UNIQUE';
696 $idprof_mandatory = 'SOCIETE_'.$key.'_MANDATORY';
697 $idprof_invoice_mandatory = 'SOCIETE_'.$key.'_INVOICE_MANDATORY';
698
699 $verif = !empty($conf->global->$idprof_unique);
700 $mandatory = !empty($conf->global->$idprof_mandatory);
701 $invoice_mandatory = !empty($conf->global->$idprof_invoice_mandatory);
702
703 if ($verif) {
704 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofid&token='.newToken().'&value='.$key.'&status=0">';
705 print img_picto($langs->trans("Activated"), 'switch_on');
706 print '</a></td>';
707 } else {
708 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofid&token='.newToken().'&value='.$key.'&status=1">';
709 print img_picto($langs->trans("Disabled"), 'switch_off');
710 print '</a></td>';
711 }
712
713 if ($mandatory) {
714 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&token='.newToken().'&value='.$key.'&status=0">';
715 print img_picto($langs->trans("Activated"), 'switch_on');
716 print '</a></td>';
717 } else {
718 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&token='.newToken().'&value='.$key.'&status=1">';
719 print img_picto($langs->trans("Disabled"), 'switch_off');
720 print '</a></td>';
721 }
722
723 if ($invoice_mandatory) {
724 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatory&token='.newToken().'&value='.$key.'&status=0">';
725 print img_picto($langs->trans("Activated"), 'switch_on');
726 print '</a></td>';
727 } else {
728 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatory&token='.newToken().'&value='.$key.'&status=1">';
729 print img_picto($langs->trans("Disabled"), 'switch_off');
730 print '</a></td>';
731 }
732
733 print "</tr>\n";
734 }
735}
736
737// VAT ID
738print '<tr class="oddeven">';
739print '<td colspan="2">'.$langs->trans('VATIntra')."</td>\n";
740$key = 'VAT_INTRA';
741if (getDolGlobalString('SOCIETE_VAT_INTRA_UNIQUE')) {
742 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofid&token='.newToken().'&value='.$key.'&status=0">';
743 print img_picto($langs->trans("Activated"), 'switch_on', 'class="valignmiddle"');
744 print '</a></td>';
745} else {
746 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofid&token='.newToken().'&value='.$key.'&status=1">';
747 print img_picto($langs->trans("Disabled"), 'switch_off', 'class="valignmiddle"');
748 print '</a></td>';
749}
750if (getDolGlobalString('SOCIETE_VAT_INTRA_MANDATORY')) {
751 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&token='.newToken().'&value='.$key.'&status=0">';
752 print img_picto($langs->trans("Activated"), 'switch_on', 'class="valignmiddle"');
753 print '</a></td>';
754} else {
755 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&token='.newToken().'&value='.$key.'&status=1">';
756 print img_picto($langs->trans("Disabled"), 'switch_off', 'class="valignmiddle"');
757 print '</a></td>';
758}
759print '<td class="center">';
760if (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY') == 'eeconly') {
761 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatoryeeconly&token='.newToken().'&value='.$key.'&status=0">';
762 print img_picto($langs->trans("Activated"), 'switch_on', 'class="valignmiddle paddingrightonly"');
763 print '</a>';
764 print $langs->trans("SaleEEC").'<br>';
765 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatory&token='.newToken().'&value='.$key.'&status=1">';
766 print img_picto($langs->trans("Activated"), 'switch_off', 'class="valignmiddle paddingrightonly"');
767 print '</a>';
768 print $langs->trans("AnySale");
769} elseif (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY')) {
770 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatoryeeconly&token='.newToken().'&value='.$key.'&status=1">';
771 print img_picto($langs->trans("Activated"), 'switch_off', 'class="valignmiddle paddingrightonly"');
772 print '</a>';
773 print $langs->trans("SaleEEC").'<br>';
774 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatory&token='.newToken().'&value='.$key.'&status=0">';
775 print img_picto($langs->trans("Activated"), 'switch_on', 'class="valignmiddle paddingrightonly"');
776 print '</a>';
777 print $langs->trans("AnySale");
778} else {
779 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatoryeeconly&token='.newToken().'&value='.$key.'&status=1">';
780 print img_picto($langs->trans("Disabled"), 'switch_off', 'class="valignmiddle paddingrightonly"');
781 print '</a>';
782 print $langs->trans("SaleEEC").'<br>';
783 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatory&token='.newToken().'&value='.$key.'&status=1">';
784 print img_picto($langs->trans("Disabled"), 'switch_off', 'class="valignmiddle paddingrightonly"');
785 print '</a>';
786 print $langs->trans("AnySale");
787}
788print '</td>';
789print "</tr>\n";
790
791print "</table>\n";
792print '</div>';
793
794print "<br>\n";
795
796print load_fiche_titre($langs->trans("Other"), '', '');
797
798// Autres options
799$form = new Form($db);
800
801print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
802print '<input type="hidden" name="token" value="'.newToken().'">';
803print '<input type="hidden" name="page_y" value="">';
804print '<input type="hidden" name="action" value="updateoptions">';
805
806print '<div class="div-table-responsive-no-min">';
807print '<table class="noborder centpercent">';
808print '<tr class="liste_titre">';
809print "<td>".$langs->trans("Parameters")."</td>\n";
810print '<td class="right" width="60"></td>'."\n";
811print '<td width="80">&nbsp;</td></tr>'."\n";
812
813// Utilisation formulaire Ajax sur choix societe
814
815print '<tr class="oddeven">';
816print '<td width="80%">'.$form->textwithpicto($langs->trans("DelaiedFullListToSelectCompany"), $langs->trans('UseSearchToSelectCompanyTooltip'), 1).' </td>';
817if (!$conf->use_javascript_ajax) {
818 print '<td class="nowrap right" colspan="2">';
819 print $langs->trans("NotAvailableWhenAjaxDisabled");
820 print "</td>";
821} else {
822 print '<td width="60" class="right">';
823 $arrval = array('0' => $langs->trans("No"),
824 '1' => $langs->trans("Yes").' - <span class="opacitymedium">'.$langs->trans("NumberOfKeyToSearch", 1).'</span>',
825 '2' => $langs->trans("Yes").' - <span class="opacitymedium">'.$langs->trans("NumberOfKeyToSearch", 2).'</span>',
826 '3' => $langs->trans("Yes").' - <span class="opacitymedium">'.$langs->trans("NumberOfKeyToSearch", 3).'</span>',
827 );
828 print $form->selectarray("activate_COMPANY_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT'), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp maxwidth400');
829 print '</td><td class="right">';
830 print '<input type="submit" class="button small reposition" name="COMPANY_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
831 print "</td>";
832}
833print '</tr>';
834
835
836print '<tr class="oddeven">';
837print '<td width="80%">'.$form->textwithpicto($langs->trans("DelaiedFullListToSelectContact"), $langs->trans('UseSearchToSelectContactTooltip'), 1).'</td>';
838if (!$conf->use_javascript_ajax) {
839 print '<td class="nowrap right" colspan="2">';
840 print $langs->trans("NotAvailableWhenAjaxDisabled");
841 print "</td>";
842} else {
843 print '<td width="60" class="right">';
844 $arrval = array('0' => $langs->trans("No"),
845 '1' => $langs->trans("Yes").' - <span class="opacitymedium">'.$langs->trans("NumberOfKeyToSearch", 1).'</span>',
846 '2' => $langs->trans("Yes").' - <span class="opacitymedium">'.$langs->trans("NumberOfKeyToSearch", 2).'</span>',
847 '3' => $langs->trans("Yes").' - <span class="opacitymedium">'.$langs->trans("NumberOfKeyToSearch", 3).'</span>',
848 );
849 print $form->selectarray("activate_CONTACT_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT'), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp maxwidth400');
850 print '</td><td class="right">';
851 print '<input type="submit" class="button small reposition" name="CONTACT_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
852 print "</td>";
853}
854print '</tr>';
855
856
857
858print '<tr class="oddeven">';
859print '<td width="80%">'.$langs->trans("AddRefInList").'</td>';
860print '<td>&nbsp;</td>';
861print '<td class="center">';
862if (getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
863 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddrefinlist&token='.newToken().'&value=0">';
864 print img_picto($langs->trans("Activated"), 'switch_on');
865} else {
866 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddrefinlist&token='.newToken().'&value=1">';
867 print img_picto($langs->trans("Disabled"), 'switch_off');
868}
869print '</a></td>';
870print '</tr>';
871
872print '<tr class="oddeven">';
873print '<td width="80%">'.$langs->trans("AddVatInList").'</td>';
874print '<td>&nbsp;</td>';
875print '<td class="center">';
876if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST')) {
877 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setvatinlist&token='.newToken().'&value=0">';
878 print img_picto($langs->trans("Activated"), 'switch_on');
879} else {
880 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setvatinlist&token='.newToken().'&value=1">';
881 print img_picto($langs->trans("Disabled"), 'switch_off');
882}
883print '</a></td>';
884print '</tr>';
885
886print '<tr class="oddeven">';
887print '<td width="80%">'.$langs->trans("AddAdressInList").'</td>';
888print '<td>&nbsp;</td>';
889print '<td class="center">';
890if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
891 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddadressinlist&token='.newToken().'&value=0">';
892 print img_picto($langs->trans("Activated"), 'switch_on');
893} else {
894 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddadressinlist&token='.newToken().'&value=1">';
895 print img_picto($langs->trans("Disabled"), 'switch_off');
896}
897print '</a></td>';
898print '</tr>';
899
900print '<tr class="oddeven">';
901print '<td width="80%">'.$langs->trans("AddEmailPhoneTownInContactList").'</td>';
902print '<td>&nbsp;</td>';
903print '<td class="center">';
904if (getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
905 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddemailphonetownincontactlist&token='.newToken().'&value=0">';
906 print img_picto($langs->trans("Activated"), 'switch_on');
907} else {
908 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddemailphonetownincontactlist&token='.newToken().'&value=1">';
909 print img_picto($langs->trans("Disabled"), 'switch_off');
910}
911print '</a></td>';
912print '</tr>';
913
914if (isModEnabled("shipping")) {
915 if (getDolGlobalInt('MAIN_FEATURES_LEVEL') > 0) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal)
916 print '<tr class="oddeven">';
917 print '<td width="80%">'.$langs->trans("AskForPreferredShippingMethod").'</td>';
918 print '<td>&nbsp;</td>';
919 print '<td class="center">';
920 if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD')) {
921 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaskforshippingmet&token='.newToken().'&value=0">';
922 print img_picto($langs->trans("Activated"), 'switch_on');
923 } else {
924 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaskforshippingmet&token='.newToken().'&value=1">';
925 print img_picto($langs->trans("Disabled"), 'switch_off');
926 }
927 print '</a></td>';
928 print '</tr>';
929 }
930}
931
932// Disable Prospect/Customer thirdparty type
933print '<tr class="oddeven">';
934print '<td width="80%">'.$langs->trans("DisableProspectCustomerType").'</td>';
935print '<td>&nbsp;</td>';
936print '<td class="center">';
937if (getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) {
938 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setdisableprospectcustomer&token='.newToken().'&value=0">';
939 print img_picto($langs->trans("Activated"), 'switch_on');
940} else {
941 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setdisableprospectcustomer&token='.newToken().'&value=1">';
942 print img_picto($langs->trans("Disabled"), 'switch_off');
943}
944print '</a></td>';
945print '</tr>';
946
947if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) {
948 // Default Prospect/Customer thirdparty type on customer création
949 print '<tr class="oddeven">';
950 print '<td>'.$langs->trans("DefaultCustomerType", $langs->transnoentitiesnoconv("MenuNewThirdParty"), $langs->transnoentitiesnoconv("MenuNewCustomer")).'</td>';
951 print '<td>';
952 print $formcompany->selectProspectCustomerType(getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT'), 'defaultcustomertype', 'defaultcustomertype', 'admin');
953 print '</td>';
954 print '<td class="center">';
955 print '<input type="submit" class="button small reposition" name="THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT" value="'.$langs->trans("Modify").'">';
956 print '</td>';
957 print '</tr>';
958}
959
960if (getDolGlobalString('THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION')) {
961 print '<tr class="oddeven">';
962 print '<td width="80%">'.$langs->trans('ContactsDefaultRoles').'</td>';
963 if (!$conf->use_javascript_ajax) {
964 print '<td class="nowrap right" colspan="2">';
965 print $langs->trans("NotAvailableWhenAjaxDisabled");
966 print "</td>";
967 } else {
968 print '<td width="60" class="right">';
969 $contact = new Contact($db); // InfraS add
970 $contactType = $contact->listeTypeContacts('external', 0, 1);
971 $selected = explode(',', getDolGlobalString('CONTACTS_DEFAULT_ROLES'));
972 print $form->multiselectarray('activate_CONTACTS_DEFAULT_ROLES', $contactType, $selected, 0, 0, 'minwidth75imp');
973 print '</td><td class="right">';
974 print '<input type="submit" class="button small eposition" name="CONTACTS_DEFAULT_ROLES" value="'.$langs->trans("Modify").'">';
975 print "</td>";
976 }
977 print '</tr>';
978}
979
980print '</table>';
981print '</div>';
982
983print '</form>';
984
985
986print dol_get_fiche_end();
987
988// End of page
989llxFooter();
990$db->close();
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
delDocumentModel($name, $type)
Delete document model used by doc generator.
versionphparray()
Return version PHP.
versioncompare($versionarray1, $versionarray2)
Compare 2 versions (stored into 2 arrays), to know if a version (a,b,c) is lower than (x,...
Definition admin.lib.php:71
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to manage contact/addresses.
Class to build HTML component for third parties management Only common components are here.
Class to manage generation of HTML components Only common components must be here.
societe_admin_prepare_head()
Return array head with list of tabs to view object information.
global $mysoc
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
GETPOSTISARRAY($paramname, $method=0)
Return true if the parameter $paramname is submit from a POST OR GET as an array.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
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...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.