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