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