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';
46$langs->loadLangs(array(
"admin",
"accountancy",
"companies",
"other"));
48$action =
GETPOST(
'action',
'aZ09');
49$value =
GETPOST(
'value',
'alpha');
50$modulepart =
GETPOST(
'modulepart',
'aZ09');
65include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
67if ($action ==
'setcodeclient') {
74if ($action ==
'setcodecompta') {
81if ($action ==
'updateoptions') {
82 if (GETPOSTISSET(
'COMPANY_USE_SEARCH_TO_SELECT')) {
83 $companysearch =
GETPOST(
'activate_COMPANY_USE_SEARCH_TO_SELECT',
'alpha');
95 if (GETPOSTISSET(
'CONTACT_USE_SEARCH_TO_SELECT')) {
96 $contactsearch =
GETPOST(
'activate_CONTACT_USE_SEARCH_TO_SELECT',
'alpha');
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);
122 $rolessearch =
GETPOST(
'activate_CONTACTS_DEFAULT_ROLES',
'array:aZ09');
123 $res =
dolibarr_set_const($db,
"CONTACTS_DEFAULT_ROLES", implode(
',', $rolessearch),
'chaine', 0,
'',
$conf->entity);
136if ($action ==
'set') {
137 $label =
GETPOST(
'label',
'alpha');
138 $scandir =
GETPOST(
'scan_dir',
'alpha');
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");
147 $resql = $db->query($sql);
154if ($action ==
'del') {
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);
165if ($action ==
'setdoc') {
166 $label =
GETPOST(
'label',
'alpha');
167 $scandir =
GETPOST(
'scan_dir',
'alpha');
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);
180 $result1 = $db->query($sql_del);
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");
188 $result2 = $db->query($sql);
189 if ($result1 && $result2) {
197if ($action ==
"setaccountancycodecustomerinvoicemandatory") {
198 $setaccountancycodecustomerinvoicemandatory =
GETPOSTINT(
'value');
199 $res =
dolibarr_set_const($db,
"SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_INVOICE_MANDATORY", $setaccountancycodecustomerinvoicemandatory,
'yesno', 0,
'',
$conf->entity);
226if ($action ==
"setaddrefinlist") {
240if ($action ==
"setvatinlist") {
254if ($action ==
"setaddadressinlist") {
268if ($action ==
"setaddemailphonetownincontactlist") {
270 $res =
dolibarr_set_const($db,
"CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST", $val,
'yesno', 0,
'',
$conf->entity);
282if ($action ==
"setaskforshippingmet") {
284 $res =
dolibarr_set_const($db,
"SOCIETE_ASK_FOR_SHIPPING_METHOD", $setaskforshippingmet,
'yesno', 0,
'',
$conf->entity);
296if ($action ==
"setdisableprospectcustomer") {
297 $setdisableprospectcustomer =
GETPOSTINT(
'value');
298 $res =
dolibarr_set_const($db,
"SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer,
'yesno', 0,
'',
$conf->entity);
310if ($action ==
'setprofid') {
311 $status =
GETPOST(
'status',
'alpha');
313 $idprof =
"SOCIETE_".$value.
"_UNIQUE";
321if ($action ==
'setprofidmandatory') {
322 $status =
GETPOST(
'status',
'alpha');
324 $idprof =
"SOCIETE_".$value.
"_MANDATORY";
332if ($action ==
'setprofidinvoicemandatory' || $action ==
'setprofidinvoicemandatoryeeconly') {
333 $status =
GETPOST(
'status',
'alpha');
334 if ($status ==
'1' && $action ==
'setprofidinvoicemandatoryeeconly') {
337 $idprof =
"SOCIETE_".$value.
"_INVOICE_MANDATORY";
345if ($action ==
'sethideinactivethirdparty') {
346 $status =
GETPOST(
'status',
'alpha');
348 $result =
dolibarr_set_const($db,
"COMPANY_HIDE_INACTIVE_IN_COMBOBOX", $status,
'chaine', 0,
'',
$conf->entity);
353if ($action ==
'setonsearchandlistgooncustomerorsuppliercard') {
354 $setonsearchandlistgooncustomerorsuppliercard =
GETPOSTINT(
'value');
355 $res =
dolibarr_set_const($db,
"SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard,
'yesno', 0,
'',
$conf->entity);
373$form =
new Form($db);
375$help_url =
'EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers|ES:Configuración_del_módulo_terceros';
376llxHeader(
'', $langs->trans(
"CompanySetup"), $help_url);
378$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
379print
load_fiche_titre($langs->trans(
"CompanySetup"), $linkback,
'title_setup');
384print
dol_get_fiche_head($head,
'general', $langs->trans(
"ThirdParties"), -1,
'company');
386$dirsociete = array_merge(array(
'/core/modules/societe/'),
$conf->modules_parts[
'societe']);
387foreach (
$conf->modules_parts[
'models'] as $mo) {
388 $dirsociete[] = $mo.
'core/modules/societe/';
395print
'<div class="div-table-responsive-no-min">';
396print
'<table class="noborder centpercent">'.
"\n";
397print
'<tr class="liste_titre">'.
"\n";
398print
' <td>'.$langs->trans(
"Name").
'</td>';
399print
' <td>'.$langs->trans(
"Description").
'</td>';
400print
' <td>'.$langs->trans(
"Example").
'</td>';
401print
' <td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
402print
' <td class="center" width="60">'.$langs->trans(
"ShortInfo").
'</td>';
405$arrayofmodules = array();
407foreach ($dirsociete as $dirroot) {
410 $handle = @opendir($dir);
411 if (is_resource($handle)) {
413 while (($file = readdir($handle)) !==
false) {
414 if (substr($file, 0, 15) ==
'mod_codeclient_' && substr($file, -3) ==
'php') {
415 $file = substr($file, 0,
dol_strlen($file) - 4);
424 $modCodeTiers =
new $file($db);
425 '@phan-var-force ModeleThirdPartyCode $modCodeTiers';
428 if ($modCodeTiers->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
431 if ($modCodeTiers->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
435 $arrayofmodules[$file] = $modCodeTiers;
443'@phan-var-force array<string,ModeleThirdPartyCode> $arrayofmodules';
445foreach ($arrayofmodules as $file => $modCodeTiers) {
446 print
'<tr class="oddeven">'.
"\n";
447 print
'<td width="140">'.$modCodeTiers->name.
'</td>'.
"\n";
448 print
'<td>'.$modCodeTiers->info($langs).
'</td>'.
"\n";
449 print
'<td class="nowrap">'.$modCodeTiers->getExample($langs).
'</td>'.
"\n";
451 if (
$conf->global->SOCIETE_CODECLIENT_ADDON ==
"$file") {
452 print
'<td class="center">'.
"\n";
453 print
img_picto($langs->trans(
"Activated"),
'switch_on');
456 $disabled = (isModEnabled(
'multicompany') && ((is_object($mc) && !empty($mc->sharings[
'referent'])) && ($mc->sharings[
'referent'] !=
$conf->entity)));
457 print
'<td class="center">';
459 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setcodeclient&token='.
newToken().
'&value='.urlencode($file).
'">';
461 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
468 print
'<td class="center">';
469 $s = $modCodeTiers->getToolTip($langs,
null, -1);
470 print $form->textwithpicto(
'', $s, 1);
485print
'<div class="div-table-responsive-no-min">';
486print
'<table class="noborder centpercent">';
487print
'<tr class="liste_titre">';
488print
'<td width="140">'.$langs->trans(
"Name").
'</td>';
489print
'<td>'.$langs->trans(
"Description").
'</td>';
490print
'<td>'.$langs->trans(
"Example").
'</td>';
491print
'<td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
492print
'<td class="center" width="60">'.$langs->trans(
"ShortInfo").
'</td>';
495$arrayofmodules = array();
497foreach ($dirsociete as $dirroot) {
500 $handle = @opendir($dir);
501 if (is_resource($handle)) {
502 while (($file = readdir($handle)) !==
false) {
503 if (substr($file, 0, 15) ==
'mod_codecompta_' && substr($file, -3) ==
'php') {
504 $file = substr($file, 0,
dol_strlen($file) - 4);
512 $modCodeCompta =
new $file();
513 '@phan-var-force ModeleAccountancyCode $modCodeTiers';
515 $arrayofmodules[$file] = $modCodeCompta;
523'@phan-var-force array<string,ModeleAccountancyCode> $arrayofmodules';
526foreach ($arrayofmodules as $file => $modCodeCompta) {
527 print
'<tr class="oddeven">';
528 print
'<td>'.$modCodeCompta->name.
"</td><td>\n";
529 print $modCodeCompta->info($langs);
531 print
'<td class="nowrap">'.$modCodeCompta->getExample($langs).
"</td>\n";
533 if (
$conf->global->SOCIETE_CODECOMPTA_ADDON ==
"$file") {
534 print
'<td class="center">';
535 print
img_picto($langs->trans(
"Activated"),
'switch_on');
538 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setcodecompta&token='.
newToken().
'&value='.urlencode($file).
'">';
539 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
542 print
'<td class="center">';
543 $s = $modCodeCompta->getToolTip($langs,
null, -1);
544 print $form->textwithpicto(
'', $s, 1);
561$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
562$sql .=
" WHERE type = 'company'";
563$sql .=
" AND entity = ".$conf->entity;
564$resql = $db->query($sql);
567 $num_rows = $db->num_rows($resql);
568 while ($i < $num_rows) {
569 $array = $db->fetch_array($resql);
570 if (is_array($array)) {
571 array_push($def, $array[0]);
579print
'<div class="div-table-responsive-no-min">';
580print
'<table class="noborder centpercent">';
581print
'<tr class="liste_titre">';
582print
'<td width="140">'.$langs->trans(
"Name").
'</td>';
583print
'<td>'.$langs->trans(
"Description").
'</td>';
584print
'<td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
585print
'<td class="center" width="60">'.$langs->trans(
"ShortInfo").
'</td>';
586print
'<td class="center" width="60">'.$langs->trans(
"Preview").
'</td>';
589foreach ($dirsociete as $dirroot) {
592 $handle = @opendir($dir);
593 if (is_resource($handle)) {
594 while (($file = readdir($handle)) !==
false) {
595 if (preg_match(
'/\.modules\.php$/i', $file)) {
596 $name = substr($file, 4,
dol_strlen($file) - 16);
597 $classname = substr($file, 0,
dol_strlen($file) - 12);
605 $module =
new $classname($db);
606 '@phan-var-force ModeleThirdPartyDoc $module';
608 $modulequalified = 1;
609 if (!empty($module->version)) {
610 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
611 $modulequalified = 0;
612 } elseif ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
613 $modulequalified = 0;
617 if ($modulequalified) {
618 print
'<tr class="oddeven"><td width="100">';
621 if (method_exists($module,
'info')) {
622 print $module->info($langs);
624 print $module->description;
629 if (in_array($name, $def)) {
630 print
"<td class=\"center\">\n";
633 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).
'">';
634 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
644 print
'<td class="center">'.
"\n";
648 print
'<td class="center">'.
"\n";
649 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=set&value='.urlencode($name).
'&token='.
newToken().
'&scan_dir='.urlencode($module->scandir).
'&label='.urlencode($module->name).
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
655 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
656 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
657 if ($module->type ==
'pdf') {
658 $htmltooltip .=
'<br>'.$langs->trans(
"Height").
'/'.$langs->trans(
"Width").
': '.$module->page_hauteur.
'/'.$module->page_largeur;
660 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
661 $htmltooltip .=
'<br>'.$langs->trans(
"WatermarkOnDraft").
': '.
yn((isset($module->option_draft_watermark) ? $module->option_draft_watermark :
''), 1, 1);
663 print
'<td class="center nowrap">';
664 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
668 print
'<td class="center nowrap">';
669 if ($module->type ==
'pdf') {
670 $linkspec =
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&token='.
newToken().
'&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
672 $linkspec =
img_object($langs->transnoentitiesnoconv(
"PreviewNotAvailable"),
'generic');
692print
'<div class="div-table-responsive-no-min">';
693print
'<table class="noborder centpercent">';
694print
'<tr class="liste_titre">';
695print
'<td>'.$langs->trans(
"Name").
'</td>';
696print
'<td>'.$langs->trans(
"Description").
'</td>';
697print
'<td class="center">'.$langs->trans(
"MustBeUnique").
'</td>';
698print
'<td class="center">'.$langs->trans(
"MustBeMandatory").
'</td>';
699print
'<td class="center">'.$langs->trans(
"MustBeInvoiceMandatory").
'</td>';
702$profid = array(
'IDPROF1' => array(),
'IDPROF2' => array(),
'IDPROF3' => array(),
'IDPROF4' => array(),
'IDPROF5' => array(),
'IDPROF6' => array(),
'EMAIL' => array());
703$profid[
'IDPROF1'][0] = $langs->trans(
"ProfId1");
704$profid[
'IDPROF1'][1] = $langs->transcountry(
'ProfId1', $mysoc->country_code);
705$profid[
'IDPROF2'][0] = $langs->trans(
"ProfId2");
706$profid[
'IDPROF2'][1] = $langs->transcountry(
'ProfId2', $mysoc->country_code);
707$profid[
'IDPROF3'][0] = $langs->trans(
"ProfId3");
708$profid[
'IDPROF3'][1] = $langs->transcountry(
'ProfId3', $mysoc->country_code);
709$profid[
'IDPROF4'][0] = $langs->trans(
"ProfId4");
710$profid[
'IDPROF4'][1] = $langs->transcountry(
'ProfId4', $mysoc->country_code);
711$profid[
'IDPROF5'][0] = $langs->trans(
"ProfId5");
712$profid[
'IDPROF5'][1] = $langs->transcountry(
'ProfId5', $mysoc->country_code);
713$profid[
'IDPROF6'][0] = $langs->trans(
"ProfId6");
714$profid[
'IDPROF6'][1] = $langs->transcountry(
'ProfId6', $mysoc->country_code);
715$profid[
'EMAIL'][0] = $langs->trans(
"EMail");
716$profid[
'EMAIL'][1] = $langs->trans(
'Email');
717if (isModEnabled(
'accounting')) {
718 $profid[
'ACCOUNTANCY_CODE_CUSTOMER'] = array();
719 $profid[
'ACCOUNTANCY_CODE_CUSTOMER'][0] = $langs->trans(
"CustomerAccountancyCodeShort");
720 $profid[
'ACCOUNTANCY_CODE_CUSTOMER'][1] = $langs->trans(
'CustomerAccountancyCodeShort');
721 $profid[
'ACCOUNTANCY_CODE_SUPPLIER'] = array();
722 $profid[
'ACCOUNTANCY_CODE_SUPPLIER'][0] = $langs->trans(
"SupplierAccountancyCodeShort");
723 $profid[
'ACCOUNTANCY_CODE_SUPPLIER'][1] = $langs->trans(
'SupplierAccountancyCodeShort');
726$nbofloop = count($profid);
727foreach ($profid as $key => $val) {
728 if ($profid[$key][1] !=
'-') {
729 print
'<tr class="oddeven">';
730 print
'<td>'.$profid[$key][0].
"</td><td>\n";
731 print $profid[$key][1];
734 $idprof_unique =
'SOCIETE_'.$key.
'_UNIQUE';
735 $idprof_mandatory =
'SOCIETE_'.$key.
'_MANDATORY';
736 $idprof_invoice_mandatory =
'SOCIETE_'.$key.
'_INVOICE_MANDATORY';
738 $verif = !empty(
$conf->global->$idprof_unique);
739 $mandatory = !empty(
$conf->global->$idprof_mandatory);
740 $invoice_mandatory = !empty(
$conf->global->$idprof_invoice_mandatory);
743 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofid&token='.
newToken().
'&value='.$key.
'&status=0">';
744 print
img_picto($langs->trans(
"Activated"),
'switch_on');
747 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofid&token='.
newToken().
'&value='.$key.
'&status=1">';
748 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
753 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidmandatory&token='.
newToken().
'&value='.$key.
'&status=0">';
754 print
img_picto($langs->trans(
"Activated"),
'switch_on');
757 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidmandatory&token='.
newToken().
'&value='.$key.
'&status=1">';
758 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
762 if ($invoice_mandatory) {
763 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatory&token='.
newToken().
'&value='.$key.
'&status=0">';
764 print
img_picto($langs->trans(
"Activated"),
'switch_on');
767 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatory&token='.
newToken().
'&value='.$key.
'&status=1">';
768 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
777print
'<tr class="oddeven">';
778print
'<td colspan="2">'.$langs->trans(
'VATIntra').
"</td>\n";
781 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofid&token='.
newToken().
'&value='.$key.
'&status=0">';
782 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'class="valignmiddle"');
785 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofid&token='.
newToken().
'&value='.$key.
'&status=1">';
786 print
img_picto($langs->trans(
"Disabled"),
'switch_off',
'class="valignmiddle"');
790 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidmandatory&token='.
newToken().
'&value='.$key.
'&status=0">';
791 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'class="valignmiddle"');
794 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidmandatory&token='.
newToken().
'&value='.$key.
'&status=1">';
795 print
img_picto($langs->trans(
"Disabled"),
'switch_off',
'class="valignmiddle"');
798print
'<td class="center">';
800 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatoryeeconly&token='.
newToken().
'&value='.$key.
'&status=0">';
801 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'class="valignmiddle paddingrightonly"');
803 print $langs->trans(
"SaleEEC").
'<br>';
804 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatory&token='.
newToken().
'&value='.$key.
'&status=1">';
805 print
img_picto($langs->trans(
"Activated"),
'switch_off',
'class="valignmiddle paddingrightonly"');
807 print $langs->trans(
"AnySale");
809 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatoryeeconly&token='.
newToken().
'&value='.$key.
'&status=1">';
810 print
img_picto($langs->trans(
"Activated"),
'switch_off',
'class="valignmiddle paddingrightonly"');
812 print $langs->trans(
"SaleEEC").
'<br>';
813 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatory&token='.
newToken().
'&value='.$key.
'&status=0">';
814 print
img_picto($langs->trans(
"Activated"),
'switch_on',
'class="valignmiddle paddingrightonly"');
816 print $langs->trans(
"AnySale");
818 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatoryeeconly&token='.
newToken().
'&value='.$key.
'&status=1">';
819 print
img_picto($langs->trans(
"Disabled"),
'switch_off',
'class="valignmiddle paddingrightonly"');
821 print $langs->trans(
"SaleEEC").
'<br>';
822 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatory&token='.
newToken().
'&value='.$key.
'&status=1">';
823 print
img_picto($langs->trans(
"Disabled"),
'switch_off',
'class="valignmiddle paddingrightonly"');
825 print $langs->trans(
"AnySale");
838$form =
new Form($db);
840print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
841print
'<input type="hidden" name="token" value="'.newToken().
'">';
842print
'<input type="hidden" name="page_y" value="">';
843print
'<input type="hidden" name="action" value="updateoptions">';
845print
'<div class="div-table-responsive-no-min">';
846print
'<table class="noborder centpercent">';
847print
'<tr class="liste_titre">';
848print
"<td>".$langs->trans(
"Parameters").
"</td>\n";
849print
'<td class="right" width="60">'.$langs->trans(
"Value").
'</td>'.
"\n";
850print
'<td width="80"> </td></tr>'.
"\n";
854print
'<tr class="oddeven">';
855print
'<td width="80%">'.$form->textwithpicto($langs->trans(
"DelaiedFullListToSelectCompany"), $langs->trans(
'UseSearchToSelectCompanyTooltip'), 1).
' </td>';
856if (!
$conf->use_javascript_ajax) {
857 print
'<td class="nowrap right" colspan="2">';
858 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
861 print
'<td width="60" class="right">';
862 $arrval = array(
'0' => $langs->trans(
"No"),
863 '1' => $langs->trans(
"Yes").
' - <span class="opacitymedium">'.$langs->trans(
"NumberOfKeyToSearch", 1).
'</span>',
864 '2' => $langs->trans(
"Yes").
' - <span class="opacitymedium">'.$langs->trans(
"NumberOfKeyToSearch", 2).
'</span>',
865 '3' => $langs->trans(
"Yes").
' - <span class="opacitymedium">'.$langs->trans(
"NumberOfKeyToSearch", 3).
'</span>',
867 print $form->selectarray(
"activate_COMPANY_USE_SEARCH_TO_SELECT", $arrval,
getDolGlobalString(
'COMPANY_USE_SEARCH_TO_SELECT'), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth75imp maxwidth400');
868 print
'</td><td class="right">';
869 print
'<input type="submit" class="button small reposition" name="COMPANY_USE_SEARCH_TO_SELECT" value="'.$langs->trans(
"Modify").
'">';
875print
'<tr class="oddeven">';
876print
'<td width="80%">'.$form->textwithpicto($langs->trans(
"DelaiedFullListToSelectContact"), $langs->trans(
'UseSearchToSelectContactTooltip'), 1).
'</td>';
877if (!
$conf->use_javascript_ajax) {
878 print
'<td class="nowrap right" colspan="2">';
879 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
882 print
'<td width="60" class="right">';
883 $arrval = array(
'0' => $langs->trans(
"No"),
884 '1' => $langs->trans(
"Yes").
' - <span class="opacitymedium">'.$langs->trans(
"NumberOfKeyToSearch", 1).
'</span>',
885 '2' => $langs->trans(
"Yes").
' - <span class="opacitymedium">'.$langs->trans(
"NumberOfKeyToSearch", 2).
'</span>',
886 '3' => $langs->trans(
"Yes").
' - <span class="opacitymedium">'.$langs->trans(
"NumberOfKeyToSearch", 3).
'</span>',
888 print $form->selectarray(
"activate_CONTACT_USE_SEARCH_TO_SELECT", $arrval,
getDolGlobalString(
'CONTACT_USE_SEARCH_TO_SELECT'), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth75imp maxwidth400');
889 print
'</td><td class="right">';
890 print
'<input type="submit" class="button small reposition" name="CONTACT_USE_SEARCH_TO_SELECT" value="'.$langs->trans(
"Modify").
'">';
897print
'<tr class="oddeven">';
898print
'<td width="80%">'.$langs->trans(
"AddRefInList").
'</td>';
899print
'<td> </td>';
900print
'<td class="center">';
902 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddrefinlist&token='.
newToken().
'&value=0">';
903 print
img_picto($langs->trans(
"Activated"),
'switch_on');
905 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddrefinlist&token='.
newToken().
'&value=1">';
906 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
911print
'<tr class="oddeven">';
912print
'<td width="80%">'.$langs->trans(
"AddVatInList").
'</td>';
913print
'<td> </td>';
914print
'<td class="center">';
916 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setvatinlist&token='.
newToken().
'&value=0">';
917 print
img_picto($langs->trans(
"Activated"),
'switch_on');
919 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setvatinlist&token='.
newToken().
'&value=1">';
920 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
925print
'<tr class="oddeven">';
926print
'<td width="80%">'.$langs->trans(
"AddAdressInList").
'</td>';
927print
'<td> </td>';
928print
'<td class="center">';
930 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddadressinlist&token='.
newToken().
'&value=0">';
931 print
img_picto($langs->trans(
"Activated"),
'switch_on');
933 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddadressinlist&token='.
newToken().
'&value=1">';
934 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
939print
'<tr class="oddeven">';
940print
'<td width="80%">'.$langs->trans(
"AddEmailPhoneTownInContactList").
'</td>';
941print
'<td> </td>';
942print
'<td class="center">';
944 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddemailphonetownincontactlist&token='.
newToken().
'&value=0">';
945 print
img_picto($langs->trans(
"Activated"),
'switch_on');
947 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddemailphonetownincontactlist&token='.
newToken().
'&value=1">';
948 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
953if (isModEnabled(
"shipping")) {
955 print
'<tr class="oddeven">';
956 print
'<td width="80%">'.$langs->trans(
"AskForPreferredShippingMethod").
'</td>';
957 print
'<td> </td>';
958 print
'<td class="center">';
960 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaskforshippingmet&token='.
newToken().
'&value=0">';
961 print
img_picto($langs->trans(
"Activated"),
'switch_on');
963 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaskforshippingmet&token='.
newToken().
'&value=1">';
964 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
972print
'<tr class="oddeven">';
973print
'<td width="80%">'.$langs->trans(
"DisableProspectCustomerType").
'</td>';
974print
'<td> </td>';
975print
'<td class="center">';
977 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setdisableprospectcustomer&token='.
newToken().
'&value=0">';
978 print
img_picto($langs->trans(
"Activated"),
'switch_on');
980 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setdisableprospectcustomer&token='.
newToken().
'&value=1">';
981 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
988 print
'<tr class="oddeven">';
989 print
'<td>'.$langs->trans(
"DefaultCustomerType").
'</td>';
991 print $formcompany->selectProspectCustomerType(
getDolGlobalString(
'THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT'),
'defaultcustomertype',
'defaultcustomertype',
'admin');
993 print
'<td class="center">';
994 print
'<input type="submit" class="button small reposition" name="THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT" value="'.$langs->trans(
"Modify").
'">';
1000 print
'<tr class="oddeven">';
1001 print
'<td width="80%">'.$langs->trans(
'ContactsDefaultRoles').
'</td>';
1002 if (!
$conf->use_javascript_ajax) {
1003 print
'<td class="nowrap right" colspan="2">';
1004 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
1007 print
'<td width="60" class="right">';
1009 $contactType = $contact->listeTypeContacts(
'external', 0, 1);
1011 print $form->multiselectarray(
'activate_CONTACTS_DEFAULT_ROLES', $contactType, $selected, 0, 0,
'minwidth75imp');
1012 print
'</td><td class="right">';
1013 print
'<input type="submit" class="button small eposition" name="CONTACTS_DEFAULT_ROLES" value="'.$langs->trans(
"Modify").
'">';
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).
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
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)
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...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.