From 2d9f5fc69e3485e61f92ff56c54db097c8fac904 Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel 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 Signed-off-by: Jonathan Druart Signed-off-by: Jared Camins-Esakov --- .../value_builder/marc21_linking_section.pl | 21 +-------- .../value_builder/unimarc_field_4XX.pl | 21 +-------- .../prog/en/modules/members/memberentrygen.tt | 23 +++++++--- .../en/modules/reports/issues_avg_stats.tt | 8 +++- .../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 +++---- .../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 f30086e62f..ac7cfce460 100644 --- a/cataloguing/value_builder/marc21_linking_section.pl +++ b/cataloguing/value_builder/marc21_linking_section.pl @@ -356,25 +356,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" @@ -404,7 +386,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 020243859d..e390010358 100755 --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ b/cataloguing/value_builder/unimarc_field_4XX.pl @@ -511,25 +511,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( @@ -560,7 +542,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 68d6a30e1c..2fdb387df2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -988,14 +988,25 @@ [% END %] [% UNLESS nobranchcode %]
  • - [% IF ( mandatorybranchcode ) %] + [%- IF ( mandatorybranchcode ) -%] + + [% IF ( mandatorybranchcode ) -%] + Required + [%- END %]
  • [% END %]
  • 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 eef1fd1e65..9010092c91 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 @@ Library - [% CGIBranch %] + +