Bugzilla – Attachment 18072 Details for
Bug 9203
limit pull down broken when adding biblio to subscription
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9203 [Incomplete] limit pull down broken when adding biblio to subscription
Bug-9203-Incomplete-limit-pull-down-broken-when-ad.patch (text/plain), 6.47 KB, created by
Owen Leonard
on 2013-05-10 15:11:21 UTC
(
hide
)
Description:
Bug 9203 [Incomplete] limit pull down broken when adding biblio to subscription
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-05-10 15:11:21 UTC
Size:
6.47 KB
patch
obsolete
>From 3ad8aa98ad74cccdf449fad9953e25545ad00b00 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 10 May 2013 10:55:19 -0400 >Subject: [PATCH] Bug 9203 [Incomplete] limit pull down broken when adding > biblio to subscription >Content-Type: text/plain; charset="utf-8" > >When creating a subscription, if you use "Search for Biblio" link to >search for an existing record the popup has a broken item type selection >option. This broke when it became possible to add multiple values to >the AdvancedSearchTypes system preference. > >This patch uses code from opac-search.pl as a template for enabling >handling of multiple search limiters when buliding the search form. > >HOWEVER, I'm not sure how to amend the search process to handle multiple >limiters. I would be grateful if someone could take it over from here or >walk me through the process. >--- > .../en/modules/serials/subscription-bib-search.tt | 18 ++++- > serials/subscription-bib-search.pl | 78 ++++++++++---------- > 2 files changed, 54 insertions(+), 42 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tt >index f78d5e0..b84015d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tt >@@ -18,12 +18,20 @@ > <ol> > <li><label for="q">Keyword: </label> > <input type="text" id="q" name="q" /></li> >- >+ >+[% FOREACH advancedsearchesloo IN advancedsearchesloop %] > <!-- ITEMTYPE LIMITS --> >- <li><label for="itemtypelimit">Limit type to: </label> >- <select name="itemtypelimit" id="itemtypelimit"> >+ <li> >+ <label for="[% advancedsearchesloo.advanced_search_type %]"> >+ [% IF ( advancedsearchesloo.advanced_search_type == 'itemtypes' ) %]Item type >+ [% ELSIF ( advancedsearchesloo.advanced_search_type == 'ccode' ) %]Collection >+ [% ELSIF ( advancedsearchesloo.advanced_search_type == 'loc' ) %]Shelving location >+ [% ELSE %][% advancedsearchesloo.advanced_search_type %] >+ [% END %] >+ </label> >+ <select name="itemtypelimit" id="[% advancedsearchesloo.advanced_search_type %]"> > <option value="">All</option> >- [% FOREACH itemtypeloo IN itemtypeloop %] >+ [% FOREACH itemtypeloo IN advancedsearchesloo.code_loop %] > <option value="[% itemtypeloo.code %]"> > [% itemtypeloo.description |html %] > </option> >@@ -31,6 +39,8 @@ > </select> > </li> > <!-- /ITEMTYPE LIMITS --> >+[% END %] >+ > </ol> > </fieldset> > <fieldset class="action"><input type="submit" value="Search" /></fieldset> >diff --git a/serials/subscription-bib-search.pl b/serials/subscription-bib-search.pl >index 95e4aa7..773de23 100755 >--- a/serials/subscription-bib-search.pl >+++ b/serials/subscription-bib-search.pl >@@ -199,51 +199,53 @@ else { > authnotrequired => 0, > flagsrequired => {catalogue => 1, serials => '*'}, > debug => 1, >- }); >- # load the itemtypes >+ }); >+ # load the Type stuff > my $itemtypes = GetItemTypes; >- my @itemtypesloop; >- if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { >- # load the itemtypes >- my $itemtypes = GetItemTypes; >- my $selected=1; >- my $cnt; >- foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { >- my %row =( >- code => $thisitemtype, >- selected => $selected, >- description => $itemtypes->{$thisitemtype}->{'description'}, >- ); >- $selected = 0 if ($selected) ; >- push @itemtypesloop, \%row; >- } >- >- >- } else { >- my $advsearchtypes = GetAuthorisedValues($advanced_search_types); >- my $cnt; >- my $selected=1; >- for my $thisitemtype (sort {$a->{'lib'} cmp $b->{'lib'}} @$advsearchtypes) { >- my %row =( >- number=>$cnt++, >- ccl => $advanced_search_types, >- code => $thisitemtype->{authorised_value}, >- selected => $selected, >- description => $thisitemtype->{'lib'}, >- count5 => $cnt % 4, >- imageurl=> getitemtypeimagelocation( 'intranet', $thisitemtype->{'imageurl'} ), >- ); >- push @itemtypesloop, \%row; >- } >+ my @advancedsearchesloop; >+ my $selected=1; >+ >+ my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes") || "itemtypes"; >+ my @advanced_search_types = split(/\|/, $advanced_search_types); >+ >+ foreach my $advanced_srch_type (@advanced_search_types) { >+ if ($advanced_srch_type eq 'itemtypes') { >+ # itemtype is a special case, since it's not defined in authorized values >+ my @itypesloop; >+ foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { >+ my %row =( >+ code => $thisitemtype, >+ selected => $selected, >+ description => $itemtypes->{$thisitemtype}->{'description'}, >+ ); >+ $selected = 0 if ($selected); >+ push @itypesloop, \%row; >+ } >+ my %search_code = ( advanced_search_type => $advanced_srch_type, >+ code_loop => \@itypesloop ); >+ push @advancedsearchesloop, \%search_code; >+ } else { >+ # covers all the other cases: non-itemtype authorized values >+ my $advsearchtypes = GetAuthorisedValues($advanced_srch_type); >+ my @authvalueloop; >+ for my $thisitemtype (@$advsearchtypes) { >+ my %row =( >+ code => $thisitemtype->{authorised_value}, >+ description => $thisitemtype->{'lib_opac'} || $thisitemtype->{'lib'}, >+ ); >+ push @authvalueloop, \%row; >+ } >+ my %search_code = ( advanced_search_type => $advanced_srch_type, >+ code_loop => \@authvalueloop ); >+ push @advancedsearchesloop, \%search_code; >+ } > } >- >- > if ($op eq "do_search") { > $template->param("no_query" => 1); > } else { > $template->param("no_query" => 0); > } >- $template->param(itemtypeloop => \@itemtypesloop); >+$template->param(advancedsearchesloop => \@advancedsearchesloop); > } > # Print the page > output_html_with_http_headers $input, $cookie, $template->output; >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9203
:
13864
|
13865
| 18072