From srdjan at catalyst.net.nz Fri Nov 1 05:25:48 2013
From: srdjan at catalyst.net.nz (Srdjan)
Date: Fri, 1 Nov 2013 17:25:48 +1300
Subject: [Koha-patches] [PATCH] bug_11156: binmode STDOUT, ':utf8'
Message-ID: <1383279948-2644-1-git-send-email-srdjan@catalyst.net.nz>
This is a noop.
To test:
* Run misc/cronjobs/check-url.pl
If you *really* want to test, place some non-ascii bogus urls in 856
and observe absence of "wide character" warning
---
misc/cronjobs/check-url.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/misc/cronjobs/check-url.pl b/misc/cronjobs/check-url.pl
index 589a4c5..61162b8 100755
--- a/misc/cronjobs/check-url.pl
+++ b/misc/cronjobs/check-url.pl
@@ -222,6 +222,8 @@ EOS
# BEGIN
+binmode STDOUT, ':utf8';
+
usage() if $help;
if ( $html && !$host_pro ) {
--
1.8.1.2
From srdjan at catalyst.net.nz Fri Nov 1 08:25:52 2013
From: srdjan at catalyst.net.nz (Srdjan)
Date: Fri, 1 Nov 2013 20:25:52 +1300
Subject: [Koha-patches] [PATCH] bug_11182: get rid of some warnings
Message-ID: <1383290752-22397-1-git-send-email-srdjan@catalyst.net.nz>
To testi - circulation:
* For a child patron, check that "Upgrade to adult" link on the "More"
drop-down is clickable
* Set sys pref FineNotifyAtCheckin to yes (Notify), and check in an
overdue item that attracts fine. Fine amount should be displayed.
---
circ/circulation.pl | 6 +++---
circ/returns.pl | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/circ/circulation.pl b/circ/circulation.pl
index 9769731..3f287ed 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -482,7 +482,7 @@ sub build_issue_data {
($it->{'charge'}, $it->{'itemtype_charge'}) = GetIssuingCharges(
$it->{'itemnumber'}, $it->{'borrowernumber'}
);
- $it->{'charge'} = sprintf("%.2f", $it->{'charge'});
+ $it->{'charge'} = sprintf("%.2f", $it->{'charge'}) if defined $it->{'charge'};
my ($can_renew, $can_renew_error) = CanBookBeRenewed(
$it->{'borrowernumber'},$it->{'itemnumber'}
);
@@ -650,7 +650,7 @@ $amountold =~ s/^.*\$//; # remove upto the $, if any
my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
-if ( $borrower->{'category_type'} eq 'C') {
+if ( $borrower->{'category_type'} && $borrower->{'category_type'} eq 'C') {
my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' );
my $cnt = scalar(@$catcodes);
$template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
@@ -748,7 +748,7 @@ $template->param(
inprocess => $inprocess,
memberofinstution => $member_of_institution,
CGIorganisations => $CGIorganisations,
- is_child => ($borrower->{'category_type'} eq 'C'),
+ is_child => ($borrower->{'category_type'} && $borrower->{'category_type'} eq 'C'),
circview => 1,
soundon => C4::Context->preference("SoundOn"),
fast_cataloging => $fast_cataloging,
diff --git a/circ/returns.pl b/circ/returns.pl
index 93f36f2..1ab23ba 100755
--- a/circ/returns.pl
+++ b/circ/returns.pl
@@ -75,7 +75,8 @@ my ( $template, $librarian, $cookie ) = get_template_and_user(
my $branches = GetBranches();
my $printers = GetPrinters();
-my $printer = C4::Context->userenv ? C4::Context->userenv->{'branchprinter'} : "";
+my $printer = C4::Context->userenv ? C4::Context->userenv->{'branchprinter'} : undef;
+$printer ||= "";
my $overduecharges = (C4::Context->preference('finesMode') && C4::Context->preference('finesMode') ne 'off');
my $userenv_branch = C4::Context->userenv->{'branch'} || '';
@@ -266,7 +267,7 @@ if ($barcode) {
if ( C4::Context->preference("FineNotifyAtCheckin") ) {
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrower->{'borrowernumber'} );
- if ($fines > 0) {
+ if ($fines && $fines > 0) {
$template->param( fines => sprintf("%.2f",$fines) );
$template->param( fineborrowernumber => $borrower->{'borrowernumber'} );
}
--
1.8.1.2
From srdjan at catalyst.net.nz Fri Nov 1 09:10:09 2013
From: srdjan at catalyst.net.nz (Srdjan)
Date: Fri, 1 Nov 2013 21:10:09 +1300
Subject: [Koha-patches] [PATCH] bug_11183: get rid of some warninngs
Message-ID: <1383293409-27366-1-git-send-email-srdjan@catalyst.net.nz>
To test in OPAC:
* Set EnableOpacSearchHistory to yes (Keep). Do an advanced search with
limits. Complete search with limits should show.
* Have an item with Collection Code. Check that the Collection Code
shows.
---
opac/opac-detail.pl | 2 +-
opac/opac-search.pl | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index 41de4fd..3ee292c 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -573,7 +573,7 @@ for my $itm (@items) {
# get collection code description, too
my $ccode = $itm->{'ccode'};
- $itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) );
+ $itm->{'ccode'} = $collections->{$ccode} if $ccode && $collections;
my $copynumber = $itm->{'copynumber'};
$itm->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumbers) && defined($copynumber) && exists( $copynumbers->{$copynumber} ) );
if ( defined $itm->{'location'} ) {
diff --git a/opac/opac-search.pl b/opac/opac-search.pl
index 2854da6..8604d0f 100755
--- a/opac/opac-search.pl
+++ b/opac/opac-search.pl
@@ -623,7 +623,7 @@ for (my $i=0;$i<@servers;$i++) {
my $query_cgi_history = $cgi->url(-query=>1);
$query_cgi_history =~ s/^$path_info\?//;
$query_cgi_history =~ s/;/&/g;
- my $query_desc_history = "$query_desc, $limit_desc";
+ my $query_desc_history = join ", ", grep { defined $_ } $query_desc, $limit_desc;
if (!$borrowernumber || $borrowernumber eq '') {
# To a cookie (the user is not logged in)
--
1.8.1.2
From srdjan at catalyst.net.nz Fri Nov 1 09:27:40 2013
From: srdjan at catalyst.net.nz (Srdjan)
Date: Fri, 1 Nov 2013 21:27:40 +1300
Subject: [Koha-patches] [PATCH] bug_11184: correct attribute cloning for the
maint screen
Message-ID: <1383294460-29369-1-git-send-email-srdjan@catalyst.net.nz>
To test - Patron details entry page:
* Have ExtendedPatronAttributes enabled. Check that "Additional
attributes and identifiers" section behaves.
---
members/memberentry.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/members/memberentry.pl b/members/memberentry.pl
index 4b410a7..13ba805 100755
--- a/members/memberentry.pl
+++ b/members/memberentry.pl
@@ -798,7 +798,7 @@ sub patron_attributes_form {
};
if (exists $attr_hash{$attr_type->code()}) {
foreach my $attr (@{ $attr_hash{$attr_type->code()} }) {
- my $newentry = { map { $_ => $entry->{$_} } %$entry };
+ my $newentry = { %$entry };
$newentry->{value} = $attr->{value};
$newentry->{password} = $attr->{password};
$newentry->{use_dropdown} = 0;
--
1.8.1.2
From srdjan at catalyst.net.nz Fri Nov 1 09:44:01 2013
From: srdjan at catalyst.net.nz (Srdjan)
Date: Fri, 1 Nov 2013 21:44:01 +1300
Subject: [Koha-patches] [PATCH] bug_11077: get rid of some warnings
Message-ID: <1383295441-31219-1-git-send-email-srdjan@catalyst.net.nz>
---
C4/Auth.pm | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/C4/Auth.pm b/C4/Auth.pm
index 8b0bebe..584f298 100644
--- a/C4/Auth.pm
+++ b/C4/Auth.pm
@@ -650,6 +650,7 @@ sub checkauth {
# This parameter is the name of the CAS server we want to authenticate against,
# when using authentication against multiple CAS servers, as configured in Auth_cas_servers.yaml
my $casparam = $query->param('cas');
+ my $q_userid = $query->param('userid');
if ( $userid = $ENV{'REMOTE_USER'} ) {
# Using Basic Authentication, no cookies required
@@ -669,9 +670,11 @@ sub checkauth {
my $session = get_session($sessionID);
C4::Context->_new_userenv($sessionID);
my ($ip, $lasttime, $sessiontype);
+ my $s_userid;
if ($session){
+ $s_userid = $session->param('id');
C4::Context::set_userenv(
- $session->param('number'), $session->param('id'),
+ $session->param('number'), $s_userid,
$session->param('cardnumber'), $session->param('firstname'),
$session->param('surname'), $session->param('branch'),
$session->param('branchname'), $session->param('flags'),
@@ -684,14 +687,14 @@ sub checkauth {
$debug and printf STDERR "AUTH_SESSION: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
$ip = $session->param('ip');
$lasttime = $session->param('lasttime');
- $userid = $session->param('id');
+ $userid = $s_userid;
$sessiontype = $session->param('sessiontype') || '';
}
- if ( ( ($query->param('koha_login_context')) && ($query->param('userid') ne $session->param('id')) )
+ if ( ( $query->param('koha_login_context') && ($q_userid && $s_userid && $q_userid ne $s_userid) )
|| ( $cas && $query->param('ticket') ) ) {
#if a user enters an id ne to the id in the current session, we need to log them in...
#first we need to clear the anonymous session...
- $debug and warn "query id = " . $query->param('userid') . " but session id = " . $session->param('id');
+ $debug and warn "query id = $q_userid but session id = $s_userid";
$session->flush;
$session->delete();
C4::Context->_unset_userenv($sessionID);
@@ -711,7 +714,7 @@ sub checkauth {
logout_cas($query);
}
}
- elsif ( $lasttime < time() - $timeout ) {
+ elsif ( $lasttime && ($lasttime < time() - $timeout) ) {
# timed logout
$info{'timed_out'} = 1;
$session->delete() if $session;
@@ -759,7 +762,7 @@ sub checkauth {
-value => $session->id,
-HttpOnly => 1
);
- $userid = $query->param('userid');
+ $userid = $q_userid;
if ( ( $cas && $query->param('ticket') )
|| $userid
|| ( my $pki_field = C4::Context->preference('AllowPKIAuth') ) ne
--
1.8.1.2
From mathieu.saby at univ-rennes2.fr Sun Nov 3 12:50:08 2013
From: mathieu.saby at univ-rennes2.fr (Mathieu Saby)
Date: Sun, 03 Nov 2013 12:50:08 +0100
Subject: [Koha-patches] [PATCH] Bug 11189 : Rename Print label in UNIMARC
advanced search
Message-ID: <52763870.4070605@univ-rennes2.fr>
"Print" label for search on 106 field is not correct in UNIMARC advanced search :
- 106 field can be used for non printed ressources (manuscript...)
- "Print" is ambiguous for translation tool, as it can be understood as a verb or a noun.
The official label for 106 field is "Type of form".
The offical label for 106$a subfield is "Medium designator".
I think "Physical presentation" is the best way to describe the content of 106$a in a user understandable label.
Test plan :
Check the "Print" label is replaced with "Physical presentation" in OPAC and Staff Advanced Search
---
.../prog/en/includes/subtypes_unimarc.inc | 2 +-
.../prog/en/includes/subtypes_unimarc.inc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/subtypes_unimarc.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/subtypes_unimarc.inc
index 10f9cba..bae4ed5 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/subtypes_unimarc.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/subtypes_unimarc.inc
@@ -18,7 +18,7 @@