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');
37 $modulepart =
GETPOST(
'modulepart',
'aZ09');
51 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
53 if ($action ==
'setcodeclient') {
54 $result =
dolibarr_set_const($db,
"SOCIETE_CODECLIENT_ADDON", $value,
'chaine', 0,
'', $conf->entity);
60 if ($action ==
'setcodecompta') {
61 $result =
dolibarr_set_const($db,
"SOCIETE_CODECOMPTA_ADDON", $value,
'chaine', 0,
'', $conf->entity);
67 if ($action ==
'updateoptions') {
68 if (
GETPOST(
'COMPANY_USE_SEARCH_TO_SELECT')) {
69 $companysearch =
GETPOST(
'activate_COMPANY_USE_SEARCH_TO_SELECT',
'alpha');
70 $res =
dolibarr_set_const($db,
"COMPANY_USE_SEARCH_TO_SELECT", $companysearch,
'chaine', 0,
'', $conf->entity);
81 if (
GETPOST(
'CONTACT_USE_SEARCH_TO_SELECT')) {
82 $contactsearch =
GETPOST(
'activate_CONTACT_USE_SEARCH_TO_SELECT',
'alpha');
83 $res =
dolibarr_set_const($db,
"CONTACT_USE_SEARCH_TO_SELECT", $contactsearch,
'chaine', 0,
'', $conf->entity);
94 if (
GETPOST(
'THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')) {
95 $customertypedefault =
GETPOST(
'defaultcustomertype',
'int');
96 $res =
dolibarr_set_const($db,
"THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT", $customertypedefault,
'chaine', 0,
'', $conf->entity);
109 if ($action ==
'set') {
110 $label =
GETPOST(
'label',
'alpha');
111 $scandir =
GETPOST(
'scan_dir',
'alpha');
114 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity, libelle, description)";
115 $sql .=
" VALUES ('".$db->escape($value).
"', '".$db->escape($type).
"', ".((int) $conf->entity).
", ";
116 $sql .= ($label ?
"'".$db->escape($label).
"'" :
'null').
", ";
117 $sql .= (!empty($scandir) ?
"'".$db->escape($scandir).
"'" :
"null");
120 $resql = $db->query($sql);
127 if ($action ==
'del') {
129 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"document_model";
130 $sql .=
" WHERE nom='".$db->escape($value).
"' AND type='".$db->escape($type).
"' AND entity=".((int) $conf->entity);
131 $resql = $db->query($sql);
138 if ($action ==
'setdoc') {
139 $label =
GETPOST(
'label',
'alpha');
140 $scandir =
GETPOST(
'scan_dir',
'alpha');
148 $sql_del =
"DELETE FROM ".MAIN_DB_PREFIX.
"document_model";
149 $sql_del .=
" WHERE nom = '".$db->escape(
GETPOST(
'value',
'alpha')).
"'";
150 $sql_del .=
" AND type = '".$db->escape($type).
"'";
151 $sql_del .=
" AND entity = ".((int) $conf->entity);
153 $result1 = $db->query($sql_del);
155 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity, libelle, description)";
156 $sql .=
" VALUES ('".$db->escape($value).
"', '".$db->escape($type).
"', ".((int) $conf->entity).
", ";
157 $sql .= ($label ?
"'".$db->escape($label).
"'" :
'null').
", ";
158 $sql .= (!empty($scandir) ?
"'".$db->escape($scandir).
"'" :
"null");
161 $result2 = $db->query($sql);
162 if ($result1 && $result2) {
170 if ($action ==
"setaccountancycodecustomerinvoicemandatory") {
171 $setaccountancycodecustomerinvoicemandatory =
GETPOST(
'value',
'int');
172 $res =
dolibarr_set_const($db,
"SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_INVOICE_MANDATORY", $setaccountancycodecustomerinvoicemandatory,
'yesno', 0,
'', $conf->entity);
184 if ($action ==
"setaddrefinlist") {
185 $setaddrefinlist =
GETPOST(
'value',
'int');
186 $res =
dolibarr_set_const($db,
"SOCIETE_ADD_REF_IN_LIST", $setaddrefinlist,
'yesno', 0,
'', $conf->entity);
198 if ($action ==
"setvatinlist") {
199 $setvatinlist =
GETPOST(
'value',
'int');
200 $res =
dolibarr_set_const($db,
"SOCIETE_SHOW_VAT_IN_LIST", $setvatinlist,
'yesno', 0,
'', $conf->entity);
212 if ($action ==
"setaddadressinlist") {
213 $val =
GETPOST(
'value',
'int');
214 $res =
dolibarr_set_const($db,
"COMPANY_SHOW_ADDRESS_SELECTLIST", $val,
'yesno', 0,
'', $conf->entity);
226 if ($action ==
"setaddemailphonetownincontactlist") {
227 $val =
GETPOST(
'value',
'int');
228 $res =
dolibarr_set_const($db,
"CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST", $val,
'yesno', 0,
'', $conf->entity);
240 if ($action ==
"setaskforshippingmet") {
241 $setaskforshippingmet =
GETPOST(
'value',
'int');
242 $res =
dolibarr_set_const($db,
"SOCIETE_ASK_FOR_SHIPPING_METHOD", $setaskforshippingmet,
'yesno', 0,
'', $conf->entity);
254 if ($action ==
"setdisableprospectcustomer") {
255 $setdisableprospectcustomer =
GETPOST(
'value',
'int');
256 $res =
dolibarr_set_const($db,
"SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer,
'yesno', 0,
'', $conf->entity);
268 if ($action ==
'setprofid') {
269 $status =
GETPOST(
'status',
'alpha');
271 $idprof =
"SOCIETE_".$value.
"_UNIQUE";
279 if ($action ==
'setprofidmandatory') {
280 $status =
GETPOST(
'status',
'alpha');
282 $idprof =
"SOCIETE_".$value.
"_MANDATORY";
290 if ($action ==
'setprofidinvoicemandatory') {
291 $status =
GETPOST(
'status',
'alpha');
293 $idprof =
"SOCIETE_".$value.
"_INVOICE_MANDATORY";
301 if ($action ==
'sethideinactivethirdparty') {
302 $status =
GETPOST(
'status',
'alpha');
304 $result =
dolibarr_set_const($db,
"COMPANY_HIDE_INACTIVE_IN_COMBOBOX", $status,
'chaine', 0,
'', $conf->entity);
309 if ($action ==
'setonsearchandlistgooncustomerorsuppliercard') {
310 $setonsearchandlistgooncustomerorsuppliercard =
GETPOST(
'value',
'int');
311 $res =
dolibarr_set_const($db,
"SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard,
'yesno', 0,
'', $conf->entity);
331 $help_url =
'EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers|ES:Configuración_del_módulo_terceros';
334 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
335 print
load_fiche_titre($langs->trans(
"CompanySetup"), $linkback,
'title_setup');
340 print
dol_get_fiche_head($head,
'general', $langs->trans(
"ThirdParties"), -1,
'company');
342 $dirsociete = array_merge(array(
'/core/modules/societe/'), $conf->modules_parts[
'societe']);
343 foreach ($conf->modules_parts[
'models'] as $mo) {
344 $dirsociete[] = $mo.
'core/modules/societe/';
351 print
'<div class="div-table-responsive-no-min">';
352 print
'<table class="noborder centpercent">'.
"\n";
353 print
'<tr class="liste_titre">'.
"\n";
354 print
' <td>'.$langs->trans(
"Name").
'</td>';
355 print
' <td>'.$langs->trans(
"Description").
'</td>';
356 print
' <td>'.$langs->trans(
"Example").
'</td>';
357 print
' <td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
358 print
' <td class="center" width="60">'.$langs->trans(
"ShortInfo").
'</td>';
361 $arrayofmodules = array();
363 foreach ($dirsociete as $dirroot) {
366 $handle = @opendir($dir);
367 if (is_resource($handle)) {
369 while (($file = readdir($handle)) !==
false) {
370 if (substr($file, 0, 15) ==
'mod_codeclient_' && substr($file, -3) ==
'php') {
371 $file = substr($file, 0,
dol_strlen($file) - 4);
379 $modCodeTiers =
new $file;
382 if ($modCodeTiers->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
385 if ($modCodeTiers->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
389 $arrayofmodules[$file] = $modCodeTiers;
398 foreach ($arrayofmodules as $file => $modCodeTiers) {
399 print
'<tr class="oddeven">'.
"\n";
400 print
'<td width="140">'.$modCodeTiers->name.
'</td>'.
"\n";
401 print
'<td>'.$modCodeTiers->info($langs).
'</td>'.
"\n";
402 print
'<td class="nowrap">'.$modCodeTiers->getExample($langs).
'</td>'.
"\n";
404 if ($conf->global->SOCIETE_CODECLIENT_ADDON ==
"$file") {
405 print
'<td class="center">'.
"\n";
406 print
img_picto($langs->trans(
"Activated"),
'switch_on');
409 $disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings[
'referent']) && $mc->sharings[
'referent'] != $conf->entity) ?
true :
false);
410 print
'<td class="center">';
412 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setcodeclient&token='.
newToken().
'&value='.urlencode($file).
'">';
414 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
421 print
'<td class="center">';
422 $s = $modCodeTiers->getToolTip($langs,
null, -1);
423 print
$form->textwithpicto(
'', $s, 1);
438 print
'<div class="div-table-responsive-no-min">';
439 print
'<table class="noborder centpercent">';
440 print
'<tr class="liste_titre">';
441 print
'<td width="140">'.$langs->trans(
"Name").
'</td>';
442 print
'<td>'.$langs->trans(
"Description").
'</td>';
443 print
'<td>'.$langs->trans(
"Example").
'</td>';
444 print
'<td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
445 print
'<td class="center" width="60">'.$langs->trans(
"ShortInfo").
'</td>';
448 $arrayofmodules = array();
450 foreach ($dirsociete as $dirroot) {
453 $handle = @opendir($dir);
454 if (is_resource($handle)) {
455 while (($file = readdir($handle)) !==
false) {
456 if (substr($file, 0, 15) ==
'mod_codecompta_' && substr($file, -3) ==
'php') {
457 $file = substr($file, 0,
dol_strlen($file) - 4);
465 $modCodeCompta =
new $file;
467 $arrayofmodules[$file] = $modCodeCompta;
477 foreach ($arrayofmodules as $file => $modCodeCompta) {
478 print
'<tr class="oddeven">';
479 print
'<td>'.$modCodeCompta->name.
"</td><td>\n";
480 print $modCodeCompta->info($langs);
482 print
'<td class="nowrap">'.$modCodeCompta->getExample($langs).
"</td>\n";
484 if ($conf->global->SOCIETE_CODECOMPTA_ADDON ==
"$file") {
485 print
'<td class="center">';
486 print
img_picto($langs->trans(
"Activated"),
'switch_on');
489 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setcodecompta&token='.
newToken().
'&value='.urlencode($file).
'">';
490 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
493 print
'<td class="center">';
494 $s = $modCodeCompta->getToolTip($langs,
null, -1);
495 print
$form->textwithpicto(
'', $s, 1);
512 $sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
513 $sql .=
" WHERE type = 'company'";
514 $sql .=
" AND entity = ".$conf->entity;
515 $resql = $db->query($sql);
518 $num_rows = $db->num_rows(
$resql);
519 while ($i < $num_rows) {
520 $array = $db->fetch_array(
$resql);
521 array_push($def, $array[0]);
528 print
'<div class="div-table-responsive-no-min">';
529 print
'<table class="noborder centpercent">';
530 print
'<tr class="liste_titre">';
531 print
'<td width="140">'.$langs->trans(
"Name").
'</td>';
532 print
'<td>'.$langs->trans(
"Description").
'</td>';
533 print
'<td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
534 print
'<td class="center" width="60">'.$langs->trans(
"ShortInfo").
'</td>';
535 print
'<td class="center" width="60">'.$langs->trans(
"Preview").
'</td>';
538 foreach ($dirsociete as $dirroot) {
541 $handle = @opendir($dir);
542 if (is_resource($handle)) {
543 while (($file = readdir($handle)) !==
false) {
544 if (preg_match(
'/\.modules\.php$/i', $file)) {
545 $name = substr($file, 4,
dol_strlen($file) - 16);
546 $classname = substr($file, 0,
dol_strlen($file) - 12);
554 $module =
new $classname($db);
556 $modulequalified = 1;
557 if (!empty($module->version)) {
558 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
559 $modulequalified = 0;
560 } elseif ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
561 $modulequalified = 0;
565 if ($modulequalified) {
566 print
'<tr class="oddeven"><td width="100">';
569 if (method_exists($module,
'info')) {
570 print $module->info($langs);
572 print $module->description;
577 if (in_array($name, $def)) {
578 print
"<td class=\"center\">\n";
581 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).
'">';
582 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
592 print
'<td class="center">'.
"\n";
596 print
'<td class="center">'.
"\n";
597 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>';
603 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
604 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
605 if ($module->type ==
'pdf') {
606 $htmltooltip .=
'<br>'.$langs->trans(
"Height").
'/'.$langs->trans(
"Width").
': '.$module->page_hauteur.
'/'.$module->page_largeur;
608 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
609 $htmltooltip .=
'<br>'.$langs->trans(
"WatermarkOnDraft").
': '.
yn((!empty($module->option_draft_watermark) ? $module->option_draft_watermark :
''), 1, 1);
611 print
'<td class="center nowrap">';
612 print
$form->textwithpicto(
'', $htmltooltip, 1, 0);
616 print
'<td class="center nowrap">';
617 if ($module->type ==
'pdf') {
618 $linkspec =
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&token='.
newToken().
'&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
620 $linkspec =
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
640 print
'<div class="div-table-responsive-no-min">';
641 print
'<table class="noborder centpercent">';
642 print
'<tr class="liste_titre">';
643 print
'<td>'.$langs->trans(
"Name").
'</td>';
644 print
'<td>'.$langs->trans(
"Description").
'</td>';
645 print
'<td class="center">'.$langs->trans(
"MustBeUnique").
'</td>';
646 print
'<td class="center">'.$langs->trans(
"MustBeMandatory").
'</td>';
647 print
'<td class="center">'.$langs->trans(
"MustBeInvoiceMandatory").
'</td>';
650 $profid[
'IDPROF1'][0] = $langs->trans(
"ProfId1");
651 $profid[
'IDPROF1'][1] = $langs->transcountry(
'ProfId1', $mysoc->country_code);
652 $profid[
'IDPROF2'][0] = $langs->trans(
"ProfId2");
653 $profid[
'IDPROF2'][1] = $langs->transcountry(
'ProfId2', $mysoc->country_code);
654 $profid[
'IDPROF3'][0] = $langs->trans(
"ProfId3");
655 $profid[
'IDPROF3'][1] = $langs->transcountry(
'ProfId3', $mysoc->country_code);
656 $profid[
'IDPROF4'][0] = $langs->trans(
"ProfId4");
657 $profid[
'IDPROF4'][1] = $langs->transcountry(
'ProfId4', $mysoc->country_code);
658 $profid[
'IDPROF5'][0] = $langs->trans(
"ProfId5");
659 $profid[
'IDPROF5'][1] = $langs->transcountry(
'ProfId5', $mysoc->country_code);
660 $profid[
'IDPROF6'][0] = $langs->trans(
"ProfId6");
661 $profid[
'IDPROF6'][1] = $langs->transcountry(
'ProfId6', $mysoc->country_code);
662 $profid[
'EMAIL'][0] = $langs->trans(
"EMail");
663 $profid[
'EMAIL'][1] = $langs->trans(
'Email');
665 $nbofloop = count($profid);
666 foreach ($profid as $key => $val) {
667 if ($profid[$key][1] !=
'-') {
668 print
'<tr class="oddeven">';
669 print
'<td>'.$profid[$key][0].
"</td><td>\n";
670 print $profid[$key][1];
673 $idprof_unique =
'SOCIETE_'.$key.
'_UNIQUE';
674 $idprof_mandatory =
'SOCIETE_'.$key.
'_MANDATORY';
675 $idprof_invoice_mandatory =
'SOCIETE_'.$key.
'_INVOICE_MANDATORY';
677 $verif = (empty($conf->global->$idprof_unique) ?
false:
true);
678 $mandatory = (empty($conf->global->$idprof_mandatory) ?
false:
true);
679 $invoice_mandatory = (empty($conf->global->$idprof_invoice_mandatory) ?
false:
true);
682 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofid&token='.
newToken().
'&value='.$key.
'&status=0">';
683 print
img_picto($langs->trans(
"Activated"),
'switch_on');
686 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofid&token='.
newToken().
'&value='.$key.
'&status=1">';
687 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=setprofidmandatory&token='.
newToken().
'&value='.$key.
'&status=1">';
697 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
701 if ($invoice_mandatory) {
702 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatory&token='.
newToken().
'&value='.$key.
'&status=0">';
703 print
img_picto($langs->trans(
"Activated"),
'switch_on');
706 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setprofidinvoicemandatory&token='.
newToken().
'&value='.$key.
'&status=1">';
707 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
716 if ($conf->accounting->enabled) {
717 print
'<tr class="oddeven">';
718 print
'<td colspan="2">'.$langs->trans(
'CustomerAccountancyCodeShort').
"</td>\n";
719 print
'<td colspan="2"></td>';
721 if (!empty($conf->global->SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_INVOICE_MANDATORY)) {
722 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaccountancycodecustomerinvoicemandatory&token='.
newToken().
'&value=0">';
723 print
img_picto($langs->trans(
"Activated"),
'switch_on');
726 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaccountancycodecustomerinvoicemandatory&token='.
newToken().
'&value=1">';
727 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
743 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
744 print
'<input type="hidden" name="token" value="'.newToken().
'">';
745 print
'<input type="hidden" name="page_y" value="">';
746 print
'<input type="hidden" name="action" value="updateoptions">';
748 print
'<div class="div-table-responsive-no-min">';
749 print
'<table class="noborder centpercent">';
750 print
'<tr class="liste_titre">';
751 print
"<td>".$langs->trans(
"Parameters").
"</td>\n";
752 print
'<td class="right" width="60">'.$langs->trans(
"Value").
'</td>'.
"\n";
753 print
'<td width="80"> </td></tr>'.
"\n";
757 print
'<tr class="oddeven">';
758 print
'<td width="80%">'.$form->textwithpicto($langs->trans(
"DelaiedFullListToSelectCompany"), $langs->trans(
'UseSearchToSelectCompanyTooltip'), 1).
' </td>';
759 if (!$conf->use_javascript_ajax) {
760 print
'<td class="nowrap right" colspan="2">';
761 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
764 print
'<td width="60" class="right">';
765 $arrval = array(
'0'=>$langs->trans(
"No"),
766 '1'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 1).
')',
767 '2'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 2).
')',
768 '3'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 3).
')',
770 print
$form->selectarray(
"activate_COMPANY_USE_SEARCH_TO_SELECT", $arrval, (property_exists($conf->global,
'COMPANY_USE_SEARCH_TO_SELECT')?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:
''), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth75imp');
771 print
'</td><td class="right">';
772 print
'<input type="submit" class="button small reposition" name="COMPANY_USE_SEARCH_TO_SELECT" value="'.$langs->trans(
"Modify").
'">';
778 print
'<tr class="oddeven">';
779 print
'<td width="80%">'.$form->textwithpicto($langs->trans(
"DelaiedFullListToSelectContact"), $langs->trans(
'UseSearchToSelectContactTooltip'), 1).
'</td>';
780 if (!$conf->use_javascript_ajax) {
781 print
'<td class="nowrap right" colspan="2">';
782 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
785 print
'<td width="60" class="right">';
786 $arrval = array(
'0'=>$langs->trans(
"No"),
787 '1'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 1).
')',
788 '2'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 2).
')',
789 '3'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 3).
')',
791 print
$form->selectarray(
"activate_CONTACT_USE_SEARCH_TO_SELECT", $arrval, (property_exists($conf->global,
'CONTACT_USE_SEARCH_TO_SELECT')?$conf->global->CONTACT_USE_SEARCH_TO_SELECT:
''), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth75imp');
792 print
'</td><td class="right">';
793 print
'<input type="submit" class="button small eposition" name="CONTACT_USE_SEARCH_TO_SELECT" value="'.$langs->trans(
"Modify").
'">';
800 print
'<tr class="oddeven">';
801 print
'<td width="80%">'.$langs->trans(
"AddRefInList").
'</td>';
802 print
'<td> </td>';
803 print
'<td class="center">';
804 if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) {
805 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddrefinlist&token='.
newToken().
'&value=0">';
806 print
img_picto($langs->trans(
"Activated"),
'switch_on');
808 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddrefinlist&token='.
newToken().
'&value=1">';
809 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
814 print
'<tr class="oddeven">';
815 print
'<td width="80%">'.$langs->trans(
"AddVatInList").
'</td>';
816 print
'<td> </td>';
817 print
'<td class="center">';
818 if (!empty($conf->global->SOCIETE_SHOW_VAT_IN_LIST)) {
819 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setvatinlist&token='.
newToken().
'&value=0">';
820 print
img_picto($langs->trans(
"Activated"),
'switch_on');
822 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setvatinlist&token='.
newToken().
'&value=1">';
823 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
828 print
'<tr class="oddeven">';
829 print
'<td width="80%">'.$langs->trans(
"AddAdressInList").
'</td>';
830 print
'<td> </td>';
831 print
'<td class="center">';
832 if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
833 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddadressinlist&token='.
newToken().
'&value=0">';
834 print
img_picto($langs->trans(
"Activated"),
'switch_on');
836 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddadressinlist&token='.
newToken().
'&value=1">';
837 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
842 print
'<tr class="oddeven">';
843 print
'<td width="80%">'.$langs->trans(
"AddEmailPhoneTownInContactList").
'</td>';
844 print
'<td> </td>';
845 print
'<td class="center">';
846 if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
847 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddemailphonetownincontactlist&token='.
newToken().
'&value=0">';
848 print
img_picto($langs->trans(
"Activated"),
'switch_on');
850 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaddemailphonetownincontactlist&token='.
newToken().
'&value=1">';
851 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
856 if (!empty($conf->expedition->enabled)) {
858 print
'<tr class="oddeven">';
859 print
'<td width="80%">'.$langs->trans(
"AskForPreferredShippingMethod").
'</td>';
860 print
'<td> </td>';
861 print
'<td class="center">';
862 if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) {
863 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaskforshippingmet&token='.
newToken().
'&value=0">';
864 print
img_picto($langs->trans(
"Activated"),
'switch_on');
866 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setaskforshippingmet&token='.
newToken().
'&value=1">';
867 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
875 print
'<tr class="oddeven">';
876 print
'<td width="80%">'.$langs->trans(
"DisableProspectCustomerType").
'</td>';
877 print
'<td> </td>';
878 print
'<td class="center">';
879 if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) {
880 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setdisableprospectcustomer&token='.
newToken().
'&value=0">';
881 print
img_picto($langs->trans(
"Activated"),
'switch_on');
883 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setdisableprospectcustomer&token='.
newToken().
'&value=1">';
884 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
889 if (empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) {
891 print
'<tr class="oddeven">';
892 print
'<td>'.$langs->trans(
"DefaultCustomerType").
'</td>';
894 print $formcompany->selectProspectCustomerType((property_exists($conf->global,
'THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')?$conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT:
''),
'defaultcustomertype',
'defaultcustomertype',
'admin');
896 print
'<td class="center">';
897 print
'<input type="submit" class="button small reposition" name="THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT" value="'.$langs->trans(
"Modify").
'">';