|
@@ -51,19 +51,15 @@ $formcompany = new FormCompany($db);
|
|
|
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
|
|
|
|
|
if ($action == 'setcodeclient') {
|
|
|
- if (dolibarr_set_const($db, "SOCIETE_CODECLIENT_ADDON", $value, 'chaine', 0, '', $conf->entity) > 0) {
|
|
|
- header("Location: ".$_SERVER["PHP_SELF"]);
|
|
|
- exit;
|
|
|
- } else {
|
|
|
+ $result = dolibarr_set_const($db, "SOCIETE_CODECLIENT_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
|
|
+ if ($result <= 0) {
|
|
|
dol_print_error($db);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ($action == 'setcodecompta') {
|
|
|
- if (dolibarr_set_const($db, "SOCIETE_CODECOMPTA_ADDON", $value, 'chaine', 0, '', $conf->entity) > 0) {
|
|
|
- header("Location: ".$_SERVER["PHP_SELF"]);
|
|
|
- exit;
|
|
|
- } else {
|
|
|
+ $result = dolibarr_set_const($db, "SOCIETE_CODECOMPTA_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
|
|
+ if ($result <= 0) {
|
|
|
dol_print_error($db);
|
|
|
}
|
|
|
}
|
|
@@ -273,10 +269,8 @@ if ($action == 'setprofid') {
|
|
|
$status = GETPOST('status', 'alpha');
|
|
|
|
|
|
$idprof = "SOCIETE_".$value."_UNIQUE";
|
|
|
- if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) {
|
|
|
- //header("Location: ".$_SERVER["PHP_SELF"]);
|
|
|
- //exit;
|
|
|
- } else {
|
|
|
+ $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity);
|
|
|
+ if ($result <= 0) {
|
|
|
dol_print_error($db);
|
|
|
}
|
|
|
}
|
|
@@ -286,10 +280,8 @@ if ($action == 'setprofidmandatory') {
|
|
|
$status = GETPOST('status', 'alpha');
|
|
|
|
|
|
$idprof = "SOCIETE_".$value."_MANDATORY";
|
|
|
- if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) {
|
|
|
- //header("Location: ".$_SERVER["PHP_SELF"]);
|
|
|
- //exit;
|
|
|
- } else {
|
|
|
+ $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity);
|
|
|
+ if ($result <= 0) {
|
|
|
dol_print_error($db);
|
|
|
}
|
|
|
}
|
|
@@ -299,10 +291,8 @@ if ($action == 'setprofidinvoicemandatory') {
|
|
|
$status = GETPOST('status', 'alpha');
|
|
|
|
|
|
$idprof = "SOCIETE_".$value."_INVOICE_MANDATORY";
|
|
|
- if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) {
|
|
|
- //header("Location: ".$_SERVER["PHP_SELF"]);
|
|
|
- //exit;
|
|
|
- } else {
|
|
|
+ $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity);
|
|
|
+ if ($result <= 0) {
|
|
|
dol_print_error($db);
|
|
|
}
|
|
|
}
|
|
@@ -311,10 +301,8 @@ if ($action == 'setprofidinvoicemandatory') {
|
|
|
if ($action == 'sethideinactivethirdparty') {
|
|
|
$status = GETPOST('status', 'alpha');
|
|
|
|
|
|
- if (dolibarr_set_const($db, "COMPANY_HIDE_INACTIVE_IN_COMBOBOX", $status, 'chaine', 0, '', $conf->entity) > 0) {
|
|
|
- header("Location: ".$_SERVER["PHP_SELF"]);
|
|
|
- exit;
|
|
|
- } else {
|
|
|
+ $result = dolibarr_set_const($db, "COMPANY_HIDE_INACTIVE_IN_COMBOBOX", $status, 'chaine', 0, '', $conf->entity);
|
|
|
+ if ($result <= 0) {
|
|
|
dol_print_error($db);
|
|
|
}
|
|
|
}
|
|
@@ -331,6 +319,7 @@ if ($action == 'setonsearchandlistgooncustomerorsuppliercard') {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* View
|
|
|
*/
|
|
@@ -575,7 +564,7 @@ foreach ($dirsociete as $dirroot) {
|
|
|
|
|
|
if ($modulequalified) {
|
|
|
print '<tr class="oddeven"><td width="100">';
|
|
|
- print $module->name;
|
|
|
+ print dol_escape_htmltag($module->name);
|
|
|
print "</td><td>\n";
|
|
|
if (method_exists($module, 'info')) {
|
|
|
print $module->info($langs);
|
|
@@ -589,7 +578,7 @@ foreach ($dirsociete as $dirroot) {
|
|
|
print "<td class=\"center\">\n";
|
|
|
//if ($conf->global->COMPANY_ADDON_PDF != "$name")
|
|
|
//{
|
|
|
- print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&token='.newToken().'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
|
|
+ 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).'">';
|
|
|
print img_picto($langs->trans("Enabled"), 'switch_on');
|
|
|
print '</a>';
|
|
|
//}
|
|
@@ -605,7 +594,7 @@ foreach ($dirsociete as $dirroot) {
|
|
|
print "</td>";
|
|
|
} else {
|
|
|
print '<td class="center">'."\n";
|
|
|
- print '<a 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>';
|
|
|
+ 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>';
|
|
|
print "</td>";
|
|
|
}
|
|
|
}
|
|
@@ -626,7 +615,7 @@ foreach ($dirsociete as $dirroot) {
|
|
|
// Preview
|
|
|
print '<td class="center nowrap">';
|
|
|
if ($module->type == 'pdf') {
|
|
|
- $linkspec = '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&token='.newToken().'&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
|
|
+ $linkspec = '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=specimen&token='.newToken().'&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
|
|
} else {
|
|
|
$linkspec = img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
|
|
}
|