From oleonard at myacpl.org Thu Jan 3 19:00:25 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Thu, 3 Jan 2013 13:00:25 -0500
Subject: [Koha-patches] [PATCH] Bug 7657 - Google and OpenLibrary image
conflict
Message-ID: <1357236025-17058-1-git-send-email-oleonard@myacpl.org>
The JavaScript files which output Google and OpenLibrary cover images
each assumes it is the only source for cover images running. Each script
isn't specific enough to filter out markup generated by the other. This
patch corrects the specificity of the selector looking for markup
related to Google and OpenLibrary covers.
To test, enable both Google and OpenLibrary cover images in the OPAC.
Perform a search which will return results which include titles which
have covers from both services. Confirm that these covers appear
correctly and that "no cover" information still works correctly.
---
koha-tmpl/opac-tmpl/prog/en/js/google-jackets.js | 5 +++--
koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/koha-tmpl/opac-tmpl/prog/en/js/google-jackets.js b/koha-tmpl/opac-tmpl/prog/en/js/google-jackets.js
index 70b1b84..f129c38 100644
--- a/koha-tmpl/opac-tmpl/prog/en/js/google-jackets.js
+++ b/koha-tmpl/opac-tmpl/prog/en/js/google-jackets.js
@@ -19,7 +19,7 @@ KOHA.Google = {
*/
GetCoverFromIsbn: function(newWindow) {
var bibkeys = [];
- $("div [id^=gbs-thumbnail]").each(function(i) {
+ $("[id^=gbs-thumbnail]").each(function(i) {
bibkeys.push($(this).attr("class")); // id=isbn
});
bibkeys = bibkeys.join(',');
@@ -45,7 +45,7 @@ KOHA.Google = {
}
for (id in booksInfo) {
var book = booksInfo[id];
- $("."+book.bib_key).each(function() {
+ $("[id^=gbs-thumbnail]."+book.bib_key).each(function() {
var a = document.createElement("a");
a.href = book.info_url;
if (typeof(book.thumbnail_url) != "undefined") {
@@ -71,5 +71,6 @@ KOHA.Google = {
}
});
}
+
}
};
diff --git a/koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js b/koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js
index e5b9d28..c07ba3b 100644
--- a/koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js
+++ b/koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js
@@ -19,7 +19,7 @@ KOHA.OpenLibrary = {
*/
GetCoverFromIsbn: function() {
var bibkeys = [];
- $("div [id^=openlibrary-thumbnail]").each(function(i) {
+ $("[id^=openlibrary-thumbnail]").each(function(i) {
bibkeys.push("ISBN:" + $(this).attr("class")); // id=isbn
});
bibkeys = bibkeys.join(',');
@@ -40,7 +40,7 @@ KOHA.OpenLibrary = {
for (id in booksInfo) {
var book = booksInfo[id];
var isbn = id.substring(5);
- $("."+isbn).each(function() {
+ $("[id^=openlibrary-thumbnail]."+isbn).each(function() {
var is_opacdetail = /openlibrary-thumbnail-preview/.exec($(this).attr("id"));
var a = document.createElement("a");
a.href = booksInfo.url;
--
1.7.9.5
From dpavlin at rot13.org Fri Jan 4 00:41:47 2013
From: dpavlin at rot13.org (Dobrica Pavlinusic)
Date: Fri, 4 Jan 2013 00:41:47 +0100
Subject: [Koha-patches] [PATCH] Bug 9346 - acqui/neworderempty.pl ignores
exchange rates and destroys user data on page load
Message-ID: <1357256507-5504-1-git-send-email-dpavlin@rot13.org>
This restores behaviour of new order form before Bug?5335 merge
Test scenario:
1. load Receipt summary for existing customer
2. take note of Unit cost and Order cost
3. open existing order line and verify that Replacement cost,
Budgeted cost and Total are not re-calculated on page load
4. change currency and verify that costs are updated
(change currency to system default and all values should become
same as vendor price)
5. change Quantity, get alert "You can't add a new item, please create a new order line"
and verify that Total still reflects correct value
---
acqui/neworderempty.pl | 3 ---
koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 5 +++--
.../prog/en/modules/acqui/neworderempty.tt | 8 ++++++--
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl
index 90b4732..807a82b 100755
--- a/acqui/neworderempty.pl
+++ b/acqui/neworderempty.pl
@@ -336,8 +336,6 @@ my @gst_values = map {
option => $_
}, split( '\|', C4::Context->preference("gist") );
-my $cur = GetCurrency();
-
$template->param(
existing => $biblionumber,
ordernumber => $ordernumber,
@@ -371,7 +369,6 @@ $template->param(
cur_active_sym => $active_currency->{'symbol'},
cur_active => $active_currency->{'currency'},
loop_currencies => \@loop_currency,
- currency_rate => $cur->{rate},
orderexists => ( $new eq 'yes' ) ? 0 : 1,
title => $data->{'title'},
author => $data->{'author'},
diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js
index d67b05b..0c3ce91 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js
+++ b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js
@@ -644,7 +644,8 @@ function updateCosts(){
var discount = new Number($("#discount").val());
var applygst = new Number ($("#applygst").val());
var listprice = new Number($("#listprice").val());
- var exchangerate = new Number($("#currency_rate").val());
+ var currcode = new String($("#currency").val());
+ var exchangerate = new Number($("#currency_rate_"+currcode).val());
var gst_on=false;
var rrp = new Number(listprice*exchangerate);
@@ -669,7 +670,7 @@ function calcNewsuggTotal(){
// var currency = f.currency.value;
var currcode = new String(document.getElementById('currency').value);
var price = new Number(document.getElementById('price').value);
- var exchangerate = new Number(document.getElementById(currcode).value);
+ var exchangerate = new Number(document.getElementById('currency_rate_'+currcode).value);
var total = new Number(quantity*price*exchangerate);
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
index 2631e3c..398a568 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
@@ -125,6 +125,7 @@ $(document).ready(function()
alert(_("You can't add a new item, please create a new order line"));
// and we replace the original value
$(this).val([% quantityrec %])
+ updateCosts(); // blur is invoked after change which updated values
return false;
}
});
@@ -146,7 +147,7 @@ $(document).ready(function()
//]]>
-
+
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
@@ -230,7 +231,10 @@ $(document).ready(function()
-
+
+ [% FOREACH loop_currencie IN loop_currencies %]
+
+ [% END %]
[% IF ( biblionumber ) %]
--
1.7.2.5
From mathieu.saby at univ-rennes2.fr Sat Jan 5 13:27:20 2013
From: mathieu.saby at univ-rennes2.fr (Mathieu Saby)
Date: Sat, 05 Jan 2013 13:27:20 +0100
Subject: [Koha-patches] [PATCH] Bug 9352 : More specific indexing of UNIMARC
7XX fields in Zebra
Message-ID: <50E81C28.70508@univ-rennes2.fr>
Problem :
Zebra indexes all subfields of UNIMARC 7XX fields in author index, including $9, $3, $4 (function code), $f (dates of authors), $c (additions other than dates), $p (address).
It causes Koha to give too much results.
For example, if an author is born in 1984 and is a teacher, searching "1984" or "teacher" in simple search will return all work by this author if these pieces of informations are in 7XX field. This is not how most ILS work, and it should be corrected.
Solution :
This patch makes indexing of unimarc 7XX fields more specific. For each field, useless subfields are not indexed.
70X : Do not index $f (dates),$c (additions other than dates),$p (affiliation/address),$3,$4. Index $9 only in Koha-Auth-Number.
710-712 : Do not index $p (affiliation/address),$3,$4. Index $9 only in Koha-Auth-Number. (I kept all other subfields : even if some may be useless I am not sure of it)
716 : Do not index $f (dates),$c (additions other than dates),$3,$4. Index $9 only in Koha-Auth-Number.
72X : Do not index $f (dates),$3,$4. Index $9 only in Koha-Auth-Number.
730 : Do not index $4. Index $9 only in Koha-Auth-Number.
Additionnaly, this patch indexes 205$f/$g in Author index (author of the edition of the work)
Testing :
a/ Create a record with
700$a Doe $b John $f1950 $cteacher $4070
716$a Trademark $f1960 $cgreat $4340
720$a Family $f1980 $4651
205$a 1st edition $fBy some guy $gAnd other guys
a/ Before applying patch :
Search in simple search and author search : "teacher", "great", "1950", "070", "340", "651" => you will see the record among the results
Search in simple search and author search : "Doe", "John Doe", "Trademark", "Family" => you will see the record among the results
Search in simple search and author search : "guy", "guys" => you will not see the record among the results
b/ Before applying patch :
Search in simple search and author search : "teacher", "great", "1950", "070", "340", "651" => you will not see the record among the results
Search in simple search and author search : "Doe", "John Doe", "Trademark", "Family" => you will see the record among the results
Search in simple search and author search : "guy", "guys" => you will see the record among the results
---
etc/zebradb/marc_defs/unimarc/biblios/record.abs | 89 ++++++++++++++++------
1 file changed, 67 insertions(+), 22 deletions(-)
diff --git a/etc/zebradb/marc_defs/unimarc/biblios/record.abs b/etc/zebradb/marc_defs/unimarc/biblios/record.abs
index 44a5bbe..e7fe909 100644
--- a/etc/zebradb/marc_defs/unimarc/biblios/record.abs
+++ b/etc/zebradb/marc_defs/unimarc/biblios/record.abs
@@ -125,39 +125,84 @@ melm 116$a Graphics-type:w:range(data,0,1),Graphics-support:w:range(data,1,1
melm 200$f Author:w,Author:p
# other Authors
melm 200$g Author:w,Author:p
+
+# main author of the edition
+melm 205$f Author:w,Author:p
+# other authors of the edition
+melm 205$g Author:w,Author:p
+
# physical Author
+# Do not index $f (dates),$c (additions other than dates),$p (affiliation/address),$3,$4. Index $9 only in Koha-Auth-Number.
melm 700$9 Koha-Auth-Number,Koha-Auth-Number:n
melm 700$a Author,Personal-name,Author:p,Personal-name:p,Personal-name,Author:s
-melm 700 Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
+melm 700$b Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
+melm 700$d Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
+melm 700$g Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
+
melm 701$9 Koha-Auth-Number,Koha-Auth-Number:n
-melm 701 Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
+melm 701$a Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
+melm 701$b Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
+melm 701$d Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
+melm 701$g Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
+
melm 702$9 Koha-Auth-Number,Koha-Auth-Number:n
-melm 702 Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
+melm 702$a Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
+melm 702$b Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
+melm 702$d Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
+melm 702$g Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
# collective Author
-melm 710$9 Koha-Auth-Number,Koha-Auth-Number:n
-melm 710 Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
-melm 711$9 Koha-Auth-Number,Koha-Auth-Number:n
-melm 711 Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
-
-melm 712$9 Koha-Auth-Number,Koha-Auth-Number:n
-melm 712 Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+# Do not index $p (affiliation/address),$3,$4. Index $9 only in Koha-Auth-Number.
+melm 710$9 Koha-Auth-Number,Koha-Auth-Number:n
+melm 710$a Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 710$b Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 710$c Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 710$d Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 710$e Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 710$f Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 710$g Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 710$h Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+
+melm 711$9 Koha-Auth-Number,Koha-Auth-Number:n
+melm 711$a Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 711$b Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 711$c Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 711$d Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 711$e Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 711$f Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 711$g Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 711$h Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+
+melm 712$9 Koha-Auth-Number,Koha-Auth-Number:n
+melm 712$a Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 712$b Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 712$c Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 712$d Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 712$e Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 712$f Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 712$g Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
+melm 712$h Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
# trademark Author : 716
-melm 716$9 Koha-Auth-Number,Koha-Auth-Number:n
-melm 716 Author:w,Author:p
+# Do not index $f (dates),$c (additions other than dates),$3,$4. Index $9 only in Koha-Auth-Number.
+melm 716$9 Koha-Auth-Number,Koha-Auth-Number:n
+melm 716$a Author:w,Author:p
# family Author : 72X
-melm 720$9 Koha-Auth-Number,Koha-Auth-Number:n
-melm 720 Author:w,Author:p
-melm 721$9 Koha-Auth-Number,Koha-Auth-Number:n
-melm 721 Author:w,Author:p
-melm 722$9 Koha-Auth-Number,Koha-Auth-Number:n
-melm 722 Author:w,Author:p
-
-# name-responsabily Author
-melm 730$9 Koha-Auth-Number,Koha-Auth-Number:n
-melm 730 Author:w,Author:p
+# Do not index $f (dates),$3,$4. Index $9 only in Koha-Auth-Number.
+melm 720$9 Koha-Auth-Number,Koha-Auth-Number:n
+melm 720$a Author:w,Author:p
+
+melm 721$9 Koha-Auth-Number,Koha-Auth-Number:n
+melm 721$a Author:w,Author:p
+
+melm 722$9 Koha-Auth-Number,Koha-Auth-Number:n
+melm 722$a Author:w,Author:p
+
+# name-responsabily Author : 730
+# Do not index $4. Index $9 only in Koha-Auth-Number.
+melm 730$9 Koha-Auth-Number,Koha-Auth-Number:n
+melm 730$a Author:w,Author:p
# 740-742 = uniform and conventional headings for legal and religious texts. Use not recommended in France (503 used instead, see http://multimedia.bnf.fr/unimarcb_trad/B7XX-6-2011.pdf )
--
1.7.9.5
--
Mathieu Saby
Service d'Informatique Documentaire
Service Commun de Documentation
Universit? Rennes 2
T?l?phone : 02 99 14 12 65
Courriel : mathieu.saby at univ-rennes2.fr
From gmc at esilibrary.com Wed Jan 9 04:36:26 2013
From: gmc at esilibrary.com (Galen Charlton)
Date: Tue, 8 Jan 2013 19:36:26 -0800
Subject: [Koha-patches] [PATCH 5/6] bug 9370: add invalid call number to LC
splitting test cases
In-Reply-To: <1357702587-5817-1-git-send-email-gmc@esilibrary.com>
References: <1357702587-5817-1-git-send-email-gmc@esilibrary.com>
Message-ID: <1357702587-5817-5-git-send-email-gmc@esilibrary.com>
'123 ABC FOO BAR' is intentionally *not* a valid LC call number,
but in order to preserve legacy behavior, it should be split on
whitespace.
Signed-off-by: Galen Charlton
---
t/Labels_split_lccn.t | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/t/Labels_split_lccn.t b/t/Labels_split_lccn.t
index c79cc00..87ab8ae 100755
--- a/t/Labels_split_lccn.t
+++ b/t/Labels_split_lccn.t
@@ -34,6 +34,7 @@ BEGIN {
'BS2545.E8 H39 1996' => [qw(BS 2545 .E8 H39 1996)],
'NX512.S85 A4 2006' => [qw(NX 512 .S85 A4 2006)],
'QH541.15.C6 C25 2012' => [qw(QH 541.15 .C6 C25 2012)],
+ '123 ABC FOO BAR' => [qw(123 ABC FOO BAR)],
};
}
my $test_num = 1;
--
1.7.2.5
From gmc at esilibrary.com Wed Jan 9 04:36:23 2013
From: gmc at esilibrary.com (Galen Charlton)
Date: Tue, 8 Jan 2013 19:36:23 -0800
Subject: [Koha-patches] [PATCH 2/6] bug 6281: introduce LC::CallNumber::LC
for sorting LC call numbers
In-Reply-To: <1357702587-5817-1-git-send-email-gmc@esilibrary.com>
References: <1357702587-5817-1-git-send-email-gmc@esilibrary.com>
Message-ID: <1357702587-5817-2-git-send-email-gmc@esilibrary.com>
This replaces the previous hand-coded normalizer. Because
LC::CallNumber::LC appears to reject strings that aren't valid
LC call numbers, significant changes to the test cases were
made as well -- however, the one that really counts is the
last one which verifies the sorting.
To recalculate the call number sort key for each item, it is necessary
to run misc/maintenance/touch_all_items.pl
To test, create item records with the following call numbers, setting
the classification sort to 'lccl:
QC100 .U57 NO. 555 1986
QC145 .A57 V.12 1980
QC145.45 .H4 D65 1998
QC995 .E29 1997
Next, make a report of them in the inventory tool. The items should be sorted
in the above order.
Signed-off-by: Galen Charlton
---
C4/ClassSortRoutine/LCC.pm | 19 ++++++-------------
t/ClassSortRoutine_LCC.t | 12 ++++++------
2 files changed, 12 insertions(+), 19 deletions(-)
diff --git a/C4/ClassSortRoutine/LCC.pm b/C4/ClassSortRoutine/LCC.pm
index 6ec3846..f5f4a1c 100644
--- a/C4/ClassSortRoutine/LCC.pm
+++ b/C4/ClassSortRoutine/LCC.pm
@@ -1,6 +1,7 @@
package C4::ClassSortRoutine::LCC;
# Copyright (C) 2007 LibLime
+# Copyright (C) 2012 Equinox Software, Inc.
#
# This file is part of Koha.
#
@@ -19,6 +20,7 @@ package C4::ClassSortRoutine::LCC;
use strict;
use warnings;
+use Library::CallNumber::LC;
use vars qw($VERSION);
@@ -50,19 +52,10 @@ sub get_class_sort_key {
$cn_class = '' unless defined $cn_class;
$cn_item = '' unless defined $cn_item;
- my $key = uc "$cn_class $cn_item";
- $key =~ s/^\s+//;
- $key =~ s/\s+$//;
- $key =~ s/^[^\p{IsAlnum}\s.]//g;
- $key =~ s/^([A-Z]+)/$1 /;
- $key =~ s/(\.[A-Z])/ $1/g;
- # handle first digit group
- $key =~ s/(\d+)/sprintf("%-05.5d", $1)/xe;
- $key =~ s/\s+/_/g;
- $key =~ s/\./_/g;
- $key =~ s/__/_/g;
- $key =~ s/[^\p{IsAlnum}_]//g;
-
+ my $call_number = Library::CallNumber::LC->new(uc "$cn_class $cn_item");
+ return '' unless defined $call_number;
+ my $key = $call_number->normalize();
+ $key = '' unless defined $key;
return $key;
}
diff --git a/t/ClassSortRoutine_LCC.t b/t/ClassSortRoutine_LCC.t
index 7454351..9ec37cf 100755
--- a/t/ClassSortRoutine_LCC.t
+++ b/t/ClassSortRoutine_LCC.t
@@ -14,17 +14,17 @@ BEGIN {
#Obvious cases
is(C4::ClassSortRoutine::LCC::get_class_sort_key(), "", "No arguments returns an empty string");
-is(C4::ClassSortRoutine::LCC::get_class_sort_key('a','b'), "A_B", "Arguments 'a','b' return 'A_B'");
+is(C4::ClassSortRoutine::LCC::get_class_sort_key('a','b'), "A B", "Arguments 'a','b' return 'A B'");
#spaces in arguements
-is(C4::ClassSortRoutine::LCC::get_class_sort_key(' ','b'), "B_", "Arguments ' ','b' return 'B_'");
-is(C4::ClassSortRoutine::LCC::get_class_sort_key('a',' '), "A_", "Arguments 'a',' ' return 'A_'");
+is(C4::ClassSortRoutine::LCC::get_class_sort_key(' ','b'), "B", "Arguments ' ','b' return 'B'");
+is(C4::ClassSortRoutine::LCC::get_class_sort_key('a',' '), "A", "Arguments 'a',' ' return 'A'");
is(C4::ClassSortRoutine::LCC::get_class_sort_key(' ',' '), "", "Arguments ' ',' ' return ''");
#'funky cases' based on regex in code
-is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','b'), "_B", "Arguments '.','b' return '_B'");
-is(C4::ClassSortRoutine::LCC::get_class_sort_key('....','........'), "_______", "Arguments '....','........' return '_______'");
-is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','.'), "__", "Arguments '.','.' return '__'");
+is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','b'), "", "Arguments '.','b' return ''");
+is(C4::ClassSortRoutine::LCC::get_class_sort_key('....','........'), "", "Arguments '....','........' return ''");
+is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','.'), "", "Arguments '.','.' return ''");
# list of example call numbers -- these
# are intentionally in the _reverse_ of
--
1.7.2.5
From gmc at esilibrary.com Wed Jan 9 04:36:25 2013
From: gmc at esilibrary.com (Galen Charlton)
Date: Tue, 8 Jan 2013 19:36:25 -0800
Subject: [Koha-patches] [PATCH 4/6] bug 9370: test case for splitting LC
call number
In-Reply-To: <1357702587-5817-1-git-send-email-gmc@esilibrary.com>
References: <1357702587-5817-1-git-send-email-gmc@esilibrary.com>
Message-ID: <1357702587-5817-4-git-send-email-gmc@esilibrary.com>
QH541.15.C6 C25 2012 should be split as follows:
QH
541.15
.C6
C25
2012
Signed-off-by: Galen Charlton
---
t/Labels_split_lccn.t | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/t/Labels_split_lccn.t b/t/Labels_split_lccn.t
index da32317..c79cc00 100755
--- a/t/Labels_split_lccn.t
+++ b/t/Labels_split_lccn.t
@@ -33,6 +33,7 @@ BEGIN {
'HE8700.7 .P6T44 1983' => [qw(HE 8700.7 .P6 T44 1983)],
'BS2545.E8 H39 1996' => [qw(BS 2545 .E8 H39 1996)],
'NX512.S85 A4 2006' => [qw(NX 512 .S85 A4 2006)],
+ 'QH541.15.C6 C25 2012' => [qw(QH 541.15 .C6 C25 2012)],
};
}
my $test_num = 1;
--
1.7.2.5
From gmc at esilibrary.com Wed Jan 9 04:36:22 2013
From: gmc at esilibrary.com (Galen Charlton)
Date: Tue, 8 Jan 2013 19:36:22 -0800
Subject: [Koha-patches] [PATCH 1/6] bug 6281: add test case for sorting LC
call numbers correctly
Message-ID: <1357702587-5817-1-git-send-email-gmc@esilibrary.com>
My thanks to Michael Flanagan of UCAR for providing some of
these examples.
Signed-off-by: Galen Charlton
---
t/ClassSortRoutine_LCC.t | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/t/ClassSortRoutine_LCC.t b/t/ClassSortRoutine_LCC.t
index 573c8fe..7454351 100755
--- a/t/ClassSortRoutine_LCC.t
+++ b/t/ClassSortRoutine_LCC.t
@@ -6,7 +6,7 @@
use strict;
use warnings;
-use Test::More tests => 9;
+use Test::More tests => 10;
BEGIN {
use_ok('C4::ClassSortRoutine::LCC');
@@ -25,3 +25,21 @@ is(C4::ClassSortRoutine::LCC::get_class_sort_key(' ',' '), "", "Arguments ' '
is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','b'), "_B", "Arguments '.','b' return '_B'");
is(C4::ClassSortRoutine::LCC::get_class_sort_key('....','........'), "_______", "Arguments '....','........' return '_______'");
is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','.'), "__", "Arguments '.','.' return '__'");
+
+# list of example call numbers -- these
+# are intentionally in the _reverse_ of
+# the correct sort order
+my @call_numbers = (
+ 'SB410.9 .P26 1993',
+ 'SB410.A26 I75 2000',
+ 'QC995 .E29 1997',
+ 'QC145.45 .H4 D65 1998',
+ 'QC145 .A57 V.12 1980',
+ 'QC100 .U57 NO. 555 1986',
+);
+
+my @sorted_call_numbers = map { $_->{call_number} }
+ sort { $a->{sortkey} cmp $b->{sortkey} }
+ map { { call_number => $_, sortkey => C4::ClassSortRoutine::LCC::get_class_sort_key($_, '') } }
+ @call_numbers;
+is_deeply(\@sorted_call_numbers, [ reverse @call_numbers ], 'LC call numbers sorted in correct order');
--
1.7.2.5
From gmc at esilibrary.com Wed Jan 9 04:36:24 2013
From: gmc at esilibrary.com (Galen Charlton)
Date: Tue, 8 Jan 2013 19:36:24 -0800
Subject: [Koha-patches] [PATCH 3/6] bug 6281: add Library::CallNumber::LC as
a required Perl dependency
In-Reply-To: <1357702587-5817-1-git-send-email-gmc@esilibrary.com>
References: <1357702587-5817-1-git-send-email-gmc@esilibrary.com>
Message-ID: <1357702587-5817-3-git-send-email-gmc@esilibrary.com>
This module is currently packaged by Debian for Wheezy and by
Ubuntu for Precise and Quantal.
Signed-off-by: Galen Charlton
---
C4/Installer/PerlDependencies.pm | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm
index 41fa8db..dbf117f 100644
--- a/C4/Installer/PerlDependencies.pm
+++ b/C4/Installer/PerlDependencies.pm
@@ -634,6 +634,11 @@ our $PERL_DEPS = {
'required' => '0',
'min_ver' => '0.22',
},
+ 'Library::CallNumber::LC' => {
+ 'usage' => 'Core',
+ 'required' => '1',
+ 'min_ver' => '0.22',
+ },
};
1;
--
1.7.2.5
From gmc at esilibrary.com Wed Jan 9 04:36:27 2013
From: gmc at esilibrary.com (Galen Charlton)
Date: Tue, 8 Jan 2013 19:36:27 -0800
Subject: [Koha-patches] [PATCH 6/6] bug 9370: improve splitting of LC call
numbers for labels
In-Reply-To: <1357702587-5817-1-git-send-email-gmc@esilibrary.com>
References: <1357702587-5817-1-git-send-email-gmc@esilibrary.com>
Message-ID: <1357702587-5817-6-git-send-email-gmc@esilibrary.com>
Use the Perl module Library::CallNumber::LC to parse and split
LC call numbers when generating spine labels.
For example, QH541.15.C6 C25 2012 should be split as follows:
QH
541.15
.C6
C25
2012
To test, create an item with call number QH541.15.C6 C25 2012
and classification source LC, then create a spine label for that
item using a layout of type 'biblio' that has the split call numbers
option enabled. The call number should be split as indicated above.
Signed-off-by: Galen Charlton
---
C4/Labels/Label.pm | 15 ++++-----------
1 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/C4/Labels/Label.pm b/C4/Labels/Label.pm
index 760bacf..f62d50c 100644
--- a/C4/Labels/Label.pm
+++ b/C4/Labels/Label.pm
@@ -7,6 +7,7 @@ use Text::Wrap;
use Algorithm::CheckDigits;
use Text::CSV_XS;
use Data::Dumper;
+use Library::CallNumber::LC;
use C4::Context;
use C4::Debug;
@@ -113,18 +114,10 @@ sub _split_lccn {
my ($lccn) = @_;
$_ = $lccn;
# lccn examples: 'HE8700.7 .P6T44 1983', 'BS2545.E8 H39 1996';
- my (@parts) = m/
- ^([a-zA-Z]+) # HE # BS
- (\d+(?:\.\d)*) # 8700.7 # 2545
- \s*
- (\.*\D+\d*) # .P6 # .E8
- \s*
- (.*) # T44 1983 # H39 1996 # everything else (except any bracketing spaces)
- \s*
- /x;
- unless (scalar @parts) {
+ my @parts = Library::CallNumber::LC->new($lccn)->components();
+ unless (scalar @parts && defined $parts[0]) {
warn sprintf('regexp failed to match string: %s', $_);
- push @parts, $_; # if no match, just push the whole string.
+ @parts = $_; # if no match, just use the whole string.
}
push @parts, split /\s+/, pop @parts; # split the last piece into an arbitrary number of pieces at spaces
$debug and warn "split_lccn array: ", join(" | ", @parts), "\n";
--
1.7.2.5
From oleonard at myacpl.org Tue Jan 15 16:48:22 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Tue, 15 Jan 2013 10:48:22 -0500
Subject: [Koha-patches] [PATCH] Bug 3134 - Ability to selelct multiple
reports to delete at once
Message-ID: <1358264903-28226-1-git-send-email-oleonard@myacpl.org>
This patch adds the option to select multiple saved reports for
deletion. Text output of the report id (of little information value to
the user) is replaced with a checkbox, and sorting has been removed from
that table column.
To test you must have two or more saved reports to delete. Deletion
should work properly when:
- Selecting one report for deletion by checking the box.
- Selecting more than one report for deletion by checking boxes.
- Clicking the old "Delete" link
Clicking the delete button should prompt you to confirm. Clicking cancel
should cancel.
Clicking the delete button when no boxes are checked should trigger an
alert asking you to select reports for deletion.
---
C4/Reports/Guided.pm | 18 +++++++++++-------
.../en/modules/reports/guided_reports_start.tt | 19 +++++++++++++++++--
reports/guided_reports.pl | 12 ++++++++++--
3 files changed, 38 insertions(+), 11 deletions(-)
diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm
index 279ac57..6d4665b 100644
--- a/C4/Reports/Guided.pm
+++ b/C4/Reports/Guided.pm
@@ -607,13 +607,17 @@ sub format_results {
}
sub delete_report {
- my ($id) = @_;
- my $dbh = C4::Context->dbh();
- my $query = "DELETE FROM saved_sql WHERE id = ?";
- my $sth = $dbh->prepare($query);
- $sth->execute($id);
-}
-
+ my ($ids) = @_;
+ if ($ids) {
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("DELETE FROM saved_sql WHERE id IN ($ids)");
+ $sth->execute();
+ $sth->finish;
+ return 1;
+ } else {
+ return 0;
+ }
+}
my $SAVED_REPORTS_BASE_QRY = <
@@ -151,10 +160,12 @@ canned reports and writing custom SQL reports.
[% INCLUDE 'table-pager.inc' perpage='20' %]
+
[% ELSE %]
[% IF (filter_set) %]
No saved reports match your criteria.
diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl
index de18072..5f57c5b 100755
--- a/reports/guided_reports.pl
+++ b/reports/guided_reports.pl
@@ -109,11 +109,19 @@ elsif ( $phase eq 'Build new' ) {
);
}
+elsif ( $phase eq 'Delete Multiple') {
+
+ my @ids = $input->param('ids');
+ delete_report( join ",", @ids );
+ print $input->redirect("/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved");
+ exit;
+}
+
elsif ( $phase eq 'Delete Saved') {
# delete a report from the saved reports list
- my $id = $input->param('reports');
- delete_report($id);
+ my $ids = $input->param('reports');
+ delete_report($ids);
print $input->redirect("/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved");
exit;
}
--
1.7.9.5
From oleonard at myacpl.org Fri Jan 18 16:37:05 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Fri, 18 Jan 2013 10:37:05 -0500
Subject: [Koha-patches] [PATCH] Bug 9424 - Move JavaScript out of header
include
Message-ID: <1358523425-9189-1-git-send-email-oleonard@myacpl.org>
This patch removes JavaScript "onlick" attributes from header.inc and
moves the functionality to staff-global.js. This is in keeping with the
idea of progressive enhancement.
This patch also makes a couple of minor changes to staff-global.js to
fix jsHint warnings.
To test, be sure to clear your browser cache after applying the patch.
Test the logout link under several conditions:
- intranetbookbag enabled, virtualshelves enabled
- intranetbookbag enabled, virtualshelves disabled
- intranetbookbag disabled, virtualshelves enabled
- intranetbookbag disabled, virtualshelves disabled
Logout should be successful with no JavaScript errors. This array of
tests is required because of the Cart-clearing action of logging out and
the changes made in this patch to the way Car/Lists JavaScript is
included.
---
.../prog/en/includes/doc-head-close.inc | 31 ++++++++++----------
.../intranet-tmpl/prog/en/includes/header.inc | 8 ++---
koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 25 +++++++++++++---
3 files changed, 38 insertions(+), 26 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc
index 32eae21..5d6f16b 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc
@@ -40,25 +40,24 @@
//]]>
[% END %]
+[% IF ( virtualshelves || intranetbookbag ) %]
- [% IF ( virtualshelves || intranetbookbag ) %]
-
- [% END %]
+
+
+[% END %]
[% IF LocalCoverImages %]
-
-
+
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
-
-
+[% INCLUDE 'datatables-strings.inc' %]
+
+
-
-
+
+
[% INCLUDE 'header.inc' %]
@@ -85,7 +89,6 @@
--
1.7.9.5
From oleonard at myacpl.org Fri Jan 18 22:00:18 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Fri, 18 Jan 2013 16:00:18 -0500
Subject: [Koha-patches] [PATCH] Bug 9431 - Use DataTables on Patron Category
Administration page
Message-ID: <1358542818-13850-1-git-send-email-oleonard@myacpl.org>
Replace the tablesorter plugin with the DataTables plugin on the
patron category administration page. Structural changes were made to the
table markup for validity and to deal with a DataTables bug which
prevents it from properly parsing a
with a colspan.
To test, open the Authorized Values page (Administration -> Patron
types and categories). Confirm that table sorting works correctly.
---
.../prog/en/modules/admin/categorie.tt | 37 ++++++++++++--------
1 file changed, 23 insertions(+), 14 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt
index 6c3114f..1e1c433 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt
@@ -5,23 +5,28 @@
[% IF ( delete_confirmed ) %]Category deleted[% END %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
-
-
-
+[% INCLUDE 'datatables-strings.inc' %]
+
+
-
-
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
-
@@ -66,12 +79,7 @@ tinyMCE.init({
$(document).ready(function() {
yuiToolbar();
- $.tablesorter.defaults.widgets = ['zebra'];
- $("#branchest").tablesorter({
- sortList: [[0,0]],
- headers: { 3:{sorter:false},4:{sorter:false},5:{sorter:false},6:{sorter:false}}
- }).tablesorterPager({container: $("#pagerbranchest"),positionFixed: false,size: 10});
- });
+ });
// YUI Toolbar Functions
function yuiToolbar() {
@@ -189,7 +197,6 @@ tinyMCE.init({
[% IF ( MESSAGE11 ) %]
Library cannot be deleted because there are patrons registered at that library
[% END %]
[% IF ( branches ) %]
-[% INCLUDE 'table-pager.inc' perpage='10' %]
@@ -199,7 +206,8 @@ tinyMCE.init({
Properties
IP
-
+
+
[% FOREACH branche IN branches %]
[% IF ( loop.odd ) %]
--
1.7.10.4
From oleonard at myacpl.org Sun Jan 20 01:58:18 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Sat, 19 Jan 2013 19:58:18 -0500
Subject: [Koha-patches] [PATCH] Bug 9436 - Use DataTables on cities
administration page
Message-ID: <1358643498-28068-1-git-send-email-oleonard@myacpl.org>
Replace the tablesorter plugin with the DataTables plugin on the
cities administration page.
To test, open the cities administration page (Administration
-> Cities and towns). Confirm that table sorting works correctly.
---
.../intranet-tmpl/prog/en/modules/admin/cities.tt | 21 ++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt
index 4b5dc0b..c41560b 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt
@@ -1,15 +1,10 @@
[% INCLUDE 'doc-head-open.inc' %]
Koha › Administration › [% IF ( add_form ) %]Cities › [% IF ( cityid ) %] Modify city[% ELSE %] New city[% END %][% ELSE %][% IF ( delete_confirm ) %]Cities › Confirm deletion of city[% ELSE %] Cities[% END %][% END %]
[% INCLUDE 'doc-head-close.inc' %]
-
-
-
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
@@ -130,7 +132,6 @@
[% IF ( loop ) %]
-[% INCLUDE 'table-pager.inc' perpage='20' %]
--
1.7.10.4
From oleonard at myacpl.org Sun Jan 20 02:19:31 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Sat, 19 Jan 2013 20:19:31 -0500
Subject: [Koha-patches] [PATCH] Bug 9437 - Use DataTables on itemtypes
administration page
Message-ID: <1358644771-28664-1-git-send-email-oleonard@myacpl.org>
Replace the tablesorter plugin with the DataTables plugin on the
itemtypes administration page.
To test, open the itemtypes administration page (Administration
-> Item types). Confirm that table sorting works correctly.
---
.../prog/en/modules/admin/itemtypes.tt | 22 ++++++++++----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt
index 30a3a85..926a0e6 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt
@@ -18,16 +18,10 @@ Data deleted
[% END %]
[% INCLUDE 'doc-head-close.inc' %]
-
-
-
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
@@ -291,7 +292,6 @@ Item types administration
[% IF ( else ) %]
Item types administration
[% IF ( loop ) %]
-[% INCLUDE 'table-pager.inc' perpage='10' %]
--
1.7.10.4
From oleonard at myacpl.org Tue Jan 22 17:03:32 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Tue, 22 Jan 2013 11:03:32 -0500
Subject: [Koha-patches] [PATCH] Bug 9443 - Use DataTables on MARC frameworks
administration page
Message-ID: <1358870612-3280-1-git-send-email-oleonard@myacpl.org>
Replace the tablesorter plugin with the DataTables plugin on the
MARC frameworks administration page.
To test, open the MARC frameworks dministration page (Administration ->
MARC bibliographic framework -> MARC structure). Confirm that table
sorting works correctly.
---
.../prog/en/modules/admin/marctagstructure.tt | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt
index d0f0132..d1e3944 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt
@@ -5,14 +5,10 @@
[% IF ( delete_confirmed ) %]MARC frameworks › Data deleted[% END %]
[% IF ( else ) %]MARC frameworks[% END %]
[% INCLUDE 'doc-head-close.inc' %]
-
-
-
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
@@ -158,7 +161,6 @@ $(document).ready(function() {
-[% INCLUDE 'table-pager.inc' perpage='20' %]
--
1.7.9.5
From oleonard at myacpl.org Tue Jan 22 18:20:57 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Tue, 22 Jan 2013 12:20:57 -0500
Subject: [Koha-patches] [PATCH] Bug 9444 - Use DataTables in system
preferences editor
Message-ID: <1358875257-3220-1-git-send-email-oleonard@myacpl.org>
Replace the tablesorter plugin with the DataTables plugin in the
"new" system preferences editor.
To test, open the system preferences editor on any tab other than Local
Use. Confirm that table sorting works correctly within each section. In
this configuration there should be no pager and no results filtering.
---
.../intranet-tmpl/prog/en/js/pages/preferences.js | 11 +++++++----
.../prog/en/modules/admin/preferences.tt | 5 ++++-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js
index 4d793a1..57f8dd3 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js
+++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js
@@ -1,8 +1,11 @@
$(document).ready(function() {
- $("table.preferences").tablesorter({
- sortList: [[0,0]],
- headers: { 1: { sorter:false}}
- });
+ $("table.preferences").dataTable($.extend(true, {}, dataTablesDefaults, {
+ "sDom": 't',
+ "aoColumnDefs": [
+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }
+ ],
+ "bPaginate": false
+ }));
});
// We can assume 'KOHA' exists, as we depend on KOHA.AJAX
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt
index 139c35e..58c1098 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt
@@ -1,7 +1,10 @@
[% INCLUDE 'doc-head-open.inc' %]
Koha › Administration › System preferences
[% INCLUDE 'doc-head-close.inc' %]
-
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
+[% INCLUDE 'datatables-strings.inc' %]
+
+
+[% END %]
-
--
1.7.9.5
From oleonard at myacpl.org Tue Jan 22 19:03:49 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Tue, 22 Jan 2013 13:03:49 -0500
Subject: [Koha-patches] [PATCH] Bug 9446 - Use DataTables on Z39.50 servers
administration page
Message-ID: <1358877829-3907-1-git-send-email-oleonard@myacpl.org>
Replace the tablesorter plugin with the DataTables plugin on the
Z39.50 servers administration page. Structural changes were made to
deal with a DataTables bug which prevents it from properly parsing a
with a colspan.
This patch also moves embedding of the toolbar and table-sorting JS from
within the body of the page to the for sake of consistency.
To test, open the Z39.50 servers administration page (Administration ->
Z39.50 client targets). Confirm that table sorting works
correctly.
---
.../prog/en/modules/admin/z3950servers.tt | 43 ++++++++++++--------
1 file changed, 25 insertions(+), 18 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt
index 3205e6f..8ff44cd 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt
@@ -5,6 +5,30 @@
[% IF ( add_validate ) %]Z39.50 servers › Z39.50 server added[% END %]
[% IF ( delete_confirmed ) %]Z39.50 servers › Z39.50 server deleted[% END %]
[% INCLUDE 'doc-head-close.inc' %]
+[% IF ( else ) %]
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
+
+[% END %]
[% IF ( add_form ) %]
-
@@ -305,7 +312,7 @@
You searched for [% searchfield %]
[% END %]
-
Target
Hostname/Port
Database
Userid
Password
Checked
Rank
Syntax
Encoding
Timeout
+
Target
Hostname/Port
Database
Userid
Password
Checked
Rank
Syntax
Encoding
Timeout
[% FOREACH loo IN loop %]
[% UNLESS ( loop.odd ) %]
--
1.7.9.5
From oleonard at myacpl.org Tue Jan 22 20:43:48 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Tue, 22 Jan 2013 14:43:48 -0500
Subject: [Koha-patches] [PATCH] Bug 9449 - Use Datatables on staff client
cart
Message-ID: <1358883828-4958-1-git-send-email-oleonard@myacpl.org>
Replace the tablesorter plugin with the DataTables plugin in the
staff client cart.
To test, add multiple items to the Cart in the staff client. View the
cart and confirm that table sorting works correctly. In this
configuration there should be no pager and no results filtering.
---
.../intranet-tmpl/prog/en/modules/basket/basket.tt | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
index 9989194..e23ba90 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
@@ -10,7 +10,10 @@
[% ELSE %][% INCLUDE 'doc-head-close.inc' %]
-
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
-
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
--
1.7.9.5
From oleonard at myacpl.org Wed Jan 23 17:20:42 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Wed, 23 Jan 2013 11:20:42 -0500
Subject: [Koha-patches] [PATCH] Bug 9460 - Use DataTables on transfers to
receive report page
Message-ID: <1358958042-9519-1-git-send-email-oleonard@myacpl.org>
Replace the tablesorter plugin with the DataTables plugin on the
transfers to receive report page.
To test, open the transfers to receive report page (Circulation ->
Transfers to receive). Confirm that table sorting works correctly on
each of the tables. In this configuration there is no filtering or
pagination.
---
.../prog/en/modules/circ/transferstoreceive.tt | 29 ++++++++++----------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt
index 6542ac3..9059f94 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt
@@ -1,23 +1,24 @@
[% INCLUDE 'doc-head-open.inc' %]
Koha › Circulation › Transfers to your library
[% INCLUDE 'doc-head-close.inc' %]
-
-
+[% INCLUDE 'datatables-strings.inc' %]
+
+
-
+[% INCLUDE 'datatables-strings.inc' %]
+
+
--
1.7.9.5
From oleonard at myacpl.org Wed Jan 23 18:19:11 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Wed, 23 Jan 2013 12:19:11 -0500
Subject: [Koha-patches] [PATCH] Bug 9462 - Use DataTables on patron detail
page
Message-ID: <1358961552-10486-1-git-send-email-oleonard@myacpl.org>
Replace the tablesorter plugin with the DataTables plugin on the
patron detail page.
To test, open a patron detail page for a patron who has checkouts,
holds, and relatives' checkouts. Confirm that table sorting works
correctly for each of those three tables.
---
.../prog/en/modules/members/moremember.tt | 48 +++++++++++---------
1 file changed, 26 insertions(+), 22 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
index bbb5cab..81801f7 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
@@ -9,33 +9,37 @@
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
-
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
-
-
+[% INCLUDE 'datatables-strings.inc' %]
+
+
[% INCLUDE 'calendar.inc' %]
-
--
1.7.9.5
From oleonard at myacpl.org Wed Jan 23 18:56:17 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Wed, 23 Jan 2013 12:56:17 -0500
Subject: [Koha-patches] [PATCH] Bug 9465 - Use DataTables on update child to
adult patron page
Message-ID: <1358963777-11179-1-git-send-email-oleonard@myacpl.org>
Replace the tablesorter plugin with the DataTables plugin on the
update child to adult patron page.
Added default sort by patron category description (ascending).
To test, open a patron with a child category type. Choose the 'Update
child to adult patron' item from the 'More' menu. Confirm that
table sorting works correctly in the popup.
---
.../prog/en/modules/members/update-child.tt | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt
index 8413468..943569f 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt
@@ -1,14 +1,20 @@
[% INCLUDE 'doc-head-open.inc' %]
Koha › Choose Adult category
[% INCLUDE 'doc-head-close.inc' %]
-
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
-
-
+[% IF ( saved1 ) %]
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
+[% END %]
+[% IF ( do_it ) %]
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
+[% END %]
[% INCLUDE 'header.inc' %]
--
1.7.9.5
From oleonard at myacpl.org Wed Jan 23 20:37:27 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Wed, 23 Jan 2013 14:37:27 -0500
Subject: [Koha-patches] [PATCH] Bug 9469 - Use Datatables in serials
statistics wizard
Message-ID: <1358969848-12049-1-git-send-email-oleonard@myacpl.org>
Replace the tablesorter plugin with the DataTables plugin on the
serials staitsics wizard report.
To test, run the serials statistics wizard (Reports -> Serials). Confirm
that table sorting works correctly.
---
.../prog/en/modules/reports/serials_stats.tt | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt
index 65f662f..47baf2c 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt
@@ -4,13 +4,18 @@
-
-
+[% INCLUDE 'datatables-strings.inc' %]
+
+
--
1.7.9.5
From oleonard at myacpl.org Wed Jan 23 21:33:08 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Wed, 23 Jan 2013 15:33:08 -0500
Subject: [Koha-patches] [PATCH] Bug 9471 - Use DataTables on serials claims
page
Message-ID: <1358973189-12460-1-git-send-email-oleonard@myacpl.org>
Replace the tablesorter plugin with the DataTables plugin on the
serials claims page.
This patch replaces some custom table fitlering code with code which
uses DataTables' built-in table fitlering. A minor correction to markup
has also been made to properly align inputs in the filter form.
To test, run the serials claims report for a vendor with data which will
populate results. Confirm that table sorting works correctly. Confirm
also that filtering by title and branch works.
---
.../prog/en/modules/serials/claims.tt | 46 ++++++++++----------
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt
index c1f3aa1..acc5922 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt
@@ -2,27 +2,27 @@
Koha › Serials › Claims
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
-
-
-
+[% INCLUDE 'datatables-strings.inc' %]
+
+
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
--
1.7.9.5
From bgkriegel at gmail.com Thu Jan 24 02:38:24 2013
From: bgkriegel at gmail.com (Bernardo Gonzalez Kriegel)
Date: Wed, 23 Jan 2013 22:38:24 -0300
Subject: [Koha-patches] [PATCH] [SIGNED-OFF]Bug 9439 - Enforce
superlibrarian mutual exclusivity of other permissions
In-Reply-To:
References:
Message-ID: <1358991504-26706-1-git-send-email-bgkriegel@gmail.com>
From: David Cook
Basically, when you check the checkbox for the superlibrarian permission in the patron record, it will disable and uncheck all the other permission checkboxes. When you uncheck the checkbox for the superlibrarian permission, it will renable those boxes. There is also some JS code there to ensure that the other boxes are disabled when returning to the change permission screen (i.e. the patch is not just a click handler).
In the event that the checkboxes for superlibrarian and other permissions are already checked, the user will be shown a pop-up window explaining that the superlibrarian permission is mutually exclusive to the others (since it already includes the others) and that the permissions for that patron will then be reset to just include the superlibrarian permission.
Comment: Tested on master. Works as described.
Signed-off-by: Bernardo Gonzalez Kriegel
---
.../prog/en/modules/members/member-flags.tt | 31 ++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt
index aa1eebd..40ff35c 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt
@@ -7,6 +7,37 @@
--
1.7.9.5
From oleonard at myacpl.org Thu Jan 24 02:44:27 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Wed, 23 Jan 2013 20:44:27 -0500
Subject: [Koha-patches] [PATCH] Bug 9476 - Use Datatables on Koha news page
Message-ID: <1358991867-10397-1-git-send-email-oleonard@myacpl.org>
Replace the tablesorter plugin with the DataTables plugin on the
Koha news page.
To test, open the Koha news page (Tools -> News). Confirm that table sorting
works correctly.
---
.../prog/en/modules/tools/koha-news.tt | 22 +++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt
index f782897..d1148b5 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt
@@ -2,17 +2,25 @@
Koha › Tools › News
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
-
+[% IF ( opac_news_count ) %]
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
+[% END %]
-
+[% INCLUDE 'datatables-strings.inc' %]
+
+
-
+[% INCLUDE 'datatables-strings.inc' %]
+
+
-
+[% IF ( saved1 ) %]
+
+
+[% INCLUDE 'datatables-strings.inc' %]
+
+[% END %]
-
-
+[% INCLUDE 'datatables-strings.inc' %]
+
-
-
-
-
+
+
+
+
+
[% IF ( login ) %]
[% END %]
--
1.7.9.5
From oleonard at myacpl.org Thu Jan 31 22:02:00 2013
From: oleonard at myacpl.org (Owen Leonard)
Date: Thu, 31 Jan 2013 16:02:00 -0500
Subject: [Koha-patches] [PATCH] Bug 9526 - Patron statistics table is not
pretty, needs circ toolbar
Message-ID: <1359666120-21102-1-git-send-email-oleonard@myacpl.org>
This patch adds the circ/members toolbar, corrects page title and
breadcrumbs, and adds some handling for column names which are coming
from the database. The table of statistics can display any items table
column specified in the StatisticsFields preference, but we can at least
embed the most obvious cases in the template for human readability: item
type, collection code, location, home library, and holding library.
To test, view the patron statistics page. For a patron with no
statistics you should see a message saying so. For a patron with
statistics you should see human-friendly labels for the columns
referenced above.
---
.../prog/en/modules/members/statistics.tt | 31 ++++++++++++++++----
1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt
index 3ff663c..d647794 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt
@@ -3,7 +3,7 @@
[% IF ( unknowuser ) %]
Patron does not exist
[% ELSE %]
- Patron details for [% INCLUDE 'patron-title.inc' %]
+ Statistics for [% INCLUDE 'patron-title.inc' %]
[% END %]
@@ -31,7 +31,7 @@
Home
› Patrons
-› [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron statistics for [% firstname %] [% surname %] ([% cardnumber %])[% END %]
+› [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Statistics for [% firstname %] [% surname %] ([% cardnumber %])[% END %]
@@ -39,13 +39,30 @@
-
-
Statistics
+ [% INCLUDE 'members-toolbar.inc' %]
+
+
Statistcs for [% UNLESS ( I ) %][% title %] [% firstname %] [% END %] [% surname %] ([% cardnumber %])
+ [% IF ( datas.size ) %]
[% FOREACH cn IN column_names %]
-
[% cn %]
+
+ [% SWITCH cn %]
+ [% CASE 'itype' %]
+ Item type
+ [% CASE 'ccode' %]
+ Collection code
+ [% CASE 'location' %]
+ Shelving location
+ [% CASE 'homebranch' %]
+ Home library
+ [% CASE 'holdingbranch' %]
+ Holding library
+ [% CASE %]
+ [% cn %]
+ [% END %]
+