29 require
'../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
34 $langs->loadLangs(array(
"admin",
"companies",
"other"));
36 $action =
GETPOST(
'action',
'aZ09');
37 $value =
GETPOST(
'value',
'alpha');
38 $modulepart =
GETPOST(
'modulepart',
'aZ09');
52 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
54 if ($action ==
'setcodeclient') {
55 $result =
dolibarr_set_const($db,
"SOCIETE_CODECLIENT_ADDON", $value,
'chaine', 0,
'', $conf->entity);
61 if ($action ==
'setcodecompta') {
62 $result =
dolibarr_set_const($db,
"SOCIETE_CODECOMPTA_ADDON", $value,
'chaine', 0,
'', $conf->entity);
68 if ($action ==
'updateoptions') {
69 if (
GETPOST(
'COMPANY_USE_SEARCH_TO_SELECT')) {
70 $companysearch =
GETPOST(
'activate_COMPANY_USE_SEARCH_TO_SELECT',
'alpha');
71 $res =
dolibarr_set_const($db,
"COMPANY_USE_SEARCH_TO_SELECT", $companysearch,
'chaine', 0,
'', $conf->entity);
82 if (
GETPOST(
'CONTACT_USE_SEARCH_TO_SELECT')) {
83 $contactsearch =
GETPOST(
'activate_CONTACT_USE_SEARCH_TO_SELECT',
'alpha');
84 $res =
dolibarr_set_const($db,
"CONTACT_USE_SEARCH_TO_SELECT", $contactsearch,
'chaine', 0,
'', $conf->entity);
95 if (
GETPOST(
'THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')) {
96 $customertypedefault =
GETPOST(
'defaultcustomertype',
'int');
97 $res =
dolibarr_set_const($db,
"THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT", $customertypedefault,
'chaine', 0,
'', $conf->entity);
110 if ($action ==
'set') {
111 $label =
GETPOST(
'label',
'alpha');
112 $scandir =
GETPOST(
'scan_dir',
'alpha');
115 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity, libelle, description)";
116 $sql .=
" VALUES ('".$db->escape($value).
"', '".$db->escape($type).
"', ".((int) $conf->entity).
", ";
117 $sql .= ($label ?
"'".$db->escape($label).
"'" :
'null').
", ";
118 $sql .= (!empty($scandir) ?
"'".$db->escape($scandir).
"'" :
"null");
121 $resql = $db->query(
$sql);
128 if ($action ==
'del') {
130 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"document_model";
131 $sql .=
" WHERE nom='".$db->escape($value).
"' AND type='".$db->escape($type).
"' AND entity=".((int) $conf->entity);
132 $resql = $db->query(
$sql);
139 if ($action ==
'setdoc') {
140 $label =
GETPOST(
'label',
'alpha');
141 $scandir =
GETPOST(
'scan_dir',
'alpha');
149 $sql_del =
"DELETE FROM ".MAIN_DB_PREFIX.
"document_model";
150 $sql_del .=
" WHERE nom = '".$db->escape(
GETPOST(
'value',
'alpha')).
"'";
151 $sql_del .=
" AND type = '".$db->escape($type).
"'";
152 $sql_del .=
" AND entity = ".((int) $conf->entity);
154 $result1 = $db->query($sql_del);
156 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity, libelle, description)";
157 $sql .=
" VALUES ('".$db->escape($value).
"', '".$db->escape($type).
"', ".((int) $conf->entity).
", ";
158 $sql .= ($label ?
"'".$db->escape($label).
"'" :
'null').
", ";
159 $sql .= (!empty($scandir) ?
"'".$db->escape($scandir).
"'" :
"null");
162 $result2 = $db->query(
$sql);
163 if ($result1 && $result2) {
171 if ($action ==
"setaccountancycodecustomerinvoicemandatory") {
172 $setaccountancycodecustomerinvoicemandatory =
GETPOST(
'value',
'int');
173 $res =
dolibarr_set_const($db,
"SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_INVOICE_MANDATORY", $setaccountancycodecustomerinvoicemandatory,
'yesno', 0,
'', $conf->entity);
185 if ($action ==
"setvatintraunique") {
186 $setvatintraunique =
GETPOST(
'value',
'int');
187 $res =
dolibarr_set_const($db,
"SOCIETE_VAT_INTRA_UNIQUE", $setvatintraunique,
'yesno', 0,
'', $conf->entity);
199 if ($action ==
"setaddrefinlist") {
200 $setaddrefinlist =
GETPOST(
'value',
'int');
201 $res =
dolibarr_set_const($db,
"SOCIETE_ADD_REF_IN_LIST", $setaddrefinlist,
'yesno', 0,
'', $conf->entity);
213 if ($action ==
"setvatinlist") {
214 $setvatinlist =
GETPOST(
'value',
'int');
215 $res =
dolibarr_set_const($db,
"SOCIETE_SHOW_VAT_IN_LIST", $setvatinlist,
'yesno', 0,
'', $conf->entity);
227 if ($action ==
"setaddadressinlist") {
228 $val =
GETPOST(
'value',
'int');
229 $res =
dolibarr_set_const($db,
"COMPANY_SHOW_ADDRESS_SELECTLIST", $val,
'yesno', 0,
'', $conf->entity);
241 if ($action ==
"setaddemailphonetownincontactlist") {
242 $val =
GETPOST(
'value',
'int');
243 $res =
dolibarr_set_const($db,
"CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST", $val,
'yesno', 0,
'', $conf->entity);
255 if ($action ==
"setaskforshippingmet") {
256 $setaskforshippingmet =
GETPOST(
'value',
'int');
257 $res =
dolibarr_set_const($db,
"SOCIETE_ASK_FOR_SHIPPING_METHOD", $setaskforshippingmet,
'yesno', 0,
'', $conf->entity);
269 if ($action ==
"setdisableprospectcustomer") {
270 $setdisableprospectcustomer =
GETPOST(
'value',
'int');
271 $res =
dolibarr_set_const($db,
"SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer,
'yesno', 0,
'', $conf->entity);
283 if ($action ==
'setprofid') {
284 $status =
GETPOST(
'status',
'alpha');
286 $idprof =
"SOCIETE_".$value.
"_UNIQUE";
294 if ($action ==
'setprofidmandatory') {
295 $status =
GETPOST(
'status',
'alpha');
297 $idprof =
"SOCIETE_".$value.
"_MANDATORY";
305 if ($action ==
'setprofidinvoicemandatory') {
306 $status =
GETPOST(
'status',
'alpha');
308 $idprof =
"SOCIETE_".$value.
"_INVOICE_MANDATORY";
316 if ($action ==
'sethideinactivethirdparty') {
317 $status =
GETPOST(
'status',
'alpha');
319 $result =
dolibarr_set_const($db,
"COMPANY_HIDE_INACTIVE_IN_COMBOBOX", $status,
'chaine', 0,
'', $conf->entity);
324 if ($action ==
'setonsearchandlistgooncustomerorsuppliercard') {
325 $setonsearchandlistgooncustomerorsuppliercard =
GETPOST(
'value',
'int');
326 $res =
dolibarr_set_const($db,
"SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard,
'yesno', 0,
'', $conf->entity);
346 $help_url =
'EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers|ES:Configuración_del_módulo_terceros';
349 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
350 print
load_fiche_titre($langs->trans(
"CompanySetup"), $linkback,
'title_setup');
355 print
dol_get_fiche_head($head,
'general', $langs->trans(
"ThirdParties"), -1,
'company');
357 $dirsociete = array_merge(array(
'/core/modules/societe/'), $conf->modules_parts[
'societe']);
358 foreach ($conf->modules_parts[
'models'] as $mo) {
359 $dirsociete[] = $mo.
'core/modules/societe/';
366 print
'<div class="div-table-responsive-no-min">';
367 print
'<table class="noborder centpercent">'.
"\n";
368 print
'<tr class="liste_titre">'.
"\n";
369 print
' <td>'.$langs->trans(
"Name").
'</td>';
370 print
' <td>'.$langs->trans(
"Description").
'</td>';
371 print
' <td>'.$langs->trans(
"Example").
'</td>';
372 print
' <td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
373 print
' <td class="center" width="60">'.$langs->trans(
"ShortInfo").
'</td>';
376 $arrayofmodules = array();
378 foreach ($dirsociete as $dirroot) {
381 $handle = @opendir($dir);
382 if (is_resource($handle)) {
384 while (($file = readdir($handle)) !==
false) {
385 if (substr($file, 0, 15) ==
'mod_codeclient_' && substr($file, -3) ==
'php') {
386 $file = substr($file, 0,
dol_strlen($file) - 4);
394 $modCodeTiers =
new $file;
397 if ($modCodeTiers->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
400 if ($modCodeTiers->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
404 $arrayofmodules[$file] = $modCodeTiers;
413 foreach ($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";
419 if ($conf->global->SOCIETE_CODECLIENT_ADDON ==
"$file") {
420 print
'<td class="center">'.
"\n";
421 print
img_picto($langs->trans(
"Activated"),
'switch_on');
424 $disabled = (
isModEnabled(
'multicompany') && (is_object($mc) && !empty($mc->sharings[
'referent']) && $mc->sharings[
'referent'] != $conf->entity) ?
true :
false);
425 print
'<td class="center">';
427 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setcodeclient&token='.
newToken().
'&value='.urlencode($file).
'">';
429 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
436 print
'<td class="center">';
437 $s = $modCodeTiers->getToolTip($langs,
null, -1);
438 print
$form->textwithpicto(
'', $s, 1);
453 print
'<div class="div-table-responsive-no-min">';
454 print
'<table class="noborder centpercent">';
455 print
'<tr class="liste_titre">';
456 print
'<td width="140">'.$langs->trans(
"Name").
'</td>';
457 print
'<td>'.$langs->trans(
"Description").
'</td>';
458 print
'<td>'.$langs->trans(
"Example").
'</td>';
459 print
'<td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
460 print
'<td class="center" width="60">'.$langs->trans(
"ShortInfo").
'</td>';
463 $arrayofmodules = array();
465 foreach ($dirsociete as $dirroot) {
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);
480 $modCodeCompta =
new $file;
482 $arrayofmodules[$file] = $modCodeCompta;
492 foreach ($arrayofmodules as $file => $modCodeCompta) {
493 print
'<tr class="oddeven">';
494 print
'<td>'.$modCodeCompta->name.
"</td><td>\n";
495 print $modCodeCompta->info($langs);
497 print
'<td class="nowrap">'.$modCodeCompta->getExample($langs).
"</td>\n";
499 if ($conf->global->SOCIETE_CODECOMPTA_ADDON ==
"$file") {
500 print
'<td class="center">';
501 print
img_picto($langs->trans(
"Activated"),
'switch_on');
504 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setcodecompta&token='.
newToken().
'&value='.urlencode($file).
'">';
505 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
508 print
'<td class="center">';
509 $s = $modCodeCompta->getToolTip($langs,
null, -1);
510 print
$form->textwithpicto(
'', $s, 1);
527 $sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
528 $sql .=
" WHERE type = 'company'";
529 $sql .=
" AND entity = ".$conf->entity;
530 $resql = $db->query(
$sql);
533 $num_rows = $db->num_rows($resql);
534 while ($i < $num_rows) {
535 $array = $db->fetch_array($resql);
536 array_push($def, $array[0]);
543 print
'<div class="div-table-responsive-no-min">';
544 print
'<table class="noborder centpercent">';
545 print
'<tr class="liste_titre">';
546 print
'<td width="140">'.$langs->trans(
"Name").
'</td>';
547 print
'<td>'.$langs->trans(
"Description").
'</td>';
548 print
'<td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
549 print
'<td class="center" width="60">'.$langs->trans(
"ShortInfo").
'</td>';
550 print
'<td class="center" width="60">'.$langs->trans(
"Preview").
'</td>';
553 foreach ($dirsociete as $dirroot) {
556 $handle = @opendir($dir);
557 if (is_resource($handle)) {
558 while (($file = readdir($handle)) !==
false) {
559 if (preg_match(
'/\.modules\.php$/i', $file)) {
560 $name = substr($file, 4,
dol_strlen($file) - 16);
561 $classname = substr($file, 0,
dol_strlen($file) - 12);
569 $module =
new $classname($db);
571 $modulequalified = 1;
572 if (!empty($module->version)) {
573 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
574 $modulequalified = 0;
575 } elseif ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
576 $modulequalified = 0;
580 if ($modulequalified) {
581 print
'<tr class="oddeven"><td width="100">';
584 if (method_exists($module,
'info')) {
585 print $module->info($langs);
587 print $module->description;
592 if (in_array($name, $def)) {
593 print
"<td class=\"center\">\n";
596 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).
'">';
597 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
607 print
'<td class="center">'.
"\n";
611 print
'<td class="center">'.
"\n";
612 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>';
618 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
619 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
620 if ($module->type ==
'pdf') {
621 $htmltooltip .=
'<br>'.$langs->trans(
"Height").
'/'.$langs->trans(
"Width").
': '.$module->page_hauteur.
'/'.$module->page_largeur;
623 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
624 $htmltooltip .=
'<br>'.$langs->trans(
"WatermarkOnDraft").
': '.
yn((!empty($module->option_draft_watermark) ? $module->option_draft_watermark :
''), 1, 1);
626 print
'<td class="center nowrap">';
627 print
$form->textwithpicto(
'', $htmltooltip, 1, 0);
631 print
'<td class="center nowrap">';
632 if ($module->type ==
'pdf') {
633 $linkspec =
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&token='.
newToken().
'&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
635 $linkspec =
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
655 print
'<div class="div-table-responsive-no-min">';
656 print
'<table class="noborder centpercent">';
657 print
'<tr class="liste_titre">';
658 print
'<td>'.$langs->trans(
"Name").
'</td>';
659 print
'<td>'.$langs->trans(
"Description").
'</td>';
660 print
'<td class="center">'.$langs->trans(
"MustBeUnique").
'</td>';
661 print
'<td class="center">'.$langs->trans(
"MustBeMandatory").
'</td>';
662 print
'<td class="center">'.$langs->trans(
"MustBeInvoiceMandatory").
'</td>';
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');
680 $nbofloop = count($profid);
681 foreach ($profid as $key => $val) {
682 if ($profid[$key][1] !=
'-') {
683 print
'<tr class="oddeven">';
684 print
'<td>'.$profid[$key][0].
"</td><td>\n";
685 print $profid[$key][1];
688 $idprof_unique =
'SOCIETE_'.$key.
'_UNIQUE';
689 $idprof_mandatory =
'SOCIETE_'.$key.
'_MANDATORY';
690 $idprof_invoice_mandatory =
'SOCIETE_'.$key.
'_INVOICE_MANDATORY';
692 $verif = (empty($conf->global->$idprof_unique) ?
false:
true);
693 $mandatory = (empty($conf->global->$idprof_mandatory) ?
false:
true);
694 $invoice_mandatory = (empty($conf->global->$idprof_invoice_mandatory) ?
false:
true);
697 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofid&token='.
newToken().
'&value='.$key.
'&status=0">';
698 print
img_picto($langs->trans(
"Activated"),
'switch_on');
701 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofid&token='.
newToken().
'&value='.$key.
'&status=1">';
702 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
707 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidmandatory&token='.
newToken().
'&value='.$key.
'&status=0">';
708 print
img_picto($langs->trans(
"Activated"),
'switch_on');
711 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidmandatory&token='.
newToken().
'&value='.$key.
'&status=1">';
712 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
716 if ($invoice_mandatory) {
717 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatory&token='.
newToken().
'&value='.$key.
'&status=0">';
718 print
img_picto($langs->trans(
"Activated"),
'switch_on');
721 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatory&token='.
newToken().
'&value='.$key.
'&status=1">';
722 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
732 print
'<tr class="oddeven">';
733 print
'<td colspan="2">'.$langs->trans(
'CustomerAccountancyCodeShort').
"</td>\n";
734 print
'<td colspan="2"></td>';
736 if (!empty($conf->global->SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_INVOICE_MANDATORY)) {
737 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaccountancycodecustomerinvoicemandatory&token='.
newToken().
'&value=0">';
738 print
img_picto($langs->trans(
"Activated"),
'switch_on');
741 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaccountancycodecustomerinvoicemandatory&token='.
newToken().
'&value=1">';
742 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
749 print
'<tr class="oddeven">';
750 print
'<td colspan="2">'.$langs->trans(
'VATIntra').
"</td>\n";
752 if (!empty($conf->global->SOCIETE_VAT_INTRA_UNIQUE)) {
753 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setvatintraunique&token='.
newToken().
'&value=0">';
754 print
img_picto($langs->trans(
"Activated"),
'switch_on');
757 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setvatintraunique&token='.
newToken().
'&value=1">';
758 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
761 print
'<td colspan="2"></td>';
774 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
775 print
'<input type="hidden" name="token" value="'.newToken().
'">';
776 print
'<input type="hidden" name="page_y" value="">';
777 print
'<input type="hidden" name="action" value="updateoptions">';
779 print
'<div class="div-table-responsive-no-min">';
780 print
'<table class="noborder centpercent">';
781 print
'<tr class="liste_titre">';
782 print
"<td>".$langs->trans(
"Parameters").
"</td>\n";
783 print
'<td class="right" width="60">'.$langs->trans(
"Value").
'</td>'.
"\n";
784 print
'<td width="80"> </td></tr>'.
"\n";
788 print
'<tr class="oddeven">';
789 print
'<td width="80%">'.$form->textwithpicto($langs->trans(
"DelaiedFullListToSelectCompany"), $langs->trans(
'UseSearchToSelectCompanyTooltip'), 1).
' </td>';
790 if (!$conf->use_javascript_ajax) {
791 print
'<td class="nowrap right" colspan="2">';
792 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
795 print
'<td width="60" class="right">';
796 $arrval = array(
'0'=>$langs->trans(
"No"),
797 '1'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 1).
')',
798 '2'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 2).
')',
799 '3'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 3).
')',
801 print
$form->selectarray(
"activate_COMPANY_USE_SEARCH_TO_SELECT", $arrval,
getDolGlobalString(
'COMPANY_USE_SEARCH_TO_SELECT'), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth75imp');
802 print
'</td><td class="right">';
803 print
'<input type="submit" class="button small reposition" name="COMPANY_USE_SEARCH_TO_SELECT" value="'.$langs->trans(
"Modify").
'">';
809 print
'<tr class="oddeven">';
810 print
'<td width="80%">'.$form->textwithpicto($langs->trans(
"DelaiedFullListToSelectContact"), $langs->trans(
'UseSearchToSelectContactTooltip'), 1).
'</td>';
811 if (!$conf->use_javascript_ajax) {
812 print
'<td class="nowrap right" colspan="2">';
813 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
816 print
'<td width="60" class="right">';
817 $arrval = array(
'0'=>$langs->trans(
"No"),
818 '1'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 1).
')',
819 '2'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 2).
')',
820 '3'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 3).
')',
822 print
$form->selectarray(
"activate_CONTACT_USE_SEARCH_TO_SELECT", $arrval,
getDolGlobalString(
'CONTACT_USE_SEARCH_TO_SELECT'), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth75imp');
823 print
'</td><td class="right">';
824 print
'<input type="submit" class="button small eposition" name="CONTACT_USE_SEARCH_TO_SELECT" value="'.$langs->trans(
"Modify").
'">';
831 print
'<tr class="oddeven">';
832 print
'<td width="80%">'.$langs->trans(
"AddRefInList").
'</td>';
833 print
'<td> </td>';
834 print
'<td class="center">';
835 if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) {
836 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddrefinlist&token='.
newToken().
'&value=0">';
837 print
img_picto($langs->trans(
"Activated"),
'switch_on');
839 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddrefinlist&token='.
newToken().
'&value=1">';
840 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
845 print
'<tr class="oddeven">';
846 print
'<td width="80%">'.$langs->trans(
"AddVatInList").
'</td>';
847 print
'<td> </td>';
848 print
'<td class="center">';
849 if (!empty($conf->global->SOCIETE_SHOW_VAT_IN_LIST)) {
850 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setvatinlist&token='.
newToken().
'&value=0">';
851 print
img_picto($langs->trans(
"Activated"),
'switch_on');
853 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setvatinlist&token='.
newToken().
'&value=1">';
854 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
859 print
'<tr class="oddeven">';
860 print
'<td width="80%">'.$langs->trans(
"AddAdressInList").
'</td>';
861 print
'<td> </td>';
862 print
'<td class="center">';
863 if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
864 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddadressinlist&token='.
newToken().
'&value=0">';
865 print
img_picto($langs->trans(
"Activated"),
'switch_on');
867 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddadressinlist&token='.
newToken().
'&value=1">';
868 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
873 print
'<tr class="oddeven">';
874 print
'<td width="80%">'.$langs->trans(
"AddEmailPhoneTownInContactList").
'</td>';
875 print
'<td> </td>';
876 print
'<td class="center">';
877 if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
878 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddemailphonetownincontactlist&token='.
newToken().
'&value=0">';
879 print
img_picto($langs->trans(
"Activated"),
'switch_on');
881 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddemailphonetownincontactlist&token='.
newToken().
'&value=1">';
882 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
889 print
'<tr class="oddeven">';
890 print
'<td width="80%">'.$langs->trans(
"AskForPreferredShippingMethod").
'</td>';
891 print
'<td> </td>';
892 print
'<td class="center">';
893 if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) {
894 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaskforshippingmet&token='.
newToken().
'&value=0">';
895 print
img_picto($langs->trans(
"Activated"),
'switch_on');
897 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaskforshippingmet&token='.
newToken().
'&value=1">';
898 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
906 print
'<tr class="oddeven">';
907 print
'<td width="80%">'.$langs->trans(
"DisableProspectCustomerType").
'</td>';
908 print
'<td> </td>';
909 print
'<td class="center">';
910 if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) {
911 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setdisableprospectcustomer&token='.
newToken().
'&value=0">';
912 print
img_picto($langs->trans(
"Activated"),
'switch_on');
914 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setdisableprospectcustomer&token='.
newToken().
'&value=1">';
915 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
920 if (empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) {
922 print
'<tr class="oddeven">';
923 print
'<td>'.$langs->trans(
"DefaultCustomerType").
'</td>';
925 print $formcompany->selectProspectCustomerType(
getDolGlobalString(
'THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT'),
'defaultcustomertype',
'defaultcustomertype',
'admin');
927 print
'<td class="center">';
928 print
'<input type="submit" class="button small reposition" name="THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT" value="'.$langs->trans(
"Modify").
'">';
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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).
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
societe_admin_prepare_head()
Return array head with list of tabs to view object informations.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
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_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...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return 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.