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