Skip to content

Commit

Permalink
Bug 11880: Select what has been selected before
Browse files Browse the repository at this point in the history
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 <[email protected]>

Signed-off-by: Marcel de Rooy <[email protected]>
Signed-off-by: Tomas Cohen Arazi <[email protected]>
  • Loading branch information
joubu authored and tomascohen committed Aug 28, 2015
1 parent 15338b7 commit 1f0ff90
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
30 changes: 15 additions & 15 deletions koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tt
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
3 changes: 2 additions & 1 deletion labels/label-item-search.pl
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ BEGIN
result_set=> \@results_set,
batch_id => $batch_id,
type => $type,
idx => $idx,
ccl_query => $ccl_query,
);
}
Expand Down Expand Up @@ -262,5 +261,7 @@ BEGIN

}

$template->param( idx => $idx );

# Print the page
output_html_with_http_headers $query, $cookie, $template->output;

0 comments on commit 1f0ff90

Please sign in to comment.