Bugzilla – Attachment 15184 Details for
Bug 9457
Ordering branches should be case independent (2)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9457: [ENH] Ordering branches should be case independent (2)
Bug-9457-ENH-Ordering-branches-should-be-case-inde.patch (text/plain), 29.33 KB, created by
Kyle M Hall (khall)
on 2013-02-08 17:40:39 UTC
(
hide
)
Description:
Bug 9457: [ENH] Ordering branches should be case independent (2)
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-02-08 17:40:39 UTC
Size:
29.33 KB
patch
obsolete
>From 899f9aec92765482b352fe458cbe15d4e898edd4 Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Wed, 23 Jan 2013 11:44:41 -0300 >Subject: [PATCH] Bug 9457: [ENH] Ordering branches should be case independent (2) > >This patch replace use of CGI::scroll_list() to show list of branches. > >In two files, marc21_linking_section.pl and unimarc_field_4XX.pl, >the scrolling list is created but not used in the template file, >so the code is removed. > >Also minor renaming/normalizing of variables. > >To test: >1) Install with some branches, records and patrons > >2.1) Select a record, click 'Place hold', select user, > there is a library pull-down next to 'Pickup at:', > list is ordered case sensitive >2.2) Go to Reports > Average loan time, > next to Library is a pull-down, > list without order >2.3) Go to Reports > Catalog by item type, > next to 'Select a library' is a pull-down, > list is ordered case sensitive >2.4) This is tricky, go to Reports home, > change last part of URL 'reports-home.pl' with > 'manager.pl?report_name=issues_by_borrower_category' > (can't find a direct link), next to 'Select a library' > is a library pull-down, > list without order >2.5) Edit/Add a patron, on section 'Library management' > there is a library pull-down, case sensitive >2.6) OPAC, as logged user, make a suggestion or hold, > there is library pull-down, correct order > >3) Apply the patch > >4.1) Repeat 2.1), correctly ordered list >4.2) Repeat 2.2), correctly ordered list >4.3) Repeat 2.3), correctly ordered list >4.4) Repeat 2.4), correctly ordered list >4.5) This is a bit more work > There are 3 possible situations to test: > A) No branches, must show a message that are no > libraries defined > B) New patron, must show a correctly ordered > list of branches, current branch selected > C) Edit patron, must show a correctly ordered > list of branches, patron branch selected >4.6) Small changes on variable names, so retest 2.6) > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../value_builder/marc21_linking_section.pl | 21 +--------- > cataloguing/value_builder/unimarc_field_4XX.pl | 21 +--------- > .../prog/en/modules/members/memberentrygen.tt | 23 +++++++--- > .../prog/en/modules/reports/issues_avg_stats.tt | 8 +++- > .../modules/reports/issues_by_borrower_category.tt | 42 +++++++++++++------ > .../prog/en/modules/reports/itemtypes.tt | 33 +++++++++++---- > .../prog/en/modules/reserve/request.tt | 14 +++++- > .../opac-tmpl/prog/en/modules/opac-reserve.tt | 16 ++++---- > .../opac-tmpl/prog/en/modules/opac-suggestions.tt | 10 ++-- > members/memberentry.pl | 45 ++++--------------- > opac/opac-reserve.pl | 5 +- > opac/opac-suggestions.pl | 4 +- > reports/issues_avg_stats.pl | 31 ++++---------- > reports/issues_by_borrower_category.plugin | 42 ++++++------------ > reports/itemtypes.plugin | 24 +--------- > reserve/request.pl | 21 +-------- > 16 files changed, 145 insertions(+), 215 deletions(-) > >diff --git a/cataloguing/value_builder/marc21_linking_section.pl b/cataloguing/value_builder/marc21_linking_section.pl >index f317f8b..ec9a42f 100644 >--- a/cataloguing/value_builder/marc21_linking_section.pl >+++ b/cataloguing/value_builder/marc21_linking_section.pl >@@ -348,25 +348,7 @@ sub plugin { > ); > $sth->finish; > >- my @branchloop; >- my @select_branch; >- my %select_branches; >- my $branches = GetBranches; >- push @select_branch, ""; >- $select_branches{''} = ""; >- foreach my $thisbranch ( keys %$branches ) { >- push @select_branch, $branches->{$thisbranch}->{'branchcode'}; >- $select_branches{ $branches->{$thisbranch}->{'branchcode'} } = >- $branches->{$thisbranch}->{'branchname'}; >- } >- my $CGIbranch = CGI::scrolling_list( >- -name => 'value', >- -values => \@select_branch, >- -labels => \%select_branches, >- -size => 1, >- -multiple => 0 >- ); >- $sth->finish; >+ # To show list of branches please use GetBranchesLoop() and modify template > > my $req = $dbh->prepare( > "select distinctrow left(publishercode,45) from biblioitems order by publishercode" >@@ -396,7 +378,6 @@ sub plugin { > > $template->param( #classlist => $classlist, > CGIitemtype => $CGIitemtype, >- CGIbranch => $CGIbranch, > CGIPublisher => $CGIpublisher, > itypeloop => \@itemtypes, > index => $query->param('index'), >diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl >index acc0854..9854416 100755 >--- a/cataloguing/value_builder/unimarc_field_4XX.pl >+++ b/cataloguing/value_builder/unimarc_field_4XX.pl >@@ -503,25 +503,7 @@ sub plugin { > ); > $sth->finish; > >- my @branchloop; >- my @select_branch; >- my %select_branches; >- my $branches = GetBranches; >- push @select_branch, ""; >- $select_branches{''} = ""; >- foreach my $thisbranch ( keys %$branches ) { >- push @select_branch, $branches->{$thisbranch}->{'branchcode'}; >- $select_branches{ $branches->{$thisbranch}->{'branchcode'} } = >- $branches->{$thisbranch}->{'branchname'}; >- } >- my $CGIbranch = CGI::scrolling_list( >- -name => 'value', >- -values => \@select_branch, >- -labels => \%select_branches, >- -size => 1, >- -multiple => 0 >- ); >- $sth->finish; >+ # To show list of branches please use GetBranchesLoop() and modify template > > my $req = > $dbh->prepare( >@@ -552,7 +534,6 @@ sub plugin { > > $template->param( #classlist => $classlist, > CGIitemtype => $CGIitemtype, >- CGIbranch => $CGIbranch, > CGIPublisher => $CGIpublisher, > itypeloop => \@itemtypes, > index => $query->param('index'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index edabba0..aff51c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -993,14 +993,25 @@ > [% END %] > [% UNLESS nobranchcode %] > <li> >- [% IF ( mandatorybranchcode ) %] >+ [%- IF ( mandatorybranchcode ) -%] > <label for="branchcode" class="required"> >- [% ELSE %] >+ [%- ELSE -%] > <label for="branchcode"> >- [% END %] >- Library: </label> >- [% CGIbranch %] >- [% IF ( mandatorybranchcode ) %]<span class="required">Required</span>[% END %] >+ [%- END -%] >+ Library:</label> >+ <select name="branchcode" size="1" id="branchcode"> >+ <option value=""></option> >+ [%- FOREACH branchloo IN branchloop %] >+ [% IF ( branchloo.selected ) -%] >+ <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option> >+ [%- ELSE -%] >+ <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option> >+ [%- END -%] >+ [%- END %] >+ </select> >+ [% IF ( mandatorybranchcode ) -%] >+ <span class="required">Required</span> >+ [%- END %] > </li> > [% END %] > <li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt >index eef1fd1..9010092 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt >@@ -164,7 +164,13 @@ > <td>Library</td> > <td><input type="radio" name="Line" value="branchcode" /></td> > <td><input type="radio" name="Column" value="branchcode" /></td> >- <td>[% CGIBranch %]</td> >+ <td><select name="Filter" size="1" id="branch"> >+ <option value=""></option> >+ [%- FOREACH branchloo IN branchloop %] >+ <option value="[% branchloo.value %]">[% branchloo.branchname %]</option> >+ [%- END %] >+ </select> >+ </td> > </tr> > <!-- Modified according to statistics table > <tr> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_by_borrower_category.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_by_borrower_category.tt >index d0a315f..4af5165 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_by_borrower_category.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_by_borrower_category.tt >@@ -51,19 +51,35 @@ > </table> > [% END %] > [% ELSE %] >- <form method="post" action="/cgi-bin/koha/reports/manager.pl"> >- <fieldset class="rows"> >- <legend>Checkouts by patron category</legend> >- <ol><li><label for="borrowercategory">Select a borrower category</label><select name="value" id="borrowercategory"><option value="" > Any Category code</option> >- [% FOREACH loopcategorie IN loopcategories %] >- <option value="[% loopcategorie.value %]" >[% loopcategorie.description %] </option> >- [% END %] >- </select></li> >- <li><label for="branch">Select a library:</label> [% CGIbranch %]</li></ol></fieldset> >- <fieldset class="action"><input type="submit" value="Submit" /> >- <input type="hidden" name="report_name" value="[% report_name %]" /> >- <input type="hidden" name="do_it" value="1" /></fieldset> >- </form> >+ <form method="post" action="/cgi-bin/koha/reports/manager.pl"> >+ <fieldset class="rows"> >+ <legend>Checkouts by patron category</legend> >+ <ol> >+ <li> >+ <label for="borrowercategory">Select a borrower category</label> >+ <select name="value" id="borrowercategory"> >+ <option value="">Any Category code</option> >+ [%- FOREACH loopcategorie IN loopcategories %] >+ <option value="[% loopcategorie.value %]" >[% loopcategorie.description %]</option> >+ [%- END %] >+ </select> >+ </li> >+ <li> >+ <label for="branch">Select a library:</label> >+ <select name="value" size="1" id="branch"> >+ <option value=""></option> >+ [%- FOREACH branchloo IN branchloop %] >+ <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option> >+ [%- END %] >+ </select> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="action"><input type="submit" value="Submit" /> >+ <input type="hidden" name="report_name" value="[% report_name %]" /> >+ <input type="hidden" name="do_it" value="1" /> >+ </fieldset> >+ </form> > [% END %] > > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt >index 6a30dc9..6a81cfa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt >@@ -49,14 +49,31 @@ $(document).ready(function() { > </table> > [% END %] > [% ELSE %] >- <h3>View a count of items held at your library grouped by item type</h3> >- <form method="post" action="/cgi-bin/koha/reports/manager.pl?report_name=itemtypes"> >- <fieldset class="rows"><ol><li><label for="value">Select a library</label> [% CGIbranch %] >- <span class="tip">Select none to see all libraries</span></li></ol></fieldset> >- <fieldset class="action"><input type="submit" value="Submit" /> >- <input type="hidden" name="report_name" value="[% report_name %]" /> >- <input type="hidden" name="do_it" value="1" /></fieldset> >- </form> >+ <h3>View a count of items held at your library grouped by item type</h3> >+ <form method="post" action="/cgi-bin/koha/reports/manager.pl?report_name=itemtypes"> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="value">Select a library</label> >+ <select name="value" size="1" id="value"> >+ <option value=""></option> >+ [%- FOREACH branchloo IN branchloop %] >+ [% IF ( branchloo.selected ) -%] >+ <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option> >+ [%- ELSE -%] >+ <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option> >+ [%- END -%] >+ [%- END %] >+ </select> >+ <span class="tip">Select none to see all libraries</span> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="action"><input type="submit" value="Submit" /> >+ <input type="hidden" name="report_name" value="[% report_name %]" /> >+ <input type="hidden" name="do_it" value="1" /> >+ </fieldset> >+ </form> > [% END %] > > </div> >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 e9a5914..122b2d0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -286,7 +286,15 @@ function checkMultiHold() { > </li> > <li> > <label for="pickup">Pickup at:</label> >- [% CGIbranch %] >+ <select name="pickup" size="1" id="pickup"> >+ [%- FOREACH branchloo IN branchloop %] >+ [% IF ( branchloo.selected ) -%] >+ <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option> >+ [%- ELSE -%] >+ <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option> >+ [%- END -%] >+ [%- END %] >+ </select> > </li> > > [% IF ( reserve_in_future ) %] >@@ -620,9 +628,9 @@ function checkMultiHold() { > <select name="pickup"> > [% FOREACH branchloo IN reserveloo.branchloop %] > [% IF ( branchloo.selected ) %] >- <option value="[% branchloo.value %]" selected="selected"> >+ <option value="[% branchloo.branchcode %]" selected="selected"> > [% ELSE %] >- <option value="[% branchloo.value %]"> >+ <option value="[% branchloo.branchcode %]"> > [% END %] > [% branchloo.branchname %] > </option> >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >index 5788b38..1dbddbf 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >@@ -390,21 +390,21 @@ > <td class="branch"> > [% UNLESS ( bibitemloo.holdable ) %] > <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled"> >- [% FOREACH branchChoicesLoo IN bibitemloo.branchChoicesLoop %] >- [% IF ( branchChoicesLoo.selected ) %] >- <option value="[% branchChoicesLoo.value %]" selected="selected">[% branchChoicesLoo.branchname %]</option> >+ [% FOREACH branchloo IN bibitemloo.branchloop %] >+ [% IF ( branchloo.selected ) %] >+ <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option> > [% ELSE %] >- <option value="[% branchChoicesLoo.value %]">[% branchChoicesLoo.branchname %]</option> >+ <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option> > [% END %] > [% END %] > </select> > [% ELSE %] > <select name="branch" id="branch_[% bibitemloo.biblionumber %]"> >- [% FOREACH branchChoicesLoo IN bibitemloo.branchChoicesLoop %] >- [% IF ( branchChoicesLoo.selected ) %] >- <option value="[% branchChoicesLoo.value %]" selected="selected">[% branchChoicesLoo.branchname %]</option> >+ [% FOREACH branchloo IN bibitemloo.branchloop %] >+ [% IF ( branchloo.selected ) %] >+ <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option> > [% ELSE %] >- <option value="[% branchChoicesLoo.value %]">[% branchChoicesLoo.branchname %]</option> >+ <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option> > [% END %] > [% END %] > </select> >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt >index 3f1b288..65cb297 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt >@@ -116,14 +116,14 @@ $.tablesorter.addParser({ > [% IF ( itemtypeloo.selected ) %]<option value="[% itemtypeloo.itemtype %]" selected="selected"> [% ELSE %]<option value="[% itemtypeloo.itemtype %]"> [% END %] [% itemtypeloo.description %]</option> > [% END %] > </select> </li> >- [% IF ( branch_loop ) %] >+ [% IF ( branchloop ) %] > <li><label for="branch">Library:</label> > <select name="branch" id="branch"> >- [% FOREACH branch_loo IN branch_loop %] >- [% IF ( branch_loo.selected ) %] >- <option value="[% branch_loo.value %]" selected="selected">[% branch_loo.branchname %]</option> >+ [% FOREACH branchloo IN branchloop %] >+ [% IF ( branchloo.selected ) %] >+ <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option> > [% ELSE %] >- <option value="[% branch_loo.value %]">[% branch_loo.branchname %]</option> >+ <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option> > [% END %] > [% END %] > </select> >diff --git a/members/memberentry.pl b/members/memberentry.pl >index f6d3e5e..0d6122d 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -568,43 +568,18 @@ foreach (keys(%flags)) { > push @flagdata,\%row; > } > >-#get Branches >-my @branches; >-my @select_branch; >-my %select_branches; >- >-my $onlymine=(C4::Context->preference('IndependantBranches') && >- C4::Context->userenv && >- C4::Context->userenv->{flags} % 2 !=1 && >- C4::Context->userenv->{branch}?1:0); >- >-my $branches=GetBranches($onlymine); >-my $default; >-my $CGIbranch; >-for my $branch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { >- push @select_branch,$branch; >- $select_branches{$branch} = $branches->{$branch}->{'branchname'}; >- $default = C4::Context->userenv->{'branch'} if (C4::Context->userenv && C4::Context->userenv->{'branch'}); >-} >-if(scalar(@select_branch) > 0){ >-# -------------------------------------------------------------------------------------------------------- >- #in modify mod :default value from $CGIbranch comes from borrowers table >- #in add mod: default value come from branches table (ip correspendence) >+# get Branch Loop >+# in modify mod: userbranch value for GetBranchesLoop() comes from borrowers table >+# in add mod: userbranch value come from branches table (ip correspondence) >+ >+my $userbranch = C4::Context->userenv->{'branch'}; > if (defined ($data{'branchcode'}) and ( $op eq 'modify' || ( $op eq 'add' && $category_type eq 'C' ) )) { >- $default = $data{'branchcode'}; >-} >-$CGIbranch = CGI::scrolling_list(-id => 'branchcode', >- -name => 'branchcode', >- -values => \@select_branch, >- -labels => \%select_branches, >- -size => 1, >- -override => 1, >- -multiple =>0, >- -default => $default, >- ); >+ $userbranch = $data{'branchcode'}; > } > >-if(!$CGIbranch){ >+my $branchloop = GetBranchesLoop( $userbranch ); >+ >+if( !$branchloop ){ > $no_add = 1; > $template->param(no_branches => 1); > } >@@ -710,7 +685,7 @@ $template->param( > check_member => $check_member,#to know if the borrower already exist(=>1) or not (=>0) > "op$op" => 1); > >-$template->param(CGIbranch=>$CGIbranch) if ($CGIbranch); >+$template->param( branchloop => $branchloop ) if ( $branchloop ); > $template->param( > nodouble => $nodouble, > borrowernumber => $borrowernumber, #register number >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 07b4f76..e725d30 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -108,8 +108,7 @@ my $branch = $query->param('branch') || $borr->{'branchcode'} || C4::Context->us > $template->param( branch => $branch ); > > # make branch selection options... >-my $CGIbranchloop = GetBranchesLoop($branch); >-$template->param( CGIbranch => $CGIbranchloop ); >+my $branchloop = GetBranchesLoop($branch); > > # Is the person allowed to choose their branch > my $OPACChooseBranch = (C4::Context->preference("OPACAllowUserToChooseBranch")) ? 1 : 0; >@@ -358,7 +357,7 @@ foreach my $biblioNum (@biblionumbers) { > > my $record = GetMarcBiblio($biblioNum); > # Init the bib item with the choices for branch pickup >- my %biblioLoopIter = ( branchChoicesLoop => $CGIbranchloop ); >+ my %biblioLoopIter = ( branchloop => $branchloop ); > > # Get relevant biblio data. > my $biblioData = $biblioDataHash{$biblioNum}; >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index eddcd26..1b353fd 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -131,8 +131,8 @@ if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) { > my $branch = $input->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ; > > # make branch selection options... >- my $CGIbranchloop = GetBranchesLoop($branch); >- $template->param( branch_loop => $CGIbranchloop ); >+ my $branchloop = GetBranchesLoop($branch); >+ $template->param( branchloop => $branchloop ); > } > > $template->param( >diff --git a/reports/issues_avg_stats.pl b/reports/issues_avg_stats.pl >index bbd6f52..b601a44 100755 >--- a/reports/issues_avg_stats.pl >+++ b/reports/issues_avg_stats.pl >@@ -160,21 +160,6 @@ if ($do_it) { > $hassort1 =1 if ($value); > push @select, $value; > } >- my $branches=GetBranches(); >- my @select_branch; >- my %select_branches; >- push @select_branch,""; >- $select_branches{""} = ""; >- foreach my $branch (keys %$branches) { >- push @select_branch, $branch; >- $select_branches{$branch} = $branches->{$branch}->{'branchname'}; >- } >- my $CGIBranch=CGI::scrolling_list( -name => 'Filter', >- -id => 'branch', >- -values => \@select_branch, >- -labels => \%select_branches, >- -size => 1, >- -multiple => 0 ); > > my $CGISort1=CGI::scrolling_list( -name => 'Filter', > -id => 'sort1', >@@ -209,14 +194,14 @@ if ($do_it) { > my $CGIsepChoice=GetDelimiterChoices; > > $template->param( >- CGIBorCat => $CGIBorCat, >- CGIItemType => $CGIItemTypes, >- CGIBranch => $CGIBranch, >- hassort1=> $hassort1, >- hassort2=> $hassort2, >- HlghtSort2 => $hglghtsort2, >- CGISort1 => $CGISort1, >- CGISort2 => $CGISort2, >+ CGIBorCat => $CGIBorCat, >+ CGIItemType => $CGIItemTypes, >+ branchloop => GetBranchesLoop(), >+ hassort1 => $hassort1, >+ hassort2 => $hassort2, >+ HlghtSort2 => $hglghtsort2, >+ CGISort1 => $CGISort1, >+ CGISort2 => $CGISort2, > CGIextChoice => $CGIextChoice, > CGIsepChoice => $CGIsepChoice > ); >diff --git a/reports/issues_by_borrower_category.plugin b/reports/issues_by_borrower_category.plugin >index 825a492..806ff7c 100755 >--- a/reports/issues_by_borrower_category.plugin >+++ b/reports/issues_by_borrower_category.plugin >@@ -62,36 +62,22 @@ the hashes are then translated to hash / arrays to be returned to manager.pl & s > =cut > > sub set_parameters { >- my ($template) = @_; >- my $dbh = C4::Context->dbh; >- my $branches=GetBranches(); >- my @branches; >- my @select_branch; >- my %select_branches; >- push @select_branch,""; >- $select_branches{""} = ""; >- foreach my $branch (keys %$branches) { >- push @select_branch, $branch; >- $select_branches{$branch} = $branches->{$branch}->{'branchname'}; >- } >- my $CGIbranch=CGI::scrolling_list( -name => 'value', >- -id => 'branch', >- -values => \@select_branch, >- -labels => \%select_branches, >- -size => 1, >- -multiple => 0 ); >- $template->param(CGIbranch => $CGIbranch); >+ my ($template) = @_; >+ >+ $template->param( branchloop => GetBranchesLoop() ); > >- my ($codes,$labels)=GetborCatFromCatType(undef,undef); >- my @borcatloop; >- foreach my $thisborcat (sort keys %$labels) { >- push @borcatloop, {value => $thisborcat, >- description => $labels->{$thisborcat}, >- }; >- } >- $template->param(loopcategories => \@borcatloop); >- return $template; >+ my ($codes,$labels)=GetborCatFromCatType(undef,undef); >+ my @borcatloop; >+ foreach my $thisborcat (sort keys %$labels) { >+ push @borcatloop, { >+ value => $thisborcat, >+ description => $labels->{$thisborcat}, >+ }; >+ } >+ $template->param(loopcategories => \@borcatloop); >+ return $template; > } >+ > sub calculate { > my ($parameters) = @_; > my @results =(); >diff --git a/reports/itemtypes.plugin b/reports/itemtypes.plugin >index 8134354..388649f 100755 >--- a/reports/itemtypes.plugin >+++ b/reports/itemtypes.plugin >@@ -32,29 +32,11 @@ use C4::Branch; # GetBranches > > sub set_parameters { > my ($template) = @_; >- my $dbh = C4::Context->dbh; >- my $branches=GetBranches(); >- my @branches; >- my $default; >- my @select_branch; >- my %select_branches; >- push @select_branch,""; >- $select_branches{""} = ""; >- for my $branch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { >- push @select_branch, $branch; >- $select_branches{$branch} = $branches->{$branch}->{'branchname'}; >- $default = C4::Context->userenv->{'branch'} if (C4::Context->userenv && C4::Context->userenv->{'branch'}); >- } >- my $CGIbranch=CGI::scrolling_list( -name => 'value', >- -id => 'value', >- -values => \@select_branch, >- -labels => \%select_branches, >- -size => 1, >- -multiple => 0, >- -default => $default, ); >- $template->param(CGIbranch => $CGIbranch); >+ my $userbranch = C4::Context->userenv->{'branch'}; >+ $template->param( branchloop => GetBranchesLoop($userbranch) ); > return $template; > } >+ > sub calculate { > my ($parameters) = @_; > my @results =(); >diff --git a/reserve/request.pl b/reserve/request.pl >index 506d5fa..f8e26a2 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -65,23 +65,7 @@ my $showallitems = $input->param('showallitems'); > my $branches = GetBranches(); > my $itemtypes = GetItemTypes(); > >-my $default = C4::Context->userenv->{branch}; >-my @values; >-my %label_of; >- >-foreach my $branchcode ( sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches ) { >- push @values, $branchcode; >- $label_of{$branchcode} = $branches->{$branchcode}->{branchname}; >-} >-my $CGIbranch = CGI::scrolling_list( >- -name => 'pickup', >- -id => 'pickup', >- -values => \@values, >- -default => $default, >- -labels => \%label_of, >- -size => 1, >- -multiple => 0, >- ); >+my $userbranch = C4::Context->userenv->{branch}; > > # Select borrowers infos > my $findborrower = $input->param('findborrower'); >@@ -590,8 +574,7 @@ foreach my $biblionumber (@biblionumbers) { > my $time = time(); > > $template->param( >- CGIbranch => $CGIbranch, >- >+ branchloop => GetBranchesLoop($userbranch), > time => $time, > fixedRank => $fixedRank, > ); >-- >1.7.2.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 9457
:
14787
|
15184
|
16171
|
16209
|
16210