28 require
'../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
33 $langs->loadLangs(array(
"admin",
"companies",
"other"));
35 $action =
GETPOST(
'action',
'aZ09');
36 $value =
GETPOST(
'value',
'alpha');
48 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
50 if ($action ==
'setcodeclient')
52 if (
dolibarr_set_const($db,
"SOCIETE_CODECLIENT_ADDON", $value,
'chaine', 0,
'', $conf->entity) > 0)
54 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
61 if ($action ==
'setcodecompta')
63 if (
dolibarr_set_const($db,
"SOCIETE_CODECOMPTA_ADDON", $value,
'chaine', 0,
'', $conf->entity) > 0)
65 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
72 if ($action ==
'updateoptions')
74 if (
GETPOST(
'COMPANY_USE_SEARCH_TO_SELECT'))
76 $companysearch =
GETPOST(
'activate_COMPANY_USE_SEARCH_TO_SELECT',
'alpha');
77 $res =
dolibarr_set_const($db,
"COMPANY_USE_SEARCH_TO_SELECT", $companysearch,
'chaine', 0,
'', $conf->entity);
78 if (!($res > 0)) $error++;
87 if (
GETPOST(
'CONTACT_USE_SEARCH_TO_SELECT'))
89 $contactsearch =
GETPOST(
'activate_CONTACT_USE_SEARCH_TO_SELECT',
'alpha');
90 $res =
dolibarr_set_const($db,
"CONTACT_USE_SEARCH_TO_SELECT", $contactsearch,
'chaine', 0,
'', $conf->entity);
91 if (!($res > 0)) $error++;
100 if (
GETPOST(
'THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT'))
102 $customertypedefault =
GETPOST(
'defaultcustomertype',
'int');
103 $res =
dolibarr_set_const($db,
"THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT", $customertypedefault,
'chaine', 0,
'', $conf->entity);
104 if (!($res > 0)) $error++;
115 if ($action ==
'set')
117 $label =
GETPOST(
'label',
'alpha');
118 $scandir =
GETPOST(
'scan_dir',
'alpha');
121 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity, libelle, description)";
122 $sql .=
" VALUES ('".$db->escape($value).
"','".$db->escape($type).
"',".$conf->entity.
", ";
123 $sql .= ($label ?
"'".$db->escape($label).
"'" :
'null').
", ";
124 $sql .= (!empty($scandir) ?
"'".$db->escape($scandir).
"'" :
"null");
127 $resql = $db->query($sql);
132 if ($action ==
'del')
135 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"document_model";
136 $sql .=
" WHERE nom='".$db->escape($value).
"' AND type='".$db->escape($type).
"' AND entity=".$conf->entity;
137 $resql = $db->query($sql);
142 if ($action ==
'setdoc')
144 $label =
GETPOST(
'label',
'alpha');
145 $scandir =
GETPOST(
'scan_dir',
'alpha');
153 $sql_del =
"DELETE FROM ".MAIN_DB_PREFIX.
"document_model";
154 $sql_del .=
" WHERE nom = '".$db->escape(
GETPOST(
'value',
'alpha')).
"'";
155 $sql_del .=
" AND type = '".$db->escape($type).
"'";
156 $sql_del .=
" AND entity = ".$conf->entity;
158 $result1 = $db->query($sql_del);
160 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity, libelle, description)";
161 $sql .=
" VALUES ('".$db->escape($value).
"', '".$db->escape($type).
"', ".$conf->entity.
", ";
162 $sql .= ($label ?
"'".$db->escape($label).
"'" :
'null').
", ";
163 $sql .= (!empty($scandir) ?
"'".$db->escape($scandir).
"'" :
"null");
166 $result2 = $db->query($sql);
167 if ($result1 && $result2)
176 if ($action ==
"setaddrefinlist") {
177 $setaddrefinlist =
GETPOST(
'value',
'int');
178 $res =
dolibarr_set_const($db,
"SOCIETE_ADD_REF_IN_LIST", $setaddrefinlist,
'yesno', 0,
'', $conf->entity);
179 if (!($res > 0)) $error++;
189 if ($action ==
"setaddadressinlist") {
190 $val =
GETPOST(
'value',
'int');
191 $res =
dolibarr_set_const($db,
"COMPANY_SHOW_ADDRESS_SELECTLIST", $val,
'yesno', 0,
'', $conf->entity);
192 if (!($res > 0)) $error++;
202 if ($action ==
"setaddemailphonetownincontactlist") {
203 $val =
GETPOST(
'value',
'int');
204 $res =
dolibarr_set_const($db,
"CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST", $val,
'yesno', 0,
'', $conf->entity);
205 if (!($res > 0)) $error++;
214 if ($action ==
"setaskforshippingmet") {
215 $setaskforshippingmet =
GETPOST(
'value',
'int');
216 $res =
dolibarr_set_const($db,
"SOCIETE_ASK_FOR_SHIPPING_METHOD", $setaskforshippingmet,
'yesno', 0,
'', $conf->entity);
217 if (!($res > 0)) $error++;
227 if ($action ==
"setdisableprospectcustomer") {
228 $setdisableprospectcustomer =
GETPOST(
'value',
'int');
229 $res =
dolibarr_set_const($db,
"SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer,
'yesno', 0,
'', $conf->entity);
230 if (!($res > 0)) $error++;
240 if ($action ==
'setprofid')
242 $status =
GETPOST(
'status',
'alpha');
244 $idprof =
"SOCIETE_".$value.
"_UNIQUE";
255 if ($action ==
'setprofidmandatory')
257 $status =
GETPOST(
'status',
'alpha');
259 $idprof =
"SOCIETE_".$value.
"_MANDATORY";
270 if ($action ==
'setprofidinvoicemandatory')
272 $status =
GETPOST(
'status',
'alpha');
274 $idprof =
"SOCIETE_".$value.
"_INVOICE_MANDATORY";
285 if ($action ==
'sethideinactivethirdparty')
287 $status =
GETPOST(
'status',
'alpha');
289 if (
dolibarr_set_const($db,
"COMPANY_HIDE_INACTIVE_IN_COMBOBOX", $status,
'chaine', 0,
'', $conf->entity) > 0)
291 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
297 if ($action ==
'setonsearchandlistgooncustomerorsuppliercard') {
298 $setonsearchandlistgooncustomerorsuppliercard =
GETPOST(
'value',
'int');
299 $res =
dolibarr_set_const($db,
"SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard,
'yesno', 0,
'', $conf->entity);
300 if (!($res > 0)) $error++;
315 $form =
new Form($db);
317 $help_url =
'EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers|ES:Configuración_del_módulo_terceros';
318 llxHeader(
'', $langs->trans(
"CompanySetup"), $help_url);
320 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
328 $dirsociete = array_merge(array(
'/core/modules/societe/'), $conf->modules_parts[
'societe']);
329 foreach ($conf->modules_parts[
'models'] as $mo) $dirsociete[] = $mo.
'core/modules/societe/';
335 print '<div class="div-table-responsive-no-min">';
336 print
'<table class="noborder centpercent">'.
"\n";
337 print
'<tr class="liste_titre">'.
"\n";
338 print
' <td>'.$langs->trans(
"Name").
'</td>';
339 print
' <td>'.$langs->trans(
"Description").
'</td>';
340 print
' <td>'.$langs->trans(
"Example").
'</td>';
341 print
' <td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
342 print
' <td class="center" width="60">'.$langs->trans(
"ShortInfo").
'</td>';
345 $arrayofmodules = array();
347 foreach ($dirsociete as $dirroot)
351 $handle = @opendir($dir);
352 if (is_resource($handle))
355 while (($file = readdir($handle)) !==
false)
357 if (substr($file, 0, 15) ==
'mod_codeclient_' && substr($file, -3) ==
'php')
359 $file = substr($file, 0,
dol_strlen($file) - 4);
368 $modCodeTiers =
new $file;
371 if ($modCodeTiers->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2)
continue;
372 if ($modCodeTiers->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1)
continue;
374 $arrayofmodules[$file] = $modCodeTiers;
383 foreach ($arrayofmodules as $file => $modCodeTiers)
385 print
'<tr class="oddeven">'.
"\n";
386 print
'<td width="140">'.$modCodeTiers->name.
'</td>'.
"\n";
387 print
'<td>'.$modCodeTiers->info($langs).
'</td>'.
"\n";
388 print
'<td class="nowrap">'.$modCodeTiers->getExample($langs).
'</td>'.
"\n";
390 if ($conf->global->SOCIETE_CODECLIENT_ADDON ==
"$file")
392 print
'<td class="center">'.
"\n";
393 print
img_picto($langs->trans(
"Activated"),
'switch_on');
396 $disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings[
'referent']) && $mc->sharings[
'referent'] != $conf->entity) ?
true :
false);
397 print
'<td class="center">';
398 if (!$disabled) print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setcodeclient&token='.
newToken().
'&value='.urlencode($file).
'">';
399 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
400 if (!$disabled) print
'</a>';
404 print
'<td class="center">';
405 $s = $modCodeTiers->getToolTip($langs, null, -1);
406 print $form->textwithpicto(
'', $s, 1);
421 print
'<div class="div-table-responsive-no-min">';
422 print
'<table class="noborder centpercent">';
423 print
'<tr class="liste_titre">';
424 print
'<td width="140">'.$langs->trans(
"Name").
'</td>';
425 print
'<td>'.$langs->trans(
"Description").
'</td>';
426 print
'<td>'.$langs->trans(
"Example").
'</td>';
427 print
'<td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
428 print
'<td class="center" width="60">'.$langs->trans(
"ShortInfo").
'</td>';
431 $arrayofmodules = array();
433 foreach ($dirsociete as $dirroot)
437 $handle = @opendir($dir);
438 if (is_resource($handle))
440 while (($file = readdir($handle)) !==
false)
442 if (substr($file, 0, 15) ==
'mod_codecompta_' && substr($file, -3) ==
'php')
444 $file = substr($file, 0,
dol_strlen($file) - 4);
453 $modCodeCompta =
new $file;
455 $arrayofmodules[$file] = $modCodeCompta;
465 foreach ($arrayofmodules as $file => $modCodeCompta)
467 print
'<tr class="oddeven">';
468 print
'<td>'.$modCodeCompta->name.
"</td><td>\n";
469 print $modCodeCompta->info($langs);
471 print
'<td class="nowrap">'.$modCodeCompta->getExample($langs).
"</td>\n";
473 if ($conf->global->SOCIETE_CODECOMPTA_ADDON ==
"$file")
475 print
'<td class="center">';
476 print
img_picto($langs->trans(
"Activated"),
'switch_on');
479 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setcodecompta&token='.
newToken().
'&value='.urlencode($file).
'">';
480 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
483 print
'<td class="center">';
484 $s = $modCodeCompta->getToolTip($langs, null, -1);
485 print $form->textwithpicto(
'', $s, 1);
502 $sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
503 $sql .=
" WHERE type = 'company'";
504 $sql .=
" AND entity = ".$conf->entity;
505 $resql = $db->query($sql);
509 $num_rows = $db->num_rows(
$resql);
510 while ($i < $num_rows)
512 $array = $db->fetch_array(
$resql);
513 array_push($def, $array[0]);
520 print
'<div class="div-table-responsive-no-min">';
521 print
'<table class="noborder centpercent">';
522 print
'<tr class="liste_titre">';
523 print
'<td width="140">'.$langs->trans(
"Name").
'</td>';
524 print
'<td>'.$langs->trans(
"Description").
'</td>';
525 print
'<td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
526 print
'<td class="center" width="60">'.$langs->trans(
"ShortInfo").
'</td>';
527 print
'<td class="center" width="60">'.$langs->trans(
"Preview").
'</td>';
530 foreach ($dirsociete as $dirroot)
534 $handle = @opendir($dir);
535 if (is_resource($handle))
537 while (($file = readdir($handle)) !==
false)
539 if (preg_match(
'/\.modules\.php$/i', $file))
541 $name = substr($file, 4,
dol_strlen($file) - 16);
542 $classname = substr($file, 0,
dol_strlen($file) - 12);
551 $module =
new $classname($db);
553 $modulequalified = 1;
554 if (!empty($module->version)) {
555 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
556 elseif ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
559 if ($modulequalified)
561 print
'<tr class="oddeven"><td width="100">';
564 if (method_exists($module,
'info')) print $module->info($langs);
565 else print $module->description;
569 if (in_array($name, $def))
571 print
"<td class=\"center\">\n";
574 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=del&value='.$name.
'&token='.
newToken().
'&scan_dir='.$module->scandir.
'&label='.urlencode($module->name).
'">';
575 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
586 print
'<td class="center">'.
"\n";
590 print
'<td class="center">'.
"\n";
591 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set&value='.$name.
'&token='.
newToken().
'&scan_dir='.$module->scandir.
'&label='.urlencode($module->name).
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
597 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
598 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
599 if ($module->type ==
'pdf')
601 $htmltooltip .=
'<br>'.$langs->trans(
"Height").
'/'.$langs->trans(
"Width").
': '.$module->page_hauteur.
'/'.$module->page_largeur;
603 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
604 $htmltooltip .=
'<br>'.$langs->trans(
"WatermarkOnDraft").
': '.
yn((!empty($module->option_draft_watermark) ? $module->option_draft_watermark :
''), 1, 1);
606 print
'<td class="center nowrap">';
607 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
611 print
'<td class="center nowrap">';
612 if ($module->type ==
'pdf')
614 $linkspec =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&token='.
newToken().
'&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'bill').
'</a>';
616 $linkspec =
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
636 print
'<div class="div-table-responsive-no-min">';
637 print
'<table class="noborder centpercent">';
638 print
'<tr class="liste_titre">';
639 print
'<td>'.$langs->trans(
"Name").
'</td>';
640 print
'<td>'.$langs->trans(
"Description").
'</td>';
641 print
'<td class="center">'.$langs->trans(
"MustBeUnique").
'</td>';
642 print
'<td class="center">'.$langs->trans(
"MustBeMandatory").
'</td>';
643 print
'<td class="center">'.$langs->trans(
"MustBeInvoiceMandatory").
'</td>';
646 $profid[
'IDPROF1'][0] = $langs->trans(
"ProfId1");
647 $profid[
'IDPROF1'][1] = $langs->transcountry(
'ProfId1', $mysoc->country_code);
648 $profid[
'IDPROF2'][0] = $langs->trans(
"ProfId2");
649 $profid[
'IDPROF2'][1] = $langs->transcountry(
'ProfId2', $mysoc->country_code);
650 $profid[
'IDPROF3'][0] = $langs->trans(
"ProfId3");
651 $profid[
'IDPROF3'][1] = $langs->transcountry(
'ProfId3', $mysoc->country_code);
652 $profid[
'IDPROF4'][0] = $langs->trans(
"ProfId4");
653 $profid[
'IDPROF4'][1] = $langs->transcountry(
'ProfId4', $mysoc->country_code);
654 $profid[
'IDPROF5'][0] = $langs->trans(
"ProfId5");
655 $profid[
'IDPROF5'][1] = $langs->transcountry(
'ProfId5', $mysoc->country_code);
656 $profid[
'IDPROF6'][0] = $langs->trans(
"ProfId6");
657 $profid[
'IDPROF6'][1] = $langs->transcountry(
'ProfId6', $mysoc->country_code);
658 $profid[
'EMAIL'][0] = $langs->trans(
"EMail");
659 $profid[
'EMAIL'][1] = $langs->trans(
'Email');
661 $nbofloop = count($profid);
662 foreach ($profid as $key => $val)
664 if ($profid[$key][1] !=
'-')
666 print
'<tr class="oddeven">';
667 print
'<td>'.$profid[$key][0].
"</td><td>\n";
668 print $profid[$key][1];
671 $idprof_unique =
'SOCIETE_'.$key.
'_UNIQUE';
672 $idprof_mandatory =
'SOCIETE_'.$key.
'_MANDATORY';
673 $idprof_invoice_mandatory =
'SOCIETE_'.$key.
'_INVOICE_MANDATORY';
675 $verif = (empty($conf->global->$idprof_unique) ?
false:
true);
676 $mandatory = (empty($conf->global->$idprof_mandatory) ?
false:
true);
677 $invoice_mandatory = (empty($conf->global->$idprof_invoice_mandatory) ?
false:
true);
681 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofid&token='.
newToken().
'&value='.$key.
'&status=0">';
682 print
img_picto($langs->trans(
"Activated"),
'switch_on');
685 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofid&token='.
newToken().
'&value='.$key.
'&status=1">';
686 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
692 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidmandatory&token='.
newToken().
'&value='.$key.
'&status=0">';
693 print
img_picto($langs->trans(
"Activated"),
'switch_on');
696 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidmandator&token='.
newToken().
'&value='.$key.
'&status=1">';
697 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
701 if ($invoice_mandatory)
703 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatory&token='.
newToken().
'&value='.$key.
'&status=0">';
704 print
img_picto($langs->trans(
"Activated"),
'switch_on');
707 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatory&token='.
newToken().
'&value='.$key.
'&status=1">';
708 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
725 $form =
new Form($db);
727 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
728 print
'<input type="hidden" name="token" value="'.newToken().
'">';
729 print
'<input type="hidden" name="action" value="updateoptions">';
731 print
'<div class="div-table-responsive-no-min">';
732 print
'<table class="noborder centpercent">';
733 print
'<tr class="liste_titre">';
734 print
"<td>".$langs->trans(
"Parameters").
"</td>\n";
735 print
'<td class="right" width="60">'.$langs->trans(
"Value").
'</td>'.
"\n";
736 print
'<td width="80"> </td></tr>'.
"\n";
740 print
'<tr class="oddeven">';
741 print
'<td width="80%">'.$form->textwithpicto($langs->trans(
"DelaiedFullListToSelectCompany"), $langs->trans(
'UseSearchToSelectCompanyTooltip'), 1).
' </td>';
742 if (!$conf->use_javascript_ajax)
744 print
'<td class="nowrap right" colspan="2">';
745 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
748 print
'<td width="60" class="right">';
749 $arrval = array(
'0'=>$langs->trans(
"No"),
750 '1'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 1).
')',
751 '2'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 2).
')',
752 '3'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 3).
')',
754 print $form->selectarray(
"activate_COMPANY_USE_SEARCH_TO_SELECT", $arrval, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth75imp');
755 print
'</td><td class="right">';
756 print
'<input type="submit" class="button" name="COMPANY_USE_SEARCH_TO_SELECT" value="'.$langs->trans(
"Modify").
'">';
762 print
'<tr class="oddeven">';
763 print
'<td width="80%">'.$form->textwithpicto($langs->trans(
"DelaiedFullListToSelectContact"), $langs->trans(
'UseSearchToSelectContactTooltip'), 1).
'</td>';
764 if (!$conf->use_javascript_ajax)
766 print
'<td class="nowrap right" colspan="2">';
767 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
770 print
'<td width="60" class="right">';
771 $arrval = array(
'0'=>$langs->trans(
"No"),
772 '1'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 1).
')',
773 '2'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 2).
')',
774 '3'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 3).
')',
776 print $form->selectarray(
"activate_CONTACT_USE_SEARCH_TO_SELECT", $arrval, $conf->global->CONTACT_USE_SEARCH_TO_SELECT, 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth75imp');
777 print
'</td><td class="right">';
778 print
'<input type="submit" class="button" name="CONTACT_USE_SEARCH_TO_SELECT" value="'.$langs->trans(
"Modify").
'">';
785 print
'<tr class="oddeven">';
786 print
'<td width="80%">'.$langs->trans(
"AddRefInList").
'</td>';
787 print
'<td> </td>';
788 print
'<td class="center">';
789 if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST))
791 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddrefinlist&token='.
newToken().
'&value=0">';
792 print
img_picto($langs->trans(
"Activated"),
'switch_on');
794 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddrefinlist&token='.
newToken().
'&value=1">';
795 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
800 print
'<tr class="oddeven">';
801 print
'<td width="80%">'.$langs->trans(
"AddAdressInList").
'</td>';
802 print
'<td> </td>';
803 print
'<td class="center">';
804 if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST))
806 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddadressinlist&token='.
newToken().
'&value=0">';
807 print
img_picto($langs->trans(
"Activated"),
'switch_on');
809 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddadressinlist&token='.
newToken().
'&value=1">';
810 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
815 print
'<tr class="oddeven">';
816 print
'<td width="80%">'.$langs->trans(
"AddEmailPhoneTownInContactList").
'</td>';
817 print
'<td> </td>';
818 print
'<td class="center">';
819 if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
820 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddemailphonetownincontactlist&token='.
newToken().
'&value=0">';
821 print
img_picto($langs->trans(
"Activated"),
'switch_on');
823 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddemailphonetownincontactlist&token='.
newToken().
'&value=1">';
824 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
829 if (!empty($conf->expedition->enabled)) {
830 if (!empty($conf->global->MAIN_FEATURES_LEVEL)) {
831 print
'<tr class="oddeven">';
832 print
'<td width="80%">'.$langs->trans(
"AskForPreferredShippingMethod").
'</td>';
833 print
'<td> </td>';
834 print
'<td class="center">';
835 if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD))
837 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaskforshippingmet&token='.
newToken().
'&value=0">';
838 print
img_picto($langs->trans(
"Activated"),
'switch_on');
840 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaskforshippingmet&token='.
newToken().
'&value=1">';
841 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
849 print
'<tr class="oddeven">';
850 print
'<td width="80%">'.$langs->trans(
"DisableProspectCustomerType").
'</td>';
851 print
'<td> </td>';
852 print
'<td class="center">';
853 if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS))
855 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setdisableprospectcustomer&token='.
newToken().
'&value=0">';
856 print
img_picto($langs->trans(
"Activated"),
'switch_on');
858 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setdisableprospectcustomer&token='.
newToken().
'&value=1">';
859 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
865 print
'<tr class="oddeven">';
866 print
'<td width="80%">'.$langs->trans(
"DefaultCustomerType").
'</td>';
868 print $formcompany->selectProspectCustomerType($conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT,
'defaultcustomertype',
'defaultcustomertype',
'admin');
870 print
'<td class="center">';
871 print
'<input type="submit" class="button" name="THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT" value="'.$langs->trans(
"Modify").
'">';
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname= '')
Make an include_once using default root and alternate root if it fails.
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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).
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
societe_admin_prepare_head()
Return array head with list of tabs to view object informations.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
versioncompare($versionarray1, $versionarray2)
Compare 2 versions (stored into 2 arrays).
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_sort_array(&$array, $index, $order= 'asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
versionphparray()
Return version PHP.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...