Bugzilla – Attachment 18550 Details for
Bug 766
Omnibus: Use of CGI::scrolling_list prevents customization in template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 766 Remove CGI::scrolling_list from request.pl
SIGNED-OFF-Bug-766-Remove-CGIscrollinglist-from-re.patch (text/plain), 5.17 KB, created by
Owen Leonard
on 2013-05-31 15:25:55 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 766 Remove CGI::scrolling_list from request.pl
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-05-31 15:25:55 UTC
Size:
5.17 KB
patch
obsolete
>From 35049c26d037db79101f5994eec9ae6783ade615 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Thu, 30 May 2013 18:23:55 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 766 Remove CGI::scrolling_list from > request.pl >Content-Type: text/plain; charset="utf-8" > >Let the template take care of generating the display. >Lets at least part of request.pl be more succinct. > >To test, place a hold and search for the patron using a partial name. >You should get a dropdown select list of patrons and be able to select >the patron to hold for from there. > >The functionality should remain unimpaired after this patch is applied. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../prog/en/modules/reserve/request.tt | 16 +++++-- > reserve/request.pl | 46 +++++--------------- > 2 files changed, 23 insertions(+), 39 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index 122b2d0..f2c7564 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -177,7 +177,7 @@ function checkMultiHold() { > <div class="dialog alert"><h3>Patron Not Found</h3><p>No patron with this name, please, try another</p> </div> > [% END %] > <form action="request.pl?biblionumber=[% biblionumber %]" method="post"> >- [% UNLESS ( CGIselectborrower ) %] >+ [% UNLESS borrower_list %] > <fieldset class="brief"> > <label for="patron">Patron: </label> > <div class="hint">Enter patron card number or partial name:</div> >@@ -186,9 +186,17 @@ function checkMultiHold() { > <input type="submit" value="Search" /> > </fieldset> > [% ELSE %] >- <fieldset> >- [% CGIselectborrower %] >- <input type="hidden" name="biblionumber" value="[% biblionumber %]" /><fieldset class="action"><input type="submit" value="Select" /></fieldset></fieldset> >+ <fieldset> >+ <select size="7" name="borrowernumber"> >+ [% FOREACH borrower IN borrower_list %] >+ <option value="[% borrower.borrowernumber %]"> >+[% borrower.surname -%], [% borrower.firstname -%] >+ ... ( [% borrower.cardnumber -%] - [% borrower.categorycode -%] >+) ... [% borrower.address %] >+ </option> >+ [% END %] >+ </select> >+ <input type="hidden" name="biblionumber" value="[% biblionumber %]" /><fieldset class="action"><input type="submit" value="Select" /></fieldset></fieldset> > > [% END %] > [% IF ( multi_hold ) %] >diff --git a/reserve/request.pl b/reserve/request.pl >index a0cc055..aea1ff8 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -76,7 +76,6 @@ my $findborrower = $input->param('findborrower'); > $findborrower = '' unless defined $findborrower; > $findborrower =~ s|,| |g; > my $borrowernumber_hold = $input->param('borrowernumber') || ''; >-my $borrowerslist; > my $messageborrower; > my $warnings; > my $messages; >@@ -113,7 +112,7 @@ if ($findborrower) { > $borrowernumber_hold = $borrowers->[0]->{'borrowernumber'}; > } > else { >- $borrowerslist = $borrowers; >+ $template->param( borrower_list => sort_borrowerlist($borrowers)); > } > } else { > $messageborrower = "'$findborrower'"; >@@ -179,38 +178,6 @@ if ($borrowernumber_hold && !$action) { > > $template->param( messageborrower => $messageborrower ); > >-my $CGIselectborrower; >-if ($borrowerslist) { >- my @values; >- my %labels; >- >- foreach my $borrower ( >- sort { >- uc($a->{surname} >- . $a->{firstname}) cmp uc($b->{surname} >- . $b->{firstname}) >- } @{$borrowerslist} >- ) >- { >- push @values, $borrower->{borrowernumber}; >- >- $labels{ $borrower->{borrowernumber} } = sprintf( >- '%s, %s ... (%s - %s) ... %s', >- $borrower->{surname} ||'', $borrower->{firstname} || '', >- $borrower->{cardnumber} || '', $borrower->{categorycode} || '', >- $borrower->{address} || '', >- ); >- } >- >- $CGIselectborrower = CGI::scrolling_list( >- -name => 'borrowernumber', >- -values => \@values, >- -labels => \%labels, >- -size => 7, >- -multiple => 0, >- ); >-} >- > # FIXME launch another time GetMember perhaps until > my $borrowerinfo = GetMember( borrowernumber => $borrowernumber_hold ); > >@@ -608,7 +575,6 @@ foreach my $biblionumber (@biblionumbers) { > borrower_branchcode => $borrowerinfo->{'branchcode'}, > ); > } >- $template->param(CGIselectborrower => $CGIselectborrower) if defined $CGIselectborrower; > > $biblioloopiter{biblionumber} = $biblionumber; > $biblioloopiter{title} = $dat->{title}; >@@ -640,3 +606,13 @@ $template->param( > > # printout the page > output_html_with_http_headers $input, $cookie, $template->output; >+ >+sub sort_borrowerlist { >+ my $borrowerslist = shift; >+ my $ref = []; >+ push @{$ref}, sort { >+ uc( $a->{surname} . $a->{firstname} ) cmp >+ uc( $b->{surname} . $b->{firstname} ) >+ } @{$borrowerslist}; >+ return $ref; >+} >-- >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 766
:
18538
|
18550
|
18664
|
25904
|
25905
|
25906
|
25907
|
26401
|
27010
|
27011
|
27012
|
27013
|
27014
|
27044
|
27045
|
27046
|
27047
|
27048
|
27396
|
27400
|
27441
|
27442
|
27443
|
27444
|
27445
|
27446
|
27447
|
27448
|
27479
|
27495
|
27665
|
27666
|
27667
|
27668
|
27669
|
27670
|
27671
|
29870
|
29871
|
29872
|
29877
|
30404
|
30405
|
30406
|
30428
|
30430
|
30432
|
30510
|
30511
|
30512