Can filter list of setup constant on name and extend visibility to all.

This commit is contained in:
Laurent Destailleur 2015-07-12 18:05:56 +02:00
parent 11c94a9d3b
commit e31af7f914
5 changed files with 27 additions and 25 deletions

View File

@ -229,8 +229,9 @@ $sql.= ", note";
$sql.= ", entity"; $sql.= ", entity";
$sql.= " FROM ".MAIN_DB_PREFIX."const"; $sql.= " FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")"; $sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug
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 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"; $sql.= " ORDER BY entity, name ASC";
dol_syslog("Const::listConstant", LOG_DEBUG); dol_syslog("Const::listConstant", LOG_DEBUG);

View File

@ -1380,6 +1380,7 @@ else if ($id > 0 || ! empty($ref))
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
} }
// Line of interventions
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
{ {
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="addinter" method="post">'; 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">&nbsp;</td>'; print '<td colspan="4">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
$var=false; $var=true;
print '<tr '.$bc[$var].">\n"; print '<tr '.$bcnd[$var].">\n";
print '<td>'; print '<td>';
// editeur wysiwyg // editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';

View File

@ -1397,7 +1397,7 @@ UseSearchToSelectProduct=Use a search form to choose a product (rather than a dr
UseEcoTaxeAbility=Support Eco-Taxe (WEEE) UseEcoTaxeAbility=Support Eco-Taxe (WEEE)
SetDefaultBarcodeTypeProducts=Default barcode type to use for products SetDefaultBarcodeTypeProducts=Default barcode type to use for products
SetDefaultBarcodeTypeThirdParties=Default barcode type to use for third parties 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) ProductCodeChecker= Module for product code generation and checking (product or service)
ProductOtherConf= Product / Service configuration ProductOtherConf= Product / Service configuration
##### Syslog ##### ##### Syslog #####

View File

@ -296,3 +296,4 @@ PropalMergePdfProductActualFile=Files use to add into PDF Azur are/is
PropalMergePdfProductChooseFile=Select PDF files PropalMergePdfProductChooseFile=Select PDF files
IncludingProductWithTag=Including product with tag IncludingProductWithTag=Including product with tag
DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on customer DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on customer
DefaultUnitToShow=Default unit to show

View File

@ -952,6 +952,15 @@ else
print '</td></tr>'; 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 // Custom code
if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO))
{ {
@ -988,15 +997,6 @@ else
print "</td></tr>"; 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 '</table>';
print '<br>'; print '<br>';
@ -1223,7 +1223,7 @@ else
print '</td></tr>'; print '</td></tr>';
} }
else else
{ {
// Weight // Weight
print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">';
print '<input name="weight" size="5" value="'.$object->weight.'"> '; 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 $formproduct->select_measuring_units("volume_units", "volume", $object->volume_units);
print '</td></tr>'; 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 // Custom code
if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO))
@ -1286,15 +1294,6 @@ else
print "</td></tr>"; 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 '</table>';
print '<br>'; print '<br>';
@ -1567,7 +1566,7 @@ else
{ {
$unit = $object->getLabelOfUnit(); $unit = $object->getLabelOfUnit();
print '<tr><td>'.$langs->trans('Unit').'</td><td>'; print '<tr><td>'.$langs->trans('DefaultUnitToShow').'</td><td>';
if ($unit !== '') { if ($unit !== '') {
print $langs->trans($unit); print $langs->trans($unit);
} }