From colin.campbell at ptfs-europe.com Mon Jan 6 18:16:42 2014 From: colin.campbell at ptfs-europe.com (Colin Campbell) Date: Mon, 6 Jan 2014 17:16:42 +0000 Subject: [Koha-patches] [PATCH] Bug 11480 Fix invalid assumptions in test Message-ID: <1389028602-17089-1-git-send-email-colin.campbell@ptfs-europe.com> Tests for Output::JSON made the invalid assumption that the hash keys of the modules internal structure will always be returned in the same sequence. A hash is an unordered structure. as of perl 5.18 this has beem reinforced by random seeding of the hashing function. See the info in perldelta and the doc for JSON This patch changes the tests to be sequence neutral where the previous test was testing that a new element was added and an existing one was untouched these have been separated into individual tests. Some typos in the messages have been corrected --- t/Output_JSONStream.t | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/t/Output_JSONStream.t b/t/Output_JSONStream.t index 1d0cf35..13702a6 100755 --- a/t/Output_JSONStream.t +++ b/t/Output_JSONStream.t @@ -6,7 +6,7 @@ use strict; use warnings; -use Test::More tests => 8; +use Test::More tests => 10; BEGIN { use_ok('C4::Output::JSONStream'); @@ -17,14 +17,16 @@ is($json->output,'{}',"Making sure JSON output is blank just after its created." $json->param( issues => [ 'yes!', 'please', 'no' ] ); is($json->output,'{"issues":["yes!","please","no"]}',"Making sure JSON output has added what we told it to."); $json->param( stuff => ['realia'] ); -is($json->output,'{"issues":["yes!","please","no"],"stuff":["realia"]}',"Making sure JSON output has added more params correctly."); +like($json->output,'/"stuff":\["realia"\]/',"Making sure JSON output has added more params correctly."); +like($json->output,'/"issues":\["yes!","please","no"\]/',"Making sure existing elements remain in JSON output"); $json->param( stuff => ['fun','love'] ); -is($json->output,'{"issues":["yes!","please","no"],"stuff":["fun","love"]}',"Making sure JSON output can obverwrite params."); +like($json->output,'/"stuff":\["fun","love"\]/',"Making sure JSON output can overwrite params."); +like($json->output,'/"issues":\["yes!","please","no"\]/',"Making non overwitten elements remain in JSON output"); eval{$json->param( die )}; ok($@,'Dies'); eval{$json->param( die => ['yes','sure','now'])}; -ok(!$@,'Dosent die.'); +ok(!$@,'Does not die.'); eval{$json->param( die => ['yes','sure','now'], die2 =>)}; ok($@,'Dies.'); -- 1.8.4.2 From nengard at bywatersolutions.com Mon Jan 6 19:16:52 2014 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 6 Jan 2014 12:16:52 -0600 Subject: [Koha-patches] [PATCH] Bug 11483: Add missing serial help files Message-ID: <1389032212-2422-1-git-send-email-nengard@bywatersolutions.com> The help files for the Serial Numbering Patterns and Frequencies pages were missing. This patch adds them. To test: * Visit the two new serial pages * Click Help * Confirm text and links are right --- .../help/serials/subscription-frequencies.tt | 11 +++++++++++ .../help/serials/subscription-numberpatterns.tt | 13 +++++++++++++ 2 files changed, 24 insertions(+), 0 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-frequencies.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-numberpatterns.tt diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-frequencies.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-frequencies.tt new file mode 100644 index 0000000..c404a85 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-frequencies.tt @@ -0,0 +1,11 @@ +[% INCLUDE 'help-top.inc' %] + +

Serial Frequencies

+ +

Koha keeps a record of publication frequencies for easy management and duplication.

+ +

From this page you can view all of the exisiting frequencies in your system and create new ones.

+ +

See the full documentation for Serial Frequencies in the manual (online).

+ +[% INCLUDE 'help-bottom.inc' %] \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-numberpatterns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-numberpatterns.tt new file mode 100644 index 0000000..7479f9d --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-numberpatterns.tt @@ -0,0 +1,13 @@ +[% INCLUDE 'help-top.inc' %] + +

Serial Numbering Patterns

+ +

Every time you create a new numbering pattern in serials you can save it for later use. These patters are accessible via the Manage numbering patterns page.

+ +

This page will list for you the numbering patterns you have saved in the past as well as a few canned patterns.

+ +

It will also allow you to create a new numbering pattern without first adding a subscription. To add new new pattern click 'New numbering pattern' at the top of the list of patterns.

+ +

See the full documentation for Serial Numbering Patterns in the manual (online).

+ +[% INCLUDE 'help-bottom.inc' %] \ No newline at end of file -- 1.7.2.3 From jendayi30 at gmail.com Wed Jan 8 19:17:16 2014 From: jendayi30 at gmail.com (J B) Date: Wed, 8 Jan 2014 12:17:16 -0600 Subject: [Koha-patches] [PATCH 2/2] Bug 11415: Add syspref to toggle SCO receipt printing Message-ID: Simple change to updatedatabase.pl to set SCO receipt printing as default -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Bug-11415-Add-syspref-to-toggle-SCO-receipt-printing.patch Type: application/octet-stream Size: 1328 bytes Desc: not available URL: From tomascohen at gmail.com Thu Jan 9 16:45:58 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Thu, 9 Jan 2014 12:45:58 -0300 Subject: [Koha-patches] [PATCH] Bug 11510: koha-translate usage message fixes Message-ID: <1389282358-12037-1-git-send-email-tomascohen@gmail.com> The koha-translate's usage message has a couple of inconsistencies: '--all' should be '--available' and '--help' is missing from the usage examples. Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- debian/docs/koha-translate.xml | 7 +++++++ debian/scripts/koha-translate | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/docs/koha-translate.xml b/debian/docs/koha-translate.xml index e06dede..7f97e8e 100644 --- a/debian/docs/koha-translate.xml +++ b/debian/docs/koha-translate.xml @@ -25,6 +25,7 @@ koha-translate | | | | lang_code koha-translate | | + koha-translate | @@ -43,6 +44,12 @@ + + + Print usage information. + + + Install the specified lang_code language translation. diff --git a/debian/scripts/koha-translate b/debian/scripts/koha-translate index 0c731cf..d0b3a2f 100755 --- a/debian/scripts/koha-translate +++ b/debian/scripts/koha-translate @@ -30,12 +30,12 @@ $scriptname This script lets you manage your Koha templates translations. Usage: -$scriptname --list|-l [--all|-a] +$scriptname --list|-l [--available|-a] $scriptname --check|-c language_code $scriptname --install|-i language_code $scriptname --update|-u language_code $scriptname --remove|-r language_code -$scriptname -h +$scriptname --help|-h -l | --list List the installed or available (combined with -a) language translations -- 1.8.3.2 From tomascohen at gmail.com Thu Jan 9 16:50:39 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Thu, 9 Jan 2014 12:50:39 -0300 Subject: [Koha-patches] [PATCH] Bug 11509: koha-create should print better usage information Message-ID: <1389282639-13728-1-git-send-email-tomascohen@gmail.com> This patch makes koha-create print better and more descriptive usage information. Also adds the --help and -h switches. Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- debian/docs/koha-create.xml | 10 +++++++ debian/scripts/koha-create | 67 ++++++++++++++++++++++++++++++++++----------- 2 files changed, 61 insertions(+), 16 deletions(-) diff --git a/debian/docs/koha-create.xml b/debian/docs/koha-create.xml index 99ce191..ae046ce 100644 --- a/debian/docs/koha-create.xml +++ b/debian/docs/koha-create.xml @@ -37,6 +37,8 @@ /path/to/passwd database n + | + instancename @@ -149,6 +151,14 @@ + + , + + Print usage information. + + + + diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index 7f05eb0..c0eecd2 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -19,15 +19,49 @@ set -e -usage="Usage: $0 [--create-db|--request-db|--populate-db|--use-db] \ - [--marcflavor marc21|normarc|unimarc] \ - [--zebralang en|es|fr|nb|ru|uk] \ - [--auth-idx dom|grs1] [--biblio-idx dom|grs1] \ - [--use-memcached] \ - [--memcached-servers server:port] [--memcached-prefix prefix] \ - [--defaultsql /path/to/some.sql] \ - [--configfile /path/to/config] [--passwdfile /path/to/passwd] \ - [--database database] [--adminuser n] instancename" +usage() +{ + local scriptname=$0 + cat <&2 @@ -220,9 +254,9 @@ then . /etc/koha/koha-sites.conf fi -[ $# -ge 2 ] && [ $# -le 16 ] || die $usage +[ $# -ge 2 ] && [ $# -le 16 ] || ( usage ; die "Error: wrong parameters" ) -TEMP=`getopt -o crpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,use-memcached,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser:,memcached-servers:,memcached-prefix:, \ +TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,use-memcached,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser:,memcached-servers:,memcached-prefix:, \ -n "$0" -- "$@"` # Note the quotes around `$TEMP': they are essential! @@ -257,11 +291,11 @@ while true ; do CLO_MEMCACHED_PREFIX="$2" ; shift 2;; -m|--marcflavor) CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;; - -l|--zebralang) + -l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;; - --auth-idx) + --auth-idx) CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;; - --biblio-idx) + --biblio-idx) CLO_BIBLIOS_INDEXING_MODE="$2" ; shift 2 ;; -d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;; @@ -273,6 +307,8 @@ while true ; do CLO_DATABASE="$2" ; shift 2 ;; -a|--adminuser) CLO_ADMINUSER="$2" ; shift 2 ;; + -h|--help) + usage ; exit 0 ;; --) shift ; break ;; *) @@ -341,8 +377,7 @@ Please set USE_MEMCACHED="yes" on /etc/koha/koha-sites.conf or use the EOF` - echo $usage - die $MSG + usage ; die $MSG else # Unset memcached-related variables MEMCACHED_SERVERS="" -- 1.8.5.2 From tomascohen at gmail.com Thu Jan 9 16:54:06 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Thu, 9 Jan 2014 12:54:06 -0300 Subject: [Koha-patches] [PATCH] Bug 10942: Provide a way for package upgrades to update template translations Message-ID: <1389282846-12231-1-git-send-email-tomascohen@gmail.com> This patch adds a new config variable AUTOMATIC_TRANSLATIONS_UPDATE at /etc/default/koha-common that is used to control whether the upgrade process should trigger a $ koha-translate --update command for each installed template translation language. To test: - Have a koha-common setup with some languages installed (e.g. koha-translate --install es-ES) - Apply the patch and build a package for it. - Install it. - A new AUTOMATIC_TRANSLATIONS_UPDATE config variable should be in place at /etc/default/koha-common - Set AUTOMATIC_TRANSLATIONS_UPDATE to 'yes' - Re-install the package to trigger the post-install script - Verify that translations get updated. Edit: added a warning message for the case AUTOMATIC_TRANSLATIONS_UPDATE=no and there are translations installed (so they need to get updated). Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- debian/koha-common.default | 13 +++++++++++++ debian/koha-common.postinst | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/debian/koha-common.default b/debian/koha-common.default index d572f17..cbc6eba 100644 --- a/debian/koha-common.default +++ b/debian/koha-common.default @@ -1,3 +1,16 @@ ## General koha-common default options PERL5LIB="/usr/share/koha/lib" + +## Automatic template translation update +# +# This variable controls whether template translations should +# be updated automatically on koha-common package upgrades. +# Options: 'yes' +# 'no' (default) +# Note: if you choose 'no' then you will have to issue +# $ koha-translate --update +# +#AUTOMATIC_TRANSLATIONS_UPDATE="no" + +## End of general koha-common default options diff --git a/debian/koha-common.postinst b/debian/koha-common.postinst index 7fa4513..b76cf57 100644 --- a/debian/koha-common.postinst +++ b/debian/koha-common.postinst @@ -2,8 +2,17 @@ set -e +NAME="koha-common" +# Default to "no" +AUTOMATIC_TRANSLATIONS_UPDATE="no" + . /usr/share/debconf/confmodule +# Read configuration variable file if it is present +if [ -r /etc/default/$NAME ]; then + . /etc/default/$NAME +fi + conf=/etc/mysql/koha-common.cnf if [ ! -e "$conf" ] && [ ! -L "$conf" ] then @@ -14,6 +23,30 @@ fi koha-upgrade-schema $(koha-list) +if [ "$AUTOMATIC_TRANSLATIONS_UPDATE" = "yes" ]; then + for lang in $(koha-translate --list | grep -v -x "en"); do + if koha-translate --update $lang; then + echo "Updated the $lang translations." + else + cat < This UT got wrapped inside a transaction with autocommit=0 but the rollback call was inadvertedly ommited. Adding it. Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- t/db_dependent/XISBN.t | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t/db_dependent/XISBN.t b/t/db_dependent/XISBN.t index 55f25a1..6ff6063 100755 --- a/t/db_dependent/XISBN.t +++ b/t/db_dependent/XISBN.t @@ -65,6 +65,8 @@ is( $results_xisbn->[0]->{biblionumber}, $biblionumber3, "Gets correct biblionumber from a book with a similar isbn using XISBN." ); +$dbh->rollback; + # Util subs # Add new biblio with isbn and return biblionumber -- 1.8.5.2 From tomascohen at gmail.com Thu Jan 9 20:03:29 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Thu, 9 Jan 2014 16:03:29 -0300 Subject: [Koha-patches] [PATCH] Bug 10896: Add a --verbose option to koha-translate Message-ID: <1389294209-17403-1-git-send-email-tomascohen@gmail.com> The -v and --verbose option switches add the --verbose switch to the misc/translator/translate script call in the packages' 'koha-translate' command. The docs are updated accordingly. Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- debian/docs/koha-translate.xml | 10 +++++++++- debian/scripts/koha-translate | 16 +++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/debian/docs/koha-translate.xml b/debian/docs/koha-translate.xml index e06dede..588aa59 100644 --- a/debian/docs/koha-translate.xml +++ b/debian/docs/koha-translate.xml @@ -23,7 +23,9 @@ - koha-translate | | | | lang_code + koha-translate | | | | | lang_code + + koha-translate | | @@ -66,6 +68,12 @@ Update the specified lang_code language translation. + + + + Be more verbose on the translation process. + + diff --git a/debian/scripts/koha-translate b/debian/scripts/koha-translate index 0c731cf..c579a7b 100755 --- a/debian/scripts/koha-translate +++ b/debian/scripts/koha-translate @@ -44,6 +44,7 @@ $scriptname -h -i | --install Install the specified language translations -u | --update Update the specified language translations -r | --remove Remove the specified language translations + -v | --verbose Be more verbose on the translation process -h | --help Display this help message EOF @@ -82,7 +83,12 @@ print_installed() install_lang() { - lang=$1 + local lang=$1 + local translate_opts="" + + if [ "$verbose" = "yes" ]; then + translate_opts="--verbose" + fi if [ "$lang" != "" ]; then @@ -97,7 +103,7 @@ install_lang() # Check po files are present check_lang_po_files $lang env PERL5LIB="$KOHA_LIB_DIR:$TRANSLATE_DIR" KOHA_CONF="$KOHA_CONF_FILE"\ - $PERL_CMD $TRANSLATE_DIR/translate install $lang + $PERL_CMD $TRANSLATE_DIR/translate install $translate_opts $lang fi else die "Error: the selected language is not currently available." @@ -195,9 +201,10 @@ PERL_CMD=`which perl` list_all="" op="" language="" +verbose="no" # We accept at most 2 parameters -[ $# -ge 1 ] && [ $# -le 3 ] || ( usage ; die "Error: wrong parameters" ) +[ $# -ge 1 ] && [ $# -le 4 ] || ( usage ; die "Error: wrong parameters" ) # Read parameters while [ $# -gt 0 ]; do @@ -224,6 +231,9 @@ while [ $# -gt 0 ]; do -a|--available) list_all=1 shift ;; + -v|--verbose) + verbose="yes" + shift ;; -*) usage die "Error: unknown parameter $1." ;; -- 1.8.3.2 From oleonard at myacpl.org Fri Jan 10 17:09:37 2014 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 10 Jan 2014 11:09:37 -0500 Subject: [Koha-patches] [PATCH] Bug 11503 - Several typos Message-ID: <1389370177-19199-1-git-send-email-oleonard@myacpl.org> This patch corrects several typos: Some reported in Bug 11503, others found during a systematic spell check of the help files. To test, examine the changes and confirm that the spelling changes are correct. --- .../prog/en/includes/subtypes_unimarc.inc | 2 +- .../prog/en/modules/authorities/authorities.tt | 2 +- .../value_builder/unimarc_field_121a.tt | 8 ++++---- .../intranet-tmpl/prog/en/modules/help/about.tt | 2 +- .../prog/en/modules/help/acqui/basket.tt | 2 +- .../prog/en/modules/help/acqui/lateorders.tt | 2 +- .../modules/help/admin/auth_subfields_structure.tt | 4 ++-- .../en/modules/help/admin/authorised_values.tt | 2 +- .../modules/help/admin/item_circulation_alerts.tt | 2 +- .../prog/en/modules/help/admin/preferences.tt | 2 +- .../prog/en/modules/help/admin/smart-rules.tt | 6 +++--- .../intranet-tmpl/prog/en/modules/help/mainpage.tt | 2 +- .../prog/en/modules/help/members/member-flags.tt | 6 +++--- .../prog/en/modules/help/plugins/plugins-home.tt | 2 +- .../prog/en/modules/help/plugins/plugins-upload.tt | 2 +- .../prog/en/modules/help/reports/guided_reports.tt | 4 ++-- .../prog/en/modules/help/reserve/request.tt | 4 ++-- .../prog/en/modules/help/serials/serials-edit.tt | 2 +- .../en/modules/help/serials/subscription-detail.tt | 2 +- .../help/serials/subscription-frequencies.tt | 2 +- .../prog/en/modules/help/tools/holidays.tt | 2 +- .../help/tools/marc_modification_templates.tt | 8 ++++---- .../prog/en/modules/help/tools/quotes-upload.tt | 2 +- .../prog/en/modules/help/tools/quotes.tt | 2 +- .../prog/en/modules/reserve/request.tt | 2 +- 25 files changed, 38 insertions(+), 38 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 5e83ea4..02f146f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/subtypes_unimarc.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/subtypes_unimarc.inc @@ -29,7 +29,7 @@ - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt index dd3d9bb..ae61553 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt @@ -158,7 +158,7 @@ function confirmnotdup(redirect){
- +
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_121a.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_121a.tt index d92de06..bbd5ca0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_121a.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_121a.tt @@ -48,9 +48,9 @@ [% END %] [% IF ( f2d ) %] - + [% ELSE %] - + [% END %] [% IF ( f2e ) %] @@ -226,9 +226,9 @@ [% END %] [% IF ( f5y ) %] - + [% ELSE %] - + [% END %] [% IF ( f5z ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/about.tt index 491d552..8ca2b5a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/about.tt @@ -10,7 +10,7 @@

Perl modules

-

This tab lists all the dependant Perl modules for Koha and whether or not you have them installed, and the version number. If you are reporting an issue, the developer may ask what is the state of the Perl modules you have installed.

+

This tab lists all the dependent Perl modules for Koha and whether or not you have them installed, and the version number. If you are reporting an issue, the developer may ask what is the state of the Perl modules you have installed.

System information

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/basket.tt index e577df2..53a1b25 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/basket.tt @@ -101,7 +101,7 @@

Clicking the 'Uncertain Prices' button will call up a list of items with uncertain prices to quick editing.

-

Important: The Uncertain Prices page is independent of the basket. It is linked to the vendor so you will see all items on order with uncertain prices for that vender.

+

Important: The Uncertain Prices page is independent of the basket. It is linked to the vendor so you will see all items on order with uncertain prices for that vendor.

Printing Baskets

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/lateorders.tt index 62526ed..25ae7fb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/lateorders.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/lateorders.tt @@ -14,7 +14,7 @@

Note: The Estimated Delivery Date is based on the Delivery time value entered on the vendor record.

-

There is a default acquisitions cliam letter. If you would rather use a different one, you can create that in the notices module and choose it from the menu above the list of late items.

+

There is a default acquisitions claim letter. If you would rather use a different one, you can create that in the notices module and choose it from the menu above the list of late items.

See the full documentation for Claims and Late Orders in the manual (online).

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/auth_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/auth_subfields_structure.tt index 123d281..461b1c1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/auth_subfields_structure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/auth_subfields_structure.tt @@ -20,7 +20,7 @@
  • 'Text for librarian' is what appears before the subfield in the librarian interface.
  • 'Text for OPAC' is what appears before the field in the OPAC.If left empty, the text for librarian is used instead
  • -
  • If 'Repeatable' is checked, the field will have a plus sign next to it in the MARC cataloguing monologue which allows you to add multiples of that tag.
  • +
  • If 'Repeatable' is checked, the field will have a plus sign next to it in the MARC cataloging module which allows you to add multiples of that tag.
  • 'Mandatory' prevents the user from saving a record unless there is a value assigned to the tag.
  • 'Managed in tab' defines the tab where the subfield is shown. All subfields of a given field must either be in the same tab or ignored. 'Ignore' means that the subfield is not managed.
  • 'Default value' defines what you want to appear in the field by default. This field will be editable, but it saves time if you use the same note over and over.
  • @@ -50,7 +50,7 @@
    • (! means 'not visible' or in the case of collapsed 'not collapsed')
    • If 'Is a url' is checked, the subfield is a url and can be clicked
    • -
    • 'Authorized Value' allows the librarian to select an authorized value list from which cataloguers must choose an option.
    • +
    • 'Authorized Value' allows the librarian to select an authorized value list from which catalogers must choose an option.
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/authorised_values.tt index 79574be..0d21744 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/authorised_values.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/authorised_values.tt @@ -33,7 +33,7 @@
  • 'MANUAL_INV' includes values for manual invoicing.
  • 'NOT_LOAN' is used to list reasons why a title is not for loan.
  • 'PROC' is for the location to be used for NewItemsDefaultLocation (change description as desired), also the location expected by InProcessingToShelvingCart.
  • -
  • 'REPORT_GROUP' provides a way to sort and filter your reports, the default values in this category include the Koha modules (Accounts, Acquitisions, Catalog, Circulation, Patrons)
  • +
  • 'REPORT_GROUP' provides a way to sort and filter your reports, the default values in this category include the Koha modules (Accounts, Acquisitions, Catalog, Circulation, Patrons)
  • 'REPORT_SUBGROUP' can be used to further sort and filter your reports. This category is empty by default. Values here need to include the authorized value code from REPORT_GROUP in the Description (OPAC) field to link the subgroup to the appropriate group.
  • 'RESTRICTED' is used for the restricted status of an item
  • 'SUGGEST' is for a list of reasons to accept or reject patron suggestions. It appears when managing suggestions.
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/item_circulation_alerts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/item_circulation_alerts.tt index af071b9..ac33024 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/item_circulation_alerts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/item_circulation_alerts.tt @@ -16,7 +16,7 @@
  • To set preferences for all libraries, keep the menu set to 'Default'
  • -
  • By default all item types and all patrons are notified of check ins and check outs. To change this, click on the item/patron type combo that you would like to stop notices for.
  • +
  • By default all item types and all patrons are notified of check ins and check outs. To change this, click on the item/patron type combination that you would like to stop notices for.
  • See the full documentation for Item Circulation Alerts in the manual (online).

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/preferences.tt index 8e5682d..302e961 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/preferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/preferences.tt @@ -16,7 +16,7 @@
    • Acquisitions: holds preferences related to acquisitions such as handling patron suggestions and local taxes.
    • -
    • Administration: holds administrative preferences such as admin email address, sessions and timout.
    • +
    • Administration: holds administrative preferences such as admin email address, sessions and timeout.
    • Authorities: holds preference related to handling authority records.
    • Cataloging: holds preferences that control the cataloging functions. This is where you choose your MARC flavor, set up Z39.50 and barcoding.
    • Circulation: holds preferences that control circulation functions such as holds and fines.
    • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/smart-rules.tt index b2a87f5..255cc22 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/smart-rules.tt @@ -23,7 +23,7 @@

      Default Circulation Rules

      -

      Using the issuing rules matrix you can define rules that depend on patron/item typecombos. To set your rules, choose a library from the pull down (or 'all libraries' if you want to apply these rules to all libraries)

      +

      Using the issuing rules matrix you can define rules that depend on patron/item type combinations. To set your rules, choose a library from the pull down (or 'all libraries' if you want to apply these rules to all libraries)

      From the matrix you can choose any combination of patron categories and item types to apply the rules to

      @@ -33,7 +33,7 @@
    • Limit the number of items a patron can have checked out at the same time by entering a number in the 'Current Checkouts Allowed' field
    • Define the period of time an item can be checked out to a patron by entering the number of units (days or hours) in the 'Loan Period' box.
    • Choose which unit of time, Days or Hours, that the loan period and fines will be calculate in
    • -
    • You can also define a hard due date for a specific patron category and item type. A hard due date ignores your usual circulation rules and makes it so that allitems of the type defined are due on, before or after the date you specify.
    • +
    • You can also define a hard due date for a specific patron category and item type. A hard due date ignores your usual circulation rules and makes it so that all items of the type defined are due on, before or after the date you specify.
    • 'Fine Amount' should have the amount you would like to charge for overdue items
      • Important: Enter only numbers and decimal points (no currency symbols).
      • @@ -57,7 +57,7 @@
      • Next decide if the patron can renew this item type and if so, enter how many times they can renew it in the 'Renewals Allowed' box
      • If the patron can place holds on this item type, enter the total numbers of items (of this type) that can be put on hold in the 'Holds Allowed' field
      • -
      • Finally, if you charge a rental feefor the item type and want to give a specific patron type a discount on that fee, enter the percentage discount (without the % symbol) in the 'Rental Discount' field
      • +
      • Finally, if you charge a rental fee for the item type and want to give a specific patron type a discount on that fee, enter the percentage discount (without the % symbol) in the 'Rental Discount' field

      When finished, click 'Add' to save your changes. To modify a rule, create a new one with the same patron type and item type. If you would like to delete your rule, simply click the 'Delete' link to the right of the rule.

      diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/mainpage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/mainpage.tt index 1ccfe32..3d00f88 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/mainpage.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/mainpage.tt @@ -11,7 +11,7 @@
    • Read Koha documentation
    • Read/Write to the Koha wiki
    • Read and contribute to discussions
    • -
    • Report koha bugs
    • +
    • Report Koha bugs
    • Submit patches to Koha using git (version control system)
    • Chat with Koha users and developers
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tt index ceec194..82b217f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tt @@ -45,7 +45,7 @@
  • parameters
    • Manage Koha system settings (Administration panel)
    • -
    • This secton can be expanded
    • +
    • This section can be expanded
  • borrowers @@ -71,7 +71,7 @@
  • editcatalogue
      -
    • Edit Catalog (Modify bibliographic/hodings data)
    • +
    • Edit Catalog (Modify bibliographic/holdings data)
    • This section can be expanded
  • @@ -88,7 +88,7 @@
  • management
      -
    • Set library management paraments (deprecated) +
    • Set library management parameters (deprecated)
      • Important: This permission level no longer controls anything.
      diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/plugins/plugins-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/plugins/plugins-home.tt index c9b1809..713d9ca 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/plugins/plugins-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/plugins/plugins-home.tt @@ -2,7 +2,7 @@

      Plugins

      -

      Koha's Plugin System allows for you to add additional tools and reports to Koha that are specific to your library. Plugins are installed by uploading KPZ ( Koha Plugin Zip ) packages. A KPZ file is just a zip file containing the perl files, template files, and any other files neccessary to make the plugin work.

      +

      Koha's Plugin System allows for you to add additional tools and reports to Koha that are specific to your library. Plugins are installed by uploading KPZ ( Koha Plugin Zip ) packages. A KPZ file is just a zip file containing the perl files, template files, and any other files necessary to make the plugin work.

      The plugin system needs to be turned on by a system administrator and should only managed by those who understand Perl and the way data connects within Koha.

      diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/plugins/plugins-upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/plugins/plugins-upload.tt index f32f2e9..e0b3dba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/plugins/plugins-upload.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/plugins/plugins-upload.tt @@ -2,7 +2,7 @@

      Upload Koha plugin

      -

      Koha's plugin system allows for you to add additional tools and reports to Koha that are specific to your library. Plugins are installed by uploading KPZ ( Koha Plugin Zip ) packages. A KPZ file is just a zip file containing the perl files, template files, and any other files neccessary to make the plugin work.

      +

      Koha's plugin system allows for you to add additional tools and reports to Koha that are specific to your library. Plugins are installed by uploading KPZ ( Koha Plugin Zip ) packages. A KPZ file is just a zip file containing the perl files, template files, and any other files necessary to make the plugin work.

      Important: Only install plugins from trusted sources.

      diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/guided_reports.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/guided_reports.tt index 2af7d47..9d08f7d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/guided_reports.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/guided_reports.tt @@ -84,7 +84,7 @@

      Reports can also be added by duplicating an existing report. Visit the 'Saved reports' page to see all of the reports listed on your system.

      -

      To the right of every report there is an 'Actions' pull down. Clickin that and choose 'Duplicate' to use an existing report as the basis for your new report. That will populate the new report form with the existing SQL for easy editing and resaving.

      +

      To the right of every report there is an 'Actions' pull down. Clicking that and choose 'Duplicate' to use an existing report as the basis for your new report. That will populate the new report form with the existing SQL for easy editing and resaving.

      Edit Custom Reports

      @@ -167,7 +167,7 @@
    • 1 = Circulation
    • 2 = Catalog
    • 3 = Patrons
    • -
    • 4 = Acquistions
    • +
    • 4 = Acquisitions
    • 5 = Accounts
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/reserve/request.tt index 9f50410..b8c7ad2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/reserve/request.tt @@ -28,7 +28,7 @@
  • If the patron has specified that they don't want the item after a certain date, or if you have limits on hold lengths, you can enter an expiration date for the hold in the 'Hold expires on date'
      -
    • To have expired holds canceled automatically you will need to have the Expired Holds cron job set to run on a regular basis.
    • +
    • To have expired holds cancelled automatically you will need to have the Expired Holds cron job set to run on a regular basis.
  • Next choose if you want to place a hold on the next available item or a specific item by clicking the radio button next to an individual item.
  • @@ -40,7 +40,7 @@

    Managing Holds

    -

    Holds can be altered and canceled from the Holds tab found on the left of the bibliographic record.

    +

    Holds can be altered and cancelled from the Holds tab found on the left of the bibliographic record.

    From the list of holds you can change the order of the holds, the pickup location and/or cancel the hold.

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/serials-edit.tt index d43f50d..29bfaa2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/serials-edit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/serials-edit.tt @@ -1,6 +1,6 @@ [% INCLUDE 'help-top.inc' %] -

    Recieving Serials

    +

    Receiving Serials

    Issues can be marked as received from several locations. To find a subscription, use the search box at the top of the Serials page to search for the serial you'd like to receive issues for

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-detail.tt index 978aa28..ffbb394 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-detail.tt @@ -4,7 +4,7 @@

    This page shows you all of the information about your subscription including issue history.

    -

    From here you can edit your subscription, renew it and/or recieve issues.

    +

    From here you can edit your subscription, renew it and/or receive issues.

    See the full documentation for Serials in the manual (online).

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-frequencies.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-frequencies.tt index c404a85..01866f8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-frequencies.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-frequencies.tt @@ -4,7 +4,7 @@

    Koha keeps a record of publication frequencies for easy management and duplication.

    -

    From this page you can view all of the exisiting frequencies in your system and create new ones.

    +

    From this page you can view all of the existing frequencies in your system and create new ones.

    See the full documentation for Serial Frequencies in the manual (online).

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/holidays.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/holidays.tt index ba06b66..9d29851 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/holidays.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/holidays.tt @@ -10,7 +10,7 @@
  • Choose the method for calculating due date - either include days the library is closed in the calculation or don't include them.
  • -
  • Get there: More > Administration > Global System Preferences > Circulation > finescalendar +
  • Get there: More > Administration > Global System Preferences > Circulation > finesCalendar
    • This will check the holiday calendar before charging fines
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/marc_modification_templates.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/marc_modification_templates.tt index 30ba280..31ec4a3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/marc_modification_templates.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/marc_modification_templates.tt @@ -4,7 +4,7 @@

    The MARC Modification Templates system gives Koha users the power to make alterations to MARC records automatically while staging MARC records for import.

    -

    This tool is useful for altering MARC records from various venders/sources work with your MARC framework. The system essentially allows one to create a basic script using actions to Copy, Move, Add, Update and Delete fields.

    +

    This tool is useful for altering MARC records from various vendors/sources work with your MARC framework. The system essentially allows one to create a basic script using actions to Copy, Move, Add, Update and Delete fields.

    Start by adding a new template (a template can be made up of one or more actions) by entering a name and clicking 'Create template'.

    @@ -18,11 +18,11 @@
  • Click 'Add action'
  • -

    Each action can also have an optional condition to check the value or existance of another field. For example you might want to add the call number to the item record if it's not already there.

    +

    Each action can also have an optional condition to check the value or existence of another field. For example you might want to add the call number to the item record if it's not already there.

    • Choose 'Copy'
    • -
    • Decide if you want to copy the first occurance or all occurances of the field
    • +
    • Decide if you want to copy the first occurrence or all occurrences of the field
    • Enter the field 090 (or other biblio call number field) and subfield a to copy
    • Enter the 952 field and o subfield to copy to
    • Choose 'if'
    • @@ -36,7 +36,7 @@
      • Choose 'Copy'
      • -
      • Decide if you want to copy the first occurance or all occurances of the field
      • +
      • Decide if you want to copy the first occurrence or all occurrences of the field
      • Enter the field 020 and subfield c to copy
      • Enter the 020 field and c subfield to copy to
      • Check the 'RegEx' box and enter your regular expression ( in this case s/\$// )
      • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/quotes-upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/quotes-upload.tt index cb1201c..2315c91 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/quotes-upload.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/quotes-upload.tt @@ -26,7 +26,7 @@
      • Delete Quote(s)
        1. This option allows for the deletion of one or more quotes at a time.
        2. -
        3. Select the quote(s) you desire to delete by clicking on the corrisponding quote id.
        4. +
        5. Select the quote(s) you desire to delete by clicking on the corresponding quote id.
        6. Once quote selection is finished, simply click the 'Delete quote(s)' key.
        7. You will be prompted to confirm the deletion.
        8. After confirming the deletion, the list will update and the quote(s) will no longer appear.
        9. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/quotes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/quotes.tt index 392580c..80d58fe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/quotes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/quotes.tt @@ -26,7 +26,7 @@
        10. Delete Quote(s)
          1. This option allows for the deletion of one or more quotes at a time.
          2. -
          3. Select the quote(s) you desire to delete by clicking on the corrisponding quote id.
          4. +
          5. Select the quote(s) you desire to delete by clicking on the corresponding quote id.
          6. Once quote selection is finished, simply click the 'Delete quote(s)' key.
          7. You will be prompted to confirm the deletion.
          8. After confirming the deletion, the list will update and the quote(s) will no longer appear.
          9. 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 9e46732..beeb5d7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -246,7 +246,7 @@ function checkMultiHold() {
          10. No copies are available to be placed on hold
          11. [% END %] [% IF ( alreadypossession ) %] -
          12. [% borrowerfirstname %] [% borrowersurname %] is already in possesion of one item
          13. +
          14. [% borrowerfirstname %] [% borrowersurname %] is already in possession of one item
          15. [% END %]
      [% ELSE %] -- 1.7.9.5 From oleonard at myacpl.org Fri Jan 10 18:02:20 2014 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 10 Jan 2014 12:02:20 -0500 Subject: [Koha-patches] [PATCH] Bug 11476 - Opac self registration title pull down offers 2 empty options Message-ID: <1389373340-19454-1-git-send-email-oleonard@myacpl.org> If you have patron titles enabled, the OPAC patron details form lists 2 empty spaces instead of 1. An empty option is passed by the script, so the template does not need to include one. To test you must have at least one patron title set in BorrowersTitles system preference and OPACPatronDetails must be set to "allow." 1. Apply the patch 2. Log in to the OPAC 3. Click the "personal details" tab. 4. Click the "salutation" dropdown. There should be only one blank line preceding the existing titles. Test in both prog and bootstrap. --- .../bootstrap/en/modules/opac-memberentry.tt | 1 - .../opac-tmpl/prog/en/modules/opac-memberentry.tt | 1 - 2 files changed, 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt index 0d48e8d..8022fff 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -110,7 +110,6 @@ Salutation: - [% FOREACH mt IN member_titles %] [% IF mt == borrower.title %] -- 1.7.9.5 From oleonard at myacpl.org Fri Jan 10 18:48:58 2014 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 10 Jan 2014 12:48:58 -0500 Subject: [Koha-patches] [PATCH] Bug 11381 - IDreamBooks too close to title on bootstrap Message-ID: <1389376138-20795-1-git-send-email-oleonard@myacpl.org> Styling of IDreamBooks elements is not correct in the bootstrap theme because the relevant CSS was not transferred from the prog theme. This patch adds it back. To test, switch to the bootstrap theme and enable IDreamBooks system preferences in the OPAC, particularly IDreamBooksReadometer. Find a book in the OPAC which shows IDreamBooks review data and confirm that everything looks correct. --- koha-tmpl/opac-tmpl/bootstrap/css/opac.css | 41 +++++++++++++++++++++ koha-tmpl/opac-tmpl/bootstrap/less/opac.less | 50 ++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/opac.css b/koha-tmpl/opac-tmpl/bootstrap/css/opac.css index d9a22de..99719d5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/opac.css +++ b/koha-tmpl/opac-tmpl/bootstrap/css/opac.css @@ -2232,6 +2232,47 @@ td img { .copiesrow { clear: both; } +#idreambooksreadometer { + float: right; +} +a.idreambooksrating { + font-size: 30px; + color: #29ADE4; + padding-left: 85px; + line-height: 30px; + text-decoration: none; +} +.idreambookslegend { + font-size: small; +} +a.reviewlink, +a.reviewlink:visited { + text-decoration: none; + color: black; + font-weight: normal; +} +.idreambookssummary a { + color: #707070; + text-decoration: none; +} +.idreambookssummary img, +.idbresult img { + vertical-align: middle; +} +.idbresult { + color: #29ADE4; + text-align: center; + margin: 0.5em; + padding: 0.5em; +} +.idbresult a, +.idbresult a:visited { + text-decoration: none; + color: #29ADE4; +} +.idbresult img { + padding-right: 6px; +} .shadowed { -webkit-box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.2); diff --git a/koha-tmpl/opac-tmpl/bootstrap/less/opac.less b/koha-tmpl/opac-tmpl/bootstrap/less/opac.less index 8fb8bf2..4e1e422 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/less/opac.less +++ b/koha-tmpl/opac-tmpl/bootstrap/less/opac.less @@ -2265,4 +2265,54 @@ td img { clear : both; } +#idreambooksreadometer { + float: right; +} + +a.idreambooksrating { + font-size: 30px; + color: #29ADE4; + padding-left: 85px; + line-height: 30px; + text-decoration: none; +} + +.idreambookslegend { + font-size: small; +} + +a.reviewlink, +a.reviewlink:visited { + text-decoration: none; + color: black; + font-weight: normal; +} + +.idreambookssummary a { + color: #707070; + text-decoration: none; +} + +.idreambookssummary img, +.idbresult img { + vertical-align: middle; +} + +.idbresult { + color: #29ADE4; + text-align: center; + margin: 0.5em; + padding: 0.5em; +} + +.idbresult a, +.idbresult a:visited { + text-decoration: none; + color: #29ADE4; +} + +.idbresult img { + padding-right: 6px; +} + @import "responsive.less"; -- 1.7.9.5 From oleonard at myacpl.org Fri Jan 10 22:03:49 2014 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 10 Jan 2014 16:03:49 -0500 Subject: [Koha-patches] [PATCH] Bug 11505 - Untranslatable table headers in Label batch manager Message-ID: <1389387829-22310-1-git-send-email-oleonard@myacpl.org> The label batch manager script hard-codes the table header cell labels in order to pass them to an HTML-building function. This obviously isn't the best solution for internationalization, but picking the whole scheme apart would be very complicated. Instead this patch uses a SWITCH statement to check for each possible case and outputs the correct translatable string for each. To test, apply the patch and run "perl translate update" for any translation. Check the revised po file and confirm that the new strings are present. View the label batch edit page and confirm that the table headings look correct: Tools -> Labels -> Manage batches -> Edit batch. --- .../prog/en/modules/labels/label-edit-batch.tt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt index bde821a..54ff3bd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt @@ -197,7 +197,20 @@ [% IF ( table_loo.header_fields ) %] [% FOREACH header_field IN table_loo.header_fields %] - [% header_field.field_label %] + [% SWITCH header_field.field_label -%] + [% CASE "Label Number" -%] + Label number + [% CASE "Summary" -%] + Summary + [% CASE "Item Type" %] + Item type + [% CASE "Barcode" %] + Barcode + [% CASE "Select" -%] + Select + [% CASE %] + [% header_field.field_label %] + [% END -%] [% END %] [% ELSE %] -- 1.7.9.5 From tomascohen at gmail.com Mon Jan 13 20:30:28 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Mon, 13 Jan 2014 16:30:28 -0300 Subject: [Koha-patches] [PATCH] Bug 11533: (regression test) QP breaks authority search Message-ID: <1389641428-25593-1-git-send-email-tomascohen@gmail.com> This patch duplicates the SearchAuthority tests, with QP enabled. Searching shouldn't be affected by QP. Instructions for manually reproducing this can be read in the first comment for the bug entry. Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- t/db_dependent/Search.t | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 2a7215d..d358e98 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -12,7 +12,7 @@ use YAML; use C4::Debug; require C4::Context; -use Test::More tests => 212; +use Test::More tests => 216; use Test::MockModule; use MARC::Record; use File::Spec; @@ -742,6 +742,20 @@ sub run_marc21_search_tests { ); is($count, 1, 'MARC21 authorities: one hit on match contains "???????"'); + $UseQueryParser = 1; + + ($auths, $count) = SearchAuthorities( + ['mainentry'], ['and'], [''], ['starts'], + ['shakespeare'], 0, 10, '', '', 1 + ); + is($count, 1, 'MARC21 authorities: one hit on mainentry starts with "shakespeare" (QP)'); + ($auths, $count) = SearchAuthorities( + ['match'], ['and'], [''], ['contains'], + ['???????'], 0, 10, '', '', 1 + ); + is($count, 1, 'MARC21 authorities: one hit on match contains "???????" (QP)'); + + cleanup(); } -- 1.8.3.2 From dcook at prosentient.com.au Tue Jan 14 00:12:44 2014 From: dcook at prosentient.com.au (David Cook) Date: Tue, 14 Jan 2014 10:12:44 +1100 Subject: [Koha-patches] [PATCH] bug 11537: Increasing test coverage for C4::Log Message-ID: <1389654764-24768-1-git-send-email-dcook@prosentient.com.au> From: alex_h To test: 1. run prove t/Log.t Notice 1 test is run 2. apply patch 3. run prove t/Log.t Notice 3 tests are run Signed-off-by: David Cook Works as described. I think there might be a typo in "Testing git log status". Should this read "Testing get log status"? (Noticed while looking at the code/running perl t/Log.t.) In any case, thanks for the patch. Looks good! --- t/Log.t | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/t/Log.t b/t/Log.t index eca6b9c..20b96a9 100755 --- a/t/Log.t +++ b/t/Log.t @@ -6,9 +6,12 @@ use strict; use warnings; -use Test::More tests => 1; +use Test::More tests => 3; BEGIN { use_ok('C4::Log'); } +ok( my $hash=GetLogStatus(),"Testing git log status"); + +ok( $hash->{BorrowersLog}, 'Testing hash is non empty'); -- 1.7.7.4 From oleonard at myacpl.org Tue Jan 14 14:53:22 2014 From: oleonard at myacpl.org (Owen Leonard) Date: Tue, 14 Jan 2014 08:53:22 -0500 Subject: [Koha-patches] [PATCH] Bug 11503 [Follow-up] Several typos Message-ID: <1389707602-24895-1-git-send-email-oleonard@myacpl.org> There is still a typo left to fix which I didn't catch because I was doing a spell-check and didn't double-check the bug report: Van der Griten -> Van der Grinten --- .../cataloguing/value_builder/unimarc_field_120.tt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_120.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_120.tt index cf9eca3..0afa7b5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_120.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_120.tt @@ -606,9 +606,9 @@ [% END %] [% IF ( f8df ) %] - + [% ELSE %] - + [% END %] [% IF ( f8dg ) %] -- 1.7.9.5 From tomascohen at gmail.com Tue Jan 14 15:53:15 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Tue, 14 Jan 2014 11:53:15 -0300 Subject: [Koha-patches] [PATCH] Bug 11540: (folowup) add a couple of tests more Message-ID: <1389711195-1680-1-git-send-email-tomascohen@gmail.com> This patch makes sure all scenarios are covered for SetUTF8Flag. Regards To+ --- t/Charset.t | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/t/Charset.t b/t/Charset.t index 8debbd7..27b2a32 100755 --- a/t/Charset.t +++ b/t/Charset.t @@ -1,9 +1,25 @@ #!/usr/bin/perl -use strict; -use warnings; +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Test::More tests => 10; +use MARC::Record; -use Test::More tests => 7; BEGIN { use_ok('C4::Charset'); } @@ -19,4 +35,24 @@ ok(!utf8::is_utf8($octets), "verify that IsStringUTF8ish does not magically turn $octets = "a\xc2" . "c"; ok(!IsStringUTF8ish($octets), "verify octets are not valid UTF-8"); -ok(!SetUTF8Flag(), 'Testing SetUTF8Flag' ); +ok( !SetUTF8Flag(), 'SetUTF8Flag returns undef if no record passed' ); + +my $record = MARC::Record->new(); +ok( !SetUTF8Flag($record), 'SetUTF8Flag returns undef if the record has no subfields' ); +# Add some fields/subfields +$record->append_fields( + MARC::Field->new('100', ' ', ' ', a => 'Julio Cortazar'), + MARC::Field->new('245', ' ', ' ', a => 'Rayuela'), +); +# Verify our data serves its purpose +ok( !utf8::is_utf8($record->subfield('100','a')) && + !utf8::is_utf8($record->subfield('245','a')), + 'Verify that the subfields are NOT set the UTF-8 flag yet' ); + +SetUTF8Flag($record); + +ok( utf8::is_utf8($record->subfield('100','a')) && + utf8::is_utf8($record->subfield('245','a')), + 'SetUTF8Flag sets the UTF-8 flag to all subfields' ); + +1; -- 1.8.3.2 From tomascohen at gmail.com Wed Jan 15 20:57:02 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Wed, 15 Jan 2014 16:57:02 -0300 Subject: [Koha-patches] [PATCH 1/2] Bug 9579: use String::Multibyte to correctly truncate facets Message-ID: <1389815823-8964-1-git-send-email-tomascohen@gmail.com> As Bernardo pointed on comment #17, the incorrect display of multibyte strings in facets is related to the way they are currently truncated. C4::Search::getRecords relies on CORE::substr for the task, which only counts bytes, and thus doesn't check it is breaking multi-byte characters. This patch replaces both the use of CORE::substr and CORE::length for their String::Multibyte counterpart. To test: - Set FacetLabelTruncationLength = 4 to make sure it will try to truncate the facet label. - Add a record with multiple multibyte characters in the author name (copy and paste '??' several times so it is looong). Note: make sure there are at least two records so you're presented the search results. - Reindex zebra to make it possible to search the record. - Search for the record. - Notice the facet with cyrillic characters is broken in the place it gets truncated. - Apply the patch and repeat the search. - Notice the string is not broken. - Sign off. Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- C4/Search.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 18a0f5f..edaa5de 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -36,6 +36,7 @@ use URI::Escape; use Business::ISBN; use MARC::Record; use MARC::Field; +use String::Multibyte; use utf8; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG); @@ -580,13 +581,13 @@ sub getRecords { # fix the length that will display in the label, my $facet_label_value = $one_facet; my $facet_max_length = C4::Context->preference( - 'FacetLabelTruncationLength') - || 20; - $facet_label_value = - substr( $one_facet, 0, $facet_max_length ) - . "..." - if length($facet_label_value) > - $facet_max_length; + 'FacetLabelTruncationLength') || 20; + my $mbsp = String::Multibyte->new('UTF8'); + if ($mbsp->length($facet_label_value) > $facet_max_length ) { + $facet_label_value = + $mbsp->substr( $one_facet, 0, $facet_max_length ) + . "..."; + } # if it's a branch, label by the name, not the code, if ( $link_value =~ /branch/ ) { -- 1.8.3.2 From tomascohen at gmail.com Wed Jan 15 20:57:03 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Wed, 15 Jan 2014 16:57:03 -0300 Subject: [Koha-patches] [PATCH 2/2] Bug 9579: (followup) add dependency for String::Multibyte In-Reply-To: <1389815823-8964-1-git-send-email-tomascohen@gmail.com> References: <1389815823-8964-1-git-send-email-tomascohen@gmail.com> Message-ID: <1389815823-8964-2-git-send-email-tomascohen@gmail.com> Just that. Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- C4/Installer/PerlDependencies.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm index 9b4b3b6..a539359 100644 --- a/C4/Installer/PerlDependencies.pm +++ b/C4/Installer/PerlDependencies.pm @@ -704,6 +704,11 @@ our $PERL_DEPS = { 'required' => '0', 'min_ver' => '0.73', }, + 'String::Multibyte' => { + 'usage' => 'Core', + 'required' => '1', + 'min_ver' => '1.10', + }, }; 1; -- 1.8.3.2 From oleonard at myacpl.org Thu Jan 16 17:26:26 2014 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 16 Jan 2014 11:26:26 -0500 Subject: [Koha-patches] [PATCH] Bug 11570 - Upgrade jQueryUI to latest version in the staff client Message-ID: The attached patch contained large lines and thus could not be sent with git-bz. -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Bug-11570-Upgrade-jQueryUI-to-latest-version-in-the-.patch Type: application/octet-stream Size: 513954 bytes Desc: not available URL: From dcook at prosentient.com.au Mon Jan 20 02:08:16 2014 From: dcook at prosentient.com.au (David Cook) Date: Mon, 20 Jan 2014 12:08:16 +1100 Subject: [Koha-patches] [PATCH] Bug 11575 - OPACBaseURL sometimes set by ENV variable and not system preference Message-ID: <1390180096-29017-1-git-send-email-dcook@prosentient.com.au> This patch changes how the OPACBaseURL parameter gets set in the subroutine get_template_and_user in Auth.pm. Currently, it's being set by the $ENV{'SERVER_NAME'} variable, which is typically filled by the URL that the user uses to access a page. While this works in many cases, this causes a problem when using a proxy server. The SERVER_NAME will instead be the domain of the proxy server (for more info, read the comments already on this bug on Bugzilla). There are ways to compensate for proxy servers. However, such a solution seems a bit convoluted... Elsewhere in Koha, we use the system preference OPACBaseURL, so I think it makes sense to use it here as well. I did leave the $ENV{'SERVER_NAME'} as a full back if OPACBaseURL isn't set, but that's it. _TEST PLAN_ Before applying: 1) Clear your OPACBaseURL preference 2) Perform a search in the OPAC 3) Click on or hover over the orange RSS icon 4) Note that the URL you used to access the site is the URL used for the RSS link 5) Add an OPACBaseURL that isn't the same as the actual OPAC URL 6) Note that the OPACBaseURL system preference has no effect here After applying the patch: 7) Refresh the page 8) Note that the URL you see now is actually the OPACBaseURL system preference that you set 9) Clear your OPACBaseURL system preference 10) Refresh your search page 11) Note that the URL has reverted back to the URL that you used to access the page --- C4/Auth.pm | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 44edf67..de00bad 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -387,6 +387,10 @@ sub get_template_and_user { } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) { $opac_name = C4::Context->userenv->{'branch'}; } + my $opac_base_url = C4::Context->preference("OPACBaseURL"); + if (!$opac_base_url){ + $opac_base_url = $ENV{'SERVER_NAME'} . ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"); + } $template->param( opaccolorstylesheet => C4::Context->preference("opaccolorstylesheet"), AnonSuggestions => "" . C4::Context->preference("AnonSuggestions"), @@ -407,8 +411,7 @@ sub get_template_and_user { OPACMobileUserCSS => "". C4::Context->preference("OPACMobileUserCSS"), OPACViewOthersSuggestions => "" . C4::Context->preference("OPACViewOthersSuggestions"), OpacAuthorities => C4::Context->preference("OpacAuthorities"), - OPACBaseURL => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} . - ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"), + OPACBaseURL => ($in->{'query'}->https() ? "https://" : "http://") . $opac_base_url, opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, opac_search_limit => $opac_search_limit, opac_limit_override => $opac_limit_override, -- 1.7.7.4 From juan.sieira at xercode.es Tue Jan 21 12:54:20 2014 From: juan.sieira at xercode.es (Juan Romay Sieira) Date: Tue, 21 Jan 2014 12:54:20 +0100 Subject: [Koha-patches] [PATCH] Bug 11441 - Ability to globally remove authorities with no bibliographic record linked. Message-ID: <1390305260-11623-1-git-send-email-juan.sieira@xercode.es> To test it: Parse only PERSO_NAME authorities: misc/migration_tools/remove_unused_authorities.pl -aut PERSO_NAME Parse all authorities: misc/migration_tools/remove_unused_authorities.pl --- misc/migration_tools/remove_unused_authorities.pl | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/misc/migration_tools/remove_unused_authorities.pl b/misc/migration_tools/remove_unused_authorities.pl index 7920923..5171538 100755 --- a/misc/migration_tools/remove_unused_authorities.pl +++ b/misc/migration_tools/remove_unused_authorities.pl @@ -46,16 +46,13 @@ if ($test) { } my $dbh=C4::Context->dbh; - at authtypes or @authtypes = qw( NC ); my $thresholdmin=0; my $thresholdmax=0; my @results; # prepare the request to retrieve all authorities of the requested types -my $rqselect = $dbh->prepare( - qq{SELECT * from auth_header where authtypecode IN (} - . join(",",map{$dbh->quote($_)}@authtypes) - . ")" -); +my $rqsql = "SELECT * from auth_header where 1"; +$rqsql .= " AND authtypecode IN (".join(",",map{$dbh->quote($_)}@authtypes).")" if @authtypes; +my $rqselect = $dbh->prepare($rqsql); $|=1; $rqselect->execute; @@ -89,7 +86,7 @@ sub print_usage { print <<_USAGE_; $0: Removes unused authorities. -This script will parse all authoritiestypes given as parameter, and remove authorities without any biblio attached. +This script will parse all authoritiestypes (or only those given as parameter), and remove authorities without any biblio attached. warning : there is no individual confirmation ! parameters --aut|authtypecode TYPE the list of authtypes to check -- 1.7.2.5 From tomascohen at gmail.com Wed Jan 22 15:32:50 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Wed, 22 Jan 2014 11:32:50 -0300 Subject: [Koha-patches] [PATCH] Bug 11596: Missing indexing options in koha-conf.xml should be reported Message-ID: <1390401170-21687-1-git-send-email-tomascohen@gmail.com> To test: - Have a clean master install - Verify that koha-conf.xml contains valid entries for: zebra_bib_index_mode and zebra_auth_index_mode - Go to More > About Koha > System information => No "Warnings regarding the system configuration" - Apply the patch - Go to More > About Koha > System information => No "Warnings regarding the system configuration" - Edit your koha-conf.xml file commenting one or both indexing mode entries. - Go to More > About Koha > System information => You get "XML configuration file" warnings for each commented entry. - Sign off :-D Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- about.pl | 15 +++++++++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/about.pl b/about.pl index 6b44ea8..e23e945 100755 --- a/about.pl +++ b/about.pl @@ -77,6 +77,20 @@ my $errZebraConnection = C4::Context->Zconn("biblioserver",0)->errcode(); my $warnIsRootUser = (! $loggedinuser); +my @xml_config_warnings; + +if ( ! defined C4::Context->config('zebra_bib_index_mode') ) { + push @xml_config_warnings, { + error => 'zebra_bib_index_mode_warn' + }; +} + +if ( ! defined C4::Context->config('zebra_auth_index_mode') ) { + push @xml_config_warnings, { + error => 'zebra_auth_index_mode_warn' + }; +} + $template->param( kohaVersion => $kohaVersion, osVersion => $osVersion, @@ -93,6 +107,7 @@ $template->param( warnPrefAnonymousPatron => $warnPrefAnonymousPatron, errZebraConnection => $errZebraConnection, warnIsRootUser => $warnIsRootUser, + xml_config_warnings => \@xml_config_warnings ); my @components = (); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 21db9d3..847047b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -117,6 +117,17 @@ Warning System preference 'OPACPrivacy' set, but AnonymousPatron preference is set to '0'. Set it to a valid borrower number if you want that this feature works correctly. [% END %] + [% ELSIF xml_config_warnings.size %] + + + [% FOREACH config_entry IN xml_config_warnings %] + [% IF config_entry.error == 'zebra_bib_index_mode_warn' %] + + [% ELSIF config_entry.error == 'zebra_auth_index_mode_warn' %] + + [% END %] + [% END %] +
      XML configuration file
      Warning The <zebra_bib_index_mode> entry is missing in your configuration file. It should be set to dom or grs1. It will default to grs1 but this could change in the future.
      Warning The <zebra_auth_index_mode> entry is missing in your configuration file. It should be set to dom or grs1. It will default to dom but this could change in the future.
      [% ELSE %]

      No warnings

      [% END %] -- 1.8.3.2 From tomascohen at gmail.com Wed Jan 22 15:46:54 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Wed, 22 Jan 2014 11:46:54 -0300 Subject: [Koha-patches] [PATCH] Bug 11096: fallback to the correct defaults if config entries missing Message-ID: <1390402014-21864-1-git-send-email-tomascohen@gmail.com> As of bug 7818 misc/migration_tools/rebuild_zebra.pl behaves like: - bib_index_mode (defaults to 'grs1' if not specified) - auth_index_mode (defaults to 'dom') we should do the same in C4::Context. So people having old config files have a seamless behaviour. Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- C4/Context.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index 746d24b..f58092d 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -730,12 +730,18 @@ sub _new_Zconn { my $tried=0; # first attempt my $Zconn; # connection object my $elementSetName; + my $index_mode; $server //= "biblioserver"; $syntax //= "XML"; - if ( ($server eq 'biblioserver' and $context->{'config'}->{'zebra_bib_index_mode'} eq 'grs1') - or ($server eq 'authorityserver' and $context->{'config'}->{'zebra_auth_index_mode'} eq 'grs1')) { + if ( $server eq 'biblioserver' ) { + $index_mode = $context->{'config'}->{'zebra_bib_index_mode'} // 'grs1'; + } elsif ( $server eq 'authorityserver' ) { + $index_mode = $context->{'config'}->{'zebra_auth_index_mode'} // 'dom'; + } + + if ( $index_mode eq 'grs1' ) { $elementSetName = 'F'; $syntax = ( $context->preference("marcflavour") eq 'UNIMARC' ) -- 1.8.3.2 From tomascohen at gmail.com Wed Jan 22 19:46:23 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Wed, 22 Jan 2014 15:46:23 -0300 Subject: [Koha-patches] [PATCH] Bug 9114: Make frameworks import/export routines correctly use UTF-8 Message-ID: <1390416383-28294-1-git-send-email-tomascohen@gmail.com> Currently both the import_export_framework.pl script outputs data with Perl's default encoding, ISO-8859. This patch properly sets the binmode to UTF-8 when exporting SQL and CSV files using the PerlIO layer (":encoding(UTF-8)") for STDOUT. To test: Export step test - Use some ASCII character(s) with DIACRITICS in some field description in a chosen framework. - Export the framework at Administration > MARC frameworks - Run this to check the file is ISO-8859 encoded: $ file export_XXX.csv export_XXX.csv: ISO-8859 text, with very long lines (Note: try SQL and other output formats too. But not ODS) - Apply the patch - Export the framework again (change the name), and test encoding: $ file export_XXX_2.csv export_XXX_2.csv: UTF-8 Unicode text Import step test I assume you have two files, export_XXX.csv (ISO-8859 encoded) and export_XXX_2.csv (XXX will depend on your framework's code) - Reset your testing branch to master - Import export_XXX.csv - The string with non-ASCII chars is truncated at the first non-ASCII char's position (Note: this is the current behaviour). - Import export_XXX_2.csv - The non-ASCII chars are broken, the logs show errors on non-UNICODE chars. (Note: even thou UTF-8 is the expected encoding it is treated as ISO-8859). - Apply the patch - Import the good (UTF-8 as expected) file and check everything worked as expected. No double encoding should occur with either combination of formats. Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- admin/import_export_framework.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/admin/import_export_framework.pl b/admin/import_export_framework.pl index 8674ebf..8f8bd7c 100755 --- a/admin/import_export_framework.pl +++ b/admin/import_export_framework.pl @@ -34,6 +34,13 @@ if ($action eq 'export' && $input->request_method() eq 'GET') { my $strXml = ''; my $format = $input->param('type_export_' . $frameworkcode); ExportFramework($frameworkcode, \$strXml, $format); + + # Correctly set the encoding to output plain text in UTF-8 + if ( $format eq 'csv' || + $format eq 'sql' ) { + binmode(STDOUT,':encoding(UTF-8)'); + } + if ($format eq 'csv') { # CSV file print $input->header(-type => 'application/vnd.ms-excel', -attachment => 'export_' . $frameworkcode . '.csv'); -- 1.8.3.2 From nengard at bywatersolutions.com Fri Jan 24 15:36:18 2014 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Fri, 24 Jan 2014 08:36:18 -0600 Subject: [Koha-patches] [PATCH] [Bug 11608] Remove the word 'library' from funds list Message-ID: <1390574178-1756-1-git-send-email-nengard@bywatersolutions.com> The list of funds on the main acq page shows the library's name followed by the word 'library'. I don't think this word is necessary as most libraries have the word 'library' in their names. Even if they don't they probably just want their library name to show without extra words. To test: * Visit the acquisitions module before applying * See the library's name + 'library' above the funds list * Apply patch * Look again at funds list and 'library' should be gone --- .../prog/en/modules/acqui/acqui-home.tt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt index 4fabffe..c275bf8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt @@ -98,7 +98,7 @@ $(document).ready(function() { [% IF ( loop_budget ) %] -

      All available funds[% IF ( branchname ) %] for [% branchname %] library[% END %]

      +

      All available funds[% IF ( branchname ) %] for [% branchname %] [% END %]

      -- 1.7.2.3 From tomascohen at gmail.com Fri Jan 24 16:31:17 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Fri, 24 Jan 2014 12:31:17 -0300 Subject: [Koha-patches] [PATCH] Bug 10580: Zebra no more optional in Koha setup Message-ID: <1390577477-1069-1-git-send-email-tomascohen@gmail.com> Running Makefile.PL asks the user whether to install the Zebra configuration files and different texts relate to the user having chosen to use Zebra. This patch removes references to choosing to use Zebra and removes the related variables from the code. To test: - Apply the patch - Go through the different install modes - Verify that nothing nothing is broken - Sign off Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- Makefile.PL | 233 +++++++++++++++++++++++++----------------------------- rewrite-config.PL | 1 - 2 files changed, 107 insertions(+), 127 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 66f9a0f..1a3eb3c 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -379,11 +379,6 @@ Name of DBMS user account for Koha's database. Pasword of DMBS user account for Koha's database. -=item INSTALL_ZEBRA - -Whether to install Zebra configuration files and data -directories. - =item ZEBRA_MARC_FORMAT Specifies format of MARC records to be indexed by Zebra. @@ -420,7 +415,6 @@ my %config_defaults = ( 'DB_NAME' => 'koha', 'DB_USER' => 'kohaadmin', 'DB_PASS' => 'katikoan', - 'INSTALL_ZEBRA' => 'yes', 'INSTALL_SRU' => 'yes', 'INSTALL_PAZPAR2' => 'no', 'AUTH_INDEX_MODE' => 'dom', @@ -474,7 +468,6 @@ else { my %valid_config_values = ( 'INSTALL_MODE' => { 'standard' => 1, 'single' => 1, 'dev' => 1 }, 'DB_TYPE' => { 'mysql' => 1, 'Pg' => 1 }, - 'INSTALL_ZEBRA' => { 'yes' => 1, 'no' => 1 }, 'INSTALL_SRU' => { 'yes' => 1, 'no' => 1 }, 'AUTH_INDEX_MODE' => { 'grs1' => 1, 'dom' => 1 }, 'BIB_INDEX_MODE' => { 'grs1' => 1, 'dom' => 1 }, @@ -501,7 +494,7 @@ my %config = get_configuration(\%config_defaults, \%valid_config_values, \%insta my ($target_directories, $skip_directories) = get_target_directories(\%config); display_configuration(\%config, $target_directories); my $file_map = {}; -get_file_map($target_map, $dirtree, $file_map, $config{'INSTALL_ZEBRA'} eq "yes" ? 1: 0); +get_file_map($target_map, $dirtree, $file_map); my $pl_files = { 'rewrite-config.PL' => [ @@ -515,38 +508,43 @@ my $pl_files = { ], }; -if ($config{'INSTALL_ZEBRA'} eq "yes") { - push @{ $pl_files->{'rewrite-config.PL'} }, ( - 'blib/ZEBRA_CONF_DIR/etc/passwd', - 'blib/ZEBRA_CONF_DIR/zebra-biblios.cfg', - 'blib/ZEBRA_CONF_DIR/zebra-biblios-dom.cfg', - 'blib/ZEBRA_CONF_DIR/zebra-authorities.cfg', - 'blib/ZEBRA_CONF_DIR/zebra-authorities-dom.cfg', - 'blib/ZEBRA_CONF_DIR/explain-authorities.xml', - 'blib/ZEBRA_CONF_DIR/explain-biblios.xml', - 'blib/ZEBRA_CONF_DIR/retrieval-info-auth-grs1.xml', - 'blib/ZEBRA_CONF_DIR/retrieval-info-auth-dom.xml', - 'blib/ZEBRA_CONF_DIR/retrieval-info-bib-grs1.xml', - 'blib/ZEBRA_CONF_DIR/retrieval-info-bib-dom.xml', - ); +push @{ $pl_files->{'rewrite-config.PL'} }, ( + 'blib/ZEBRA_CONF_DIR/etc/passwd', + 'blib/ZEBRA_CONF_DIR/zebra-biblios.cfg', + 'blib/ZEBRA_CONF_DIR/zebra-biblios-dom.cfg', + 'blib/ZEBRA_CONF_DIR/zebra-authorities.cfg', + 'blib/ZEBRA_CONF_DIR/zebra-authorities-dom.cfg', + 'blib/ZEBRA_CONF_DIR/explain-authorities.xml', + 'blib/ZEBRA_CONF_DIR/explain-biblios.xml', + 'blib/ZEBRA_CONF_DIR/retrieval-info-auth-grs1.xml', + 'blib/ZEBRA_CONF_DIR/retrieval-info-auth-dom.xml', + 'blib/ZEBRA_CONF_DIR/retrieval-info-bib-grs1.xml', + 'blib/ZEBRA_CONF_DIR/retrieval-info-bib-dom.xml', +); +push @{ $pl_files->{'rewrite-config.PL'} }, ( + 'blib/SCRIPT_DIR/koha-zebra-ctl.sh', + 'blib/SCRIPT_DIR/koha-pazpar2-ctl.sh', + 'blib/SCRIPT_DIR/koha-index-daemon-ctl.sh', +); +if ($config{'INSTALL_PAZPAR2'} eq 'yes') { push @{ $pl_files->{'rewrite-config.PL'} }, ( - 'blib/SCRIPT_DIR/koha-zebra-ctl.sh', - 'blib/SCRIPT_DIR/koha-pazpar2-ctl.sh', - 'blib/SCRIPT_DIR/koha-index-daemon-ctl.sh', + 'blib/PAZPAR2_CONF_DIR/koha-biblios.xml', + 'blib/PAZPAR2_CONF_DIR/pazpar2.xml' ); - if ($config{'INSTALL_PAZPAR2'} eq 'yes') { - push @{ $pl_files->{'rewrite-config.PL'} }, ( - 'blib/PAZPAR2_CONF_DIR/koha-biblios.xml', - 'blib/PAZPAR2_CONF_DIR/pazpar2.xml' - ); - } - $config{'ZEBRA_AUTH_CFG'} = $config{'AUTH_INDEX_MODE'} eq 'dom' ? 'zebra-authorities-dom.cfg' : 'zebra-authorities.cfg'; - $config{'ZEBRA_BIB_CFG'} = $config{'BIB_INDEX_MODE'} eq 'dom' ? 'zebra-biblios-dom.cfg' : 'zebra-biblios.cfg'; - $config{'AUTH_RETRIEVAL_CFG'} = - $config{'AUTH_INDEX_MODE'} eq 'dom' ? 'retrieval-info-auth-dom.xml' : 'retrieval-info-auth-grs1.xml'; - $config{'BIB_RETRIEVAL_CFG'} = - $config{'BIB_INDEX_MODE'} eq 'dom' ? 'retrieval-info-bib-dom.xml' : 'retrieval-info-bib-grs1.xml'; } +$config{'ZEBRA_AUTH_CFG'} = $config{'AUTH_INDEX_MODE'} eq 'dom' + ? 'zebra-authorities-dom.cfg' + : 'zebra-authorities.cfg'; +$config{'ZEBRA_BIB_CFG'} = $config{'BIB_INDEX_MODE'} eq 'dom' + ? 'zebra-biblios-dom.cfg' + : 'zebra-biblios.cfg'; +$config{'AUTH_RETRIEVAL_CFG'} = $config{'AUTH_INDEX_MODE'} eq 'dom' + ? 'retrieval-info-auth-dom.xml' + : 'retrieval-info-auth-grs1.xml'; +$config{'BIB_RETRIEVAL_CFG'} = $config{'BIB_INDEX_MODE'} eq 'dom' + ? 'retrieval-info-bib-dom.xml' + : 'retrieval-info-bib-grs1.xml'; + if ($config{'INSTALL_MODE'} ne "dev") { push @{ $pl_files->{'rewrite-config.PL'} }, ( @@ -630,7 +628,6 @@ sub get_file_map { my $target_map = shift; my $dirtree = shift; my $file_map = shift; - my $install_zebra = shift; my $curr_path = @_ ? shift : ['.']; # Traverse the directory tree. @@ -661,7 +658,7 @@ sub get_file_map { } } if (defined $targetdir) { - _add_to_file_map($file_map, $targetdir, $curr_path, $file, $matchlevel, $install_zebra); + _add_to_file_map($file_map, $targetdir, $curr_path, $file, $matchlevel); } else { my $path = join("/", @$curr_path); print "failed to map: $path/$file\n" if $DEBUG; @@ -670,7 +667,7 @@ sub get_file_map { } else { # dealing with subdirectory push @$curr_path, $dir; - get_file_map($target_map, $dirtree->{$dir}, $file_map, $install_zebra, $curr_path); + get_file_map($target_map, $dirtree->{$dir}, $file_map, $curr_path); pop @$curr_path; } } @@ -682,7 +679,6 @@ sub _add_to_file_map { my $curr_path = shift; my $file = shift; my $matchlevel = shift; - my $install_zebra = shift; my $dest_path = @_ ? shift : $curr_path; # The target can be one of the following: @@ -709,12 +705,12 @@ sub _add_to_file_map { } else { splice @new_dest_path, 0, $targetdir->{trimdir}; } - _add_to_file_map($file_map, $subtarget, $curr_path, $file, $matchlevel, $install_zebra, \@new_dest_path); + _add_to_file_map($file_map, $subtarget, $curr_path, $file, $matchlevel, \@new_dest_path); } else { # actually getting here means that the # target was unnecessarily listed # as a hash, but we'll forgive that - _add_to_file_map($file_map, $subtarget, $curr_path, $file, $matchlevel, $install_zebra); + _add_to_file_map($file_map, $subtarget, $curr_path, $file, $matchlevel); } } elsif ($targetdir ne 'NONE' and $targetdir ne '') { my $source = File::Spec->catfile(@$curr_path, $file); @@ -728,7 +724,7 @@ sub _add_to_file_map { $source =~ s/ /\\ /g; $destination =~ s/ /\\ /g; - $file_map->{$source} = $destination unless (!$install_zebra and $targetdir =~ /ZEBRA/); + $file_map->{$source} = $destination; } } @@ -914,58 +910,46 @@ Please specify the password of the user that owns the database to be used by Koha); $config{'DB_PASS'} = _get_value('DB_PASS', $msg, $defaults->{'DB_PASS'}, $valid_values, $install_log_values); - $msg = q( -Koha can use the Zebra search engine for high-performance + print q( +Koha uses the Zebra search engine for high-performance searching of bibliographic and authority records. If you -have installed the Zebra software and would like to use it, -please answer 'yes' to the following question. Otherwise, -Koha will default to using its internal search engine. - -Please note that if you choose *NOT* to install Zebra, -koha-conf.xml will still contain some references to Zebra -settings. Those references will be ignored by Koha. - -Install the Zebra configuration files?); - $msg .= _add_valid_values_disp('INSTALL_ZEBRA', $valid_values); - $config{'INSTALL_ZEBRA'} = _get_value('INSTALL_ZEBRA', $msg, $defaults->{'INSTALL_ZEBRA'}, $valid_values, $install_log_values); - - if ($config{'INSTALL_ZEBRA'} eq 'yes') { +have installed the Zebra software +); - if (defined(my $zebra_path = find_zebra())) { - $config{'PATH_TO_ZEBRA'} = $zebra_path; - print qq( + if (defined(my $zebra_path = find_zebra())) { + $config{'PATH_TO_ZEBRA'} = $zebra_path; + print qq( Found 'zebrasrv' and 'zebraidx' in $zebra_path. ); - } else { - print q( + } else { + print q( Unable to find the Zebra programs 'zebrasrv' and 'zebraidx' in your PATH or in some of the usual places. If you haven't installed Zebra yet, please do so and run Makefile.PL again. ); - } + } - $msg = q( -Since you've chosen to use Zebra with Koha, -you must specify the primary MARC format of the + $msg = q( +You must specify the primary MARC format of the records to be indexed by Zebra. Koha provides Zebra configuration files for MARC21, NORMARC and UNIMARC. MARC format for Zebra indexing); - $msg .= _add_valid_values_disp('ZEBRA_MARC_FORMAT', $valid_values); - $config{'ZEBRA_MARC_FORMAT'} = _get_value('ZEBRA_MARC_FORMAT', $msg, $defaults->{'ZEBRA_MARC_FORMAT'}, $valid_values, $install_log_values); - $msg = q( + $msg .= _add_valid_values_disp('ZEBRA_MARC_FORMAT', $valid_values); + $config{'ZEBRA_MARC_FORMAT'} = _get_value('ZEBRA_MARC_FORMAT', $msg, $defaults->{'ZEBRA_MARC_FORMAT'}, $valid_values, $install_log_values); + $msg = q( Koha supplies Zebra configuration files tuned for searching either English (en) or French (fr) MARC records. Primary language for Zebra indexing); - $msg .= _add_valid_values_disp('ZEBRA_LANGUAGE', $valid_values); - $config{'ZEBRA_LANGUAGE'} = _get_value('ZEBRA_LANGUAGE', $msg, $defaults->{'ZEBRA_LANGUAGE'}, $valid_values, $install_log_values); + $msg .= _add_valid_values_disp('ZEBRA_LANGUAGE', $valid_values); + $config{'ZEBRA_LANGUAGE'} = _get_value('ZEBRA_LANGUAGE', $msg, $defaults->{'ZEBRA_LANGUAGE'}, $valid_values, $install_log_values); - $msg = q( + $msg = q( Koha can use one of two different indexing modes for the MARC bibliographic records: @@ -975,11 +959,11 @@ dom - uses the DOM XML filter; offers improved functionality. Bibliographic indexing mode); - $msg .= _add_valid_values_disp('BIB_INDEX_MODE', $valid_values); - $config{'BIB_INDEX_MODE'} = _get_value('BIB_INDEX_MODE', $msg, $defaults->{'BIB_INDEX_MODE'}, $valid_values, $install_log_values); + $msg .= _add_valid_values_disp('BIB_INDEX_MODE', $valid_values); + $config{'BIB_INDEX_MODE'} = _get_value('BIB_INDEX_MODE', $msg, $defaults->{'BIB_INDEX_MODE'}, $valid_values, $install_log_values); - $msg = q( + $msg = q( Koha can use one of two different indexing modes for the MARC authorities records: @@ -989,27 +973,27 @@ dom - uses the DOM XML filter; offers improved functionality. Authorities indexing mode); - $msg .= _add_valid_values_disp('AUTH_INDEX_MODE', $valid_values); - $config{'AUTH_INDEX_MODE'} = _get_value('AUTH_INDEX_MODE', $msg, $defaults->{'AUTH_INDEX_MODE'}, $valid_values, $install_log_values); + $msg .= _add_valid_values_disp('AUTH_INDEX_MODE', $valid_values); + $config{'AUTH_INDEX_MODE'} = _get_value('AUTH_INDEX_MODE', $msg, $defaults->{'AUTH_INDEX_MODE'}, $valid_values, $install_log_values); - $msg = q( + $msg = q( Zebra has two methods to perform records tokenization and characters normalization: CHR and ICU. ICU is recommended for catalogs containing non-Latin characters.); - $msg .= _add_valid_values_disp('ZEBRA_TOKENIZER', $valid_values); - $config{'ZEBRA_TOKENIZER'} = _get_value('ZEBRA_TOKENIZER', $msg, $defaults->{'ZEBRA_TOKENIZER'}, $valid_values, $install_log_values); + $msg .= _add_valid_values_disp('ZEBRA_TOKENIZER', $valid_values); + $config{'ZEBRA_TOKENIZER'} = _get_value('ZEBRA_TOKENIZER', $msg, $defaults->{'ZEBRA_TOKENIZER'}, $valid_values, $install_log_values); - $msg = q( + $msg = q( Please specify Zebra database user); - $config{'ZEBRA_USER'} = _get_value('ZEBRA_USER', $msg, $defaults->{'ZEBRA_USER'}, $valid_values, $install_log_values); + $config{'ZEBRA_USER'} = _get_value('ZEBRA_USER', $msg, $defaults->{'ZEBRA_USER'}, $valid_values, $install_log_values); - $msg = q( + $msg = q( Please specify the Zebra database password); - $config{'ZEBRA_PASS'} = _get_value('ZEBRA_PASS', $msg, $defaults->{'ZEBRA_PASS'}, $valid_values, $install_log_values); + $config{'ZEBRA_PASS'} = _get_value('ZEBRA_PASS', $msg, $defaults->{'ZEBRA_PASS'}, $valid_values, $install_log_values); - $msg = q( + $msg = q( Since you've chosen to use Zebra, you can enable the SRU/ Z39.50 Server if you so choose, but you must specify a few configuration options for it. @@ -1019,64 +1003,64 @@ koha-conf.xml will still contain some references to SRU settings. Those references will be ignored by Koha. Install the SRU configuration files?); - $msg .= _add_valid_values_disp('INSTALL_SRU', $valid_values); - $config{'INSTALL_SRU'} = _get_value('INSTALL_SRU', $msg, $defaults->{'INSTALL_SRU'}, $valid_values, $install_log_values); + $msg .= _add_valid_values_disp('INSTALL_SRU', $valid_values); + $config{'INSTALL_SRU'} = _get_value('INSTALL_SRU', $msg, $defaults->{'INSTALL_SRU'}, $valid_values, $install_log_values); - if ($config{'INSTALL_SRU'} eq 'yes') { - $msg = q( + if ($config{'INSTALL_SRU'} eq 'yes') { + $msg = q( Since you've chosen to configure SRU, you must specify the host and port(s) that the SRU Servers (bibliographic and authority) should run on. ); - $msg = q( + $msg = q( SRU Database host?); - $config{'ZEBRA_SRU_HOST'} = _get_value('ZEBRA_SRU_HOST', $msg, $defaults->{'ZEBRA_SRU_HOST'}, $valid_values, $install_log_values); + $config{'ZEBRA_SRU_HOST'} = _get_value('ZEBRA_SRU_HOST', $msg, $defaults->{'ZEBRA_SRU_HOST'}, $valid_values, $install_log_values); - $msg = q( + $msg = q( SRU port for bibliographic data?); - $config{'ZEBRA_SRU_BIBLIOS_PORT'} = _get_value('ZEBRA_SRU_BIBLIOS_PORT', $msg, $defaults->{'ZEBRA_SRU_BIBLIOS_PORT'}, $valid_values, $install_log_values); + $config{'ZEBRA_SRU_BIBLIOS_PORT'} = _get_value('ZEBRA_SRU_BIBLIOS_PORT', $msg, $defaults->{'ZEBRA_SRU_BIBLIOS_PORT'}, $valid_values, $install_log_values); - $msg = q( + $msg = q( SRU port for authority data?); - $config{'ZEBRA_SRU_AUTHORITIES_PORT'} = _get_value('ZEBRA_SRU_AUTHORITIES_PORT', $msg, $defaults->{'ZEBRA_SRU_AUTHORITIES_PORT'}, $valid_values, $install_log_values); + $config{'ZEBRA_SRU_AUTHORITIES_PORT'} = _get_value('ZEBRA_SRU_AUTHORITIES_PORT', $msg, $defaults->{'ZEBRA_SRU_AUTHORITIES_PORT'}, $valid_values, $install_log_values); - } + } - $msg = q( -Since you've chosen to use Zebra, you can also choose to -install PazPar2, which is a metasearch tool. With PazPar2, + $msg = q( +Along with Zebra, you can also choose to install PazPar2, +which is a metasearch tool. With PazPar2, Koha can perform on-the-fly merging of bibliographic records during searching, allowing for FRBRization of the results list. Install the PazPar2 configuration files?); - $msg .= _add_valid_values_disp('INSTALL_PAZPAR2', $valid_values); - $config{'INSTALL_PAZPAR2'} = _get_value('INSTALL_PAZPAR2', $msg, $defaults->{'INSTALL_PAZPAR2'}, $valid_values, $install_log_values); + $msg .= _add_valid_values_disp('INSTALL_PAZPAR2', $valid_values); + $config{'INSTALL_PAZPAR2'} = _get_value('INSTALL_PAZPAR2', $msg, $defaults->{'INSTALL_PAZPAR2'}, $valid_values, $install_log_values); - if ($config{'INSTALL_PAZPAR2'} eq 'yes') { - $msg = q( + if ($config{'INSTALL_PAZPAR2'} eq 'yes') { + $msg = q( Since you've chosen to configure PazPar2, you must specify the host and port(s) that PazPar2 uses: ); - $msg = q( + $msg = q( Zebra bibliographic server host?); - $config{'MERGE_SERVER_HOST'} = _get_value('MERGE_SERVER_HOST', $msg, $defaults->{'MERGE_SERVER_HOST'}, $valid_values, $install_log_values); + $config{'MERGE_SERVER_HOST'} = _get_value('MERGE_SERVER_HOST', $msg, $defaults->{'MERGE_SERVER_HOST'}, $valid_values, $install_log_values); - $msg = q( + $msg = q( Zebra bibliographic port for PazPar2 to use?); - $config{'MERGE_SERVER_PORT'} = _get_value('MERGE_SERVER_PORT', $msg, $defaults->{'MERGE_SERVER_PORT'}, $valid_values, $install_log_values); + $config{'MERGE_SERVER_PORT'} = _get_value('MERGE_SERVER_PORT', $msg, $defaults->{'MERGE_SERVER_PORT'}, $valid_values, $install_log_values); - $msg = q( + $msg = q( PazPar2 host?); - $config{'PAZPAR2_HOST'} = _get_value('PAZPAR2_HOST', $msg, $defaults->{'PAZPAR2_HOST'}, $valid_values, $install_log_values); + $config{'PAZPAR2_HOST'} = _get_value('PAZPAR2_HOST', $msg, $defaults->{'PAZPAR2_HOST'}, $valid_values, $install_log_values); - $msg = q( + $msg = q( PazPar2 port?); - $config{'PAZPAR2_PORT'} = _get_value('PAZPAR2_PORT', $msg, $defaults->{'PAZPAR2_PORT'}, $valid_values, $install_log_values); + $config{'PAZPAR2_PORT'} = _get_value('PAZPAR2_PORT', $msg, $defaults->{'PAZPAR2_PORT'}, $valid_values, $install_log_values); - } } + $msg = q( Use memcached and memoize to cache the results of some function calls? This provides a signficant performance improvement. @@ -1450,7 +1434,7 @@ sub install { $install .= qq( KOHA_INST_$key = blib/$key KOHA_DEST_$key = $target_directories->{$key} -) unless ($config{'INSTALL_ZEBRA'} ne "yes" and $key =~ /ZEBRA/) or exists $skip_directories->{$key}; +) unless exists $skip_directories->{$key}; } $install .= qq( install :: all install_koha set_koha_ownership set_koha_permissions warn_koha_env_vars @@ -1460,7 +1444,7 @@ install :: all install_koha set_koha_ownership set_koha_permissions warn_koha_en $install .= "\t\$(NOECHO) umask 022; \$(MOD_INSTALL) \\\n"; foreach my $key (sort keys %$target_directories) { $install .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n" - unless ($config{'INSTALL_ZEBRA'} ne "yes" and $key =~ /ZEBRA/) or exists $skip_directories->{$key}; + unless exists $skip_directories->{$key}; } $install .= "\t\t\$(INST_MAN1DIR) \$(DESTINSTALLMAN1DIR) \\\n"; $install .= "\t\t\$(INST_MAN3DIR) \$(DESTINSTALLMAN3DIR)\n"; @@ -1470,8 +1454,8 @@ install :: all install_koha set_koha_ownership set_koha_permissions warn_koha_en # Do not try to change ownership if DESTDIR is set if ($config{'INSTALL_MODE'} eq 'standard' and $config{'KOHA_USER'} ne "root") { foreach my $key (sort keys %$target_directories) { - $install .= "\t\$(NOECHO) if test -z \"\$(DESTDIR)\"; then chown -R $config{'KOHA_USER'}:$config{'KOHA_GROUP'} \$(KOHA_DEST_$key); fi\n" - unless ($config{'INSTALL_ZEBRA'} ne "yes" and $key =~ /ZEBRA/) or exists $skip_directories->{$key}; + $install .= "\t\$(NOECHO) if test -z \"\$(DESTDIR)\"; then chown -R $config{'KOHA_USER'}:$config{'KOHA_GROUP'} \$(KOHA_DEST_$key); fi\n" + unless exists $skip_directories->{$key}; } } else { $install .= "\t\t\$(NOECHO) \$(NOOP)\n\n"; @@ -1484,7 +1468,7 @@ install :: all install_koha set_koha_ownership set_koha_permissions warn_koha_en # of Koha's files to have write permission by default. foreach my $key (sort keys %$target_directories) { $install .= "\t\$(NOECHO) chmod -R u+w \$(KOHA_DEST_$key)\n" - unless ($config{'INSTALL_ZEBRA'} ne "yes" and $key =~ /ZEBRA/) or exists $skip_directories->{$key}; + unless exists $skip_directories->{$key}; } } elsif ($^O eq 'MSWin32' ) { # On Win32, the install probably needs to be done under the user account koha will be running as... @@ -1494,7 +1478,7 @@ install :: all install_koha set_koha_ownership set_koha_permissions warn_koha_en $install .= qq( KOHA_INST_$key = blib/$key KOHA_DEST_$key = $target_directories->{$key} -) unless ($config{'INSTALL_ZEBRA'} ne "yes" and $key =~ /ZEBRA/) or exists $skip_directories->{$key}; +) unless exists $skip_directories->{$key}; } $install .= qq( install :: all install_koha warn_koha_env_vars @@ -1504,7 +1488,7 @@ install :: all install_koha warn_koha_env_vars $install .= "\t\$(MOD_INSTALL) \\\n"; foreach my $key (sort keys %$target_directories) { $install .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n" - unless ($config{'INSTALL_ZEBRA'} ne "yes" and $key =~ /ZEBRA/) or exists $skip_directories->{$key}; + unless exists $skip_directories->{$key}; } } $install .= "\n"; @@ -1522,9 +1506,7 @@ install :: all install_koha warn_koha_env_vars $install .= "\t\$(NOECHO) \$(ECHO) For other post-installation tasks, please consult the README.\n"; $install .= "\t\$(NOECHO) \$(ECHO)\n"; - if ($config{'INSTALL_ZEBRA'} eq "yes") { - $install .= _update_zebra_conf_target(); - } + $install .= _update_zebra_conf_target(); $install .= upgrade(); @@ -1574,8 +1556,7 @@ make_upgrade_backup :: foreach my $key (qw/KOHA_CONF_DIR INTRANET_TMPL_DIR INTRANET_WWW_DIR OPAC_TMPL_DIR OPAC_WWW_DIR PAZPAR2_CONF_DIR ZEBRA_CONF_DIR PLUGINS_DIR/) { $upgrade .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n" - unless ($config{'INSTALL_ZEBRA'} ne "yes" and $key =~ /ZEBRA/) or - exists $skip_directories->{$key} or + unless exists $skip_directories->{$key} or not exists $target_directories->{$key}; } $upgrade =~ s/\\\n$/\n/; diff --git a/rewrite-config.PL b/rewrite-config.PL index e903d49..ea69c94 100644 --- a/rewrite-config.PL +++ b/rewrite-config.PL @@ -134,7 +134,6 @@ $prefix = $ENV{'INSTALL_BASE'} || "/usr"; "__PAZPAR2_PORT__" => '11002', "__INSTALL_MODE__" => 'standard', "__INSTALL_BASE__" => '/usr/share/koha', - "__INSTALL_ZEBRA__" => 'yes', "__INSTALL_SRU__" => 'yes', "__INSTALL_PAZPAR2__" => 'no', "__PAZPAR2_TOGGLE_XML_PRE__" => ' +
      +
      Select items you want to check
      1. @@ -184,6 +188,8 @@ $(document).ready(function(){
      + +
      -- 1.7.2.3 From oleonard at myacpl.org Mon Jan 27 17:48:38 2014 From: oleonard at myacpl.org (Owen Leonard) Date: Mon, 27 Jan 2014 11:48:38 -0500 Subject: [Koha-patches] [PATCH] Bug 11618 - jQuery timepicker is not picked up by the i18n toolchain Message-ID: The attached patch contained large lines and thus could not be sent with git-bz. -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Bug-11618-jQuery-timepicker-is-not-picked-up-by-the-.patch Type: application/octet-stream Size: 113764 bytes Desc: not available URL: From oleonard at myacpl.org Wed Jan 29 18:31:11 2014 From: oleonard at myacpl.org (Owen Leonard) Date: Wed, 29 Jan 2014 12:31:11 -0500 Subject: [Koha-patches] [PATCH] Bug 11636 - Impossible to remove patrons from patron list during add process Message-ID: <1391016671-1464-1-git-send-email-oleonard@myacpl.org> If you patrons have card numbers with leading zeroes this causes problems removing patron entries during the process of adding patrons to an existing list. This patch refactors the relevant JavaScript to correct the problem and to remove inline "onclick" from generated HTML. This patch also includes a fix for Bug 11632 - Untranslatable string "Remove" in patron lists. To test: 1. If necessary, create or modify a patron to have a card number with leading zeroes. 2. Go to Tools -> Patron lists. 3. Click "Add patrons" on an existing list. 4. Perform a patron search and choose one of the results. 5. Click the "remove" link next to the patron name which was just added. Nothing will happen. 6. Apply the patch and test again. The "remove" link should now work. To test the fix for Bug 11632, after applying the patch run "translate update [language code]" and confirm that the "Remove" string is listed in the updated po file for patron_lists/list.tt. --- .../prog/en/modules/patron_lists/list.tt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt index b0717dd..fa30be5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt @@ -27,10 +27,17 @@ $(document).ready(function() { .append( "" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "" ) .appendTo( ul ); }; + + $("body").on("click",".removePatron",function(e){ + e.preventDefault(); + var divid = $(this).parent().attr("id"); + var cardnumber = divid.replace("borrower_",""); + RemovePatron(cardnumber); + }); }); function AddPatron( name, cardnumber ) { - div = "
      " + name + " ( Remove )
      "; + div = "
      " + name + " ( " + _("Remove") + " )
      "; $('#patrons_to_add').append( div ); $('#find_patron').val('').focus(); -- 1.7.9.5 From oleonard at myacpl.org Wed Jan 29 20:41:00 2014 From: oleonard at myacpl.org (Owen Leonard) Date: Wed, 29 Jan 2014 14:41:00 -0500 Subject: [Koha-patches] [PATCH] Bug 11534 - impossible to remove instructors on course reserve Message-ID: <1391024460-3011-1-git-send-email-oleonard@myacpl.org> In some cases clicking the "remove" link to remove a course instructor when editing a course reserves course doesn't work. I suspect this is caused by leading zeroes in the card number. This patch refactors the relevant function to fix the problem and to remove inline JavaScript from generated markup. Other changes: - Make the "Remove" text translatable - Re-order the first name and last name when added by JavaScript to match the template's "surname, firstname" order. To test: 1. If necessary, create or modify a patron to have a card number with leading zeroes. 2. Go to Course reserves and add or edit a course. 3. If you are editing a course and there are existing instructors, click the "remove" link. Nothing will happen. 4. Perform a patron search and choose one of the results. The name should be added to the list of instructors in the format "surname, firstname." 5. Click the "remove" link next to the patron name which was just added. Nothing will happen. 6. Apply the patch and repeat step 4. The "remove" link should work. 7. Add an instructor and save the course reserve. Repeat steps 2 and 3. The "remove" link should now work. To test the translation fix, after applying the patch run "translate update [language code]" and confirm that the "Remove" string is listed in the updated po file for course_reserves/course.tt. --- .../prog/en/modules/course_reserves/course.tt | 31 +++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt index 1f5aca8..b9daa0a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt @@ -43,7 +43,7 @@ source: "/cgi-bin/koha/circ/ysearch.pl", minLength: 3, select: function( event, ui ) { - AddInstructor( ui.item.firstname + " " + ui.item.surname, ui.item.cardnumber ); + AddInstructor( ui.item.surname + ", " + ui.item.firstname, ui.item.cardnumber ); return false; } }) @@ -54,17 +54,32 @@ .appendTo( ul ); }; + if ( ! $('#instructors').html() ) { + $('#course_instructors').hide(); + } + + $("body").on("click",".removeInstructor",function(e){ + e.preventDefault(); + var divid = $(this).parent().attr("id"); + var cardnumber = divid.replace("borrower_",""); + RemoveInstructor(cardnumber); + }); }); function AddInstructor( name, cardnumber ) { - div = "
      " + name + " ( Remove )
      "; + div = "
      " + name + " ( " + _("Remove")+ " )
      "; $('#instructors').append( div ); $('#find_instructor').val('').focus(); + $('#course_instructors').show(); } function RemoveInstructor( cardnumber ) { $( '#borrower_' + cardnumber ).remove(); + + if ( ! $('#instructors').html() ) { + $('#course_instructors').hide( 800 ); + } } //]]> @@ -143,15 +158,9 @@
    • Instructors: -
      -
      - [% FOREACH i IN instructors %] -
      - [% i.surname %], [% i.firstname %] ( Remove ) - -
      - [% END %] -
      +
      +
      [% FOREACH i IN instructors %]
      [% i.surname %], [% i.firstname %] ( Remove ) +
      [% END %]
      -- 1.7.9.5 From oleonard at myacpl.org Thu Jan 30 16:44:04 2014 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 30 Jan 2014 10:44:04 -0500 Subject: [Koha-patches] [PATCH] Bug 11588 - Untranslatable subscription frequency units Message-ID: <1391096644-8142-1-git-send-email-oleonard@myacpl.org> The subscription add form has a couple of translation issues which are addressed in this patch: First, the frequency option which pulls descriptive strings from the subscription_frequencies table. Second, the subscription length option which is based on hard-coded choices in subscription-add.pl. This patch makes these choices translatable by using a SWITCH in the template based on the predefined strings which can be expected. To test, apply the patch and update the translation of your choice by running 'translate update [language code]'. Confirm that the frequency and length strings are now present in the updated po file. --- .../prog/en/modules/serials/subscription-add.tt | 42 +++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt index f206802..1e2bba2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt @@ -658,7 +658,36 @@ $(document).ready(function() { [% ELSE %] [% END %] @@ -672,7 +701,16 @@ $(document).ready(function() { [% ELSE %] [% END %] -- 1.7.9.5 From tomascohen at gmail.com Thu Jan 30 18:02:39 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Thu, 30 Jan 2014 14:02:39 -0300 Subject: [Koha-patches] [PATCH] Bug 11096: Koha<->Zebra should use the XML syntax with DOM Message-ID: <1391101359-23538-1-git-send-email-tomascohen@gmail.com> This patch makes Koha <-> Zebra use MARCXML for the serialization when using DOM, and USMARC for GRS-1. * The following functions are modified to set the Zebra record syntax according to the current sysprefs and configuration: - C4::Context->Zconn - C4::Context-_new_Zconn * A new function 'new_record_from_zebra' is introduced, which checks the context we are in, and creates the MARC::Record object using the right constructor. The following packages get touched to make use of the new function: - C4::Search - C4::AuthoritiesMarc and the same happens to the UI scripts that make use of them (both in the OPAC and STAFF interfaces). * Calls to the unsafe ZOOM::Record->render()[1] method are removed. Due to this last change the code for building facets was rewritten. And for performance on the facets creation I pushed higher version dependencies for MARC::File::XML and MARC::Record (we rely on MARC::Field->as_string). * Calls to MARC::Record->new_from_xml and MARC::Record->new_from_usmarc are wrapped with eval for catching problems [2]. * As of bug 3087, UNIMARC uses the 'unimarc' record syntax. this case is correctly handled. * As of bug 7818 misc/migration_tools/rebuild_zebra.pl behaves like: - bib_index_mode (defaults to 'grs1' if not specified) - auth_index_mode (defaults to 'dom') here we do exactly the same. To test: - prove t/db_dependent/Search.t should pass. - Searching should remain functional. - Indexing and searching for a big record should work (that's what the unit tests do). - Test an index scan search (on the staff interface): Search > More options > Check "Scan indexes". Regards To+ [1] http://search.cpan.org/~mirk/Net-Z3950-ZOOM/lib/ZOOM.pod#render() [2] a record that cannot be parsed by MARC::Record is simply skipped (bug 10684) Sponsored-by: Universidad Nacional de Cordoba --- C4/AuthoritiesMarc.pm | 40 ++++++++----- C4/Context.pm | 50 ++++++++-------- C4/Installer/PerlDependencies.pm | 4 +- C4/Search.pm | 121 ++++++++++++++++++++++++++++----------- catalogue/search.pl | 5 +- circ/circulation.pl | 2 +- t/db_dependent/Search.t | 44 +++++++++++++- 7 files changed, 188 insertions(+), 78 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 1c87285..ee4a349 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -266,10 +266,17 @@ sub SearchAuthorities { ##Here we have to extract MARC record and $authid from ZEBRA AUTHORITIES my $rec=$oAResult->record($counter); - my $marcdata=$rec->raw(); - my $authrecord; my $separator=C4::Context->preference('authoritysep'); - $authrecord = MARC::File::USMARC::decode($marcdata); + my $authrecord = C4::Search::new_record_from_zebra( + 'authorityserver', + $rec->raw() + ); + + if ( !defined $authrecord or !defined $authrecord->field('001') ) { + $counter++; + next; + } + my $authid=$authrecord->field('001')->data(); my %newline; $newline{authid} = $authid; @@ -847,15 +854,18 @@ sub FindDuplicateAuthority { my $query='at:'.$authtypecode.' '; my $filtervalues=qr([\001-\040\!\'\"\`\#\$\%\&\*\+,\-\./:;<=>\?\@\(\)\{\[\]\}_\|\~]); if ($record->field($auth_tag_to_report)) { - foreach ($record->field($auth_tag_to_report)->subfields()) { - $_->[1]=~s/$filtervalues/ /g; $query.= " $op he:\"".$_->[1]."\"" if ($_->[0]=~/[A-z]/); - } + foreach ($record->field($auth_tag_to_report)->subfields()) { + $_->[1]=~s/$filtervalues/ /g; $query.= " $op he:\"".$_->[1]."\"" if ($_->[0]=~/[A-z]/); + } } my ($error, $results, $total_hits) = C4::Search::SimpleSearch( $query, 0, 1, [ "authorityserver" ] ); # there is at least 1 result => return the 1st one if (!defined $error && @{$results} ) { - my $marcrecord = MARC::File::USMARC::decode($results->[0]); - return $marcrecord->field('001')->data,BuildSummary($marcrecord,$marcrecord->field('001')->data,$authtypecode); + my $marcrecord = C4::Search::new_record_from_zebra( + 'authorityserver', + $results->[0] + ); + return $marcrecord->field('001')->data,BuildSummary($marcrecord,$marcrecord->field('001')->data,$authtypecode); } # no result, returns nothing return; @@ -1452,13 +1462,15 @@ sub merge { } my $z=0; while ( $z<$count ) { - my $rec; - $rec=$oResult->record($z); - my $marcdata = $rec->raw(); - my $marcrecordzebra= MARC::Record->new_from_usmarc($marcdata); + my $marcrecordzebra = C4::Search::new_record_from_zebra( + 'biblioserver', + $oResult->record($z)->raw() + ); my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' ); - my $i = ($biblionumbertagfield < 10) ? $marcrecordzebra->field($biblionumbertagfield)->data : $marcrecordzebra->subfield($biblionumbertagfield, $biblionumbertagsubfield); - my $marcrecorddb=GetMarcBiblio($i); + my $i = ($biblionumbertagfield < 10) + ? $marcrecordzebra->field( $biblionumbertagfield )->data + : $marcrecordzebra->subfield( $biblionumbertagfield, $biblionumbertagsubfield ); + my $marcrecorddb = GetMarcBiblio($i); push @reccache, $marcrecorddb; $z++; } diff --git a/C4/Context.pm b/C4/Context.pm index 3914420..f58092d 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -706,8 +706,6 @@ sub Zconn { $context->{"Zconn"}->{$server}->destroy() if defined($context->{"Zconn"}->{$server}); $context->{"Zconn"}->{$server} = &_new_Zconn($server,$async,$auth,$piggyback,$syntax); - $context->{ Zconn }->{ $server }->option( - preferredRecordSyntax => C4::Context->preference("marcflavour") ); return $context->{"Zconn"}->{$server}; } } @@ -731,14 +729,36 @@ sub _new_Zconn { my $tried=0; # first attempt my $Zconn; # connection object - $server = "biblioserver" unless $server; - $syntax = "usmarc" unless $syntax; + my $elementSetName; + my $index_mode; + + $server //= "biblioserver"; + $syntax //= "XML"; + + if ( $server eq 'biblioserver' ) { + $index_mode = $context->{'config'}->{'zebra_bib_index_mode'} // 'grs1'; + } elsif ( $server eq 'authorityserver' ) { + $index_mode = $context->{'config'}->{'zebra_auth_index_mode'} // 'dom'; + } + + if ( $index_mode eq 'grs1' ) { + + $elementSetName = 'F'; + $syntax = ( $context->preference("marcflavour") eq 'UNIMARC' ) + ? 'unimarc' + : 'usmarc'; + + } else { + + $elementSetName = 'marcxml'; + $syntax = 'XML'; + } my $host = $context->{'listen'}->{$server}->{'content'}; my $servername = $context->{"config"}->{$server}; my $user = $context->{"serverinfo"}->{$server}->{"user"}; my $password = $context->{"serverinfo"}->{$server}->{"password"}; - $auth = 1 if($user && $password); + $auth = 1 if($user && $password); retry: eval { # set options @@ -750,7 +770,7 @@ sub _new_Zconn { $o->option(cqlfile=> $context->{"server"}->{$server}->{"cql2rpn"}); $o->option(cclfile=> $context->{"serverinfo"}->{$server}->{"ccl2rpn"}); $o->option(preferredRecordSyntax => $syntax); - $o->option(elementSetName => "F"); # F for 'full' as opposed to B for 'brief' + $o->option(elementSetName => $elementSetName); $o->option(databaseName => ($servername?$servername:"biblios")); # create a new connection object @@ -765,23 +785,7 @@ sub _new_Zconn { } }; -# if ($@) { -# # Koha manages the Zebra server -- this doesn't work currently for me because of permissions issues -# # Also, I'm skeptical about whether it's the best approach -# warn "problem with Zebra"; -# if ( C4::Context->preference("ManageZebra") ) { -# if ($@->code==10000 && $tried==0) { ##No connection try restarting Zebra -# $tried=1; -# warn "trying to restart Zebra"; -# my $res=system("zebrasrv -f $ENV{'KOHA_CONF'} >/koha/log/zebra-error.log"); -# goto "retry"; -# } else { -# warn "Error ", $@->code(), ": ", $@->message(), "\n"; -# $Zconn="error"; -# return $Zconn; -# } -# } -# } + return $Zconn; } diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm index 9b4b3b6..59a91e8 100644 --- a/C4/Installer/PerlDependencies.pm +++ b/C4/Installer/PerlDependencies.pm @@ -462,7 +462,7 @@ our $PERL_DEPS = { 'MARC::Record' => { 'usage' => 'Core', 'required' => '1', - 'min_ver' => '2' + 'min_ver' => '2.0.6' }, 'Locale::Currency::Format' => { 'usage' => 'Core', @@ -487,7 +487,7 @@ our $PERL_DEPS = { 'MARC::File::XML' => { 'usage' => 'Core', 'required' => '1', - 'min_ver' => '0.88' + 'min_ver' => '1.0.1' }, 'XML::SAX::Writer' => { 'usage' => 'Core', diff --git a/C4/Search.pm b/C4/Search.pm index 18a0f5f..afd4b7e 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -144,8 +144,11 @@ sub FindDuplicate { my @results; if (!defined $error) { foreach my $possible_duplicate_record (@{$searchresults}) { - my $marcrecord = - MARC::Record->new_from_usmarc($possible_duplicate_record); + my $marcrecord = new_record_from_zebra( + 'biblioserver', + $possible_duplicate_record + ); + my $result = TransformMarcToKoha( $dbh, $marcrecord, '' ); # FIXME :: why 2 $biblionumber ? @@ -289,10 +292,11 @@ sub SimpleSearch { } for my $j ( $first_record .. $last_record ) { - my $record = + my $record = eval { $tmpresults[ $i - 1 ]->record( $j - 1 )->raw() ; # 0 indexed - push @{$results}, $record; + }; + push @{$results}, $record if defined $record; } } ); @@ -446,6 +450,7 @@ sub getRecords { else { $times = $size; } + for ( my $j = $offset ; $j < $times ; $j++ ) { my $records_hash; my $record; @@ -488,7 +493,6 @@ sub getRecords { # not an index scan else { $record = $results[ $i - 1 ]->record($j)->raw(); - # warn "RECORD $j:".$record; $results_hash->{'RECORDS'}[$j] = $record; } @@ -503,39 +507,37 @@ sub getRecords { $size > $facets_maxrecs ? $facets_maxrecs : $size; for my $facet (@$facets) { for ( my $j = 0 ; $j < $jmax ; $j++ ) { - my $render_record = - $results[ $i - 1 ]->record($j)->render(); + + my $marc_record = new_record_from_zebra ( + 'biblioserver', + $results[ $i - 1 ]->record($j)->raw() + ); + + if ( ! defined $marc_record ) { + warn "ERROR DECODING RECORD - $@: " . + $results[ $i - 1 ]->record($j)->raw(); + next; + } + my @used_datas = (); + foreach my $tag ( @{ $facet->{tags} } ) { # avoid first line my $tag_num = substr( $tag, 0, 3 ); - my $letters = substr( $tag, 3 ); - my $field_pattern = - '\n' . $tag_num . ' ([^z][^\n]+)'; - $field_pattern = '\n' . $tag_num . ' ([^\n]+)' - if ( int($tag_num) < 10 ); - my @field_tokens = - ( $render_record =~ /$field_pattern/g ); - foreach my $field_token (@field_tokens) { - my @subf = ( $field_token =~ - /\$([a-zA-Z0-9]) ([^\$]+)/g ); - my @values; - for ( my $i = 0 ; $i < @subf ; $i += 2 ) { - if ( $letters =~ $subf[$i] ) { - my $value = $subf[ $i + 1 ]; - $value =~ s/^ *//; - $value =~ s/ *$//; - push @values, $value; - } - } - my $data = join( $facet->{sep}, @values ); + my $subfield_letters = substr( $tag, 3 ); + # Removed when as_string fixed + my @subfields = $subfield_letters =~ /./sg; + + my @fields = $marc_record->field($tag_num); + foreach my $field (@fields) { + my $data = $field->as_string( $subfield_letters, $facet->{sep} ); + unless ( $data ~~ @used_datas ) { - $facets_counter->{ $facet->{idx} } - ->{$data}++; push @used_datas, $data; + $facets_counter->{ $facet->{idx} }->{$data}++; } - } # fields + } # fields } # field codes } # records $facets_info->{ $facet->{idx} }->{label_value} = @@ -1700,16 +1702,28 @@ sub searchResults { $times = $hits; # FIXME: if $hits is undefined, why do we want to equal it? } - my $marcflavour = C4::Context->preference("marcflavour"); + my $marcflavour = C4::Context->preference("marcflavour"); # We get the biblionumber position in MARC my ($bibliotag,$bibliosubf)=GetMarcFromKohaField('biblio.biblionumber',''); # loop through all of the records we've retrieved for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) { - my $marcrecord = eval { MARC::File::USMARC::decode( $marcresults->[$i] ); }; - if ( $@ ) { - warn "ERROR DECODING RECORD - $@: " . $marcresults->[$i]; - next; + + my $marcrecord; + if ($scan) { + # For Scan searches we built USMARC data + $marcrecord = MARC::Record->new_from_usmarc( $marcresults->[$i]); + } else { + # Normal search, render from Zebra's output + $marcrecord = new_record_from_zebra( + 'biblioserver', + $marcresults->[$i] + ); + + if ( ! defined $marcrecord ) { + warn "ERROR DECODING RECORD - $@: " . $marcresults->[$i]; + next; + } } my $fw = $scan @@ -2372,6 +2386,43 @@ sub _ZOOM_event_loop { } } +=head2 new_record_from_zebra + +Given raw data from a Zebra result set, return a MARC::Record object + +This helper function is needed to take into account all the involved +system preferences and configuration variables to properly create the +MARC::Record object. + +If we are using GRS-1, then the raw data we get from Zebra should be USMARC +data. If we are using DOM, then it has to be MARCXML. + +=cut + +sub new_record_from_zebra { + + my $server = shift; + my $raw_data = shift; + # Set the default indexing modes + my $index_mode = ( $server eq 'biblioserver' ) + ? C4::Context->config('zebra_bib_index_mode') // 'grs1' + : C4::Context->config('zebra_auth_index_mode') // 'dom'; + + my $marc_record = eval { + if ( $index_mode eq 'dom' ) { + MARC::Record->new_from_xml( $raw_data, 'UTF-8' ); + } else { + MARC::Record->new_from_usmarc( $raw_data ); + } + }; + + if ($@) { + return; + } else { + return $marc_record; + } + +} END { } # module clean-up code here (global destructor) diff --git a/catalogue/search.pl b/catalogue/search.pl index 892ff15..a391dfe 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -660,7 +660,10 @@ for (my $i=0;$i<@servers;$i++) { elsif ($server =~/authorityserver/) { # this is the local authority server my @inner_sup_results_array; for my $sup_record ( @{$results_hashref->{$server}->{"RECORDS"}} ) { - my $marc_record_object = MARC::Record->new_from_usmarc($sup_record); + my $marc_record_object = C4::Search::new_record_from_zebra( + 'authorityserver', + $sup_record + ); # warn "Authority Found: ".$marc_record_object->as_formatted(); push @inner_sup_results_array, { 'title' => $marc_record_object->field(100)->subfield('a'), diff --git a/circ/circulation.pl b/circ/circulation.pl index 7d214ea..e7a7b5d 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -309,7 +309,7 @@ if ($barcode) { foreach my $hit ( @{$results} ) { my $chosen = TransformMarcToKoha( C4::Context->dbh, - MARC::Record->new_from_usmarc($hit) ); + MARC::Record->new_from_xml($hit,'UTF-8') ); # offer all barcodes individually foreach my $barcode ( sort split(/\s*\|\s*/, $chosen->{barcode}) ) { diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 415cb75..9265594 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -358,6 +358,43 @@ sub run_marc21_search_tests { getRecords('au:Lessig', 'au:Lessig', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef); is($results_hashref->{biblioserver}->{hits}, 4, "getRecords title search for 'Australia' matched right number of records"); +if ( $indexing_mode eq 'dom' ) { + ( undef, $results_hashref, $facets_loop ) = + getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Efectos del ambiente/ && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies' && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ + , "Simple relevance sorting in getRecords matches old behavior"); + + ( undef, $results_hashref, $facets_loop ) = + getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[6],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' + , "Simple ascending author sorting in getRecords matches old behavior"); + + ( undef, $results_hashref, $facets_loop ) = + getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[12],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ + , "Simple descending author sorting in getRecords matches old behavior"); + + ( undef, $results_hashref, $facets_loop ) = + getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ + , "Simple ascending publication date sorting in getRecords matches old behavior"); + + ( undef, $results_hashref, $facets_loop ) = + getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Estado de salud/ && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' + , "Simple descending publication date sorting in getRecords matches old behavior"); + +} elsif ( $indexing_mode eq 'grs1' ){ ( undef, $results_hashref, $facets_loop ) = getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/^Efectos del ambiente/ && @@ -392,14 +429,17 @@ sub run_marc21_search_tests { MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() eq 'World health statistics 2009^ien' && MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() eq 'Manual de higiene industrial^ies' , "Simple descending publication date sorting in getRecords matches old behavior"); +} +TODO: { + local $TODO = "Switch relevance search to MARCXML too"; ( undef, $results_hashref, $facets_loop ) = getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1); $record = MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0]); is($record->title_proper(), 'books', "Scan returned requested item"); is($record->subfield('100', 'a'), 2, "Scan returned correct number of records matching term"); - # Time to test buildQuery and searchResults too. +} my ( $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, @@ -543,7 +583,7 @@ sub run_marc21_search_tests { is(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper(), 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies', "Weighted query returns best match first"); } else { local $TODO = "Query weighting does not behave exactly the same in DOM vs. GRS"; - is(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper(), 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies', "Weighted query returns best match first"); + is(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper(), 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies', "Weighted query returns best match first"); } $QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryRemoveStopwords = 0; -- 1.8.3.2 From tomascohen at gmail.com Thu Jan 30 19:10:54 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Thu, 30 Jan 2014 15:10:54 -0300 Subject: [Koha-patches] [PATCH] Bug 11096: Koha<->Zebra should use the XML syntax with DOM Message-ID: <1391105454-26463-1-git-send-email-tomascohen@gmail.com> This patch makes Koha <-> Zebra use MARCXML for the serialization when using DOM, and USMARC for GRS-1. * The following functions are modified to set the Zebra record syntax according to the current sysprefs and configuration: - C4::Context->Zconn - C4::Context-_new_Zconn * A new function 'new_record_from_zebra' is introduced, which checks the context we are in, and creates the MARC::Record object using the right constructor. The following packages get touched to make use of the new function: - C4::Search - C4::AuthoritiesMarc and the same happens to the UI scripts that make use of them (both in the OPAC and STAFF interfaces). * Calls to the unsafe ZOOM::Record->render()[1] method are removed. Due to this last change the code for building facets was rewritten. And for performance on the facets creation I pushed higher version dependencies for MARC::File::XML and MARC::Record (we rely on MARC::Field->as_string). * Calls to MARC::Record->new_from_xml and MARC::Record->new_from_usmarc are wrapped with eval for catching problems [2]. * As of bug 3087, UNIMARC uses the 'unimarc' record syntax. this case is correctly handled. * As of bug 7818 misc/migration_tools/rebuild_zebra.pl behaves like: - bib_index_mode (defaults to 'grs1' if not specified) - auth_index_mode (defaults to 'dom') here we do exactly the same. To test: - prove t/db_dependent/Search.t should pass. - Searching should remain functional. - Indexing and searching for a big record should work (that's what the unit tests do). - Test an index scan search (on the staff interface): Search > More options > Check "Scan indexes". - Enable 'itemBarcodeFallbackSearch' and try to circulate any word, it shouldn't break. - Searching for a biblio in a new subscription shouldn't break. - Running bulkmarcimport.pl shouldn't break. - And so on... for the rest of the .pl files. Regards To+ [1] http://search.cpan.org/~mirk/Net-Z3950-ZOOM/lib/ZOOM.pod#render() [2] a record that cannot be parsed by MARC::Record is simply skipped (bug 10684) Sponsored-by: Universidad Nacional de Cordoba --- C4/AuthoritiesMarc.pm | 40 ++++--- C4/Context.pm | 50 +++++---- C4/Installer/PerlDependencies.pm | 4 +- C4/Matcher.pm | 2 +- C4/Search.pm | 121 +++++++++++++++------ C4/XISBN.pm | 2 +- acqui/neworderbiblio.pl | 2 +- catalogue/search.pl | 5 +- .../value_builder/marc21_linking_section.pl | 2 +- cataloguing/value_builder/unimarc_field_4XX.pl | 2 +- circ/circulation.pl | 2 +- labels/label-item-search.pl | 2 +- misc/migration_tools/bulkmarcimport.pl | 2 +- serials/subscription-bib-search.pl | 2 +- t/db_dependent/Search.t | 44 +++++++- 15 files changed, 196 insertions(+), 86 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 1c87285..ee4a349 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -266,10 +266,17 @@ sub SearchAuthorities { ##Here we have to extract MARC record and $authid from ZEBRA AUTHORITIES my $rec=$oAResult->record($counter); - my $marcdata=$rec->raw(); - my $authrecord; my $separator=C4::Context->preference('authoritysep'); - $authrecord = MARC::File::USMARC::decode($marcdata); + my $authrecord = C4::Search::new_record_from_zebra( + 'authorityserver', + $rec->raw() + ); + + if ( !defined $authrecord or !defined $authrecord->field('001') ) { + $counter++; + next; + } + my $authid=$authrecord->field('001')->data(); my %newline; $newline{authid} = $authid; @@ -847,15 +854,18 @@ sub FindDuplicateAuthority { my $query='at:'.$authtypecode.' '; my $filtervalues=qr([\001-\040\!\'\"\`\#\$\%\&\*\+,\-\./:;<=>\?\@\(\)\{\[\]\}_\|\~]); if ($record->field($auth_tag_to_report)) { - foreach ($record->field($auth_tag_to_report)->subfields()) { - $_->[1]=~s/$filtervalues/ /g; $query.= " $op he:\"".$_->[1]."\"" if ($_->[0]=~/[A-z]/); - } + foreach ($record->field($auth_tag_to_report)->subfields()) { + $_->[1]=~s/$filtervalues/ /g; $query.= " $op he:\"".$_->[1]."\"" if ($_->[0]=~/[A-z]/); + } } my ($error, $results, $total_hits) = C4::Search::SimpleSearch( $query, 0, 1, [ "authorityserver" ] ); # there is at least 1 result => return the 1st one if (!defined $error && @{$results} ) { - my $marcrecord = MARC::File::USMARC::decode($results->[0]); - return $marcrecord->field('001')->data,BuildSummary($marcrecord,$marcrecord->field('001')->data,$authtypecode); + my $marcrecord = C4::Search::new_record_from_zebra( + 'authorityserver', + $results->[0] + ); + return $marcrecord->field('001')->data,BuildSummary($marcrecord,$marcrecord->field('001')->data,$authtypecode); } # no result, returns nothing return; @@ -1452,13 +1462,15 @@ sub merge { } my $z=0; while ( $z<$count ) { - my $rec; - $rec=$oResult->record($z); - my $marcdata = $rec->raw(); - my $marcrecordzebra= MARC::Record->new_from_usmarc($marcdata); + my $marcrecordzebra = C4::Search::new_record_from_zebra( + 'biblioserver', + $oResult->record($z)->raw() + ); my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' ); - my $i = ($biblionumbertagfield < 10) ? $marcrecordzebra->field($biblionumbertagfield)->data : $marcrecordzebra->subfield($biblionumbertagfield, $biblionumbertagsubfield); - my $marcrecorddb=GetMarcBiblio($i); + my $i = ($biblionumbertagfield < 10) + ? $marcrecordzebra->field( $biblionumbertagfield )->data + : $marcrecordzebra->subfield( $biblionumbertagfield, $biblionumbertagsubfield ); + my $marcrecorddb = GetMarcBiblio($i); push @reccache, $marcrecorddb; $z++; } diff --git a/C4/Context.pm b/C4/Context.pm index 3914420..f58092d 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -706,8 +706,6 @@ sub Zconn { $context->{"Zconn"}->{$server}->destroy() if defined($context->{"Zconn"}->{$server}); $context->{"Zconn"}->{$server} = &_new_Zconn($server,$async,$auth,$piggyback,$syntax); - $context->{ Zconn }->{ $server }->option( - preferredRecordSyntax => C4::Context->preference("marcflavour") ); return $context->{"Zconn"}->{$server}; } } @@ -731,14 +729,36 @@ sub _new_Zconn { my $tried=0; # first attempt my $Zconn; # connection object - $server = "biblioserver" unless $server; - $syntax = "usmarc" unless $syntax; + my $elementSetName; + my $index_mode; + + $server //= "biblioserver"; + $syntax //= "XML"; + + if ( $server eq 'biblioserver' ) { + $index_mode = $context->{'config'}->{'zebra_bib_index_mode'} // 'grs1'; + } elsif ( $server eq 'authorityserver' ) { + $index_mode = $context->{'config'}->{'zebra_auth_index_mode'} // 'dom'; + } + + if ( $index_mode eq 'grs1' ) { + + $elementSetName = 'F'; + $syntax = ( $context->preference("marcflavour") eq 'UNIMARC' ) + ? 'unimarc' + : 'usmarc'; + + } else { + + $elementSetName = 'marcxml'; + $syntax = 'XML'; + } my $host = $context->{'listen'}->{$server}->{'content'}; my $servername = $context->{"config"}->{$server}; my $user = $context->{"serverinfo"}->{$server}->{"user"}; my $password = $context->{"serverinfo"}->{$server}->{"password"}; - $auth = 1 if($user && $password); + $auth = 1 if($user && $password); retry: eval { # set options @@ -750,7 +770,7 @@ sub _new_Zconn { $o->option(cqlfile=> $context->{"server"}->{$server}->{"cql2rpn"}); $o->option(cclfile=> $context->{"serverinfo"}->{$server}->{"ccl2rpn"}); $o->option(preferredRecordSyntax => $syntax); - $o->option(elementSetName => "F"); # F for 'full' as opposed to B for 'brief' + $o->option(elementSetName => $elementSetName); $o->option(databaseName => ($servername?$servername:"biblios")); # create a new connection object @@ -765,23 +785,7 @@ sub _new_Zconn { } }; -# if ($@) { -# # Koha manages the Zebra server -- this doesn't work currently for me because of permissions issues -# # Also, I'm skeptical about whether it's the best approach -# warn "problem with Zebra"; -# if ( C4::Context->preference("ManageZebra") ) { -# if ($@->code==10000 && $tried==0) { ##No connection try restarting Zebra -# $tried=1; -# warn "trying to restart Zebra"; -# my $res=system("zebrasrv -f $ENV{'KOHA_CONF'} >/koha/log/zebra-error.log"); -# goto "retry"; -# } else { -# warn "Error ", $@->code(), ": ", $@->message(), "\n"; -# $Zconn="error"; -# return $Zconn; -# } -# } -# } + return $Zconn; } diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm index 9b4b3b6..59a91e8 100644 --- a/C4/Installer/PerlDependencies.pm +++ b/C4/Installer/PerlDependencies.pm @@ -462,7 +462,7 @@ our $PERL_DEPS = { 'MARC::Record' => { 'usage' => 'Core', 'required' => '1', - 'min_ver' => '2' + 'min_ver' => '2.0.6' }, 'Locale::Currency::Format' => { 'usage' => 'Core', @@ -487,7 +487,7 @@ our $PERL_DEPS = { 'MARC::File::XML' => { 'usage' => 'Core', 'required' => '1', - 'min_ver' => '0.88' + 'min_ver' => '1.0.1' }, 'XML::SAX::Writer' => { 'usage' => 'Core', diff --git a/C4/Matcher.pm b/C4/Matcher.pm index 4e064be..3615aa1 100644 --- a/C4/Matcher.pm +++ b/C4/Matcher.pm @@ -696,7 +696,7 @@ sub get_matches { if ($self->{'record_type'} eq 'biblio') { require C4::Biblio; foreach my $marcblob (keys %matches) { - my $target_record = MARC::Record->new_from_usmarc($marcblob); + my $target_record = C4::Search::new_record_from_zebra('biblioserver',$marcblob); my $record_number; my $result = C4::Biblio::TransformMarcToKoha(C4::Context->dbh, $target_record, ''); $record_number = $result->{'biblionumber'}; diff --git a/C4/Search.pm b/C4/Search.pm index 18a0f5f..afd4b7e 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -144,8 +144,11 @@ sub FindDuplicate { my @results; if (!defined $error) { foreach my $possible_duplicate_record (@{$searchresults}) { - my $marcrecord = - MARC::Record->new_from_usmarc($possible_duplicate_record); + my $marcrecord = new_record_from_zebra( + 'biblioserver', + $possible_duplicate_record + ); + my $result = TransformMarcToKoha( $dbh, $marcrecord, '' ); # FIXME :: why 2 $biblionumber ? @@ -289,10 +292,11 @@ sub SimpleSearch { } for my $j ( $first_record .. $last_record ) { - my $record = + my $record = eval { $tmpresults[ $i - 1 ]->record( $j - 1 )->raw() ; # 0 indexed - push @{$results}, $record; + }; + push @{$results}, $record if defined $record; } } ); @@ -446,6 +450,7 @@ sub getRecords { else { $times = $size; } + for ( my $j = $offset ; $j < $times ; $j++ ) { my $records_hash; my $record; @@ -488,7 +493,6 @@ sub getRecords { # not an index scan else { $record = $results[ $i - 1 ]->record($j)->raw(); - # warn "RECORD $j:".$record; $results_hash->{'RECORDS'}[$j] = $record; } @@ -503,39 +507,37 @@ sub getRecords { $size > $facets_maxrecs ? $facets_maxrecs : $size; for my $facet (@$facets) { for ( my $j = 0 ; $j < $jmax ; $j++ ) { - my $render_record = - $results[ $i - 1 ]->record($j)->render(); + + my $marc_record = new_record_from_zebra ( + 'biblioserver', + $results[ $i - 1 ]->record($j)->raw() + ); + + if ( ! defined $marc_record ) { + warn "ERROR DECODING RECORD - $@: " . + $results[ $i - 1 ]->record($j)->raw(); + next; + } + my @used_datas = (); + foreach my $tag ( @{ $facet->{tags} } ) { # avoid first line my $tag_num = substr( $tag, 0, 3 ); - my $letters = substr( $tag, 3 ); - my $field_pattern = - '\n' . $tag_num . ' ([^z][^\n]+)'; - $field_pattern = '\n' . $tag_num . ' ([^\n]+)' - if ( int($tag_num) < 10 ); - my @field_tokens = - ( $render_record =~ /$field_pattern/g ); - foreach my $field_token (@field_tokens) { - my @subf = ( $field_token =~ - /\$([a-zA-Z0-9]) ([^\$]+)/g ); - my @values; - for ( my $i = 0 ; $i < @subf ; $i += 2 ) { - if ( $letters =~ $subf[$i] ) { - my $value = $subf[ $i + 1 ]; - $value =~ s/^ *//; - $value =~ s/ *$//; - push @values, $value; - } - } - my $data = join( $facet->{sep}, @values ); + my $subfield_letters = substr( $tag, 3 ); + # Removed when as_string fixed + my @subfields = $subfield_letters =~ /./sg; + + my @fields = $marc_record->field($tag_num); + foreach my $field (@fields) { + my $data = $field->as_string( $subfield_letters, $facet->{sep} ); + unless ( $data ~~ @used_datas ) { - $facets_counter->{ $facet->{idx} } - ->{$data}++; push @used_datas, $data; + $facets_counter->{ $facet->{idx} }->{$data}++; } - } # fields + } # fields } # field codes } # records $facets_info->{ $facet->{idx} }->{label_value} = @@ -1700,16 +1702,28 @@ sub searchResults { $times = $hits; # FIXME: if $hits is undefined, why do we want to equal it? } - my $marcflavour = C4::Context->preference("marcflavour"); + my $marcflavour = C4::Context->preference("marcflavour"); # We get the biblionumber position in MARC my ($bibliotag,$bibliosubf)=GetMarcFromKohaField('biblio.biblionumber',''); # loop through all of the records we've retrieved for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) { - my $marcrecord = eval { MARC::File::USMARC::decode( $marcresults->[$i] ); }; - if ( $@ ) { - warn "ERROR DECODING RECORD - $@: " . $marcresults->[$i]; - next; + + my $marcrecord; + if ($scan) { + # For Scan searches we built USMARC data + $marcrecord = MARC::Record->new_from_usmarc( $marcresults->[$i]); + } else { + # Normal search, render from Zebra's output + $marcrecord = new_record_from_zebra( + 'biblioserver', + $marcresults->[$i] + ); + + if ( ! defined $marcrecord ) { + warn "ERROR DECODING RECORD - $@: " . $marcresults->[$i]; + next; + } } my $fw = $scan @@ -2372,6 +2386,43 @@ sub _ZOOM_event_loop { } } +=head2 new_record_from_zebra + +Given raw data from a Zebra result set, return a MARC::Record object + +This helper function is needed to take into account all the involved +system preferences and configuration variables to properly create the +MARC::Record object. + +If we are using GRS-1, then the raw data we get from Zebra should be USMARC +data. If we are using DOM, then it has to be MARCXML. + +=cut + +sub new_record_from_zebra { + + my $server = shift; + my $raw_data = shift; + # Set the default indexing modes + my $index_mode = ( $server eq 'biblioserver' ) + ? C4::Context->config('zebra_bib_index_mode') // 'grs1' + : C4::Context->config('zebra_auth_index_mode') // 'dom'; + + my $marc_record = eval { + if ( $index_mode eq 'dom' ) { + MARC::Record->new_from_xml( $raw_data, 'UTF-8' ); + } else { + MARC::Record->new_from_usmarc( $raw_data ); + } + }; + + if ($@) { + return; + } else { + return $marc_record; + } + +} END { } # module clean-up code here (global destructor) diff --git a/C4/XISBN.pm b/C4/XISBN.pm index cbb2484..bf1f857 100644 --- a/C4/XISBN.pm +++ b/C4/XISBN.pm @@ -67,7 +67,7 @@ sub _get_biblio_from_xisbn { my ( $errors, $results, $total_hits ) = C4::Search::SimpleSearch( "nb=$xisbn", 0, 1 ); return unless ( !$errors && scalar @$results ); - my $record = MARC::Record::new_from_usmarc( $results->[0] ); + my $record = C4::Search::new_record_from_zebra( 'biblioserver', $results->[0] ); my $biblionumber = C4::Biblio::get_koha_field_from_marc('biblio', 'biblionumber', $record, ''); return unless $biblionumber; diff --git a/acqui/neworderbiblio.pl b/acqui/neworderbiblio.pl index bc782af..0e07066 100755 --- a/acqui/neworderbiblio.pl +++ b/acqui/neworderbiblio.pl @@ -111,7 +111,7 @@ if (defined $error) { my @results; foreach my $result ( @{$marcresults} ) { - my $marcrecord = MARC::File::USMARC::decode( $result ); + my $marcrecord = C4::Search::new_record_from_zebra( 'biblioserver', $result ); my $biblio = TransformMarcToKoha( C4::Context->dbh, $marcrecord, '' ); $biblio->{booksellerid} = $booksellerid; diff --git a/catalogue/search.pl b/catalogue/search.pl index 892ff15..a391dfe 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -660,7 +660,10 @@ for (my $i=0;$i<@servers;$i++) { elsif ($server =~/authorityserver/) { # this is the local authority server my @inner_sup_results_array; for my $sup_record ( @{$results_hashref->{$server}->{"RECORDS"}} ) { - my $marc_record_object = MARC::Record->new_from_usmarc($sup_record); + my $marc_record_object = C4::Search::new_record_from_zebra( + 'authorityserver', + $sup_record + ); # warn "Authority Found: ".$marc_record_object->as_formatted(); push @inner_sup_results_array, { 'title' => $marc_record_object->field(100)->subfield('a'), diff --git a/cataloguing/value_builder/marc21_linking_section.pl b/cataloguing/value_builder/marc21_linking_section.pl index ac7cfce..514394f 100644 --- a/cataloguing/value_builder/marc21_linking_section.pl +++ b/cataloguing/value_builder/marc21_linking_section.pl @@ -231,7 +231,7 @@ sub plugin { my @arrayresults; my @field_data = ($search); for ( my $i = 0 ; $i < $resultsperpage ; $i++ ) { - my $record = MARC::Record::new_from_usmarc( $results->[$i] ); + my $record = C4::Search::new_record_from_zebra( 'biblioserver', $results->[$i] ); my $rechash = TransformMarcToKoha( $dbh, $record ); my $pos; my $countitems = $rechash->{itembumber} ? 1 : 0; diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl index 75862cb..7d2fcbc 100755 --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ b/cataloguing/value_builder/unimarc_field_4XX.pl @@ -390,7 +390,7 @@ sub plugin { $i++ ) { - my $record = MARC::Record::new_from_usmarc( $results->[$i] ); + my $record = C4::Search::new_record_from_zebra( 'biblioserver', $results->[$i] ); my $rechash = TransformMarcToKoha( $dbh, $record ); my $pos; my $countitems; diff --git a/circ/circulation.pl b/circ/circulation.pl index 7d214ea..2c97a19 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -309,7 +309,7 @@ if ($barcode) { foreach my $hit ( @{$results} ) { my $chosen = TransformMarcToKoha( C4::Context->dbh, - MARC::Record->new_from_usmarc($hit) ); + C4::Search::new_record_from_zebra('biblioserver',$hit) ); # offer all barcodes individually foreach my $barcode ( sort split(/\s*\|\s*/, $chosen->{barcode}) ) { diff --git a/labels/label-item-search.pl b/labels/label-item-search.pl index a9a1805..6d7db6f 100755 --- a/labels/label-item-search.pl +++ b/labels/label-item-search.pl @@ -125,7 +125,7 @@ if ($show_results) { for ( my $i = 0 ; $i < $hits ; $i++ ) { my @row_data= (); #DEBUG Notes: Decode the MARC record from each resulting MARC record... - my $marcrecord = MARC::File::USMARC::decode( $marcresults->[$i] ); + my $marcrecord = C4::Search::new_record_from_zebra( 'biblioserver', $marcresults->[$i] ); #DEBUG Notes: Transform it to Koha form... my $biblio = TransformMarcToKoha( C4::Context->dbh, $marcrecord, '' ); #DEBUG Notes: Stuff the bib into @biblio_data... diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index 545e818..7bb6be6 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -240,7 +240,7 @@ RECORD: while ( ) { die "unable to search the database for duplicates : $error" if ( defined $error ); $debug && warn "$query $server : $totalhits"; if ( $results && scalar(@$results) == 1 ) { - my $marcrecord = MARC::File::USMARC::decode( $results->[0] ); + my $marcrecord = C4::Search::new_record_from_zebra( $server, $results->[0] ); SetUTF8Flag($marcrecord); $id = GetRecordId( $marcrecord, $tagid, $subfieldid ); if ( $authorities && $marcFlavour ) { diff --git a/serials/subscription-bib-search.pl b/serials/subscription-bib-search.pl index 8d6310c..089b31b 100755 --- a/serials/subscription-bib-search.pl +++ b/serials/subscription-bib-search.pl @@ -113,7 +113,7 @@ if ( $op eq "do_search" && $query ) { for ( my $i = 0 ; $i < $total ; $i++ ) { my %resultsloop; - my $marcrecord = MARC::File::USMARC::decode( $marcrecords->[$i] ); + my $marcrecord = C4::Search::new_record_from_zebra( 'biblioserver', $marcrecords->[$i] ); my $biblio = TransformMarcToKoha( C4::Context->dbh, $marcrecord, '' ); #build the hash for the template. diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 415cb75..9265594 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -358,6 +358,43 @@ sub run_marc21_search_tests { getRecords('au:Lessig', 'au:Lessig', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef); is($results_hashref->{biblioserver}->{hits}, 4, "getRecords title search for 'Australia' matched right number of records"); +if ( $indexing_mode eq 'dom' ) { + ( undef, $results_hashref, $facets_loop ) = + getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Efectos del ambiente/ && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies' && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ + , "Simple relevance sorting in getRecords matches old behavior"); + + ( undef, $results_hashref, $facets_loop ) = + getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[6],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' + , "Simple ascending author sorting in getRecords matches old behavior"); + + ( undef, $results_hashref, $facets_loop ) = + getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[12],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ + , "Simple descending author sorting in getRecords matches old behavior"); + + ( undef, $results_hashref, $facets_loop ) = + getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ + , "Simple ascending publication date sorting in getRecords matches old behavior"); + + ( undef, $results_hashref, $facets_loop ) = + getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); + ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Estado de salud/ && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && + MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' + , "Simple descending publication date sorting in getRecords matches old behavior"); + +} elsif ( $indexing_mode eq 'grs1' ){ ( undef, $results_hashref, $facets_loop ) = getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/^Efectos del ambiente/ && @@ -392,14 +429,17 @@ sub run_marc21_search_tests { MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() eq 'World health statistics 2009^ien' && MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() eq 'Manual de higiene industrial^ies' , "Simple descending publication date sorting in getRecords matches old behavior"); +} +TODO: { + local $TODO = "Switch relevance search to MARCXML too"; ( undef, $results_hashref, $facets_loop ) = getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1); $record = MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0]); is($record->title_proper(), 'books', "Scan returned requested item"); is($record->subfield('100', 'a'), 2, "Scan returned correct number of records matching term"); - # Time to test buildQuery and searchResults too. +} my ( $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, @@ -543,7 +583,7 @@ sub run_marc21_search_tests { is(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper(), 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies', "Weighted query returns best match first"); } else { local $TODO = "Query weighting does not behave exactly the same in DOM vs. GRS"; - is(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper(), 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies', "Weighted query returns best match first"); + is(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper(), 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies', "Weighted query returns best match first"); } $QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryRemoveStopwords = 0; -- 1.8.3.2 From januszop at gmail.com Fri Jan 31 15:41:24 2014 From: januszop at gmail.com (Janusz Kaczmarek) Date: Fri, 31 Jan 2014 15:41:24 +0100 Subject: [Koha-patches] [PATCH] Bug 11650: multiplicated authorities after link_bibs_to_authorities.pl Message-ID: <1391179284-5924-1-git-send-email-januszop@gmail.com> Under certain circumstances misc/link_bibs_to_authorities.pl creates multiple authority with identical heading. Test plan: 1. Have some (2-3) biblio records with some repeated headings Have BiblioAddsAuthorities = allow, AutoCreateAuthorities = generate Have no authority records 2. Run misc/link_bibs_to_authorities.pl script 3. You will get multiple authority records -- one for each occurence of a heading in biblio record. 4. Apply the patch. 5. Repeat 1-3 (remember to have "fresh" biblios, without $9, and no authorities). 6. The problem should be fixed. --- C4/Biblio.pm | 1 + C4/Linker.pm | 3 +++ C4/Linker/Default.pm | 12 ++++++++++++ C4/Linker/FirstMatch.pm | 7 +++++++ C4/Linker/LastMatch.pm | 7 +++++++ 5 files changed, 30 insertions(+), 0 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index dc40d68..380f656 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -634,6 +634,7 @@ sub LinkBibHeadingsToAuthorities { $heading->auth_type() ); $field->add_subfields( '9', $authid ); $num_headings_changed++; + $linker->update_cache($heading, $authid); $results{'added'}->{ $heading->display_form() }++; } } diff --git a/C4/Linker.pm b/C4/Linker.pm index a3c04f7..447d3b2 100644 --- a/C4/Linker.pm +++ b/C4/Linker.pm @@ -35,6 +35,9 @@ the match is "fuzzy" (the semantics of "fuzzy" are up to the individual plugin). In order to handle authority limits, get_link should always end with: return $self->SUPER::_handle_auth_limit($authid), $fuzzy; +B - updates internal linker cache for +$heading with $authid of a new created authotiry record + B - return a MARC::Field object with the heading flipped to the preferred form. diff --git a/C4/Linker/Default.pm b/C4/Linker/Default.pm index 445b408..2610085 100644 --- a/C4/Linker/Default.pm +++ b/C4/Linker/Default.pm @@ -79,6 +79,18 @@ sub get_link { return $self->SUPER::_handle_auth_limit($authid), $fuzzy; } +sub update_cache { + my $self = shift; + my $heading = shift; + my $authid = shift; + my $search_form = $heading->search_form(); + my $fuzzy = 0; + + $self->{'cache'}->{$search_form}->{'cached'} = 1; + $self->{'cache'}->{$search_form}->{'authid'} = $authid; + $self->{'cache'}->{$search_form}->{'fuzzy'} = $fuzzy; +} + sub flip_heading { my $self = shift; my $heading = shift; diff --git a/C4/Linker/FirstMatch.pm b/C4/Linker/FirstMatch.pm index ed03d73..ff05070 100644 --- a/C4/Linker/FirstMatch.pm +++ b/C4/Linker/FirstMatch.pm @@ -41,6 +41,13 @@ sub get_link { return $self->{'default_linker'}->get_link( $heading, 'first' ); } +sub update_cache { + my $self = shift; + my $heading = shift; + my $authid = shift; + $self->{'default_linker'}->update_cache( $heading, $authid ); +} + sub flip_heading { my $self = shift; my $heading = shift; diff --git a/C4/Linker/LastMatch.pm b/C4/Linker/LastMatch.pm index 9357e95..048d35e 100644 --- a/C4/Linker/LastMatch.pm +++ b/C4/Linker/LastMatch.pm @@ -41,6 +41,13 @@ sub get_link { return $self->{'default_linker'}->get_link( $heading, 'last' ); } +sub update_cache { + my $self = shift; + my $heading = shift; + my $authid = shift; + $self->{'default_linker'}->update_cache( $heading, $authid ); +} + sub flip_heading { my $self = shift; my $heading = shift; -- 1.7.2.5 From januszop at gmail.com Fri Jan 31 16:31:03 2014 From: januszop at gmail.com (Janusz Kaczmarek) Date: Fri, 31 Jan 2014 16:31:03 +0100 Subject: [Koha-patches] [PATCH] Bug 11652: merging authority records does not correct biblios Message-ID: <1391182263-6453-1-git-send-email-januszop@gmail.com> When merging authority records in librarian interface biblio records linked to deleted authority are not being corrected (i.e. have still old heading and orpaned link in $9). Test plan: 1. Have two authorities in the catalogue, linked to biblio records. 2. Merge them with the new merge facility (cf. Bug 5202). 3. Have a look a the biblio record(s) previously linked to the removed authority. It should still have the old heading AND orpaned authority link in $9. 4. Apply the patch. 5. Refresh the test records (or use another set). 6. Repeat 1-3. Headings should be refreshed and the correct authid link should be in $9 now. --- authorities/merge.pl | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/authorities/merge.pl b/authorities/merge.pl index 315e232..3628381 100755 --- a/authorities/merge.pl +++ b/authorities/merge.pl @@ -68,6 +68,7 @@ if ($merge) { require C4::ImportBatch; C4::ImportBatch::SetImportRecordStatus( $recordid2, 'imported' ); } else { + C4::AuthoritiesMarc::merge( $recordid2, GetAuthority($recordid2), $recordid1, $record ); $error = (DelAuthority($recordid2) == 0); } push @errors, $error if ($error); -- 1.7.2.5 From tomascohen at gmail.com Fri Jan 31 20:58:34 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Fri, 31 Jan 2014 16:58:34 -0300 Subject: [Koha-patches] [PATCH] Bug 11655: koha-translate --list shouldn't show 'en' Message-ID: <1391198314-5360-1-git-send-email-tomascohen@gmail.com> 'en' is not a translation and it doesn't make any sense to return it as part of the installed translations or the available ones. It becomes relevant to remove it as users upgrading their installed translations end up grepping the output to remove 'en' like in: for lang in $(koha-translate --list | grep -v -x -e 'en') ; do koah-translate --update $lang done instead on simply issuing the koha-translate --list command. To test: - Run ./koha-translate --list ./koha-translate --list --available => It shouldn't return 'en' in the result list. Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- debian/scripts/koha-translate | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/scripts/koha-translate b/debian/scripts/koha-translate index 78bc23e..0164a72 100755 --- a/debian/scripts/koha-translate +++ b/debian/scripts/koha-translate @@ -71,14 +71,15 @@ print_available() { # Loop over only one opac theme for i in $( ls $PO_DIR | grep opac-t-prog ); do - echo `basename $i -i-opac-t-prog-v-3006000.po` + echo `basename $i -i-opac-t-prog-v-3006000.po` | \ + grep -v -x -e en done } print_installed() { ls $KOHA_INSTALL_DIR/opac/htdocs/opac-tmpl/prog/ | \ - grep -v -e images -e itemtypeimg + grep -v -e images -e itemtypeimg -x -e en } install_lang() -- 1.8.3.2