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