From: Janusz Dobrowolski Date: Fri, 7 May 2010 13:37:10 +0000 (+0000) Subject: Fixed bug in array_selector X-Git-Tag: v2.4.2~19^2~899 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=c3e31ddfb1139d6264bddd2a211e18c35ded6e54;p=fa-stable.git Fixed bug in array_selector --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ed78295b..bd8af76f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,10 @@ Legend: ! -> Note $ -> Affected files +07-May-2010 Janusz Dobrowolski +# Fixed bug in array_selector for multiply lists +$ /includes/ui/ui_lists.inc + 30-Apr-2010 Janusz Dobrowolski + Recovering next reference after voiding of last reference /admin/db/voiding_db.inc diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 72d2dd9c..24dedae2 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -89,7 +89,7 @@ $opts = array( // default options $opts['sel_hint'] = $by_id || $search_box==false ? '' : _('Press Space tab for search pattern entry'); - if ($opts['box_hint'] === null) // dodaƦ hint dla pustego **** + if ($opts['box_hint'] === null) $opts['box_hint'] = $search_box && $search_submit != false ? ($by_id ? _('Enter code fragment to search or * for all') : _('Enter description fragment to search or * for all')) :''; @@ -103,7 +103,6 @@ $opts = array( // default options $txt = get_post($search_box); $rel = ''; $limit = ''; - if (isset($_POST['_'.$name.'_update'])) { // select list or search box change if ($by_id) $txt = $_POST[$name]; @@ -145,6 +144,7 @@ $opts = array( // default options } } } + // sql completion if (count($opts['where'])) { $where = strpos($sql, 'WHERE')==false ? ' WHERE ':' AND '; @@ -345,16 +345,14 @@ $opts = array( // default options foreach($items as $value=>$descr) { $sel = ''; if (in_array((string)$value, $selected_id, true)) { - $sel = "selected='selected'"; + $sel = 'selected'; $found = $value; } if ($first_id === false) { $first_id = $value; - $first_opt = "\n"; - } - else { - $selector .= "\n"; + $first_opt = $descr; } + $selector .= "\n"; } if ($first_id!==false) { @@ -365,7 +363,7 @@ $opts = array( // default options if ($spec_option !== false) { // if special option used - add it $first_id = $spec_id; $first_opt = $spec_option; - $sel = $found===false ? "selected='selected'" : ''; + $sel = $found===false ? 'selected' : ''; $selector = "\n" . $selector; } @@ -374,6 +372,7 @@ $opts = array( // default options $selected_id = array($first_id); } $_POST[$name] = $multi ? $selected_id : $selected_id[0]; + $selector = "