Skip to content

Commit

Permalink
Can filter list of setup constant on name and extend visibility to all.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jul 12, 2015
1 parent 11c94a9 commit e31af7f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 25 deletions.
5 changes: 3 additions & 2 deletions htdocs/admin/const.php
Expand Up @@ -229,8 +229,9 @@
$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);
Expand Down
5 changes: 3 additions & 2 deletions htdocs/fichinter/card.php
Expand Up @@ -1380,6 +1380,7 @@
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">';
Expand Down Expand Up @@ -1556,9 +1557,9 @@
print '<td colspan="4">&nbsp;</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';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/langs/en_US/admin.lang
Expand Up @@ -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 #####
Expand Down
1 change: 1 addition & 0 deletions htdocs/langs/fr_FR/products.lang
Expand Up @@ -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
39 changes: 19 additions & 20 deletions htdocs/product/card.php
Expand Up @@ -952,6 +952,15 @@
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))
{
Expand Down Expand Up @@ -988,15 +997,6 @@
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>';
Expand Down Expand Up @@ -1223,7 +1223,7 @@
print '</td></tr>';
}
else
{
{
// Weight
print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">';
print '<input name="weight" size="5" value="'.$object->weight.'"> ';
Expand All @@ -1245,6 +1245,14 @@
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))
Expand Down Expand Up @@ -1286,15 +1294,6 @@
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>';
Expand Down Expand Up @@ -1567,7 +1566,7 @@
{
$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);
}
Expand Down

0 comments on commit e31af7f

Please sign in to comment.