dolibarr 21.0.0-beta
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 MDW <mdeweerd@users.noreply.github.com>
8 * Copyright (C) 2024 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';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
34require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
35require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
36
46$langs->loadLangs(array("admin", "companies", "other"));
47
48$action = GETPOST('action', 'aZ09');
49$value = GETPOST('value', 'alpha');
50$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
51
52if (!$user->admin) {
54}
55
56$formcompany = new FormCompany($db);
57
58
59
60/*
61 * Actions
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 $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
142 $sql .= " VALUES ('".$db->escape($value)."', '".$db->escape($type)."', ".((int) $conf->entity).", ";
143 $sql .= ($label ? "'".$db->escape($label)."'" : 'null').", ";
144 $sql .= (!empty($scandir) ? "'".$db->escape($scandir)."'" : "null");
145 $sql .= ")";
146
147 $resql = $db->query($sql);
148 if (!$resql) {
149 dol_print_error($db);
150 }
151}
152
153// Disable a document generator module
154if ($action == 'del') {
155 $type = 'company';
156 $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
157 $sql .= " WHERE nom='".$db->escape($value)."' AND type='".$db->escape($type)."' AND entity=".((int) $conf->entity);
158 $resql = $db->query($sql);
159 if (!$resql) {
160 dol_print_error($db);
161 }
162}
163
164// Define default generator
165if ($action == 'setdoc') {
166 $label = GETPOST('label', 'alpha');
167 $scandir = GETPOST('scan_dir', 'alpha');
168
169 $db->begin();
170
171 dolibarr_set_const($db, "COMPANY_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity);
172
173 // On active le modele
174 $type = 'company';
175 $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
176 $sql_del .= " WHERE nom = '".$db->escape(GETPOST('value', 'alpha'))."'";
177 $sql_del .= " AND type = '".$db->escape($type)."'";
178 $sql_del .= " AND entity = ".((int) $conf->entity);
179 dol_syslog("societe.php ".$sql);
180 $result1 = $db->query($sql_del);
181
182 $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
183 $sql .= " VALUES ('".$db->escape($value)."', '".$db->escape($type)."', ".((int) $conf->entity).", ";
184 $sql .= ($label ? "'".$db->escape($label)."'" : 'null').", ";
185 $sql .= (!empty($scandir) ? "'".$db->escape($scandir)."'" : "null");
186 $sql .= ")";
187 dol_syslog("societe.php", LOG_DEBUG);
188 $result2 = $db->query($sql);
189 if ($result1 && $result2) {
190 $db->commit();
191 } else {
192 $db->rollback();
193 }
194}
195
196//Activate Set accountancy code customer invoice mandatory
197if ($action == "setaccountancycodecustomerinvoicemandatory") {
198 $setaccountancycodecustomerinvoicemandatory = GETPOSTINT('value');
199 $res = dolibarr_set_const($db, "SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_INVOICE_MANDATORY", $setaccountancycodecustomerinvoicemandatory, 'yesno', 0, '', $conf->entity);
200 if (!($res > 0)) {
201 $error++;
202 }
203 if (!$error) {
204 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
205 } else {
206 setEventMessages($langs->trans("Error"), null, 'errors');
207 }
208}
209/* This code is not needed anymore as we can use the setprofid functions instead with key = 'VAT_INTRA'
210//Activate Set vat id unique
211if ($action == "setvatintraunique") {
212 $setvatintraunique = GETPOSTINT('value');
213 $res = dolibarr_set_const($db, "SOCIETE_VAT_INTRA_UNIQUE", $setvatintraunique, 'yesno', 0, '', $conf->entity);
214 if (!($res > 0)) {
215 $error++;
216 }
217 if (!$error) {
218 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
219 } else {
220 setEventMessages($langs->trans("Error"), null, 'errors');
221 }
222}
223*/
224
225//Activate Set ref in list
226if ($action == "setaddrefinlist") {
227 $setaddrefinlist = GETPOSTINT('value');
228 $res = dolibarr_set_const($db, "SOCIETE_ADD_REF_IN_LIST", $setaddrefinlist, 'yesno', 0, '', $conf->entity);
229 if (!($res > 0)) {
230 $error++;
231 }
232 if (!$error) {
233 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
234 } else {
235 setEventMessages($langs->trans("Error"), null, 'errors');
236 }
237}
238
239//Activate Set vat in list
240if ($action == "setvatinlist") {
241 $setvatinlist = GETPOSTINT('value');
242 $res = dolibarr_set_const($db, "SOCIETE_SHOW_VAT_IN_LIST", $setvatinlist, 'yesno', 0, '', $conf->entity);
243 if (!($res > 0)) {
244 $error++;
245 }
246 if (!$error) {
247 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
248 } else {
249 setEventMessages($langs->trans("Error"), null, 'errors');
250 }
251}
252
253//Activate Set address in list
254if ($action == "setaddadressinlist") {
255 $val = GETPOSTINT('value');
256 $res = dolibarr_set_const($db, "COMPANY_SHOW_ADDRESS_SELECTLIST", $val, 'yesno', 0, '', $conf->entity);
257 if (!($res > 0)) {
258 $error++;
259 }
260 if (!$error) {
261 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
262 } else {
263 setEventMessages($langs->trans("Error"), null, 'errors');
264 }
265}
266
267//Activate Set email phone town in contact list
268if ($action == "setaddemailphonetownincontactlist") {
269 $val = GETPOSTINT('value');
270 $res = dolibarr_set_const($db, "CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST", $val, 'yesno', 0, '', $conf->entity);
271 if (!($res > 0)) {
272 $error++;
273 }
274 if (!$error) {
275 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
276 } else {
277 setEventMessages($langs->trans("Error"), null, 'errors');
278 }
279}
280
281//Activate Ask For Preferred Shipping Method
282if ($action == "setaskforshippingmet") {
283 $setaskforshippingmet = GETPOSTINT('value');
284 $res = dolibarr_set_const($db, "SOCIETE_ASK_FOR_SHIPPING_METHOD", $setaskforshippingmet, 'yesno', 0, '', $conf->entity);
285 if (!($res > 0)) {
286 $error++;
287 }
288 if (!$error) {
289 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
290 } else {
291 setEventMessages($langs->trans("Error"), null, 'errors');
292 }
293}
294
295// Activate "Disable prospect/customer type"
296if ($action == "setdisableprospectcustomer") {
297 $setdisableprospectcustomer = GETPOSTINT('value');
298 $res = dolibarr_set_const($db, "SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer, 'yesno', 0, '', $conf->entity);
299 if (!($res > 0)) {
300 $error++;
301 }
302 if (!$error) {
303 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
304 } else {
305 setEventMessages($langs->trans("Error"), null, 'errors');
306 }
307}
308
309//Activate ProfId unique
310if ($action == 'setprofid') {
311 $status = GETPOST('status', 'alpha');
312
313 $idprof = "SOCIETE_".$value."_UNIQUE";
314 $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity);
315 if ($result <= 0) {
316 dol_print_error($db);
317 }
318}
319
320//Activate ProfId mandatory
321if ($action == 'setprofidmandatory') {
322 $status = GETPOST('status', 'alpha');
323
324 $idprof = "SOCIETE_".$value."_MANDATORY";
325 $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity);
326 if ($result <= 0) {
327 dol_print_error($db);
328 }
329}
330
331//Activate ProfId invoice mandatory
332if ($action == 'setprofidinvoicemandatory') {
333 $status = GETPOST('status', 'alpha');
334
335 $idprof = "SOCIETE_".$value."_INVOICE_MANDATORY";
336 $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity);
337 if ($result <= 0) {
338 dol_print_error($db);
339 }
340}
341
342//Set hide closed customer into combox or select
343if ($action == 'sethideinactivethirdparty') {
344 $status = GETPOST('status', 'alpha');
345
346 $result = dolibarr_set_const($db, "COMPANY_HIDE_INACTIVE_IN_COMBOBOX", $status, 'chaine', 0, '', $conf->entity);
347 if ($result <= 0) {
348 dol_print_error($db);
349 }
350}
351if ($action == 'setonsearchandlistgooncustomerorsuppliercard') {
352 $setonsearchandlistgooncustomerorsuppliercard = GETPOSTINT('value');
353 $res = dolibarr_set_const($db, "SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard, 'yesno', 0, '', $conf->entity);
354 if (!($res > 0)) {
355 $error++;
356 }
357 if (!$error) {
358 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
359 } else {
360 setEventMessages($langs->trans("Error"), null, 'errors');
361 }
362}
363
364
365/*
366 * View
367 */
368
369clearstatcache();
370
371$form = new Form($db);
372
373$help_url = 'EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers|ES:Configuración_del_módulo_terceros';
374llxHeader('', $langs->trans("CompanySetup"), $help_url);
375
376$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
377print load_fiche_titre($langs->trans("CompanySetup"), $linkback, 'title_setup');
378
379
381
382print dol_get_fiche_head($head, 'general', $langs->trans("ThirdParties"), -1, 'company');
383
384$dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
385foreach ($conf->modules_parts['models'] as $mo) {
386 $dirsociete[] = $mo.'core/modules/societe/'; //Add more models
387}
388
389// Module to manage customer/supplier code
390
391print load_fiche_titre($langs->trans("CompanyCodeChecker"), '', '');
392
393print '<div class="div-table-responsive-no-min">';
394print '<table class="noborder centpercent">'."\n";
395print '<tr class="liste_titre">'."\n";
396print ' <td>'.$langs->trans("Name").'</td>';
397print ' <td>'.$langs->trans("Description").'</td>';
398print ' <td>'.$langs->trans("Example").'</td>';
399print ' <td class="center" width="80">'.$langs->trans("Status").'</td>';
400print ' <td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
401print "</tr>\n";
402
403$arrayofmodules = array();
404
405foreach ($dirsociete as $dirroot) {
406 $dir = dol_buildpath($dirroot, 0);
407
408 $handle = @opendir($dir);
409 if (is_resource($handle)) {
410 // Loop on each module find in opened directory
411 while (($file = readdir($handle)) !== false) {
412 if (substr($file, 0, 15) == 'mod_codeclient_' && substr($file, -3) == 'php') {
413 $file = substr($file, 0, dol_strlen($file) - 4);
414
415 try {
416 dol_include_once($dirroot.$file.'.php');
417 } catch (Exception $e) {
418 dol_syslog($e->getMessage(), LOG_ERR);
419 }
420
422 $modCodeTiers = new $file($db);
423 '@phan-var-force ModeleThirdPartyCode $modCodeTiers';
424
425 // Show modules according to features level
426 if ($modCodeTiers->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
427 continue;
428 }
429 if ($modCodeTiers->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
430 continue;
431 }
432
433 $arrayofmodules[$file] = $modCodeTiers;
434 }
435 }
436 closedir($handle);
437 }
438}
439
440$arrayofmodules = dol_sort_array($arrayofmodules, 'position');
441'@phan-var-force array<string,ModeleThirdPartyCode> $arrayofmodules'; // Repeat type because of dol_sort_array
442
443foreach ($arrayofmodules as $file => $modCodeTiers) {
444 print '<tr class="oddeven">'."\n";
445 print '<td width="140">'.$modCodeTiers->name.'</td>'."\n";
446 print '<td>'.$modCodeTiers->info($langs).'</td>'."\n";
447 print '<td class="nowrap">'.$modCodeTiers->getExample($langs).'</td>'."\n";
448
449 if ($conf->global->SOCIETE_CODECLIENT_ADDON == "$file") {
450 print '<td class="center">'."\n";
451 print img_picto($langs->trans("Activated"), 'switch_on');
452 print "</td>\n";
453 } else {
454 $disabled = (isModEnabled('multicompany') && ((is_object($mc) && !empty($mc->sharings['referent'])) && ($mc->sharings['referent'] != $conf->entity)));
455 print '<td class="center">';
456 if (!$disabled) {
457 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setcodeclient&token='.newToken().'&value='.urlencode($file).'">';
458 }
459 print img_picto($langs->trans("Disabled"), 'switch_off');
460 if (!$disabled) {
461 print '</a>';
462 }
463 print '</td>';
464 }
465
466 print '<td class="center">';
467 $s = $modCodeTiers->getToolTip($langs, null, -1);
468 print $form->textwithpicto('', $s, 1);
469 print '</td>';
470
471 print '</tr>';
472}
473print '</table>';
474print '</div>';
475
476print "<br>";
477
478
479// Select accountancy code numbering module
480
481print load_fiche_titre($langs->trans("AccountCodeManager"), '', '');
482
483print '<div class="div-table-responsive-no-min">';
484print '<table class="noborder centpercent">';
485print '<tr class="liste_titre">';
486print '<td width="140">'.$langs->trans("Name").'</td>';
487print '<td>'.$langs->trans("Description").'</td>';
488print '<td>'.$langs->trans("Example").'</td>';
489print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
490print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
491print "</tr>\n";
492
493$arrayofmodules = array();
494
495foreach ($dirsociete as $dirroot) {
496 $dir = dol_buildpath($dirroot, 0);
497
498 $handle = @opendir($dir);
499 if (is_resource($handle)) {
500 while (($file = readdir($handle)) !== false) {
501 if (substr($file, 0, 15) == 'mod_codecompta_' && substr($file, -3) == 'php') {
502 $file = substr($file, 0, dol_strlen($file) - 4);
503
504 try {
505 dol_include_once($dirroot.$file.'.php');
506 } catch (Exception $e) {
507 dol_syslog($e->getMessage(), LOG_ERR);
508 }
509
510 $modCodeCompta = new $file();
511 '@phan-var-force ModeleAccountancyCode $modCodeTiers';
512
513 $arrayofmodules[$file] = $modCodeCompta;
514 }
515 }
516 closedir($handle);
517 }
518}
519
520$arrayofmodules = dol_sort_array($arrayofmodules, 'position');
521'@phan-var-force array<string,ModeleAccountancyCode> $arrayofmodules';
522
523
524foreach ($arrayofmodules as $file => $modCodeCompta) {
525 print '<tr class="oddeven">';
526 print '<td>'.$modCodeCompta->name."</td><td>\n";
527 print $modCodeCompta->info($langs);
528 print '</td>';
529 print '<td class="nowrap">'.$modCodeCompta->getExample($langs)."</td>\n";
530
531 if ($conf->global->SOCIETE_CODECOMPTA_ADDON == "$file") {
532 print '<td class="center">';
533 print img_picto($langs->trans("Activated"), 'switch_on');
534 print '</td>';
535 } else {
536 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setcodecompta&token='.newToken().'&value='.urlencode($file).'">';
537 print img_picto($langs->trans("Disabled"), 'switch_off');
538 print '</a></td>';
539 }
540 print '<td class="center">';
541 $s = $modCodeCompta->getToolTip($langs, null, -1);
542 print $form->textwithpicto('', $s, 1);
543 print '</td>';
544 print "</tr>\n";
545}
546print "</table>\n";
547print '</div>';
548
549
550/*
551 * Document templates generators
552 */
553print '<br>';
554print load_fiche_titre($langs->trans("ModelModules"), '', '');
555
556// Load array def with activated templates
557$def = array();
558$sql = "SELECT nom";
559$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
560$sql .= " WHERE type = 'company'";
561$sql .= " AND entity = ".$conf->entity;
562$resql = $db->query($sql);
563if ($resql) {
564 $i = 0;
565 $num_rows = $db->num_rows($resql);
566 while ($i < $num_rows) {
567 $array = $db->fetch_array($resql);
568 if (is_array($array)) {
569 array_push($def, $array[0]);
570 }
571 $i++;
572 }
573} else {
574 dol_print_error($db);
575}
576
577print '<div class="div-table-responsive-no-min">';
578print '<table class="noborder centpercent">';
579print '<tr class="liste_titre">';
580print '<td width="140">'.$langs->trans("Name").'</td>';
581print '<td>'.$langs->trans("Description").'</td>';
582print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
583print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
584print '<td class="center" width="60">'.$langs->trans("Preview").'</td>';
585print "</tr>\n";
586
587foreach ($dirsociete as $dirroot) {
588 $dir = dol_buildpath($dirroot.'doc/', 0);
589
590 $handle = @opendir($dir);
591 if (is_resource($handle)) {
592 while (($file = readdir($handle)) !== false) {
593 if (preg_match('/\.modules\.php$/i', $file)) {
594 $name = substr($file, 4, dol_strlen($file) - 16);
595 $classname = substr($file, 0, dol_strlen($file) - 12);
596
597 try {
598 dol_include_once($dirroot.'doc/'.$file);
599 } catch (Exception $e) {
600 dol_syslog($e->getMessage(), LOG_ERR);
601 }
602
603 $module = new $classname($db);
604 '@phan-var-force ModeleThirdPartyDoc $module';
605
606 $modulequalified = 1;
607 if (!empty($module->version)) {
608 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
609 $modulequalified = 0;
610 } elseif ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
611 $modulequalified = 0;
612 }
613 }
614
615 if ($modulequalified) {
616 print '<tr class="oddeven"><td width="100">';
617 print dol_escape_htmltag($module->name);
618 print "</td><td>\n";
619 if (method_exists($module, 'info')) {
620 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
621 } else {
622 print $module->description;
623 }
624 print '</td>';
625
626 // Activate / Disable
627 if (in_array($name, $def)) {
628 print "<td class=\"center\">\n";
629 //if ($conf->global->COMPANY_ADDON_PDF != "$name")
630 //{
631 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).'">';
632 print img_picto($langs->trans("Enabled"), 'switch_on');
633 print '</a>';
634 //}
635 //else
636 //{
637 // print img_picto($langs->trans("Enabled"),'on');
638 //}
639 print "</td>";
640 } else {
641 if (versioncompare($module->phpmin, versionphparray()) > 0) {
642 print '<td class="center">'."\n";
643 print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion", implode('.', $module->phpmin))), 'switch_off');
644 print "</td>";
645 } else {
646 print '<td class="center">'."\n";
647 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>';
648 print "</td>";
649 }
650 }
651
652 // Info
653 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
654 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
655 if ($module->type == 'pdf') {
656 $htmltooltip .= '<br>'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur;
657 }
658 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
659 $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraft").': '.yn((isset($module->option_draft_watermark) ? $module->option_draft_watermark : ''), 1, 1);
660
661 print '<td class="center nowrap">';
662 print $form->textwithpicto('', $htmltooltip, 1, 0);
663 print '</td>';
664
665 // Preview
666 print '<td class="center nowrap">';
667 if ($module->type == 'pdf') {
668 $linkspec = '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=specimen&token='.newToken().'&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
669 } else {
670 $linkspec = img_object($langs->trans("PreviewNotAvailable"), 'generic');
671 }
672 print $linkspec;
673 print '</td>';
674
675 print "</tr>\n";
676 }
677 }
678 }
679 closedir($handle);
680 }
681}
682print '</table>';
683print '</div>';
684
685print '<br>';
686
687//IDProf
688print load_fiche_titre($langs->trans("CompanyIdProfChecker"), '', '');
689
690print '<div class="div-table-responsive-no-min">';
691print '<table class="noborder centpercent">';
692print '<tr class="liste_titre">';
693print '<td>'.$langs->trans("Name").'</td>';
694print '<td>'.$langs->trans("Description").'</td>';
695print '<td class="center">'.$langs->trans("MustBeUnique").'</td>';
696print '<td class="center">'.$langs->trans("MustBeMandatory").'</td>';
697print '<td class="center">'.$langs->trans("MustBeInvoiceMandatory").'</td>';
698print "</tr>\n";
699
700$profid = array('IDPROF1' => array(), 'IDPROF2' => array(), 'IDPROF3' => array(), 'IDPROF4' => array(), 'IDPROF5' => array(),'IDPROF6' => array(), 'EMAIL' => array());
701$profid['IDPROF1'][0] = $langs->trans("ProfId1");
702$profid['IDPROF1'][1] = $langs->transcountry('ProfId1', $mysoc->country_code);
703$profid['IDPROF2'][0] = $langs->trans("ProfId2");
704$profid['IDPROF2'][1] = $langs->transcountry('ProfId2', $mysoc->country_code);
705$profid['IDPROF3'][0] = $langs->trans("ProfId3");
706$profid['IDPROF3'][1] = $langs->transcountry('ProfId3', $mysoc->country_code);
707$profid['IDPROF4'][0] = $langs->trans("ProfId4");
708$profid['IDPROF4'][1] = $langs->transcountry('ProfId4', $mysoc->country_code);
709$profid['IDPROF5'][0] = $langs->trans("ProfId5");
710$profid['IDPROF5'][1] = $langs->transcountry('ProfId5', $mysoc->country_code);
711$profid['IDPROF6'][0] = $langs->trans("ProfId6");
712$profid['IDPROF6'][1] = $langs->transcountry('ProfId6', $mysoc->country_code);
713$profid['EMAIL'][0] = $langs->trans("EMail");
714$profid['EMAIL'][1] = $langs->trans('Email');
715if (isModEnabled('accounting')) {
716 $profid['ACCOUNTANCY_CODE_CUSTOMER'] = array();
717 $profid['ACCOUNTANCY_CODE_CUSTOMER'][0] = $langs->trans("CustomerAccountancyCodeShort");
718 $profid['ACCOUNTANCY_CODE_CUSTOMER'][1] = $langs->trans('CustomerAccountancyCodeShort');
719 $profid['ACCOUNTANCY_CODE_SUPPLIER'] = array();
720 $profid['ACCOUNTANCY_CODE_SUPPLIER'][0] = $langs->trans("SupplierAccountancyCodeShort");
721 $profid['ACCOUNTANCY_CODE_SUPPLIER'][1] = $langs->trans('SupplierAccountancyCodeShort');
722}
723
724$nbofloop = count($profid);
725foreach ($profid as $key => $val) {
726 if ($profid[$key][1] != '-') {
727 print '<tr class="oddeven">';
728 print '<td>'.$profid[$key][0]."</td><td>\n";
729 print $profid[$key][1];
730 print '</td>';
731
732 $idprof_unique = 'SOCIETE_'.$key.'_UNIQUE';
733 $idprof_mandatory = 'SOCIETE_'.$key.'_MANDATORY';
734 $idprof_invoice_mandatory = 'SOCIETE_'.$key.'_INVOICE_MANDATORY';
735
736 $verif = !empty($conf->global->$idprof_unique);
737 $mandatory = !empty($conf->global->$idprof_mandatory);
738 $invoice_mandatory = !empty($conf->global->$idprof_invoice_mandatory);
739
740 if ($verif) {
741 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofid&token='.newToken().'&value='.$key.'&status=0">';
742 print img_picto($langs->trans("Activated"), 'switch_on');
743 print '</a></td>';
744 } else {
745 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofid&token='.newToken().'&value='.$key.'&status=1">';
746 print img_picto($langs->trans("Disabled"), 'switch_off');
747 print '</a></td>';
748 }
749
750 if ($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');
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');
757 print '</a></td>';
758 }
759
760 if ($invoice_mandatory) {
761 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatory&token='.newToken().'&value='.$key.'&status=0">';
762 print img_picto($langs->trans("Activated"), 'switch_on');
763 print '</a></td>';
764 } else {
765 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatory&token='.newToken().'&value='.$key.'&status=1">';
766 print img_picto($langs->trans("Disabled"), 'switch_off');
767 print '</a></td>';
768 }
769
770 print "</tr>\n";
771 }
772}
773
774// VAT ID
775print '<tr class="oddeven">';
776print '<td colspan="2">'.$langs->trans('VATIntra')."</td>\n";
777$key = 'VAT_INTRA';
778if (getDolGlobalString('SOCIETE_VAT_INTRA_UNIQUE')) {
779 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofid&token='.newToken().'&value='.$key.'&status=0">';
780 print img_picto($langs->trans("Activated"), 'switch_on');
781 print '</a></td>';
782} else {
783 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofid&token='.newToken().'&value='.$key.'&status=1">';
784 print img_picto($langs->trans("Disabled"), 'switch_off');
785 print '</a></td>';
786}
787if (getDolGlobalString('SOCIETE_VAT_INTRA_MANDATORY')) {
788 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&token='.newToken().'&value='.$key.'&status=0">';
789 print img_picto($langs->trans("Activated"), 'switch_on');
790 print '</a></td>';
791} else {
792 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&token='.newToken().'&value='.$key.'&status=1">';
793 print img_picto($langs->trans("Disabled"), 'switch_off');
794 print '</a></td>';
795}
796if (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY')) {
797 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatory&token='.newToken().'&value='.$key.'&status=0">';
798 print img_picto($langs->trans("Activated"), 'switch_on');
799 print '</a></td>';
800} else {
801 print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatory&token='.newToken().'&value='.$key.'&status=1">';
802 print img_picto($langs->trans("Disabled"), 'switch_off');
803 print '</a></td>';
804}
805print "</tr>\n";
806
807print "</table>\n";
808print '</div>';
809
810print "<br>\n";
811
812print load_fiche_titre($langs->trans("Other"), '', '');
813
814// Autres options
815$form = new Form($db);
816
817print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
818print '<input type="hidden" name="token" value="'.newToken().'">';
819print '<input type="hidden" name="page_y" value="">';
820print '<input type="hidden" name="action" value="updateoptions">';
821
822print '<div class="div-table-responsive-no-min">';
823print '<table class="noborder centpercent">';
824print '<tr class="liste_titre">';
825print "<td>".$langs->trans("Parameters")."</td>\n";
826print '<td class="right" width="60">'.$langs->trans("Value").'</td>'."\n";
827print '<td width="80">&nbsp;</td></tr>'."\n";
828
829// Utilisation formulaire Ajax sur choix societe
830
831print '<tr class="oddeven">';
832print '<td width="80%">'.$form->textwithpicto($langs->trans("DelaiedFullListToSelectCompany"), $langs->trans('UseSearchToSelectCompanyTooltip'), 1).' </td>';
833if (!$conf->use_javascript_ajax) {
834 print '<td class="nowrap right" colspan="2">';
835 print $langs->trans("NotAvailableWhenAjaxDisabled");
836 print "</td>";
837} else {
838 print '<td width="60" class="right">';
839 $arrval = array('0' => $langs->trans("No"),
840 '1' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
841 '2' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
842 '3' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
843 );
844 print $form->selectarray("activate_COMPANY_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT'), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
845 print '</td><td class="right">';
846 print '<input type="submit" class="button small reposition" name="COMPANY_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
847 print "</td>";
848}
849print '</tr>';
850
851
852print '<tr class="oddeven">';
853print '<td width="80%">'.$form->textwithpicto($langs->trans("DelaiedFullListToSelectContact"), $langs->trans('UseSearchToSelectContactTooltip'), 1).'</td>';
854if (!$conf->use_javascript_ajax) {
855 print '<td class="nowrap right" colspan="2">';
856 print $langs->trans("NotAvailableWhenAjaxDisabled");
857 print "</td>";
858} else {
859 print '<td width="60" class="right">';
860 $arrval = array('0' => $langs->trans("No"),
861 '1' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
862 '2' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
863 '3' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
864 );
865 print $form->selectarray("activate_CONTACT_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT'), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
866 print '</td><td class="right">';
867 print '<input type="submit" class="button small reposition" name="CONTACT_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
868 print "</td>";
869}
870print '</tr>';
871
872
873
874print '<tr class="oddeven">';
875print '<td width="80%">'.$langs->trans("AddRefInList").'</td>';
876print '<td>&nbsp;</td>';
877print '<td class="center">';
878if (getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
879 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddrefinlist&token='.newToken().'&value=0">';
880 print img_picto($langs->trans("Activated"), 'switch_on');
881} else {
882 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddrefinlist&token='.newToken().'&value=1">';
883 print img_picto($langs->trans("Disabled"), 'switch_off');
884}
885print '</a></td>';
886print '</tr>';
887
888print '<tr class="oddeven">';
889print '<td width="80%">'.$langs->trans("AddVatInList").'</td>';
890print '<td>&nbsp;</td>';
891print '<td class="center">';
892if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST')) {
893 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setvatinlist&token='.newToken().'&value=0">';
894 print img_picto($langs->trans("Activated"), 'switch_on');
895} else {
896 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setvatinlist&token='.newToken().'&value=1">';
897 print img_picto($langs->trans("Disabled"), 'switch_off');
898}
899print '</a></td>';
900print '</tr>';
901
902print '<tr class="oddeven">';
903print '<td width="80%">'.$langs->trans("AddAdressInList").'</td>';
904print '<td>&nbsp;</td>';
905print '<td class="center">';
906if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
907 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddadressinlist&token='.newToken().'&value=0">';
908 print img_picto($langs->trans("Activated"), 'switch_on');
909} else {
910 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddadressinlist&token='.newToken().'&value=1">';
911 print img_picto($langs->trans("Disabled"), 'switch_off');
912}
913print '</a></td>';
914print '</tr>';
915
916print '<tr class="oddeven">';
917print '<td width="80%">'.$langs->trans("AddEmailPhoneTownInContactList").'</td>';
918print '<td>&nbsp;</td>';
919print '<td class="center">';
920if (getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
921 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddemailphonetownincontactlist&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=setaddemailphonetownincontactlist&token='.newToken().'&value=1">';
925 print img_picto($langs->trans("Disabled"), 'switch_off');
926}
927print '</a></td>';
928print '</tr>';
929
930if (isModEnabled("shipping")) {
931 if (getDolGlobalInt('MAIN_FEATURES_LEVEL') > 0) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal)
932 print '<tr class="oddeven">';
933 print '<td width="80%">'.$langs->trans("AskForPreferredShippingMethod").'</td>';
934 print '<td>&nbsp;</td>';
935 print '<td class="center">';
936 if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD')) {
937 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaskforshippingmet&token='.newToken().'&value=0">';
938 print img_picto($langs->trans("Activated"), 'switch_on');
939 } else {
940 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaskforshippingmet&token='.newToken().'&value=1">';
941 print img_picto($langs->trans("Disabled"), 'switch_off');
942 }
943 print '</a></td>';
944 print '</tr>';
945 }
946}
947
948// Disable Prospect/Customer thirdparty type
949print '<tr class="oddeven">';
950print '<td width="80%">'.$langs->trans("DisableProspectCustomerType").'</td>';
951print '<td>&nbsp;</td>';
952print '<td class="center">';
953if (getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) {
954 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setdisableprospectcustomer&token='.newToken().'&value=0">';
955 print img_picto($langs->trans("Activated"), 'switch_on');
956} else {
957 print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setdisableprospectcustomer&token='.newToken().'&value=1">';
958 print img_picto($langs->trans("Disabled"), 'switch_off');
959}
960print '</a></td>';
961print '</tr>';
962
963if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) {
964 // Default Prospect/Customer thirdparty type on customer création
965 print '<tr class="oddeven">';
966 print '<td>'.$langs->trans("DefaultCustomerType").'</td>';
967 print '<td>';
968 print $formcompany->selectProspectCustomerType(getDolGlobalString('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT'), 'defaultcustomertype', 'defaultcustomertype', 'admin');
969 print '</td>';
970 print '<td class="center">';
971 print '<input type="submit" class="button small reposition" name="THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT" value="'.$langs->trans("Modify").'">';
972 print '</td>';
973 print '</tr>';
974}
975
976if (getDolGlobalString('THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION')) {
977 print '<tr class="oddeven">';
978 print '<td width="80%">'.$langs->trans('ContactsDefaultRoles').'</td>';
979 if (!$conf->use_javascript_ajax) {
980 print '<td class="nowrap right" colspan="2">';
981 print $langs->trans("NotAvailableWhenAjaxDisabled");
982 print "</td>";
983 } else {
984 print '<td width="60" class="right">';
985 $contact = new Contact($db); // InfraS add
986 $contactType = $contact->listeTypeContacts('external', 0, 1);
987 $selected = explode(',', getDolGlobalString('CONTACTS_DEFAULT_ROLES'));
988 print $form->multiselectarray('activate_CONTACTS_DEFAULT_ROLES', $contactType, $selected, 0, 0, 'minwidth75imp');
989 print '</td><td class="right">';
990 print '<input type="submit" class="button small eposition" name="CONTACTS_DEFAULT_ROLES" value="'.$langs->trans("Modify").'">';
991 print "</td>";
992 }
993 print '</tr>';
994}
995
996print '</table>';
997print '</div>';
998
999print '</form>';
1000
1001
1002print dol_get_fiche_end();
1003
1004// End of page
1005llxFooter();
1006$db->close();
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).
versionphparray()
Return version PHP.
versioncompare($versionarray1, $versionarray2)
Compare 2 versions (stored into 2 arrays).
Definition admin.lib.php:69
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:71
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.
llxFooter()
Footer empty.
Definition document.php:107
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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)
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)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.