add show empty
This commit is contained in:
parent
bcb98d1d67
commit
9c3988da5c
@ -432,9 +432,10 @@ class FormProduct
|
|||||||
* @param string $name Name of HTML field
|
* @param string $name Name of HTML field
|
||||||
* @param string $selected Preselected value
|
* @param string $selected Preselected value
|
||||||
* @param int $mode 1=Use label as value, 0=Use code
|
* @param int $mode 1=Use label as value, 0=Use code
|
||||||
|
* @param int $showempty 1=show empty value, 0= no
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function selectProductNature($name = 'finished', $selected = '', $mode = 0)
|
public function selectProductNature($name = 'finished', $selected = '', $mode = 0, $showempty=1)
|
||||||
{
|
{
|
||||||
global $langs, $db;
|
global $langs, $db;
|
||||||
|
|
||||||
@ -461,11 +462,13 @@ class FormProduct
|
|||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
$return .= '<select class="flat" name="'.$name.'">';
|
$return .= '<select class="flat" name="'.$name.'">';
|
||||||
$return .= '<option value="-1"';
|
if ($showempty || ($selected == '' || $selected == '-1')) {
|
||||||
if ($selected=='' || $selected=='-1') {
|
$return .= '<option value="-1"';
|
||||||
$return .= ' selected';
|
if ($selected == '' || $selected == '-1') {
|
||||||
|
$return .= ' selected';
|
||||||
|
}
|
||||||
|
$return .= '></option>';
|
||||||
}
|
}
|
||||||
$return .= '></option>';
|
|
||||||
if (!empty($productNature->records) && is_array($productNature->records)) {
|
if (!empty($productNature->records) && is_array($productNature->records)) {
|
||||||
foreach ($productNature->records as $lines) {
|
foreach ($productNature->records as $lines) {
|
||||||
$return .= '<option value="';
|
$return .= '<option value="';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user