Can filter list of setup constant on name and extend visibility to all.
This commit is contained in:
parent
11c94a9d3b
commit
e31af7f914
@ -229,8 +229,9 @@ $sql.= ", note";
|
||||
$sql.= ", entity";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."const";
|
||||
$sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
|
||||
if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin
|
||||
else $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
|
||||
if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug
|
||||
else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
|
||||
if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name'));
|
||||
$sql.= " ORDER BY entity, name ASC";
|
||||
|
||||
dol_syslog("Const::listConstant", LOG_DEBUG);
|
||||
|
||||
@ -1380,6 +1380,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
|
||||
}
|
||||
|
||||
// Line of interventions
|
||||
if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
|
||||
{
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="addinter" method="post">';
|
||||
@ -1556,9 +1557,9 @@ else if ($id > 0 || ! empty($ref))
|
||||
print '<td colspan="4"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=false;
|
||||
$var=true;
|
||||
|
||||
print '<tr '.$bc[$var].">\n";
|
||||
print '<tr '.$bcnd[$var].">\n";
|
||||
print '<td>';
|
||||
// editeur wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
|
||||
@ -1397,7 +1397,7 @@ UseSearchToSelectProduct=Use a search form to choose a product (rather than a dr
|
||||
UseEcoTaxeAbility=Support Eco-Taxe (WEEE)
|
||||
SetDefaultBarcodeTypeProducts=Default barcode type to use for products
|
||||
SetDefaultBarcodeTypeThirdParties=Default barcode type to use for third parties
|
||||
UseUnits=Support units
|
||||
UseUnits=Define a unit of measure for Quantity during order, proposal or invoice lines edition
|
||||
ProductCodeChecker= Module for product code generation and checking (product or service)
|
||||
ProductOtherConf= Product / Service configuration
|
||||
##### Syslog #####
|
||||
|
||||
@ -296,3 +296,4 @@ PropalMergePdfProductActualFile=Files use to add into PDF Azur are/is
|
||||
PropalMergePdfProductChooseFile=Select PDF files
|
||||
IncludingProductWithTag=Including product with tag
|
||||
DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on customer
|
||||
DefaultUnitToShow=Default unit to show
|
||||
@ -952,6 +952,15 @@ else
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Units
|
||||
if($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('DefaultUnitToShow').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->selectUnits('','units');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Custom code
|
||||
if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO))
|
||||
{
|
||||
@ -988,15 +997,6 @@ else
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Units
|
||||
if($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Unit').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->selectUnits("units");
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
@ -1223,7 +1223,7 @@ else
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
// Weight
|
||||
print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">';
|
||||
print '<input name="weight" size="5" value="'.$object->weight.'"> ';
|
||||
@ -1245,6 +1245,14 @@ else
|
||||
print $formproduct->select_measuring_units("volume_units", "volume", $object->volume_units);
|
||||
print '</td></tr>';
|
||||
}
|
||||
// Units
|
||||
if($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('DefaultUnitToShow').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->selectUnits($object->fk_unit, 'units');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Custom code
|
||||
if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO))
|
||||
@ -1286,15 +1294,6 @@ else
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Units
|
||||
if($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Unit').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->selectUnits($object->fk_unit);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
@ -1567,7 +1566,7 @@ else
|
||||
{
|
||||
$unit = $object->getLabelOfUnit();
|
||||
|
||||
print '<tr><td>'.$langs->trans('Unit').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('DefaultUnitToShow').'</td><td>';
|
||||
if ($unit !== '') {
|
||||
print $langs->trans($unit);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user