From e31af7f914093dbd55569c520bae31e66429c702 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Sun, 12 Jul 2015 18:05:56 +0200 Subject: [PATCH] Can filter list of setup constant on name and extend visibility to all. --- htdocs/admin/const.php | 5 ++-- htdocs/fichinter/card.php | 5 ++-- htdocs/langs/en_US/admin.lang | 2 +- htdocs/langs/fr_FR/products.lang | 1 + htdocs/product/card.php | 39 ++++++++++++++++---------------- 5 files changed, 27 insertions(+), 25 deletions(-) diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 55434d4de2e..0f9213fc252 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -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); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index b6505f19e4e..b73d2281a3a 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -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'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 67750a18aae..6d1b24a2bc1 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -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 ##### diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index c3e20457a79..b1bb18289cc 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -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 \ No newline at end of file diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 20f3361fac1..ec60f691e05 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -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); } -- GitLab