Fix setup when js disabled.
This commit is contained in:
parent
22fb2845ae
commit
6ffa4fa7ce
@ -144,16 +144,17 @@ if ($action == 'other') {
|
||||
$value = GETPOST('activate_usesearchtoselectproduct', 'alpha');
|
||||
$res = dolibarr_set_const($db, "PRODUIT_USE_SEARCH_TO_SELECT", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
$value = GETPOST('activate_useProdFournDesc', 'alpha');
|
||||
$res = dolibarr_set_const($db, "PRODUIT_FOURN_TEXTS", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
$value = GETPOST('activate_FillProductDescAuto', 'alpha');
|
||||
$res = dolibarr_set_const($db, "PRODUIT_AUTOFILL_DESC", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
$value = GETPOST('activate_useProdSupplierPackaging', 'alpha');
|
||||
$value = GETPOST('PRODUIT_FOURN_TEXTS', 'alpha');
|
||||
$res = dolibarr_set_const($db, "PRODUIT_FOURN_TEXTS", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
$value = GETPOST('PRODUCT_USE_SUPPLIER_PACKAGING', 'alpha');
|
||||
$res = dolibarr_set_const($db, "PRODUCT_USE_SUPPLIER_PACKAGING", $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'specimen') { // For products
|
||||
$modele = GETPOST('module', 'alpha');
|
||||
|
||||
@ -233,12 +234,22 @@ if ($action == 'set') {
|
||||
}
|
||||
}
|
||||
|
||||
//if ($action == 'other')
|
||||
//{
|
||||
// $value = GETPOST('activate_units', 'alpha');
|
||||
// $res = dolibarr_set_const($db, "PRODUCT_USE_UNITS", $value, 'chaine', 0, '', $conf->entity);
|
||||
// if (! $res > 0) $error++;
|
||||
//}
|
||||
// To enable a constant whithout javascript
|
||||
if (preg_match('/set_(.+)/', $action, $reg)) {
|
||||
$keyforvar = $reg[1];
|
||||
if ($keyforvar) {
|
||||
$value = 1;
|
||||
$res = dolibarr_set_const($db, $keyforvar, $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
|
||||
// To disable a constant whithout javascript
|
||||
if (preg_match('/del_(.+)/', $action, $reg)) {
|
||||
$keyforvar = $reg[1];
|
||||
if ($keyforvar) {
|
||||
$res = dolibarr_del_const($db, $keyforvar, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action) {
|
||||
if (!$error) {
|
||||
@ -573,7 +584,7 @@ print '</tr>';
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MultiPricesNumPrices").'</td>';
|
||||
print '<td class="right"><input size="3" type="text" class="flat" name="value_PRODUIT_MULTIPRICES_LIMIT" value="'.$conf->global->PRODUIT_MULTIPRICES_LIMIT.'"></td>';
|
||||
print '<td class="right"><input size="3" type="text" class="flat right" name="value_PRODUIT_MULTIPRICES_LIMIT" value="'.$conf->global->PRODUIT_MULTIPRICES_LIMIT.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -587,16 +598,18 @@ print '</tr>';
|
||||
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("UseProductFournDesc").'</td>';
|
||||
print '<td class="right">';
|
||||
print $form->selectyesno("activate_useProdFournDesc", (!empty($conf->global->PRODUIT_FOURN_TEXTS) ? $conf->global->PRODUIT_FOURN_TEXTS : 0), 1);
|
||||
print '<td>'.$langs->trans("UseProductSupplierPackaging").'</td>';
|
||||
print '<td align="right">';
|
||||
print ajax_constantonoff("PRODUCT_USE_SUPPLIER_PACKAGING", array(), $conf->entity, 0, 0, 0, 0);
|
||||
//print $form->selectyesno("activate_useProdSupplierPackaging", (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING) ? $conf->global->PRODUCT_USE_SUPPLIER_PACKAGING : 0), 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("UseProductSupplierPackaging").'</td>';
|
||||
print '<td align="right">';
|
||||
print $form->selectyesno("activate_useProdSupplierPackaging", (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING) ? $conf->global->PRODUCT_USE_SUPPLIER_PACKAGING : 0), 1);
|
||||
print '<td>'.$langs->trans("UseProductFournDesc").'</td>';
|
||||
print '<td class="right">';
|
||||
print ajax_constantonoff("PRODUIT_FOURN_TEXTS", array(), $conf->entity, 0, 0, 0, 0);
|
||||
//print $form->selectyesno("activate_useProdFournDesc", (!empty($conf->global->PRODUIT_FOURN_TEXTS) ? $conf->global->PRODUIT_FOURN_TEXTS : 0), 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user