Browse Source

Bug 19807: Make IntranetCatalogSearchPulldown honor IntranetNumbersPreferPhrase

This patch
- fixes callnum and sn
- Removes unecessary syspref transmission to the template.
  As the template directly reads the syspref

Test plan:
1. Set sysprefs IntranetCatalogSearchPulldown and
   IntranetNumbersPreferPhrase to true
2. Go to staff:/cgi-bin/koha/catalogue/search.pl
3. "search for" → "call number" and write anything that won't match a
   call number in the field
4. Then you should see
   «No results match your search for 'callnum,phr: [...]»
5. Go to the staff homepage
6. Click on "Search the catalog"
7. Do the same search as previouly
8. Then you should see
   «No results match your search for 'callnum,wrdl: [...]»
   This shows that IntranetNumbersPreferPhrase isn't honored
9. Apply this patch
10. Redo the same two searches and see that phr will now be always used.
    So IntranetNumbersPreferPhrase is honored

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
18.05.x
Victor Grousset 5 years ago
committed by Jonathan Druart
parent
commit
886b197b2d
  1. 3
      catalogue/search.pl
  2. 5
      koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc

3
catalogue/search.pl

@ -191,9 +191,6 @@ my $lang = C4::Languages::getlanguage($cgi);
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
$template->param('UNIMARC' => 1);
}
if (C4::Context->preference("IntranetNumbersPreferPhrase")) {
$template->param('numbersphr' => 1);
}
if($cgi->cookie("holdfor")){
my $holdfor_patron = Koha::Patrons->find( $cgi->cookie("holdfor") );

5
koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc

@ -1,3 +1,4 @@
[% USE Koha %]
<select class="advsearch" name="idx">
<option value="kw">Keyword</option>
<option value="kw,phr">&nbsp;&nbsp;&nbsp;&nbsp; Keyword as phrase</option>
@ -21,14 +22,14 @@
[% END %]
<option value="bc">Barcode</option>
<option value="location">Shelving location</option>
[% IF (numbersphr) %]
[% IF ( Koha.Preference('IntranetNumbersPreferPhrase') ) %]
<option value="sn,phr">Standard number</option>
[% ELSE %]
<option value="sn">Standard number</option>
[% END %]
<option value="nb">&nbsp;&nbsp;&nbsp;&nbsp; ISBN</option>
<option value="ns">&nbsp;&nbsp;&nbsp;&nbsp; ISSN</option>
[% IF (numbersphr) %]
[% IF ( Koha.Preference('IntranetNumbersPreferPhrase') ) %]
<option value="callnum,phr">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>
[% ELSE %]
<option value="callnum">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>

Loading…
Cancel
Save