Bug 11880: Select what has been selected before
The previous patch wants to select the barcode option when the user is
on the item search for label, in all cases.
So even if 'title' is selected, a search done, and there is no result,
the barcode index is selected anyway.
In this case, the title option should be kept.
Test plan:
Confirm that the barcode option is the default choice, but other values
are kept if the search does not return any result.
Followed test plan, behaves as expected. Tested with all choices.
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1f0ff90360)
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
This commit is contained in:
parent
2e87354a74
commit
f365143c18
|
|
@ -23,45 +23,45 @@ to add to Batch [% batch_id %]
|
|||
<ol><li>
|
||||
<select name="idx" > <!-- FIXME: script does keyword search regardless -->
|
||||
|
||||
[% IF ( selected ) %]<option value="kw" selected="selected">Keyword</option>
|
||||
[% IF idx == 'kw' %]<option value="kw" selected="selected">Keyword</option>
|
||||
[% ELSE %]<option value="kw">Keyword</option>[% END %]
|
||||
|
||||
[% IF ( selected ) %]<option value="au" selected="selected">Author</option>
|
||||
[% IF idx == 'au' %]<option value="au" selected="selected">Author</option>
|
||||
[% ELSE %]<option value="au">Author</option>[% END %]
|
||||
|
||||
[% IF ( selected ) %]<option value="yr" selected="selected">Publication date</option>
|
||||
[% IF idx == 'yr' %]<option value="yr" selected="selected">Publication date</option>
|
||||
[% ELSE %]<option value="yr">Publication date</option>[% END %]
|
||||
|
||||
[% IF ( selected ) %]<option value="sn" selected="selected">Standard number</option>
|
||||
[% IF idx == 'sn' %]<option value="sn" selected="selected">Standard number</option>
|
||||
[% ELSE %]<option value="sn">Standard number</option>[% END %]
|
||||
|
||||
[% IF ( selected ) %]<option value="nb" selected="selected">ISBN</option>
|
||||
[% IF idx == 'nb' %]<option value="nb" selected="selected">ISBN</option>
|
||||
[% ELSE %]<option value="nb">ISBN</option>[% END %]
|
||||
|
||||
[% IF ( selected ) %]<option value="ns" selected="selected">ISSN</option>
|
||||
[% IF idx == 'ns' %]<option value="ns" selected="selected">ISSN</option>
|
||||
[% ELSE %]<option value="ns">ISSN</option>[% END %]
|
||||
|
||||
[% IF ( selected ) %]<option value="lcn,phr" selected="selected">Call number</option>
|
||||
[% IF idx == 'lcn,phr' %]<option value="lcn,phr" selected="selected">Call number</option>
|
||||
[% ELSE %]<option value="lcn,phr">Call number</option>[% END %]
|
||||
|
||||
[% IF ( selected ) %]<option value="su" selected="selected">Subject</option>
|
||||
[% IF idx == 'su' %]<option value="su" selected="selected">Subject</option>
|
||||
[% ELSE %]<option value="su">Subject</option>[% END %]
|
||||
|
||||
[% IF ( selected ) %]
|
||||
[% IF idx == 'ti' %]
|
||||
<option value="ti" selected="selected">Title</option>
|
||||
[% ELSE %]
|
||||
<option value="ti" selected="selected">Title</option>[% END %]
|
||||
<option value="ti">Title</option>[% END %]
|
||||
|
||||
[% IF ( selected ) %]<option value="ti,phr" selected="selected">Title phrase</option>
|
||||
[% IF idx == 'ti,phr' %]<option value="ti,phr" selected="selected">Title phrase</option>
|
||||
[% ELSE %]<option value="ti,phr">Title phrase</option>[% END %]
|
||||
|
||||
[% IF ( selected ) %]<option value="se" selected="selected">Series title</option>
|
||||
[% IF idx == 'se' %]<option value="se" selected="selected">Series title</option>
|
||||
[% ELSE %]<option value="se">Series title</option>[% END %]
|
||||
|
||||
[% IF ( selected ) %]<option value="bc" selected="selected">Barcode</option>
|
||||
[% ELSE %]<option value="bc" selected="selected">Barcode</option>[% END %]
|
||||
[% IF idx == 'bc' or not idx %]<option value="bc" selected="selected">Barcode</option>
|
||||
[% ELSE %]<option value="bc">Barcode</option>[% END %]
|
||||
|
||||
[% IF ( selected ) %]<option value="acqdate" selected="selected">Acquisition date</option>
|
||||
[% IF idx == 'acqdate' %]<option value="acqdate" selected="selected">Acquisition date</option>
|
||||
[% ELSE %]<option value="acqdate">Acquisition date</option>[% END %]
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -225,7 +225,6 @@ if ($show_results) {
|
|||
result_set=> \@results_set,
|
||||
batch_id => $batch_id,
|
||||
type => $type,
|
||||
idx => $idx,
|
||||
ccl_query => $ccl_query,
|
||||
);
|
||||
}
|
||||
|
|
@ -262,5 +261,7 @@ else {
|
|||
|
||||
}
|
||||
|
||||
$template->param( idx => $idx );
|
||||
|
||||
# Print the page
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
|
|||
Loading…
Reference in New Issue