From robin at catalyst.net.nz Thu Sep 1 09:01:04 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Thu, 1 Sep 2011 19:01:04 +1200 Subject: [Koha-patches] [PATCH] Bug 6129 - [master] this adds an ISSN to serialssolutions URLs Message-ID: <1314860464-24369-1-git-send-email-robin@catalyst.net.nz> If a URL is a serialssolutions URLs that doesn't already have an ISSN parameter, this adds one on the OPAC. Author: Srdjan Jankovic Author: Robin Sheat --- C4/Biblio.pm | 6 ++++-- basket/basket.pl | 4 ++-- catalogue/detail.pl | 10 ++++++++-- .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 5 ++++- opac/opac-basket.pl | 2 +- opac/opac-detail.pl | 12 ++++++------ 6 files changed, 25 insertions(+), 14 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 96baaef..ddae223 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1624,7 +1624,7 @@ sub GetMarcAuthors { =head2 GetMarcUrls - $marcurls = GetMarcUrls($record,$marcflavour); + $marcurls = GetMarcUrls($record,$marcflavour,$issn); Returns arrayref of URLs from MARC data, suitable to pass to tmpl loop. Assumes web resources (not uncommon in MARC21 to omit resource type ind) @@ -1632,7 +1632,7 @@ Assumes web resources (not uncommon in MARC21 to omit resource type ind) =cut sub GetMarcUrls { - my ( $record, $marcflavour ) = @_; + my ( $record, $marcflavour, $issn ) = @_; my @marcurls; for my $field ( $record->field('856') ) { @@ -1642,6 +1642,8 @@ sub GetMarcUrls { } my @urls = $field->subfield('u'); foreach my $url (@urls) { + $url .= "?sid=&ISSN=$issn" + if $issn && ($url =~ m/\bserialssolutions\b/o) && ($url !~ m/\bISSN=/o); my $marcurl; if ( $marcflavour eq 'MARC21' ) { my $s3 = $field->subfield('3'); diff --git a/basket/basket.pl b/basket/basket.pl index 8fc15e4..90c4cf8 100755 --- a/basket/basket.pl +++ b/basket/basket.pl @@ -65,8 +65,8 @@ foreach my $biblionumber ( @bibs ) { my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); - my $marcurlsarray = GetMarcUrls ($record,$marcflavour); - my @items = GetItemsInfo( $biblionumber ); + my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); + my @items = GetItemsInfo( $biblionumber, 'opac' ); my $hasauthors = 0; if($dat->{'author'} || @$marcauthorsarray) { diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 8738737..ac94cc0 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -99,12 +99,19 @@ $template->param( normalized_isbn => $isbn, ); +unless (defined($record)) { + print $query->redirect("/cgi-bin/koha/errors/404.pl"); + exit; +} + +my $dat = &GetBiblioData($biblionumber); + my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); my $marcisbnsarray = GetMarcISBN( $record, $marcflavour ); my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries($record,$marcflavour); -my $marcurlsarray = GetMarcUrls ($record,$marcflavour); +my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); my $subtitle = GetRecordValue('subtitle', $record, $fw); # Get Branches, Itemtypes and Locations @@ -117,7 +124,6 @@ my @items; for my $itm (@all_items) { push @items, $itm unless ( $itm->{itemlost} && GetHideLostItemsPreference($borrowernumber) && !$showallitems); } -my $dat = &GetBiblioData($biblionumber); # get count of holds my ( $holdcount, $holds ) = GetReservesFromBiblionumber($biblionumber,1); diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl index d4f763f..c8d8c3b 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -436,6 +436,7 @@ + @@ -539,7 +540,9 @@ Online Resources: - + + + ?sid=&ISSN= _blank diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index 5e92d15..e56509e 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -67,7 +67,7 @@ foreach my $biblionumber ( @bibs ) { my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); - my $marcurlsarray = GetMarcUrls ($record,$marcflavour); + my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); my @items = &GetItemsLocationInfo( $biblionumber ); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index e18e046..8511456 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -97,12 +97,12 @@ my $hideitems = 1 if C4::Context->preference('hidelostitems') or scalar(@hiddeni # Hide items if ($hideitems) { for my $itm (@all_items) { - if ( C4::Context->preference('hidelostitems') ) { - push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems; - } else { - push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems; + if ( C4::Context->preference('hidelostitems') ) { + push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems; + } else { + push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems; + } } -} } else { # Or not @items = @all_items; @@ -223,7 +223,7 @@ my $marcisbnsarray = GetMarcISBN ($record,$marcflavour); my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour); my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); -my $marcurlsarray = GetMarcUrls ($record,$marcflavour); +my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); $template->param( -- 1.7.4.1 From robin at catalyst.net.nz Thu Sep 1 09:01:30 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Thu, 1 Sep 2011 19:01:30 +1200 Subject: [Koha-patches] [PATCH] Bug 6129 - [3.4.x] this adds an ISSN to serialssolutions URLs Message-ID: <1314860490-24430-1-git-send-email-robin@catalyst.net.nz> If a URL is a serialssolutions URLs that doesn't already have an ISSN parameter, this adds one on the OPAC. Author: Srdjan Jankovic Author: Robin Sheat --- C4/Biblio.pm | 6 ++++-- basket/basket.pl | 2 +- catalogue/detail.pl | 10 ++++++++-- .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 5 ++++- opac/opac-basket.pl | 2 +- opac/opac-detail.pl | 12 ++++++------ 6 files changed, 24 insertions(+), 13 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index c9590c2..58c6392 100755 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1601,7 +1601,7 @@ sub GetMarcAuthors { =head2 GetMarcUrls - $marcurls = GetMarcUrls($record,$marcflavour); + $marcurls = GetMarcUrls($record,$marcflavour,$issn); Returns arrayref of URLs from MARC data, suitable to pass to tmpl loop. Assumes web resources (not uncommon in MARC21 to omit resource type ind) @@ -1609,7 +1609,7 @@ Assumes web resources (not uncommon in MARC21 to omit resource type ind) =cut sub GetMarcUrls { - my ( $record, $marcflavour ) = @_; + my ( $record, $marcflavour, $issn ) = @_; my @marcurls; for my $field ( $record->field('856') ) { @@ -1619,6 +1619,8 @@ sub GetMarcUrls { } my @urls = $field->subfield('u'); foreach my $url (@urls) { + $url .= "?sid=&ISSN=$issn" + if $issn && ($url =~ m/\bserialssolutions\b/o) && ($url !~ m/\bISSN=/o); my $marcurl; if ( $marcflavour eq 'MARC21' ) { my $s3 = $field->subfield('3'); diff --git a/basket/basket.pl b/basket/basket.pl index ed6e5a4..50caf61 100755 --- a/basket/basket.pl +++ b/basket/basket.pl @@ -65,7 +65,7 @@ foreach my $biblionumber ( @bibs ) { my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); - my $marcurlsarray = GetMarcUrls ($record,$marcflavour); + my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); my @items = &GetItemsInfo( $biblionumber, 'opac' ); my $hasauthors = 0; diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 03271b4..e4a04e5 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -99,12 +99,19 @@ $template->param( normalized_isbn => $isbn, ); +unless (defined($record)) { + print $query->redirect("/cgi-bin/koha/errors/404.pl"); + exit; +} + +my $dat = &GetBiblioData($biblionumber); + my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); my $marcisbnsarray = GetMarcISBN( $record, $marcflavour ); my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries($record,$marcflavour); -my $marcurlsarray = GetMarcUrls ($record,$marcflavour); +my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); my $subtitle = GetRecordValue('subtitle', $record, $fw); # Get Branches, Itemtypes and Locations @@ -118,7 +125,6 @@ my @items; for my $itm (@all_items) { push @items, $itm unless ( $itm->{itemlost} && GetHideLostItemsPreference($borrowernumber) && !$showallitems); } -my $dat = &GetBiblioData($biblionumber); # get count of holds my ( $holdcount, $holds ) = GetReservesFromBiblionumber($biblionumber,1); diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl index 1e0855f..a1bca45 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -436,6 +436,7 @@ + @@ -539,7 +540,9 @@ Online Resources: - + + + ?sid=&ISSN= _blank diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index 5e92d15..e56509e 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -67,7 +67,7 @@ foreach my $biblionumber ( @bibs ) { my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); - my $marcurlsarray = GetMarcUrls ($record,$marcflavour); + my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); my @items = &GetItemsLocationInfo( $biblionumber ); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 3e4c76c..604ddfc 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -97,12 +97,12 @@ my $hideitems = 1 if C4::Context->preference('hidelostitems') or scalar(@hiddeni # Hide items if ($hideitems) { for my $itm (@all_items) { - if ( C4::Context->preference('hidelostitems') ) { - push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems; - } else { - push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems; + if ( C4::Context->preference('hidelostitems') ) { + push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems; + } else { + push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems; + } } -} } else { # Or not @items = @all_items; @@ -223,7 +223,7 @@ my $marcisbnsarray = GetMarcISBN ($record,$marcflavour); my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour); my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); -my $marcurlsarray = GetMarcUrls ($record,$marcflavour); +my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); $template->param( -- 1.7.4.1 From M.de.Rooy at rijksmuseum.nl Thu Sep 1 12:33:11 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Thu, 1 Sep 2011 10:33:11 +0000 Subject: [Koha-patches] [PATCH] 6278 Funny translation bug with XSLT subfieldSelect parameters Message-ID: <809BE39CD64BFD4EB9036172EBCCFA3132726D@S-MAIL-1B.rijksmuseum.intra> This patch resolves the situation of translating the parameters at (meaning subfield a and t) of subfieldSelect by replacing at with a_t. This string will not be translated and the xslt function subfieldSelect just ignores the underscore. It is a pragmatic and easy solution. Theoretically, we should look for a solution in the translation parser. This is much harder and would probably not result in better code in those modules. Test this patch with the following remarks in mind: 1) This patch deals with XSLT. So you should enable XSLT at OPAC detail. 2) In English or any language not translating the word at: Just check if the links for a MARC 490, 773, 780 or 785 still work at the opac detail page. 3) For a language translating the word at (like Dutch where at becomes bij), you should first rerun your translation process (at least for the OPAC). 4) In that language: Check the results on the vernacular opac detail page for MARC 490, 773, 780 or 785. Without the patch, you would not see a link following e.g. the Series label (with 490 first indicator set to 1). With the patch, you should see a link now. --- .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 10 +++++----- .../prog/en/xslt/NORMARCslim2OPACDetail.xsl | 4 ++-- .../prog/en/xslt/UNIMARCslim2OPACDetail.xsl | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl index d4f763f..a0b72de 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -246,7 +246,7 @@ - at + a_t @@ -257,7 +257,7 @@ - at + a_t @@ -668,7 +668,7 @@ - at + a_t @@ -786,7 +786,7 @@ - at + a_t @@ -848,7 +848,7 @@ - at + a_t diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl index 961f0c9..d2b6b1b 100644 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl @@ -419,7 +419,7 @@ - at + a_t /cgi-bin/koha/opac-search.pl?q= @@ -469,7 +469,7 @@ - at + a_t diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl index 2832b6b..61054ea 100644 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl @@ -411,7 +411,7 @@ - at + a_t /cgi-bin/koha/opac-search.pl?q= @@ -464,7 +464,7 @@ - at + a_t -- 1.6.0.6 From f.demians at tamil.fr Thu Sep 1 13:52:32 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Thu, 1 Sep 2011 13:52:32 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] 6786: False detection of index names in Search; make index names case insensitive Message-ID: <1314877953-1194-1-git-send-email-f.demians@tamil.fr> From: Marcel de Rooy Fixing the regex to detect index names in ccl queries. Changing loop structure: looping through the index candidates in the query is faster than testing every index name with a regex. Making the index comparison case insensitive will benefit users misspelling the case of an index; Zebra does not care about it. Test the change by searching on a word followed by a : or = character. Previously, when that word contained an index name like an or nb, the search would crash. Signed-off-by: Fr?d?ric Demians --- C4/Search.pm | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index c3cff65..e16772d 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1071,15 +1071,14 @@ sub buildQuery { my $stopwords_removed; # flag to determine if stopwords have been removed - my $cclq; + my $cclq=0; my $cclindexes = getIndexes(); - if( $query !~ /\s*ccl=/ ){ - for my $index (@$cclindexes){ - if($query =~ /($index)(,?\w)*[:=]/){ - $cclq = 1; - } - } - $query = "ccl=$query" if($cclq); + if( $query !~ /\s*ccl=/ ) { + while(!$cclq && $query=~/(?:^|\W)(\w+)(,\w+)*[:=]/g) { + my $dx=lc($1); + $cclq= grep {lc($_) eq $dx} @$cclindexes; + } + $query = "ccl=$query" if $cclq; } # for handling ccl, cql, pqf queries in diagnostic mode, skip the rest of the steps -- 1.7.6.1 From f.demians at tamil.fr Thu Sep 1 13:52:33 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Thu, 1 Sep 2011 13:52:33 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6772 - recommendation system In-Reply-To: <1314877953-1194-1-git-send-email-f.demians@tamil.fr> References: <1314877953-1194-1-git-send-email-f.demians@tamil.fr> Message-ID: <1314877953-1194-2-git-send-email-f.demians@tamil.fr> From: Chris Cormack This allows Koha to link similar books to provide recommendations to users. It provides a cron job that should be run regularly (daily or weekly perhaps) to build a recommendation index. When viewing books in the OPAC, those items with the closest match will be displayed. Author: Chris Cormack Author: Robin Sheat Signed-off-by: Fr?d?ric Demians --- C4/Recommendations.pm | 204 ++++++++++++++++++++ debian/koha-common.cron.daily | 4 + installer/data/mysql/de-DE/mandatory/sysprefs.sql | 2 +- installer/data/mysql/en/mandatory/sysprefs.sql | 1 + .../1-Obligatoire/unimarc_standard_systemprefs.sql | 1 + installer/data/mysql/it-IT/necessari/sysprefs.sql | 1 + installer/data/mysql/kohastructure.sql | 11 + .../data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql | 1 + installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 1 + ...m_preferences_full_optimal_for_install_only.sql | 1 + ...m_preferences_full_optimal_for_install_only.sql | 1 + installer/data/mysql/updatedatabase.pl | 17 ++ .../prog/en/modules/admin/preferences/opac.pref | 6 + koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 11 + misc/cronjobs/recommendations.pl | 53 +++++ opac/opac-detail.pl | 8 + 16 files changed, 322 insertions(+), 1 deletions(-) create mode 100644 C4/Recommendations.pm create mode 100755 misc/cronjobs/recommendations.pl diff --git a/C4/Recommendations.pm b/C4/Recommendations.pm new file mode 100644 index 0000000..0cd0e00 --- /dev/null +++ b/C4/Recommendations.pm @@ -0,0 +1,204 @@ +package C4::Recommendations; + +# Copyright 2009,2011 Catalyst IT +# +# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +=head1 NAME + + C4::Recommendations - Koha module for producing reading recommendations + +=head1 SYNOPSIS + + use C4::Recommendations; + + build_recommendations(); + + my $recommended_books = get_recommendations($biblio); + +=head1 DESCRIPTION + +This looks at the issue history, and counts how many times each particular book +has been taken out by someone who also has taken out another particular book, +recording that as a hit for each pair. + +For example, if 3 people have taken out book A and book B, then this is +recorded as three "hits" for that combination, and so it'll show as a +recommendation with that strength. + +=head1 EXPORT + +None by default, however C and C +can be imported optionally. + +=head1 FUNCTIONS + +=cut + +use strict; +use warnings; +use C4::Context; + +require Exporter; + +our @ISA = qw(Exporter); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. +our @EXPORT_OK = qw( + build_recommendations + get_recommendations +); + +our $VERSION = '0.01'; + +=head2 build_recommendations + + build_recommendations + +This runs through all the issues and generates the tables of recommendations. +Note that it'll likely take a long time to run, and put stress on the database, +so do it at a low peak time. + +=cut + +sub build_recommendations { + my $dbh = C4::Context->dbh; + $dbh->do("TRUNCATE recommendations"); + my $all_issues_query = qq/ +SELECT biblio.biblionumber,borrowernumber +FROM old_issues,biblio,items +WHERE old_issues.itemnumber=items.itemnumber +AND items.biblionumber=biblio.biblionumber + /; + my $all_issues_sth = $dbh->prepare($all_issues_query); + my $borrower_issues_query = qq/ +SELECT biblio.biblionumber,borrowernumber +FROM old_issues,biblio,items +WHERE old_issues.itemnumber=items.itemnumber +AND items.biblionumber=biblio.biblionumber +AND old_issues.borrowernumber = ? +AND items.biblionumber > ? + /; + my $borrower_issues_sth = $dbh->prepare($borrower_issues_query); + my $recommendations_select = $dbh->prepare(qq/ +SELECT * FROM recommendations +WHERE biblio_one = ? AND +biblio_two = ? + /); + my $recommendations_update = $dbh->prepare(qq/ +UPDATE recommendations +SET hit_count = ? +WHERE biblio_one = ? +AND biblio_two = ? + /); + my $recommendations_insert = $dbh->prepare(qq/ +INSERT INTO recommendations (biblio_one,biblio_two,hit_count) VALUES (?,?,?) + /); + + $all_issues_sth->execute(); + while ( my $issue = $all_issues_sth->fetchrow_hashref() ) { +# warn $issue->{'borrowernumber'}; + $borrower_issues_sth->execute( $issue->{'borrowernumber'}, $issue->{biblionumber} ); + while ( my $borrowers_issue = $borrower_issues_sth->fetchrow_hashref() ) { +# warn $borrowers_issue->{'biblionumber'}; + $recommendations_select->execute( $issue->{'biblionumber'}, + $borrowers_issue->{'biblionumber'} ); + if ( my $recommendation = $recommendations_select->fetchrow_hashref() ) { + $recommendation->{'hit_count'}++; + $recommendations_update->execute( + $recommendation->{'hit_count'}, + $issue->{'biblionumber'}, + $borrowers_issue->{'biblionumber'} + ); + } else { + $recommendations_insert->execute( + $issue->{'biblionumber'}, + $borrowers_issue->{'biblionumber'}, + 1 + ); + } + } + + } +} + +=head2 get_recommendations + + my $recommendations = get_recommendations($biblionumber, $limit) + foreach my $rec (@$recommendations) { + print $rec->{biblionumber}.": ".$rec->{title}."\n"; + } + +This gets the recommendations for a particular biblio, returning an array of +hashes containing C and C. The array is ordered from +most-recommended to least. + +C<$limit> restrictes the amount of results returned. If it's not supplied, +it defaults to 100. + +=cut + +sub get_recommendations { + my ($biblionumber, $limit) = @_; + $limit ||= 100; + + my $dbh = C4::Context->dbh(); + + # Two parts: first get the biblio_one side, then get the + # biblio_two side. I'd love to know how to squish this into one query. + my $sth = $dbh->prepare(qq/ +SELECT biblio.biblionumber,biblio.title, hit_count +FROM biblio,recommendations +WHERE biblio.biblionumber = biblio_two +AND biblio_one = ? +ORDER BY hit_count DESC +LIMIT ? + /); + $sth->execute($biblionumber, $limit); + my $res = $sth->fetchall_arrayref({}); + + $sth = $dbh->prepare(qq/ +SELECT biblio.biblionumber,biblio.title, hit_count +FROM biblio,recommendations +WHERE biblio.biblionumber = biblio_one +AND biblio_two = ? +ORDER BY hit_count DESC +LIMIT ? + /); + $sth->execute($biblionumber, $limit); + push @{ $res }, @{$sth->fetchall_arrayref({})}; + + $res = \@{ @{$res}[0..$limit] } if (@$res > $limit); + + my @res = sort { $b->{hit_count} <=> $a->{hit_count} } @$res; + return \@res; +} + +1; +__END__ + +=head1 AUTHOR + +=over + +=item Chris Cormack, E<lt>chrisc at catalyst.net.nzE<gt> + +=item Robin Sheat, E<lt>robin at catalyst.net.nzE<gt> + +=back + diff --git a/debian/koha-common.cron.daily b/debian/koha-common.cron.daily index e2c7a80..86a7fe5 100644 --- a/debian/koha-common.cron.daily +++ b/debian/koha-common.cron.daily @@ -23,3 +23,7 @@ koha-foreach --enabled /usr/share/koha/bin/cronjobs/services_throttle.pl > /dev/ koha-foreach --enabled /usr/share/koha/bin/cronjobs/cleanup_database.pl --sessions --zebraqueue 10 koha-foreach --enabled --noemail /usr/share/koha/bin/cronjobs/cleanup_database.pl --mail koha-run-backups --days 2 --output /var/spool/koha + +# If recommendations are enabled, this may take a while to run. However, it'll +# stop pretty much immediately if it doesn't need to do anything. +koha-foreach --enabled /usr/share/koha/bin/cronjobs/recommendations.pl diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index 6df6a9f..1107703 100755 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -317,4 +317,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0, 'If ON Openlibrary book covers will be show',NULL,'YesNo'); - +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShowRecommendations',0,'If ON recommendation information will be generated and displayed',NULL,'YesNo'); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 8407505..3d17252 100755 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -317,3 +317,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShowRecommendations',0,'If ON recommendation information will be generated and displayed',NULL,'YesNo'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index d46502c..d13cc73 100755 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -318,4 +318,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShowRecommendations',0,'If ON recommendation information will be generated and displayed',NULL,'YesNo'); diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql index 3448738..17cc120 100755 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -304,4 +304,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShowRecommendations',0,'If ON recommendation information will be generated and displayed',NULL,'YesNo'); diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 13fa53d..ce4bc37 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2613,6 +2613,17 @@ CREATE TABLE `fieldmapping` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS `recommendations`; +CREATE TABLE `recommendations` ( + `id` int(11) NOT NULL auto_increment, + `biblio_one` int(11), + `biblio_two` int(11), + `hit_count` int(11), + PRIMARY KEY (`id`), + KEY `biblio_one_idx` (`biblio_one`), + KEY `biblio_two_idx` (`biblio_two`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql index ac4c3e2..37eca0f 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql @@ -324,3 +324,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShowRecommendations',0,'If ON recommendation information will be generated and displayed',NULL,'YesNo'); diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index 3087f3c..6e9a72a 100755 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -316,3 +316,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0, 'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShowRecommendations',0,'If ON recommendation information will be generated and displayed',NULL,'YesNo'); diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql index c0912ba..8e82624 100755 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -371,3 +371,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShowRecommendations',0,'If ON recommendation information will be generated and displayed',NULL,'YesNo'); diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql index d334469..afc93e7 100755 --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -396,4 +396,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0, 'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShowRecommendations',0,'If ON recommendation information will be generated and displayed',NULL,'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bdfc9ac..272a0c1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4440,6 +4440,23 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { } +$DBversion = "3.05.00.011"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(" + CREATE TABLE `recommendations` ( + `id` int(11) NOT NULL auto_increment, + `biblio_one` int(11), + `biblio_two` int(11), + `hit_count` int(11), + PRIMARY KEY (`id`), + KEY `biblio_one_idx` (`biblio_one`), + KEY `biblio_two_idx` (`biblio_two`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 + "); + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShowRecommendations',0,'If ON recommendation information will be generated and displayed',NULL,'YesNo');"); + print "Add table and syspref track the recommended reading data.\n"; + SetVersion($DBversion); +} =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 4a7c652..cd00daa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -268,6 +268,12 @@ OPAC: - pref: numSearchRSSResults class: long - search results in the RSS feed. + - + - pref: ShowRecommendations + choices: + yes: Do + no: "Don't" + - "generate and display reading recommendations in the OPAC. <i>(Notes: this requires the <tt>recommendations.pl</tt> cron job to be configured to run regularly. This cron job will take a long time to run on catalogs with a sizable circulation history.)</i>" Policy: - - pref: singleBranchMode diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 40af8f5..e5243af 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -363,6 +363,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( OPACFRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]#editions">Editions</a></li>[% END %][% END %] [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonReviews ) %]<li><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]#amazonreviews">Amazon Reviews</a></li>[% END %][% END %] + [% IF ( Recommendations ) %]<li><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]#recommendations">Recommendations</a></li>[% END %] [% IF ( Babeltheque ) %]<li><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]#babeltheque">Babelth?que</a></li>[% END %] [% IF ( serialcollection ) %] @@ -728,6 +729,16 @@ YAHOO.util.Event.onContentReady("furtherm", function () { </div> [% END %] +[% IF (Recommendations) %] +<div id="recommendations"> +<table> +[% FOREACH recommendation IN recommendation_loop %] +<tr><td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% recommendation.biblionumber %]">[% recommendation.title | html %]</a></td></tr> +[% END %] +</table> +</div> +[% END %] + [% IF ( OPACFRBRizeEditions ) %][% IF ( XISBNS ) %] <div id="editions"> diff --git a/misc/cronjobs/recommendations.pl b/misc/cronjobs/recommendations.pl new file mode 100755 index 0000000..d2b114f --- /dev/null +++ b/misc/cronjobs/recommendations.pl @@ -0,0 +1,53 @@ +#!/usr/bin/perl + +# Copyright 2009,2011 Catalyst IT Ltd. +# +# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +=head1 NAME + +recommendations.pl - cron script to populate the recommendations table + +=head1 SYNOPSIS + +./recommendations.pl + +or, in crontab: +0 1 * * * recommendations.pl + +=head1 DESCRIPTION + +=cut + +use strict; +use warnings; +BEGIN { + # find Koha's Perl modules + # test carefully before changing this + use FindBin; + eval { require "$FindBin::Bin/../kohalib.pl" }; +} + +use C4::Context; +use C4::Recommendations qw/ build_recommendations /; + +if (C4::Context->preference('ShowRecommendations')) { + build_recommendations(); +} + +1; + +__END__ diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index e18e046..b17d77a 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -42,6 +42,7 @@ use C4::VirtualShelves; use C4::XSLT; use C4::ShelfBrowser; use C4::Charset; +use C4::Recommendations qw/ get_recommendations /; use MARC::Record; use MARC::Field; use List::MoreUtils qw/any none/; @@ -66,6 +67,13 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( my $biblionumber = $query->param('biblionumber') || $query->param('bib'); +if ( C4::Context->preference('ShowRecommendations')){ + my $recommendations = get_recommendations($biblionumber); + $template->param('Recommendations' => 1, + 'recommendation_loop' => $recommendations + ); +} + $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') ); $template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); -- 1.7.6.1 From f.demians at tamil.fr Thu Sep 1 13:56:59 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Thu, 1 Sep 2011 13:56:59 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6752: Be stricter with utf-8 encoding of output Message-ID: <1314878219-2386-1-git-send-email-f.demians@tamil.fr> From: Colin Campbell <colin.campbell at ptfs-europe.com> use encoding(UTF-8) rather than utf-8 for stricter encoding Marking output as ':utf8' only flags the data as utf8 using :encoding(UTF-8) also checks it as valid utf-8 see binmode in perlfunc for more details In accordance with the robustness principle input filehandles have not been changed as code may make the undocumented assumption that invalid utf-8 is present in the imput Fixes errors reported by t/00-testcritic.t Where feasable some filehandles have been made lexical rather than reusing global filehandle vars Signed-off-by: Fr?d?ric Demians <f.demians at tamil.fr> --- admin/aqplan.pl | 2 +- authorities/authorities-list.pl | 2 +- cataloguing/ysearch.pl | 2 +- circ/overdue.pl | 2 +- circ/ypattrodue-attr-search-authvalue.pl | 2 +- circ/ysearch.pl | 2 +- docs/CAS/CASProxy/examples/koha_webservice.pl | 2 +- misc/cronjobs/MARC21_parse_test.pl | 2 +- misc/cronjobs/overdue_notices.pl | 2 +- .../22_to_30/export_Authorities_xml.pl | 6 ++-- misc/migration_tools/bulkmarcimport.pl | 2 +- misc/migration_tools/rebuild_zebra.pl | 28 ++++++++++---------- misc/sax_parser_test.pl | 2 +- misc/translator/xgettext.pl | 2 +- opac/ilsdi.pl | 2 +- opac/oai.pl | 2 +- reports/guided_reports.pl | 2 +- reports/serials_stats.pl | 2 +- svc/bib | 2 +- svc/new_bib | 2 +- t/db_dependent/lib/KohaTest.pm | 6 ++-- tools/export.pl | 2 +- 22 files changed, 39 insertions(+), 39 deletions(-) diff --git a/admin/aqplan.pl b/admin/aqplan.pl index 81418ff..b9917fd 100755 --- a/admin/aqplan.pl +++ b/admin/aqplan.pl @@ -463,7 +463,7 @@ output_html_with_http_headers $input, $cookie, $template->output; sub _print_to_csv { my ( $header, $results ) = @_; - binmode STDOUT, ":utf8"; + binmode STDOUT, ':encoding(UTF-8)'; my $csv = Text::CSV_XS->new( { sep_char => $del, diff --git a/authorities/authorities-list.pl b/authorities/authorities-list.pl index eec3233..2b15856 100755 --- a/authorities/authorities-list.pl +++ b/authorities/authorities-list.pl @@ -4,7 +4,7 @@ use warnings; use C4::Context; use C4::AuthoritiesMarc; use utf8; -use open qw( :std :utf8 ); +use open qw[ :std :encoding(utf8) ]; my $dbh=C4::Context->dbh; my $datatypes_query = $dbh->prepare(<<ENDSQL); diff --git a/cataloguing/ysearch.pl b/cataloguing/ysearch.pl index 5cd0205..40ac979 100755 --- a/cataloguing/ysearch.pl +++ b/cataloguing/ysearch.pl @@ -39,7 +39,7 @@ my $field = $input->param('field'); # Prevent from disclosing data die() unless ($table eq "biblioitems"); -binmode STDOUT, ":utf8"; +binmode STDOUT, ':encoding(UTF-8)'; print $input->header( -type => 'text/plain', -charset => 'UTF-8' ); my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { cataloguing => '*' } ); diff --git a/circ/overdue.pl b/circ/overdue.pl index 18851a6..86e7b01 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -351,7 +351,7 @@ if ($noreport) { } if ($op eq 'csv') { - binmode(STDOUT, ":utf8"); + binmode STDOUT, 'encoding(UTF-8)'; my $csv = build_csv(\@overduedata); print $input->header(-type => 'application/vnd.sun.xml.calc', -encoding => 'utf-8', diff --git a/circ/ypattrodue-attr-search-authvalue.pl b/circ/ypattrodue-attr-search-authvalue.pl index 5ff1cd9..a7a950f 100755 --- a/circ/ypattrodue-attr-search-authvalue.pl +++ b/circ/ypattrodue-attr-search-authvalue.pl @@ -32,7 +32,7 @@ $attrcode =~ s|^/||; my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { circulate => '*' } ); exit 0 if $auth_status ne "ok"; -binmode STDOUT, ":utf8"; +binmode STDOUT, ':encoding(UTF-8)'; print $input->header( -type => 'text/plain', -charset => 'UTF-8' ); print STDERR ">> CALLING $0 (attrcode=$attrcode, query=$query)\n" if $debug; diff --git a/circ/ysearch.pl b/circ/ysearch.pl index f8fc52a..26e2def 100755 --- a/circ/ysearch.pl +++ b/circ/ysearch.pl @@ -33,7 +33,7 @@ use C4::Auth qw/check_cookie_auth/; my $input = new CGI; my $query = $input->param('query'); -binmode STDOUT, ":utf8"; +binmode STDOUT, ':encoding(UTF-8)'; print $input->header(-type => 'text/plain', -charset => 'UTF-8'); my ($auth_status, $sessionID) = check_cookie_auth($input->cookie('CGISESSID'), { circulate => '*' }); diff --git a/docs/CAS/CASProxy/examples/koha_webservice.pl b/docs/CAS/CASProxy/examples/koha_webservice.pl index cb161f7..95b8bd3 100755 --- a/docs/CAS/CASProxy/examples/koha_webservice.pl +++ b/docs/CAS/CASProxy/examples/koha_webservice.pl @@ -34,7 +34,7 @@ The Proxy Ticket, needed for check_api_auth, that will try to make the CAS Serve use utf8; use strict; use warnings; -binmode(STDOUT, ":utf8"); +binmode STDOUT, ':encoding(UTF-8)'; use C4::Auth qw(check_api_auth); use C4::Output; diff --git a/misc/cronjobs/MARC21_parse_test.pl b/misc/cronjobs/MARC21_parse_test.pl index f607cd9..3510f2b 100755 --- a/misc/cronjobs/MARC21_parse_test.pl +++ b/misc/cronjobs/MARC21_parse_test.pl @@ -24,7 +24,7 @@ use MARC::Record; use MARC::File::XML; use MARC::File::USMARC; -use open OUT => ':utf8'; +use open OUT => ':encoding(UTF-8)'; use Getopt::Long qw(:config auto_help auto_version); use Pod::Usage; diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 37774b5..1fb9592 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -323,7 +323,7 @@ if (@branchcodes) { # these are the fields that will be substituted into <<item.content>> my @item_content_fields = split( /,/, $itemscontent ); -binmode( STDOUT, ":utf8" ); +binmode STDOUT, ':encoding(UTF-8)'; our $csv; # the Text::CSV_XS object diff --git a/misc/migration_tools/22_to_30/export_Authorities_xml.pl b/misc/migration_tools/22_to_30/export_Authorities_xml.pl index 70647ee..42d2e5c 100755 --- a/misc/migration_tools/22_to_30/export_Authorities_xml.pl +++ b/misc/migration_tools/22_to_30/export_Authorities_xml.pl @@ -23,7 +23,7 @@ $rq->execute; #ATTENTION : Mettre la base en utf8 auparavant. #BEWARE : Set database into utf8 before. while (my ($authid)=$rq->fetchrow){ -open FILEOUTPUT,">:utf8", "./$filename/$authid.xml" or die "unable to open $filename"; +open my $fileoutput, '>:encoding(UTF-8)', "./$filename/$authid.xml" or die "unable to open $filename"; my $record=AUTHgetauthority($dbh,$authid); if (! utf8::is_utf8($record)) { utf8::decode($record); @@ -44,7 +44,7 @@ open FILEOUTPUT,">:utf8", "./$filename/$authid.xml" or die "unable to open $file # } else { # $record->encoding( 'UTF-8' ); # } - print FILEOUTPUT $record->as_xml(); -close FILEOUPUT; + print {$fileoutput} $record->as_xml(); +close $fileoutput; } diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index 4f738e8..70d5eb7 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -30,7 +30,7 @@ use Getopt::Long; use IO::File; use Pod::Usage; -binmode(STDOUT, ":utf8"); +binmode STDOUT, ':encoding(UTF-8)'; my ( $input_marc_file, $number, $offset) = ('',0,0); my ($version, $delete, $test_parameter, $skip_marc8_conversion, $char_encoding, $verbose, $commit, $fk_off,$format,$biblios,$authorities,$keepids,$match, $isbn_check, $logfile); my ($sourcetag,$sourcesubfield,$idmapfl); diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index dadf43f..52a577c 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/misc/migration_tools/rebuild_zebra.pl @@ -309,7 +309,7 @@ sub export_marc_records_from_sth { my ($record_type, $sth, $directory, $as_xml, $noxml, $nosanitize) = @_; my $num_exported = 0; - open (OUT, ">:utf8 ", "$directory/exported_records") or die $!; + open my $fh, '>:encoding(UTF-8) ', "$directory/exported_records" or die $!; my $i = 0; my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField("items.itemnumber",''); while (my ($record_number) = $sth->fetchrow_array) { @@ -339,7 +339,7 @@ sub export_marc_records_from_sth { } } if ( $marcxml ) { - print OUT $marcxml if $marcxml; + print {$fh} $marcxml if $marcxml; $num_exported++; } next; @@ -352,7 +352,7 @@ sub export_marc_records_from_sth { # to care, though, at least if you're using the GRS-1 filter. It does # care if you're using the DOM filter, which requires valid XML file(s). eval { - print OUT ($as_xml) ? $marc->as_xml_record(C4::Context->preference('marcflavour')) : $marc->as_usmarc(); + print {$fh} ($as_xml) ? $marc->as_xml_record(C4::Context->preference('marcflavour')) : $marc->as_usmarc(); $num_exported++; }; if ($@) { @@ -361,7 +361,7 @@ sub export_marc_records_from_sth { } } print "\nRecords exported: $num_exported\n" if ( $verbose_logging ); - close OUT; + close $fh; return $num_exported; } @@ -369,7 +369,7 @@ sub export_marc_records_from_list { my ($record_type, $entries, $directory, $as_xml, $noxml, $records_deleted) = @_; my $num_exported = 0; - open (OUT, ">:utf8 ", "$directory/exported_records") or die $!; + open my $fh, '>:encoding(UTF-8)', "$directory/exported_records" or die $!; my $i = 0; # Skip any deleted records. We check for this anyway, but this reduces error spam @@ -386,12 +386,12 @@ sub export_marc_records_from_list { # strung together with no single root element. zebraidx doesn't seem # to care, though, at least if you're using the GRS-1 filter. It does # care if you're using the DOM filter, which requires valid XML file(s). - print OUT ($as_xml) ? $marc->as_xml_record(C4::Context->preference('marcflavour')) : $marc->as_usmarc(); + print {$fh} ($as_xml) ? $marc->as_xml_record(C4::Context->preference('marcflavour')) : $marc->as_usmarc(); $num_exported++; } } print "\nRecords exported: $num_exported\n" if ( $verbose_logging ); - close OUT; + close $fh; return $num_exported; } @@ -399,7 +399,7 @@ sub generate_deleted_marc_records { my ($record_type, $entries, $directory, $as_xml) = @_; my $records_deleted = {}; - open (OUT, ">:utf8 ", "$directory/exported_records") or die $!; + open my $fh, '>:encoding(UTF-8)', "$directory/exported_records" or die $!; my $i = 0; foreach my $record_number (map { $_->{biblio_auth_number} } @$entries ) { print "\r$i" unless ($i++ %100 or !$verbose_logging); @@ -415,12 +415,12 @@ sub generate_deleted_marc_records { fix_unimarc_100($marc); } - print OUT ($as_xml) ? $marc->as_xml_record(C4::Context->preference("marcflavour")) : $marc->as_usmarc(); + print {$fh} ($as_xml) ? $marc->as_xml_record(C4::Context->preference("marcflavour")) : $marc->as_usmarc(); $records_deleted->{$record_number} = 1; } print "\nRecords exported: $i\n" if ( $verbose_logging ); - close OUT; + close $fh; return $records_deleted; @@ -830,8 +830,8 @@ if ($authorities) { # AUTHORITIES : copying mandatory files # unless (-f C4::Context->zebraconfig('authorityserver')->{config}) { - open ZD,">:utf8 ",C4::Context->zebraconfig('authorityserver')->{config}; - print ZD " + open my $zd, '>:encoding(UTF-8)' ,C4::Context->zebraconfig('authorityserver')->{config}; + print {$zd} " # generated by KOHA/misc/migration_tools/rebuild_zebra.pl profilePath:\${srcdir:-.}:$authorityserverdir/tab/:$tabdir/tab/:\${srcdir:-.}/tab/ @@ -975,8 +975,8 @@ if ($biblios) { # BIBLIOS : copying mandatory files # unless (-f C4::Context->zebraconfig('biblioserver')->{config}) { - open ZD,">:utf8 ",C4::Context->zebraconfig('biblioserver')->{config}; - print ZD " + open my $zd, '>:encoding(UTF-8)', C4::Context->zebraconfig('biblioserver')->{config}; + print {$zd} " # generated by KOHA/misc/migrtion_tools/rebuild_zebra.pl profilePath:\${srcdir:-.}:$biblioserverdir/tab/:$tabdir/tab/:\${srcdir:-.}/tab/ diff --git a/misc/sax_parser_test.pl b/misc/sax_parser_test.pl index b2e5974..fb56de1 100755 --- a/misc/sax_parser_test.pl +++ b/misc/sax_parser_test.pl @@ -9,7 +9,7 @@ use Encode; my $parser = XML::SAX::ParserFactory->parser( Handler => MySAXHandler->new ); -binmode STDOUT, ":utf8"; +binmode STDOUT, ':encoding(UTF-8)'; print "\x{65}\x{301}\n"; $parser->parse_string(encode_utf8("<xml>\x{65}\x{301}</xml>")); $parser->parse_string("<xml>\xEF\xBB\xBF\x{65}\x{301}</xml>"); diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl index 99e9612..f7a940b 100755 --- a/misc/translator/xgettext.pl +++ b/misc/translator/xgettext.pl @@ -351,7 +351,7 @@ if (defined $output && $output ne '-') { print STDERR "$0: Outputting to STDOUT...\n" if $verbose_p; open(OUTPUT, ">&STDOUT"); } -binmode( OUTPUT, ":utf8" ); +binmode OUTPUT, ':encoding(UTF-8)'; if (defined $files_from) { print STDERR "$0: Opening input file list \"$files_from\"\n" if $verbose_p; diff --git a/opac/ilsdi.pl b/opac/ilsdi.pl index 48fd7ba..419c0f2 100755 --- a/opac/ilsdi.pl +++ b/opac/ilsdi.pl @@ -228,7 +228,7 @@ if ( $service and any { $service eq $_ } @services ) { } # Output XML by passing the hashref to XMLOut -binmode(STDOUT, ":utf8"); +binmode STDOUT, ':encoding(UTF-8)'; print CGI::header('-type'=>'text/xml', '-charset'=>'utf-8'); print XMLout( $out, diff --git a/opac/oai.pl b/opac/oai.pl index 038b6d1..2ef3f28 100755 --- a/opac/oai.pl +++ b/opac/oai.pl @@ -41,7 +41,7 @@ else { ); } -binmode( STDOUT, ":utf8" ); +binmode STDOUT, ':encoding(UTF-8)'; my $repository = C4::OAI::Repository->new(); # __END__ Main Prog diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index f5667a2..27377e0 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -539,7 +539,7 @@ elsif ($phase eq 'Run this report'){ } elsif ($phase eq 'Export'){ - binmode STDOUT, ':utf8'; + binmode STDOUT, ':encoding(UTF-8)'; # export results to tab separated text or CSV my $sql = $input->param('sql'); # FIXME: use sql from saved report ID#, not new user-supplied SQL! diff --git a/reports/serials_stats.pl b/reports/serials_stats.pl index 640ef60..88918cc 100755 --- a/reports/serials_stats.pl +++ b/reports/serials_stats.pl @@ -103,7 +103,7 @@ if($do_it){ $template->param(datas => \@datas, do_it => 1); }else{ - binmode STDOUT, ':utf8'; + binmode STDOUT, ':encoding(UTF-8)'; print $input->header(-type => 'application/vnd.sun.xml.calc', -encoding => 'utf-8', -name => "$basename.csv", diff --git a/svc/bib b/svc/bib index 29121ca..4808559 100755 --- a/svc/bib +++ b/svc/bib @@ -27,7 +27,7 @@ use C4::Biblio; use XML::Simple; my $query = new CGI; -binmode STDOUT, ":utf8"; +binmode STDOUT, ':encoding(UTF-8)'; my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} ); unless ($status eq "ok") { diff --git a/svc/new_bib b/svc/new_bib index b84eaea..dba1fc7 100755 --- a/svc/new_bib +++ b/svc/new_bib @@ -28,7 +28,7 @@ use XML::Simple; use C4::Charset; my $query = new CGI; -binmode STDOUT, ":utf8"; +binmode STDOUT, ':encoding(UTF-8)'; my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} ); unless ($status eq "ok") { diff --git a/t/db_dependent/lib/KohaTest.pm b/t/db_dependent/lib/KohaTest.pm index 70c963d..d8cf495 100644 --- a/t/db_dependent/lib/KohaTest.pm +++ b/t/db_dependent/lib/KohaTest.pm @@ -625,11 +625,11 @@ sub reindex_marc { mkdir "$directory/$record_type"; my $sth = $dbh->prepare($record_type eq "biblio" ? "SELECT marc FROM biblioitems" : "SELECT marc FROM auth_header"); $sth->execute(); - open OUT, ">:utf8", "$directory/$record_type/records"; + open my $out, '>:encoding(UTF-8)', "$directory/$record_type/records"; while (my ($blob) = $sth->fetchrow_array) { - print OUT $blob; + print {$out} $blob; } - close OUT; + close $out; my $zebra_server = "${record_type}server"; my $zebra_config = C4::Context->zebraconfig($zebra_server)->{'config'}; my $zebra_db_dir = C4::Context->zebraconfig($zebra_server)->{'directory'}; diff --git a/tools/export.pl b/tools/export.pl index 4a09868..a39f080 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -56,7 +56,7 @@ my ($template, $loggedinuser, $cookie) } if ($op eq "export") { - binmode(STDOUT,":utf8"); + binmode STDOUT, ':encoding(UTF-8)'; print $query->header( -type => 'application/octet-stream', -charset => 'utf-8', -attachment=>$filename); -- 1.7.6.1 From M.de.Rooy at rijksmuseum.nl Thu Sep 1 15:09:27 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Thu, 1 Sep 2011 13:09:27 +0000 Subject: [Koha-patches] [PATCH] 6829: Remove two warnings for opac-MARCdetail Message-ID: <809BE39CD64BFD4EB9036172EBCCFA313273DD@S-MAIL-1B.rijksmuseum.intra> Remove two warnings from logfile by adding simple checks. Sept 1, revision: Clearing another warning (thx Owen) too. --- opac/opac-MARCdetail.pl | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 7544902..8e90c9e 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -142,8 +142,8 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { for my $i ( 0 .. $#subf ) { $subf[$i][0] = "@" unless $subf[$i][0]; my $sf_def = $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }; - next if ( $sf_def->{tab} ne $tabloop ); - next if ( $sf_def->{hidden} > 0 ); + next if ( ($sf_def->{tab}||'') ne $tabloop ); + next if ( ($sf_def->{hidden}||0) > 0 ); my %subfield_data; $subfield_data{marc_lib} = ($sf_def->{lib} eq $previous) ? '--' : $sf_def->{lib}; $previous = $sf_def->{lib}; @@ -215,8 +215,8 @@ foreach my $field (@fields) { # loop through each subfield for my $i ( 0 .. $#subf ) { my $sf_def = $tagslib->{ $field->tag() }->{ $subf[$i][0] }; - next if ( $sf_def->{tab} ne 10 ); - next if ( $sf_def->{hidden} > 0 ); + next if ( ($sf_def->{tab}||'') ne '10' ); + next if ( ($sf_def->{hidden}||0) > 0 ); $witness{ $subf[$i][0] } = $sf_def->{lib}; if ( $sf_def->{isurl} ) { @@ -237,7 +237,7 @@ foreach my $field (@fields) { my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype ); @big_array = - sort { $a->{$holdingbrtagsubf} cmp $b->{$holdingbrtagsubf} } @big_array; + sort { ($a->{$holdingbrtagsubf}||'') cmp ($b->{$holdingbrtagsubf}||'') } @big_array; #fill big_row with missing datas foreach my $subfield_code ( keys(%witness) ) { -- 1.6.0.6 From oleonard at myacpl.org Thu Sep 1 15:12:50 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 1 Sep 2011 09:12:50 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] 6829: Remove two warnings for opac-MARCdetail Message-ID: <1314882770-20366-1-git-send-email-oleonard@myacpl.org> From: Marcel de Rooy <m.de.rooy at rijksmuseum.nl> Remove two warnings from logfile by adding simple checks. Sept 1, revision: Clearing another warning (thx Owen) too. Signed-off-by: Owen Leonard <oleonard at myacpl.org> --- opac/opac-MARCdetail.pl | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 7544902..ffa0a6d 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -142,8 +142,8 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { for my $i ( 0 .. $#subf ) { $subf[$i][0] = "@" unless $subf[$i][0]; my $sf_def = $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }; - next if ( $sf_def->{tab} ne $tabloop ); - next if ( $sf_def->{hidden} > 0 ); + next if ( ($sf_def->{tab}||'') ne $tabloop ); + next if ( ($sf_def->{hidden}||0) > 0 ); my %subfield_data; $subfield_data{marc_lib} = ($sf_def->{lib} eq $previous) ? '--' : $sf_def->{lib}; $previous = $sf_def->{lib}; @@ -215,8 +215,8 @@ foreach my $field (@fields) { # loop through each subfield for my $i ( 0 .. $#subf ) { my $sf_def = $tagslib->{ $field->tag() }->{ $subf[$i][0] }; - next if ( $sf_def->{tab} ne 10 ); - next if ( $sf_def->{hidden} > 0 ); + next if ( ($sf_def->{tab}||'') ne 10 ); + next if ( ($sf_def->{hidden}||0) > 0 ); $witness{ $subf[$i][0] } = $sf_def->{lib}; if ( $sf_def->{isurl} ) { @@ -237,7 +237,7 @@ foreach my $field (@fields) { my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype ); @big_array = - sort { $a->{$holdingbrtagsubf} cmp $b->{$holdingbrtagsubf} } @big_array; + sort { ($a->{$holdingbrtagsubf}||'') cmp ($b->{$holdingbrtagsubf}||'') } @big_array; #fill big_row with missing datas foreach my $subfield_code ( keys(%witness) ) { -- 1.7.3 From oleonard at myacpl.org Thu Sep 1 15:44:18 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 1 Sep 2011 09:44:18 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 6458 - incorrect parsing result in translation processing Message-ID: <1314884658-20991-1-git-send-email-oleonard@myacpl.org> Fixing improperly nested template logic inside markup in header.inc --- .../intranet-tmpl/prog/en/includes/header.inc | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 0db885a..58430fc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -64,7 +64,11 @@ <span class="loggedinusername"> [% loggedinusername %] </span> - (<a href="/cgi-bin/koha/mainpage.pl?logout.x=1"[% IF ( intranetbookbag ) %] onclick="delBasket(true);"[% END %]>Log Out</a>) | + [% IF ( intranetbookbag ) %] + (<a href="/cgi-bin/koha/mainpage.pl?logout.x=1" onclick="delBasket(true);">Log Out</a>) | + [% ELSE %] + (<a href="/cgi-bin/koha/mainpage.pl?logout.x=1">Log Out</a>) | + [% END %] [% ELSE %] You are not logged in | [% END %] -- 1.7.3 From oleonard at myacpl.org Thu Sep 1 16:08:27 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 1 Sep 2011 10:08:27 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 6458 - incorrect parsing result in translation processing Message-ID: <1314886107-21375-1-git-send-email-oleonard@myacpl.org> Fixing improperly nested template logic inside HTML tags in aqplan template. --- .../intranet-tmpl/prog/en/modules/admin/aqplan.tt | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt index 32940ee..10ca4ce 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt @@ -145,8 +145,12 @@ YAHOO.util.Event.onAvailable("popmenu", function () { <tbody> [% FOREACH budget_line IN budget_lines %] [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %] - - <td align="left"[% IF ( budget_line.budget_lock ) %] class="locked" title="Fund locked"[% END %]><a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_id=[% budget_line.budget_id %]&budget_period_id=[% budget_line.budget_period_id %]">[% budget_line.budget_name_indent %]</a></td> + [% IF ( budget_line.budget_lock ) %] + <td align="left" class="locked" title="Fund locked"> + [% ELSE %] + <td align="left"> + [% END %] + <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_id=[% budget_line.budget_id %]&budget_period_id=[% budget_line.budget_period_id %]">[% budget_line.budget_name_indent %]</a></td> <td><span id="budget_tot_formatted_[% budget_line.budget_id %]">[% budget_line.budget_amount_formatted %] </span> -- 1.7.3 From oleonard at myacpl.org Thu Sep 1 16:28:07 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 1 Sep 2011 10:28:07 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 6458 - incorrect parsing result in translation processing Message-ID: <1314887287-21561-1-git-send-email-oleonard@myacpl.org> Fixing improperly nested template logic inside HTML tags in member details template. --- .../prog/en/modules/members/moremember.tt | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index cfa75ca..db9ae4d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -437,7 +437,12 @@ function validate1(date) { [% ELSE %] <tr> [% END %] - <td[% IF ( issueloo.red ) %] class="od"[% END %]>[% issueloo.date_due %] + [% IF ( issueloo.red ) %] + <td class="od"> + [% ELSE %] + <td> + [% END %] + [% issueloo.date_due %] [% IF ( issueloo.itemlost ) %] <span class="lost">[% issueloo.itemlost %]</span> [% END %] @@ -538,7 +543,12 @@ function validate1(date) { [% ELSE %] <tr> [% END %] - <td[% IF ( relissueloo.red ) %] class="od"[% END %]>[% relissueloo.date_due %] + [% IF ( relissueloo.red ) %] + <td class="od"> + [% ELSE %] + <td> + [% END %] + [% relissueloo.date_due %] [% IF ( relissueloo.itemlost ) %] <span class="lost">[% relissueloo.itemlost %]</span> [% END %] -- 1.7.3 From oleonard at myacpl.org Thu Sep 1 16:38:02 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 1 Sep 2011 10:38:02 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 6458 - incorrect parsing result in translation processing Message-ID: <1314887882-21681-1-git-send-email-oleonard@myacpl.org> Fixing improperly nested template logic inside HTML tags in spine label print template. --- .../prog/en/modules/labels/spinelabel-print.tt | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt index eb39405..598eed8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt @@ -1,6 +1,10 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD Xhtml 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html lang="[% lang %]" xml:lang="[% lang %]" [% IF ( bidi ) %]dir="[% bidi %]"[% END %] xmlns="http://www.w3.org/1999/xhtml"> +[% IF ( bidi ) %] +<html lang="[% lang %]" xml:lang="[% lang %]" dir="[% bidi %]" xmlns="http://www.w3.org/1999/xhtml"> +[% ELSE %] +<html lang="[% lang %]" xml:lang="[% lang %]" xmlns="http://www.w3.org/1999/xhtml"> +[% END %] <head> <title>Koha › Tools › Spine Labels -- 1.7.3 From oleonard at myacpl.org Thu Sep 1 16:55:44 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 1 Sep 2011 10:55:44 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 6458 - incorrect parsing result in translation processing Message-ID: <1314888944-21842-1-git-send-email-oleonard@myacpl.org> Fixing improperly nested template logic inside HTML tags in the system preferences editor. --- .../prog/en/modules/admin/systempreferences.tt | 71 ++++++++++++++++---- 1 files changed, 58 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt index 2b7feff..18c0552 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt @@ -87,9 +87,11 @@
[% IF ( add_form ) %] - -
- + [% IF ( type_upload ) %] + + [% ELSE %] + + [% END %]
[% IF ( modify ) %]Modify [% ELSE %]Add @@ -125,21 +127,41 @@ [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]
[% IF ( sublanguages_loo.sublanguage_current ) %] + [% IF ( sublanguages_loo.enabled ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ( sublanguages_loo.enabled ) %] + + [% ELSE %] + + [% END %] + [% END %]
[% END %] [% ELSE %] [% IF ( languages_loo.current ) %] + [% IF ( languages_loo.group_enabled ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ( languages_loo.group_enabled ) %] + + [% ELSE %] + + [% END %] + [% END %] [% END %] @@ -260,8 +282,11 @@ [% ELSE %] [% END %] - - + [% IF ( loo.type_upload ) %] + + [% ELSE %] + + [% END %] [% IF ( loo.type_free ) %] [% END %] @@ -293,21 +318,41 @@ [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]
[% IF ( sublanguages_loo.sublanguage_current ) %] + [% IF ( sublanguages_loo.enabled ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ( sublanguages_loo.enabled ) %] + + [% ELSE %] + + [% END %] + [% END %]
[% END %] [% ELSE %] [% IF ( languages_loo.current ) %] + [% IF ( languages_loo.group_enabled ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ( languages_loo.group_enabled ) %] + + [% ELSE %] + + [% END %] + [% END %] [% END %] -- 1.7.3 From oleonard at myacpl.org Thu Sep 1 17:17:08 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 1 Sep 2011 11:17:08 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 6458 - incorrect parsing result in translation processing Message-ID: <1314890228-22178-1-git-send-email-oleonard@myacpl.org> Fixing improperly nested template logic inside HTML tags in MARC editor. Modifying script to stop tag attribute markup from being passed to the template directly in favor of using template logic. --- cataloguing/addbiblio.pl | 2 +- .../prog/en/modules/cataloguing/addbiblio.tt | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 637d82d..21601e9 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -874,7 +874,7 @@ foreach my $thisframeworkcode ( keys %$frameworks ) { frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, ); if ($frameworkcode eq $thisframeworkcode){ - $row{'selected'}="selected=\"selected\""; + $row{'selected'} = 1; } push @frameworkcodeloop, \%row; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 173e0cf..0d974a6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -778,8 +778,12 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
  • - [% FOREACH frameworkcodeloo IN frameworkcodeloop %] - [% END %] @@ -857,8 +861,11 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
    [% UNLESS ( subfield_loo.advancedMARCEditor ) %] - [% IF ( subfield_loo.fixedfield ) %]
    [% IF ( add_form ) %] - - - + [% IF ( type_upload ) %] + + [% ELSE %] + + [% END %]
    [% IF ( modify ) %]Modify [% ELSE %]Add @@ -125,21 +127,41 @@ [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]
    [% IF ( sublanguages_loo.sublanguage_current ) %] + [% IF ( sublanguages_loo.enabled ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ( sublanguages_loo.enabled ) %] + + [% ELSE %] + + [% END %] + [% END %]
    [% END %] [% ELSE %] [% IF ( languages_loo.current ) %] + [% IF ( languages_loo.group_enabled ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ( languages_loo.group_enabled ) %] + + [% ELSE %] + + [% END %] + [% END %] [% END %] @@ -260,8 +282,11 @@ [% ELSE %] [% END %] - - + [% IF ( loo.type_upload ) %] + + [% ELSE %] + + [% END %] [% IF ( loo.type_free ) %] [% END %] @@ -293,21 +318,41 @@ [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]
    [% IF ( sublanguages_loo.sublanguage_current ) %] + [% IF ( sublanguages_loo.enabled ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ( sublanguages_loo.enabled ) %] + + [% ELSE %] + + [% END %] + [% END %]
    [% END %] [% ELSE %] [% IF ( languages_loo.current ) %] + [% IF ( languages_loo.group_enabled ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ( languages_loo.group_enabled ) %] + + [% ELSE %] + + [% END %] + [% END %] [% END %] -- 1.7.4.1 From henridamien.laurent at biblibre.com Fri Sep 2 10:41:27 2011 From: henridamien.laurent at biblibre.com (Henri-Damien LAURENT) Date: Fri, 2 Sep 2011 10:41:27 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6834 : Removing last of the $template->{param_map} Message-ID: <1314952887-21387-1-git-send-email-henridamien.laurent@biblibre.com> From: Chris Cormack Signed-off-by: Henri-Damien LAURENT --- admin/aqbudgets.pl | 4 ++-- admin/aqplan.pl | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl index 9c35079..db99759 100755 --- a/admin/aqbudgets.pl +++ b/admin/aqbudgets.pl @@ -90,7 +90,7 @@ $template->param( # ------- get periods stuff ------------------ # USED FOR PERMISSION COMPARISON LATER -my $borrower_id = $template->{param_map}->{'USER_INFO'}[0]->{'borrowernumber'}; +my $borrower_id = $template->{VARS}->{'USER_INFO'}[0]->{'borrowernumber'}; my $user = GetMemberDetails($borrower_id); my $user_branchcode = $user->{'branchcode'}; @@ -246,7 +246,7 @@ if ($op eq 'add_form') { # PERMISSIONS unless($staffflags->{'superlibrarian'} % 2 == 1 ) { #IF NO PERMS, THEN DISABLE EDIT/DELETE - unless ( $template->{param_map}->{'CAN_user_acquisition_budget_modify'} ) { + unless ( $template->{VARS}->{'CAN_user_acquisition_budget_modify'} ) { $budget->{'budget_lock'} = 1; } # check budget permission diff --git a/admin/aqplan.pl b/admin/aqplan.pl index 81418ff..ceb9950 100755 --- a/admin/aqplan.pl +++ b/admin/aqplan.pl @@ -85,8 +85,8 @@ $template->param( # ------- get periods stuff ------------------ -my $borrower_id = $template->{param_map}->{'USER_INFO'}[0]->{'borrowernumber'}; -my $borrower_branchcode = $template->{param_map}->{'USER_INFO'}[0]->{'branchcode'}; +my $borrower_id = $template->{VARS}->{'USER_INFO'}[0]->{'borrowernumber'}; +my $borrower_branchcode = $template->{VARS}->{'USER_INFO'}[0]->{'branchcode'}; my $periods; my $authcat = $input->param('authcat'); @@ -132,7 +132,7 @@ my $op = $input->param("op"); my $budget_branchcode; -my $budgets_ref = GetBudgetHierarchy( $budget_period_id, $show_mine?$template->{param_map}->{'USER_INFO'}[0]->{'branchcode'}:'', $show_mine?$template->{param_map}->{'USER_INFO'}[0]->{'borrowernumber'}:'' ); +my $budgets_ref = GetBudgetHierarchy( $budget_period_id, $show_mine?$template->{VARS}->{'USER_INFO'}[0]->{'branchcode'}:'', $show_mine?$template->{VARS}->{'USER_INFO'}[0]->{'borrowernumber'}:'' ); # build categories list my $sth = $dbh->prepare("select distinct category from authorised_values where category like 'A%' "); -- 1.7.1 From henridamien.laurent at biblibre.com Fri Sep 2 10:43:08 2011 From: henridamien.laurent at biblibre.com (Henri-Damien LAURENT) Date: Fri, 2 Sep 2011 10:43:08 +0200 Subject: [Koha-patches] [PATCH] bug 6834 followup removing param_map Message-ID: <1314952988-21486-1-git-send-email-henridamien.laurent@biblibre.com> param_map was still to be found in two files. --- acqui/acqui-home.pl | 2 +- acqui/basket.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index 0d9c207..69482a8 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -80,7 +80,7 @@ my $suggestions_count = CountSuggestion($status); my $budget_arr = GetBudgetHierarchy( '', $user->{branchcode}, - $template->{param_map}->{'USER_INFO'}[0]->{'borrowernumber'} ); + $template->{VARS}->{'USER_INFO'}[0]->{'borrowernumber'} ); my $total = 0; my $totspent = 0; diff --git a/acqui/basket.pl b/acqui/basket.pl index 303684c..dfc9447 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -136,7 +136,7 @@ if ( $op eq 'delete_confirm' ) { address3 => $bookseller->{'address3'}, address4 => $bookseller->{'address4'}, ); -} elsif ($op eq 'attachbasket' && $template->{'param_map'}->{'CAN_user_acquisition_group_manage'} == 1) { +} elsif ($op eq 'attachbasket' && $template->{'VARS'}->{'CAN_user_acquisition_group_manage'} == 1) { print $query->redirect('/cgi-bin/koha/acqui/basketgroup.pl?basketno=' . $basket->{'basketno'} . '&op=attachbasket&booksellerid=' . $booksellerid); # check if we have to "close" a basket before building page } elsif ($op eq 'export') { -- 1.7.1 From stephane.delaune at biblibre.com Fri Sep 2 10:45:00 2011 From: stephane.delaune at biblibre.com (=?UTF-8?q?St=C3=A9phane=20Delaune?=) Date: Fri, 2 Sep 2011 10:45:00 +0200 Subject: [Koha-patches] [PATCH][SIGNED-OFF] Fix for Bug 5028 - Remove references to catmaintain.pl Message-ID: <1314953100-13260-1-git-send-email-stephane.delaune@biblibre.com> From: Owen Leonard catmaintain.pl doesn't exist anymore. References to it in the templates should be removed. Signed-off-by: St?phane Delaune --- .../prog/en/modules/catalogue/detail.tt | 3 - .../prog/en/modules/maint/catmaintain.tt | 122 -------------------- koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 3 - 3 files changed, 0 insertions(+), 128 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/maint/catmaintain.tt diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 2ea7091..e723781 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -370,9 +370,6 @@ function verify_images() { [% itemloo.copynumber %] [% END %] [% IF ( itemdata_itemnotes ) %]
    [% itemloo.itemnotes %]
    [% END %] - [% IF ( itemloo.type ) %] -
    Fix Itemtype - [% END %] [% IF ( SpineLabelShowPrintOnBibDetails ) %] Print Label [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/maint/catmaintain.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/maint/catmaintain.tt deleted file mode 100644 index 996e33d..0000000 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/maint/catmaintain.tt +++ /dev/null @@ -1,122 +0,0 @@ -[% INCLUDE 'doc-head-open.inc' %] -Koha › Catalog Maintenance -[% INCLUDE 'doc-head-close.inc' %] - - -[% INCLUDE 'header.inc' %] - -
    - -
    -
    -
    - -[% IF ( allsub_p ) %] - - -[% FOREACH loo IN loop %] - -[% END %] -
    Results
    [% loo.subject |html %]
    -[% END %] - - -[% IF ( modsub_p ) %] - -This will change the subject headings on all the records this subject is applied to. - - - -
    Subject Heading Global Update
    -
    - - -[% END %] - - -[% IF ( upsub_p ) %] -Successfully modified [% oldsub |html %] -is now [% sub |html %] - -[% END %] - - -[% IF ( undel_p ) %] - - - -[% FOREACH loo IN loop %] - - - - - -[% END %] -
    TitleAuthorUndelete
    [% loo.title |html %][% loo.author |html %]Undelete
    -[% END %] - - -[% IF ( finun_p ) %] -

    Successfully undeleted

    -

    Back to Catalog Maintenance

    -[% END %] - - -[% IF ( fixitemtype_p ) %] -
    - - -
    - -
    - -
    -[% END %] - - -[% IF ( updatetype_p ) %] -

    Updated successfully

    -

    Back to Catalog Maintenance

    -[% END %] - - -[% IF ( mainmenu_p ) %] - -

    Catalog Maintenance

    -
    - - - -
    Subject Maintenance
    - -
    - -
    - - - - -
    Group Maintenance
    - -
    - -
    - - - -
    Undelete Biblio
    - -
    - -[% END %] - -
    -
    -
    - -[% INCLUDE 'mainmenu.inc' %] -[% INCLUDE 'intranet-bottom.inc' %] - diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 40af8f5..1950e4e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -420,9 +420,6 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% INCLUDE 'item-status.inc' item = ITEM_RESULT %] [% IF ( itemdata_itemnotes ) %][% ITEM_RESULT.itemnotes %][% END %] [% ITEM_RESULT.datedue %] - [% IF ( ITEM_RESULT.type ) %] - Fix Itemtype - [% END %] [% END %] -- 1.7.0.4 From christophe.croullebois at biblibre.com Fri Sep 2 11:02:00 2011 From: christophe.croullebois at biblibre.com (Christophe Croullebois) Date: Fri, 2 Sep 2011 11:02:00 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6825 OpacNav menu hide user menu on opac-user.pl page Message-ID: <1314954120-16172-1-git-send-email-christophe.croullebois@biblibre.com> From: Fr?d?ric Demians This patch inverse OpacNav and user menu on opac-user.pl page and other user pages. Signed-off-by: Christophe Croullebois --- .../opac-tmpl/prog/en/modules/opac-account.tt | 2 +- .../opac-tmpl/prog/en/modules/opac-messaging.tt | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt | 2 +- .../opac-tmpl/prog/en/modules/opac-privacy.tt | 2 +- .../prog/en/modules/opac-readingrecord.tt | 2 +- .../prog/en/modules/opac-search-history.tt | 4 ++-- .../opac-tmpl/prog/en/modules/opac-shelves.tt | 2 +- .../opac-tmpl/prog/en/modules/opac-suggestions.tt | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 2 +- .../opac-tmpl/prog/en/modules/opac-userupdate.tt | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt index eed66d3..6af4781 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt @@ -54,8 +54,8 @@
    -[% INCLUDE 'navigation.inc' %] [% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' %]
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt index ebb1e26..61db54d 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt @@ -115,8 +115,8 @@
    -[% INCLUDE 'navigation.inc' %] [% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' %]
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt index 16c4532..8084a44 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt @@ -54,8 +54,8 @@
  • -[% INCLUDE 'navigation.inc' %] [% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' %]
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt index de34e02..6de1b6c 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt @@ -64,8 +64,8 @@
    -[% INCLUDE 'navigation.inc' %] [% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' %]
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt index 2c097b5..e3cf66e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt @@ -95,8 +95,8 @@ You have never borrowed anything from this library.
    -[% INCLUDE 'navigation.inc' %] [% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' %]
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt index e9f6be1..7c03d20 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt @@ -82,13 +82,13 @@ [% IF ( OpacNav ) %]
    -[% INCLUDE 'navigation.inc' %] [% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' %]
    [% ELSIF ( loggedinusername ) %]
    -[% INCLUDE 'navigation.inc' %] [% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' %]
    [% ELSE %] [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt index 344f822..0e035e9 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt @@ -601,8 +601,8 @@ $(function() { [% IF ( OpacNav||loggedinusername ) %]
    - [% INCLUDE 'navigation.inc' %] [% INCLUDE 'usermenu.inc' %] + [% INCLUDE 'navigation.inc' %]
    [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt index 3f3aa34..e65f286 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt @@ -212,8 +212,8 @@ $.tablesorter.addParser({
    -[% INCLUDE 'navigation.inc' %] [% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' %]
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt index e99d201..30b4f07 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt @@ -131,8 +131,8 @@ [% IF ( OpacNav||loggedinusername ) %]
    -[% INCLUDE 'navigation.inc' %] [% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' %]
    [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt index 9d7a2a7..f95d2d5 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -423,8 +423,8 @@ $.tablesorter.addParser({
    -[% INCLUDE 'navigation.inc' %] [% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' %]
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt index db5f7f5..08825eb 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt @@ -180,8 +180,8 @@
    -[% INCLUDE 'navigation.inc' %] [% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' %]
    -- 1.7.0.4 From magnus at enger.priv.no Fri Sep 2 11:53:18 2011 From: magnus at enger.priv.no (Magnus Enger) Date: Fri, 2 Sep 2011 11:53:18 +0200 Subject: [Koha-patches] =?utf-8?q?=5BPATCH_1/2=5D_Bug_6595=3A_=5BSIGNED-OF?= =?utf-8?q?F=5D_Add_German_translation_of_purchase_suggestion_mails?= Message-ID: <1314957199-12552-1-git-send-email-magnus@enger.priv.no> From: Katrin Fischer Translates the purchase suggestion mails in sample_notices.sql from English to German. Signed-off-by: Magnus Enger --- .../data/mysql/de-DE/mandatory/sample_notices.sql | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/installer/data/mysql/de-DE/mandatory/sample_notices.sql b/installer/data/mysql/de-DE/mandatory/sample_notices.sql index 6bb636a..84bdca6 100644 --- a/installer/data/mysql/de-DE/mandatory/sample_notices.sql +++ b/installer/data/mysql/de-DE/mandatory/sample_notices.sql @@ -12,7 +12,7 @@ VALUES ('circulation','ODUE','Mahnung','Mahnung','Liebe/r < ('circulation','CHECKIN','R?ckgabequittung (Zusammenfassung)','R?ckgabequittung','Die folgenden Medien wurden zur?ckgegeben:\r\n----\r\n<>\r\n----\r\nVielen Dank.'), ('circulation','CHECKOUT','Ausleihquittung (Zusammenfassung)','Ausleihquittung','Die folgenden Medien wurden entliehen:\r\n----\r\n<>\r\n----\r\nVielen Dank f?r Ihren Besuch in <>.'), ('reserves', 'HOLDPLACED', 'Neue Vormerkung', 'Neue Vormerkung','Folgender Titel wurde vorgemerkt: <> (<<biblionumber>>) durch den Benutzer <<firstname>> <<surname>> (<<cardnumber>>).'), -('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), -('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), -('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'), -('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'); +('suggestions','ACCEPTED','Anschaffungsvorschlag wurde angenommen', 'Ihr Anschaffungsvorschlag wurde angenommen','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> by <<suggestions.author>>.\n\nDie Bibliothek hat diesen Titel heute recherchiert und wird Ihn sobald wie m?glich im Buchhandel bestellen. Sie erhalten Nachricht, sobald die Bestellung abgeschlossen ist und sobald der Titel in der Bibliotek verf?gbar ist.\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'), +('suggestions','AVAILABLE','Vorgeschlagenes Medium verf?gbar', 'Das vorgeschlagene Medium ist jetzt verf?gbar','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> von <<suggestions.author>>.\n\nWir freuen uns Ihnen mitteilen zu k?nnen, dass dieser Titel jetzt im Bestand der Bibliothek verf?gbar ist.\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'), +('suggestions','ORDERED','Vorgeschlagenes Medium bestellt', 'Das vorgeschlagene Medium wurde im Buchhandel bestellt','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlaten: <<suggestions.title>> von <<suggestions.author>>.\n\nWir freuen uns Ihnen mitteilen zu k?nnen, dass dieser Titel jetzt im Buchhandel bestellt wurde. Nach Eintreffen wird er in unseren Bestand eingearbeitet.\n\nSie erhalten Nachricht, sobald das Medium verf?gbar ist.\n\nBei Nachfragen erreichen Sie uns unter der Emailadresse <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'), +('suggestions','REJECTED','Anschaffungsvorschlag nicht angenommen', 'Ihr Anschaffungsvorschlag wurde nicht angenommen','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haven der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> von <<suggestions.author>>.\n\nDie Bibliothek hat diesen Titel heute recherchiert und sich gegen eine Anschaffung entschieden.\n\nBegr?ndung: <<suggestions.reason>>\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'); -- 1.7.4.1 From magnus at enger.priv.no Fri Sep 2 11:53:19 2011 From: magnus at enger.priv.no (Magnus Enger) Date: Fri, 2 Sep 2011 11:53:19 +0200 Subject: [Koha-patches] =?utf-8?q?=5BPATCH_2/2=5D_Bug_6595=3A_=5BSIGNED-OF?= =?utf-8?q?F=5D_Fixing_German_translation_and_address_formatting_?= =?utf-8?b?KEhPTERfUFJJTlQp?= In-Reply-To: <1314957199-12552-1-git-send-email-magnus@enger.priv.no> References: <1314957199-12552-1-git-send-email-magnus@enger.priv.no> Message-ID: <1314957199-12552-2-git-send-email-magnus@enger.priv.no> From: Katrin Fischer <Katrin.Fischer.83 at web.de> Patch fixes some translation issues and address formatting for printed hold notices. Signed-off-by: Magnus Enger <magnus at enger.priv.no> --- .../data/mysql/de-DE/mandatory/sample_notices.sql | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/installer/data/mysql/de-DE/mandatory/sample_notices.sql b/installer/data/mysql/de-DE/mandatory/sample_notices.sql index 84bdca6..166c36d 100644 --- a/installer/data/mysql/de-DE/mandatory/sample_notices.sql +++ b/installer/data/mysql/de-DE/mandatory/sample_notices.sql @@ -8,7 +8,7 @@ VALUES ('circulation','ODUE','Mahnung','Mahnung','Liebe/r <<borrowers.firstname> ('circulation','PREDUE','Erinnerungsbenachrichtigung','Erinnerungsbenachrichtigung','Liebe/r <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nFolgende Ausleihe wird bald f?llig:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), ('circulation','PREDUEDGST','Erinnerungsbenachrichtigung (Zusammenfassung)','Erinnerungsbenachrichtigung','Sie haben <<count>> Ausleihen, die bald f?llig werden.'), ('reserves', 'HOLD', 'Vormerkbenachrichtigung', 'Vormerkung abholbereit in <<branches.branchname>>', 'Liebe/r <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nF?r Sie liegt seit <<reserves.waitingdate>> eine Vormerkung zur Abholung bereit:\r\n\r\nTitel: <<biblio.title>>\r\nVerfasser: <<biblio.author>>\r\nExemplar: <<items.copynumber>>\r\nStandort: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>\r\n<<branches.branchcity>> <<branches.branchzip>>'), -('reserves', 'HOLD_PRINT', 'Vormerkbenachrichtigung (gedruckte Benachrichtigung)', 'Vormerkung abholbereit (gedruckte Benachrichtigung)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\n?nderung angefra\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nF?r Sie liegt seit dem <<reserves.waitingdate>> eine Vormerkung zur Abholung bereit:\r\n\r\nTitel: <<biblio.title>>\r\nVerfasser: <<biblio.author>>\r\nExemplar: <<items.copynumber>>\r\n'), +('reserves', 'HOLD_PRINT', 'Vormerkbenachrichtigung (Print)', 'Vormerkbenachrichtigung (Print)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchzip>> <<branches.branchcity>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.address2>>\r\n<<borrowers.zipcode>> <<borrowers.city>>\r\n<<borrowers.country>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nLiebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nF?r Sie liegt seit dem <<reserves.waitingdate>> eine Vormerkung zur Abholung bereit:\r\n\r\nTitel: <<biblio.title>>\r\nVerfasser: <<biblio.author>>\r\nSignatur: <<items.itemcallnumber>>\r\n'), ('circulation','CHECKIN','R?ckgabequittung (Zusammenfassung)','R?ckgabequittung','Die folgenden Medien wurden zur?ckgegeben:\r\n----\r\n<<biblio.title>>\r\n----\r\nVielen Dank.'), ('circulation','CHECKOUT','Ausleihquittung (Zusammenfassung)','Ausleihquittung','Die folgenden Medien wurden entliehen:\r\n----\r\n<<biblio.title>>\r\n----\r\nVielen Dank f?r Ihren Besuch in <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Neue Vormerkung', 'Neue Vormerkung','Folgender Titel wurde vorgemerkt: <<title>> (<<biblionumber>>) durch den Benutzer <<firstname>> <<surname>> (<<cardnumber>>).'), -- 1.7.4.1 From alex.arnaud at biblibre.com Fri Sep 2 11:53:48 2011 From: alex.arnaud at biblibre.com (alex.arnaud at biblibre.com) Date: Fri, 2 Sep 2011 11:53:48 +0200 Subject: [Koha-patches] [PATCH] Bug 6835 - Ability to specify types of email address in overdue_notices.pl Message-ID: <1314957228-414-1-git-send-email-alex.arnaud@biblibre.com> From: Alex Arnaud <alex.arnaud at biblibre.com> --- C4/Members.pm | 30 ++++++++++++++++++++++++++++++ misc/cronjobs/overdue_notices.pl | 25 +++++++++++++++++++++++-- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index dcc168b..4a0fcbc 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -59,6 +59,7 @@ BEGIN { &getidcity &GetFirstValidEmailAddress + &GetValidEmailAddresses &GetAge &GetCities @@ -1361,6 +1362,35 @@ sub GetFirstValidEmailAddress { } } +=head2 GetValidEmailAddresses + + $email = GetValidEmailAddresses($borrowernumber); + +Return all the valid email address for a borrower, given the borrowernumber. Returns an hash. + +=cut + +sub GetValidEmailAddresses { + my $borrowernumber = shift; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare( "SELECT email, emailpro, B_email FROM borrowers where borrowernumber = ? "); + $sth->execute( $borrowernumber ); + my $data = $sth->fetchrow_hashref; + my %mailhash; + + if ($data->{'email'}) { + $mailhash{'email'} = $data->{'email'}; + } + if ($data->{'emailpro'}) { + $mailhash{'emailpro'} = $data->{'emailpro'}; + } + if ($data->{'B_email'}) { + $mailhash{'B_email'} = $data->{'B_email'}; + } + return \%mailhash; +} + + =head2 GetExpiryDate $expirydate = GetExpiryDate($categorycode, $dateenrolled); diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 37774b5..6ba76f8 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -47,7 +47,7 @@ overdue_notices.pl - prepare messages to be sent to patrons for overdue items =head1 SYNOPSIS -overdue_notices.pl [ -n ] [ -library <branchcode> ] [ -library <branchcode>...] [ -max <number of days> ] [ -csv [ <filename> ] ] [ -itemscontent <field list> ] +overdue_notices.pl [ -n ] [ -library <branchcode> ] [ -library <branchcode>...] [ -max <number of days> ] [ -csv [ <filename> ] ] [ -itemscontent <field list> ] [ -email <email_type>...] Options: -help brief help message @@ -60,6 +60,7 @@ overdue_notices.pl [ -n ] [ -library <branchcode> ] [ -library <branchcode>...] -itemscontent <list of fields> item information in templates -borcat <categorycode> category code that must be included -borcatout <categorycode> category code that must be excluded + -email <email_type> type of email that will be used. Can be 'email', 'emailpro' or 'B_email'. Repeatable. =head1 OPTIONS @@ -143,6 +144,10 @@ Default items.content lists only those items that fall in the range of the currently processing notice. Choose list-all to include all overdue items in the list (limited by B<-max> setting). +=item B<-email> + +Allows to specify which type of email will be used. Can be email, emailpro or B_email. Repeatable. + =back =head1 DESCRIPTION @@ -252,6 +257,8 @@ my $verbose = 0; my $nomail = 0; my $MAX = 90; my @branchcodes; # Branch(es) passed as parameter +my @emails_to_use; # Emails to use for messaging +my @emails; # Emails given in command-line parameters my $csvfilename; my $htmlfilename; my $triggered = 0; @@ -274,6 +281,7 @@ GetOptions( 't|triggered' => \$triggered, 'borcat=s' => \@myborcat, 'borcatout=s' => \@myborcatout, + 'email=s' => \@emails, ) or pod2usage(2); pod2usage(1) if $help; pod2usage( -verbose => 2 ) if $man; @@ -458,6 +466,18 @@ END_SQL $address1, $address2, $city, $postcode, $country, $email, $longest_issue ) = $sth->fetchrow ) { + @emails_to_use = (); + if (@emails && !$nomail) { + my $validemails = C4::Members::GetValidEmailAddresses($borrowernumber); + foreach (@emails) { + push @emails_to_use, $validemails->{$_} if (defined $validemails->{$_}); + } + $email = 1 if (@emails_to_use); + } else { + $email=C4::Members::GetFirstValidEmailAddress($borrowernumber); + push @emails_to_use, $email; + } + $verbose and warn "borrower $firstname, $lastname ($borrowernumber) has $itemcount items triggering level $i."; my $letter = C4::Letters::getletter( 'circulation', $overdue_rules->{"letter$i"} ); @@ -539,12 +559,13 @@ END_SQL } ); } else { - if ($email) { + if (scalar(@emails_to_use) > 0 ) { C4::Letters::EnqueueLetter( { letter => $letter, borrowernumber => $borrowernumber, message_transport_type => 'email', from_address => $admin_email_address, + to_address => join(',', @emails_to_use), } ); } else { -- 1.7.0.4 From henridamien.laurent at biblibre.com Fri Sep 2 12:31:49 2011 From: henridamien.laurent at biblibre.com (Henri-Damien LAURENT) Date: Fri, 2 Sep 2011 12:31:49 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] BUG6271 renewals in both items and issues tables Message-ID: <1314959509-26522-1-git-send-email-henridamien.laurent@biblibre.com> From: Fridolyn SOMERS <fridolyn.somers at progilone.fr> Signed-off-by: Henri-Damien LAURENT <henridamien.laurent at biblibre.com> --- C4/Accounts.pm | 2 +- C4/Circulation.pm | 8 +++++--- C4/Overdues.pm | 3 ++- misc/cronjobs/advance_notices.pl | 4 ++-- misc/cronjobs/overdue_notices.pl | 3 ++- tools/inventory.pl | 6 +++++- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index eea142c..1481bfc 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -295,7 +295,7 @@ sub chargelostitem{ my $dbh = C4::Context->dbh(); my ($itemnumber) = @_; - my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title + my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title,issues.renewals AS renewals,items.renewals AS totalrenewals FROM issues JOIN items USING (itemnumber) JOIN biblio USING (biblionumber) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 47068f9..02aa9c9 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1960,7 +1960,7 @@ sub GetItemIssue { my ($itemnumber) = @_; return unless $itemnumber; my $sth = C4::Context->dbh->prepare( - "SELECT * + "SELECT *,issues.renewals AS renewals,items.renewals AS totalrenewals FROM issues LEFT JOIN items ON issues.itemnumber=items.itemnumber WHERE issues.itemnumber=?"); @@ -2011,13 +2011,15 @@ sub GetItemIssues { my ( $itemnumber, $history ) = @_; my $today = C4::Dates->today('iso'); # get today date - my $sql = "SELECT * FROM issues + my $sql = "SELECT *,issues.renewals AS renewals,items.renewals AS totalrenewals + FROM issues JOIN borrowers USING (borrowernumber) JOIN items USING (itemnumber) WHERE issues.itemnumber = ? "; if ($history) { $sql .= "UNION ALL - SELECT * FROM old_issues + SELECT *,old_issues.renewals AS renewals,items.renewals AS totalrenewals + FROM old_issues LEFT JOIN borrowers USING (borrowernumber) JOIN items USING (itemnumber) WHERE old_issues.itemnumber = ? "; diff --git a/C4/Overdues.pm b/C4/Overdues.pm index 28b135c..6ba733d 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -166,7 +166,8 @@ Returns a count and a list of overdueitems for a given borrowernumber sub checkoverdues { my $borrowernumber = shift or return; my $sth = C4::Context->dbh->prepare( - "SELECT * FROM issues + "SELECT *,issues.renewals AS renewals,items.renewals AS totalrenewals + FROM issues LEFT JOIN items ON issues.itemnumber = items.itemnumber LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl index 3ca4835..f1e912c 100755 --- a/misc/cronjobs/advance_notices.pl +++ b/misc/cronjobs/advance_notices.pl @@ -123,7 +123,7 @@ my $due_digest; my $dbh = C4::Context->dbh(); my $sth = $dbh->prepare(<<'END_SQL'); -SELECT biblio.*, items.*, issues.* +SELECT biblio.*, items.*, issues.*,issues.renewals AS renewals, items.renewals AS totalrenewals FROM issues,items,biblio WHERE items.itemnumber=issues.itemnumber AND biblio.biblionumber=items.biblionumber @@ -231,7 +231,7 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { # Now, run through all the people that want digests and send them $sth = $dbh->prepare(<<'END_SQL'); -SELECT biblio.*, items.*, issues.* +SELECT biblio.*, items.*, issues.*, ,issues.renewals AS renewals, items.renewals AS totalrenewals FROM issues,items,biblio WHERE items.itemnumber=issues.itemnumber AND biblio.biblionumber=items.biblionumber diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 37774b5..8d7866c 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -375,7 +375,8 @@ foreach my $branchcode (@branches) { $verbose and warn sprintf "branchcode : '%s' using %s\n", $branchcode, $admin_email_address; my $sth2 = $dbh->prepare( <<'END_SQL' ); -SELECT biblio.*, items.*, issues.*, biblioitems.itemtype, TO_DAYS(NOW())-TO_DAYS(date_due) AS days_overdue +SELECT biblio.*, items.*, issues.*, biblioitems.itemtype, TO_DAYS(NOW())-TO_DAYS(date_due) AS days_overdue, + issues.renewals AS renewals, items.renewals AS totalrenewals FROM issues,items,biblio, biblioitems WHERE items.itemnumber=issues.itemnumber AND biblio.biblionumber = items.biblionumber diff --git a/tools/inventory.pl b/tools/inventory.pl index 5e7b198..5030f1d 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -142,7 +142,11 @@ if ($uploadbarcodes && length($uploadbarcodes)>0){ my $dbh=C4::Context->dbh; my $date = format_date_in_iso($input->param('setdate')) || C4::Dates->today('iso'); # warn "$date"; - my $strsth="select * from issues, items where items.itemnumber=issues.itemnumber and items.barcode =?"; + my $strsth="SELECT *,issues.renewals AS renewals,items.renewals AS totalrenewals + FROM issues, items + WHERE items.itemnumber=issues.itemnumber + AND items.barcode =? + "; my $qonloan = $dbh->prepare($strsth); $strsth="select * from items where items.barcode =? and items.wthdrawn = 1"; my $qwthdrawn = $dbh->prepare($strsth); -- 1.7.1 From katrin.fischer at bsz-bw.de Fri Sep 2 14:15:32 2011 From: katrin.fischer at bsz-bw.de (Katrin Fischer) Date: Fri, 02 Sep 2011 12:15:32 -0000 Subject: [Koha-patches] [PATCH 1/2] [SIGNED-OFF] Fix for Bug 6458 - incorrect parsing result in translation processing Message-ID: <1281487087-26179-1-git-send-email-katrin.fischer@bsz-bw.de> From: Owen Leonard <oleonard at myacpl.org> Fixing improperly nested template logic inside HTML tags in member entry form. Signed-off-by: Katrin Fischer <katrin.fischer at bsz-bw.de> Fixes lots of problems. Spotted one small problem. I am sending a follow-up. --- .../prog/en/modules/members/memberentrygen.tt | 272 ++++++++++++++++---- 1 files changed, 226 insertions(+), 46 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 8a34bb1..a0ddf20 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -203,9 +203,17 @@ [% END %] Surname: </label> [% IF ( uppercasesurnames ) %] - <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20" value="[% surname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20" value="[% surname %]" onclick="this.value=''" /> + [% ELSE %] + <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20" value="[% surname %]" /> + [% END %] [% ELSE %] - <input type="text" id="surname" name="surname" size="20" value="[% surname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="surname" name="surname" size="20" value="[% surname %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="surname" name="surname" size="20" value="[% surname %]" /> + [% END %] [% END %] [% IF ( mandatorysurname ) %]<span class="required">Required</span>[% END %] </li> @@ -255,7 +263,11 @@ <label for="initials"> [% END %] Initials: </label> - <input type="text" id="initials" name="initials" size="20" value="[% initials %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="initials" name="initials" size="20" value="[% initials %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="initials" name="initials" size="20" value="[% initials %]" /> + [% END %] [% IF ( mandatoryinitials ) %]<span class="required">Required</span>[% END %] </li> [% END %] @@ -266,7 +278,11 @@ <label for="othernames"> [% END %] Other name: </label> - <input type="text" id="othernames" name="othernames" size="20" value="[% othernames %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="othernames" name="othernames" size="20" value="[% othernames %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="othernames" name="othernames" size="20" value="[% othernames %]" /> + [% END %] [% IF ( mandatoryothernames ) %]<span class="required">Required</span>[% END %] [% IF ( I ) %]<input type="hidden" name="sex" value="N" />[% END %] </li> @@ -311,7 +327,11 @@ <span>[% contactname %]</span> <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" /> [% ELSE %] - <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" onclick="this.value=''" /> + [% ELSE %] + <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" /> + [% END %] [% END %] </li> [% ELSE %] @@ -329,7 +349,11 @@ <span>[% contactname %]</span> <input name="contactname" id="contactname" type="hidden" size="20" value="[% contactname %]" /> [% ELSE %] - <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" onclick="this.value=''" /> + [% ELSE %] + <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" /> + [% END %] [% END %] </li> <li> @@ -338,7 +362,11 @@ <span>[% contactfirstname %]</span> <input name="contactfirstname" id="contactfirstname" type="hidden" size="20" value="[% contactfirstname %]" /> [% ELSE %] - <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="[% contactfirstname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="[% contactfirstname %]" onclick="this.value=''" /> + [% ELSE %] + <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="[% contactfirstname %]" /> + [% END %] [% END %] </li> [% IF ( relshiploop ) %] @@ -379,7 +407,11 @@ <label for="streetnumber"> [% END %] Street number: </label> - <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" /> + [% END %] [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %] </li> [% IF ( road_cgipopup ) %] @@ -401,7 +433,11 @@ <label for="address"> [% END %] Address: </label> - <input type="text" id="address" name="address" size="35" value="[% address %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="address" name="address" size="35" value="[% address %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="address" name="address" size="35" value="[% address %]" /> + [% END %] [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -411,7 +447,11 @@ <label for="address2"> [% END %] Address 2: </label> - <input type="text" id="address2" name="address2" size="35" value="[% address2 %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="address2" name="address2" size="35" value="[% address2 %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="address2" name="address2" size="35" value="[% address2 %]" /> + [% END %] [% IF ( mandatoryaddress2 ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -421,8 +461,11 @@ <label for="city"> [% END %] City: </label> - - <input type="text" id="city" name="city" size="20" value="[% city %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="city" name="city" size="20" value="[% city %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="city" name="city" size="20" value="[% city %]" /> + [% END %] [% IF ( city_cgipopup ) %]or <strong>choose</strong> <select id="select_city" name="select_city"> [% FOREACH city_loo IN city_loop %] @@ -455,7 +498,11 @@ <label for="zipcode"> [% END %] Zip/Postal code: </label> - <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" /> + [% END %] [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %] </li> @@ -466,7 +513,11 @@ <label for="country"> [% END %] Country: </label> - <input type="text" name="country" id="country" size="20" value="[% country %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" name="country" id="country" size="20" value="[% country %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" name="country" id="country" size="20" value="[% country %]" /> + [% END %] [% IF ( mandatorycountry ) %]<span class="required">Required</span>[% END %] </li> @@ -481,7 +532,11 @@ <label for="phone"> [% END %] Primary Phone: </label> - <input type="text" id="phone" name="phone" value="[% phone %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="phone" name="phone" value="[% phone %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="phone" name="phone" value="[% phone %]" /> + [% END %] [% IF ( mandatoryphone ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div> </li> @@ -492,7 +547,11 @@ <label for="phonepro"> [% END %] Secondary Phone: </label> - <input type="text" id="phonepro" name="phonepro" value="[% phonepro %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="phonepro" name="phonepro" value="[% phonepro %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="phonepro" name="phonepro" value="[% phonepro %]" /> + [% END %] [% IF ( mandatoryphonepro ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -502,7 +561,11 @@ <label for="mobile"> [% END %] Other Phone: </label> - <input type="text" id="mobile" name="mobile" value="[% mobile %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="mobile" name="mobile" value="[% mobile %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="mobile" name="mobile" value="[% mobile %]" /> + [% END %] [% IF ( mandatorymobile ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -512,7 +575,11 @@ <label for="email"> [% END %] Primary Email: </label> - <input type="text" id="email" name="email" size="45" value="[% email %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="email" name="email" size="45" value="[% email %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="email" name="email" size="45" value="[% email %]" /> + [% END %] [% IF ( mandatoryemail ) %]<span class="required">Required</span>[% END %]<div class="hint">Shows on transit slips</div> </li> @@ -523,7 +590,11 @@ <label for="emailpro"> [% END %] Secondary Email: </label> - <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="emailpro" name="emailpro" size="45" value="[% emailpro %]" /> + [% END %] [% IF ( mandatoryemailpro ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -533,7 +604,11 @@ <label for="fax"> [% END %] Fax: </label> - <input type="text" id="fax" name="fax" value="[% fax %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="fax" name="fax" value="[% fax %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="fax" name="fax" value="[% fax %]" /> + [% END %] [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %] </li> </ol> @@ -553,7 +628,11 @@ <label for="B_address"> [% END %] Address: </label> - <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" /> + [% END %] [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -563,7 +642,11 @@ <label for="B_address2"> [% END %] Address 2: </label> - <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]" /> + [% END %] [% IF ( mandatoryB_address2 ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -593,7 +676,11 @@ <label for="B_zipcode"> [% END %] Zip/Postal code: </label> - <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" /> + [% END %] [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -603,7 +690,11 @@ <label for="B_country"> [% END %] Country: </label> - <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]" /> + [% END %] [% IF ( mandatoryB_country ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -612,8 +703,12 @@ [% ELSE %] <label for="B_phone"> [% END %] - Phone: </label> - <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + Phone: </label> + [% IF ( opduplicate ) %] + <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]" /> + [% END %] [% IF ( mandatoryB_phone ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -623,7 +718,11 @@ <label for="B_email"> [% END %] Email: </label> - <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" /> + [% END %] [% IF ( mandatoryB_email ) %]<span class="required">Required</span>[% END %] </li> <li> [% IF ( mandatorycontactnote ) %] @@ -648,7 +747,11 @@ <label for="altcontactsurname"> [% END %] Surname:</label> - <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]" /> + [% END %] [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -658,7 +761,11 @@ <label for="altcontactfirstname"> [% END %] First name:</label> - <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]" /> + [% END %] [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -668,7 +775,11 @@ <label for="altcontactaddress1"> [% END %] Address:</label> - <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] size="40" /> + [% IF ( opduplicate ) %] + <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" onclick="this.value=''" size="40" /> + [% ELSE %] + <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40" /> + [% END %] [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -678,7 +789,11 @@ <label for="altcontactaddress2"> [% END %] Address 2:</label> - <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] size="40" /> + [% IF ( opduplicate ) %] + <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]" onclick="this.value=''" size="40" /> + [% ELSE %] + <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]" size="40" /> + [% END %] [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -708,7 +823,11 @@ <label for="altcontactzipcode"> [% END %] Zip/Postal code:</label> - <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] size="5" /> + [% IF ( opduplicate ) %] + <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" onclick="this.value=''" size="5" /> + [% ELSE %] + <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5" /> + [% END %] [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -718,7 +837,11 @@ <label for="altcontactcountry"> [% END %] Country:</label> - <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] size="20" /> + [% IF ( opduplicate ) %] + <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]" onclick="this.value=''" size="20" /> + [% ELSE %] + <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]" size="20" /> + [% END %] [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %] </li> <li> @@ -728,7 +851,11 @@ <label for="altcontactphone"> [% END %] Phone:</label> - <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" /> + [% END %] [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %] </li> </ol> @@ -745,7 +872,11 @@ <label for="cardnumber"> [% END %] Card number: </label> - <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% IF ( opduplicate ) %][% ELSE %][% cardnumber %][% END %]" /> + [% IF ( opduplicate ) %] + <input type="text" id="cardnumber" name="cardnumber" size="20" /> + [% ELSE %] + <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" /> + [% END %] [% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]</li> <li> [% IF ( mandatorybranchcode ) %] @@ -806,7 +937,11 @@ [% IF ( CGIsort2 ) %] [% CGIsort2 %] [% ELSE %] - <input type="text" id="sort2" name="sort2" size="20" value="[% sort2 %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + [% IF ( opduplicate ) %] + <input type="text" id="sort2" name="sort2" size="20" value="[% sort2 %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="sort2" name="sort2" size="20" value="[% sort2 %]" /> + [% END %] [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %] [% END %] </li> @@ -821,7 +956,11 @@ <label for="dateenrolled"> [% END %] Registration date: </label> - <input type="text" id="dateenrolled" name="dateenrolled" maxlength="10" size="10" [% IF ( metric ) %]onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');"[% END %] value="[% dateenrolled %]" /> + [% IF ( metric ) %] + <input type="text" id="dateenrolled" name="dateenrolled" maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="[% dateenrolled %]" /> + [% ELSE %] + <input type="text" id="dateenrolled" name="dateenrolled" maxlength="10" size="10" value="[% dateenrolled %]" /> + [% END %] <img src="[% themelang %]/lib/calendar/cal.gif" id="dateenrolled_button" alt="Show Calendar" /> <script language="JavaScript" type="text/javascript"> Calendar.setup( @@ -843,7 +982,19 @@ <label for="dateexpiry"> [% END %] Expiry date (leave blank for auto calc) </label> - <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10" size="10" [% IF ( metric ) %]onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');"[% END %] value="[% UNLESS ( opadd ) %][% dateexpiry %][% END %]" /> + [% IF ( metric ) %] + [% UNLESS ( opadd ) %] + <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10" size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="[% dateexpiry %]" /> + [% ELSE %] + <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10" size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" /> + [% END %] + [% ELSE %] + [% UNLESS ( opadd ) %] + <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10" size="10" value="[% dateexpiry %]" /> + + <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10" size="10" value="[% UNLESS ( opadd ) %][% dateexpiry %][% END %]" /> + [% END %] + [% END %] <img src="[% themelang %]/lib/calendar/cal.gif" id="dateexpiry_button" alt="Show Calendar" /> <script language="JavaScript" type="text/javascript"> Calendar.setup( @@ -893,9 +1044,17 @@ Username: </label> [% IF ( NoUpdateLogin ) %] -<input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% IF ( opduplicate ) %][% ELSE %][% userid %][% END %]" /> + [% IF ( opduplicate ) %] + <input type="text" id="userid" name="userid" size="20" disabled="disabled" /> + [% ELSE %] + <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% userid %]" /> + [% END %] [% ELSE %] -<input type="text" id="userid" name="userid" size="20" value="[% IF ( opduplicate ) %][% ELSE %][% userid %][% END %]" /> + [% IF ( opduplicate ) %] + <input type="text" id="userid" name="userid" size="20" value="" /> + [% ELSE %] + <input type="text" id="userid" name="userid" size="20" value="[% userid %]" /> + [% END %] [% END %] [% IF ( mandatoryuserid ) %]<span class="required">Required</span>[% END %] @@ -909,16 +1068,28 @@ Password: </label> [% IF ( opadd ) %] [% IF ( NoUpdateLogin ) %] - <input type="text" id="password" name="password" size="20" disabled="disabled" value="[% IF ( opduplicate ) %][% ELSE %][% password %][% END %]" /> + [% IF ( opduplicate ) %] + <input type="text" id="password" name="password" size="20" disabled="disabled" /> + [% ELSE %] + <input type="text" id="password" name="password" size="20" disabled="disabled" value="[% password %]" /> + [% END %] [% ELSE %] - <input type="text" id="password" name="password" size="20" value="[% IF ( opduplicate ) %][% ELSE %][% password %][% END %]" /> + [% IF ( opduplicate ) %] + <input type="text" id="password" name="password" size="20" /> + [% ELSE %] + <input type="text" id="password" name="password" size="20" value="[% password %]" /> + [% END %] [% END %] [% ELSE %] [% IF ( password ) %] [% IF ( NoUpdateLogin ) %] <input type="text" id="password" name="password" size="20" disabled="disabled" value="****" /> [% ELSE %] - <input type="text" id="password" name="password" size="20" value="[% IF ( opduplicate ) %][% ELSE %]****[% END %]" /> + [% IF ( opduplicate ) %] + <input type="text" id="password" name="password" size="20" /> + [% ELSE %] + <input type="text" id="password" name="password" size="20" value="****" /> + [% END %] [% END %] [% ELSE %] [% IF ( NoUpdateLogin ) %] @@ -995,8 +1166,13 @@ [% END %] </select> [% ELSE %] + [% IF ( opduplicate ) %] <input type="text" maxlength="64" value="[% patron_attribute.value %]" - id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]"[% IF ( patron_attribute.opduplicate ) %] onclick="this.value=''"[% END %] /> + id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" maxlength="64" value="[% patron_attribute.value %]" + id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]" /> + [% END %] [% END %] [% IF ( patron_attribute.password_allowed ) %] (Password: <input type="password" maxlength="64" value="[% patron_attribute.password %]" @@ -1070,8 +1246,12 @@ [% END %] [% INCLUDE 'messaging-preference-form.inc' %] [% IF ( SMSSendDriver ) %] - <p><label for="SMSnumber">SMS number:</label> - <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]"[% IF ( opduplicate ) %] onclick="this.value=''"[% END %] /> + <p><label for="SMSnumber">SMS number:</label> + [% IF ( opduplicate ) %] + <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" onclick="this.value=''" /> + [% ELSE %] + <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" /> + [% END %] </p> [% END %] </fieldset> -- 1.6.3.3 From katrin.fischer at bsz-bw.de Fri Sep 2 14:15:54 2011 From: katrin.fischer at bsz-bw.de (Katrin Fischer) Date: Fri, 02 Sep 2011 12:15:54 -0000 Subject: [Koha-patches] [PATCH 2/2] Fix for Bug 6458 Follow-up for memberentrygen.tt In-Reply-To: <1281487087-26179-1-git-send-email-katrin.fischer@bsz-bw.de> References: <1281487087-26179-1-git-send-email-katrin.fischer@bsz-bw.de> Message-ID: <1281487087-26179-2-git-send-email-katrin.fischer@bsz-bw.de> The registration date field would show up twice after applying the first patch for memberentrygen.tt. This patch fixes the problem. --- .../prog/en/modules/members/memberentrygen.tt | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index a0ddf20..47ea6c9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -991,8 +991,8 @@ [% ELSE %] [% UNLESS ( opadd ) %] <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10" size="10" value="[% dateexpiry %]" /> - - <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10" size="10" value="[% UNLESS ( opadd ) %][% dateexpiry %][% END %]" /> + [% ELSE %] + <input type="text" id="dateexpiry" name="dateexpiry" maxlength="10" size="10" /> [% END %] [% END %] <img src="[% themelang %]/lib/calendar/cal.gif" id="dateexpiry_button" alt="Show Calendar" /> -- 1.6.3.3 From katrin.fischer at bsz-bw.de Fri Sep 2 14:35:02 2011 From: katrin.fischer at bsz-bw.de (Katrin Fischer) Date: Fri, 02 Sep 2011 12:35:02 -0000 Subject: [Koha-patches] [PATCH] Fix for Bug 6458 - incorrect parsing result in translation processing Message-ID: <1281488258-26508-1-git-send-email-katrin.fischer@bsz-bw.de> From: Owen Leonard <oleonard at myacpl.org> Correction for patron-attr-types.tt stops tag attribute markup from being passed to the template directly in favor of using template logic. Signed-off-by: Katrin Fischer <katrin.fischer at bsz-bw.de> Read the patch and tested the page, didn't find any problems. --- admin/patron-attr-types.pl | 24 +++++----- .../prog/en/modules/admin/patron-attr-types.tt | 46 +++++++++++++++++-- 2 files changed, 53 insertions(+), 17 deletions(-) diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl index 1dfe442..227213c 100755 --- a/admin/patron-attr-types.pl +++ b/admin/patron-attr-types.pl @@ -92,19 +92,19 @@ sub error_add_attribute_type_form { $template->param(description => $input->param('description')); if ($input->param('repeatable')) { - $template->param(repeatable_checked => 'checked="checked"'); + $template->param(repeatable_checked => 1); } if ($input->param('unique_id')) { - $template->param(unique_id_checked => 'checked="checked"'); + $template->param(unique_id_checked => 1); } if ($input->param('password_allowed')) { - $template->param(password_allowed_checked => 'checked="checked"'); + $template->param(password_allowed_checked => 1); } if ($input->param('opac_display')) { - $template->param(opac_display_checked => 'checked="checked"'); + $template->param(opac_display_checked => 1); } if ($input->param('staff_searchable')) { - $template->param(staff_searchable_checked => 'checked="checked"'); + $template->param(staff_searchable_checked => 1); } $template->param( @@ -206,21 +206,21 @@ sub edit_attribute_type_form { $template->param(description => $attr_type->description()); if ($attr_type->repeatable()) { - $template->param(repeatable_checked => 'checked="checked"'); + $template->param(repeatable_checked => 1); } - $template->param(repeatable_disabled => 'disabled="disabled"'); + $template->param(repeatable_disabled => 1); if ($attr_type->unique_id()) { - $template->param(unique_id_checked => 'checked="checked"'); + $template->param(unique_id_checked => 1); } - $template->param(unique_id_disabled => 'disabled="disabled"'); + $template->param(unique_id_disabled => 1); if ($attr_type->password_allowed()) { - $template->param(password_allowed_checked => 'checked="checked"'); + $template->param(password_allowed_checked => 1); } if ($attr_type->opac_display()) { - $template->param(opac_display_checked => 'checked="checked"'); + $template->param(opac_display_checked => 1); } if ($attr_type->staff_searchable()) { - $template->param(staff_searchable_checked => 'checked="checked"'); + $template->param(staff_searchable_checked => 1); } authorised_value_category_list($template, $attr_type->authorised_value_category()); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt index 105d268..c42d7b3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt @@ -101,25 +101,61 @@ function CheckAttributeTypeForm(f) { value="[% description |html %]" /> </li> <li><label for="repeatable">Repeatable: </label> - <input type="checkbox" id="repeatable" name="repeatable" [% repeatable_checked %] [% repeatable_disabled %] /> + [% IF ( repeatable_checked ) %] + [% IF ( repeatable_disabled ) %] + <input type="checkbox" id="repeatable" name="repeatable" checked="checked" disabled="disabled" /> + [% ELSE %] + <input type="checkbox" id="repeatable" name="repeatable" checked="checked" /> + [% END %] + [% ELSE %] + [% IF ( repeatable_disabled ) %] + <input type="checkbox" id="repeatable" name="repeatable" disabled="disabled" /> + [% ELSE %] + <input type="checkbox" id="repeatable" name="repeatable" /> + [% END %] + [% END %] <span>Check to let a patron record have multiple values of this attribute. This setting cannot be changed after an attribute is defined.</span> </li> <li><label for="unique_id">Unique identifier: </label> - <input type="checkbox" id="unique_id" name="unique_id" [% unique_id_checked %] [% unique_id_disabled %] /> + [% IF ( unique_id_checked ) %] + [% IF ( unique_id_disabled ) %] + <input type="checkbox" id="unique_id" name="unique_id" checked="checked" disabled="disabled" /> + [% ELSE %] + <input type="checkbox" id="unique_id" name="unique_id" checked="checked" /> + [% END %] + [% ELSE %] + [% IF ( unique_id_disabled ) %] + <input type="checkbox" id="unique_id" name="unique_id" disabled="disabled" /> + [% ELSE %] + <input type="checkbox" id="unique_id" name="unique_id" /> + [% END %] + [% END %] <span>If checked, attribute will be a unique identifier — if a value is given to a patron record, the same value cannot be given to a different record. This setting cannot be changed after an attribute is defined.</span> </li> <li><label for="password_allowed">Allow password: </label> - <input type="checkbox" id="password_allowed" name="password_allowed" [% password_allowed_checked %] /> + [% IF ( password_allowed_checked ) %] + <input type="checkbox" id="password_allowed" name="password_allowed" checked="checked" /> + [% ELSE %] + <input type="checkbox" id="password_allowed" name="password_allowed" /> + [% END %] <span>Check to make it possible to associate a password with this attribute.</span> </li> <li><label for="opac_display">Display in OPAC: </label> - <input type="checkbox" id="opac_display" name="opac_display" [% opac_display_checked %] /> + [% IF ( opac_display_checked ) %] + <input type="checkbox" id="opac_display" name="opac_display" checked="checked" /> + [% ELSE %] + <input type="checkbox" id="opac_display" name="opac_display" /> + [% END %] <span>Check to display this attribute on a patron's details page in the OPAC.</span> </li> <li><label for="staff_searchable">Searchable: </label> - <input type="checkbox" id="staff_searchable" name="staff_searchable" [% staff_searchable_checked %] /> + [% IF ( staff_searchable_checked ) %] + <input type="checkbox" id="staff_searchable" name="staff_searchable" checked="checked" /> + [% ELSE %] + <input type="checkbox" id="staff_searchable" name="staff_searchable" /> + [% END %] <span>Check to make this attribute staff_searchable in the staff patron search.</span> </li> <li><label for="authorised_value_category">Authorized value category: </label> -- 1.6.3.3 From alex.arnaud at biblibre.com Fri Sep 2 14:36:38 2011 From: alex.arnaud at biblibre.com (alex.arnaud at biblibre.com) Date: Fri, 2 Sep 2011 14:36:38 +0200 Subject: [Koha-patches] [PATCH] Bug 4966 - follow up - add xhtml closure for input tags Message-ID: <1314966998-2654-1-git-send-email-alex.arnaud@biblibre.com> From: Alex Arnaud <alex.arnaud at biblibre.com> --- .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index 313dbe7..e67b82e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -333,9 +333,9 @@ <!--<form action="/cgi-bin/koha/acqui/parcels.pl?supplierid=[% supplierid %]" method="post">--> <form action="parcels.pl?supplierid=[% supplierid %]" method="post"> - <input type="hidden" name="supplierid" value="[% supplierid %]"> + <input type="hidden" name="supplierid" value="[% supplierid %]" /> <fieldset class="action"> - <input type="submit" value="Finish receiving"> + <input type="submit" value="Finish receiving" /> </fieldset> </form> -- 1.7.0.4 From katrin.fischer at bsz-bw.de Fri Sep 2 16:03:14 2011 From: katrin.fischer at bsz-bw.de (Katrin Fischer) Date: Fri, 2 Sep 2011 16:03:14 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 6458 - incorrect parsing result in translation processing Message-ID: <1314972194-27058-1-git-send-email-katrin.fischer@bsz-bw.de> From: Owen Leonard <oleonard at myacpl.org> Correction in opac holds template. Corrections made are logically consistent, but I couldn't reproduce the combination of factors to trigger the "disabled" attribute on the branch selector. In that respect this hasn't been tested 100%. Signed-off-by: Katrin Fischer <katrin.fischer at bsz-bw.de> --- .../opac-tmpl/prog/en/modules/opac-reserve.tt | 33 +++++++++++++------ 1 files changed, 22 insertions(+), 11 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt index 4d81a17..543b469 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt @@ -423,17 +423,28 @@ [% IF ( bibitemloo.holdable ) %] [% IF ( choose_branch ) %] <td> - <select name="branch" id="branch_[% bibitemloo.biblionumber %]" - [% UNLESS ( bibitemloo.holdable ) %]disabled="disabled"[% END %] > - [% FOREACH branchChoicesLoo IN bibitemloo.branchChoicesLoop %] - [% IF ( branchChoicesLoo.selected ) %] - <option value="[% branchChoicesLoo.value %]" selected="selected">[% branchChoicesLoo.branchname %]</option> - [% ELSE %] - <option value="[% branchChoicesLoo.value %]">[% branchChoicesLoo.branchname %]</option> - [% END %] - [% END %] - </select> - </td> + [% UNLESS ( bibitemloo.holdable ) %] + <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled"> + [% FOREACH branchChoicesLoo IN bibitemloo.branchChoicesLoop %] + [% IF ( branchChoicesLoo.selected ) %] + <option value="[% branchChoicesLoo.value %]" selected="selected">[% branchChoicesLoo.branchname %]</option> + [% ELSE %] + <option value="[% branchChoicesLoo.value %]">[% branchChoicesLoo.branchname %]</option> + [% END %] + [% END %] + </select> + [% ELSE %] + <select name="branch" id="branch_[% bibitemloo.biblionumber %]"> + [% FOREACH branchChoicesLoo IN bibitemloo.branchChoicesLoop %] + [% IF ( branchChoicesLoo.selected ) %] + <option value="[% branchChoicesLoo.value %]" selected="selected">[% branchChoicesLoo.branchname %]</option> + [% ELSE %] + <option value="[% branchChoicesLoo.value %]">[% branchChoicesLoo.branchname %]</option> + [% END %] + [% END %] + </select> + [% END %] + </td> [% END %] [% END %] [% END %] -- 1.6.3.3 From oleonard at myacpl.org Fri Sep 2 16:18:55 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 2 Sep 2011 10:18:55 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 6458 - incorrect parsing result in translation processing Message-ID: <1314973135-2737-1-git-send-email-oleonard@myacpl.org> There is template logic in manage-marc-import.tt which is intended to set the "selected" option for the framework chooser ("Add new bibliographic records into this framework"). However, I can't see any place in the code which sends the "selected" variable to the template, and I can't see any circumstance in which a value would be passed to the template. This patch removes the "selected" variable from the template. --- .../prog/en/modules/tools/manage-marc-import.tt | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt index b5083ae..3890efe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt @@ -157,9 +157,7 @@ $(document).ready(function(){ <select name="framework" id="frameworks"> <option value="">Default</option> [% FOREACH framework IN frameworks %] - <option value="[% framework.value %]" [% framework.selected %]> - [% framework.label %] - </option> + <option value="[% framework.value %]">[% framework.label %]</option> [% END %] </select> </fieldset> -- 1.7.3 From julian.maurice at biblibre.com Fri Sep 2 16:46:01 2011 From: julian.maurice at biblibre.com (Julian Maurice) Date: Fri, 2 Sep 2011 16:46:01 +0200 Subject: [Koha-patches] [PATCH] Bug 6836: Add jQuery dataTables plugin Message-ID: <1314974761-26617-1-git-send-email-julian.maurice@biblibre.com> This patch add the javascript library, a CSS (and image files from datatables.net) and another javascript file which provides some extra features. It also add a Perl module C4::Utils::Datatables which provides helpful functions for server-side processing --- C4/Utils/DataTables.pm | 306 ++++++++++++++++++++ koha-tmpl/intranet-tmpl/prog/en/css/datatables.css | 114 ++++++++ koha-tmpl/intranet-tmpl/prog/en/js/datatables.js | 280 ++++++++++++++++++ .../en/lib/jquery/plugins/jquery.dataTables.min.js | 153 ++++++++++ .../prog/img/datatables/back_disabled.jpg | Bin 0 -> 612 bytes .../prog/img/datatables/back_enabled.jpg | Bin 0 -> 807 bytes .../prog/img/datatables/forward_disabled.jpg | Bin 0 -> 635 bytes .../prog/img/datatables/forward_enabled.jpg | Bin 0 -> 852 bytes .../intranet-tmpl/prog/img/datatables/sort_asc.png | Bin 0 -> 263 bytes .../prog/img/datatables/sort_asc_disabled.png | Bin 0 -> 252 bytes .../prog/img/datatables/sort_both.png | Bin 0 -> 282 bytes .../prog/img/datatables/sort_desc.png | Bin 0 -> 260 bytes .../prog/img/datatables/sort_desc_disabled.png | Bin 0 -> 251 bytes koha-tmpl/opac-tmpl/prog/en/css/datatables.css | 114 ++++++++ koha-tmpl/opac-tmpl/prog/en/js/datatables.js | 281 ++++++++++++++++++ .../en/lib/jquery/plugins/jquery.dataTables.min.js | 153 ++++++++++ .../prog/images/datatables/back_disabled.jpg | Bin 0 -> 612 bytes .../prog/images/datatables/back_enabled.jpg | Bin 0 -> 807 bytes .../prog/images/datatables/forward_disabled.jpg | Bin 0 -> 635 bytes .../prog/images/datatables/forward_enabled.jpg | Bin 0 -> 852 bytes .../opac-tmpl/prog/images/datatables/sort_asc.png | Bin 0 -> 263 bytes .../prog/images/datatables/sort_asc_disabled.png | Bin 0 -> 252 bytes .../opac-tmpl/prog/images/datatables/sort_both.png | Bin 0 -> 282 bytes .../opac-tmpl/prog/images/datatables/sort_desc.png | Bin 0 -> 260 bytes .../prog/images/datatables/sort_desc_disabled.png | Bin 0 -> 251 bytes 25 files changed, 1401 insertions(+), 0 deletions(-) create mode 100644 C4/Utils/DataTables.pm create mode 100644 koha-tmpl/intranet-tmpl/prog/en/css/datatables.css create mode 100644 koha-tmpl/intranet-tmpl/prog/en/js/datatables.js create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js create mode 100644 koha-tmpl/intranet-tmpl/prog/img/datatables/back_disabled.jpg create mode 100644 koha-tmpl/intranet-tmpl/prog/img/datatables/back_enabled.jpg create mode 100644 koha-tmpl/intranet-tmpl/prog/img/datatables/forward_disabled.jpg create mode 100644 koha-tmpl/intranet-tmpl/prog/img/datatables/forward_enabled.jpg create mode 100644 koha-tmpl/intranet-tmpl/prog/img/datatables/sort_asc.png create mode 100644 koha-tmpl/intranet-tmpl/prog/img/datatables/sort_asc_disabled.png create mode 100644 koha-tmpl/intranet-tmpl/prog/img/datatables/sort_both.png create mode 100644 koha-tmpl/intranet-tmpl/prog/img/datatables/sort_desc.png create mode 100644 koha-tmpl/intranet-tmpl/prog/img/datatables/sort_desc_disabled.png create mode 100644 koha-tmpl/opac-tmpl/prog/en/css/datatables.css create mode 100644 koha-tmpl/opac-tmpl/prog/en/js/datatables.js create mode 100644 koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js create mode 100644 koha-tmpl/opac-tmpl/prog/images/datatables/back_disabled.jpg create mode 100644 koha-tmpl/opac-tmpl/prog/images/datatables/back_enabled.jpg create mode 100644 koha-tmpl/opac-tmpl/prog/images/datatables/forward_disabled.jpg create mode 100644 koha-tmpl/opac-tmpl/prog/images/datatables/forward_enabled.jpg create mode 100644 koha-tmpl/opac-tmpl/prog/images/datatables/sort_asc.png create mode 100644 koha-tmpl/opac-tmpl/prog/images/datatables/sort_asc_disabled.png create mode 100644 koha-tmpl/opac-tmpl/prog/images/datatables/sort_both.png create mode 100644 koha-tmpl/opac-tmpl/prog/images/datatables/sort_desc.png create mode 100644 koha-tmpl/opac-tmpl/prog/images/datatables/sort_desc_disabled.png diff --git a/C4/Utils/DataTables.pm b/C4/Utils/DataTables.pm new file mode 100644 index 0000000..901cafc --- /dev/null +++ b/C4/Utils/DataTables.pm @@ -0,0 +1,306 @@ +package C4::Utils::DataTables; + +# Copyright 2011 BibLibre +# +# 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 2 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; +require Exporter; + +use vars qw($VERSION @ISA @EXPORT); + +BEGIN { + $VERSION = 3.04, + + @ISA = qw(Exporter); + @EXPORT = qw(dt_build_orderby dt_build_having dt_get_params dt_build_query); +} + +=head1 NAME + +C4::Utils::DataTables - Utility subs for building query when DataTables source is AJAX + +=head1 SYNOPSYS + + use CGI; + use C4::Context; + use C4::Utils::DataTables; + + my $input = new CGI; + my $vars = $input->Vars; + + my $query = qq{ + SELECT surname, firstname + FROM borrowers + WHERE borrowernumber = ? + }; + my ($having, $having_params) = dt_build_having($vars); + $query .= $having; + $query .= dt_build_orderby($vars); + $query .= " LIMIT ?,? "; + + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare($query); + $sth->execute( + $vars->{'borrowernumber'}, + @$having_params, + $vars->{'iDisplayStart'}, + $vars->{'iDisplayLength'} + ); + ... + +=head1 DESCRIPTION + + This module provide two utility functions to build a part of the SQL query, + depending on DataTables parameters. + One function build the 'ORDER BY' part, and the other the 'HAVING' part. + +=head1 FUNCTIONS + +=over 2 + +=item dt_build_orderby + + my $orderby = dt_build_orderby($dt_param); + + This function takes a reference to a hash containing DataTables parameters + and build the corresponding 'ORDER BY' clause. + This hash must contains the following keys: + + iSortCol_N, where N is a number from 0 to the number of columns to sort on minus 1 + + sSortDir_N is the sorting order ('asc' or 'desc) for the corresponding column + + mDataProp_N is a mapping between the column index, and the name of a SQL field + +=cut + +sub dt_build_orderby { + my $param = shift; + + my $i = 0; + my @orderbys; + while(exists $param->{'iSortCol_'.$i}){ + my $iSortCol = $param->{'iSortCol_'.$i}; + my $sSortDir = $param->{'sSortDir_'.$i}; + my $mDataProp = $param->{'mDataProp_'.$iSortCol}; + my @sort_fields = $param->{$mDataProp.'_sorton'} + ? split(' ', $param->{$mDataProp.'_sorton'}) + : (); + if(@sort_fields > 0) { + push @orderbys, "$_ $sSortDir" foreach (@sort_fields); + } else { + push @orderbys, "$mDataProp $sSortDir"; + } + $i++; + } + + my $orderby = " ORDER BY " . join(',', @orderbys) . " " if @orderbys; + return $orderby; +} + +=item dt_build_having + + my ($having, $having_params) = dt_build_having($dt_params) + + This function takes a reference to a hash containing DataTables parameters + and build the corresponding 'HAVING' clause. + This hash must contains the following keys: + + sSearch is the text entered in the global filter + + iColumns is the number of columns + + bSearchable_N is a boolean value that is true if the column is searchable + + mDataProp_N is a mapping between the column index, and the name of a SQL field + + sSearch_N is the text entered in individual filter for column N + +=back + +=cut + +sub dt_build_having { + my $param = shift; + + my @filters; + my @params; + + # Global filter + if($param->{'sSearch'}) { + my $sSearch = $param->{'sSearch'}; + my $i = 0; + my @gFilters; + my @gParams; + while($i < $param->{'iColumns'}) { + if($param->{'bSearchable_'.$i} eq 'true') { + my $mDataProp = $param->{'mDataProp_'.$i}; + my @filter_fields = $param->{$mDataProp.'_filteron'} + ? split(' ', $param->{$mDataProp.'_filteron'}) + : (); + if(@filter_fields > 0) { + foreach my $field (@filter_fields) { + push @gFilters, " $field LIKE ? "; + push @gParams, "%$sSearch%"; + } + } else { + push @gFilters, " $mDataProp LIKE ? "; + push @gParams, "%$sSearch%"; + } + } + $i++; + } + push @filters, " (" . join(" OR ", @gFilters) . ") "; + push @params, @gParams; + } + + # Individual filters + my $i = 0; + while($i < $param->{'iColumns'}) { + my $sSearch = $param->{'sSearch_'.$i}; + if($sSearch) { + my $mDataProp = $param->{'mDataProp_'.$i}; + my @filter_fields = $param->{$mDataProp.'_filteron'} + ? split(' ', $param->{$mDataProp.'_filteron'}) + : (); + if(@filter_fields > 0) { + my @localfilters; + foreach my $field (@filter_fields) { + push @localfilters, " $field LIKE ? "; + push @params, "%$sSearch%"; + } + push @filters, " ( ". join(" OR ", @localfilters) ." ) "; + } else { + push @filters, " $mDataProp LIKE ? "; + push @params, "%$sSearch%"; + } + } + $i++; + } + + return (\@filters, \@params); +} + +=item dt_get_params + + my %dtparam = = dt_get_params( $input ) + + This function takes a reference to a new CGI object. + + It prepares a hash containing Datatable parameters. + +=back + +=cut +sub dt_get_params { + my $input = shift; + my %dtparam; + my $vars = $input->Vars; + + foreach(qw/ iDisplayStart iDisplayLength iColumns sSearch bRegex iSortingCols sEcho /) { + $dtparam{$_} = $input->param($_); + } + foreach(grep /(?:_sorton|_filteron)$/, keys %$vars) { + $dtparam{$_} = $vars->{$_}; + } + for(my $i=0; $i<$dtparam{'iColumns'}; $i++) { + foreach(qw/ bSearchable sSearch bRegex bSortable iSortCol mDataProp sSortDir /) { + my $key = $_ . '_' . $i; + $dtparam{$key} = $input->param($key) if defined $input->param($key); + } + } + return %dtparam; +} + +=item dt_build_query_simple + + my ( $query, $params )= dt_build_query_simple( $value, $field ) + + This function takes a value and a field (table.field). + + It returns (undef, []) if not $value. + Else, returns a SQL where string and an arrayref containing parameters + for the execute method of the statement. + +=back + +=cut +sub dt_build_query_simple { + my ( $value, $field ) = @_; + my $query; + my @params; + if( $value ) { + $query .= " AND $field = ? "; + push @params, $value; + } + return ( $query, \@params ); +} + +=item dt_build_query_dates + + my ( $query, $params )= dt_build_query_dates( $datefrom, $dateto, $field) + + This function takes a datefrom, dateto and a field (table.field). + + It returns (undef, []) if not $value. + Else, returns a SQL where string and an arrayref containing parameters + for the execute method of the statement. + +=back + +=cut +sub dt_build_query_dates { + my ( $datefrom, $dateto, $field ) = @_; + my $query; + my @params; + if ( $datefrom ) { + $query .= " AND $field >= ? "; + push @params, C4::Dates->new($datefrom)->output('iso'); + } + if ( $dateto ) { + $query .= " AND $field <= ? "; + push @params, C4::Dates->new($dateto)->output('iso'); + } + return ( $query, \@params ); +} + +=item dt_build_query + + my ( $query, $filter ) = dt_build_query( $type, @params ) + + This function takes a value and a list of parameters. + + It calls dt_build_query_dates or dt_build_query_simple fonction of $type. + + $type can be 'simple' or 'rage_dates'. + +=back + +=cut +sub dt_build_query { + my ( $type, @params ) = @_; + given ( $type ) { + when ( /simple/ ) { + return dt_build_query_simple( @params ); + } + when ( /range_dates/ ) { + return dt_build_query_dates( @params ); + } + } +} + +1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css b/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css new file mode 100644 index 0000000..e069b93 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css @@ -0,0 +1,114 @@ +input.search_init { + color: #999999; +} +.sorting_asc { + padding-right: 19px; + background: url("../../img/datatables/sort_asc.png") no-repeat scroll right center #EEEEEE; +} +.sorting_desc { + padding-right: 19px; + background: url("../../img/datatables/sort_desc.png") no-repeat scroll right center #EEEEEE; +} +.sorting { + padding-right: 19px; + background: url("../../img/datatables/sort_both.png") no-repeat scroll right center #EEEEEE; +} +.sorting_asc_disabled { + padding-right: 19px; + background: url("../../img/datatables/sort_asc_disabled.png") no-repeat scroll right center #EEEEEE; +} +.sorting_desc_disabled { + padding-right: 19px; + background: url("../../img/datatables/sort_desc_disabled.png") no-repeat scroll right center #EEEEEE; +} +.sorting_disabled { + padding-right: 19px; + background-color: #EEEEEE; +} + +table.display { + width: 100%; +} +table.display thead th { + border-bottom: 1px solid black; + cursor: pointer; + font-weight: bold; + padding: 3px 18px 3px 10px; +} +.dataTables_wrapper { + clear: both; + position: relative; +} +.dataTables_processing { + background-color: white; + border: 1px solid #DDDDDD; + color: #999999; + font-size: 14px; + height: 30px; + left: 50%; + margin-left: -125px; + margin-top: -15px; + padding: 14px 0 2px; + position: fixed; + text-align: center; + top: 50%; + width: 250px; +} +.dataTables_info { + float: left; + width: 60%; +} +.dataTables_paginate { + float: right; + text-align: right; + width: 44px; +} +.paging_full_numbers { + height: 22px; + line-height: 22px; + width: 400px; +} +.paging_full_numbers span.paginate_button, + .paging_full_numbers span.paginate_active { + border: 1px solid #aaa; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + padding: 2px 5px; + margin: 0 3px; + cursor: pointer; + *cursor: hand; +} + +.paging_full_numbers span.paginate_button { + background-color: #ddd; +} + +.paging_full_numbers span.paginate_button:hover { + background-color: #ccc; +} + +.paging_full_numbers span.paginate_active { + background-color: #99B3FF; +} +.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next { + float: left; + height: 19px; + margin-left: 3px; + width: 19px; +} +.paginate_disabled_previous { + background-image: url("../../img/datatables/back_disabled.jpg"); +} +.paginate_enabled_previous { + background-image: url("../../img/datatables/back_enabled.jpg"); +} +.paginate_disabled_next { + background-image: url("../../img/datatables/forward_disabled.jpg"); +} +.paginate_enabled_next { + background-image: url("../../img/datatables/forward_enabled.jpg"); +} +.spacer { + clear: both; + height: 20px; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js new file mode 100644 index 0000000..9ae078d --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js @@ -0,0 +1,280 @@ +// These default options are for translation but can be used +// for any other datatables settings +// To use it, write: +// $("#table_id").dataTable($.extend(true, {}, dataTableDefaults, { +// // other settings +// } ) ); +var dataTablesDefaults = { + "oLanguage": { + "oPaginate": { + "sFirst" : _("First"), + "sLast" : _("Last"), + "sNext" : _("Next"), + "sPrevious" : _("Previous") + }, + "sEmptyTable" : _("No data available in table"), + "sInfo" : _("Showing _START_ to _END_ of _TOTAL_ entries"), + "sInfoEmpty" : _("No entries to show"), + "sInfoFiltered" : _("(filtered from _MAX_ total entries)"), + "sLengthMenu" : _("Show _MENU_ entries"), + "sLoadingRecords" : _("Loading..."), + "sProcessing" : _("Processing..."), + "sSearch" : _("Search:"), + "sZeroRecords" : _("No matching records found") + } +}; + + +// Return an array of string containing the values of a particular column +$.fn.dataTableExt.oApi.fnGetColumnData = function ( oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty ) { + // check that we have a column id + if ( typeof iColumn == "undefined" ) return new Array(); + // by default we only wany unique data + if ( typeof bUnique == "undefined" ) bUnique = true; + // by default we do want to only look at filtered data + if ( typeof bFiltered == "undefined" ) bFiltered = true; + // by default we do not wany to include empty values + if ( typeof bIgnoreEmpty == "undefined" ) bIgnoreEmpty = true; + // list of rows which we're going to loop through + var aiRows; + // use only filtered rows + if (bFiltered == true) aiRows = oSettings.aiDisplay; + // use all rows + else aiRows = oSettings.aiDisplayMaster; // all row numbers + + // set up data array + var asResultData = new Array(); + for (var i=0,c=aiRows.length; i<c; i++) { + iRow = aiRows[i]; + var aData = this.fnGetData(iRow); + var sValue = aData[iColumn]; + // ignore empty values? + if (bIgnoreEmpty == true && sValue.length == 0) continue; + // ignore unique values? + else if (bUnique == true && jQuery.inArray(sValue, asResultData) > -1) continue; + // else push the value onto the result data array + else asResultData.push(sValue); + } + return asResultData; +} + +// List of unbind keys (Ctrl, Alt, Direction keys, etc.) +// These keys must not launch filtering +var blacklist_keys = new Array(0, 16, 17, 18, 37, 38, 39, 40); + +// Set a filtering delay for global search field +jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) { + /* + * Inputs: object:oSettings - dataTables settings object - automatically given + * integer:iDelay - delay in milliseconds + * Usage: $('#example').dataTable().fnSetFilteringDelay(250); + * Author: Zygimantas Berziunas (www.zygimantas.com) and Allan Jardine + * License: GPL v2 or BSD 3 point style + * Contact: zygimantas.berziunas /AT\ hotmail.com + */ + var + _that = this, + iDelay = (typeof iDelay == 'undefined') ? 250 : iDelay; + + this.each( function ( i ) { + $.fn.dataTableExt.iApiIndex = i; + var + $this = this, + oTimerId = null, + sPreviousSearch = null, + anControl = $( 'input', _that.fnSettings().aanFeatures.f ); + + anControl.unbind( 'keyup.DT' ).bind( 'keyup.DT', function(event) { + var $$this = $this; + if (blacklist_keys.indexOf(event.keyCode) != -1) { + return this; + }else if ( event.keyCode == '13' ) { + $.fn.dataTableExt.iApiIndex = i; + _that.fnFilter( $(this).val() ); + } else { + if (sPreviousSearch === null || sPreviousSearch != anControl.val()) { + window.clearTimeout(oTimerId); + sPreviousSearch = anControl.val(); + oTimerId = window.setTimeout(function() { + $.fn.dataTableExt.iApiIndex = i; + _that.fnFilter( anControl.val() ); + }, iDelay); + } + } + }); + + return this; + } ); + return this; +} + +// Add a filtering delay on general search and on all input (with a class 'filter') +jQuery.fn.dataTableExt.oApi.fnAddFilters = function ( oSettings, sClass, iDelay ) { + var table = this; + this.fnSetFilteringDelay(iDelay); + var filterTimerId = null; + $("input."+sClass).keyup(function(event) { + if (blacklist_keys.indexOf(event.keyCode) != -1) { + return this; + }else if ( event.keyCode == '13' ) { + table.fnFilter( $(this).val(), $(this).attr('data-column_num') ); + } else { + window.clearTimeout(filterTimerId); + var input = this; + filterTimerId = window.setTimeout(function() { + table.fnFilter($(input).val(), $(input).attr('data-column_num')); + }, iDelay); + } + }); +} + +// Useful if you want to filter on dates with 2 inputs (start date and end date) +// You have to include calendar.inc to use it +function dt_add_rangedate_filter(begindate_id, enddate_id, dateCol) { + $.fn.dataTableExt.afnFiltering.push( + function( oSettings, aData, iDataIndex ) { + + var beginDate = Date_from_syspref($("#"+begindate_id).val()).getTime(); + var endDate = Date_from_syspref($("#"+enddate_id).val()).getTime(); + + var data = Date_from_syspref(aData[dateCol]).getTime(); + + if ( !parseInt(beginDate) && ! parseInt(endDate) ) { + return true; + } + else if ( beginDate <= data && !parseInt(endDate) ) { + return true; + } + else if ( data <= endDate && !parseInt(beginDate) ) { + return true; + } + else if ( beginDate <= data && data <= endDate) { + return true; + } + return false; + } + ); +} + +//Sorting for dates (uk format) +function dt_add_type_uk_date() { + jQuery.fn.dataTableExt.aTypes.unshift( + function ( sData ) + { + if (sData.match(/(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[012])\/(19|20|21)\d\d/)) + { + return 'uk_date'; + } + return null; + } + ); + + jQuery.fn.dataTableExt.oSort['uk_date-asc'] = function(a,b) { + var re = /(\d{2}\/\d{2}\/\d{4})/; + a.match(re); + var ukDatea = RegExp.$1.split("/"); + b.match(re); + var ukDateb = RegExp.$1.split("/"); + + var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1; + var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1; + + return ((x < y) ? -1 : ((x > y) ? 1 : 0)); + }; + + jQuery.fn.dataTableExt.oSort['uk_date-desc'] = function(a,b) { + var re = /(\d{2}\/\d{2}\/\d{4})/; + a.match(re); + var ukDatea = RegExp.$1.split("/"); + b.match(re); + var ukDateb = RegExp.$1.split("/"); + + var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1; + var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1; + + return ((x < y) ? 1 : ((x > y) ? -1 : 0)); + }; +} + +// Sorting on html contains +// <a href="foo.pl">bar</a> sort on 'bar' +function dt_overwrite_html_sorting_localeCompare() { + jQuery.fn.dataTableExt.oSort['html-asc'] = function(a,b) { + a = a.replace(/<.*?>/g, "").replace(/\s+/g, " "); + b = b.replace(/<.*?>/g, "").replace(/\s+/g, " "); + if (typeof(a.localeCompare == "function")) { + return a.localeCompare(b); + } else { + return (a > b) ? 1 : ((a < b) ? -1 : 0); + } + }; + + jQuery.fn.dataTableExt.oSort['html-desc'] = function(a,b) { + a = a.replace(/<.*?>/g, "").replace(/\s+/g, " "); + b = b.replace(/<.*?>/g, "").replace(/\s+/g, " "); + if(typeof(b.localeCompare == "function")) { + return b.localeCompare(a); + } else { + return (b > a) ? 1 : ((b < a) ? -1 : 0); + } + }; +} + +// Sorting on string without accentued characters +function dt_overwrite_string_sorting_localeCompare() { + jQuery.fn.dataTableExt.oSort['string-asc'] = function(a,b) { + a = a.replace(/<.*?>/g, "").replace(/\s+/g, " "); + b = b.replace(/<.*?>/g, "").replace(/\s+/g, " "); + if (typeof(a.localeCompare == "function")) { + return a.localeCompare(b); + } else { + return (a > b) ? 1 : ((a < b) ? -1 : 0); + } + }; + + jQuery.fn.dataTableExt.oSort['string-desc'] = function(a,b) { + a = a.replace(/<.*?>/g, "").replace(/\s+/g, " "); + b = b.replace(/<.*?>/g, "").replace(/\s+/g, " "); + if(typeof(b.localeCompare == "function")) { + return b.localeCompare(a); + } else { + return (b > a) ? 1 : ((b < a) ? -1 : 0); + } + }; +} + +// Replace a node with a html and js contain. +function replace_html( original_node, type ) { + switch ( $(original_node).attr('data-type') ) { + case "range_dates": + var id = $(original_node).attr("data-id"); + var format = $(original_node).attr("data-format"); + replace_html_date( original_node, id, format ); + break; + default: + alert("_(This node can't be replaced)"); + } +} + +// Replace a node with a "From [date] To [date]" element +// Used on tfoot > td +function replace_html_date( original_node, id, format ) { + var node = $('<span style="white-space:nowrap">' + _("From") + '<input type="text" id="' + id + 'from" readonly="readonly" placeholder=\'' + _("Pick date") + '\' size="7" /><a title="Delete this filter" style="cursor:pointer" onclick=\'$("#' + id + 'from").val("").change();\' >×</a></span><br/><span style="white-space:nowrap">' + _("To") + '<input type="text" id="' + id + 'to" readonly="readonly" placeholder=\'' + _("Pick date") + '\' size="7" /><a title="Delete this filter" style="cursor:pointer" onclick=\'$("#' + id + 'to").val("").change();\' >×</a></span>'); + $(original_node).replaceWith(node); + var script = document.createElement( 'script' ); + script.type = 'text/javascript'; + var script_content = "Calendar.setup({"; + script_content += " inputField: \"" + id + "from\","; + script_content += " ifFormat: \"" + format + "\","; + script_content += " button: \"" + id + "from\","; + script_content += " onClose: function(){ $(\"#" + id + "from\").change(); this.hide();}"; + script_content += " });"; + script_content += " Calendar.setup({"; + script_content += " inputField: \"" + id + "to\","; + script_content += " ifFormat: \"" + format + "\","; + script_content += " button: \"" + id + "to\","; + script_content += " onClose: function(){ $(\"#" + id + "to\").change(); this.hide();}"; + script_content += " });"; + script.text = script_content; + $(original_node).append( script ); +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js new file mode 100644 index 0000000..9035a2e --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js @@ -0,0 +1,153 @@ +/* + * File: jquery.dataTables.min.js + * Version: 1.8.1 + * Author: Allan Jardine (www.sprymedia.co.uk) + * Info: www.datatables.net + * + * Copyright 2008-2010 Allan Jardine, all rights reserved. + * + * This source file is free software, under either the GPL v2 license or a + * BSD style license, available at: + * http://datatables.net/license_gpl2 + * http://datatables.net/license_bsd + * + * This source file 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 license files for details. + */ +(function(i,wa,p){i.fn.dataTableSettings=[];var D=i.fn.dataTableSettings;i.fn.dataTableExt={};var o=i.fn.dataTableExt;o.sVersion="1.8.1";o.sErrMode="alert";o.iApiIndex=0;o.oApi={};o.afnFiltering=[];o.aoFeatures=[];o.ofnSearch={};o.afnSortData=[];o.oStdClasses={sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active", +sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled", +sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:""};o.oJUIClasses={sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left", +sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled", +sPageFirst:"first ui-corner-tl ui-corner-bl",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last ui-corner-tr ui-corner-br",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default", +sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortColumn:"sorting_",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollWrapper:"dataTables_scroll", +sScrollHead:"dataTables_scrollHead ui-state-default",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot ui-state-default",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"ui-state-default"};o.oPagination={two_button:{fnInit:function(g,l,r){var s,w,y;if(g.bJUI){s=p.createElement("a");w=p.createElement("a");y=p.createElement("span");y.className=g.oClasses.sPageJUINext;w.appendChild(y);y=p.createElement("span");y.className=g.oClasses.sPageJUIPrev; +s.appendChild(y)}else{s=p.createElement("div");w=p.createElement("div")}s.className=g.oClasses.sPagePrevDisabled;w.className=g.oClasses.sPageNextDisabled;s.title=g.oLanguage.oPaginate.sPrevious;w.title=g.oLanguage.oPaginate.sNext;l.appendChild(s);l.appendChild(w);i(s).bind("click.DT",function(){g.oApi._fnPageChange(g,"previous")&&r(g)});i(w).bind("click.DT",function(){g.oApi._fnPageChange(g,"next")&&r(g)});i(s).bind("selectstart.DT",function(){return false});i(w).bind("selectstart.DT",function(){return false}); +if(g.sTableId!==""&&typeof g.aanFeatures.p=="undefined"){l.setAttribute("id",g.sTableId+"_paginate");s.setAttribute("id",g.sTableId+"_previous");w.setAttribute("id",g.sTableId+"_next")}},fnUpdate:function(g){if(g.aanFeatures.p)for(var l=g.aanFeatures.p,r=0,s=l.length;r<s;r++)if(l[r].childNodes.length!==0){l[r].childNodes[0].className=g._iDisplayStart===0?g.oClasses.sPagePrevDisabled:g.oClasses.sPagePrevEnabled;l[r].childNodes[1].className=g.fnDisplayEnd()==g.fnRecordsDisplay()?g.oClasses.sPageNextDisabled: +g.oClasses.sPageNextEnabled}}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(g,l,r){var s=p.createElement("span"),w=p.createElement("span"),y=p.createElement("span"),G=p.createElement("span"),x=p.createElement("span");s.innerHTML=g.oLanguage.oPaginate.sFirst;w.innerHTML=g.oLanguage.oPaginate.sPrevious;G.innerHTML=g.oLanguage.oPaginate.sNext;x.innerHTML=g.oLanguage.oPaginate.sLast;var v=g.oClasses;s.className=v.sPageButton+" "+v.sPageFirst;w.className=v.sPageButton+" "+v.sPagePrevious;G.className= +v.sPageButton+" "+v.sPageNext;x.className=v.sPageButton+" "+v.sPageLast;l.appendChild(s);l.appendChild(w);l.appendChild(y);l.appendChild(G);l.appendChild(x);i(s).bind("click.DT",function(){g.oApi._fnPageChange(g,"first")&&r(g)});i(w).bind("click.DT",function(){g.oApi._fnPageChange(g,"previous")&&r(g)});i(G).bind("click.DT",function(){g.oApi._fnPageChange(g,"next")&&r(g)});i(x).bind("click.DT",function(){g.oApi._fnPageChange(g,"last")&&r(g)});i("span",l).bind("mousedown.DT",function(){return false}).bind("selectstart.DT", +function(){return false});if(g.sTableId!==""&&typeof g.aanFeatures.p=="undefined"){l.setAttribute("id",g.sTableId+"_paginate");s.setAttribute("id",g.sTableId+"_first");w.setAttribute("id",g.sTableId+"_previous");G.setAttribute("id",g.sTableId+"_next");x.setAttribute("id",g.sTableId+"_last")}},fnUpdate:function(g,l){if(g.aanFeatures.p){var r=o.oPagination.iFullNumbersShowPages,s=Math.floor(r/2),w=Math.ceil(g.fnRecordsDisplay()/g._iDisplayLength),y=Math.ceil(g._iDisplayStart/g._iDisplayLength)+1,G= +"",x,v=g.oClasses;if(w<r){s=1;x=w}else if(y<=s){s=1;x=r}else if(y>=w-s){s=w-r+1;x=w}else{s=y-Math.ceil(r/2)+1;x=s+r-1}for(r=s;r<=x;r++)G+=y!=r?'<span class="'+v.sPageButton+'">'+r+"</span>":'<span class="'+v.sPageButtonActive+'">'+r+"</span>";x=g.aanFeatures.p;var z,Y=function(L){g._iDisplayStart=(this.innerHTML*1-1)*g._iDisplayLength;l(g);L.preventDefault()},V=function(){return false};r=0;for(s=x.length;r<s;r++)if(x[r].childNodes.length!==0){z=i("span:eq(2)",x[r]);z.html(G);i("span",z).bind("click.DT", +Y).bind("mousedown.DT",V).bind("selectstart.DT",V);z=x[r].getElementsByTagName("span");z=[z[0],z[1],z[z.length-2],z[z.length-1]];i(z).removeClass(v.sPageButton+" "+v.sPageButtonActive+" "+v.sPageButtonStaticDisabled);if(y==1){z[0].className+=" "+v.sPageButtonStaticDisabled;z[1].className+=" "+v.sPageButtonStaticDisabled}else{z[0].className+=" "+v.sPageButton;z[1].className+=" "+v.sPageButton}if(w===0||y==w||g._iDisplayLength==-1){z[2].className+=" "+v.sPageButtonStaticDisabled;z[3].className+=" "+ +v.sPageButtonStaticDisabled}else{z[2].className+=" "+v.sPageButton;z[3].className+=" "+v.sPageButton}}}}}};o.oSort={"string-asc":function(g,l){if(typeof g!="string")g="";if(typeof l!="string")l="";g=g.toLowerCase();l=l.toLowerCase();return g<l?-1:g>l?1:0},"string-desc":function(g,l){if(typeof g!="string")g="";if(typeof l!="string")l="";g=g.toLowerCase();l=l.toLowerCase();return g<l?1:g>l?-1:0},"html-asc":function(g,l){g=g.replace(/<.*?>/g,"").toLowerCase();l=l.replace(/<.*?>/g,"").toLowerCase();return g< +l?-1:g>l?1:0},"html-desc":function(g,l){g=g.replace(/<.*?>/g,"").toLowerCase();l=l.replace(/<.*?>/g,"").toLowerCase();return g<l?1:g>l?-1:0},"date-asc":function(g,l){g=Date.parse(g);l=Date.parse(l);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(l)||l==="")l=Date.parse("01/01/1970 00:00:00");return g-l},"date-desc":function(g,l){g=Date.parse(g);l=Date.parse(l);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(l)||l==="")l=Date.parse("01/01/1970 00:00:00");return l- +g},"numeric-asc":function(g,l){return(g=="-"||g===""?0:g*1)-(l=="-"||l===""?0:l*1)},"numeric-desc":function(g,l){return(l=="-"||l===""?0:l*1)-(g=="-"||g===""?0:g*1)}};o.aTypes=[function(g){if(typeof g=="number")return"numeric";else if(typeof g!="string")return null;var l,r=false;l=g.charAt(0);if("0123456789-".indexOf(l)==-1)return null;for(var s=1;s<g.length;s++){l=g.charAt(s);if("0123456789.".indexOf(l)==-1)return null;if(l=="."){if(r)return null;r=true}}return"numeric"},function(g){var l=Date.parse(g); +if(l!==null&&!isNaN(l)||typeof g=="string"&&g.length===0)return"date";return null},function(g){if(typeof g=="string"&&g.indexOf("<")!=-1&&g.indexOf(">")!=-1)return"html";return null}];o.fnVersionCheck=function(g){var l=function(x,v){for(;x.length<v;)x+="0";return x},r=o.sVersion.split(".");g=g.split(".");for(var s="",w="",y=0,G=g.length;y<G;y++){s+=l(r[y],3);w+=l(g[y],3)}return parseInt(s,10)>=parseInt(w,10)};o._oExternConfig={iNextUnique:0};i.fn.dataTable=function(g){function l(){this.fnRecordsTotal= +function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length};this.fnRecordsDisplay=function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length};this.fnDisplayEnd=function(){return this.oFeatures.bServerSide?this.oFeatures.bPaginate===false||this._iDisplayLength==-1?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd};this.sInstance= +this.oInstance=null;this.oFeatures={bPaginate:true,bLengthChange:true,bFilter:true,bSort:true,bInfo:true,bAutoWidth:true,bProcessing:false,bSortClasses:true,bStateSave:false,bServerSide:false,bDeferRender:false};this.oScroll={sX:"",sXInner:"",sY:"",bCollapse:false,bInfinite:false,iLoadGap:100,iBarWidth:0,bAutoCss:true};this.aanFeatures=[];this.oLanguage={sProcessing:"Processing...",sLengthMenu:"Show _MENU_ entries",sZeroRecords:"No matching records found",sEmptyTable:"No data available in table", +sLoadingRecords:"Loading...",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sSearch:"Search:",sUrl:"",oPaginate:{sFirst:"First",sPrevious:"Previous",sNext:"Next",sLast:"Last"},fnInfoCallback:null};this.aoData=[];this.aiDisplay=[];this.aiDisplayMaster=[];this.aoColumns=[];this.aoHeader=[];this.aoFooter=[];this.iNextId=0;this.asDataSearch=[];this.oPreviousSearch={sSearch:"",bRegex:false, +bSmart:true};this.aoPreSearchCols=[];this.aaSorting=[[0,"asc",0]];this.aaSortingFixed=null;this.asStripClasses=[];this.asDestoryStrips=[];this.sDestroyWidth=0;this.fnFooterCallback=this.fnHeaderCallback=this.fnRowCallback=null;this.aoDrawCallback=[];this.fnInitComplete=this.fnPreDrawCallback=null;this.sTableId="";this.nTableWrapper=this.nTBody=this.nTFoot=this.nTHead=this.nTable=null;this.bInitialised=this.bDeferLoading=false;this.aoOpenRows=[];this.sDom="lfrtip";this.sPaginationType="two_button"; +this.iCookieDuration=7200;this.sCookiePrefix="SpryMedia_DataTables_";this.fnCookieCallback=null;this.aoStateSave=[];this.aoStateLoad=[];this.sAjaxSource=this.oLoadedState=null;this.sAjaxDataProp="aaData";this.bAjaxDataGet=true;this.jqXHR=null;this.fnServerData=function(a,b,c,d){d.jqXHR=i.ajax({url:a,data:b,success:c,dataType:"json",cache:false,error:function(f,e){e=="parsererror"&&alert("DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})}; +this.fnFormatNumber=function(a){if(a<1E3)return a;else{var b=a+"";a=b.split("");var c="";b=b.length;for(var d=0;d<b;d++){if(d%3===0&&d!==0)c=","+c;c=a[b-d-1]+c}}return c};this.aLengthMenu=[10,25,50,100];this.bDrawing=this.iDraw=0;this.iDrawError=-1;this._iDisplayLength=10;this._iDisplayStart=0;this._iDisplayEnd=10;this._iRecordsDisplay=this._iRecordsTotal=0;this.bJUI=false;this.oClasses=o.oStdClasses;this.bSortCellsTop=this.bSorted=this.bFiltered=false;this.oInit=null}function r(a){return function(){var b= +[A(this[o.iApiIndex])].concat(Array.prototype.slice.call(arguments));return o.oApi[a].apply(this,b)}}function s(a){var b,c,d=a.iInitDisplayStart;if(a.bInitialised===false)setTimeout(function(){s(a)},200);else{xa(a);V(a);L(a,a.aoHeader);a.nTFoot&&L(a,a.aoFooter);K(a,true);a.oFeatures.bAutoWidth&&ea(a);b=0;for(c=a.aoColumns.length;b<c;b++)if(a.aoColumns[b].sWidth!==null)a.aoColumns[b].nTh.style.width=u(a.aoColumns[b].sWidth);if(a.oFeatures.bSort)R(a);else if(a.oFeatures.bFilter)M(a,a.oPreviousSearch); +else{a.aiDisplay=a.aiDisplayMaster.slice();E(a);C(a)}if(a.sAjaxSource!==null&&!a.oFeatures.bServerSide)a.fnServerData.call(a.oInstance,a.sAjaxSource,[],function(f){var e=f;if(a.sAjaxDataProp!=="")e=Z(a.sAjaxDataProp)(f);for(b=0;b<e.length;b++)v(a,e[b]);a.iInitDisplayStart=d;if(a.oFeatures.bSort)R(a);else{a.aiDisplay=a.aiDisplayMaster.slice();E(a);C(a)}K(a,false);w(a,f)},a);else if(!a.oFeatures.bServerSide){K(a,false);w(a)}}}function w(a,b){a._bInitComplete=true;if(typeof a.fnInitComplete=="function")typeof b!= +"undefined"?a.fnInitComplete.call(a.oInstance,a,b):a.fnInitComplete.call(a.oInstance,a)}function y(a,b,c){n(a.oLanguage,b,"sProcessing");n(a.oLanguage,b,"sLengthMenu");n(a.oLanguage,b,"sEmptyTable");n(a.oLanguage,b,"sLoadingRecords");n(a.oLanguage,b,"sZeroRecords");n(a.oLanguage,b,"sInfo");n(a.oLanguage,b,"sInfoEmpty");n(a.oLanguage,b,"sInfoFiltered");n(a.oLanguage,b,"sInfoPostFix");n(a.oLanguage,b,"sSearch");if(typeof b.oPaginate!="undefined"){n(a.oLanguage.oPaginate,b.oPaginate,"sFirst");n(a.oLanguage.oPaginate, +b.oPaginate,"sPrevious");n(a.oLanguage.oPaginate,b.oPaginate,"sNext");n(a.oLanguage.oPaginate,b.oPaginate,"sLast")}typeof b.sEmptyTable=="undefined"&&typeof b.sZeroRecords!="undefined"&&n(a.oLanguage,b,"sZeroRecords","sEmptyTable");typeof b.sLoadingRecords=="undefined"&&typeof b.sZeroRecords!="undefined"&&n(a.oLanguage,b,"sZeroRecords","sLoadingRecords");c&&s(a)}function G(a,b){var c=a.aoColumns.length;b={sType:null,_bAutoType:true,bVisible:true,bSearchable:true,bSortable:true,asSorting:["asc","desc"], +sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,sTitle:b?b.innerHTML:"",sName:"",sWidth:null,sWidthOrig:null,sClass:null,fnRender:null,bUseRendered:true,iDataSort:c,mDataProp:c,fnGetData:null,fnSetData:null,sSortDataType:"std",sDefaultContent:null,sContentPadding:"",nTh:b?b:p.createElement("th"),nTf:null};a.aoColumns.push(b);if(typeof a.aoPreSearchCols[c]=="undefined"||a.aoPreSearchCols[c]===null)a.aoPreSearchCols[c]={sSearch:"",bRegex:false,bSmart:true};else{if(typeof a.aoPreSearchCols[c].bRegex== +"undefined")a.aoPreSearchCols[c].bRegex=true;if(typeof a.aoPreSearchCols[c].bSmart=="undefined")a.aoPreSearchCols[c].bSmart=true}x(a,c,null)}function x(a,b,c){b=a.aoColumns[b];if(typeof c!="undefined"&&c!==null){if(typeof c.sType!="undefined"){b.sType=c.sType;b._bAutoType=false}n(b,c,"bVisible");n(b,c,"bSearchable");n(b,c,"bSortable");n(b,c,"sTitle");n(b,c,"sName");n(b,c,"sWidth");n(b,c,"sWidth","sWidthOrig");n(b,c,"sClass");n(b,c,"fnRender");n(b,c,"bUseRendered");n(b,c,"iDataSort");n(b,c,"mDataProp"); +n(b,c,"asSorting");n(b,c,"sSortDataType");n(b,c,"sDefaultContent");n(b,c,"sContentPadding")}b.fnGetData=Z(b.mDataProp);b.fnSetData=ya(b.mDataProp);if(!a.oFeatures.bSort)b.bSortable=false;if(!b.bSortable||i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortableNone;b.sSortingClassJUI=""}else if(b.bSortable||i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortable;b.sSortingClassJUI=a.oClasses.sSortJUI}else if(i.inArray("asc", +b.asSorting)!=-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortableAsc;b.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed}else if(i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)!=-1){b.sSortingClass=a.oClasses.sSortableDesc;b.sSortingClassJUI=a.oClasses.sSortJUIDescAllowed}}function v(a,b){var c;c=typeof b.length=="number"?b.slice():i.extend(true,{},b);b=a.aoData.length;var d={nTr:null,_iId:a.iNextId++,_aData:c,_anHidden:[],_sRowStripe:""};a.aoData.push(d);for(var f, +e=0,h=a.aoColumns.length;e<h;e++){c=a.aoColumns[e];typeof c.fnRender=="function"&&c.bUseRendered&&c.mDataProp!==null&&N(a,b,e,c.fnRender({iDataRow:b,iDataColumn:e,aData:d._aData,oSettings:a}));if(c._bAutoType&&c.sType!="string"){f=H(a,b,e,"type");if(f!==null&&f!==""){f=fa(f);if(c.sType===null)c.sType=f;else if(c.sType!=f)c.sType="string"}}}a.aiDisplayMaster.push(b);a.oFeatures.bDeferRender||z(a,b);return b}function z(a,b){var c=a.aoData[b],d;if(c.nTr===null){c.nTr=p.createElement("tr");typeof c._aData.DT_RowId!= +"undefined"&&c.nTr.setAttribute("id",c._aData.DT_RowId);typeof c._aData.DT_RowClass!="undefined"&&i(c.nTr).addClass(c._aData.DT_RowClass);for(var f=0,e=a.aoColumns.length;f<e;f++){var h=a.aoColumns[f];d=p.createElement("td");d.innerHTML=typeof h.fnRender=="function"&&(!h.bUseRendered||h.mDataProp===null)?h.fnRender({iDataRow:b,iDataColumn:f,aData:c._aData,oSettings:a}):H(a,b,f,"display");if(h.sClass!==null)d.className=h.sClass;if(h.bVisible){c.nTr.appendChild(d);c._anHidden[f]=null}else c._anHidden[f]= +d}}}function Y(a){var b,c,d,f,e,h,j,k,m;if(a.bDeferLoading||a.sAjaxSource===null){j=a.nTBody.childNodes;b=0;for(c=j.length;b<c;b++)if(j[b].nodeName.toUpperCase()=="TR"){k=a.aoData.length;a.aoData.push({nTr:j[b],_iId:a.iNextId++,_aData:[],_anHidden:[],_sRowStripe:""});a.aiDisplayMaster.push(k);h=j[b].childNodes;d=e=0;for(f=h.length;d<f;d++){m=h[d].nodeName.toUpperCase();if(m=="TD"||m=="TH"){N(a,k,e,i.trim(h[d].innerHTML));e++}}}}j=$(a);h=[];b=0;for(c=j.length;b<c;b++){d=0;for(f=j[b].childNodes.length;d< +f;d++){e=j[b].childNodes[d];m=e.nodeName.toUpperCase();if(m=="TD"||m=="TH")h.push(e)}}h.length!=j.length*a.aoColumns.length&&J(a,1,"Unexpected number of TD elements. Expected "+j.length*a.aoColumns.length+" and got "+h.length+". DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.");d=0;for(f=a.aoColumns.length;d<f;d++){if(a.aoColumns[d].sTitle===null)a.aoColumns[d].sTitle=a.aoColumns[d].nTh.innerHTML;j=a.aoColumns[d]._bAutoType; +m=typeof a.aoColumns[d].fnRender=="function";e=a.aoColumns[d].sClass!==null;k=a.aoColumns[d].bVisible;var t,q;if(j||m||e||!k){b=0;for(c=a.aoData.length;b<c;b++){t=h[b*f+d];if(j&&a.aoColumns[d].sType!="string"){q=H(a,b,d,"type");if(q!==""){q=fa(q);if(a.aoColumns[d].sType===null)a.aoColumns[d].sType=q;else if(a.aoColumns[d].sType!=q)a.aoColumns[d].sType="string"}}if(m){q=a.aoColumns[d].fnRender({iDataRow:b,iDataColumn:d,aData:a.aoData[b]._aData,oSettings:a});t.innerHTML=q;a.aoColumns[d].bUseRendered&& +N(a,b,d,q)}if(e)t.className+=" "+a.aoColumns[d].sClass;if(k)a.aoData[b]._anHidden[d]=null;else{a.aoData[b]._anHidden[d]=t;t.parentNode.removeChild(t)}}}}}function V(a){var b,c,d;a.nTHead.getElementsByTagName("tr");if(a.nTHead.getElementsByTagName("th").length!==0){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;a.aoColumns[b].sClass!==null&&i(c).addClass(a.aoColumns[b].sClass);if(a.aoColumns[b].sTitle!=c.innerHTML)c.innerHTML=a.aoColumns[b].sTitle}}else{var f=p.createElement("tr");b=0; +for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;c.innerHTML=a.aoColumns[b].sTitle;a.aoColumns[b].sClass!==null&&i(c).addClass(a.aoColumns[b].sClass);f.appendChild(c)}i(a.nTHead).html("")[0].appendChild(f);W(a.aoHeader,a.nTHead)}if(a.bJUI){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;f=p.createElement("div");f.className=a.oClasses.sSortJUIWrapper;i(c).contents().appendTo(f);var e=p.createElement("span");e.className=a.oClasses.sSortIcon;f.appendChild(e);c.appendChild(f)}}d=function(){this.onselectstart= +function(){return false};return false};if(a.oFeatures.bSort)for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable!==false){ga(a,a.aoColumns[b].nTh,b);i(a.aoColumns[b].nTh).bind("mousedown.DT",d)}else i(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);a.oClasses.sFooterTH!==""&&i(">tr>th",a.nTFoot).addClass(a.oClasses.sFooterTH);if(a.nTFoot!==null){c=S(a,null,a.aoFooter);b=0;for(d=a.aoColumns.length;b<d;b++)if(typeof c[b]!="undefined")a.aoColumns[b].nTf=c[b]}}function L(a,b,c){var d,f, +e,h=[],j=[],k=a.aoColumns.length;if(typeof c=="undefined")c=false;d=0;for(f=b.length;d<f;d++){h[d]=b[d].slice();h[d].nTr=b[d].nTr;for(e=k-1;e>=0;e--)!a.aoColumns[e].bVisible&&!c&&h[d].splice(e,1);j.push([])}d=0;for(f=h.length;d<f;d++){if(h[d].nTr){a=0;for(e=h[d].nTr.childNodes.length;a<e;a++)h[d].nTr.removeChild(h[d].nTr.childNodes[0])}e=0;for(b=h[d].length;e<b;e++){k=c=1;if(typeof j[d][e]=="undefined"){h[d].nTr.appendChild(h[d][e].cell);for(j[d][e]=1;typeof h[d+c]!="undefined"&&h[d][e].cell==h[d+ +c][e].cell;){j[d+c][e]=1;c++}for(;typeof h[d][e+k]!="undefined"&&h[d][e].cell==h[d][e+k].cell;){for(a=0;a<c;a++)j[d+a][e+k]=1;k++}h[d][e].cell.setAttribute("rowspan",c);h[d][e].cell.setAttribute("colspan",k)}}}}function C(a){var b,c,d=[],f=0,e=false;b=a.asStripClasses.length;c=a.aoOpenRows.length;if(!(a.fnPreDrawCallback!==null&&a.fnPreDrawCallback.call(a.oInstance,a)===false)){a.bDrawing=true;if(typeof a.iInitDisplayStart!="undefined"&&a.iInitDisplayStart!=-1){a._iDisplayStart=a.oFeatures.bServerSide? +a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart;a.iInitDisplayStart=-1;E(a)}if(a.bDeferLoading){a.bDeferLoading=false;a.iDraw++}else if(a.oFeatures.bServerSide){if(!a.bDestroying&&!za(a))return}else a.iDraw++;if(a.aiDisplay.length!==0){var h=a._iDisplayStart,j=a._iDisplayEnd;if(a.oFeatures.bServerSide){h=0;j=a.aoData.length}for(h=h;h<j;h++){var k=a.aoData[a.aiDisplay[h]];k.nTr===null&&z(a,a.aiDisplay[h]);var m=k.nTr;if(b!==0){var t=a.asStripClasses[f%b];if(k._sRowStripe!= +t){i(m).removeClass(k._sRowStripe).addClass(t);k._sRowStripe=t}}if(typeof a.fnRowCallback=="function"){m=a.fnRowCallback.call(a.oInstance,m,a.aoData[a.aiDisplay[h]]._aData,f,h);if(!m&&!e){J(a,0,"A node was not returned by fnRowCallback");e=true}}d.push(m);f++;if(c!==0)for(k=0;k<c;k++)m==a.aoOpenRows[k].nParent&&d.push(a.aoOpenRows[k].nTr)}}else{d[0]=p.createElement("tr");if(typeof a.asStripClasses[0]!="undefined")d[0].className=a.asStripClasses[0];e=a.oLanguage.sZeroRecords.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal())); +if(a.iDraw==1&&a.sAjaxSource!==null&&!a.oFeatures.bServerSide)e=a.oLanguage.sLoadingRecords;else if(typeof a.oLanguage.sEmptyTable!="undefined"&&a.fnRecordsTotal()===0)e=a.oLanguage.sEmptyTable;b=p.createElement("td");b.setAttribute("valign","top");b.colSpan=X(a);b.className=a.oClasses.sRowEmpty;b.innerHTML=e;d[f].appendChild(b)}typeof a.fnHeaderCallback=="function"&&a.fnHeaderCallback.call(a.oInstance,i(">tr",a.nTHead)[0],aa(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);typeof a.fnFooterCallback== +"function"&&a.fnFooterCallback.call(a.oInstance,i(">tr",a.nTFoot)[0],aa(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);f=p.createDocumentFragment();b=p.createDocumentFragment();if(a.nTBody){e=a.nTBody.parentNode;b.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered){c=a.nTBody.childNodes;for(b=c.length-1;b>=0;b--)c[b].parentNode.removeChild(c[b])}b=0;for(c=d.length;b<c;b++)f.appendChild(d[b]);a.nTBody.appendChild(f);e!==null&&e.appendChild(a.nTBody)}for(b=a.aoDrawCallback.length- +1;b>=0;b--)a.aoDrawCallback[b].fn.call(a.oInstance,a);a.bSorted=false;a.bFiltered=false;a.bDrawing=false;if(a.oFeatures.bServerSide){K(a,false);typeof a._bInitComplete=="undefined"&&w(a)}}}function ba(a){if(a.oFeatures.bSort)R(a,a.oPreviousSearch);else if(a.oFeatures.bFilter)M(a,a.oPreviousSearch);else{E(a);C(a)}}function za(a){if(a.bAjaxDataGet){K(a,true);var b=a.aoColumns.length,c=[],d,f;a.iDraw++;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:ha(a)}); +c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",value:a.oFeatures.bPaginate!==false?a._iDisplayLength:-1});for(f=0;f<b;f++){d=a.aoColumns[f].mDataProp;c.push({name:"mDataProp_"+f,value:typeof d=="function"?"function":d})}if(a.oFeatures.bFilter!==false){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(f=0;f<b;f++){c.push({name:"sSearch_"+f,value:a.aoPreSearchCols[f].sSearch});c.push({name:"bRegex_"+ +f,value:a.aoPreSearchCols[f].bRegex});c.push({name:"bSearchable_"+f,value:a.aoColumns[f].bSearchable})}}if(a.oFeatures.bSort!==false){d=a.aaSortingFixed!==null?a.aaSortingFixed.length:0;var e=a.aaSorting.length;c.push({name:"iSortingCols",value:d+e});for(f=0;f<d;f++){c.push({name:"iSortCol_"+f,value:a.aaSortingFixed[f][0]});c.push({name:"sSortDir_"+f,value:a.aaSortingFixed[f][1]})}for(f=0;f<e;f++){c.push({name:"iSortCol_"+(f+d),value:a.aaSorting[f][0]});c.push({name:"sSortDir_"+(f+d),value:a.aaSorting[f][1]})}for(f= +0;f<b;f++)c.push({name:"bSortable_"+f,value:a.aoColumns[f].bSortable})}a.fnServerData.call(a.oInstance,a.sAjaxSource,c,function(h){Aa(a,h)},a);return false}else return true}function Aa(a,b){if(typeof b.sEcho!="undefined")if(b.sEcho*1<a.iDraw)return;else a.iDraw=b.sEcho*1;if(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered))ia(a);a._iRecordsTotal=b.iTotalRecords;a._iRecordsDisplay=b.iTotalDisplayRecords;var c=ha(a);if(c=typeof b.sColumns!="undefined"&&c!==""&&b.sColumns!=c)var d= +Ba(a,b.sColumns);b=Z(a.sAjaxDataProp)(b);for(var f=0,e=b.length;f<e;f++)if(c){for(var h=[],j=0,k=a.aoColumns.length;j<k;j++)h.push(b[f][d[j]]);v(a,h)}else v(a,b[f]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=false;C(a);a.bAjaxDataGet=true;K(a,false)}function xa(a){var b=p.createElement("div");a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=p.createElement("div");a.nTableWrapper.className=a.oClasses.sWrapper;a.sTableId!==""&&a.nTableWrapper.setAttribute("id",a.sTableId+"_wrapper"); +a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),f,e,h,j,k,m,t,q=0;q<d.length;q++){e=0;h=d[q];if(h=="<"){j=p.createElement("div");k=d[q+1];if(k=="'"||k=='"'){m="";for(t=2;d[q+t]!=k;){m+=d[q+t];t++}if(m=="H")m="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix";else if(m=="F")m="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix";if(m.indexOf(".")!=-1){k=m.split(".");j.setAttribute("id",k[0].substr(1, +k[0].length-1));j.className=k[1]}else if(m.charAt(0)=="#")j.setAttribute("id",m.substr(1,m.length-1));else j.className=m;q+=t}c.appendChild(j);c=j}else if(h==">")c=c.parentNode;else if(h=="l"&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange){f=Ca(a);e=1}else if(h=="f"&&a.oFeatures.bFilter){f=Da(a);e=1}else if(h=="r"&&a.oFeatures.bProcessing){f=Ea(a);e=1}else if(h=="t"){f=Fa(a);e=1}else if(h=="i"&&a.oFeatures.bInfo){f=Ga(a);e=1}else if(h=="p"&&a.oFeatures.bPaginate){f=Ha(a);e=1}else if(o.aoFeatures.length!== +0){j=o.aoFeatures;t=0;for(k=j.length;t<k;t++)if(h==j[t].cFeature){if(f=j[t].fnInit(a))e=1;break}}if(e==1&&f!==null){if(typeof a.aanFeatures[h]!="object")a.aanFeatures[h]=[];a.aanFeatures[h].push(f);c.appendChild(f)}}b.parentNode.replaceChild(a.nTableWrapper,b)}function Fa(a){if(a.oScroll.sX===""&&a.oScroll.sY==="")return a.nTable;var b=p.createElement("div"),c=p.createElement("div"),d=p.createElement("div"),f=p.createElement("div"),e=p.createElement("div"),h=p.createElement("div"),j=a.nTable.cloneNode(false), +k=a.nTable.cloneNode(false),m=a.nTable.getElementsByTagName("thead")[0],t=a.nTable.getElementsByTagName("tfoot").length===0?null:a.nTable.getElementsByTagName("tfoot")[0],q=typeof g.bJQueryUI!="undefined"&&g.bJQueryUI?o.oJUIClasses:o.oStdClasses;c.appendChild(d);e.appendChild(h);f.appendChild(a.nTable);b.appendChild(c);b.appendChild(f);d.appendChild(j);j.appendChild(m);if(t!==null){b.appendChild(e);h.appendChild(k);k.appendChild(t)}b.className=q.sScrollWrapper;c.className=q.sScrollHead;d.className= +q.sScrollHeadInner;f.className=q.sScrollBody;e.className=q.sScrollFoot;h.className=q.sScrollFootInner;if(a.oScroll.bAutoCss){c.style.overflow="hidden";c.style.position="relative";e.style.overflow="hidden";f.style.overflow="auto"}c.style.border="0";c.style.width="100%";e.style.border="0";d.style.width="150%";j.removeAttribute("id");j.style.marginLeft="0";a.nTable.style.marginLeft="0";if(t!==null){k.removeAttribute("id");k.style.marginLeft="0"}d=i(">caption",a.nTable);h=0;for(k=d.length;h<k;h++)j.appendChild(d[h]); +if(a.oScroll.sX!==""){c.style.width=u(a.oScroll.sX);f.style.width=u(a.oScroll.sX);if(t!==null)e.style.width=u(a.oScroll.sX);i(f).scroll(function(){c.scrollLeft=this.scrollLeft;if(t!==null)e.scrollLeft=this.scrollLeft})}if(a.oScroll.sY!=="")f.style.height=u(a.oScroll.sY);a.aoDrawCallback.push({fn:Ia,sName:"scrolling"});a.oScroll.bInfinite&&i(f).scroll(function(){if(!a.bDrawing)if(i(this).scrollTop()+i(this).height()>i(a.nTable).height()-a.oScroll.iLoadGap)if(a.fnDisplayEnd()<a.fnRecordsDisplay()){ja(a, +"next");E(a);C(a)}});a.nScrollHead=c;a.nScrollFoot=e;return b}function Ia(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],d=a.nTable.parentNode,f,e,h,j,k,m,t,q,I=[];h=a.nTable.getElementsByTagName("thead");h.length>0&&a.nTable.removeChild(h[0]);if(a.nTFoot!==null){k=a.nTable.getElementsByTagName("tfoot");k.length>0&&a.nTable.removeChild(k[0])}h=a.nTHead.cloneNode(true);a.nTable.insertBefore(h,a.nTable.childNodes[0]);if(a.nTFoot!==null){k=a.nTFoot.cloneNode(true); +a.nTable.insertBefore(k,a.nTable.childNodes[1])}if(a.oScroll.sX===""){d.style.width="100%";b.parentNode.style.width="100%"}var O=S(a,h);f=0;for(e=O.length;f<e;f++){t=Ja(a,f);O[f].style.width=a.aoColumns[t].sWidth}a.nTFoot!==null&&P(function(B){B.style.width=""},k.getElementsByTagName("tr"));f=i(a.nTable).outerWidth();if(a.oScroll.sX===""){a.nTable.style.width="100%";if(i.browser.msie&&i.browser.version<=7)a.nTable.style.width=u(i(a.nTable).outerWidth()-a.oScroll.iBarWidth)}else if(a.oScroll.sXInner!== +"")a.nTable.style.width=u(a.oScroll.sXInner);else if(f==i(d).width()&&i(d).height()<i(a.nTable).height()){a.nTable.style.width=u(f-a.oScroll.iBarWidth);if(i(a.nTable).outerWidth()>f-a.oScroll.iBarWidth)a.nTable.style.width=u(f)}else a.nTable.style.width=u(f);f=i(a.nTable).outerWidth();if(a.oScroll.sX===""){d.style.width=u(f+a.oScroll.iBarWidth);b.parentNode.style.width=u(f+a.oScroll.iBarWidth)}e=a.nTHead.getElementsByTagName("tr");h=h.getElementsByTagName("tr");P(function(B,F){m=B.style;m.paddingTop= +"0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;q=i(B).width();F.style.width=u(q);I.push(q)},h,e);i(h).height(0);if(a.nTFoot!==null){j=k.getElementsByTagName("tr");k=a.nTFoot.getElementsByTagName("tr");P(function(B,F){m=B.style;m.paddingTop="0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;q=i(B).width();F.style.width=u(q);I.push(q)},j,k);i(j).height(0)}P(function(B){B.innerHTML="";B.style.width=u(I.shift())},h);a.nTFoot!==null&&P(function(B){B.innerHTML= +"";B.style.width=u(I.shift())},j);if(i(a.nTable).outerWidth()<f)if(a.oScroll.sX==="")J(a,1,"The table cannot fit into the current element which will cause column misalignment. It is suggested that you enable x-scrolling or increase the width the table has in which to be drawn");else a.oScroll.sXInner!==""&&J(a,1,"The table cannot fit into the current element which will cause column misalignment. It is suggested that you increase the sScrollXInner property to allow it to draw in a larger area, or simply remove that parameter to allow automatic calculation"); +if(a.oScroll.sY==="")if(i.browser.msie&&i.browser.version<=7)d.style.height=u(a.nTable.offsetHeight+a.oScroll.iBarWidth);if(a.oScroll.sY!==""&&a.oScroll.bCollapse){d.style.height=u(a.oScroll.sY);j=a.oScroll.sX!==""&&a.nTable.offsetWidth>d.offsetWidth?a.oScroll.iBarWidth:0;if(a.nTable.offsetHeight<d.offsetHeight)d.style.height=u(i(a.nTable).height()+j)}j=i(a.nTable).outerWidth();c.style.width=u(j);b.style.width=u(j+a.oScroll.iBarWidth);if(a.nTFoot!==null){b=a.nScrollFoot.getElementsByTagName("div")[0]; +c=b.getElementsByTagName("table")[0];b.style.width=u(a.nTable.offsetWidth+a.oScroll.iBarWidth);c.style.width=u(a.nTable.offsetWidth)}if(a.bSorted||a.bFiltered)d.scrollTop=0}function ca(a){if(a.oFeatures.bAutoWidth===false)return false;ea(a);for(var b=0,c=a.aoColumns.length;b<c;b++)a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}function Da(a){var b=a.oLanguage.sSearch;b=b.indexOf("_INPUT_")!==-1?b.replace("_INPUT_",'<input type="text" />'):b===""?'<input type="text" />':b+' <input type="text" />'; +var c=p.createElement("div");c.className=a.oClasses.sFilter;c.innerHTML="<label>"+b+"</label>";a.sTableId!==""&&typeof a.aanFeatures.f=="undefined"&&c.setAttribute("id",a.sTableId+"_filter");b=i("input",c);b.val(a.oPreviousSearch.sSearch.replace('"',"""));b.bind("keyup.DT",function(){for(var d=a.aanFeatures.f,f=0,e=d.length;f<e;f++)d[f]!=this.parentNode&&i("input",d[f]).val(this.value);this.value!=a.oPreviousSearch.sSearch&&M(a,{sSearch:this.value,bRegex:a.oPreviousSearch.bRegex,bSmart:a.oPreviousSearch.bSmart})}); +b.bind("keypress.DT",function(d){if(d.keyCode==13)return false});return c}function M(a,b,c){Ka(a,b.sSearch,c,b.bRegex,b.bSmart);for(b=0;b<a.aoPreSearchCols.length;b++)La(a,a.aoPreSearchCols[b].sSearch,b,a.aoPreSearchCols[b].bRegex,a.aoPreSearchCols[b].bSmart);o.afnFiltering.length!==0&&Ma(a);a.bFiltered=true;a._iDisplayStart=0;E(a);C(a);ka(a,0)}function Ma(a){for(var b=o.afnFiltering,c=0,d=b.length;c<d;c++)for(var f=0,e=0,h=a.aiDisplay.length;e<h;e++){var j=a.aiDisplay[e-f];if(!b[c](a,da(a,j,"filter"), +j)){a.aiDisplay.splice(e-f,1);f++}}}function La(a,b,c,d,f){if(b!==""){var e=0;b=la(b,d,f);for(d=a.aiDisplay.length-1;d>=0;d--){f=ma(H(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType);if(!b.test(f)){a.aiDisplay.splice(d,1);e++}}}}function Ka(a,b,c,d,f){var e=la(b,d,f);if(typeof c=="undefined"||c===null)c=0;if(o.afnFiltering.length!==0)c=1;if(b.length<=0){a.aiDisplay.splice(0,a.aiDisplay.length);a.aiDisplay=a.aiDisplayMaster.slice()}else if(a.aiDisplay.length==a.aiDisplayMaster.length||a.oPreviousSearch.sSearch.length> +b.length||c==1||b.indexOf(a.oPreviousSearch.sSearch)!==0){a.aiDisplay.splice(0,a.aiDisplay.length);ka(a,1);for(c=0;c<a.aiDisplayMaster.length;c++)e.test(a.asDataSearch[c])&&a.aiDisplay.push(a.aiDisplayMaster[c])}else{var h=0;for(c=0;c<a.asDataSearch.length;c++)if(!e.test(a.asDataSearch[c])){a.aiDisplay.splice(c-h,1);h++}}a.oPreviousSearch.sSearch=b;a.oPreviousSearch.bRegex=d;a.oPreviousSearch.bSmart=f}function ka(a,b){a.asDataSearch.splice(0,a.asDataSearch.length);b=typeof b!="undefined"&&b==1?a.aiDisplayMaster: +a.aiDisplay;for(var c=0,d=b.length;c<d;c++)a.asDataSearch[c]=na(a,da(a,b[c],"filter"))}function na(a,b){var c="";if(typeof a.__nTmpFilter=="undefined")a.__nTmpFilter=p.createElement("div");for(var d=a.__nTmpFilter,f=0,e=a.aoColumns.length;f<e;f++)if(a.aoColumns[f].bSearchable)c+=ma(b[f],a.aoColumns[f].sType)+" ";if(c.indexOf("&")!==-1){d.innerHTML=c;c=d.textContent?d.textContent:d.innerText;c=c.replace(/\n/g," ").replace(/\r/g,"")}return c}function la(a,b,c){if(c){a=b?a.split(" "):oa(a).split(" "); +a="^(?=.*?"+a.join(")(?=.*?")+").*$";return new RegExp(a,"i")}else{a=b?a:oa(a);return new RegExp(a,"i")}}function ma(a,b){if(typeof o.ofnSearch[b]=="function")return o.ofnSearch[b](a);else if(b=="html")return a.replace(/\n/g," ").replace(/<.*?>/g,"");else if(typeof a=="string")return a.replace(/\n/g," ");else if(a===null)return"";return a}function R(a,b){var c,d,f,e,h=[],j=[],k=o.oSort;d=a.aoData;var m=a.aoColumns;if(!a.oFeatures.bServerSide&&(a.aaSorting.length!==0||a.aaSortingFixed!==null)){h=a.aaSortingFixed!== +null?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<h.length;c++){var t=h[c][0];f=pa(a,t);e=a.aoColumns[t].sSortDataType;if(typeof o.afnSortData[e]!="undefined"){var q=o.afnSortData[e](a,t,f);f=0;for(e=d.length;f<e;f++)N(a,f,t,q[f])}}c=0;for(d=a.aiDisplayMaster.length;c<d;c++)j[a.aiDisplayMaster[c]]=c;var I=h.length;a.aiDisplayMaster.sort(function(O,B){var F,qa;for(c=0;c<I;c++){F=m[h[c][0]].iDataSort;qa=m[F].sType;F=k[(qa?qa:"string")+"-"+h[c][1]](H(a,O,F,"sort"),H(a,B,F,"sort")); +if(F!==0)return F}return k["numeric-asc"](j[O],j[B])})}if((typeof b=="undefined"||b)&&!a.oFeatures.bDeferRender)T(a);a.bSorted=true;if(a.oFeatures.bFilter)M(a,a.oPreviousSearch,1);else{a.aiDisplay=a.aiDisplayMaster.slice();a._iDisplayStart=0;E(a);C(a)}}function ga(a,b,c,d){i(b).bind("click.DT",function(f){if(a.aoColumns[c].bSortable!==false){var e=function(){var h,j;if(f.shiftKey){for(var k=false,m=0;m<a.aaSorting.length;m++)if(a.aaSorting[m][0]==c){k=true;h=a.aaSorting[m][0];j=a.aaSorting[m][2]+ +1;if(typeof a.aoColumns[h].asSorting[j]=="undefined")a.aaSorting.splice(m,1);else{a.aaSorting[m][1]=a.aoColumns[h].asSorting[j];a.aaSorting[m][2]=j}break}k===false&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}else if(a.aaSorting.length==1&&a.aaSorting[0][0]==c){h=a.aaSorting[0][0];j=a.aaSorting[0][2]+1;if(typeof a.aoColumns[h].asSorting[j]=="undefined")j=0;a.aaSorting[0][1]=a.aoColumns[h].asSorting[j];a.aaSorting[0][2]=j}else{a.aaSorting.splice(0,a.aaSorting.length);a.aaSorting.push([c,a.aoColumns[c].asSorting[0], +0])}R(a)};if(a.oFeatures.bProcessing){K(a,true);setTimeout(function(){e();a.oFeatures.bServerSide||K(a,false)},0)}else e();typeof d=="function"&&d(a)}})}function T(a){var b,c,d,f,e,h=a.aoColumns.length,j=a.oClasses;for(b=0;b<h;b++)a.aoColumns[b].bSortable&&i(a.aoColumns[b].nTh).removeClass(j.sSortAsc+" "+j.sSortDesc+" "+a.aoColumns[b].sSortingClass);f=a.aaSortingFixed!==null?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable){e=a.aoColumns[b].sSortingClass; +d=-1;for(c=0;c<f.length;c++)if(f[c][0]==b){e=f[c][1]=="asc"?j.sSortAsc:j.sSortDesc;d=c;break}i(a.aoColumns[b].nTh).addClass(e);if(a.bJUI){c=i("span",a.aoColumns[b].nTh);c.removeClass(j.sSortJUIAsc+" "+j.sSortJUIDesc+" "+j.sSortJUI+" "+j.sSortJUIAscAllowed+" "+j.sSortJUIDescAllowed);c.addClass(d==-1?a.aoColumns[b].sSortingClassJUI:f[d][1]=="asc"?j.sSortJUIAsc:j.sSortJUIDesc)}}else i(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);e=j.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){d= +Q(a);if(a.oFeatures.bDeferRender)i(d).removeClass(e+"1 "+e+"2 "+e+"3");else if(d.length>=h)for(b=0;b<h;b++)if(d[b].className.indexOf(e+"1")!=-1){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(e+"1",""))}else if(d[b].className.indexOf(e+"2")!=-1){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(e+"2",""))}else if(d[b].className.indexOf(e+"3")!=-1){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(" "+ +e+"3",""))}j=1;var k;for(b=0;b<f.length;b++){k=parseInt(f[b][0],10);c=0;for(a=d.length/h;c<a;c++)d[h*c+k].className+=" "+e+j;j<3&&j++}}}function Ha(a){if(a.oScroll.bInfinite)return null;var b=p.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType;o.oPagination[a.sPaginationType].fnInit(a,b,function(c){E(c);C(c)});typeof a.aanFeatures.p=="undefined"&&a.aoDrawCallback.push({fn:function(c){o.oPagination[c.sPaginationType].fnUpdate(c,function(d){E(d);C(d)})},sName:"pagination"});return b} +function ja(a,b){var c=a._iDisplayStart;if(b=="first")a._iDisplayStart=0;else if(b=="previous"){a._iDisplayStart=a._iDisplayLength>=0?a._iDisplayStart-a._iDisplayLength:0;if(a._iDisplayStart<0)a._iDisplayStart=0}else if(b=="next")if(a._iDisplayLength>=0){if(a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay())a._iDisplayStart+=a._iDisplayLength}else a._iDisplayStart=0;else if(b=="last")if(a._iDisplayLength>=0){b=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(b-1)*a._iDisplayLength}else a._iDisplayStart= +0;else J(a,0,"Unknown paging action: "+b);return c!=a._iDisplayStart}function Ga(a){var b=p.createElement("div");b.className=a.oClasses.sInfo;if(typeof a.aanFeatures.i=="undefined"){a.aoDrawCallback.push({fn:Na,sName:"information"});a.sTableId!==""&&b.setAttribute("id",a.sTableId+"_info")}return b}function Na(a){if(!(!a.oFeatures.bInfo||a.aanFeatures.i.length===0)){var b=a._iDisplayStart+1,c=a.fnDisplayEnd(),d=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),e=a.fnFormatNumber(b),h=a.fnFormatNumber(c),j= +a.fnFormatNumber(d),k=a.fnFormatNumber(f);if(a.oScroll.bInfinite)e=a.fnFormatNumber(1);e=a.fnRecordsDisplay()===0&&a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfoEmpty+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()===0?a.oLanguage.sInfoEmpty+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",j)+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfo.replace("_START_",e).replace("_END_",h).replace("_TOTAL_",k)+a.oLanguage.sInfoPostFix:a.oLanguage.sInfo.replace("_START_", +e).replace("_END_",h).replace("_TOTAL_",k)+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()))+a.oLanguage.sInfoPostFix;if(a.oLanguage.fnInfoCallback!==null)e=a.oLanguage.fnInfoCallback(a,b,c,d,f,e);a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++)i(a[b]).html(e)}}function Ca(a){if(a.oScroll.bInfinite)return null;var b='<select size="1" '+(a.sTableId===""?"":'name="'+a.sTableId+'_length"')+">",c,d;if(a.aLengthMenu.length==2&&typeof a.aLengthMenu[0]=="object"&&typeof a.aLengthMenu[1]== +"object"){c=0;for(d=a.aLengthMenu[0].length;c<d;c++)b+='<option value="'+a.aLengthMenu[0][c]+'">'+a.aLengthMenu[1][c]+"</option>"}else{c=0;for(d=a.aLengthMenu.length;c<d;c++)b+='<option value="'+a.aLengthMenu[c]+'">'+a.aLengthMenu[c]+"</option>"}b+="</select>";var f=p.createElement("div");a.sTableId!==""&&typeof a.aanFeatures.l=="undefined"&&f.setAttribute("id",a.sTableId+"_length");f.className=a.oClasses.sLength;f.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";i('select option[value="'+ +a._iDisplayLength+'"]',f).attr("selected",true);i("select",f).bind("change.DT",function(){var e=i(this).val(),h=a.aanFeatures.l;c=0;for(d=h.length;c<d;c++)h[c]!=this.parentNode&&i("select",h[c]).val(e);a._iDisplayLength=parseInt(e,10);E(a);if(a.fnDisplayEnd()==a.fnRecordsDisplay()){a._iDisplayStart=a.fnDisplayEnd()-a._iDisplayLength;if(a._iDisplayStart<0)a._iDisplayStart=0}if(a._iDisplayLength==-1)a._iDisplayStart=0;C(a)});return f}function Ea(a){var b=p.createElement("div");a.sTableId!==""&&typeof a.aanFeatures.r== +"undefined"&&b.setAttribute("id",a.sTableId+"_processing");b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function K(a,b){if(a.oFeatures.bProcessing){a=a.aanFeatures.r;for(var c=0,d=a.length;c<d;c++)a[c].style.visibility=b?"visible":"hidden"}}function Ja(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++){a.aoColumns[d].bVisible===true&&c++;if(c==b)return d}return null}function pa(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++){a.aoColumns[d].bVisible=== +true&&c++;if(d==b)return a.aoColumns[d].bVisible===true?c:null}return null}function U(a,b){var c,d;c=a._iDisplayStart;for(d=a._iDisplayEnd;c<d;c++)if(a.aoData[a.aiDisplay[c]].nTr==b)return a.aiDisplay[c];c=0;for(d=a.aoData.length;c<d;c++)if(a.aoData[c].nTr==b)return c;return null}function X(a){for(var b=0,c=0;c<a.aoColumns.length;c++)a.aoColumns[c].bVisible===true&&b++;return b}function E(a){a._iDisplayEnd=a.oFeatures.bPaginate===false?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length|| +a._iDisplayLength==-1?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Oa(a,b){if(!a||a===null||a==="")return 0;if(typeof b=="undefined")b=p.getElementsByTagName("body")[0];var c=p.createElement("div");c.style.width=u(a);b.appendChild(c);a=c.offsetWidth;b.removeChild(c);return a}function ea(a){var b=0,c,d=0,f=a.aoColumns.length,e,h=i("th",a.nTHead);for(e=0;e<f;e++)if(a.aoColumns[e].bVisible){d++;if(a.aoColumns[e].sWidth!==null){c=Oa(a.aoColumns[e].sWidthOrig,a.nTable.parentNode);if(c!== +null)a.aoColumns[e].sWidth=u(c);b++}}if(f==h.length&&b===0&&d==f&&a.oScroll.sX===""&&a.oScroll.sY==="")for(e=0;e<a.aoColumns.length;e++){c=i(h[e]).width();if(c!==null)a.aoColumns[e].sWidth=u(c)}else{b=a.nTable.cloneNode(false);e=a.nTHead.cloneNode(true);d=p.createElement("tbody");c=p.createElement("tr");b.removeAttribute("id");b.appendChild(e);if(a.nTFoot!==null){b.appendChild(a.nTFoot.cloneNode(true));P(function(k){k.style.width=""},b.getElementsByTagName("tr"))}b.appendChild(d);d.appendChild(c); +d=i("thead th",b);if(d.length===0)d=i("tbody tr:eq(0)>td",b);h=S(a,e);for(e=d=0;e<f;e++){var j=a.aoColumns[e];if(j.bVisible&&j.sWidthOrig!==null&&j.sWidthOrig!=="")h[e-d].style.width=u(j.sWidthOrig);else if(j.bVisible)h[e-d].style.width="";else d++}for(e=0;e<f;e++)if(a.aoColumns[e].bVisible){d=Pa(a,e);if(d!==null){d=d.cloneNode(true);if(a.aoColumns[e].sContentPadding!=="")d.innerHTML+=a.aoColumns[e].sContentPadding;c.appendChild(d)}}f=a.nTable.parentNode;f.appendChild(b);if(a.oScroll.sX!==""&&a.oScroll.sXInner!== +"")b.style.width=u(a.oScroll.sXInner);else if(a.oScroll.sX!==""){b.style.width="";if(i(b).width()<f.offsetWidth)b.style.width=u(f.offsetWidth)}else if(a.oScroll.sY!=="")b.style.width=u(f.offsetWidth);b.style.visibility="hidden";Qa(a,b);f=i("tbody tr:eq(0)",b).children();if(f.length===0)f=S(a,i("thead",b)[0]);if(a.oScroll.sX!==""){for(e=d=c=0;e<a.aoColumns.length;e++)if(a.aoColumns[e].bVisible){c+=a.aoColumns[e].sWidthOrig===null?i(f[d]).outerWidth():parseInt(a.aoColumns[e].sWidth.replace("px",""), +10)+(i(f[d]).outerWidth()-i(f[d]).width());d++}b.style.width=u(c);a.nTable.style.width=u(c)}for(e=d=0;e<a.aoColumns.length;e++)if(a.aoColumns[e].bVisible){c=i(f[d]).width();if(c!==null&&c>0)a.aoColumns[e].sWidth=u(c);d++}a.nTable.style.width=u(i(b).outerWidth());b.parentNode.removeChild(b)}}function Qa(a,b){if(a.oScroll.sX===""&&a.oScroll.sY!==""){i(b).width();b.style.width=u(i(b).outerWidth()-a.oScroll.iBarWidth)}else if(a.oScroll.sX!=="")b.style.width=u(i(b).outerWidth())}function Pa(a,b){var c= +Ra(a,b);if(c<0)return null;if(a.aoData[c].nTr===null){var d=p.createElement("td");d.innerHTML=H(a,c,b,"");return d}return Q(a,c)[b]}function Ra(a,b){for(var c=-1,d=-1,f=0;f<a.aoData.length;f++){var e=H(a,f,b,"display")+"";e=e.replace(/<.*?>/g,"");if(e.length>c){c=e.length;d=f}}return d}function u(a){if(a===null)return"0px";if(typeof a=="number"){if(a<0)return"0px";return a+"px"}var b=a.charCodeAt(a.length-1);if(b<48||b>57)return a;return a+"px"}function Va(a,b){if(a.length!=b.length)return 1;for(var c= +0;c<a.length;c++)if(a[c]!=b[c])return 2;return 0}function fa(a){for(var b=o.aTypes,c=b.length,d=0;d<c;d++){var f=b[d](a);if(f!==null)return f}return"string"}function A(a){for(var b=0;b<D.length;b++)if(D[b].nTable==a)return D[b];return null}function aa(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++)b.push(a.aoData[d]._aData);return b}function $(a){for(var b=[],c=0,d=a.aoData.length;c<d;c++)a.aoData[c].nTr!==null&&b.push(a.aoData[c].nTr);return b}function Q(a,b){var c=[],d,f,e,h,j;f=0;var k=a.aoData.length; +if(typeof b!="undefined"){f=b;k=b+1}for(f=f;f<k;f++){j=a.aoData[f];if(j.nTr!==null){b=[];e=0;for(h=j.nTr.childNodes.length;e<h;e++){d=j.nTr.childNodes[e].nodeName.toLowerCase();if(d=="td"||d=="th")b.push(j.nTr.childNodes[e])}e=d=0;for(h=a.aoColumns.length;e<h;e++)if(a.aoColumns[e].bVisible)c.push(b[e-d]);else{c.push(j._anHidden[e]);d++}}}return c}function oa(a){return a.replace(new RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^)","g"),"\\$1")}function ra(a,b){for(var c=-1,d= +0,f=a.length;d<f;d++)if(a[d]==b)c=d;else a[d]>b&&a[d]--;c!=-1&&a.splice(c,1)}function Ba(a,b){b=b.split(",");for(var c=[],d=0,f=a.aoColumns.length;d<f;d++)for(var e=0;e<f;e++)if(a.aoColumns[d].sName==b[e]){c.push(e);break}return c}function ha(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++)b+=a.aoColumns[c].sName+",";if(b.length==d)return"";return b.slice(0,-1)}function J(a,b,c){a=a.sTableId===""?"DataTables warning: "+c:"DataTables warning (table id = '"+a.sTableId+"'): "+c;if(b===0)if(o.sErrMode== +"alert")alert(a);else throw a;else typeof console!="undefined"&&typeof console.log!="undefined"&&console.log(a)}function ia(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0,a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);E(a)}function sa(a){if(!(!a.oFeatures.bStateSave||typeof a.bDestroying!="undefined")){var b,c,d,f="{";f+='"iCreate":'+(new Date).getTime()+",";f+='"iStart":'+(a.oScroll.bInfinite?0:a._iDisplayStart)+",";f+='"iEnd":'+(a.oScroll.bInfinite?a._iDisplayLength: +a._iDisplayEnd)+",";f+='"iLength":'+a._iDisplayLength+",";f+='"sFilter":"'+encodeURIComponent(a.oPreviousSearch.sSearch)+'",';f+='"sFilterEsc":'+!a.oPreviousSearch.bRegex+",";f+='"aaSorting":[ ';for(b=0;b<a.aaSorting.length;b++)f+="["+a.aaSorting[b][0]+',"'+a.aaSorting[b][1]+'"],';f=f.substring(0,f.length-1);f+="],";f+='"aaSearchCols":[ ';for(b=0;b<a.aoPreSearchCols.length;b++)f+='["'+encodeURIComponent(a.aoPreSearchCols[b].sSearch)+'",'+!a.aoPreSearchCols[b].bRegex+"],";f=f.substring(0,f.length- +1);f+="],";f+='"abVisCols":[ ';for(b=0;b<a.aoColumns.length;b++)f+=a.aoColumns[b].bVisible+",";f=f.substring(0,f.length-1);f+="]";b=0;for(c=a.aoStateSave.length;b<c;b++){d=a.aoStateSave[b].fn(a,f);if(d!=="")f=d}f+="}";Sa(a.sCookiePrefix+a.sInstance,f,a.iCookieDuration,a.sCookiePrefix,a.fnCookieCallback)}}function Ta(a,b){if(a.oFeatures.bStateSave){var c,d,f;d=ta(a.sCookiePrefix+a.sInstance);if(d!==null&&d!==""){try{c=typeof i.parseJSON=="function"?i.parseJSON(d.replace(/'/g,'"')):eval("("+d+")")}catch(e){return}d= +0;for(f=a.aoStateLoad.length;d<f;d++)if(!a.aoStateLoad[d].fn(a,c))return;a.oLoadedState=i.extend(true,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart=c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.oPreviousSearch.sSearch=decodeURIComponent(c.sFilter);a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();if(typeof c.sFilterEsc!="undefined")a.oPreviousSearch.bRegex=!c.sFilterEsc;if(typeof c.aaSearchCols!="undefined")for(d=0;d<c.aaSearchCols.length;d++)a.aoPreSearchCols[d]= +{sSearch:decodeURIComponent(c.aaSearchCols[d][0]),bRegex:!c.aaSearchCols[d][1]};if(typeof c.abVisCols!="undefined"){b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++){b.saved_aoColumns[d]={};b.saved_aoColumns[d].bVisible=c.abVisCols[d]}}}}}function Sa(a,b,c,d,f){var e=new Date;e.setTime(e.getTime()+c*1E3);c=wa.location.pathname.split("/");a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase();var h;if(f!==null){h=typeof i.parseJSON=="function"?i.parseJSON(b):eval("("+b+")");b=f(a,h,e.toGMTString(), +c.join("/")+"/")}else b=a+"="+encodeURIComponent(b)+"; expires="+e.toGMTString()+"; path="+c.join("/")+"/";f="";e=9999999999999;if((ta(a)!==null?p.cookie.length:b.length+p.cookie.length)+10>4096){a=p.cookie.split(";");for(var j=0,k=a.length;j<k;j++)if(a[j].indexOf(d)!=-1){var m=a[j].split("=");try{h=eval("("+decodeURIComponent(m[1])+")")}catch(t){continue}if(typeof h.iCreate!="undefined"&&h.iCreate<e){f=m[0];e=h.iCreate}}if(f!=="")p.cookie=f+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+c.join("/")+ +"/"}p.cookie=b}function ta(a){var b=wa.location.pathname.split("/");a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=";b=p.cookie.split(";");for(var c=0;c<b.length;c++){for(var d=b[c];d.charAt(0)==" ";)d=d.substring(1,d.length);if(d.indexOf(a)===0)return decodeURIComponent(d.substring(a.length,d.length))}return null}function W(a,b){b=b.getElementsByTagName("tr");var c,d,f,e,h,j,k,m,t=function(O,B,F){for(;typeof O[B][F]!="undefined";)F++;return F};a.splice(0,a.length);d=0;for(j=b.length;d< +j;d++)a.push([]);d=0;for(j=b.length;d<j;d++){f=0;for(k=b[d].childNodes.length;f<k;f++){c=b[d].childNodes[f];if(c.nodeName.toUpperCase()=="TD"||c.nodeName.toUpperCase()=="TH"){var q=c.getAttribute("colspan")*1,I=c.getAttribute("rowspan")*1;q=!q||q===0||q===1?1:q;I=!I||I===0||I===1?1:I;m=t(a,d,0);for(h=0;h<q;h++)for(e=0;e<I;e++){a[d+e][m+h]={cell:c,unique:q==1?true:false};a[d+e].nTr=b[d]}}}}}function S(a,b,c){var d=[];if(typeof c=="undefined"){c=a.aoHeader;if(typeof b!="undefined"){c=[];W(c,b)}}b=0; +for(var f=c.length;b<f;b++)for(var e=0,h=c[b].length;e<h;e++)if(c[b][e].unique&&(typeof d[e]=="undefined"||!a.bSortCellsTop))d[e]=c[b][e].cell;return d}function Ua(){var a=p.createElement("p"),b=a.style;b.width="100%";b.height="200px";var c=p.createElement("div");b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px";b.overflow="hidden";c.appendChild(a);p.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";a=a.offsetWidth;if(b==a)a= +c.clientWidth;p.body.removeChild(c);return b-a}function P(a,b,c){for(var d=0,f=b.length;d<f;d++)for(var e=0,h=b[d].childNodes.length;e<h;e++)if(b[d].childNodes[e].nodeType==1)typeof c!="undefined"?a(b[d].childNodes[e],c[d].childNodes[e]):a(b[d].childNodes[e])}function n(a,b,c,d){if(typeof d=="undefined")d=c;if(typeof b[c]!="undefined")a[d]=b[c]}function da(a,b,c){for(var d=[],f=0,e=a.aoColumns.length;f<e;f++)d.push(H(a,b,f,c));return d}function H(a,b,c,d){var f=a.aoColumns[c];if((c=f.fnGetData(a.aoData[b]._aData))=== +undefined){if(a.iDrawError!=a.iDraw&&f.sDefaultContent===null){J(a,0,"Requested unknown parameter '"+f.mDataProp+"' from the data source for row "+b);a.iDrawError=a.iDraw}return f.sDefaultContent}if(c===null&&f.sDefaultContent!==null)c=f.sDefaultContent;if(d=="display"&&c===null)return"";return c}function N(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function Z(a){if(a===null)return function(){return null};else if(typeof a=="function")return function(c){return a(c)};else if(typeof a== +"string"&&a.indexOf(".")!=-1){var b=a.split(".");return b.length==2?function(c){return c[b[0]][b[1]]}:b.length==3?function(c){return c[b[0]][b[1]][b[2]]}:function(c){for(var d=0,f=b.length;d<f;d++)c=c[b[d]];return c}}else return function(c){return c[a]}}function ya(a){if(a===null)return function(){};else if(typeof a=="function")return function(c,d){return a(c,d)};else if(typeof a=="string"&&a.indexOf(".")!=-1){var b=a.split(".");return b.length==2?function(c,d){c[b[0]][b[1]]=d}:b.length==3?function(c, +d){c[b[0]][b[1]][b[2]]=d}:function(c,d){for(var f=0,e=b.length-1;f<e;f++)c=c[b[f]];c[b[b.length-1]]=d}}else return function(c,d){c[a]=d}}this.oApi={};this.fnDraw=function(a){var b=A(this[o.iApiIndex]);if(typeof a!="undefined"&&a===false){E(b);C(b)}else ba(b)};this.fnFilter=function(a,b,c,d,f){var e=A(this[o.iApiIndex]);if(e.oFeatures.bFilter){if(typeof c=="undefined")c=false;if(typeof d=="undefined")d=true;if(typeof f=="undefined")f=true;if(typeof b=="undefined"||b===null){M(e,{sSearch:a,bRegex:c, +bSmart:d},1);if(f&&typeof e.aanFeatures.f!="undefined"){b=e.aanFeatures.f;c=0;for(d=b.length;c<d;c++)i("input",b[c]).val(a)}}else{e.aoPreSearchCols[b].sSearch=a;e.aoPreSearchCols[b].bRegex=c;e.aoPreSearchCols[b].bSmart=d;M(e,e.oPreviousSearch,1)}}};this.fnSettings=function(){return A(this[o.iApiIndex])};this.fnVersionCheck=o.fnVersionCheck;this.fnSort=function(a){var b=A(this[o.iApiIndex]);b.aaSorting=a;R(b)};this.fnSortListener=function(a,b,c){ga(A(this[o.iApiIndex]),a,b,c)};this.fnAddData=function(a, +b){if(a.length===0)return[];var c=[],d,f=A(this[o.iApiIndex]);if(typeof a[0]=="object")for(var e=0;e<a.length;e++){d=v(f,a[e]);if(d==-1)return c;c.push(d)}else{d=v(f,a);if(d==-1)return c;c.push(d)}f.aiDisplay=f.aiDisplayMaster.slice();if(typeof b=="undefined"||b)ba(f);return c};this.fnDeleteRow=function(a,b,c){var d=A(this[o.iApiIndex]);a=typeof a=="object"?U(d,a):a;var f=d.aoData.splice(a,1),e=i.inArray(a,d.aiDisplay);d.asDataSearch.splice(e,1);ra(d.aiDisplayMaster,a);ra(d.aiDisplay,a);typeof b== +"function"&&b.call(this,d,f);if(d._iDisplayStart>=d.aiDisplay.length){d._iDisplayStart-=d._iDisplayLength;if(d._iDisplayStart<0)d._iDisplayStart=0}if(typeof c=="undefined"||c){E(d);C(d)}return f};this.fnClearTable=function(a){var b=A(this[o.iApiIndex]);ia(b);if(typeof a=="undefined"||a)C(b)};this.fnOpen=function(a,b,c){var d=A(this[o.iApiIndex]);this.fnClose(a);var f=p.createElement("tr"),e=p.createElement("td");f.appendChild(e);e.className=c;e.colSpan=X(d);if(typeof b.jquery!="undefined"||typeof b== +"object")e.appendChild(b);else e.innerHTML=b;b=i("tr",d.nTBody);i.inArray(a,b)!=-1&&i(f).insertAfter(a);d.aoOpenRows.push({nTr:f,nParent:a});return f};this.fnClose=function(a){for(var b=A(this[o.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a){(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr);b.aoOpenRows.splice(c,1);return 0}return 1};this.fnGetData=function(a,b){var c=A(this[o.iApiIndex]);if(typeof a!="undefined"){a=typeof a=="object"?U(c,a):a;if(typeof b!= +"undefined")return H(c,a,b,"");return typeof c.aoData[a]!="undefined"?c.aoData[a]._aData:null}return aa(c)};this.fnGetNodes=function(a){var b=A(this[o.iApiIndex]);if(typeof a!="undefined")return typeof b.aoData[a]!="undefined"?b.aoData[a].nTr:null;return $(b)};this.fnGetPosition=function(a){var b=A(this[o.iApiIndex]),c=a.nodeName.toUpperCase();if(c=="TR")return U(b,a);else if(c=="TD"||c=="TH"){c=U(b,a.parentNode);for(var d=Q(b,c),f=0;f<b.aoColumns.length;f++)if(d[f]==a)return[c,pa(b,f),f]}return null}; +this.fnUpdate=function(a,b,c,d,f){var e=A(this[o.iApiIndex]);b=typeof b=="object"?U(e,b):b;if(i.isArray(a)&&typeof a=="object"){e.aoData[b]._aData=a.slice();for(c=0;c<e.aoColumns.length;c++)this.fnUpdate(H(e,b,c),b,c,false,false)}else if(typeof a=="object"){e.aoData[b]._aData=i.extend(true,{},a);for(c=0;c<e.aoColumns.length;c++)this.fnUpdate(H(e,b,c),b,c,false,false)}else{a=a;N(e,b,c,a);if(e.aoColumns[c].fnRender!==null){a=e.aoColumns[c].fnRender({iDataRow:b,iDataColumn:c,aData:e.aoData[b]._aData, +oSettings:e});e.aoColumns[c].bUseRendered&&N(e,b,c,a)}if(e.aoData[b].nTr!==null)Q(e,b)[c].innerHTML=a}c=i.inArray(b,e.aiDisplay);e.asDataSearch[c]=na(e,da(e,b,"filter"));if(typeof f=="undefined"||f)ca(e);if(typeof d=="undefined"||d)ba(e);return 0};this.fnSetColumnVis=function(a,b,c){var d=A(this[o.iApiIndex]),f,e;e=d.aoColumns.length;var h,j;if(d.aoColumns[a].bVisible!=b){if(b){for(f=j=0;f<a;f++)d.aoColumns[f].bVisible&&j++;j=j>=X(d);if(!j)for(f=a;f<e;f++)if(d.aoColumns[f].bVisible){h=f;break}f=0; +for(e=d.aoData.length;f<e;f++)if(d.aoData[f].nTr!==null)j?d.aoData[f].nTr.appendChild(d.aoData[f]._anHidden[a]):d.aoData[f].nTr.insertBefore(d.aoData[f]._anHidden[a],Q(d,f)[h])}else{f=0;for(e=d.aoData.length;f<e;f++)if(d.aoData[f].nTr!==null){h=Q(d,f)[a];d.aoData[f]._anHidden[a]=h;h.parentNode.removeChild(h)}}d.aoColumns[a].bVisible=b;L(d,d.aoHeader);d.nTFoot&&L(d,d.aoFooter);f=0;for(e=d.aoOpenRows.length;f<e;f++)d.aoOpenRows[f].nTr.colSpan=X(d);if(typeof c=="undefined"||c){ca(d);C(d)}sa(d)}};this.fnPageChange= +function(a,b){var c=A(this[o.iApiIndex]);ja(c,a);E(c);if(typeof b=="undefined"||b)C(c)};this.fnDestroy=function(){var a=A(this[o.iApiIndex]),b=a.nTableWrapper.parentNode,c=a.nTBody,d,f;a.bDestroying=true;d=0;for(f=a.aoColumns.length;d<f;d++)a.aoColumns[d].bVisible===false&&this.fnSetColumnVis(d,true);i(a.nTableWrapper).find("*").andSelf().unbind(".DT");i("tbody>tr>td."+a.oClasses.sRowEmpty,a.nTable).parent().remove();if(a.nTable!=a.nTHead.parentNode){i(">thead",a.nTable).remove();a.nTable.appendChild(a.nTHead)}if(a.nTFoot&& +a.nTable!=a.nTFoot.parentNode){i(">tfoot",a.nTable).remove();a.nTable.appendChild(a.nTFoot)}a.nTable.parentNode.removeChild(a.nTable);i(a.nTableWrapper).remove();a.aaSorting=[];a.aaSortingFixed=[];T(a);i($(a)).removeClass(a.asStripClasses.join(" "));if(a.bJUI){i("th",a.nTHead).removeClass([o.oStdClasses.sSortable,o.oJUIClasses.sSortableAsc,o.oJUIClasses.sSortableDesc,o.oJUIClasses.sSortableNone].join(" "));i("th span."+o.oJUIClasses.sSortIcon,a.nTHead).remove();i("th",a.nTHead).each(function(){var e= +i("div."+o.oJUIClasses.sSortJUIWrapper,this),h=e.contents();i(this).append(h);e.remove()})}else i("th",a.nTHead).removeClass([o.oStdClasses.sSortable,o.oStdClasses.sSortableAsc,o.oStdClasses.sSortableDesc,o.oStdClasses.sSortableNone].join(" "));a.nTableReinsertBefore?b.insertBefore(a.nTable,a.nTableReinsertBefore):b.appendChild(a.nTable);d=0;for(f=a.aoData.length;d<f;d++)a.aoData[d].nTr!==null&&c.appendChild(a.aoData[d].nTr);if(a.oFeatures.bAutoWidth===true)a.nTable.style.width=u(a.sDestroyWidth); +i(">tr:even",c).addClass(a.asDestoryStrips[0]);i(">tr:odd",c).addClass(a.asDestoryStrips[1]);d=0;for(f=D.length;d<f;d++)D[d]==a&&D.splice(d,1);a=null};this.fnAdjustColumnSizing=function(a){var b=A(this[o.iApiIndex]);ca(b);if(typeof a=="undefined"||a)this.fnDraw(false);else if(b.oScroll.sX!==""||b.oScroll.sY!=="")this.oApi._fnScrollDraw(b)};for(var ua in o.oApi)if(ua)this[ua]=r(ua);this.oApi._fnExternApiFunc=r;this.oApi._fnInitalise=s;this.oApi._fnInitComplete=w;this.oApi._fnLanguageProcess=y;this.oApi._fnAddColumn= +G;this.oApi._fnColumnOptions=x;this.oApi._fnAddData=v;this.oApi._fnCreateTr=z;this.oApi._fnGatherData=Y;this.oApi._fnBuildHead=V;this.oApi._fnDrawHead=L;this.oApi._fnDraw=C;this.oApi._fnReDraw=ba;this.oApi._fnAjaxUpdate=za;this.oApi._fnAjaxUpdateDraw=Aa;this.oApi._fnAddOptionsHtml=xa;this.oApi._fnFeatureHtmlTable=Fa;this.oApi._fnScrollDraw=Ia;this.oApi._fnAjustColumnSizing=ca;this.oApi._fnFeatureHtmlFilter=Da;this.oApi._fnFilterComplete=M;this.oApi._fnFilterCustom=Ma;this.oApi._fnFilterColumn=La; +this.oApi._fnFilter=Ka;this.oApi._fnBuildSearchArray=ka;this.oApi._fnBuildSearchRow=na;this.oApi._fnFilterCreateSearch=la;this.oApi._fnDataToSearch=ma;this.oApi._fnSort=R;this.oApi._fnSortAttachListener=ga;this.oApi._fnSortingClasses=T;this.oApi._fnFeatureHtmlPaginate=Ha;this.oApi._fnPageChange=ja;this.oApi._fnFeatureHtmlInfo=Ga;this.oApi._fnUpdateInfo=Na;this.oApi._fnFeatureHtmlLength=Ca;this.oApi._fnFeatureHtmlProcessing=Ea;this.oApi._fnProcessingDisplay=K;this.oApi._fnVisibleToColumnIndex=Ja;this.oApi._fnColumnIndexToVisible= +pa;this.oApi._fnNodeToDataIndex=U;this.oApi._fnVisbleColumns=X;this.oApi._fnCalculateEnd=E;this.oApi._fnConvertToWidth=Oa;this.oApi._fnCalculateColumnWidths=ea;this.oApi._fnScrollingWidthAdjust=Qa;this.oApi._fnGetWidestNode=Pa;this.oApi._fnGetMaxLenString=Ra;this.oApi._fnStringToCss=u;this.oApi._fnArrayCmp=Va;this.oApi._fnDetectType=fa;this.oApi._fnSettingsFromNode=A;this.oApi._fnGetDataMaster=aa;this.oApi._fnGetTrNodes=$;this.oApi._fnGetTdNodes=Q;this.oApi._fnEscapeRegex=oa;this.oApi._fnDeleteIndex= +ra;this.oApi._fnReOrderIndex=Ba;this.oApi._fnColumnOrdering=ha;this.oApi._fnLog=J;this.oApi._fnClearTable=ia;this.oApi._fnSaveState=sa;this.oApi._fnLoadState=Ta;this.oApi._fnCreateCookie=Sa;this.oApi._fnReadCookie=ta;this.oApi._fnDetectHeader=W;this.oApi._fnGetUniqueThs=S;this.oApi._fnScrollBarWidth=Ua;this.oApi._fnApplyToChildren=P;this.oApi._fnMap=n;this.oApi._fnGetRowData=da;this.oApi._fnGetCellData=H;this.oApi._fnSetCellData=N;this.oApi._fnGetObjectDataFn=Z;this.oApi._fnSetObjectDataFn=ya;var va= +this;return this.each(function(){var a=0,b,c,d,f;a=0;for(b=D.length;a<b;a++){if(D[a].nTable==this)if(typeof g=="undefined"||typeof g.bRetrieve!="undefined"&&g.bRetrieve===true)return D[a].oInstance;else if(typeof g.bDestroy!="undefined"&&g.bDestroy===true){D[a].oInstance.fnDestroy();break}else{J(D[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrieve to true. Alternatively, to destory the old table and create a new one, set bDestroy to true (note that a lot of changes to the configuration can be made through the API which is usually much faster)."); +return}if(D[a].sTableId!==""&&D[a].sTableId==this.getAttribute("id")){D.splice(a,1);break}}var e=new l;D.push(e);var h=false,j=false;a=this.getAttribute("id");if(a!==null){e.sTableId=a;e.sInstance=a}else e.sInstance=o._oExternConfig.iNextUnique++;if(this.nodeName.toLowerCase()!="table")J(e,0,"Attempted to initialise DataTables on a node which is not a table: "+this.nodeName);else{e.nTable=this;e.oInstance=va.length==1?va:i(this).dataTable();e.oApi=va.oApi;e.sDestroyWidth=i(this).width();if(typeof g!= +"undefined"&&g!==null){e.oInit=g;n(e.oFeatures,g,"bPaginate");n(e.oFeatures,g,"bLengthChange");n(e.oFeatures,g,"bFilter");n(e.oFeatures,g,"bSort");n(e.oFeatures,g,"bInfo");n(e.oFeatures,g,"bProcessing");n(e.oFeatures,g,"bAutoWidth");n(e.oFeatures,g,"bSortClasses");n(e.oFeatures,g,"bServerSide");n(e.oFeatures,g,"bDeferRender");n(e.oScroll,g,"sScrollX","sX");n(e.oScroll,g,"sScrollXInner","sXInner");n(e.oScroll,g,"sScrollY","sY");n(e.oScroll,g,"bScrollCollapse","bCollapse");n(e.oScroll,g,"bScrollInfinite", +"bInfinite");n(e.oScroll,g,"iScrollLoadGap","iLoadGap");n(e.oScroll,g,"bScrollAutoCss","bAutoCss");n(e,g,"asStripClasses");n(e,g,"fnPreDrawCallback");n(e,g,"fnRowCallback");n(e,g,"fnHeaderCallback");n(e,g,"fnFooterCallback");n(e,g,"fnCookieCallback");n(e,g,"fnInitComplete");n(e,g,"fnServerData");n(e,g,"fnFormatNumber");n(e,g,"aaSorting");n(e,g,"aaSortingFixed");n(e,g,"aLengthMenu");n(e,g,"sPaginationType");n(e,g,"sAjaxSource");n(e,g,"sAjaxDataProp");n(e,g,"iCookieDuration");n(e,g,"sCookiePrefix"); +n(e,g,"sDom");n(e,g,"bSortCellsTop");n(e,g,"oSearch","oPreviousSearch");n(e,g,"aoSearchCols","aoPreSearchCols");n(e,g,"iDisplayLength","_iDisplayLength");n(e,g,"bJQueryUI","bJUI");n(e.oLanguage,g,"fnInfoCallback");typeof g.fnDrawCallback=="function"&&e.aoDrawCallback.push({fn:g.fnDrawCallback,sName:"user"});typeof g.fnStateSaveCallback=="function"&&e.aoStateSave.push({fn:g.fnStateSaveCallback,sName:"user"});typeof g.fnStateLoadCallback=="function"&&e.aoStateLoad.push({fn:g.fnStateLoadCallback,sName:"user"}); +if(e.oFeatures.bServerSide&&e.oFeatures.bSort&&e.oFeatures.bSortClasses)e.aoDrawCallback.push({fn:T,sName:"server_side_sort_classes"});else e.oFeatures.bDeferRender&&e.aoDrawCallback.push({fn:T,sName:"defer_sort_classes"});if(typeof g.bJQueryUI!="undefined"&&g.bJQueryUI){e.oClasses=o.oJUIClasses;if(typeof g.sDom=="undefined")e.sDom='<"H"lfr>t<"F"ip>'}if(e.oScroll.sX!==""||e.oScroll.sY!=="")e.oScroll.iBarWidth=Ua();if(typeof g.iDisplayStart!="undefined"&&typeof e.iInitDisplayStart=="undefined"){e.iInitDisplayStart= +g.iDisplayStart;e._iDisplayStart=g.iDisplayStart}if(typeof g.bStateSave!="undefined"){e.oFeatures.bStateSave=g.bStateSave;Ta(e,g);e.aoDrawCallback.push({fn:sa,sName:"state_save"})}if(typeof g.iDeferLoading!="undefined"){e.bDeferLoading=true;e._iRecordsTotal=g.iDeferLoading;e._iRecordsDisplay=g.iDeferLoading}if(typeof g.aaData!="undefined")j=true;if(typeof g!="undefined"&&typeof g.aoData!="undefined")g.aoColumns=g.aoData;if(typeof g.oLanguage!="undefined")if(typeof g.oLanguage.sUrl!="undefined"&&g.oLanguage.sUrl!== +""){e.oLanguage.sUrl=g.oLanguage.sUrl;i.getJSON(e.oLanguage.sUrl,null,function(t){y(e,t,true)});h=true}else y(e,g.oLanguage,false)}else g={};if(typeof g.asStripClasses=="undefined"){e.asStripClasses.push(e.oClasses.sStripOdd);e.asStripClasses.push(e.oClasses.sStripEven)}c=false;d=i(">tbody>tr",this);a=0;for(b=e.asStripClasses.length;a<b;a++)if(d.filter(":lt(2)").hasClass(e.asStripClasses[a])){c=true;break}if(c){e.asDestoryStrips=["",""];if(i(d[0]).hasClass(e.oClasses.sStripOdd))e.asDestoryStrips[0]+= +e.oClasses.sStripOdd+" ";if(i(d[0]).hasClass(e.oClasses.sStripEven))e.asDestoryStrips[0]+=e.oClasses.sStripEven;if(i(d[1]).hasClass(e.oClasses.sStripOdd))e.asDestoryStrips[1]+=e.oClasses.sStripOdd+" ";if(i(d[1]).hasClass(e.oClasses.sStripEven))e.asDestoryStrips[1]+=e.oClasses.sStripEven;d.removeClass(e.asStripClasses.join(" "))}c=[];var k;a=this.getElementsByTagName("thead");if(a.length!==0){W(e.aoHeader,a[0]);c=S(e)}if(typeof g.aoColumns=="undefined"){k=[];a=0;for(b=c.length;a<b;a++)k.push(null)}else k= +g.aoColumns;a=0;for(b=k.length;a<b;a++){if(typeof g.saved_aoColumns!="undefined"&&g.saved_aoColumns.length==b){if(k[a]===null)k[a]={};k[a].bVisible=g.saved_aoColumns[a].bVisible}G(e,c?c[a]:null)}if(typeof g.aoColumnDefs!="undefined")for(a=g.aoColumnDefs.length-1;a>=0;a--){var m=g.aoColumnDefs[a].aTargets;i.isArray(m)||J(e,1,"aTargets must be an array of targets, not a "+typeof m);c=0;for(d=m.length;c<d;c++)if(typeof m[c]=="number"&&m[c]>=0){for(;e.aoColumns.length<=m[c];)G(e);x(e,m[c],g.aoColumnDefs[a])}else if(typeof m[c]== +"number"&&m[c]<0)x(e,e.aoColumns.length+m[c],g.aoColumnDefs[a]);else if(typeof m[c]=="string"){b=0;for(f=e.aoColumns.length;b<f;b++)if(m[c]=="_all"||i(e.aoColumns[b].nTh).hasClass(m[c]))x(e,b,g.aoColumnDefs[a])}}if(typeof k!="undefined"){a=0;for(b=k.length;a<b;a++)x(e,a,k[a])}a=0;for(b=e.aaSorting.length;a<b;a++){if(e.aaSorting[a][0]>=e.aoColumns.length)e.aaSorting[a][0]=0;k=e.aoColumns[e.aaSorting[a][0]];if(typeof e.aaSorting[a][2]=="undefined")e.aaSorting[a][2]=0;if(typeof g.aaSorting=="undefined"&& +typeof e.saved_aaSorting=="undefined")e.aaSorting[a][1]=k.asSorting[0];c=0;for(d=k.asSorting.length;c<d;c++)if(e.aaSorting[a][1]==k.asSorting[c]){e.aaSorting[a][2]=c;break}}T(e);a=i(">thead",this);if(a.length===0){a=[p.createElement("thead")];this.appendChild(a[0])}e.nTHead=a[0];a=i(">tbody",this);if(a.length===0){a=[p.createElement("tbody")];this.appendChild(a[0])}e.nTBody=a[0];a=i(">tfoot",this);if(a.length>0){e.nTFoot=a[0];W(e.aoFooter,e.nTFoot)}if(j)for(a=0;a<g.aaData.length;a++)v(e,g.aaData[a]); +else Y(e);e.aiDisplay=e.aiDisplayMaster.slice();e.bInitialised=true;h===false&&s(e)}})}})(jQuery,window,document); diff --git a/koha-tmpl/intranet-tmpl/prog/img/datatables/back_disabled.jpg b/koha-tmpl/intranet-tmpl/prog/img/datatables/back_disabled.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1e73a546e3609636f9cf4c543c2a4fe4050866c3 GIT binary patch literal 612 zcmex=<NpH&0WUXCHwH!~28I+MWcdGvLC~c%IlGd9k%5H)B*^gp9Rr_ZN`6u*L&^c5 z2;=|T3 at r?d!~-S-V1@&zb|ywfpezu>C5UDGKfoZ!!63{a%*-grz$D1XEXer(2tyUn z+02YUSHb}sD?0}l&^EXLguy7lz`(-H!phDIlVN0HVHIR%V-ON%S2Pq6HFFG{Xryc+ zmRQ($@S#&sld*HEn>dFcBLmQ_$YwDLDjGT#PW*q1fd^<YlOVGogFVCRyQwLwf|@66 ze!$4fpt!)cj7zNLKSN?_SjIEf$Z0nVqZh4{&j?Wu4PU>^;oX+iLI)z|@;wX;U8Xr> zT8Qgxn;R!Cottl}#(8Ri${a3d=J*$R5qBRbK9bRJe*4BYwq9(uIM4mLS9%TSY?*y6 zE==owYH)vf>dq6(Uzum+IyVJqc3N&dRPD57vW(=l(=(DZ-K_<Unt1pe8#qknGCi3V zkh;vl;B4~gY1f{Kz2M5sJrOKuSm0ZhaMrL}#<_9H6t<5or9~0qKc;W}wfIQk>!LSx zwPk@>bN at 4B-OI9gCf>Wc_;CDAS%c at BJZ}k<t>BlbDz~@y-*&Y^_U+@};q`xNUthN} On^Cj9W}Eu@|2F})$f79# literal 0 HcmV?d00001 diff --git a/koha-tmpl/intranet-tmpl/prog/img/datatables/back_enabled.jpg b/koha-tmpl/intranet-tmpl/prog/img/datatables/back_enabled.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a6d764c79c7a2047b6bf65bf9d96fcafd5161e38 GIT binary patch literal 807 zcmex=<NpH&0WUXCHwH!~28I+MWcdGvLC~c%IlGd9k%5H)B*^gp9Rr_ZN`6u*L&^c5 z2;=|T3 at r?d!~-S-V1@&zb|ywfpezu>C5UDGKfoZ!!63{a%*-grz$D1XEXer(2*U&h z1}0{pBN2d|gO!bok%5r~RhW^Pm5qg+Lx6#Sm5Gs^od+h%$i&RTD#*spplB#0EW!~u z(MZ`u)XXulu<_tSr=TWdXR%Z_aiE1jZ7eM8Fl&IpCkWK1$Y$s$#2&a&N#sM~M5iWU z<^Q)Bc$gW1&SMs2uxGfw`}E06etb^r9k|jMc at Dlk(IlSD-Wwx*G{%4ThHhR%HnTsw zbu3z!=BtbC=-In5f5nt;je{+vrKZdWckk$U`c^FEYC6}Jn=<Phg&RGxWowtu+j4vL zuDrGP=1IPrb~kp*>lG)17QB>6z3khm7PHhg<-pEGSO0F>VA}N6`w53!8pr$>MbUW| zME<s?dezw;U%dR;`Kd)lCauvOXRNpVXgK`4pX=Sp- at CZj9x15&y*j<b<JPA<K_*#K z<@>sFn=(%w+^5v0yp7Lmb+~3PpI4(#G~bQ$y_;t)oo+U5`bnSHZcn){CH~m7Ys2rz z2!R at xgGrCtcPz?eOPOzKr2P26p~(mTGjR1-c<x%~cJ0>3?psA>uUGsyt|R2Ts3~!B zN71DGSrW%W*`w8#2{O$LX)%%8*<4Ycyr;tN(Hm<XHM0xJ?{xF0EskFCh5u=&<iulr zYNyl=#<wqXD&+4u8oF^$)m7<lY at VgXk9azsKIKz?vp4^)yx{evPw)J-Dth+P<;w$q z`@Q9}`(-Xi+_IiGtB&jWay`d}j~$NpR at hm5{cf*szhAZWsp!3Z`)}>8|M=_HtvR>P P+Rcr(b5Xx$|NkZcT0jT? literal 0 HcmV?d00001 diff --git a/koha-tmpl/intranet-tmpl/prog/img/datatables/forward_disabled.jpg b/koha-tmpl/intranet-tmpl/prog/img/datatables/forward_disabled.jpg new file mode 100644 index 0000000000000000000000000000000000000000..28a9dc53fa232919299ac980dc9b61167c1868bd GIT binary patch literal 635 zcmex=<NpH&0WUXCHwH!~28I+MWcdGvLC~c%IlGd9k%5H)B*^gp9Rr_ZN`6u*L&^c5 z2;=|T3 at r?d!~-S-V1@&zb|ywfpezu>C5UDGKfoZ!!63{a%*-grz$D1XEXer(2tySE z1JEp>E8&2Nm4%I+g9~UMTnNHo6kuRrVP;|B;)Y2uGBL9Vva&G<iLfgg3UfFHPBdy# zHW3vwODt at B=oDn^oa!bn$jHFNjA9g{prWDU#Q(P#c!1(eg3N*p_6)E5E7rbHvEH7V z8#+gHc2rxYci=nCmS=BPhUq>lzGLeh=CM*_u2I6%$1L~6;-1yGa|?*Fva<AVW}f$w zM|jiv%AS4aZbfpP)?S?%8?6+<6*?uQG at xF)s3 at 1Q<(tn>vCW+<XI6GdMB6yB9$3U& z#>Av>{Flt>+*?d?iZ`9)^O?_H|D3t8;Og6lD<#WHQvW(mo1ETsD>A at mr8@sqg(?1R z%d at qrmWLWmIn1#pQuo}{brVW*C8t%EDXbOt_DabwXgGW3;wDX1;~7hWrYL+ZX=qre z&-y^2q0zm?-FJb#(AWJTHOJ-3`S`D|JEhzC{KvY_h0kZinXP-?w!g_L at p#JQO^!z$ mYCgVwS7#SryXs@?>&L&t^Z(SozHVt~@Z#>58}s)6zX<@qORf(9 literal 0 HcmV?d00001 diff --git a/koha-tmpl/intranet-tmpl/prog/img/datatables/forward_enabled.jpg b/koha-tmpl/intranet-tmpl/prog/img/datatables/forward_enabled.jpg new file mode 100644 index 0000000000000000000000000000000000000000..598c075f13ab0e4bbe05a4eeea7cf777ba73cf03 GIT binary patch literal 852 zcmex=<NpH&0WUXCHwH!~28I+MWcdGvLC~c%IlGd9k%5H)B*^gp9Rr_ZN`6u*L&^c5 z2;=|T3 at r?d!~-S-V1@&zb|ywfpezu>C5UDGKfoZ!!63{a%*-grz$D1XEXer(2tywO z0~0eN(3Nn&%Fe>Z!NthH$ciG&$iU3P%Em6hz`z1zu=B#yGcqx=2(q#<2(fb*3M-3< zDh5t8G7&R#Oe}1C=oHjs?40T*F37+LbR`oj+(bq}CT0c}Rz*W0Hg?Cv#)(EB0yioN zi~PUEzyov)lOVGogFVA5dn3uE%Z<*rn&ugY^FIG9<<=87L*?mOy^~u`Rq(Eg+UDw^ z@^Uh}zJ$t~P2YpRT#sm2p`oEt8zJ-EBRfY;>b?DxZo!24Z)Q(O&}!Mbt}27`dKa(x zr)AHkZg5MjKa&4$syaupXWNXgp32dQs<o<XGr#5u9@=#E+?+!}FI~Pa)LWslJ}B36 z`Lb3YheKCCm%VOu;VpX6(0MkYSk}6t at aOKz+;_*D4{7|~^5)^QORgNty2^@M51##X zueaWLX7+9e=RH;{oZr5)jkOooU8VU}TQps%p>_rj-?|M=Q9pN^hZg^mV7=UWs>}D5 z$40(ME7Q1T4h8p}ZJ8O!G-Xk84;P~#ci!&o`A5I3kG at gLm*VlJbn%kvSqIh?3Y?HQ zAX0NL>XIkpf=MN83*!%}9-aN5)p7^py2Am>F9gW&pFSp#V0dxX#ZPW;UoD(gaI at 8E z(rNQz1DBIiM13!LtZ|85lHB@$wW~n0fhRz-$?R&m{@z;uI}N|35As;}zdXB<<FOu# z{FTp-PcAia6ML~>I#+N1k=r*G-&mI78vJ_Ezs!yIV%J}l7d*c9>7Bn;xyLT84V&`$ z at 9WMTAJ6DZyR)~=FS6P2e3MDv7lHB>{C&1H^7EJ9PIf=EdUwUYtGE9%$X9(m*ZWLf M_rC2^{;K~s0TRp{r2qf` literal 0 HcmV?d00001 diff --git a/koha-tmpl/intranet-tmpl/prog/img/datatables/sort_asc.png b/koha-tmpl/intranet-tmpl/prog/img/datatables/sort_asc.png new file mode 100644 index 0000000000000000000000000000000000000000..a56d0e21902ce620cd57f87fa58a6d3e804135cf GIT binary patch literal 263 zcmeAS at N?(olHy`uVBq!ia0vp^!XV7S3?yCqj{O5tEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i>l2Ka=y{`vF&<?H{u_y6mi^6%Qs z|I63>J9*~+_wWBdfBFCW_y37A{>@tOZ^^2EJ(K_a|Nno&o$%d2jr=7+e!)O45 at 5J; zXU0OHl&hzUV at SoVE9Xw~GAQscA1s)^?0*rXqM}DeLv7?|BU8z at Q<ntt9<njnJ|j`Y znD at ZlWoHa-oW7$XVs$3z>COGupVzP9Hek5&L+Gnl%BD>~0~tJB{an^LB{Ts5b0m7= literal 0 HcmV?d00001 diff --git a/koha-tmpl/intranet-tmpl/prog/img/datatables/sort_asc_disabled.png b/koha-tmpl/intranet-tmpl/prog/img/datatables/sort_asc_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..b7e621ef1c68da839ce077cec6e201a55c1ba168 GIT binary patch literal 252 zcmeAS at N?(olHy`uVBq!ia0vp^!XV7S3?yCqj{O5tEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i=)2l#}z{`>du$&)AV- at pIy<HzUE zpI^Ot_51hlzkmNec<|ufy?c)zKfZJ4&j0`aCog>d9;k)4B*-rq$b|z2+ZRf0KnW*L z7srr_TUXBQ7Ge<Kak=PnB>V6G?@}f$7k6Jhw{qGm$-QDzD`qrDaZ3s$b2XF;fBBPU nqjNDy&Nw~puHFA+-v&m8`?>-yUFVHK{$ucT^>bP0l+XkKhw^g= literal 0 HcmV?d00001 diff --git a/koha-tmpl/intranet-tmpl/prog/img/datatables/sort_both.png b/koha-tmpl/intranet-tmpl/prog/img/datatables/sort_both.png new file mode 100644 index 0000000000000000000000000000000000000000..839ac4bb5b0b414834c950de9deafff6dd94ed2d GIT binary patch literal 282 zcmeAS at N?(olHy`uVBq!ia0vp^!XV7S3?yCqj{O5tEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i=)2l#}z{`>du$&)AV- at pIy<HzUE zpI^Ot_51hlzkmNec<|ufy?c)zKfZJ4&j0`aCog>d9;k)4B*-rq$b|z2+ZRf0K#2rT z7srr_TRjsz`4|*ASOSl%eg6Ob+(JtRwX|O at S}a^IES<M^Rar)~R7{gT(8t-3AepQp zDW<l1NyH(qlCXQ0 at AfT`xZ2rtb0gcPuhQK|E$f?fe^;k=XM|b({WbrT_5p at zx%{&^ T>QC<i+Qs1M>gTe~DWM4fR9b+X literal 0 HcmV?d00001 diff --git a/koha-tmpl/intranet-tmpl/prog/img/datatables/sort_desc.png b/koha-tmpl/intranet-tmpl/prog/img/datatables/sort_desc.png new file mode 100644 index 0000000000000000000000000000000000000000..90b295159df995329b3a84340d32761f3d1dbade GIT binary patch literal 260 zcmeAS at N?(olHy`uVBq!ia0vp^!XV7S3?yCqj{O5tEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i>l2Ka=y{`vF&<?H{u_y6mi^6%Qs z|I63>J9*~+_wWBdfBFCW_y37A{>@tOZ^^2EJ(K_a|Nno&o$%d2jr=7+e!)O45 at 5J; zXU0OHl#{26V at SoVqz8vtc$~v}dc~O{CLEF2anNavMpdMP)0v(X&o(k0opIq!LdvtJ wj~up7 at 0`wiSoe($&y07EkGxK6U|?nlJSz0{?wJWUfu=Edy85}Sb4q9e0C9MGu>b%7 literal 0 HcmV?d00001 diff --git a/koha-tmpl/intranet-tmpl/prog/img/datatables/sort_desc_disabled.png b/koha-tmpl/intranet-tmpl/prog/img/datatables/sort_desc_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..2409653dc94cd21a281a31c0e3819323b84704b7 GIT binary patch literal 251 zcmeAS at N?(olHy`uVBq!ia0vp^!XV7S3?yCqj{O5tEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i=)2l#}z{`>du$&)AV- at pIy<HzUE zpI^Ot_51hlzkmNec<|ufy?c)zKfZJ4&j0`aCog>d9;k)4B*-rq$b|z2+ZRf0KnX`r z7srr_TS*TNvhX;E^>j)zMNBv%VR68zN24n8K+>5N&kUJbBQCy4c=qgBiu3mAQ)hD? n)_oJhGvi(If!Apb49pB3GXz|UGFKJ=4P)?h^>bP0l+XkK*57ji literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/en/css/datatables.css b/koha-tmpl/opac-tmpl/prog/en/css/datatables.css new file mode 100644 index 0000000..e069b93 --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/css/datatables.css @@ -0,0 +1,114 @@ +input.search_init { + color: #999999; +} +.sorting_asc { + padding-right: 19px; + background: url("../../img/datatables/sort_asc.png") no-repeat scroll right center #EEEEEE; +} +.sorting_desc { + padding-right: 19px; + background: url("../../img/datatables/sort_desc.png") no-repeat scroll right center #EEEEEE; +} +.sorting { + padding-right: 19px; + background: url("../../img/datatables/sort_both.png") no-repeat scroll right center #EEEEEE; +} +.sorting_asc_disabled { + padding-right: 19px; + background: url("../../img/datatables/sort_asc_disabled.png") no-repeat scroll right center #EEEEEE; +} +.sorting_desc_disabled { + padding-right: 19px; + background: url("../../img/datatables/sort_desc_disabled.png") no-repeat scroll right center #EEEEEE; +} +.sorting_disabled { + padding-right: 19px; + background-color: #EEEEEE; +} + +table.display { + width: 100%; +} +table.display thead th { + border-bottom: 1px solid black; + cursor: pointer; + font-weight: bold; + padding: 3px 18px 3px 10px; +} +.dataTables_wrapper { + clear: both; + position: relative; +} +.dataTables_processing { + background-color: white; + border: 1px solid #DDDDDD; + color: #999999; + font-size: 14px; + height: 30px; + left: 50%; + margin-left: -125px; + margin-top: -15px; + padding: 14px 0 2px; + position: fixed; + text-align: center; + top: 50%; + width: 250px; +} +.dataTables_info { + float: left; + width: 60%; +} +.dataTables_paginate { + float: right; + text-align: right; + width: 44px; +} +.paging_full_numbers { + height: 22px; + line-height: 22px; + width: 400px; +} +.paging_full_numbers span.paginate_button, + .paging_full_numbers span.paginate_active { + border: 1px solid #aaa; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + padding: 2px 5px; + margin: 0 3px; + cursor: pointer; + *cursor: hand; +} + +.paging_full_numbers span.paginate_button { + background-color: #ddd; +} + +.paging_full_numbers span.paginate_button:hover { + background-color: #ccc; +} + +.paging_full_numbers span.paginate_active { + background-color: #99B3FF; +} +.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next { + float: left; + height: 19px; + margin-left: 3px; + width: 19px; +} +.paginate_disabled_previous { + background-image: url("../../img/datatables/back_disabled.jpg"); +} +.paginate_enabled_previous { + background-image: url("../../img/datatables/back_enabled.jpg"); +} +.paginate_disabled_next { + background-image: url("../../img/datatables/forward_disabled.jpg"); +} +.paginate_enabled_next { + background-image: url("../../img/datatables/forward_enabled.jpg"); +} +.spacer { + clear: both; + height: 20px; +} diff --git a/koha-tmpl/opac-tmpl/prog/en/js/datatables.js b/koha-tmpl/opac-tmpl/prog/en/js/datatables.js new file mode 100644 index 0000000..cfd5d05 --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/js/datatables.js @@ -0,0 +1,281 @@ +// These default options are for translation but can be used +// for any other datatables settings +// To use it, write: +// $("#table_id").dataTable($.extend(true, {}, dataTableDefaults, { +// // other settings +// } ) ); +var dataTableDefaults = { + "oLanguage": { + "oPaginate": { + "sFirst" : _("First"), + "sLast" : _("Last"), + "sNext" : _("Next"), + "sPrevious" : _("Previous") + }, + "sEmptyTable" : _("No data available in table"), + "sInfo" : _("Showing _START_ to _END_ of _TOTAL_ entries"), + "sInfoEmpty" : _("No entries to show"), + "sInfoFiltered" : _("(filtered from _MAX_ total entries"), + "sLengthMenu" : _("Show _MENU_ entries"), + "sLoadingRecords" : _("Loading..."), + "sProcessing" : _("Processing..."), + "sSearch" : _("Search:"), + "sZeroRecords" : _("No matching records found") + } +}; + + +// Return an array of string containing the values of a particular column +$.fn.dataTableExt.oApi.fnGetColumnData = function ( oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty ) { + // check that we have a column id + if ( typeof iColumn == "undefined" ) return new Array(); + // by default we only wany unique data + if ( typeof bUnique == "undefined" ) bUnique = true; + // by default we do want to only look at filtered data + if ( typeof bFiltered == "undefined" ) bFiltered = true; + // by default we do not wany to include empty values + if ( typeof bIgnoreEmpty == "undefined" ) bIgnoreEmpty = true; + // list of rows which we're going to loop through + var aiRows; + // use only filtered rows + if (bFiltered == true) aiRows = oSettings.aiDisplay; + // use all rows + else aiRows = oSettings.aiDisplayMaster; // all row numbers + + // set up data array + var asResultData = new Array(); + for (var i=0,c=aiRows.length; i<c; i++) { + iRow = aiRows[i]; + var aData = this.fnGetData(iRow); + var sValue = aData[iColumn]; + // ignore empty values? + if (bIgnoreEmpty == true && sValue.length == 0) continue; + // ignore unique values? + else if (bUnique == true && jQuery.inArray(sValue, asResultData) > -1) continue; + // else push the value onto the result data array + else asResultData.push(sValue); + } + return asResultData; +} + +// List of unbind keys (Ctrl, Alt, Direction keys, etc.) +// These keys must not launch filtering +var blacklist_keys = new Array(0, 16, 17, 18, 37, 38, 39, 40); + +// Set a filtering delay for global search field +jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) { + /* + * Inputs: object:oSettings - dataTables settings object - automatically given + * integer:iDelay - delay in milliseconds + * Usage: $('#example').dataTable().fnSetFilteringDelay(250); + * Author: Zygimantas Berziunas (www.zygimantas.com) and Allan Jardine + * License: GPL v2 or BSD 3 point style + * Contact: zygimantas.berziunas /AT\ hotmail.com + */ + var + _that = this, + iDelay = (typeof iDelay == 'undefined') ? 250 : iDelay; + + this.each( function ( i ) { + $.fn.dataTableExt.iApiIndex = i; + var + $this = this, + oTimerId = null, + sPreviousSearch = null, + anControl = $( 'input', _that.fnSettings().aanFeatures.f ); + + anControl.unbind( 'keyup.DT' ).bind( 'keyup.DT', function(event) { + var $$this = $this; + if (blacklist_keys.indexOf(event.keyCode) != -1) { + return this; + }else if ( event.keyCode == '13' ) { + $.fn.dataTableExt.iApiIndex = i; + _that.fnFilter( $(this).val() ); + } else { + if (sPreviousSearch === null || sPreviousSearch != anControl.val()) { + window.clearTimeout(oTimerId); + sPreviousSearch = anControl.val(); + oTimerId = window.setTimeout(function() { + $.fn.dataTableExt.iApiIndex = i; + _that.fnFilter( anControl.val() ); + }, iDelay); + } + } + }); + + return this; + } ); + return this; +} + +// Add a filtering delay on general search and on all input (with a class 'filter') +jQuery.fn.dataTableExt.oApi.fnAddFilteringDelay = function ( oSettings, iDelay ) { + var table = this; + this.fnSetFilteringDelay(iDelay); + var filterTimerId = null; + $("input.filter").keyup(function(event) { + var $this = this; + if (blacklist_keys.indexOf(event.keyCode) != -1) { + return this; + }else if ( event.keyCode == '13' ) { + $.fn.dataTableExt.iApiIndex = i; + _that.fnFilter( $(this).val() ); + } else { + window.clearTimeout(filterTimerId); + filterTimerId = window.setTimeout(function() { + table.fnFilter($($this).val(), $($this).attr('data-column_num')); + }, iDelay); + } + }); +} + +// Useful if you want to filter on dates with 2 inputs (start date and end date) +// You have to include calendar.inc to use it +function dt_add_rangedate_filter(begindate_id, enddate_id, dateCol) { + $.fn.dataTableExt.afnFiltering.push( + function( oSettings, aData, iDataIndex ) { + + var beginDate = Date_from_syspref($("#"+begindate_id).val()).getTime(); + var endDate = Date_from_syspref($("#"+enddate_id).val()).getTime(); + + var data = Date_from_syspref(aData[dateCol]).getTime(); + + if ( !parseInt(beginDate) && ! parseInt(endDate) ) { + return true; + } + else if ( beginDate <= data && !parseInt(endDate) ) { + return true; + } + else if ( data <= endDate && !parseInt(beginDate) ) { + return true; + } + else if ( beginDate <= data && data <= endDate) { + return true; + } + return false; + } + ); +} + +//Sorting for dates (uk format) +function dt_add_type_uk_date() { + jQuery.fn.dataTableExt.aTypes.unshift( + function ( sData ) + { + if (sData.match(/(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[012])\/(19|20|21)\d\d/)) + { + return 'uk_date'; + } + return null; + } + ); + + jQuery.fn.dataTableExt.oSort['uk_date-asc'] = function(a,b) { + var re = /(\d{2}\/\d{2}\/\d{4})/; + a.match(re); + var ukDatea = RegExp.$1.split("/"); + b.match(re); + var ukDateb = RegExp.$1.split("/"); + + var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1; + var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1; + + return ((x < y) ? -1 : ((x > y) ? 1 : 0)); + }; + + jQuery.fn.dataTableExt.oSort['uk_date-desc'] = function(a,b) { + var re = /(\d{2}\/\d{2}\/\d{4})/; + a.match(re); + var ukDatea = RegExp.$1.split("/"); + b.match(re); + var ukDateb = RegExp.$1.split("/"); + + var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1; + var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1; + + return ((x < y) ? 1 : ((x > y) ? -1 : 0)); + }; +} + +// Sorting on html contains +// <a href="foo.pl">bar</a> sort on 'bar' +function dt_overwrite_html_sorting_localeCompare() { + jQuery.fn.dataTableExt.oSort['html-asc'] = function(a,b) { + a = a.replace(/<.*?>/g, "").replace(/\s+/g, " "); + b = b.replace(/<.*?>/g, "").replace(/\s+/g, " "); + if (typeof(a.localeCompare == "function")) { + return a.localeCompare(b); + } else { + return (a > b) ? 1 : ((a < b) ? -1 : 0); + } + }; + + jQuery.fn.dataTableExt.oSort['html-desc'] = function(a,b) { + a = a.replace(/<.*?>/g, "").replace(/\s+/g, " "); + b = b.replace(/<.*?>/g, "").replace(/\s+/g, " "); + if(typeof(b.localeCompare == "function")) { + return b.localeCompare(a); + } else { + return (b > a) ? 1 : ((b < a) ? -1 : 0); + } + }; +} + +// Sorting on string without accentued characters +function dt_overwrite_string_sorting_localeCompare() { + jQuery.fn.dataTableExt.oSort['string-asc'] = function(a,b) { + a = a.replace(/<.*?>/g, "").replace(/\s+/g, " "); + b = b.replace(/<.*?>/g, "").replace(/\s+/g, " "); + if (typeof(a.localeCompare == "function")) { + return a.localeCompare(b); + } else { + return (a > b) ? 1 : ((a < b) ? -1 : 0); + } + }; + + jQuery.fn.dataTableExt.oSort['string-desc'] = function(a,b) { + a = a.replace(/<.*?>/g, "").replace(/\s+/g, " "); + b = b.replace(/<.*?>/g, "").replace(/\s+/g, " "); + if(typeof(b.localeCompare == "function")) { + return b.localeCompare(a); + } else { + return (b > a) ? 1 : ((b < a) ? -1 : 0); + } + }; +} + +// Replace a node with a html and js contain. +function replace_html( original_node, type ) { + switch ( $(original_node).attr('data-type') ) { + case "range_dates": + var id = $(original_node).attr("data-id"); + var format = $(original_node).attr("data-format"); + replace_html_date( original_node, id, format ); + break; + default: + alert("_(This node can't be replaced)"); + } +} + +// Replace a node with a "From [date] To [date]" element +// Used on tfoot > td +function replace_html_date( original_node, id, format ) { + var node = $('<span style="white-space:nowrap">' + _("From") + '<input type="text" id="' + id + 'from" readonly="readonly" placeholder=\'' + _("Pick date") + '\' size="7" /><a title="Delete this filter" style="cursor:pointer" onclick=\'$("#' + id + 'from").val("").change();\' >×</a></span><br/><span style="white-space:nowrap">' + _("To") + '<input type="text" id="' + id + 'to" readonly="readonly" placeholder=\'' + _("Pick date") + '\' size="7" /><a title="Delete this filter" style="cursor:pointer" onclick=\'$("#' + id + 'to").val("").change();\' >×</a></span>'); + $(original_node).replaceWith(node); + var script = document.createElement( 'script' ); + script.type = 'text/javascript'; + var script_content = "Calendar.setup({"; + script_content += " inputField: \"" + id + "from\","; + script_content += " ifFormat: \"" + format + "\","; + script_content += " button: \"" + id + "from\","; + script_content += " onClose: function(){ $(\"#" + id + "from\").change(); this.hide();}"; + script_content += " });"; + script_content += " Calendar.setup({"; + script_content += " inputField: \"" + id + "to\","; + script_content += " ifFormat: \"" + format + "\","; + script_content += " button: \"" + id + "to\","; + script_content += " onClose: function(){ $(\"#" + id + "to\").change(); this.hide();}"; + script_content += " });"; + script.text = script_content; + $(original_node).append( script ); +} diff --git a/koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js b/koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js new file mode 100644 index 0000000..9035a2e --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js @@ -0,0 +1,153 @@ +/* + * File: jquery.dataTables.min.js + * Version: 1.8.1 + * Author: Allan Jardine (www.sprymedia.co.uk) + * Info: www.datatables.net + * + * Copyright 2008-2010 Allan Jardine, all rights reserved. + * + * This source file is free software, under either the GPL v2 license or a + * BSD style license, available at: + * http://datatables.net/license_gpl2 + * http://datatables.net/license_bsd + * + * This source file 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 license files for details. + */ +(function(i,wa,p){i.fn.dataTableSettings=[];var D=i.fn.dataTableSettings;i.fn.dataTableExt={};var o=i.fn.dataTableExt;o.sVersion="1.8.1";o.sErrMode="alert";o.iApiIndex=0;o.oApi={};o.afnFiltering=[];o.aoFeatures=[];o.ofnSearch={};o.afnSortData=[];o.oStdClasses={sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active", +sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled", +sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:""};o.oJUIClasses={sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left", +sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled", +sPageFirst:"first ui-corner-tl ui-corner-bl",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last ui-corner-tr ui-corner-br",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default", +sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortColumn:"sorting_",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollWrapper:"dataTables_scroll", +sScrollHead:"dataTables_scrollHead ui-state-default",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot ui-state-default",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"ui-state-default"};o.oPagination={two_button:{fnInit:function(g,l,r){var s,w,y;if(g.bJUI){s=p.createElement("a");w=p.createElement("a");y=p.createElement("span");y.className=g.oClasses.sPageJUINext;w.appendChild(y);y=p.createElement("span");y.className=g.oClasses.sPageJUIPrev; +s.appendChild(y)}else{s=p.createElement("div");w=p.createElement("div")}s.className=g.oClasses.sPagePrevDisabled;w.className=g.oClasses.sPageNextDisabled;s.title=g.oLanguage.oPaginate.sPrevious;w.title=g.oLanguage.oPaginate.sNext;l.appendChild(s);l.appendChild(w);i(s).bind("click.DT",function(){g.oApi._fnPageChange(g,"previous")&&r(g)});i(w).bind("click.DT",function(){g.oApi._fnPageChange(g,"next")&&r(g)});i(s).bind("selectstart.DT",function(){return false});i(w).bind("selectstart.DT",function(){return false}); +if(g.sTableId!==""&&typeof g.aanFeatures.p=="undefined"){l.setAttribute("id",g.sTableId+"_paginate");s.setAttribute("id",g.sTableId+"_previous");w.setAttribute("id",g.sTableId+"_next")}},fnUpdate:function(g){if(g.aanFeatures.p)for(var l=g.aanFeatures.p,r=0,s=l.length;r<s;r++)if(l[r].childNodes.length!==0){l[r].childNodes[0].className=g._iDisplayStart===0?g.oClasses.sPagePrevDisabled:g.oClasses.sPagePrevEnabled;l[r].childNodes[1].className=g.fnDisplayEnd()==g.fnRecordsDisplay()?g.oClasses.sPageNextDisabled: +g.oClasses.sPageNextEnabled}}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(g,l,r){var s=p.createElement("span"),w=p.createElement("span"),y=p.createElement("span"),G=p.createElement("span"),x=p.createElement("span");s.innerHTML=g.oLanguage.oPaginate.sFirst;w.innerHTML=g.oLanguage.oPaginate.sPrevious;G.innerHTML=g.oLanguage.oPaginate.sNext;x.innerHTML=g.oLanguage.oPaginate.sLast;var v=g.oClasses;s.className=v.sPageButton+" "+v.sPageFirst;w.className=v.sPageButton+" "+v.sPagePrevious;G.className= +v.sPageButton+" "+v.sPageNext;x.className=v.sPageButton+" "+v.sPageLast;l.appendChild(s);l.appendChild(w);l.appendChild(y);l.appendChild(G);l.appendChild(x);i(s).bind("click.DT",function(){g.oApi._fnPageChange(g,"first")&&r(g)});i(w).bind("click.DT",function(){g.oApi._fnPageChange(g,"previous")&&r(g)});i(G).bind("click.DT",function(){g.oApi._fnPageChange(g,"next")&&r(g)});i(x).bind("click.DT",function(){g.oApi._fnPageChange(g,"last")&&r(g)});i("span",l).bind("mousedown.DT",function(){return false}).bind("selectstart.DT", +function(){return false});if(g.sTableId!==""&&typeof g.aanFeatures.p=="undefined"){l.setAttribute("id",g.sTableId+"_paginate");s.setAttribute("id",g.sTableId+"_first");w.setAttribute("id",g.sTableId+"_previous");G.setAttribute("id",g.sTableId+"_next");x.setAttribute("id",g.sTableId+"_last")}},fnUpdate:function(g,l){if(g.aanFeatures.p){var r=o.oPagination.iFullNumbersShowPages,s=Math.floor(r/2),w=Math.ceil(g.fnRecordsDisplay()/g._iDisplayLength),y=Math.ceil(g._iDisplayStart/g._iDisplayLength)+1,G= +"",x,v=g.oClasses;if(w<r){s=1;x=w}else if(y<=s){s=1;x=r}else if(y>=w-s){s=w-r+1;x=w}else{s=y-Math.ceil(r/2)+1;x=s+r-1}for(r=s;r<=x;r++)G+=y!=r?'<span class="'+v.sPageButton+'">'+r+"</span>":'<span class="'+v.sPageButtonActive+'">'+r+"</span>";x=g.aanFeatures.p;var z,Y=function(L){g._iDisplayStart=(this.innerHTML*1-1)*g._iDisplayLength;l(g);L.preventDefault()},V=function(){return false};r=0;for(s=x.length;r<s;r++)if(x[r].childNodes.length!==0){z=i("span:eq(2)",x[r]);z.html(G);i("span",z).bind("click.DT", +Y).bind("mousedown.DT",V).bind("selectstart.DT",V);z=x[r].getElementsByTagName("span");z=[z[0],z[1],z[z.length-2],z[z.length-1]];i(z).removeClass(v.sPageButton+" "+v.sPageButtonActive+" "+v.sPageButtonStaticDisabled);if(y==1){z[0].className+=" "+v.sPageButtonStaticDisabled;z[1].className+=" "+v.sPageButtonStaticDisabled}else{z[0].className+=" "+v.sPageButton;z[1].className+=" "+v.sPageButton}if(w===0||y==w||g._iDisplayLength==-1){z[2].className+=" "+v.sPageButtonStaticDisabled;z[3].className+=" "+ +v.sPageButtonStaticDisabled}else{z[2].className+=" "+v.sPageButton;z[3].className+=" "+v.sPageButton}}}}}};o.oSort={"string-asc":function(g,l){if(typeof g!="string")g="";if(typeof l!="string")l="";g=g.toLowerCase();l=l.toLowerCase();return g<l?-1:g>l?1:0},"string-desc":function(g,l){if(typeof g!="string")g="";if(typeof l!="string")l="";g=g.toLowerCase();l=l.toLowerCase();return g<l?1:g>l?-1:0},"html-asc":function(g,l){g=g.replace(/<.*?>/g,"").toLowerCase();l=l.replace(/<.*?>/g,"").toLowerCase();return g< +l?-1:g>l?1:0},"html-desc":function(g,l){g=g.replace(/<.*?>/g,"").toLowerCase();l=l.replace(/<.*?>/g,"").toLowerCase();return g<l?1:g>l?-1:0},"date-asc":function(g,l){g=Date.parse(g);l=Date.parse(l);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(l)||l==="")l=Date.parse("01/01/1970 00:00:00");return g-l},"date-desc":function(g,l){g=Date.parse(g);l=Date.parse(l);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(l)||l==="")l=Date.parse("01/01/1970 00:00:00");return l- +g},"numeric-asc":function(g,l){return(g=="-"||g===""?0:g*1)-(l=="-"||l===""?0:l*1)},"numeric-desc":function(g,l){return(l=="-"||l===""?0:l*1)-(g=="-"||g===""?0:g*1)}};o.aTypes=[function(g){if(typeof g=="number")return"numeric";else if(typeof g!="string")return null;var l,r=false;l=g.charAt(0);if("0123456789-".indexOf(l)==-1)return null;for(var s=1;s<g.length;s++){l=g.charAt(s);if("0123456789.".indexOf(l)==-1)return null;if(l=="."){if(r)return null;r=true}}return"numeric"},function(g){var l=Date.parse(g); +if(l!==null&&!isNaN(l)||typeof g=="string"&&g.length===0)return"date";return null},function(g){if(typeof g=="string"&&g.indexOf("<")!=-1&&g.indexOf(">")!=-1)return"html";return null}];o.fnVersionCheck=function(g){var l=function(x,v){for(;x.length<v;)x+="0";return x},r=o.sVersion.split(".");g=g.split(".");for(var s="",w="",y=0,G=g.length;y<G;y++){s+=l(r[y],3);w+=l(g[y],3)}return parseInt(s,10)>=parseInt(w,10)};o._oExternConfig={iNextUnique:0};i.fn.dataTable=function(g){function l(){this.fnRecordsTotal= +function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length};this.fnRecordsDisplay=function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length};this.fnDisplayEnd=function(){return this.oFeatures.bServerSide?this.oFeatures.bPaginate===false||this._iDisplayLength==-1?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd};this.sInstance= +this.oInstance=null;this.oFeatures={bPaginate:true,bLengthChange:true,bFilter:true,bSort:true,bInfo:true,bAutoWidth:true,bProcessing:false,bSortClasses:true,bStateSave:false,bServerSide:false,bDeferRender:false};this.oScroll={sX:"",sXInner:"",sY:"",bCollapse:false,bInfinite:false,iLoadGap:100,iBarWidth:0,bAutoCss:true};this.aanFeatures=[];this.oLanguage={sProcessing:"Processing...",sLengthMenu:"Show _MENU_ entries",sZeroRecords:"No matching records found",sEmptyTable:"No data available in table", +sLoadingRecords:"Loading...",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sSearch:"Search:",sUrl:"",oPaginate:{sFirst:"First",sPrevious:"Previous",sNext:"Next",sLast:"Last"},fnInfoCallback:null};this.aoData=[];this.aiDisplay=[];this.aiDisplayMaster=[];this.aoColumns=[];this.aoHeader=[];this.aoFooter=[];this.iNextId=0;this.asDataSearch=[];this.oPreviousSearch={sSearch:"",bRegex:false, +bSmart:true};this.aoPreSearchCols=[];this.aaSorting=[[0,"asc",0]];this.aaSortingFixed=null;this.asStripClasses=[];this.asDestoryStrips=[];this.sDestroyWidth=0;this.fnFooterCallback=this.fnHeaderCallback=this.fnRowCallback=null;this.aoDrawCallback=[];this.fnInitComplete=this.fnPreDrawCallback=null;this.sTableId="";this.nTableWrapper=this.nTBody=this.nTFoot=this.nTHead=this.nTable=null;this.bInitialised=this.bDeferLoading=false;this.aoOpenRows=[];this.sDom="lfrtip";this.sPaginationType="two_button"; +this.iCookieDuration=7200;this.sCookiePrefix="SpryMedia_DataTables_";this.fnCookieCallback=null;this.aoStateSave=[];this.aoStateLoad=[];this.sAjaxSource=this.oLoadedState=null;this.sAjaxDataProp="aaData";this.bAjaxDataGet=true;this.jqXHR=null;this.fnServerData=function(a,b,c,d){d.jqXHR=i.ajax({url:a,data:b,success:c,dataType:"json",cache:false,error:function(f,e){e=="parsererror"&&alert("DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})}; +this.fnFormatNumber=function(a){if(a<1E3)return a;else{var b=a+"";a=b.split("");var c="";b=b.length;for(var d=0;d<b;d++){if(d%3===0&&d!==0)c=","+c;c=a[b-d-1]+c}}return c};this.aLengthMenu=[10,25,50,100];this.bDrawing=this.iDraw=0;this.iDrawError=-1;this._iDisplayLength=10;this._iDisplayStart=0;this._iDisplayEnd=10;this._iRecordsDisplay=this._iRecordsTotal=0;this.bJUI=false;this.oClasses=o.oStdClasses;this.bSortCellsTop=this.bSorted=this.bFiltered=false;this.oInit=null}function r(a){return function(){var b= +[A(this[o.iApiIndex])].concat(Array.prototype.slice.call(arguments));return o.oApi[a].apply(this,b)}}function s(a){var b,c,d=a.iInitDisplayStart;if(a.bInitialised===false)setTimeout(function(){s(a)},200);else{xa(a);V(a);L(a,a.aoHeader);a.nTFoot&&L(a,a.aoFooter);K(a,true);a.oFeatures.bAutoWidth&&ea(a);b=0;for(c=a.aoColumns.length;b<c;b++)if(a.aoColumns[b].sWidth!==null)a.aoColumns[b].nTh.style.width=u(a.aoColumns[b].sWidth);if(a.oFeatures.bSort)R(a);else if(a.oFeatures.bFilter)M(a,a.oPreviousSearch); +else{a.aiDisplay=a.aiDisplayMaster.slice();E(a);C(a)}if(a.sAjaxSource!==null&&!a.oFeatures.bServerSide)a.fnServerData.call(a.oInstance,a.sAjaxSource,[],function(f){var e=f;if(a.sAjaxDataProp!=="")e=Z(a.sAjaxDataProp)(f);for(b=0;b<e.length;b++)v(a,e[b]);a.iInitDisplayStart=d;if(a.oFeatures.bSort)R(a);else{a.aiDisplay=a.aiDisplayMaster.slice();E(a);C(a)}K(a,false);w(a,f)},a);else if(!a.oFeatures.bServerSide){K(a,false);w(a)}}}function w(a,b){a._bInitComplete=true;if(typeof a.fnInitComplete=="function")typeof b!= +"undefined"?a.fnInitComplete.call(a.oInstance,a,b):a.fnInitComplete.call(a.oInstance,a)}function y(a,b,c){n(a.oLanguage,b,"sProcessing");n(a.oLanguage,b,"sLengthMenu");n(a.oLanguage,b,"sEmptyTable");n(a.oLanguage,b,"sLoadingRecords");n(a.oLanguage,b,"sZeroRecords");n(a.oLanguage,b,"sInfo");n(a.oLanguage,b,"sInfoEmpty");n(a.oLanguage,b,"sInfoFiltered");n(a.oLanguage,b,"sInfoPostFix");n(a.oLanguage,b,"sSearch");if(typeof b.oPaginate!="undefined"){n(a.oLanguage.oPaginate,b.oPaginate,"sFirst");n(a.oLanguage.oPaginate, +b.oPaginate,"sPrevious");n(a.oLanguage.oPaginate,b.oPaginate,"sNext");n(a.oLanguage.oPaginate,b.oPaginate,"sLast")}typeof b.sEmptyTable=="undefined"&&typeof b.sZeroRecords!="undefined"&&n(a.oLanguage,b,"sZeroRecords","sEmptyTable");typeof b.sLoadingRecords=="undefined"&&typeof b.sZeroRecords!="undefined"&&n(a.oLanguage,b,"sZeroRecords","sLoadingRecords");c&&s(a)}function G(a,b){var c=a.aoColumns.length;b={sType:null,_bAutoType:true,bVisible:true,bSearchable:true,bSortable:true,asSorting:["asc","desc"], +sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,sTitle:b?b.innerHTML:"",sName:"",sWidth:null,sWidthOrig:null,sClass:null,fnRender:null,bUseRendered:true,iDataSort:c,mDataProp:c,fnGetData:null,fnSetData:null,sSortDataType:"std",sDefaultContent:null,sContentPadding:"",nTh:b?b:p.createElement("th"),nTf:null};a.aoColumns.push(b);if(typeof a.aoPreSearchCols[c]=="undefined"||a.aoPreSearchCols[c]===null)a.aoPreSearchCols[c]={sSearch:"",bRegex:false,bSmart:true};else{if(typeof a.aoPreSearchCols[c].bRegex== +"undefined")a.aoPreSearchCols[c].bRegex=true;if(typeof a.aoPreSearchCols[c].bSmart=="undefined")a.aoPreSearchCols[c].bSmart=true}x(a,c,null)}function x(a,b,c){b=a.aoColumns[b];if(typeof c!="undefined"&&c!==null){if(typeof c.sType!="undefined"){b.sType=c.sType;b._bAutoType=false}n(b,c,"bVisible");n(b,c,"bSearchable");n(b,c,"bSortable");n(b,c,"sTitle");n(b,c,"sName");n(b,c,"sWidth");n(b,c,"sWidth","sWidthOrig");n(b,c,"sClass");n(b,c,"fnRender");n(b,c,"bUseRendered");n(b,c,"iDataSort");n(b,c,"mDataProp"); +n(b,c,"asSorting");n(b,c,"sSortDataType");n(b,c,"sDefaultContent");n(b,c,"sContentPadding")}b.fnGetData=Z(b.mDataProp);b.fnSetData=ya(b.mDataProp);if(!a.oFeatures.bSort)b.bSortable=false;if(!b.bSortable||i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortableNone;b.sSortingClassJUI=""}else if(b.bSortable||i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortable;b.sSortingClassJUI=a.oClasses.sSortJUI}else if(i.inArray("asc", +b.asSorting)!=-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortableAsc;b.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed}else if(i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)!=-1){b.sSortingClass=a.oClasses.sSortableDesc;b.sSortingClassJUI=a.oClasses.sSortJUIDescAllowed}}function v(a,b){var c;c=typeof b.length=="number"?b.slice():i.extend(true,{},b);b=a.aoData.length;var d={nTr:null,_iId:a.iNextId++,_aData:c,_anHidden:[],_sRowStripe:""};a.aoData.push(d);for(var f, +e=0,h=a.aoColumns.length;e<h;e++){c=a.aoColumns[e];typeof c.fnRender=="function"&&c.bUseRendered&&c.mDataProp!==null&&N(a,b,e,c.fnRender({iDataRow:b,iDataColumn:e,aData:d._aData,oSettings:a}));if(c._bAutoType&&c.sType!="string"){f=H(a,b,e,"type");if(f!==null&&f!==""){f=fa(f);if(c.sType===null)c.sType=f;else if(c.sType!=f)c.sType="string"}}}a.aiDisplayMaster.push(b);a.oFeatures.bDeferRender||z(a,b);return b}function z(a,b){var c=a.aoData[b],d;if(c.nTr===null){c.nTr=p.createElement("tr");typeof c._aData.DT_RowId!= +"undefined"&&c.nTr.setAttribute("id",c._aData.DT_RowId);typeof c._aData.DT_RowClass!="undefined"&&i(c.nTr).addClass(c._aData.DT_RowClass);for(var f=0,e=a.aoColumns.length;f<e;f++){var h=a.aoColumns[f];d=p.createElement("td");d.innerHTML=typeof h.fnRender=="function"&&(!h.bUseRendered||h.mDataProp===null)?h.fnRender({iDataRow:b,iDataColumn:f,aData:c._aData,oSettings:a}):H(a,b,f,"display");if(h.sClass!==null)d.className=h.sClass;if(h.bVisible){c.nTr.appendChild(d);c._anHidden[f]=null}else c._anHidden[f]= +d}}}function Y(a){var b,c,d,f,e,h,j,k,m;if(a.bDeferLoading||a.sAjaxSource===null){j=a.nTBody.childNodes;b=0;for(c=j.length;b<c;b++)if(j[b].nodeName.toUpperCase()=="TR"){k=a.aoData.length;a.aoData.push({nTr:j[b],_iId:a.iNextId++,_aData:[],_anHidden:[],_sRowStripe:""});a.aiDisplayMaster.push(k);h=j[b].childNodes;d=e=0;for(f=h.length;d<f;d++){m=h[d].nodeName.toUpperCase();if(m=="TD"||m=="TH"){N(a,k,e,i.trim(h[d].innerHTML));e++}}}}j=$(a);h=[];b=0;for(c=j.length;b<c;b++){d=0;for(f=j[b].childNodes.length;d< +f;d++){e=j[b].childNodes[d];m=e.nodeName.toUpperCase();if(m=="TD"||m=="TH")h.push(e)}}h.length!=j.length*a.aoColumns.length&&J(a,1,"Unexpected number of TD elements. Expected "+j.length*a.aoColumns.length+" and got "+h.length+". DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.");d=0;for(f=a.aoColumns.length;d<f;d++){if(a.aoColumns[d].sTitle===null)a.aoColumns[d].sTitle=a.aoColumns[d].nTh.innerHTML;j=a.aoColumns[d]._bAutoType; +m=typeof a.aoColumns[d].fnRender=="function";e=a.aoColumns[d].sClass!==null;k=a.aoColumns[d].bVisible;var t,q;if(j||m||e||!k){b=0;for(c=a.aoData.length;b<c;b++){t=h[b*f+d];if(j&&a.aoColumns[d].sType!="string"){q=H(a,b,d,"type");if(q!==""){q=fa(q);if(a.aoColumns[d].sType===null)a.aoColumns[d].sType=q;else if(a.aoColumns[d].sType!=q)a.aoColumns[d].sType="string"}}if(m){q=a.aoColumns[d].fnRender({iDataRow:b,iDataColumn:d,aData:a.aoData[b]._aData,oSettings:a});t.innerHTML=q;a.aoColumns[d].bUseRendered&& +N(a,b,d,q)}if(e)t.className+=" "+a.aoColumns[d].sClass;if(k)a.aoData[b]._anHidden[d]=null;else{a.aoData[b]._anHidden[d]=t;t.parentNode.removeChild(t)}}}}}function V(a){var b,c,d;a.nTHead.getElementsByTagName("tr");if(a.nTHead.getElementsByTagName("th").length!==0){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;a.aoColumns[b].sClass!==null&&i(c).addClass(a.aoColumns[b].sClass);if(a.aoColumns[b].sTitle!=c.innerHTML)c.innerHTML=a.aoColumns[b].sTitle}}else{var f=p.createElement("tr");b=0; +for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;c.innerHTML=a.aoColumns[b].sTitle;a.aoColumns[b].sClass!==null&&i(c).addClass(a.aoColumns[b].sClass);f.appendChild(c)}i(a.nTHead).html("")[0].appendChild(f);W(a.aoHeader,a.nTHead)}if(a.bJUI){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;f=p.createElement("div");f.className=a.oClasses.sSortJUIWrapper;i(c).contents().appendTo(f);var e=p.createElement("span");e.className=a.oClasses.sSortIcon;f.appendChild(e);c.appendChild(f)}}d=function(){this.onselectstart= +function(){return false};return false};if(a.oFeatures.bSort)for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable!==false){ga(a,a.aoColumns[b].nTh,b);i(a.aoColumns[b].nTh).bind("mousedown.DT",d)}else i(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);a.oClasses.sFooterTH!==""&&i(">tr>th",a.nTFoot).addClass(a.oClasses.sFooterTH);if(a.nTFoot!==null){c=S(a,null,a.aoFooter);b=0;for(d=a.aoColumns.length;b<d;b++)if(typeof c[b]!="undefined")a.aoColumns[b].nTf=c[b]}}function L(a,b,c){var d,f, +e,h=[],j=[],k=a.aoColumns.length;if(typeof c=="undefined")c=false;d=0;for(f=b.length;d<f;d++){h[d]=b[d].slice();h[d].nTr=b[d].nTr;for(e=k-1;e>=0;e--)!a.aoColumns[e].bVisible&&!c&&h[d].splice(e,1);j.push([])}d=0;for(f=h.length;d<f;d++){if(h[d].nTr){a=0;for(e=h[d].nTr.childNodes.length;a<e;a++)h[d].nTr.removeChild(h[d].nTr.childNodes[0])}e=0;for(b=h[d].length;e<b;e++){k=c=1;if(typeof j[d][e]=="undefined"){h[d].nTr.appendChild(h[d][e].cell);for(j[d][e]=1;typeof h[d+c]!="undefined"&&h[d][e].cell==h[d+ +c][e].cell;){j[d+c][e]=1;c++}for(;typeof h[d][e+k]!="undefined"&&h[d][e].cell==h[d][e+k].cell;){for(a=0;a<c;a++)j[d+a][e+k]=1;k++}h[d][e].cell.setAttribute("rowspan",c);h[d][e].cell.setAttribute("colspan",k)}}}}function C(a){var b,c,d=[],f=0,e=false;b=a.asStripClasses.length;c=a.aoOpenRows.length;if(!(a.fnPreDrawCallback!==null&&a.fnPreDrawCallback.call(a.oInstance,a)===false)){a.bDrawing=true;if(typeof a.iInitDisplayStart!="undefined"&&a.iInitDisplayStart!=-1){a._iDisplayStart=a.oFeatures.bServerSide? +a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart;a.iInitDisplayStart=-1;E(a)}if(a.bDeferLoading){a.bDeferLoading=false;a.iDraw++}else if(a.oFeatures.bServerSide){if(!a.bDestroying&&!za(a))return}else a.iDraw++;if(a.aiDisplay.length!==0){var h=a._iDisplayStart,j=a._iDisplayEnd;if(a.oFeatures.bServerSide){h=0;j=a.aoData.length}for(h=h;h<j;h++){var k=a.aoData[a.aiDisplay[h]];k.nTr===null&&z(a,a.aiDisplay[h]);var m=k.nTr;if(b!==0){var t=a.asStripClasses[f%b];if(k._sRowStripe!= +t){i(m).removeClass(k._sRowStripe).addClass(t);k._sRowStripe=t}}if(typeof a.fnRowCallback=="function"){m=a.fnRowCallback.call(a.oInstance,m,a.aoData[a.aiDisplay[h]]._aData,f,h);if(!m&&!e){J(a,0,"A node was not returned by fnRowCallback");e=true}}d.push(m);f++;if(c!==0)for(k=0;k<c;k++)m==a.aoOpenRows[k].nParent&&d.push(a.aoOpenRows[k].nTr)}}else{d[0]=p.createElement("tr");if(typeof a.asStripClasses[0]!="undefined")d[0].className=a.asStripClasses[0];e=a.oLanguage.sZeroRecords.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal())); +if(a.iDraw==1&&a.sAjaxSource!==null&&!a.oFeatures.bServerSide)e=a.oLanguage.sLoadingRecords;else if(typeof a.oLanguage.sEmptyTable!="undefined"&&a.fnRecordsTotal()===0)e=a.oLanguage.sEmptyTable;b=p.createElement("td");b.setAttribute("valign","top");b.colSpan=X(a);b.className=a.oClasses.sRowEmpty;b.innerHTML=e;d[f].appendChild(b)}typeof a.fnHeaderCallback=="function"&&a.fnHeaderCallback.call(a.oInstance,i(">tr",a.nTHead)[0],aa(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);typeof a.fnFooterCallback== +"function"&&a.fnFooterCallback.call(a.oInstance,i(">tr",a.nTFoot)[0],aa(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);f=p.createDocumentFragment();b=p.createDocumentFragment();if(a.nTBody){e=a.nTBody.parentNode;b.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered){c=a.nTBody.childNodes;for(b=c.length-1;b>=0;b--)c[b].parentNode.removeChild(c[b])}b=0;for(c=d.length;b<c;b++)f.appendChild(d[b]);a.nTBody.appendChild(f);e!==null&&e.appendChild(a.nTBody)}for(b=a.aoDrawCallback.length- +1;b>=0;b--)a.aoDrawCallback[b].fn.call(a.oInstance,a);a.bSorted=false;a.bFiltered=false;a.bDrawing=false;if(a.oFeatures.bServerSide){K(a,false);typeof a._bInitComplete=="undefined"&&w(a)}}}function ba(a){if(a.oFeatures.bSort)R(a,a.oPreviousSearch);else if(a.oFeatures.bFilter)M(a,a.oPreviousSearch);else{E(a);C(a)}}function za(a){if(a.bAjaxDataGet){K(a,true);var b=a.aoColumns.length,c=[],d,f;a.iDraw++;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:ha(a)}); +c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",value:a.oFeatures.bPaginate!==false?a._iDisplayLength:-1});for(f=0;f<b;f++){d=a.aoColumns[f].mDataProp;c.push({name:"mDataProp_"+f,value:typeof d=="function"?"function":d})}if(a.oFeatures.bFilter!==false){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(f=0;f<b;f++){c.push({name:"sSearch_"+f,value:a.aoPreSearchCols[f].sSearch});c.push({name:"bRegex_"+ +f,value:a.aoPreSearchCols[f].bRegex});c.push({name:"bSearchable_"+f,value:a.aoColumns[f].bSearchable})}}if(a.oFeatures.bSort!==false){d=a.aaSortingFixed!==null?a.aaSortingFixed.length:0;var e=a.aaSorting.length;c.push({name:"iSortingCols",value:d+e});for(f=0;f<d;f++){c.push({name:"iSortCol_"+f,value:a.aaSortingFixed[f][0]});c.push({name:"sSortDir_"+f,value:a.aaSortingFixed[f][1]})}for(f=0;f<e;f++){c.push({name:"iSortCol_"+(f+d),value:a.aaSorting[f][0]});c.push({name:"sSortDir_"+(f+d),value:a.aaSorting[f][1]})}for(f= +0;f<b;f++)c.push({name:"bSortable_"+f,value:a.aoColumns[f].bSortable})}a.fnServerData.call(a.oInstance,a.sAjaxSource,c,function(h){Aa(a,h)},a);return false}else return true}function Aa(a,b){if(typeof b.sEcho!="undefined")if(b.sEcho*1<a.iDraw)return;else a.iDraw=b.sEcho*1;if(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered))ia(a);a._iRecordsTotal=b.iTotalRecords;a._iRecordsDisplay=b.iTotalDisplayRecords;var c=ha(a);if(c=typeof b.sColumns!="undefined"&&c!==""&&b.sColumns!=c)var d= +Ba(a,b.sColumns);b=Z(a.sAjaxDataProp)(b);for(var f=0,e=b.length;f<e;f++)if(c){for(var h=[],j=0,k=a.aoColumns.length;j<k;j++)h.push(b[f][d[j]]);v(a,h)}else v(a,b[f]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=false;C(a);a.bAjaxDataGet=true;K(a,false)}function xa(a){var b=p.createElement("div");a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=p.createElement("div");a.nTableWrapper.className=a.oClasses.sWrapper;a.sTableId!==""&&a.nTableWrapper.setAttribute("id",a.sTableId+"_wrapper"); +a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),f,e,h,j,k,m,t,q=0;q<d.length;q++){e=0;h=d[q];if(h=="<"){j=p.createElement("div");k=d[q+1];if(k=="'"||k=='"'){m="";for(t=2;d[q+t]!=k;){m+=d[q+t];t++}if(m=="H")m="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix";else if(m=="F")m="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix";if(m.indexOf(".")!=-1){k=m.split(".");j.setAttribute("id",k[0].substr(1, +k[0].length-1));j.className=k[1]}else if(m.charAt(0)=="#")j.setAttribute("id",m.substr(1,m.length-1));else j.className=m;q+=t}c.appendChild(j);c=j}else if(h==">")c=c.parentNode;else if(h=="l"&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange){f=Ca(a);e=1}else if(h=="f"&&a.oFeatures.bFilter){f=Da(a);e=1}else if(h=="r"&&a.oFeatures.bProcessing){f=Ea(a);e=1}else if(h=="t"){f=Fa(a);e=1}else if(h=="i"&&a.oFeatures.bInfo){f=Ga(a);e=1}else if(h=="p"&&a.oFeatures.bPaginate){f=Ha(a);e=1}else if(o.aoFeatures.length!== +0){j=o.aoFeatures;t=0;for(k=j.length;t<k;t++)if(h==j[t].cFeature){if(f=j[t].fnInit(a))e=1;break}}if(e==1&&f!==null){if(typeof a.aanFeatures[h]!="object")a.aanFeatures[h]=[];a.aanFeatures[h].push(f);c.appendChild(f)}}b.parentNode.replaceChild(a.nTableWrapper,b)}function Fa(a){if(a.oScroll.sX===""&&a.oScroll.sY==="")return a.nTable;var b=p.createElement("div"),c=p.createElement("div"),d=p.createElement("div"),f=p.createElement("div"),e=p.createElement("div"),h=p.createElement("div"),j=a.nTable.cloneNode(false), +k=a.nTable.cloneNode(false),m=a.nTable.getElementsByTagName("thead")[0],t=a.nTable.getElementsByTagName("tfoot").length===0?null:a.nTable.getElementsByTagName("tfoot")[0],q=typeof g.bJQueryUI!="undefined"&&g.bJQueryUI?o.oJUIClasses:o.oStdClasses;c.appendChild(d);e.appendChild(h);f.appendChild(a.nTable);b.appendChild(c);b.appendChild(f);d.appendChild(j);j.appendChild(m);if(t!==null){b.appendChild(e);h.appendChild(k);k.appendChild(t)}b.className=q.sScrollWrapper;c.className=q.sScrollHead;d.className= +q.sScrollHeadInner;f.className=q.sScrollBody;e.className=q.sScrollFoot;h.className=q.sScrollFootInner;if(a.oScroll.bAutoCss){c.style.overflow="hidden";c.style.position="relative";e.style.overflow="hidden";f.style.overflow="auto"}c.style.border="0";c.style.width="100%";e.style.border="0";d.style.width="150%";j.removeAttribute("id");j.style.marginLeft="0";a.nTable.style.marginLeft="0";if(t!==null){k.removeAttribute("id");k.style.marginLeft="0"}d=i(">caption",a.nTable);h=0;for(k=d.length;h<k;h++)j.appendChild(d[h]); +if(a.oScroll.sX!==""){c.style.width=u(a.oScroll.sX);f.style.width=u(a.oScroll.sX);if(t!==null)e.style.width=u(a.oScroll.sX);i(f).scroll(function(){c.scrollLeft=this.scrollLeft;if(t!==null)e.scrollLeft=this.scrollLeft})}if(a.oScroll.sY!=="")f.style.height=u(a.oScroll.sY);a.aoDrawCallback.push({fn:Ia,sName:"scrolling"});a.oScroll.bInfinite&&i(f).scroll(function(){if(!a.bDrawing)if(i(this).scrollTop()+i(this).height()>i(a.nTable).height()-a.oScroll.iLoadGap)if(a.fnDisplayEnd()<a.fnRecordsDisplay()){ja(a, +"next");E(a);C(a)}});a.nScrollHead=c;a.nScrollFoot=e;return b}function Ia(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],d=a.nTable.parentNode,f,e,h,j,k,m,t,q,I=[];h=a.nTable.getElementsByTagName("thead");h.length>0&&a.nTable.removeChild(h[0]);if(a.nTFoot!==null){k=a.nTable.getElementsByTagName("tfoot");k.length>0&&a.nTable.removeChild(k[0])}h=a.nTHead.cloneNode(true);a.nTable.insertBefore(h,a.nTable.childNodes[0]);if(a.nTFoot!==null){k=a.nTFoot.cloneNode(true); +a.nTable.insertBefore(k,a.nTable.childNodes[1])}if(a.oScroll.sX===""){d.style.width="100%";b.parentNode.style.width="100%"}var O=S(a,h);f=0;for(e=O.length;f<e;f++){t=Ja(a,f);O[f].style.width=a.aoColumns[t].sWidth}a.nTFoot!==null&&P(function(B){B.style.width=""},k.getElementsByTagName("tr"));f=i(a.nTable).outerWidth();if(a.oScroll.sX===""){a.nTable.style.width="100%";if(i.browser.msie&&i.browser.version<=7)a.nTable.style.width=u(i(a.nTable).outerWidth()-a.oScroll.iBarWidth)}else if(a.oScroll.sXInner!== +"")a.nTable.style.width=u(a.oScroll.sXInner);else if(f==i(d).width()&&i(d).height()<i(a.nTable).height()){a.nTable.style.width=u(f-a.oScroll.iBarWidth);if(i(a.nTable).outerWidth()>f-a.oScroll.iBarWidth)a.nTable.style.width=u(f)}else a.nTable.style.width=u(f);f=i(a.nTable).outerWidth();if(a.oScroll.sX===""){d.style.width=u(f+a.oScroll.iBarWidth);b.parentNode.style.width=u(f+a.oScroll.iBarWidth)}e=a.nTHead.getElementsByTagName("tr");h=h.getElementsByTagName("tr");P(function(B,F){m=B.style;m.paddingTop= +"0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;q=i(B).width();F.style.width=u(q);I.push(q)},h,e);i(h).height(0);if(a.nTFoot!==null){j=k.getElementsByTagName("tr");k=a.nTFoot.getElementsByTagName("tr");P(function(B,F){m=B.style;m.paddingTop="0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;q=i(B).width();F.style.width=u(q);I.push(q)},j,k);i(j).height(0)}P(function(B){B.innerHTML="";B.style.width=u(I.shift())},h);a.nTFoot!==null&&P(function(B){B.innerHTML= +"";B.style.width=u(I.shift())},j);if(i(a.nTable).outerWidth()<f)if(a.oScroll.sX==="")J(a,1,"The table cannot fit into the current element which will cause column misalignment. It is suggested that you enable x-scrolling or increase the width the table has in which to be drawn");else a.oScroll.sXInner!==""&&J(a,1,"The table cannot fit into the current element which will cause column misalignment. It is suggested that you increase the sScrollXInner property to allow it to draw in a larger area, or simply remove that parameter to allow automatic calculation"); +if(a.oScroll.sY==="")if(i.browser.msie&&i.browser.version<=7)d.style.height=u(a.nTable.offsetHeight+a.oScroll.iBarWidth);if(a.oScroll.sY!==""&&a.oScroll.bCollapse){d.style.height=u(a.oScroll.sY);j=a.oScroll.sX!==""&&a.nTable.offsetWidth>d.offsetWidth?a.oScroll.iBarWidth:0;if(a.nTable.offsetHeight<d.offsetHeight)d.style.height=u(i(a.nTable).height()+j)}j=i(a.nTable).outerWidth();c.style.width=u(j);b.style.width=u(j+a.oScroll.iBarWidth);if(a.nTFoot!==null){b=a.nScrollFoot.getElementsByTagName("div")[0]; +c=b.getElementsByTagName("table")[0];b.style.width=u(a.nTable.offsetWidth+a.oScroll.iBarWidth);c.style.width=u(a.nTable.offsetWidth)}if(a.bSorted||a.bFiltered)d.scrollTop=0}function ca(a){if(a.oFeatures.bAutoWidth===false)return false;ea(a);for(var b=0,c=a.aoColumns.length;b<c;b++)a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}function Da(a){var b=a.oLanguage.sSearch;b=b.indexOf("_INPUT_")!==-1?b.replace("_INPUT_",'<input type="text" />'):b===""?'<input type="text" />':b+' <input type="text" />'; +var c=p.createElement("div");c.className=a.oClasses.sFilter;c.innerHTML="<label>"+b+"</label>";a.sTableId!==""&&typeof a.aanFeatures.f=="undefined"&&c.setAttribute("id",a.sTableId+"_filter");b=i("input",c);b.val(a.oPreviousSearch.sSearch.replace('"',"""));b.bind("keyup.DT",function(){for(var d=a.aanFeatures.f,f=0,e=d.length;f<e;f++)d[f]!=this.parentNode&&i("input",d[f]).val(this.value);this.value!=a.oPreviousSearch.sSearch&&M(a,{sSearch:this.value,bRegex:a.oPreviousSearch.bRegex,bSmart:a.oPreviousSearch.bSmart})}); +b.bind("keypress.DT",function(d){if(d.keyCode==13)return false});return c}function M(a,b,c){Ka(a,b.sSearch,c,b.bRegex,b.bSmart);for(b=0;b<a.aoPreSearchCols.length;b++)La(a,a.aoPreSearchCols[b].sSearch,b,a.aoPreSearchCols[b].bRegex,a.aoPreSearchCols[b].bSmart);o.afnFiltering.length!==0&&Ma(a);a.bFiltered=true;a._iDisplayStart=0;E(a);C(a);ka(a,0)}function Ma(a){for(var b=o.afnFiltering,c=0,d=b.length;c<d;c++)for(var f=0,e=0,h=a.aiDisplay.length;e<h;e++){var j=a.aiDisplay[e-f];if(!b[c](a,da(a,j,"filter"), +j)){a.aiDisplay.splice(e-f,1);f++}}}function La(a,b,c,d,f){if(b!==""){var e=0;b=la(b,d,f);for(d=a.aiDisplay.length-1;d>=0;d--){f=ma(H(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType);if(!b.test(f)){a.aiDisplay.splice(d,1);e++}}}}function Ka(a,b,c,d,f){var e=la(b,d,f);if(typeof c=="undefined"||c===null)c=0;if(o.afnFiltering.length!==0)c=1;if(b.length<=0){a.aiDisplay.splice(0,a.aiDisplay.length);a.aiDisplay=a.aiDisplayMaster.slice()}else if(a.aiDisplay.length==a.aiDisplayMaster.length||a.oPreviousSearch.sSearch.length> +b.length||c==1||b.indexOf(a.oPreviousSearch.sSearch)!==0){a.aiDisplay.splice(0,a.aiDisplay.length);ka(a,1);for(c=0;c<a.aiDisplayMaster.length;c++)e.test(a.asDataSearch[c])&&a.aiDisplay.push(a.aiDisplayMaster[c])}else{var h=0;for(c=0;c<a.asDataSearch.length;c++)if(!e.test(a.asDataSearch[c])){a.aiDisplay.splice(c-h,1);h++}}a.oPreviousSearch.sSearch=b;a.oPreviousSearch.bRegex=d;a.oPreviousSearch.bSmart=f}function ka(a,b){a.asDataSearch.splice(0,a.asDataSearch.length);b=typeof b!="undefined"&&b==1?a.aiDisplayMaster: +a.aiDisplay;for(var c=0,d=b.length;c<d;c++)a.asDataSearch[c]=na(a,da(a,b[c],"filter"))}function na(a,b){var c="";if(typeof a.__nTmpFilter=="undefined")a.__nTmpFilter=p.createElement("div");for(var d=a.__nTmpFilter,f=0,e=a.aoColumns.length;f<e;f++)if(a.aoColumns[f].bSearchable)c+=ma(b[f],a.aoColumns[f].sType)+" ";if(c.indexOf("&")!==-1){d.innerHTML=c;c=d.textContent?d.textContent:d.innerText;c=c.replace(/\n/g," ").replace(/\r/g,"")}return c}function la(a,b,c){if(c){a=b?a.split(" "):oa(a).split(" "); +a="^(?=.*?"+a.join(")(?=.*?")+").*$";return new RegExp(a,"i")}else{a=b?a:oa(a);return new RegExp(a,"i")}}function ma(a,b){if(typeof o.ofnSearch[b]=="function")return o.ofnSearch[b](a);else if(b=="html")return a.replace(/\n/g," ").replace(/<.*?>/g,"");else if(typeof a=="string")return a.replace(/\n/g," ");else if(a===null)return"";return a}function R(a,b){var c,d,f,e,h=[],j=[],k=o.oSort;d=a.aoData;var m=a.aoColumns;if(!a.oFeatures.bServerSide&&(a.aaSorting.length!==0||a.aaSortingFixed!==null)){h=a.aaSortingFixed!== +null?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<h.length;c++){var t=h[c][0];f=pa(a,t);e=a.aoColumns[t].sSortDataType;if(typeof o.afnSortData[e]!="undefined"){var q=o.afnSortData[e](a,t,f);f=0;for(e=d.length;f<e;f++)N(a,f,t,q[f])}}c=0;for(d=a.aiDisplayMaster.length;c<d;c++)j[a.aiDisplayMaster[c]]=c;var I=h.length;a.aiDisplayMaster.sort(function(O,B){var F,qa;for(c=0;c<I;c++){F=m[h[c][0]].iDataSort;qa=m[F].sType;F=k[(qa?qa:"string")+"-"+h[c][1]](H(a,O,F,"sort"),H(a,B,F,"sort")); +if(F!==0)return F}return k["numeric-asc"](j[O],j[B])})}if((typeof b=="undefined"||b)&&!a.oFeatures.bDeferRender)T(a);a.bSorted=true;if(a.oFeatures.bFilter)M(a,a.oPreviousSearch,1);else{a.aiDisplay=a.aiDisplayMaster.slice();a._iDisplayStart=0;E(a);C(a)}}function ga(a,b,c,d){i(b).bind("click.DT",function(f){if(a.aoColumns[c].bSortable!==false){var e=function(){var h,j;if(f.shiftKey){for(var k=false,m=0;m<a.aaSorting.length;m++)if(a.aaSorting[m][0]==c){k=true;h=a.aaSorting[m][0];j=a.aaSorting[m][2]+ +1;if(typeof a.aoColumns[h].asSorting[j]=="undefined")a.aaSorting.splice(m,1);else{a.aaSorting[m][1]=a.aoColumns[h].asSorting[j];a.aaSorting[m][2]=j}break}k===false&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}else if(a.aaSorting.length==1&&a.aaSorting[0][0]==c){h=a.aaSorting[0][0];j=a.aaSorting[0][2]+1;if(typeof a.aoColumns[h].asSorting[j]=="undefined")j=0;a.aaSorting[0][1]=a.aoColumns[h].asSorting[j];a.aaSorting[0][2]=j}else{a.aaSorting.splice(0,a.aaSorting.length);a.aaSorting.push([c,a.aoColumns[c].asSorting[0], +0])}R(a)};if(a.oFeatures.bProcessing){K(a,true);setTimeout(function(){e();a.oFeatures.bServerSide||K(a,false)},0)}else e();typeof d=="function"&&d(a)}})}function T(a){var b,c,d,f,e,h=a.aoColumns.length,j=a.oClasses;for(b=0;b<h;b++)a.aoColumns[b].bSortable&&i(a.aoColumns[b].nTh).removeClass(j.sSortAsc+" "+j.sSortDesc+" "+a.aoColumns[b].sSortingClass);f=a.aaSortingFixed!==null?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable){e=a.aoColumns[b].sSortingClass; +d=-1;for(c=0;c<f.length;c++)if(f[c][0]==b){e=f[c][1]=="asc"?j.sSortAsc:j.sSortDesc;d=c;break}i(a.aoColumns[b].nTh).addClass(e);if(a.bJUI){c=i("span",a.aoColumns[b].nTh);c.removeClass(j.sSortJUIAsc+" "+j.sSortJUIDesc+" "+j.sSortJUI+" "+j.sSortJUIAscAllowed+" "+j.sSortJUIDescAllowed);c.addClass(d==-1?a.aoColumns[b].sSortingClassJUI:f[d][1]=="asc"?j.sSortJUIAsc:j.sSortJUIDesc)}}else i(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);e=j.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){d= +Q(a);if(a.oFeatures.bDeferRender)i(d).removeClass(e+"1 "+e+"2 "+e+"3");else if(d.length>=h)for(b=0;b<h;b++)if(d[b].className.indexOf(e+"1")!=-1){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(e+"1",""))}else if(d[b].className.indexOf(e+"2")!=-1){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(e+"2",""))}else if(d[b].className.indexOf(e+"3")!=-1){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(" "+ +e+"3",""))}j=1;var k;for(b=0;b<f.length;b++){k=parseInt(f[b][0],10);c=0;for(a=d.length/h;c<a;c++)d[h*c+k].className+=" "+e+j;j<3&&j++}}}function Ha(a){if(a.oScroll.bInfinite)return null;var b=p.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType;o.oPagination[a.sPaginationType].fnInit(a,b,function(c){E(c);C(c)});typeof a.aanFeatures.p=="undefined"&&a.aoDrawCallback.push({fn:function(c){o.oPagination[c.sPaginationType].fnUpdate(c,function(d){E(d);C(d)})},sName:"pagination"});return b} +function ja(a,b){var c=a._iDisplayStart;if(b=="first")a._iDisplayStart=0;else if(b=="previous"){a._iDisplayStart=a._iDisplayLength>=0?a._iDisplayStart-a._iDisplayLength:0;if(a._iDisplayStart<0)a._iDisplayStart=0}else if(b=="next")if(a._iDisplayLength>=0){if(a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay())a._iDisplayStart+=a._iDisplayLength}else a._iDisplayStart=0;else if(b=="last")if(a._iDisplayLength>=0){b=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(b-1)*a._iDisplayLength}else a._iDisplayStart= +0;else J(a,0,"Unknown paging action: "+b);return c!=a._iDisplayStart}function Ga(a){var b=p.createElement("div");b.className=a.oClasses.sInfo;if(typeof a.aanFeatures.i=="undefined"){a.aoDrawCallback.push({fn:Na,sName:"information"});a.sTableId!==""&&b.setAttribute("id",a.sTableId+"_info")}return b}function Na(a){if(!(!a.oFeatures.bInfo||a.aanFeatures.i.length===0)){var b=a._iDisplayStart+1,c=a.fnDisplayEnd(),d=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),e=a.fnFormatNumber(b),h=a.fnFormatNumber(c),j= +a.fnFormatNumber(d),k=a.fnFormatNumber(f);if(a.oScroll.bInfinite)e=a.fnFormatNumber(1);e=a.fnRecordsDisplay()===0&&a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfoEmpty+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()===0?a.oLanguage.sInfoEmpty+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",j)+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfo.replace("_START_",e).replace("_END_",h).replace("_TOTAL_",k)+a.oLanguage.sInfoPostFix:a.oLanguage.sInfo.replace("_START_", +e).replace("_END_",h).replace("_TOTAL_",k)+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()))+a.oLanguage.sInfoPostFix;if(a.oLanguage.fnInfoCallback!==null)e=a.oLanguage.fnInfoCallback(a,b,c,d,f,e);a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++)i(a[b]).html(e)}}function Ca(a){if(a.oScroll.bInfinite)return null;var b='<select size="1" '+(a.sTableId===""?"":'name="'+a.sTableId+'_length"')+">",c,d;if(a.aLengthMenu.length==2&&typeof a.aLengthMenu[0]=="object"&&typeof a.aLengthMenu[1]== +"object"){c=0;for(d=a.aLengthMenu[0].length;c<d;c++)b+='<option value="'+a.aLengthMenu[0][c]+'">'+a.aLengthMenu[1][c]+"</option>"}else{c=0;for(d=a.aLengthMenu.length;c<d;c++)b+='<option value="'+a.aLengthMenu[c]+'">'+a.aLengthMenu[c]+"</option>"}b+="</select>";var f=p.createElement("div");a.sTableId!==""&&typeof a.aanFeatures.l=="undefined"&&f.setAttribute("id",a.sTableId+"_length");f.className=a.oClasses.sLength;f.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";i('select option[value="'+ +a._iDisplayLength+'"]',f).attr("selected",true);i("select",f).bind("change.DT",function(){var e=i(this).val(),h=a.aanFeatures.l;c=0;for(d=h.length;c<d;c++)h[c]!=this.parentNode&&i("select",h[c]).val(e);a._iDisplayLength=parseInt(e,10);E(a);if(a.fnDisplayEnd()==a.fnRecordsDisplay()){a._iDisplayStart=a.fnDisplayEnd()-a._iDisplayLength;if(a._iDisplayStart<0)a._iDisplayStart=0}if(a._iDisplayLength==-1)a._iDisplayStart=0;C(a)});return f}function Ea(a){var b=p.createElement("div");a.sTableId!==""&&typeof a.aanFeatures.r== +"undefined"&&b.setAttribute("id",a.sTableId+"_processing");b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function K(a,b){if(a.oFeatures.bProcessing){a=a.aanFeatures.r;for(var c=0,d=a.length;c<d;c++)a[c].style.visibility=b?"visible":"hidden"}}function Ja(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++){a.aoColumns[d].bVisible===true&&c++;if(c==b)return d}return null}function pa(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++){a.aoColumns[d].bVisible=== +true&&c++;if(d==b)return a.aoColumns[d].bVisible===true?c:null}return null}function U(a,b){var c,d;c=a._iDisplayStart;for(d=a._iDisplayEnd;c<d;c++)if(a.aoData[a.aiDisplay[c]].nTr==b)return a.aiDisplay[c];c=0;for(d=a.aoData.length;c<d;c++)if(a.aoData[c].nTr==b)return c;return null}function X(a){for(var b=0,c=0;c<a.aoColumns.length;c++)a.aoColumns[c].bVisible===true&&b++;return b}function E(a){a._iDisplayEnd=a.oFeatures.bPaginate===false?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length|| +a._iDisplayLength==-1?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Oa(a,b){if(!a||a===null||a==="")return 0;if(typeof b=="undefined")b=p.getElementsByTagName("body")[0];var c=p.createElement("div");c.style.width=u(a);b.appendChild(c);a=c.offsetWidth;b.removeChild(c);return a}function ea(a){var b=0,c,d=0,f=a.aoColumns.length,e,h=i("th",a.nTHead);for(e=0;e<f;e++)if(a.aoColumns[e].bVisible){d++;if(a.aoColumns[e].sWidth!==null){c=Oa(a.aoColumns[e].sWidthOrig,a.nTable.parentNode);if(c!== +null)a.aoColumns[e].sWidth=u(c);b++}}if(f==h.length&&b===0&&d==f&&a.oScroll.sX===""&&a.oScroll.sY==="")for(e=0;e<a.aoColumns.length;e++){c=i(h[e]).width();if(c!==null)a.aoColumns[e].sWidth=u(c)}else{b=a.nTable.cloneNode(false);e=a.nTHead.cloneNode(true);d=p.createElement("tbody");c=p.createElement("tr");b.removeAttribute("id");b.appendChild(e);if(a.nTFoot!==null){b.appendChild(a.nTFoot.cloneNode(true));P(function(k){k.style.width=""},b.getElementsByTagName("tr"))}b.appendChild(d);d.appendChild(c); +d=i("thead th",b);if(d.length===0)d=i("tbody tr:eq(0)>td",b);h=S(a,e);for(e=d=0;e<f;e++){var j=a.aoColumns[e];if(j.bVisible&&j.sWidthOrig!==null&&j.sWidthOrig!=="")h[e-d].style.width=u(j.sWidthOrig);else if(j.bVisible)h[e-d].style.width="";else d++}for(e=0;e<f;e++)if(a.aoColumns[e].bVisible){d=Pa(a,e);if(d!==null){d=d.cloneNode(true);if(a.aoColumns[e].sContentPadding!=="")d.innerHTML+=a.aoColumns[e].sContentPadding;c.appendChild(d)}}f=a.nTable.parentNode;f.appendChild(b);if(a.oScroll.sX!==""&&a.oScroll.sXInner!== +"")b.style.width=u(a.oScroll.sXInner);else if(a.oScroll.sX!==""){b.style.width="";if(i(b).width()<f.offsetWidth)b.style.width=u(f.offsetWidth)}else if(a.oScroll.sY!=="")b.style.width=u(f.offsetWidth);b.style.visibility="hidden";Qa(a,b);f=i("tbody tr:eq(0)",b).children();if(f.length===0)f=S(a,i("thead",b)[0]);if(a.oScroll.sX!==""){for(e=d=c=0;e<a.aoColumns.length;e++)if(a.aoColumns[e].bVisible){c+=a.aoColumns[e].sWidthOrig===null?i(f[d]).outerWidth():parseInt(a.aoColumns[e].sWidth.replace("px",""), +10)+(i(f[d]).outerWidth()-i(f[d]).width());d++}b.style.width=u(c);a.nTable.style.width=u(c)}for(e=d=0;e<a.aoColumns.length;e++)if(a.aoColumns[e].bVisible){c=i(f[d]).width();if(c!==null&&c>0)a.aoColumns[e].sWidth=u(c);d++}a.nTable.style.width=u(i(b).outerWidth());b.parentNode.removeChild(b)}}function Qa(a,b){if(a.oScroll.sX===""&&a.oScroll.sY!==""){i(b).width();b.style.width=u(i(b).outerWidth()-a.oScroll.iBarWidth)}else if(a.oScroll.sX!=="")b.style.width=u(i(b).outerWidth())}function Pa(a,b){var c= +Ra(a,b);if(c<0)return null;if(a.aoData[c].nTr===null){var d=p.createElement("td");d.innerHTML=H(a,c,b,"");return d}return Q(a,c)[b]}function Ra(a,b){for(var c=-1,d=-1,f=0;f<a.aoData.length;f++){var e=H(a,f,b,"display")+"";e=e.replace(/<.*?>/g,"");if(e.length>c){c=e.length;d=f}}return d}function u(a){if(a===null)return"0px";if(typeof a=="number"){if(a<0)return"0px";return a+"px"}var b=a.charCodeAt(a.length-1);if(b<48||b>57)return a;return a+"px"}function Va(a,b){if(a.length!=b.length)return 1;for(var c= +0;c<a.length;c++)if(a[c]!=b[c])return 2;return 0}function fa(a){for(var b=o.aTypes,c=b.length,d=0;d<c;d++){var f=b[d](a);if(f!==null)return f}return"string"}function A(a){for(var b=0;b<D.length;b++)if(D[b].nTable==a)return D[b];return null}function aa(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++)b.push(a.aoData[d]._aData);return b}function $(a){for(var b=[],c=0,d=a.aoData.length;c<d;c++)a.aoData[c].nTr!==null&&b.push(a.aoData[c].nTr);return b}function Q(a,b){var c=[],d,f,e,h,j;f=0;var k=a.aoData.length; +if(typeof b!="undefined"){f=b;k=b+1}for(f=f;f<k;f++){j=a.aoData[f];if(j.nTr!==null){b=[];e=0;for(h=j.nTr.childNodes.length;e<h;e++){d=j.nTr.childNodes[e].nodeName.toLowerCase();if(d=="td"||d=="th")b.push(j.nTr.childNodes[e])}e=d=0;for(h=a.aoColumns.length;e<h;e++)if(a.aoColumns[e].bVisible)c.push(b[e-d]);else{c.push(j._anHidden[e]);d++}}}return c}function oa(a){return a.replace(new RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^)","g"),"\\$1")}function ra(a,b){for(var c=-1,d= +0,f=a.length;d<f;d++)if(a[d]==b)c=d;else a[d]>b&&a[d]--;c!=-1&&a.splice(c,1)}function Ba(a,b){b=b.split(",");for(var c=[],d=0,f=a.aoColumns.length;d<f;d++)for(var e=0;e<f;e++)if(a.aoColumns[d].sName==b[e]){c.push(e);break}return c}function ha(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++)b+=a.aoColumns[c].sName+",";if(b.length==d)return"";return b.slice(0,-1)}function J(a,b,c){a=a.sTableId===""?"DataTables warning: "+c:"DataTables warning (table id = '"+a.sTableId+"'): "+c;if(b===0)if(o.sErrMode== +"alert")alert(a);else throw a;else typeof console!="undefined"&&typeof console.log!="undefined"&&console.log(a)}function ia(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0,a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);E(a)}function sa(a){if(!(!a.oFeatures.bStateSave||typeof a.bDestroying!="undefined")){var b,c,d,f="{";f+='"iCreate":'+(new Date).getTime()+",";f+='"iStart":'+(a.oScroll.bInfinite?0:a._iDisplayStart)+",";f+='"iEnd":'+(a.oScroll.bInfinite?a._iDisplayLength: +a._iDisplayEnd)+",";f+='"iLength":'+a._iDisplayLength+",";f+='"sFilter":"'+encodeURIComponent(a.oPreviousSearch.sSearch)+'",';f+='"sFilterEsc":'+!a.oPreviousSearch.bRegex+",";f+='"aaSorting":[ ';for(b=0;b<a.aaSorting.length;b++)f+="["+a.aaSorting[b][0]+',"'+a.aaSorting[b][1]+'"],';f=f.substring(0,f.length-1);f+="],";f+='"aaSearchCols":[ ';for(b=0;b<a.aoPreSearchCols.length;b++)f+='["'+encodeURIComponent(a.aoPreSearchCols[b].sSearch)+'",'+!a.aoPreSearchCols[b].bRegex+"],";f=f.substring(0,f.length- +1);f+="],";f+='"abVisCols":[ ';for(b=0;b<a.aoColumns.length;b++)f+=a.aoColumns[b].bVisible+",";f=f.substring(0,f.length-1);f+="]";b=0;for(c=a.aoStateSave.length;b<c;b++){d=a.aoStateSave[b].fn(a,f);if(d!=="")f=d}f+="}";Sa(a.sCookiePrefix+a.sInstance,f,a.iCookieDuration,a.sCookiePrefix,a.fnCookieCallback)}}function Ta(a,b){if(a.oFeatures.bStateSave){var c,d,f;d=ta(a.sCookiePrefix+a.sInstance);if(d!==null&&d!==""){try{c=typeof i.parseJSON=="function"?i.parseJSON(d.replace(/'/g,'"')):eval("("+d+")")}catch(e){return}d= +0;for(f=a.aoStateLoad.length;d<f;d++)if(!a.aoStateLoad[d].fn(a,c))return;a.oLoadedState=i.extend(true,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart=c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.oPreviousSearch.sSearch=decodeURIComponent(c.sFilter);a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();if(typeof c.sFilterEsc!="undefined")a.oPreviousSearch.bRegex=!c.sFilterEsc;if(typeof c.aaSearchCols!="undefined")for(d=0;d<c.aaSearchCols.length;d++)a.aoPreSearchCols[d]= +{sSearch:decodeURIComponent(c.aaSearchCols[d][0]),bRegex:!c.aaSearchCols[d][1]};if(typeof c.abVisCols!="undefined"){b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++){b.saved_aoColumns[d]={};b.saved_aoColumns[d].bVisible=c.abVisCols[d]}}}}}function Sa(a,b,c,d,f){var e=new Date;e.setTime(e.getTime()+c*1E3);c=wa.location.pathname.split("/");a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase();var h;if(f!==null){h=typeof i.parseJSON=="function"?i.parseJSON(b):eval("("+b+")");b=f(a,h,e.toGMTString(), +c.join("/")+"/")}else b=a+"="+encodeURIComponent(b)+"; expires="+e.toGMTString()+"; path="+c.join("/")+"/";f="";e=9999999999999;if((ta(a)!==null?p.cookie.length:b.length+p.cookie.length)+10>4096){a=p.cookie.split(";");for(var j=0,k=a.length;j<k;j++)if(a[j].indexOf(d)!=-1){var m=a[j].split("=");try{h=eval("("+decodeURIComponent(m[1])+")")}catch(t){continue}if(typeof h.iCreate!="undefined"&&h.iCreate<e){f=m[0];e=h.iCreate}}if(f!=="")p.cookie=f+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+c.join("/")+ +"/"}p.cookie=b}function ta(a){var b=wa.location.pathname.split("/");a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=";b=p.cookie.split(";");for(var c=0;c<b.length;c++){for(var d=b[c];d.charAt(0)==" ";)d=d.substring(1,d.length);if(d.indexOf(a)===0)return decodeURIComponent(d.substring(a.length,d.length))}return null}function W(a,b){b=b.getElementsByTagName("tr");var c,d,f,e,h,j,k,m,t=function(O,B,F){for(;typeof O[B][F]!="undefined";)F++;return F};a.splice(0,a.length);d=0;for(j=b.length;d< +j;d++)a.push([]);d=0;for(j=b.length;d<j;d++){f=0;for(k=b[d].childNodes.length;f<k;f++){c=b[d].childNodes[f];if(c.nodeName.toUpperCase()=="TD"||c.nodeName.toUpperCase()=="TH"){var q=c.getAttribute("colspan")*1,I=c.getAttribute("rowspan")*1;q=!q||q===0||q===1?1:q;I=!I||I===0||I===1?1:I;m=t(a,d,0);for(h=0;h<q;h++)for(e=0;e<I;e++){a[d+e][m+h]={cell:c,unique:q==1?true:false};a[d+e].nTr=b[d]}}}}}function S(a,b,c){var d=[];if(typeof c=="undefined"){c=a.aoHeader;if(typeof b!="undefined"){c=[];W(c,b)}}b=0; +for(var f=c.length;b<f;b++)for(var e=0,h=c[b].length;e<h;e++)if(c[b][e].unique&&(typeof d[e]=="undefined"||!a.bSortCellsTop))d[e]=c[b][e].cell;return d}function Ua(){var a=p.createElement("p"),b=a.style;b.width="100%";b.height="200px";var c=p.createElement("div");b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px";b.overflow="hidden";c.appendChild(a);p.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";a=a.offsetWidth;if(b==a)a= +c.clientWidth;p.body.removeChild(c);return b-a}function P(a,b,c){for(var d=0,f=b.length;d<f;d++)for(var e=0,h=b[d].childNodes.length;e<h;e++)if(b[d].childNodes[e].nodeType==1)typeof c!="undefined"?a(b[d].childNodes[e],c[d].childNodes[e]):a(b[d].childNodes[e])}function n(a,b,c,d){if(typeof d=="undefined")d=c;if(typeof b[c]!="undefined")a[d]=b[c]}function da(a,b,c){for(var d=[],f=0,e=a.aoColumns.length;f<e;f++)d.push(H(a,b,f,c));return d}function H(a,b,c,d){var f=a.aoColumns[c];if((c=f.fnGetData(a.aoData[b]._aData))=== +undefined){if(a.iDrawError!=a.iDraw&&f.sDefaultContent===null){J(a,0,"Requested unknown parameter '"+f.mDataProp+"' from the data source for row "+b);a.iDrawError=a.iDraw}return f.sDefaultContent}if(c===null&&f.sDefaultContent!==null)c=f.sDefaultContent;if(d=="display"&&c===null)return"";return c}function N(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function Z(a){if(a===null)return function(){return null};else if(typeof a=="function")return function(c){return a(c)};else if(typeof a== +"string"&&a.indexOf(".")!=-1){var b=a.split(".");return b.length==2?function(c){return c[b[0]][b[1]]}:b.length==3?function(c){return c[b[0]][b[1]][b[2]]}:function(c){for(var d=0,f=b.length;d<f;d++)c=c[b[d]];return c}}else return function(c){return c[a]}}function ya(a){if(a===null)return function(){};else if(typeof a=="function")return function(c,d){return a(c,d)};else if(typeof a=="string"&&a.indexOf(".")!=-1){var b=a.split(".");return b.length==2?function(c,d){c[b[0]][b[1]]=d}:b.length==3?function(c, +d){c[b[0]][b[1]][b[2]]=d}:function(c,d){for(var f=0,e=b.length-1;f<e;f++)c=c[b[f]];c[b[b.length-1]]=d}}else return function(c,d){c[a]=d}}this.oApi={};this.fnDraw=function(a){var b=A(this[o.iApiIndex]);if(typeof a!="undefined"&&a===false){E(b);C(b)}else ba(b)};this.fnFilter=function(a,b,c,d,f){var e=A(this[o.iApiIndex]);if(e.oFeatures.bFilter){if(typeof c=="undefined")c=false;if(typeof d=="undefined")d=true;if(typeof f=="undefined")f=true;if(typeof b=="undefined"||b===null){M(e,{sSearch:a,bRegex:c, +bSmart:d},1);if(f&&typeof e.aanFeatures.f!="undefined"){b=e.aanFeatures.f;c=0;for(d=b.length;c<d;c++)i("input",b[c]).val(a)}}else{e.aoPreSearchCols[b].sSearch=a;e.aoPreSearchCols[b].bRegex=c;e.aoPreSearchCols[b].bSmart=d;M(e,e.oPreviousSearch,1)}}};this.fnSettings=function(){return A(this[o.iApiIndex])};this.fnVersionCheck=o.fnVersionCheck;this.fnSort=function(a){var b=A(this[o.iApiIndex]);b.aaSorting=a;R(b)};this.fnSortListener=function(a,b,c){ga(A(this[o.iApiIndex]),a,b,c)};this.fnAddData=function(a, +b){if(a.length===0)return[];var c=[],d,f=A(this[o.iApiIndex]);if(typeof a[0]=="object")for(var e=0;e<a.length;e++){d=v(f,a[e]);if(d==-1)return c;c.push(d)}else{d=v(f,a);if(d==-1)return c;c.push(d)}f.aiDisplay=f.aiDisplayMaster.slice();if(typeof b=="undefined"||b)ba(f);return c};this.fnDeleteRow=function(a,b,c){var d=A(this[o.iApiIndex]);a=typeof a=="object"?U(d,a):a;var f=d.aoData.splice(a,1),e=i.inArray(a,d.aiDisplay);d.asDataSearch.splice(e,1);ra(d.aiDisplayMaster,a);ra(d.aiDisplay,a);typeof b== +"function"&&b.call(this,d,f);if(d._iDisplayStart>=d.aiDisplay.length){d._iDisplayStart-=d._iDisplayLength;if(d._iDisplayStart<0)d._iDisplayStart=0}if(typeof c=="undefined"||c){E(d);C(d)}return f};this.fnClearTable=function(a){var b=A(this[o.iApiIndex]);ia(b);if(typeof a=="undefined"||a)C(b)};this.fnOpen=function(a,b,c){var d=A(this[o.iApiIndex]);this.fnClose(a);var f=p.createElement("tr"),e=p.createElement("td");f.appendChild(e);e.className=c;e.colSpan=X(d);if(typeof b.jquery!="undefined"||typeof b== +"object")e.appendChild(b);else e.innerHTML=b;b=i("tr",d.nTBody);i.inArray(a,b)!=-1&&i(f).insertAfter(a);d.aoOpenRows.push({nTr:f,nParent:a});return f};this.fnClose=function(a){for(var b=A(this[o.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a){(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr);b.aoOpenRows.splice(c,1);return 0}return 1};this.fnGetData=function(a,b){var c=A(this[o.iApiIndex]);if(typeof a!="undefined"){a=typeof a=="object"?U(c,a):a;if(typeof b!= +"undefined")return H(c,a,b,"");return typeof c.aoData[a]!="undefined"?c.aoData[a]._aData:null}return aa(c)};this.fnGetNodes=function(a){var b=A(this[o.iApiIndex]);if(typeof a!="undefined")return typeof b.aoData[a]!="undefined"?b.aoData[a].nTr:null;return $(b)};this.fnGetPosition=function(a){var b=A(this[o.iApiIndex]),c=a.nodeName.toUpperCase();if(c=="TR")return U(b,a);else if(c=="TD"||c=="TH"){c=U(b,a.parentNode);for(var d=Q(b,c),f=0;f<b.aoColumns.length;f++)if(d[f]==a)return[c,pa(b,f),f]}return null}; +this.fnUpdate=function(a,b,c,d,f){var e=A(this[o.iApiIndex]);b=typeof b=="object"?U(e,b):b;if(i.isArray(a)&&typeof a=="object"){e.aoData[b]._aData=a.slice();for(c=0;c<e.aoColumns.length;c++)this.fnUpdate(H(e,b,c),b,c,false,false)}else if(typeof a=="object"){e.aoData[b]._aData=i.extend(true,{},a);for(c=0;c<e.aoColumns.length;c++)this.fnUpdate(H(e,b,c),b,c,false,false)}else{a=a;N(e,b,c,a);if(e.aoColumns[c].fnRender!==null){a=e.aoColumns[c].fnRender({iDataRow:b,iDataColumn:c,aData:e.aoData[b]._aData, +oSettings:e});e.aoColumns[c].bUseRendered&&N(e,b,c,a)}if(e.aoData[b].nTr!==null)Q(e,b)[c].innerHTML=a}c=i.inArray(b,e.aiDisplay);e.asDataSearch[c]=na(e,da(e,b,"filter"));if(typeof f=="undefined"||f)ca(e);if(typeof d=="undefined"||d)ba(e);return 0};this.fnSetColumnVis=function(a,b,c){var d=A(this[o.iApiIndex]),f,e;e=d.aoColumns.length;var h,j;if(d.aoColumns[a].bVisible!=b){if(b){for(f=j=0;f<a;f++)d.aoColumns[f].bVisible&&j++;j=j>=X(d);if(!j)for(f=a;f<e;f++)if(d.aoColumns[f].bVisible){h=f;break}f=0; +for(e=d.aoData.length;f<e;f++)if(d.aoData[f].nTr!==null)j?d.aoData[f].nTr.appendChild(d.aoData[f]._anHidden[a]):d.aoData[f].nTr.insertBefore(d.aoData[f]._anHidden[a],Q(d,f)[h])}else{f=0;for(e=d.aoData.length;f<e;f++)if(d.aoData[f].nTr!==null){h=Q(d,f)[a];d.aoData[f]._anHidden[a]=h;h.parentNode.removeChild(h)}}d.aoColumns[a].bVisible=b;L(d,d.aoHeader);d.nTFoot&&L(d,d.aoFooter);f=0;for(e=d.aoOpenRows.length;f<e;f++)d.aoOpenRows[f].nTr.colSpan=X(d);if(typeof c=="undefined"||c){ca(d);C(d)}sa(d)}};this.fnPageChange= +function(a,b){var c=A(this[o.iApiIndex]);ja(c,a);E(c);if(typeof b=="undefined"||b)C(c)};this.fnDestroy=function(){var a=A(this[o.iApiIndex]),b=a.nTableWrapper.parentNode,c=a.nTBody,d,f;a.bDestroying=true;d=0;for(f=a.aoColumns.length;d<f;d++)a.aoColumns[d].bVisible===false&&this.fnSetColumnVis(d,true);i(a.nTableWrapper).find("*").andSelf().unbind(".DT");i("tbody>tr>td."+a.oClasses.sRowEmpty,a.nTable).parent().remove();if(a.nTable!=a.nTHead.parentNode){i(">thead",a.nTable).remove();a.nTable.appendChild(a.nTHead)}if(a.nTFoot&& +a.nTable!=a.nTFoot.parentNode){i(">tfoot",a.nTable).remove();a.nTable.appendChild(a.nTFoot)}a.nTable.parentNode.removeChild(a.nTable);i(a.nTableWrapper).remove();a.aaSorting=[];a.aaSortingFixed=[];T(a);i($(a)).removeClass(a.asStripClasses.join(" "));if(a.bJUI){i("th",a.nTHead).removeClass([o.oStdClasses.sSortable,o.oJUIClasses.sSortableAsc,o.oJUIClasses.sSortableDesc,o.oJUIClasses.sSortableNone].join(" "));i("th span."+o.oJUIClasses.sSortIcon,a.nTHead).remove();i("th",a.nTHead).each(function(){var e= +i("div."+o.oJUIClasses.sSortJUIWrapper,this),h=e.contents();i(this).append(h);e.remove()})}else i("th",a.nTHead).removeClass([o.oStdClasses.sSortable,o.oStdClasses.sSortableAsc,o.oStdClasses.sSortableDesc,o.oStdClasses.sSortableNone].join(" "));a.nTableReinsertBefore?b.insertBefore(a.nTable,a.nTableReinsertBefore):b.appendChild(a.nTable);d=0;for(f=a.aoData.length;d<f;d++)a.aoData[d].nTr!==null&&c.appendChild(a.aoData[d].nTr);if(a.oFeatures.bAutoWidth===true)a.nTable.style.width=u(a.sDestroyWidth); +i(">tr:even",c).addClass(a.asDestoryStrips[0]);i(">tr:odd",c).addClass(a.asDestoryStrips[1]);d=0;for(f=D.length;d<f;d++)D[d]==a&&D.splice(d,1);a=null};this.fnAdjustColumnSizing=function(a){var b=A(this[o.iApiIndex]);ca(b);if(typeof a=="undefined"||a)this.fnDraw(false);else if(b.oScroll.sX!==""||b.oScroll.sY!=="")this.oApi._fnScrollDraw(b)};for(var ua in o.oApi)if(ua)this[ua]=r(ua);this.oApi._fnExternApiFunc=r;this.oApi._fnInitalise=s;this.oApi._fnInitComplete=w;this.oApi._fnLanguageProcess=y;this.oApi._fnAddColumn= +G;this.oApi._fnColumnOptions=x;this.oApi._fnAddData=v;this.oApi._fnCreateTr=z;this.oApi._fnGatherData=Y;this.oApi._fnBuildHead=V;this.oApi._fnDrawHead=L;this.oApi._fnDraw=C;this.oApi._fnReDraw=ba;this.oApi._fnAjaxUpdate=za;this.oApi._fnAjaxUpdateDraw=Aa;this.oApi._fnAddOptionsHtml=xa;this.oApi._fnFeatureHtmlTable=Fa;this.oApi._fnScrollDraw=Ia;this.oApi._fnAjustColumnSizing=ca;this.oApi._fnFeatureHtmlFilter=Da;this.oApi._fnFilterComplete=M;this.oApi._fnFilterCustom=Ma;this.oApi._fnFilterColumn=La; +this.oApi._fnFilter=Ka;this.oApi._fnBuildSearchArray=ka;this.oApi._fnBuildSearchRow=na;this.oApi._fnFilterCreateSearch=la;this.oApi._fnDataToSearch=ma;this.oApi._fnSort=R;this.oApi._fnSortAttachListener=ga;this.oApi._fnSortingClasses=T;this.oApi._fnFeatureHtmlPaginate=Ha;this.oApi._fnPageChange=ja;this.oApi._fnFeatureHtmlInfo=Ga;this.oApi._fnUpdateInfo=Na;this.oApi._fnFeatureHtmlLength=Ca;this.oApi._fnFeatureHtmlProcessing=Ea;this.oApi._fnProcessingDisplay=K;this.oApi._fnVisibleToColumnIndex=Ja;this.oApi._fnColumnIndexToVisible= +pa;this.oApi._fnNodeToDataIndex=U;this.oApi._fnVisbleColumns=X;this.oApi._fnCalculateEnd=E;this.oApi._fnConvertToWidth=Oa;this.oApi._fnCalculateColumnWidths=ea;this.oApi._fnScrollingWidthAdjust=Qa;this.oApi._fnGetWidestNode=Pa;this.oApi._fnGetMaxLenString=Ra;this.oApi._fnStringToCss=u;this.oApi._fnArrayCmp=Va;this.oApi._fnDetectType=fa;this.oApi._fnSettingsFromNode=A;this.oApi._fnGetDataMaster=aa;this.oApi._fnGetTrNodes=$;this.oApi._fnGetTdNodes=Q;this.oApi._fnEscapeRegex=oa;this.oApi._fnDeleteIndex= +ra;this.oApi._fnReOrderIndex=Ba;this.oApi._fnColumnOrdering=ha;this.oApi._fnLog=J;this.oApi._fnClearTable=ia;this.oApi._fnSaveState=sa;this.oApi._fnLoadState=Ta;this.oApi._fnCreateCookie=Sa;this.oApi._fnReadCookie=ta;this.oApi._fnDetectHeader=W;this.oApi._fnGetUniqueThs=S;this.oApi._fnScrollBarWidth=Ua;this.oApi._fnApplyToChildren=P;this.oApi._fnMap=n;this.oApi._fnGetRowData=da;this.oApi._fnGetCellData=H;this.oApi._fnSetCellData=N;this.oApi._fnGetObjectDataFn=Z;this.oApi._fnSetObjectDataFn=ya;var va= +this;return this.each(function(){var a=0,b,c,d,f;a=0;for(b=D.length;a<b;a++){if(D[a].nTable==this)if(typeof g=="undefined"||typeof g.bRetrieve!="undefined"&&g.bRetrieve===true)return D[a].oInstance;else if(typeof g.bDestroy!="undefined"&&g.bDestroy===true){D[a].oInstance.fnDestroy();break}else{J(D[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrieve to true. Alternatively, to destory the old table and create a new one, set bDestroy to true (note that a lot of changes to the configuration can be made through the API which is usually much faster)."); +return}if(D[a].sTableId!==""&&D[a].sTableId==this.getAttribute("id")){D.splice(a,1);break}}var e=new l;D.push(e);var h=false,j=false;a=this.getAttribute("id");if(a!==null){e.sTableId=a;e.sInstance=a}else e.sInstance=o._oExternConfig.iNextUnique++;if(this.nodeName.toLowerCase()!="table")J(e,0,"Attempted to initialise DataTables on a node which is not a table: "+this.nodeName);else{e.nTable=this;e.oInstance=va.length==1?va:i(this).dataTable();e.oApi=va.oApi;e.sDestroyWidth=i(this).width();if(typeof g!= +"undefined"&&g!==null){e.oInit=g;n(e.oFeatures,g,"bPaginate");n(e.oFeatures,g,"bLengthChange");n(e.oFeatures,g,"bFilter");n(e.oFeatures,g,"bSort");n(e.oFeatures,g,"bInfo");n(e.oFeatures,g,"bProcessing");n(e.oFeatures,g,"bAutoWidth");n(e.oFeatures,g,"bSortClasses");n(e.oFeatures,g,"bServerSide");n(e.oFeatures,g,"bDeferRender");n(e.oScroll,g,"sScrollX","sX");n(e.oScroll,g,"sScrollXInner","sXInner");n(e.oScroll,g,"sScrollY","sY");n(e.oScroll,g,"bScrollCollapse","bCollapse");n(e.oScroll,g,"bScrollInfinite", +"bInfinite");n(e.oScroll,g,"iScrollLoadGap","iLoadGap");n(e.oScroll,g,"bScrollAutoCss","bAutoCss");n(e,g,"asStripClasses");n(e,g,"fnPreDrawCallback");n(e,g,"fnRowCallback");n(e,g,"fnHeaderCallback");n(e,g,"fnFooterCallback");n(e,g,"fnCookieCallback");n(e,g,"fnInitComplete");n(e,g,"fnServerData");n(e,g,"fnFormatNumber");n(e,g,"aaSorting");n(e,g,"aaSortingFixed");n(e,g,"aLengthMenu");n(e,g,"sPaginationType");n(e,g,"sAjaxSource");n(e,g,"sAjaxDataProp");n(e,g,"iCookieDuration");n(e,g,"sCookiePrefix"); +n(e,g,"sDom");n(e,g,"bSortCellsTop");n(e,g,"oSearch","oPreviousSearch");n(e,g,"aoSearchCols","aoPreSearchCols");n(e,g,"iDisplayLength","_iDisplayLength");n(e,g,"bJQueryUI","bJUI");n(e.oLanguage,g,"fnInfoCallback");typeof g.fnDrawCallback=="function"&&e.aoDrawCallback.push({fn:g.fnDrawCallback,sName:"user"});typeof g.fnStateSaveCallback=="function"&&e.aoStateSave.push({fn:g.fnStateSaveCallback,sName:"user"});typeof g.fnStateLoadCallback=="function"&&e.aoStateLoad.push({fn:g.fnStateLoadCallback,sName:"user"}); +if(e.oFeatures.bServerSide&&e.oFeatures.bSort&&e.oFeatures.bSortClasses)e.aoDrawCallback.push({fn:T,sName:"server_side_sort_classes"});else e.oFeatures.bDeferRender&&e.aoDrawCallback.push({fn:T,sName:"defer_sort_classes"});if(typeof g.bJQueryUI!="undefined"&&g.bJQueryUI){e.oClasses=o.oJUIClasses;if(typeof g.sDom=="undefined")e.sDom='<"H"lfr>t<"F"ip>'}if(e.oScroll.sX!==""||e.oScroll.sY!=="")e.oScroll.iBarWidth=Ua();if(typeof g.iDisplayStart!="undefined"&&typeof e.iInitDisplayStart=="undefined"){e.iInitDisplayStart= +g.iDisplayStart;e._iDisplayStart=g.iDisplayStart}if(typeof g.bStateSave!="undefined"){e.oFeatures.bStateSave=g.bStateSave;Ta(e,g);e.aoDrawCallback.push({fn:sa,sName:"state_save"})}if(typeof g.iDeferLoading!="undefined"){e.bDeferLoading=true;e._iRecordsTotal=g.iDeferLoading;e._iRecordsDisplay=g.iDeferLoading}if(typeof g.aaData!="undefined")j=true;if(typeof g!="undefined"&&typeof g.aoData!="undefined")g.aoColumns=g.aoData;if(typeof g.oLanguage!="undefined")if(typeof g.oLanguage.sUrl!="undefined"&&g.oLanguage.sUrl!== +""){e.oLanguage.sUrl=g.oLanguage.sUrl;i.getJSON(e.oLanguage.sUrl,null,function(t){y(e,t,true)});h=true}else y(e,g.oLanguage,false)}else g={};if(typeof g.asStripClasses=="undefined"){e.asStripClasses.push(e.oClasses.sStripOdd);e.asStripClasses.push(e.oClasses.sStripEven)}c=false;d=i(">tbody>tr",this);a=0;for(b=e.asStripClasses.length;a<b;a++)if(d.filter(":lt(2)").hasClass(e.asStripClasses[a])){c=true;break}if(c){e.asDestoryStrips=["",""];if(i(d[0]).hasClass(e.oClasses.sStripOdd))e.asDestoryStrips[0]+= +e.oClasses.sStripOdd+" ";if(i(d[0]).hasClass(e.oClasses.sStripEven))e.asDestoryStrips[0]+=e.oClasses.sStripEven;if(i(d[1]).hasClass(e.oClasses.sStripOdd))e.asDestoryStrips[1]+=e.oClasses.sStripOdd+" ";if(i(d[1]).hasClass(e.oClasses.sStripEven))e.asDestoryStrips[1]+=e.oClasses.sStripEven;d.removeClass(e.asStripClasses.join(" "))}c=[];var k;a=this.getElementsByTagName("thead");if(a.length!==0){W(e.aoHeader,a[0]);c=S(e)}if(typeof g.aoColumns=="undefined"){k=[];a=0;for(b=c.length;a<b;a++)k.push(null)}else k= +g.aoColumns;a=0;for(b=k.length;a<b;a++){if(typeof g.saved_aoColumns!="undefined"&&g.saved_aoColumns.length==b){if(k[a]===null)k[a]={};k[a].bVisible=g.saved_aoColumns[a].bVisible}G(e,c?c[a]:null)}if(typeof g.aoColumnDefs!="undefined")for(a=g.aoColumnDefs.length-1;a>=0;a--){var m=g.aoColumnDefs[a].aTargets;i.isArray(m)||J(e,1,"aTargets must be an array of targets, not a "+typeof m);c=0;for(d=m.length;c<d;c++)if(typeof m[c]=="number"&&m[c]>=0){for(;e.aoColumns.length<=m[c];)G(e);x(e,m[c],g.aoColumnDefs[a])}else if(typeof m[c]== +"number"&&m[c]<0)x(e,e.aoColumns.length+m[c],g.aoColumnDefs[a]);else if(typeof m[c]=="string"){b=0;for(f=e.aoColumns.length;b<f;b++)if(m[c]=="_all"||i(e.aoColumns[b].nTh).hasClass(m[c]))x(e,b,g.aoColumnDefs[a])}}if(typeof k!="undefined"){a=0;for(b=k.length;a<b;a++)x(e,a,k[a])}a=0;for(b=e.aaSorting.length;a<b;a++){if(e.aaSorting[a][0]>=e.aoColumns.length)e.aaSorting[a][0]=0;k=e.aoColumns[e.aaSorting[a][0]];if(typeof e.aaSorting[a][2]=="undefined")e.aaSorting[a][2]=0;if(typeof g.aaSorting=="undefined"&& +typeof e.saved_aaSorting=="undefined")e.aaSorting[a][1]=k.asSorting[0];c=0;for(d=k.asSorting.length;c<d;c++)if(e.aaSorting[a][1]==k.asSorting[c]){e.aaSorting[a][2]=c;break}}T(e);a=i(">thead",this);if(a.length===0){a=[p.createElement("thead")];this.appendChild(a[0])}e.nTHead=a[0];a=i(">tbody",this);if(a.length===0){a=[p.createElement("tbody")];this.appendChild(a[0])}e.nTBody=a[0];a=i(">tfoot",this);if(a.length>0){e.nTFoot=a[0];W(e.aoFooter,e.nTFoot)}if(j)for(a=0;a<g.aaData.length;a++)v(e,g.aaData[a]); +else Y(e);e.aiDisplay=e.aiDisplayMaster.slice();e.bInitialised=true;h===false&&s(e)}})}})(jQuery,window,document); diff --git a/koha-tmpl/opac-tmpl/prog/images/datatables/back_disabled.jpg b/koha-tmpl/opac-tmpl/prog/images/datatables/back_disabled.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1e73a546e3609636f9cf4c543c2a4fe4050866c3 GIT binary patch literal 612 zcmex=<NpH&0WUXCHwH!~28I+MWcdGvLC~c%IlGd9k%5H)B*^gp9Rr_ZN`6u*L&^c5 z2;=|T3 at r?d!~-S-V1@&zb|ywfpezu>C5UDGKfoZ!!63{a%*-grz$D1XEXer(2tyUn z+02YUSHb}sD?0}l&^EXLguy7lz`(-H!phDIlVN0HVHIR%V-ON%S2Pq6HFFG{Xryc+ zmRQ($@S#&sld*HEn>dFcBLmQ_$YwDLDjGT#PW*q1fd^<YlOVGogFVCRyQwLwf|@66 ze!$4fpt!)cj7zNLKSN?_SjIEf$Z0nVqZh4{&j?Wu4PU>^;oX+iLI)z|@;wX;U8Xr> zT8Qgxn;R!Cottl}#(8Ri${a3d=J*$R5qBRbK9bRJe*4BYwq9(uIM4mLS9%TSY?*y6 zE==owYH)vf>dq6(Uzum+IyVJqc3N&dRPD57vW(=l(=(DZ-K_<Unt1pe8#qknGCi3V zkh;vl;B4~gY1f{Kz2M5sJrOKuSm0ZhaMrL}#<_9H6t<5or9~0qKc;W}wfIQk>!LSx zwPk@>bN at 4B-OI9gCf>Wc_;CDAS%c at BJZ}k<t>BlbDz~@y-*&Y^_U+@};q`xNUthN} On^Cj9W}Eu@|2F})$f79# literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/datatables/back_enabled.jpg b/koha-tmpl/opac-tmpl/prog/images/datatables/back_enabled.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a6d764c79c7a2047b6bf65bf9d96fcafd5161e38 GIT binary patch literal 807 zcmex=<NpH&0WUXCHwH!~28I+MWcdGvLC~c%IlGd9k%5H)B*^gp9Rr_ZN`6u*L&^c5 z2;=|T3 at r?d!~-S-V1@&zb|ywfpezu>C5UDGKfoZ!!63{a%*-grz$D1XEXer(2*U&h z1}0{pBN2d|gO!bok%5r~RhW^Pm5qg+Lx6#Sm5Gs^od+h%$i&RTD#*spplB#0EW!~u z(MZ`u)XXulu<_tSr=TWdXR%Z_aiE1jZ7eM8Fl&IpCkWK1$Y$s$#2&a&N#sM~M5iWU z<^Q)Bc$gW1&SMs2uxGfw`}E06etb^r9k|jMc at Dlk(IlSD-Wwx*G{%4ThHhR%HnTsw zbu3z!=BtbC=-In5f5nt;je{+vrKZdWckk$U`c^FEYC6}Jn=<Phg&RGxWowtu+j4vL zuDrGP=1IPrb~kp*>lG)17QB>6z3khm7PHhg<-pEGSO0F>VA}N6`w53!8pr$>MbUW| zME<s?dezw;U%dR;`Kd)lCauvOXRNpVXgK`4pX=Sp- at CZj9x15&y*j<b<JPA<K_*#K z<@>sFn=(%w+^5v0yp7Lmb+~3PpI4(#G~bQ$y_;t)oo+U5`bnSHZcn){CH~m7Ys2rz z2!R at xgGrCtcPz?eOPOzKr2P26p~(mTGjR1-c<x%~cJ0>3?psA>uUGsyt|R2Ts3~!B zN71DGSrW%W*`w8#2{O$LX)%%8*<4Ycyr;tN(Hm<XHM0xJ?{xF0EskFCh5u=&<iulr zYNyl=#<wqXD&+4u8oF^$)m7<lY at VgXk9azsKIKz?vp4^)yx{evPw)J-Dth+P<;w$q z`@Q9}`(-Xi+_IiGtB&jWay`d}j~$NpR at hm5{cf*szhAZWsp!3Z`)}>8|M=_HtvR>P P+Rcr(b5Xx$|NkZcT0jT? literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/datatables/forward_disabled.jpg b/koha-tmpl/opac-tmpl/prog/images/datatables/forward_disabled.jpg new file mode 100644 index 0000000000000000000000000000000000000000..28a9dc53fa232919299ac980dc9b61167c1868bd GIT binary patch literal 635 zcmex=<NpH&0WUXCHwH!~28I+MWcdGvLC~c%IlGd9k%5H)B*^gp9Rr_ZN`6u*L&^c5 z2;=|T3 at r?d!~-S-V1@&zb|ywfpezu>C5UDGKfoZ!!63{a%*-grz$D1XEXer(2tySE z1JEp>E8&2Nm4%I+g9~UMTnNHo6kuRrVP;|B;)Y2uGBL9Vva&G<iLfgg3UfFHPBdy# zHW3vwODt at B=oDn^oa!bn$jHFNjA9g{prWDU#Q(P#c!1(eg3N*p_6)E5E7rbHvEH7V z8#+gHc2rxYci=nCmS=BPhUq>lzGLeh=CM*_u2I6%$1L~6;-1yGa|?*Fva<AVW}f$w zM|jiv%AS4aZbfpP)?S?%8?6+<6*?uQG at xF)s3 at 1Q<(tn>vCW+<XI6GdMB6yB9$3U& z#>Av>{Flt>+*?d?iZ`9)^O?_H|D3t8;Og6lD<#WHQvW(mo1ETsD>A at mr8@sqg(?1R z%d at qrmWLWmIn1#pQuo}{brVW*C8t%EDXbOt_DabwXgGW3;wDX1;~7hWrYL+ZX=qre z&-y^2q0zm?-FJb#(AWJTHOJ-3`S`D|JEhzC{KvY_h0kZinXP-?w!g_L at p#JQO^!z$ mYCgVwS7#SryXs@?>&L&t^Z(SozHVt~@Z#>58}s)6zX<@qORf(9 literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/datatables/forward_enabled.jpg b/koha-tmpl/opac-tmpl/prog/images/datatables/forward_enabled.jpg new file mode 100644 index 0000000000000000000000000000000000000000..598c075f13ab0e4bbe05a4eeea7cf777ba73cf03 GIT binary patch literal 852 zcmex=<NpH&0WUXCHwH!~28I+MWcdGvLC~c%IlGd9k%5H)B*^gp9Rr_ZN`6u*L&^c5 z2;=|T3 at r?d!~-S-V1@&zb|ywfpezu>C5UDGKfoZ!!63{a%*-grz$D1XEXer(2tywO z0~0eN(3Nn&%Fe>Z!NthH$ciG&$iU3P%Em6hz`z1zu=B#yGcqx=2(q#<2(fb*3M-3< zDh5t8G7&R#Oe}1C=oHjs?40T*F37+LbR`oj+(bq}CT0c}Rz*W0Hg?Cv#)(EB0yioN zi~PUEzyov)lOVGogFVA5dn3uE%Z<*rn&ugY^FIG9<<=87L*?mOy^~u`Rq(Eg+UDw^ z@^Uh}zJ$t~P2YpRT#sm2p`oEt8zJ-EBRfY;>b?DxZo!24Z)Q(O&}!Mbt}27`dKa(x zr)AHkZg5MjKa&4$syaupXWNXgp32dQs<o<XGr#5u9@=#E+?+!}FI~Pa)LWslJ}B36 z`Lb3YheKCCm%VOu;VpX6(0MkYSk}6t at aOKz+;_*D4{7|~^5)^QORgNty2^@M51##X zueaWLX7+9e=RH;{oZr5)jkOooU8VU}TQps%p>_rj-?|M=Q9pN^hZg^mV7=UWs>}D5 z$40(ME7Q1T4h8p}ZJ8O!G-Xk84;P~#ci!&o`A5I3kG at gLm*VlJbn%kvSqIh?3Y?HQ zAX0NL>XIkpf=MN83*!%}9-aN5)p7^py2Am>F9gW&pFSp#V0dxX#ZPW;UoD(gaI at 8E z(rNQz1DBIiM13!LtZ|85lHB@$wW~n0fhRz-$?R&m{@z;uI}N|35As;}zdXB<<FOu# z{FTp-PcAia6ML~>I#+N1k=r*G-&mI78vJ_Ezs!yIV%J}l7d*c9>7Bn;xyLT84V&`$ z at 9WMTAJ6DZyR)~=FS6P2e3MDv7lHB>{C&1H^7EJ9PIf=EdUwUYtGE9%$X9(m*ZWLf M_rC2^{;K~s0TRp{r2qf` literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/datatables/sort_asc.png b/koha-tmpl/opac-tmpl/prog/images/datatables/sort_asc.png new file mode 100644 index 0000000000000000000000000000000000000000..a56d0e21902ce620cd57f87fa58a6d3e804135cf GIT binary patch literal 263 zcmeAS at N?(olHy`uVBq!ia0vp^!XV7S3?yCqj{O5tEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i>l2Ka=y{`vF&<?H{u_y6mi^6%Qs z|I63>J9*~+_wWBdfBFCW_y37A{>@tOZ^^2EJ(K_a|Nno&o$%d2jr=7+e!)O45 at 5J; zXU0OHl&hzUV at SoVE9Xw~GAQscA1s)^?0*rXqM}DeLv7?|BU8z at Q<ntt9<njnJ|j`Y znD at ZlWoHa-oW7$XVs$3z>COGupVzP9Hek5&L+Gnl%BD>~0~tJB{an^LB{Ts5b0m7= literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/datatables/sort_asc_disabled.png b/koha-tmpl/opac-tmpl/prog/images/datatables/sort_asc_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..b7e621ef1c68da839ce077cec6e201a55c1ba168 GIT binary patch literal 252 zcmeAS at N?(olHy`uVBq!ia0vp^!XV7S3?yCqj{O5tEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i=)2l#}z{`>du$&)AV- at pIy<HzUE zpI^Ot_51hlzkmNec<|ufy?c)zKfZJ4&j0`aCog>d9;k)4B*-rq$b|z2+ZRf0KnW*L z7srr_TUXBQ7Ge<Kak=PnB>V6G?@}f$7k6Jhw{qGm$-QDzD`qrDaZ3s$b2XF;fBBPU nqjNDy&Nw~puHFA+-v&m8`?>-yUFVHK{$ucT^>bP0l+XkKhw^g= literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/datatables/sort_both.png b/koha-tmpl/opac-tmpl/prog/images/datatables/sort_both.png new file mode 100644 index 0000000000000000000000000000000000000000..839ac4bb5b0b414834c950de9deafff6dd94ed2d GIT binary patch literal 282 zcmeAS at N?(olHy`uVBq!ia0vp^!XV7S3?yCqj{O5tEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i=)2l#}z{`>du$&)AV- at pIy<HzUE zpI^Ot_51hlzkmNec<|ufy?c)zKfZJ4&j0`aCog>d9;k)4B*-rq$b|z2+ZRf0K#2rT z7srr_TRjsz`4|*ASOSl%eg6Ob+(JtRwX|O at S}a^IES<M^Rar)~R7{gT(8t-3AepQp zDW<l1NyH(qlCXQ0 at AfT`xZ2rtb0gcPuhQK|E$f?fe^;k=XM|b({WbrT_5p at zx%{&^ T>QC<i+Qs1M>gTe~DWM4fR9b+X literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/datatables/sort_desc.png b/koha-tmpl/opac-tmpl/prog/images/datatables/sort_desc.png new file mode 100644 index 0000000000000000000000000000000000000000..90b295159df995329b3a84340d32761f3d1dbade GIT binary patch literal 260 zcmeAS at N?(olHy`uVBq!ia0vp^!XV7S3?yCqj{O5tEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i>l2Ka=y{`vF&<?H{u_y6mi^6%Qs z|I63>J9*~+_wWBdfBFCW_y37A{>@tOZ^^2EJ(K_a|Nno&o$%d2jr=7+e!)O45 at 5J; zXU0OHl#{26V at SoVqz8vtc$~v}dc~O{CLEF2anNavMpdMP)0v(X&o(k0opIq!LdvtJ wj~up7 at 0`wiSoe($&y07EkGxK6U|?nlJSz0{?wJWUfu=Edy85}Sb4q9e0C9MGu>b%7 literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/datatables/sort_desc_disabled.png b/koha-tmpl/opac-tmpl/prog/images/datatables/sort_desc_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..2409653dc94cd21a281a31c0e3819323b84704b7 GIT binary patch literal 251 zcmeAS at N?(olHy`uVBq!ia0vp^!XV7S3?yCqj{O5tEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i=)2l#}z{`>du$&)AV- at pIy<HzUE zpI^Ot_51hlzkmNec<|ufy?c)zKfZJ4&j0`aCog>d9;k)4B*-rq$b|z2+ZRf0KnX`r z7srr_TS*TNvhX;E^>j)zMNBv%VR68zN24n8K+>5N&kUJbBQCy4c=qgBiu3mAQ)hD? n)_oJhGvi(If!Apb49pB3GXz|UGFKJ=4P)?h^>bP0l+XkK*57ji literal 0 HcmV?d00001 -- 1.7.5.4 From julian.maurice at biblibre.com Fri Sep 2 17:01:39 2011 From: julian.maurice at biblibre.com (Julian Maurice) Date: Fri, 2 Sep 2011 17:01:39 +0200 Subject: [Koha-patches] [PATCH] Bug 6838: Add pagination and filtering on subscriptions table Message-ID: <1314975699-27290-1-git-send-email-julian.maurice@biblibre.com> Use dataTables plugin --- C4/Serials.pm | 6 ++- .../prog/en/modules/serials/serials-home.tt | 37 ++++++++++++++------ 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 8aa6ebc..51da389 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -613,8 +613,10 @@ sub GetSubscriptions { while ( my $line = $sth->fetchrow_hashref ) { if ( $previousbiblio eq $line->{biblionumber} ) { - $line->{title} = ""; - $line->{issn} = ""; + # Disabled for sorting and filtering on issn and title + # to work on serials-home.pl + #$line->{title} = ""; + #$line->{issn} = ""; } else { $previousbiblio = $line->{biblionumber}; $odd = -$odd; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt index 7753fd3..6fbf31f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt @@ -1,18 +1,21 @@ [% INCLUDE 'doc-head-open.inc' %] <title>Koha › Serials [% biblionumber %] + [% INCLUDE 'doc-head-close.inc' %] - + + @@ -73,7 +76,7 @@ Serials updated : [% IF ( done_searched ) %]

    Serials subscriptions

    - +
    @@ -85,9 +88,21 @@ Serials updated : [% IF ( routing ) %] [% END %] - + + + + + + + + + + + + + [% FOREACH subscription IN subscriptions %] [% UNLESS ( loop.odd ) %] -- 1.7.5.4 From Katrin.Fischer.83 at web.de Fri Sep 2 20:41:07 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Fri, 2 Sep 2011 20:41:07 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 6458 - incorrect parsing result in translation processing Message-ID: <1314988867-6737-1-git-send-email-Katrin.Fischer.83@web.de> From: Owen Leonard Fixing improperly nested template logic inside HTML tags in clone circulation rules form. Signed-off-by: Katrin Fischer --- .../prog/en/modules/admin/clone-rules.tt | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt index c9d60c1..7bbe27b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt @@ -38,7 +38,11 @@ [% IF ( tobranch ) %][% END %] @@ -52,7 +56,11 @@ [% IF ( frombranch ) %][% END %] -- 1.7.4.1 From Katrin.Fischer.83 at web.de Fri Sep 2 21:17:55 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Fri, 2 Sep 2011 21:17:55 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 6458 - incorrect parsing result in translation processing / branches Message-ID: <1314991075-8277-1-git-send-email-Katrin.Fischer.83@web.de> From: Owen Leonard Correction for branch admin template stops tag attribute markup from being passed to the template directly in favor of using template logic. Signed-off-by: Katrin Fischer --- admin/branches.pl | 6 +++--- .../prog/en/modules/admin/branches.tt | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/admin/branches.pl b/admin/branches.pl index d6388f5..12c49e2 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -254,15 +254,15 @@ sub editbranchform { # # We export a "categoryloop" array to the template, each element of which # contains separate 'categoryname', 'categorycode', 'codedescription', and - # 'checked' fields. The $checked field is either '' or 'checked="checked"' + # 'checked' fields. The $checked field is either empty or 1' my $catinfo = GetBranchCategory(); my @categoryloop = (); foreach my $cat (@$catinfo) { - my $checked = ""; + my $checked; my $tmp = quotemeta( $cat->{'categorycode'} ); if ( grep { /^$tmp$/ } @{ $data->{'categories'} } ) { - $checked = "checked=\"checked\""; + $checked = 1; } push @categoryloop, { categoryname => $cat->{'categoryname'}, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt index 42ddb52..1107624 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt @@ -99,7 +99,12 @@
      [% FOREACH categoryloo IN categoryloop %]
    1. - [% categoryloo.codedescription %] + [% IF ( categoryloo.checked ) %] + + [% ELSE %] + + [% END %] + [% categoryloo.codedescription %]
    2. [% END %]
    -- 1.7.4.1 From chrisc at catalyst.net.nz Mon Sep 5 01:06:59 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Mon, 5 Sep 2011 11:06:59 +1200 Subject: [Koha-patches] [PATCH] Bug 5459 - Holds not being shifted when merging biblios Message-ID: <1315177619-22332-1-git-send-email-chrisc@catalyst.net.nz> Holds are now shifted and reordered by date placed. --- C4/Reserves.pm | 32 ++++++++++++++++++++++++++++++++ cataloguing/merge.pl | 5 +++++ 2 files changed, 37 insertions(+), 0 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 8373840..58ddbfe 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -3,6 +3,7 @@ package C4::Reserves; # Copyright 2000-2002 Katipo Communications # 2006 SAN Ouest Provence # 2007-2010 BibLibre Paul POULAIN +# 2011 Catalyst IT # # This file is part of Koha. # @@ -121,6 +122,7 @@ BEGIN { &AlterPriority &ToggleLowestPriority ); + @EXPORT_OK = qw( MergeHolds ); } =head2 AddReserve @@ -1794,6 +1796,36 @@ sub _ShiftPriorityByDateAndPriority { return $new_priority; # so the caller knows what priority they wind up receiving } +=head2 MergeHolds + + MergeHolds($dbh,$to_biblio, $from_biblio); + +This shifts the holds from C<$from_biblio> to C<$to_biblio> and reorders them by the date they were placed + +=cut + +sub MergeHolds { + my ($dbh,$to_biblio,$from_biblio) = @_; + my $sth = $dbh->prepare("SELECT count(*) as reservenumber FROM reserves WHERE biblionumber = ?"); + $sth->execute($from_biblio); + if (my $data = $sth->fetchrow_hashref()){ + # holds exist on old record if not we don't need to do anything + $sth = $dbh->prepare("UPDATE reserves SET biblionumber = ? WHERE biblionumber = ?"); + $sth->execute($to_biblio,$from_biblio); + # Reorder by date + $sth = $dbh->prepare("SELECT * FROM reserves WHERE biblionumber = ? ORDER BY reservedate ASC"); + my $upd_sth = $dbh->prepare("UPDATE reserves SET priority = ? WHERE biblionumber = ? AND borrowernumber = ? + AND reservedate = ? AND constrainttype = ? AND (itemnumber = ? or itemnumber is NULL) "); + $sth->execute($to_biblio); + my $priority = 1; + while (my $reserve = $sth->fetchrow_hashref()){ + $upd_sth->execute($priority,$to_biblio,$reserve->{'borrowernumber'},$reserve->{'reservedate'},$reserve->{'constrainttype'},$reserve->{'itemnumber'}); + $priority++; + } + } +} + + =head1 AUTHOR Koha Development Team diff --git a/cataloguing/merge.pl b/cataloguing/merge.pl index cc2d01d..f32991e 100755 --- a/cataloguing/merge.pl +++ b/cataloguing/merge.pl @@ -2,6 +2,7 @@ # Copyright 2009 BibLibre +# Parts Copyright Catalyst IT 2011 # # This file is part of Koha. # @@ -26,6 +27,7 @@ use C4::Auth; use C4::Items; use C4::Biblio; use C4::Serials; +use C4::Reserves qw/MergeHolds/; my $input = new CGI; my @biblionumber = $input->param('biblionumber'); @@ -101,6 +103,8 @@ if ($merge) { # Deleting the other record if (scalar(@errors) == 0) { + # Move holds + MergeHolds($dbh,$tobiblio,$frombiblio); my $error = DelBiblio($frombiblio); push @errors, $error if ($error); } @@ -252,3 +256,4 @@ sub createKey(){ } + -- 1.7.4.1 From robin at catalyst.net.nz Mon Sep 5 02:21:54 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Mon, 5 Sep 2011 12:21:54 +1200 Subject: [Koha-patches] [PATCH] Bug 6129 - [3.4.x] this adds an ISSN to serialssolutions URLs Message-ID: <1315182114-15952-1-git-send-email-robin@catalyst.net.nz> If a URL is a serialssolutions URLs that doesn't already have an ISSN parameter, this adds one on the OPAC. Author: Srdjan Jankovic Author: Robin Sheat --- C4/Biblio.pm | 6 ++++-- basket/basket.pl | 4 ++-- catalogue/detail.pl | 10 ++++++++-- .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 5 ++++- opac/opac-basket.pl | 2 +- opac/opac-detail.pl | 12 ++++++------ 6 files changed, 25 insertions(+), 14 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 808955d..ad9b9f8 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1606,7 +1606,7 @@ sub GetMarcAuthors { =head2 GetMarcUrls - $marcurls = GetMarcUrls($record,$marcflavour); + $marcurls = GetMarcUrls($record,$marcflavour,$issn); Returns arrayref of URLs from MARC data, suitable to pass to tmpl loop. Assumes web resources (not uncommon in MARC21 to omit resource type ind) @@ -1614,7 +1614,7 @@ Assumes web resources (not uncommon in MARC21 to omit resource type ind) =cut sub GetMarcUrls { - my ( $record, $marcflavour ) = @_; + my ( $record, $marcflavour, $issn ) = @_; my @marcurls; for my $field ( $record->field('856') ) { @@ -1624,6 +1624,8 @@ sub GetMarcUrls { } my @urls = $field->subfield('u'); foreach my $url (@urls) { + $url .= "?sid=&ISSN=$issn" + if $issn && ($url =~ m/\bserialssolutions\b/o) && ($url !~ m/\bISSN=/o); my $marcurl; if ( $marcflavour eq 'MARC21' ) { my $s3 = $field->subfield('3'); diff --git a/basket/basket.pl b/basket/basket.pl index 8fc15e4..90c4cf8 100755 --- a/basket/basket.pl +++ b/basket/basket.pl @@ -65,8 +65,8 @@ foreach my $biblionumber ( @bibs ) { my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); - my $marcurlsarray = GetMarcUrls ($record,$marcflavour); - my @items = GetItemsInfo( $biblionumber ); + my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); + my @items = GetItemsInfo( $biblionumber, 'opac' ); my $hasauthors = 0; if($dat->{'author'} || @$marcauthorsarray) { diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 8738737..ac94cc0 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -99,12 +99,19 @@ $template->param( normalized_isbn => $isbn, ); +unless (defined($record)) { + print $query->redirect("/cgi-bin/koha/errors/404.pl"); + exit; +} + +my $dat = &GetBiblioData($biblionumber); + my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); my $marcisbnsarray = GetMarcISBN( $record, $marcflavour ); my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries($record,$marcflavour); -my $marcurlsarray = GetMarcUrls ($record,$marcflavour); +my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); my $subtitle = GetRecordValue('subtitle', $record, $fw); # Get Branches, Itemtypes and Locations @@ -117,7 +124,6 @@ my @items; for my $itm (@all_items) { push @items, $itm unless ( $itm->{itemlost} && GetHideLostItemsPreference($borrowernumber) && !$showallitems); } -my $dat = &GetBiblioData($biblionumber); # get count of holds my ( $holdcount, $holds ) = GetReservesFromBiblionumber($biblionumber,1); diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl index d4f763f..c8d8c3b 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -436,6 +436,7 @@ + @@ -539,7 +540,9 @@ Online Resources: - + + + ?sid=&ISSN= _blank diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index 5e92d15..e56509e 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -67,7 +67,7 @@ foreach my $biblionumber ( @bibs ) { my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); - my $marcurlsarray = GetMarcUrls ($record,$marcflavour); + my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); my @items = &GetItemsLocationInfo( $biblionumber ); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 6345da1..2198bea 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -97,12 +97,12 @@ my $hideitems = 1 if C4::Context->preference('hidelostitems') or scalar(@hiddeni # Hide items if ($hideitems) { for my $itm (@all_items) { - if ( C4::Context->preference('hidelostitems') ) { - push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems; - } else { - push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems; + if ( C4::Context->preference('hidelostitems') ) { + push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems; + } else { + push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems; + } } -} } else { # Or not @items = @all_items; @@ -223,7 +223,7 @@ my $marcisbnsarray = GetMarcISBN ($record,$marcflavour); my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour); my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); -my $marcurlsarray = GetMarcUrls ($record,$marcflavour); +my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); $template->param( -- 1.7.4.1 From cnighswonger at foundations.edu Mon Sep 5 03:12:05 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Sun, 4 Sep 2011 21:12:05 -0400 Subject: [Koha-patches] [PATCH] Bug 6722: Cause build output to appear on the screen In-Reply-To: <1313385599-25436-1-git-send-email-robin@catalyst.net.nz> References: <1313385599-25436-1-git-send-email-robin@catalyst.net.nz> Message-ID: This patch does not apply cleanly to 3.4.x. If it should, please rebase against 3.4.x and resubmit with [3.4.x] in the subject line. Kind Regards, Chris On Mon, Aug 15, 2011 at 1:19 AM, Robin Sheat wrote: > This allows the build information to not be suppressed when using > build-git-snapshot. This makes seeing where problems are substantially > easier. > --- > debian/build-git-snapshot | 9 ++++++++- > 1 files changed, 8 insertions(+), 1 deletions(-) > > diff --git a/debian/build-git-snapshot b/debian/build-git-snapshot > index cd0545a..91552ff 100755 > --- a/debian/build-git-snapshot > +++ b/debian/build-git-snapshot > @@ -58,6 +58,13 @@ sub sys_command_output { > return map { chomp; $_ } <$command_output>; > } > > +sub sys_command_output_screen { > + my ($command) = @_; > + > + print "$command\n" if $debug; > + system($command); > +} > + > sub everything_is_committed { > my $filter; > for ($git_checks) { > @@ -130,7 +137,7 @@ sub build_package { > sys_command_output( qq{git archive --format=tar > --prefix="koha-$newversion/" HEAD | gzip -9 > "../koha_$newversion.tar.gz"} > ); > > my $pdebuildopts = $buildresult ? "--buildresult $buildresult" : ""; > - sys_command_output( "pdebuild $pdebuildopts" ); > + sys_command_output_screen( "pdebuild $pdebuildopts" ); > } > > everything_is_committed() or die "cannot build: uncommited changes"; > -- > 1.7.4.1 > > _______________________________________________ > Koha-patches mailing list > Koha-patches at lists.koha-community.org > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > website : http://www.koha-community.org/ > git : http://git.koha-community.org/ > bugs : http://bugs.koha-community.org/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrisc at catalyst.net.nz Mon Sep 5 03:20:37 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Mon, 5 Sep 2011 13:20:37 +1200 Subject: [Koha-patches] [PATCH] Bug 6722: Cause build output to appear on the screen In-Reply-To: References: <1313385599-25436-1-git-send-email-robin@catalyst.net.nz> Message-ID: <20110905012037.GP23576@rorohiko.wgtn.cat-it.co.nz> * Chris Nighswonger (cnighswonger at foundations.edu) wrote: > This patch does not apply cleanly to 3.4.x. If it should, please rebase > against 3.4.x and resubmit with [3.4.x] in the subject line. > This patch depends on the patches for 6722 being applied first. I think its safe to apply them to the 3.4.x tree, then this one after Chris > Kind Regards, > Chris > > On Mon, Aug 15, 2011 at 1:19 AM, Robin Sheat > wrote: > > This allows the build information to not be suppressed when using > build-git-snapshot. This makes seeing where problems are substantially > easier. > --- > A debian/build-git-snapshot | A A 9 ++++++++- > A 1 files changed, 8 insertions(+), 1 deletions(-) > > diff --git a/debian/build-git-snapshot b/debian/build-git-snapshot > index cd0545a..91552ff 100755 > --- a/debian/build-git-snapshot > +++ b/debian/build-git-snapshot > @@ -58,6 +58,13 @@ sub sys_command_output { > A A return map { chomp; $_ } <$command_output>; > A } > > +sub sys_command_output_screen { > + A A my ($command) = @_; > + > + A A print "$command\n" if $debug; > + A A system($command); > +} > + > A sub everything_is_committed { > A A my $filter; > A A for ($git_checks) { > @@ -130,7 +137,7 @@ sub build_package { > A A sys_command_output( qq{git archive --format=tar > --prefix="koha-$newversion/" HEAD | gzip -9 > > "../koha_$newversion.tar.gz"} ); > > A A my $pdebuildopts = $buildresult ? "--buildresult $buildresult" : > ""; > - A A sys_command_output( "pdebuild $pdebuildopts" ); > + A A sys_command_output_screen( "pdebuild $pdebuildopts" ); > A } > > A everything_is_committed() or die "cannot build: uncommited changes"; > -- > 1.7.4.1 > > _______________________________________________ > Koha-patches mailing list > Koha-patches at lists.koha-community.org > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > website : http://www.koha-community.org/ > git : http://git.koha-community.org/ > bugs : http://bugs.koha-community.org/ > _______________________________________________ > Koha-patches mailing list > Koha-patches at lists.koha-community.org > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > website : http://www.koha-community.org/ > git : http://git.koha-community.org/ > bugs : http://bugs.koha-community.org/ -- Chris Cormack Catalyst IT Ltd. +64 4 803 2238 PO Box 11-053, Manners St, Wellington 6142, New Zealand -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From srdjan at catalyst.net.nz Mon Sep 5 08:07:43 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Mon, 5 Sep 2011 18:07:43 +1200 Subject: [Koha-patches] [PATCH] bug_6190: BorrowerUnwantedField syspref and removing fields from the patron entry In-Reply-To: References: Message-ID: <1315202863-17395-1-git-send-email-srdjan@catalyst.net.nz> Sysprefs test fixes --- admin/systempreferences.pl | 1 + installer/data/mysql/de-DE/mandatory/sysprefs.sql | 2 +- installer/data/mysql/en/mandatory/sysprefs.sql | 1 + installer/data/mysql/es-ES/mandatory/sysprefs.sql | 1 + .../1-Obligatoire/unimarc_standard_systemprefs.sql | 2 +- installer/data/mysql/it-IT/necessari/sysprefs.sql | 1 + .../data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql | 27 ++++- installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 1 + ...m_preferences_full_optimal_for_install_only.sql | 1 + ...m_preferences_full_optimal_for_install_only.sql | 1 + installer/data/mysql/updatedatabase.pl | 6 + .../prog/en/modules/admin/preferences/patrons.pref | 5 + .../prog/en/modules/help/members/memberentry.tt | 1 + .../prog/en/modules/members/memberentrygen.tt | 124 +++++++++++++++++++- members/memberentry.pl | 7 + xt/syspref.t | 1 + 16 files changed, 174 insertions(+), 8 deletions(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 87ecac4..39a81e6 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -223,6 +223,7 @@ $tabsysprefs{intranetreadinghistory} = "Patrons"; $tabsysprefs{NotifyBorrowerDeparture} = "Patrons"; $tabsysprefs{memberofinstitution} = "Patrons"; $tabsysprefs{BorrowerMandatoryField} = "Patrons"; +$tabsysprefs{BorrowerUnwantedField} = "Patrons"; $tabsysprefs{borrowerRelationship} = "Patrons"; $tabsysprefs{BorrowersTitles} = "Patrons"; $tabsysprefs{patronimages} = "Patrons"; diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index 6df6a9f..8687ed7 100755 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -20,6 +20,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoMemberNum',1,'If ON, patron number is auto-calculated','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BiblioDefaultView','normal','Choose the default detail view in the catalog; choose between normal, marc or isbd','normal|marc|isbd','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerMandatoryField','zipcode|surname|cardnumber','Choose the mandatory fields for a patron\'s account',NULL,'free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerUnwantedField','','Name the fields you don\'t need to store for a patron\'s account',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('borrowerRelationship','Vater|Mutter','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowersLog',1,'If ON, log edit/create/delete actions on patron data',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('casAuthentication', '0', 'Enable or disable CAS authentication', '', 'YesNo'); @@ -317,4 +318,3 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0, 'If ON Openlibrary book covers will be show',NULL,'YesNo'); - diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 8407505..65a5acc 100755 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -20,6 +20,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoMemberNum',1,'If ON, patron number is auto-calculated','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BiblioDefaultView','normal','Choose the default detail view in the catalog; choose between normal, marc or isbd','normal|marc|isbd','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerMandatoryField','zipcode|surname|cardnumber','Choose the mandatory fields for a patron\'s account',NULL,'free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerUnwantedField','','Name the fields you don\'t need to store for a patron\'s account',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('borrowerRelationship','father|mother','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowersLog',1,'If ON, log edit/create/delete actions on patron data',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('casAuthentication', '0', 'Enable or disable CAS authentication', '', 'YesNo'); diff --git a/installer/data/mysql/es-ES/mandatory/sysprefs.sql b/installer/data/mysql/es-ES/mandatory/sysprefs.sql index 8407505..7fd4b3a 100755 --- a/installer/data/mysql/es-ES/mandatory/sysprefs.sql +++ b/installer/data/mysql/es-ES/mandatory/sysprefs.sql @@ -317,3 +317,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerUnwantedField','','Name the fields you don\'t need to store for a patron\'s account',NULL,'free'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index d46502c..032fcbf 100755 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -19,6 +19,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutomaticItemReturn', '1', 'Ce param??tre permet de faire les retours vers le site propri??taire automatiquement', '', 'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoMemberNum', '1', 'Si ce param??tre est activ??, le num??ro des adh??rents est automatiquement calcul??. Ne sera pas activ?? si vous avez des cartes pr??-imprim??es.', '', 'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerMandatoryField', '', 'Liste les champs obligatoires dans la grille de saisie des adh??rents (s??par??s par | ou ,)', 'cardnumber|surname|address', 'free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerUnwantedField','','Name the fields you don\'t need to store for a patron\'s account',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('borrowerRelationship', '', 'Liste les relations entre les garants et leurs garantis (separ??es par | ou ,)', 'P??re|M??re|grand-parent|Tuteur l??gal|Autre\r\n', 'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowersLog', '0', 'Activer ce param??tre pour enregistrer les actions sur les lecteurs', '', 'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowersTitles', '', 'Liste les titres de politesse (s??par??s par | ou ,)', 'M|Mme|Mlle', 'free'); @@ -318,4 +319,3 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); - diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql index 3448738..65cfa3e 100755 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -35,6 +35,7 @@ insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('BiblioAddsAuthorities','1','','Se ON, aggiungendo un nuovo record bibliografico il sistema controlla se ci sono i records di authority corrispondenti per i campi collegati con l???authority. Se non ci sono, gli equivalenti rcords di autority sono creati al volo.','YesNo'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('BiblioDefaultView','normal','normal|marc|isbd','Per scegliere la visualizzazione di default della scheda dettagliata nel catalogo; scegliere tra normal, marc o isbd.','Choice'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('BorrowerMandatoryField','city|surname|cardnumber','','Per decidere quali campi sono obbligatori nell\'account di un utente.','free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerUnwantedField','','Name the fields you don\'t need to store for a patron\'s account',NULL,'free'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('borrowerRelationship','father|mother','','Definisce la relazione valida tra garante e garanzia (separali con | o ,)','free'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('BorrowersLog','0','','Se ON, logga le azioni di modifica/creazione/cancellazione sui dati utente.','YesNo'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('BorrowersTitles','Sig|Sig.ra|Sig.na','','Definisce i titoli appropriati per gli utenti','free'); diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql index ac4c3e2..eb685b1 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql @@ -41,6 +41,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoMemberNum',1,'If ON, patron number is auto-calculated','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BiblioDefaultView','normal','Choose the default detail view in the catalog; choose between normal, marc or isbd','normal|marc|isbd','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerMandatoryField','surname|cardnumber','Choose the mandatory fields for a patron\'s account',NULL,'free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerUnwantedField','','Name the fields you don\'t need to store for a patron\'s account',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('borrowerRelationship','far|mor','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowersLog',1,'If ON, log edit/create/delete actions on patron data',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('casAuthentication', '0', 'Enable or disable CAS authentication', '', 'YesNo'); @@ -48,6 +49,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('casServerUrl', 'https://localhost:8443/cas', 'URL of the cas server', '', 'Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CataloguingLog',1,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('checkdigit','none','If ON, enable checks on patron cardnumber: none or \"Katipo\" style checks','none|katipo','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('COinSinOPACResults', 1, 'If ON, use COinS in OPAC search results page. NOTE: this can slow down search response time significantly','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('delimiter',';','Define the default separator character for exporting reports',';|tabulation|,|/|\\|#|\|','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('EnhancedMessagingPreferences',0,'If ON, allows patrons to select to receive additional messages about items due or nearly due.','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('expandedSearchOption',0,'If ON, set advanced search to be expanded by default',NULL,'YesNo'); @@ -55,6 +57,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FinesLog',1,'If ON, log fines',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems',0,'If ON, disables display of\"lost\" items in OPAC.','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hide_marc',0,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WaitingNotifyAtCheckin',0,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IndependantBranches',0,'If ON, increases security between libraries',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('insecure',0,'If ON, bypasses all authentication. Be careful!',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetBiblioDefaultView','normal','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','normal|marc|isbd|labeled_marc','Choice'); @@ -118,7 +121,9 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnBeforeExpiry',0,'If ON, checkout will be prevented if returndate is after patron card expiry',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnLog',1,'If ON, enables the circulation (returns) log',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('reviewson',1,'If ON, enables patron reviews of bibliographic records in the OPAC','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewer',1,'If ON, name of reviewer will be shown above comments in OPAC','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewer',1,'If ON, name of reviewer will be shown above comments in OPAC','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SpecifyDueDate',1,'Define whether to display \"Specify Due Date\" form in Circulation','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionHistory','simplified','Define the display preference for serials issue history in OPAC','simplified|full','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionLog',1,'If ON, enables subscriptions log',NULL,'YesNo'); @@ -127,6 +132,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('timeout',12000000,'Inactivity timeout for cookies authentication (in seconds)',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('TransfersMaxDaysWarning',3,'Define the days before a transfer is suspected of having a problem',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('useDaysMode','Calendar','Choose the method for calculating due date: select Calendar to use the holidays module, and Days to ignore the holidays module','Calendar|Days|Datedue','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('UseControlNumber',0,'If ON, record control number (w subfields) and control number (001) are used for linking of bibliographic records.','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('virtualshelves',1,'If ON, enables Lists management','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('z3950AuthorAuthFields','701,702,700','Define the MARC biblio fields for Personal Name Authorities to fill biblio.author',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('z3950NormalizeAuthor',0,'If ON, Personal Name Authorities will replace authors in biblio.author','','YesNo'); @@ -160,6 +166,9 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES -- need AddressType to distinguish between US and other, telephone numbers, maori stuff, sex, nationality, etc. -- LDAP ? required fields? INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'If ON, enables the web-based self-check system',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckTimeout',120,'Define the number of seconds before the Web-based Self Checkout times out a patron','','Integer'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowSelfCheckReturns',0,'If enabled, patrons may return items through the Web-based Self Checkout','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckHelpMessage','','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); @@ -173,8 +182,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('emailLibrarianWhenHoldIsPlaced',0,'If ON, emails the librarian whenever a hold is placed',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numReturnedItemsToShow','20','Number of returned items to show on the check-in page',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesMode','test','Choose the fines mode, \'off\', \'test\' (emails admin report) or \'production\' (accrue overdue fines). Requires accruefines cronjob.','off|test|production','Choice'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('globalDueDate','','If set, allows a global static due date for all checkouts','10','free'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ceilingDueDate','','If set, date due will not be past this date. Enter date according to the dateformat System Preference',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeInputFilter','','If set, allows specification of a item barcode input filter','whitespace|T-prefix|cuecat|libsuite8','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free'); @@ -286,6 +293,7 @@ INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanatio INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'DisplayClearScreenButton', '0', '', 'If set to ON, a clear screen button will appear on the circulation page.', 'YesNo'); INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('HidePatronName', '0', '', 'If this is switched on, patron''s cardnumber will be shown instead of their name on the holds and catalog screens', 'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACSearchForTitleIn','
  • Andre bibliotek (WorldCat)
  • \n
  • Andre databaser (Google Scholar)
  • \n
  • Nettbutikker (Bookfinder.com)
  • ','Skriv inn HTML som vil vises i \'Flere s??k\'-menyen i detaljvisningen i OPACen. Bruk {TITLE}, {AUTHOR} eller {ISBN} som variabler i URLer. La feltet v??re tomt for ?? skru av \'Flere s??k\'-menyen.','70|10','Textarea'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACMySummaryHTML','','Enter the HTML that will appear in a column on the \'my profile\' tab when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACPatronDetails','1','If OFF the patron details tab in the OPAC is disabled.','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACFinesTab','1','If OFF the patron fines tab in the OPAC is disabled.','','YesNo'); INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('DisplayOPACiconsXSLT', '1', '', 'If ON, displays the format, audience, type icons in XSLT MARC21 results and display pages.', 'YesNo'); @@ -321,6 +329,21 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('StaffAuthorisedValueImages','1','',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACDisplay856uAsImage','OFF','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','OFF|Details|Results|Both','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Display856uAsImage','OFF','Display the URI in the 856u field as an image, the corresponding Staff Client XSLT option must be on','OFF|Details|Results|Both','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('StaffAuthorisedValueImages','1','',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACDisplay856uAsImage','OFF','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','OFF|Details|Results|Both','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Display856uAsImage','OFF','Display the URI in the 856u field as an image, the corresponding Staff Client XSLT option must be on','OFF|Details|Results|Both','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice'); diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index 3087f3c..9d01cb1 100755 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -20,6 +20,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoMemberNum',1,'If ON, patron number is auto-calculated','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BiblioDefaultView','normal','Choose the default detail view in the catalog; choose between normal, marc or isbd','normal|marc|isbd','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerMandatoryField','zipcode|surname|cardnumber','Choose the mandatory fields for a patron\'s account',NULL,'free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerUnwantedField','','Name the fields you don\'t need to store for a patron\'s account',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('borrowerRelationship','father|mother','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowersLog',1,'If ON, log edit/create/delete actions on patron data',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('casAuthentication', '0', 'Enable or disable CAS authentication', '', 'YesNo'); diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql index c0912ba..66a1576 100755 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -35,6 +35,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoMemberNum',1,'If ON, patron number is auto-calculated','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BiblioDefaultView','normal','Choose the default detail view in the catalog; choose between normal, marc or isbd','normal|marc|isbd','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerMandatoryField','surname|cardnumber','Choose the mandatory fields for a patron\'s account',NULL,'free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerUnwantedField','','Name the fields you don\'t need to store for a patron\'s account',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('borrowerRelationship','father|mother','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowersLog',1,'If ON, log edit/create/delete actions on patron data',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CataloguingLog',1,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.',NULL,'YesNo'); diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql index d334469..3a5f191 100755 --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -34,6 +34,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoMemberNum',1,'If ON, patron number is auto-calculated','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BiblioDefaultView','normal','Choose the default detail view in the catalog; choose between normal, marc or isbd','normal|marc|isbd','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerMandatoryField','surname|cardnumber','Choose the mandatory fields for a patron\'s account',NULL,'free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerUnwantedField','','Name the fields you don\'t need to store for a patron\'s account',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('borrowerRelationship','father|mother','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowersLog',1,'If ON, log edit/create/delete actions on patron data',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CataloguingLog',1,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.',NULL,'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bdfc9ac..db05eb1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4439,6 +4439,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerUnwantedField','','Name the fields you don\'t need to store for a patron\'s account',NULL,'free')"); + print "Upgrade to $DBversion done (BorrowerUnwantedField syspref)\n"; + SetVersion ($DBversion); +} =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index ac3e1d2..6bfa0df 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -32,6 +32,11 @@ Patrons: class: multi - (separate columns with |) - + - "The following database columns will not appear on the patron entry screen:" + - pref: BorrowerUnwantedField + class: multi + - (separate columns with |) + - - "Guarantors can be the following of those they guarantee:" - pref: borrowerRelationship class: multi diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/memberentry.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/memberentry.tt index b832f4c..9dcaf60 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/memberentry.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/memberentry.tt @@ -22,6 +22,7 @@
  • Enter the identifying information regarding your patron
    • Required fields are defined in the BorrowerMandatoryField system preference
    • +
    • Unwanted fields are defined in the BorrowerUnwantedField system preference
    • Salutation is populated by the BorrowersTitles system preference
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 8a34bb1..d078169 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -178,10 +178,12 @@ [% END %] [% IF ( step_1 ) %] +[%UNLESS notitle && nosurname && nofirstname && nodateofbirth && noinitials && noothernames &&nosex %]
    [% IF ( I ) %]Organization [% ELSE %]Patron [% END %]identity
      [% UNLESS ( I ) %] + [% UNLESS notitle %] [% IF ( title_cgipopup ) %]
    1. [% IF ( mandatorytitle ) %] @@ -195,6 +197,8 @@
    2. [% END %] [% END %] + [% END %] + [% UNLESS nosurname %]
    3. [% IF ( mandatorysurname ) %]
    4. + [% END %] [% UNLESS ( I ) %] + [% UNLESS nofirstname %]
    5. [% IF ( mandatoryfirstname ) %]
    6. + [% END %] + [% UNLESS nodateofbirth %]
    7. [% IF ( mandatorydateofbirth ) %]
    8. + [% END %] + [% UNLESS noinitials %]
    9. [% IF ( mandatoryinitials ) %]
    10. [% END %] + [% END %] + [% UNLESS noothernames %]
    11. [% IF ( mandatoryothernames ) %]
    12. + [% END %] [% UNLESS ( I ) %] + [% UNLESS nosex %]
    13. [% IF ( female ) %] @@ -289,9 +303,11 @@ [% END %]
    14. + [% END %] [% END %]
    +[% END # hide fieldset %] [% IF ( showguarantor ) %]
    @@ -323,6 +339,7 @@ [% END %] Patron #: [% IF ( guarantorid ) %] [% guarantorid %][% END %] + [% UNLESS nocontactname %]
  • [% IF ( guarantorid ) %] @@ -332,6 +349,8 @@ [% END %]
  • + [% END %] + [% UNLESS nocontactfirstname %]
  • [% IF ( guarantorid ) %] @@ -341,6 +360,7 @@ [% END %]
  • + [% END %] [% IF ( relshiploop ) %]
  • @@ -370,8 +390,10 @@
  • [% END %] +[% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
    Main address
      + [% UNLESS nostreetnumber %]
    1. [% IF ( mandatorystreetnumber ) %]
    2. + [% END %] + [% UNLESS nostreettype %] [% IF ( road_cgipopup ) %]
    3. [% IF ( mandatorystreettype ) %] @@ -394,6 +418,8 @@ [% IF ( mandatorystreettype ) %]Required[% END %]
    4. [% END %] + [% END %] + [% UNLESS noaddress %]
    5. [% IF ( mandatoryaddress ) %]
    6. + [% END %] + [% UNLESS noaddress2 %]
    7. [% IF ( mandatoryaddress2 ) %]
    8. + [% END %] + [% UNLESS nocity %]
    9. [% IF ( mandatorycity ) %]
    10. + [% END %] + [% UNLESS nostate %]
    11. [% IF ( mandatorystate ) %]
    12. + [% END %] + [% UNLESS nozipcode %]
    13. [% IF ( mandatoryzipcode ) %]
    14. - + [% END %] + [% UNLESS nocountry %]
    15. [% IF ( mandatorycountry ) %]
    16. - + [% END %]
    +[% END # nostreet && nocity etc group%] + +[% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
    Contact
      + [% UNLESS nophone %]
    1. [% IF ( mandatoryphone ) %]
    2. + [% END %] + [% UNLESS nophonepro %]
    3. [% IF ( mandatoryphonepro ) %]
    4. + [% END %] + [% UNLESS nomobile %]
    5. [% IF ( mandatorymobile ) %]
    6. + [% END %] + [% UNLESS noemail %]
    7. [% IF ( mandatoryemail ) %]
    8. + [% END %] + [% UNLESS noemailpro %]
    9. [% IF ( mandatoryemailpro ) %]
    10. + [% END %] + [% UNLESS nofax %]
    11. [% IF ( mandatoryfax ) %]
    12. + [% END %]
    - +[%END # hide fieldset %] [% END %] [% IF ( step_6 ) %] + [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %]
    Alternate address
      + [% UNLESS noB_address %]
    1. [% IF ( mandatoryB_address ) %]
    2. + [% END %] + [% UNLESS noB_address2 %]
    3. [% IF ( mandatoryB_address2 ) %]
    4. + [% END %] + [% UNLESS noB_city %]
    5. [% IF ( mandatoryB_city ) %]
    6. + [% END %] + [% UNLESS noB_state %]
    7. [% IF ( mandatoryB_state ) %]
    8. + [% END %] + [% UNLESS noB_zipcode %]
    9. [% IF ( mandatoryB_zipcode ) %]
    10. + [% END %] + [% UNLESS noB_country %]
    11. [% IF ( mandatoryB_country ) %]
    12. + [% END %] + [% UNLESS noB_phone %]
    13. [% IF ( mandatoryB_phone ) %]
    14. + [% END %] + [% UNLESS noB_email %]
    15. [% IF ( mandatoryB_email ) %] [% IF ( mandatoryB_email ) %]Required[% END %]
    16. + [% END %] + [% UNLESS nocontactnote %]
    17. [% IF ( mandatorycontactnote ) %]
    18. + [% END %]
    + [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %] [% END %] [% IF ( step_2 ) %] + [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
    Alternate Contact
      + [% UNLESS noaltcontactsurname %]
    1. [% IF ( mandatoryaltcontactsurname ) %]
    2. + [% END %] + [% UNLESS noaltcontactfirstname %]
    3. [% IF ( mandatoryaltcontactfirstname ) %]
    4. + [% END %] + [% UNLESS noaltcontactaddress1 %]
    5. [% IF ( mandatoryaltcontactaddress1 ) %]
    6. + [% END %] + [% UNLESS noaltcontactaddress2 %]
    7. [% IF ( mandatoryaltcontactaddress2 ) %]
    8. + [% END %] + [% UNLESS noaltcontactaddress3 %]
    9. [% IF ( mandatoryaltcontactaddress3 ) %]
    10. + [% END %] + [% UNLESS noaltcontactstate %]
    11. [% IF ( mandatoryaltcontactstate ) %]
    12. + [% END %] + [% UNLESS noaltcontactzipcode %]
    13. [% IF ( mandatoryaltcontactzipcode ) %]
    14. + [% END %] + [% UNLESS noaltcontactcountry %]
    15. [% IF ( mandatoryaltcontactcountry ) %]
    16. + [% END %] + [% UNLESS noaltcontactphone %]
    17. [% IF ( mandatoryaltcontactphone ) %]
    18. + [% END %]
    + [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %] [% END %] [% IF ( step_3 ) %]
    Library Management
      + [% UNLESS nocardnumber %]
    1. [% IF ( mandatorycardnumber ) %] [% IF ( mandatorycardnumber ) %]Required[% END %]
    2. + [% END %] + [% UNLESS nobranchcode %]
    3. [% IF ( mandatorybranchcode ) %]
    4. + [% END %]
    5. + [% UNLESS nosort1 %]
    6. [% IF ( mandatorysort1 ) %]
    7. + [% END %] + [% UNLESS nosort2 %]
    8. [% IF ( mandatorysort2 ) %]
    9. + [% END %]
    + [% UNLESS nodateenrolled && nodateexpiry && noopacnote && noborrowernotes %]
    Library set-up
      + [% UNLESS nodateenrolled %]
    1. [% IF ( mandatorydateenrolled ) %]
    2. + [% END %] + [% UNLESS nodateexpiry %]
    3. [% IF ( mandatorydateexpiry ) %]
    4. + [% END %] + [% UNLESS noopacnote %]
    5. [% IF ( mandatoryopacnote ) %]
    6. + [% END %] + [% UNLESS noborrowernotes %]
    7. [% IF ( mandatoryborrowernotes ) %]
    8. + [% END %]
    + [% END # hide fieldset %] + + [% UNLESS nouserid && nopassword %]
    OPAC/Staff Login
      + [% UNLESS nouserid %]
    1. [% IF ( mandatoryuserid ) %]
    2. + [%END %] + [% UNLESS nopassword %]
    3. [% IF ( mandatorypassword ) %]
    + + [% END %] +
    + [% END # hide fieldset %] [% UNLESS ( opadd ) %]
    diff --git a/members/memberentry.pl b/members/memberentry.pl index f01261e..0c8d984 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -100,6 +100,13 @@ my @field_check=split(/\|/,$check_BorrowerMandatoryField); foreach (@field_check) { $template->param( "mandatory$_" => 1); } +# function to designate unwanted fields +my $check_BorrowerUnwantedField=C4::Context->preference("BorrowerUnwantedField"); + at field_check=split(/\|/,$check_BorrowerUnwantedField); +foreach (@field_check) { + next unless m/\w/o; + $template->param( "no$_" => 1); +} $template->param( "add" => 1 ) if ( $op eq 'add' ); $template->param( "duplicate" => 1 ) if ( $op eq 'duplicate' ); $template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 ); diff --git a/xt/syspref.t b/xt/syspref.t index acadc55..0ea160c 100755 --- a/xt/syspref.t +++ b/xt/syspref.t @@ -34,6 +34,7 @@ my @trans_syspref_files = qw( ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql pl-PL/mandatory/sysprefs.sql es-ES/mandatory/sysprefs.sql + nb-NO/1-Obligatorisk/sysprefs.sql ); ok( -- 1.6.5 From srdjan at catalyst.net.nz Mon Sep 5 10:45:54 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Mon, 5 Sep 2011 20:45:54 +1200 Subject: [Koha-patches] [PATCH] bug_6318: Always give predefined fields drop downs on label layout edit In-Reply-To: References: Message-ID: <1315212354-19802-1-git-send-email-srdjan@catalyst.net.nz> --- C4/Creators/Layout.pm | 3 +- .../prog/en/modules/labels/label-edit-layout.tt | 28 ++++----- labels/label-edit-layout.pl | 60 +++++++------------- 3 files changed, 36 insertions(+), 55 deletions(-) diff --git a/C4/Creators/Layout.pm b/C4/Creators/Layout.pm index 3281e15..9de8ece 100644 --- a/C4/Creators/Layout.pm +++ b/C4/Creators/Layout.pm @@ -61,6 +61,7 @@ sub _check_params { return $exit_code; } +use constant PRESET_FIELDS => [qw(title author isbn issn itemtype barcode callnumber)]; sub new { my $invocant = shift; my $self = ''; @@ -81,7 +82,7 @@ sub new { font_size => 3, callnum_split => 0, text_justify => 'L', - format_string => 'title, author, isbn, issn, itemtype, barcode, callnumber', + format_string => join(', ', @{ PRESET_FIELDS() }), @_, }; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt index d694464..4610aca 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt @@ -75,25 +75,23 @@ [% END %]
    - [% FOREACH field_tabl IN field_table %]

    - [% FOREACH text_field IN field_tabl.text_fields %] - [% IF ( text_field.field_empty ) %] - [% ELSE %] - + + [% FOREACH orde IN [1..field_count] %] + [% IF ( orde == text_field.order ) %] + [% ELSE %] - + [% END %] - [% END %] - - - [% END %] - [% END %] + [% END %] +   + +    + + [% END %]

    - [% END %]
    [% UNLESS ( layout_string ) %] diff --git a/labels/label-edit-layout.pl b/labels/label-edit-layout.pl index 6a70212..5a45d5c 100755 --- a/labels/label-edit-layout.pl +++ b/labels/label-edit-layout.pl @@ -23,7 +23,6 @@ use warnings; use CGI; use POSIX; -use Text::CSV_XS; use C4::Auth qw(get_template_and_user); use C4::Output qw(output_html_with_http_headers); @@ -66,40 +65,23 @@ sub _set_selected { sub _select_format_string { # generate field table based on format_string my $format_string = shift; - $format_string =~ s/(?<=,) (?![A-Z][a-z][0-9])//g; # remove spaces between fields - my $table = []; - my $fields = []; - my ($row_index, $col_index, $field_index) = (0,0,0); - my $cols = 5; # number of columns to wrap on - my $csv = Text::CSV_XS->new({ allow_whitespace => 1 }); - my $status = $csv->parse($format_string); - my @text_fields = $csv->fields(); - warn sprintf('Error parsing format_string. Parser returned: %s', $csv->error_input()) if $csv->error_input(); - my $field_count = $#text_fields + 1; - POPULATE_TABLE: - foreach my $text_field (@text_fields) { - $$fields[$col_index] = {field_empty => 0, field_name => ($text_field . "_tbl"), field_label => $text_field, order => [{num => '', selected => 0}]}; - for (my $order_i = 1; $order_i <= $field_count; $order_i++) { - $$fields[$col_index]{'order'}[$order_i] = {num => $order_i, selected => ($field_index == $order_i-1 ? 1 : 0)}; - } - $col_index++; + + my @text_fields = grep /\w/, split /\s*,\s/, $format_string; + my %tf = map {$_ => 1} @text_fields; + my @missing_fields = grep { !$tf{$_} } @{ C4::Labels::Layout->PRESET_FIELDS }; + + my $field_count = scalar(@text_fields) + scalar( @missing_fields); + + my @fields; + my $field_index = 1; + foreach my $f (@text_fields) { + push @fields, {field_name => ($f . "_tbl"), field_label => $f, order => $field_index}; $field_index++; - if ((($col_index > 0) && !($col_index % $cols)) || ($field_index == $field_count)) { # wrap to new row - if (($field_index == $field_count) && ($row_index > 0)) { # in this case fill out row with empty fields - while ($col_index < $cols) { - $$fields[$col_index] = {field_empty => 1, field_name => '', field_label => '', order => [{num => '', selected => 0}]}; - $col_index++; - } - $$table[$row_index] = {text_fields => $fields}; - last POPULATE_TABLE; - } - $$table[$row_index] = {text_fields => $fields}; - $row_index++; - $fields = []; - $col_index = 0; - } } - return $table; + foreach my $f (@missing_fields) { + push @fields, {field_name => ($f . "_tbl"), field_label => $f}; + } + return (\@fields, $field_count); } if ($op eq 'edit') { @@ -110,15 +92,14 @@ if ($op eq 'edit') { elsif ($op eq 'save') { my $format_string = ''; if ($layout_choice eq 'layout_table') { # translate the field table into a format_string - my @layout_table = (); + my %layout_table; foreach my $cgi_param ($cgi->param()) { if (($cgi_param =~ m/^(.*)_tbl$/) && ($cgi->param($cgi_param))) { my $value = $cgi->param($cgi_param); - $layout_table[$value - 1] = $1; + $layout_table{$1} = $value; } } - @layout_table = grep {$_} @layout_table; # this removes numerically 'skipped' fields. ie. user omits a number in sequential order - $format_string = join ', ', @layout_table; + $format_string = join ', ', sort { $layout_table{$a} <=> $layout_table{$b} } keys %layout_table; $cgi->param('format_string', $format_string); } my @params = ( @@ -152,14 +133,15 @@ my $barcode_types = _set_selected(get_barcode_types(), $layout, 'barcode_type'); my $label_types = _set_selected(get_label_types(), $layout, 'printing_type'); my $font_types = _set_selected(get_font_types(), $layout, 'font'); my $text_justification_types = _set_selected(get_text_justification_types(), $layout, 'text_justify'); -my $select_text_fields = _select_format_string($layout->get_attr('format_string')); +my ($select_text_fields, $select_text_fields_cnt) = _select_format_string($layout->get_attr('format_string')); $template->param( barcode_types => $barcode_types, label_types => $label_types, font_types => $font_types, text_justification_types => $text_justification_types, - field_table => $select_text_fields, + fields => $select_text_fields, + field_count => $select_text_fields_cnt, layout_id => $layout->get_attr('layout_id') > -1 ? $layout->get_attr('layout_id') : '', layout_name => $layout->get_attr('layout_name'), guidebox => $layout->get_attr('guidebox'), -- 1.6.5 From srdjan at catalyst.net.nz Tue Sep 6 04:08:28 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Tue, 6 Sep 2011 14:08:28 +1200 Subject: [Koha-patches] [PATCH] bug_6488: Added trailing \n when parsing OpacHiddenItems to make YAML happy In-Reply-To: References: Message-ID: <1315274908-14070-1-git-send-email-srdjan@catalyst.net.nz> --- C4/Items.pm | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index bc36dd1..0f098af 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1531,6 +1531,7 @@ sub GetHiddenItemnumbers { my @resultitems; my $yaml = C4::Context->preference('OpacHiddenItems'); + $yaml = "$yaml\n"; # YAML is anal on ending \n. Surplus does not hurt my $hidingrules; eval { $hidingrules = YAML::Load($yaml); @@ -1538,7 +1539,7 @@ sub GetHiddenItemnumbers { if ($@) { warn "Unable to parse OpacHiddenItems syspref : $@"; return (); - } else { + } my $dbh = C4::Context->dbh; # For each item @@ -1563,9 +1564,7 @@ sub GetHiddenItemnumbers { } } return @resultitems; - } - - } +} =head3 get_item_authorised_values -- 1.6.5 From srdjan at catalyst.net.nz Tue Sep 6 06:13:11 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Tue, 6 Sep 2011 16:13:11 +1200 Subject: [Koha-patches] [PATCH] bug_6770: removed doubled override increment when using AllowHoldPolicyOverride In-Reply-To: References: Message-ID: <1315282391-15468-1-git-send-email-srdjan@catalyst.net.nz> --- reserve/request.pl | 16 ++++++---------- 1 files changed, 6 insertions(+), 10 deletions(-) diff --git a/reserve/request.pl b/reserve/request.pl index 0c952b4..71762f8 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -434,22 +434,18 @@ foreach my $biblionumber (@biblionumbers) { $policy_holdallowed = 0; } - if (IsAvailableForItemLevelRequest($itemnumber) and - not $item->{cantreserve} and - CanItemBeReserved($borrowerinfo->{borrowernumber}, $itemnumber) ) { - if ( $policy_holdallowed ) { + if ( $policy_holdallowed && + !$item->{cantreserve} && + IsAvailableForItemLevelRequest($itemnumber) && + CanItemBeReserved($borrowerinfo->{borrowernumber}, $itemnumber) + ) { $item->{available} = 1; $num_available++; - } } elsif (C4::Context->preference( 'AllowHoldPolicyOverride' ) ) { + # If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules $item->{override} = 1; $num_override++; } - # If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules - if (C4::Context->preference( 'AllowHoldPolicyOverride' ) && !$item->{available} ) { - $item->{override} = 1; - $num_override++; - } # If none of the conditions hold true, then neither override nor available is set and the item cannot be checked -- 1.6.5 From nengard at bywatersolutions.com Tue Sep 6 16:06:02 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Tue, 6 Sep 2011 10:06:02 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] bug_6318: Always give predefined fields drop downs on label layout edit Message-ID: <1315317962-2557-1-git-send-email-nengard@bywatersolutions.com> From: Srdjan Jankovic Signed-off-by: Nicole C. Engard --- C4/Creators/Layout.pm | 3 +- .../prog/en/modules/labels/label-edit-layout.tt | 28 ++++----- labels/label-edit-layout.pl | 60 +++++++------------- 3 files changed, 36 insertions(+), 55 deletions(-) diff --git a/C4/Creators/Layout.pm b/C4/Creators/Layout.pm index 3281e15..9de8ece 100644 --- a/C4/Creators/Layout.pm +++ b/C4/Creators/Layout.pm @@ -61,6 +61,7 @@ sub _check_params { return $exit_code; } +use constant PRESET_FIELDS => [qw(title author isbn issn itemtype barcode callnumber)]; sub new { my $invocant = shift; my $self = ''; @@ -81,7 +82,7 @@ sub new { font_size => 3, callnum_split => 0, text_justify => 'L', - format_string => 'title, author, isbn, issn, itemtype, barcode, callnumber', + format_string => join(', ', @{ PRESET_FIELDS() }), @_, }; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt index d694464..4610aca 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt @@ -75,25 +75,23 @@ [% END %]
    - [% FOREACH field_tabl IN field_table %]

    - [% FOREACH text_field IN field_tabl.text_fields %] - [% IF ( text_field.field_empty ) %] - [% ELSE %] - + + [% FOREACH orde IN [1..field_count] %] + [% IF ( orde == text_field.order ) %] + [% ELSE %] - + [% END %] - [% END %] - - - [% END %] - [% END %] + [% END %] +   + +    + + [% END %]

    - [% END %]
    [% UNLESS ( layout_string ) %] diff --git a/labels/label-edit-layout.pl b/labels/label-edit-layout.pl index 6a70212..5a45d5c 100755 --- a/labels/label-edit-layout.pl +++ b/labels/label-edit-layout.pl @@ -23,7 +23,6 @@ use warnings; use CGI; use POSIX; -use Text::CSV_XS; use C4::Auth qw(get_template_and_user); use C4::Output qw(output_html_with_http_headers); @@ -66,40 +65,23 @@ sub _set_selected { sub _select_format_string { # generate field table based on format_string my $format_string = shift; - $format_string =~ s/(?<=,) (?![A-Z][a-z][0-9])//g; # remove spaces between fields - my $table = []; - my $fields = []; - my ($row_index, $col_index, $field_index) = (0,0,0); - my $cols = 5; # number of columns to wrap on - my $csv = Text::CSV_XS->new({ allow_whitespace => 1 }); - my $status = $csv->parse($format_string); - my @text_fields = $csv->fields(); - warn sprintf('Error parsing format_string. Parser returned: %s', $csv->error_input()) if $csv->error_input(); - my $field_count = $#text_fields + 1; - POPULATE_TABLE: - foreach my $text_field (@text_fields) { - $$fields[$col_index] = {field_empty => 0, field_name => ($text_field . "_tbl"), field_label => $text_field, order => [{num => '', selected => 0}]}; - for (my $order_i = 1; $order_i <= $field_count; $order_i++) { - $$fields[$col_index]{'order'}[$order_i] = {num => $order_i, selected => ($field_index == $order_i-1 ? 1 : 0)}; - } - $col_index++; + + my @text_fields = grep /\w/, split /\s*,\s/, $format_string; + my %tf = map {$_ => 1} @text_fields; + my @missing_fields = grep { !$tf{$_} } @{ C4::Labels::Layout->PRESET_FIELDS }; + + my $field_count = scalar(@text_fields) + scalar( @missing_fields); + + my @fields; + my $field_index = 1; + foreach my $f (@text_fields) { + push @fields, {field_name => ($f . "_tbl"), field_label => $f, order => $field_index}; $field_index++; - if ((($col_index > 0) && !($col_index % $cols)) || ($field_index == $field_count)) { # wrap to new row - if (($field_index == $field_count) && ($row_index > 0)) { # in this case fill out row with empty fields - while ($col_index < $cols) { - $$fields[$col_index] = {field_empty => 1, field_name => '', field_label => '', order => [{num => '', selected => 0}]}; - $col_index++; - } - $$table[$row_index] = {text_fields => $fields}; - last POPULATE_TABLE; - } - $$table[$row_index] = {text_fields => $fields}; - $row_index++; - $fields = []; - $col_index = 0; - } } - return $table; + foreach my $f (@missing_fields) { + push @fields, {field_name => ($f . "_tbl"), field_label => $f}; + } + return (\@fields, $field_count); } if ($op eq 'edit') { @@ -110,15 +92,14 @@ if ($op eq 'edit') { elsif ($op eq 'save') { my $format_string = ''; if ($layout_choice eq 'layout_table') { # translate the field table into a format_string - my @layout_table = (); + my %layout_table; foreach my $cgi_param ($cgi->param()) { if (($cgi_param =~ m/^(.*)_tbl$/) && ($cgi->param($cgi_param))) { my $value = $cgi->param($cgi_param); - $layout_table[$value - 1] = $1; + $layout_table{$1} = $value; } } - @layout_table = grep {$_} @layout_table; # this removes numerically 'skipped' fields. ie. user omits a number in sequential order - $format_string = join ', ', @layout_table; + $format_string = join ', ', sort { $layout_table{$a} <=> $layout_table{$b} } keys %layout_table; $cgi->param('format_string', $format_string); } my @params = ( @@ -152,14 +133,15 @@ my $barcode_types = _set_selected(get_barcode_types(), $layout, 'barcode_type'); my $label_types = _set_selected(get_label_types(), $layout, 'printing_type'); my $font_types = _set_selected(get_font_types(), $layout, 'font'); my $text_justification_types = _set_selected(get_text_justification_types(), $layout, 'text_justify'); -my $select_text_fields = _select_format_string($layout->get_attr('format_string')); +my ($select_text_fields, $select_text_fields_cnt) = _select_format_string($layout->get_attr('format_string')); $template->param( barcode_types => $barcode_types, label_types => $label_types, font_types => $font_types, text_justification_types => $text_justification_types, - field_table => $select_text_fields, + fields => $select_text_fields, + field_count => $select_text_fields_cnt, layout_id => $layout->get_attr('layout_id') > -1 ? $layout->get_attr('layout_id') : '', layout_name => $layout->get_attr('layout_name'), guidebox => $layout->get_attr('guidebox'), -- 1.7.2.3 From nengard at bywatersolutions.com Tue Sep 6 16:43:40 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Tue, 6 Sep 2011 10:43:40 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6555 : only 10 lists show in the staff client Message-ID: <1315320220-3379-1-git-send-email-nengard@bywatersolutions.com> From: Chris Cormack Signed-off-by: Nicole C. Engard --- C4/VirtualShelves.pm | 10 +++++++--- virtualshelves/addbybiblionumber.pl | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm index df54de8..57b86da 100644 --- a/C4/VirtualShelves.pm +++ b/C4/VirtualShelves.pm @@ -203,15 +203,19 @@ sub GetRecentShelves { my @params; my $selection; if (defined $owner) { - @params = ($owner, $mincategory, $row_count); + @params = ($owner, $mincategory); $selection = ' WHERE owner = ? AND category = ?'; } else { - @params = ( $mincategory, $row_count); + @params = ( $mincategory); $selection = ' WHERE category >= ? '; } my $query = 'SELECT * FROM virtualshelves'; $query .= $selection; - $query .= ' ORDER BY lastmodified DESC LIMIT ?'; + $query .= ' ORDER BY lastmodified DESC'; + if ($row_count){ + $query .= ' LIMIT ?'; + push @params,$row_count; + } my $sth = $dbh->prepare($query); $sth->execute(@params); my $shelflist = $sth->fetchall_arrayref({}); diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl index f1ac674..1dbffbb 100755 --- a/virtualshelves/addbybiblionumber.pl +++ b/virtualshelves/addbybiblionumber.pl @@ -152,14 +152,14 @@ if ( $shelfnumber || ( $shelfnumber == -1 ) ) { # the shelf already exist. } } else { # this shelf doesn't already exist. - my $limit = 10; +# my $limit = 10; my ($shelflist); my @shelvesloop; my %shelvesloop; #grab each type of shelf, open (type 3) should not be limited by user. foreach my $shelftype (1,2,3) { - my ($shelflist) = GetRecentShelves($shelftype, $limit, $shelftype == 3 ? undef : $loggedinuser); + my ($shelflist) = GetRecentShelves($shelftype, undef, $shelftype == 3 ? undef : $loggedinuser); for my $shelf (@{ $shelflist }) { push(@shelvesloop, $shelf->{shelfnumber}); $shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname}; -- 1.7.2.3 From nengard at bywatersolutions.com Tue Sep 6 16:47:08 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Tue, 6 Sep 2011 10:47:08 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6665 : TT problem was preventing AdvancedMARCEditor pref from working when cataloguing Message-ID: <1315320428-3516-1-git-send-email-nengard@bywatersolutions.com> From: Chris Cormack Signed-off-by: Nicole C. Engard --- .../prog/en/modules/cataloguing/addbiblio.tt | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 173e0cf..7062f1b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -818,7 +818,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
    [% UNLESS ( innerloo.hide_marc ) %] - [% IF ( innerloo.advancedMARCEditor ) %] + [% IF advancedMARCEditor %] [% innerloo.tag %] [% ELSE %] [% innerloo.tag %][% innerloo.tag_lib %] [% END %] [% IF ( innerloo.repeatable ) %] @@ -856,7 +856,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
    - [% UNLESS ( subfield_loo.advancedMARCEditor ) %] + [% UNLESS advancedMARCEditor %]
    +
    [% suggestions_loo.author %]
    [% suggestions_loo.isbn %] -- 1.6.4.2 From amit.gupta at osslabs.biz Thu Sep 8 02:26:08 2011 From: amit.gupta at osslabs.biz (Amit Gupta) Date: Thu, 8 Sep 2011 05:56:08 +0530 Subject: [Koha-patches] [PATCH] Bug id:6783 - Circulation restrictions dont work when other withdrawn reasons are used Message-ID: <1315441568-5266-1-git-send-email-amit.gupta@osslabs.biz> From: Meenakshi.R Circulation restrictions work only when withdrawn reason (value 1) is selected. If ones sets up other withdrawn reasons using authorized values, and selects one of them (e.g. value 2), circulation restrictions don't work. This changes fixes this problem. Signed-off-by: Amit Gupta --- C4/Circulation.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 47068f9..520c116 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -817,7 +817,7 @@ sub CanBookBeIssued { } } } - if ( $item->{'wthdrawn'} && $item->{'wthdrawn'} == 1 ) + if ( $item->{'wthdrawn'} && $item->{'wthdrawn'} > 0 ) { $issuingimpossible{WTHDRAWN} = 1; } -- 1.6.4.2 From srdjan at catalyst.net.nz Thu Sep 8 08:23:02 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Thu, 8 Sep 2011 18:23:02 +1200 Subject: [Koha-patches] [PATCH] bug_6488: Changed searchResults() interface Take in account opachiddenitems when searching in opac Added trailing \n when parsing OpacHiddenItems to make YAML happy In-Reply-To: References: Message-ID: <1315462982-22995-1-git-send-email-srdjan@catalyst.net.nz> --- C4/Items.pm | 7 +++---- C4/Search.pm | 31 ++++++++++++++++++++----------- catalogue/search.pl | 2 +- cataloguing/addbooks.pl | 2 +- opac/opac-search.pl | 4 ++-- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index bc36dd1..0f098af 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1531,6 +1531,7 @@ sub GetHiddenItemnumbers { my @resultitems; my $yaml = C4::Context->preference('OpacHiddenItems'); + $yaml = "$yaml\n"; # YAML is anal on ending \n. Surplus does not hurt my $hidingrules; eval { $hidingrules = YAML::Load($yaml); @@ -1538,7 +1539,7 @@ sub GetHiddenItemnumbers { if ($@) { warn "Unable to parse OpacHiddenItems syspref : $@"; return (); - } else { + } my $dbh = C4::Context->dbh; # For each item @@ -1563,9 +1564,7 @@ sub GetHiddenItemnumbers { } } return @resultitems; - } - - } +} =head3 get_item_authorised_values diff --git a/C4/Search.pm b/C4/Search.pm index c3cff65..0ebef81 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1413,11 +1413,16 @@ Format results in a form suitable for passing to the template # IMO this subroutine is pretty messy still -- it's responsible for # building the HTML output for the template sub searchResults { - my ( $search_context, $searchdesc, $hits, $results_per_page, $offset, $scan, @marcresults, $hidelostitems ) = @_; + my ( $search_context, $searchdesc, $hits, $results_per_page, $offset, $scan, $marcresults ) = @_; my $dbh = C4::Context->dbh; my @newresults; - $search_context = 'opac' unless $search_context eq 'opac' or $search_context eq 'intranet'; + $search_context = 'opac' if !$search_context || $search_context ne 'intranet'; + my ($is_opac, $hidelostitems); + if ($search_context eq 'opac') { + $hidelostitems = C4::Context->preference('hidelostitems'); + $is_opac = 1; + } #Build branchnames hash #find branchname @@ -1484,7 +1489,7 @@ sub searchResults { # loop through all of the records we've retrieved for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) { - my $marcrecord = MARC::File::USMARC::decode( $marcresults[$i] ); + my $marcrecord = MARC::File::USMARC::decode( $marcresults->[$i] ); $fw = $scan ? undef : $bibliotag < 10 @@ -1576,11 +1581,12 @@ sub searchResults { my $other_count = 0; my $wthdrawn_count = 0; my $itemlost_count = 0; + my $hideatopac_count = 0; my $itembinding_count = 0; my $itemdamaged_count = 0; my $item_in_transit_count = 0; my $can_place_holds = 0; - my $item_onhold_count = 0; + my $item_onhold_count = 0; my $items_count = scalar(@fields); my $maxitems = ( C4::Context->preference('maxItemsinSearchResults') ) @@ -1597,9 +1603,10 @@ sub searchResults { } # Hidden items - my @items = ($item); - my (@hiddenitems) = GetHiddenItemnumbers(@items); - $item->{'hideatopac'} = 1 if (@hiddenitems); + if ($is_opac) { + my @hiddenitems = GetHiddenItemnumbers($item); + $item->{'hideatopac'} = @hiddenitems; + } my $hbranch = C4::Context->preference('HomeOrHoldingBranch') eq 'homebranch' ? 'homebranch' : 'holdingbranch'; my $otherbranch = C4::Context->preference('HomeOrHoldingBranch') eq 'homebranch' ? 'holdingbranch' : 'homebranch'; @@ -1683,6 +1690,7 @@ sub searchResults { $wthdrawn_count++ if $item->{wthdrawn}; $itemlost_count++ if $item->{itemlost}; $itemdamaged_count++ if $item->{damaged}; + $hideatopac_count++ if $item->{hideatopac}; $item_in_transit_count++ if $transfertwhen ne ''; $item_onhold_count++ if $reservestatus eq 'Waiting'; $item->{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan}; @@ -1721,6 +1729,10 @@ sub searchResults { } } } # notforloan, item level and biblioitem level + + next if $is_opac && $hideatopac_count >= $items_count; + next if $hidelostitems && $itemlost_count >= $items_count; + my ( $availableitemscount, $onloanitemscount, $otheritemscount ); $maxitems = ( C4::Context->preference('maxItemsinSearchResults') ) @@ -1807,10 +1819,7 @@ sub searchResults { $oldbiblio->{'alternateholdings_count'} = $alternateholdingscount; } - push( @newresults, $oldbiblio ) - if(not $hidelostitems - or (($items_count > $itemlost_count ) - && $hidelostitems)); + push( @newresults, $oldbiblio ); } return @newresults; diff --git a/catalogue/search.pl b/catalogue/search.pl index b9f9ed3..604b895 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -547,7 +547,7 @@ for (my $i=0;$i<@servers;$i++) { $hits = $results_hashref->{$server}->{"hits"}; my $page = $cgi->param('page') || 0; my @newresults = searchResults('intranet', $query_desc, $hits, $results_per_page, $offset, $scan, - @{$results_hashref->{$server}->{"RECORDS"}}); + $results_hashref->{$server}->{"RECORDS"}); $total = $total + $results_hashref->{$server}->{"hits"}; ## If there's just one result, redirect to the detail page if ($total == 1) { diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl index 5e89ef8..38e8024 100755 --- a/cataloguing/addbooks.pl +++ b/cataloguing/addbooks.pl @@ -86,7 +86,7 @@ if ($query) { # format output # SimpleSearch() give the results per page we want, so 0 offet here my $total = @{$marcresults}; - my @newresults = searchResults( 'intranet', $query, $total, $results_per_page, 0, 0, @{$marcresults} ); + my @newresults = searchResults( 'intranet', $query, $total, $results_per_page, 0, 0, $marcresults ); $template->param( total => $total_hits, query => $query, diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 8f6b67a..6902633 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -467,12 +467,12 @@ for (my $i=0;$i<@servers;$i++) { # we want as specified by $offset and $results_per_page, # we need to set the offset parameter of searchResults to 0 my @group_results = searchResults( 'opac', $query_desc, $group->{'group_count'},$results_per_page, 0, $scan, - @{ $group->{"RECORDS"} }, C4::Context->preference('hidelostitems')); + $group->{"RECORDS"}); push @newresults, { group_label => $group->{'group_label'}, GROUP_RESULTS => \@group_results }; } } else { @newresults = searchResults('opac', $query_desc, $hits, $results_per_page, $offset, $scan, - @{$results_hashref->{$server}->{"RECORDS"}},, C4::Context->preference('hidelostitems')); + $results_hashref->{$server}->{"RECORDS"}); } my $tag_quantity; if (C4::Context->preference('TagsEnabled') and -- 1.6.5 From robin at catalyst.net.nz Thu Sep 8 08:35:14 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Thu, 8 Sep 2011 18:35:14 +1200 Subject: [Koha-patches] [PATCH] Bug 6857: display a charge warning alert for reserves Message-ID: <1315463714-16181-1-git-send-email-robin@catalyst.net.nz> If a user is placing a reserve on the OPAC, this'll let them know that it's going to cost them. Author: Chris Cormack --- C4/Members.pm | 6 ++++-- .../opac-tmpl/prog/en/modules/opac-reserve.tt | 5 +++++ opac/opac-reserve.pl | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index ddab777..531582d 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -2,6 +2,7 @@ package C4::Members; # Copyright 2000-2003 Katipo Communications # Copyright 2010 BibLibre +# Parts Copyright 2010 Catalyst IT # # This file is part of Koha. # @@ -352,11 +353,11 @@ sub GetMemberDetails { my $query; my $sth; if ($borrowernumber) { - $sth = $dbh->prepare("select borrowers.*,category_type,categories.description from borrowers left join categories on borrowers.categorycode=categories.categorycode where borrowernumber=?"); + $sth = $dbh->prepare("SELECT borrowers.*,category_type,categories.description,reservefee FROM borrowers LEFT JOIN categories ON borrowers.categorycode=categories.categorycode WHERE borrowernumber=?"); $sth->execute($borrowernumber); } elsif ($cardnumber) { - $sth = $dbh->prepare("select borrowers.*,category_type,categories.description from borrowers left join categories on borrowers.categorycode=categories.categorycode where cardnumber=?"); + $sth = $dbh->prepare("SELECT borrowers.*,category_type,categories.description,reservefee FROM borrowers LEFT JOIN categories ON borrowers.categorycode=categories.categorycode WHERE cardnumber=?"); $sth->execute($cardnumber); } else { @@ -386,6 +387,7 @@ sub GetMemberDetails { $sth->execute( $borrower->{'categorycode'} ); my $enrolment = $sth->fetchrow; $borrower->{'enrolmentperiod'} = $enrolment; + return ($borrower); #, $flags, $accessflagshash); } diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt index 370ebdc..c70adcc 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt @@ -220,6 +220,11 @@ [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %]) [% END %] [% END %] + [% IF (RESERVE_CHARGE) %] +
    + There is a charge of [% RESERVE_CHARGE %] for placing this reserve +
    + [% END %]
    diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index a92a976..ab02afe 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -54,6 +54,10 @@ sub get_out ($$$) { # get borrower information .... my ( $borr ) = GetMemberDetails( $borrowernumber ); +# Pass through any reserve charge +if ($borr->{reservefee} > 0){ + $template->param( RESERVE_CHARGE => sprintf("%.2f",$borr->{reservefee})); +} # get branches and itemtypes my $branches = GetBranches(); my $itemTypes = GetItemTypes(); -- 1.7.4.1 From amit.gupta at osslabs.biz Thu Sep 8 03:45:55 2011 From: amit.gupta at osslabs.biz (Amit Gupta) Date: Thu, 8 Sep 2011 07:15:55 +0530 Subject: [Koha-patches] [PATCH] Bug 6811 - Send renewal notice. Message-ID: <1315446355-10945-1-git-send-email-amit.gupta@osslabs.biz> Similar to checkin, checkout notices already present. Renewal notices can be set in messaging preferences at borrower and membership category level. Contents will be picked up from a notice template. --- C4/Circulation.pm | 17 +++++++++++++++++ .../data/mysql/en/mandatory/sample_notices.sql | 1 + .../optional/sample_notices_message_attributes.sql | 3 ++- .../optional/sample_notices_message_transports.sql | 4 +++- .../data/mysql/es-ES/mandatory/sample_notices.sql | 1 + .../optional/sample_notices_message_attributes.sql | 4 ++-- .../optional/sample_notices_message_transports.sql | 4 +++- .../mysql/fr-FR/1-Obligatoire/sample_notices.sql | 1 + .../sample_notices_message_attributes.sql | 4 ++-- .../sample_notices_message_transports.sql | 4 +++- installer/data/mysql/it-IT/necessari/notices.sql | 1 + .../sample_notices_message_attributes.sql | 3 ++- .../sample_notices_message_transports.sql | 5 +++-- .../mysql/nb-NO/1-Obligatorisk/sample_notices.sql | 1 + .../sample_notices_message_attributes.sql | 3 ++- .../sample_notices_message_transports.sql | 4 +++- .../data/mysql/pl-PL/mandatory/sample_notices.sql | 1 + .../optional/sample_notices_message_attributes.sql | 3 ++- .../optional/sample_notices_message_transports.sql | 4 +++- .../data/mysql/ru-RU/mandatory/sample_notices.sql | 1 + .../optional/sample_notices_message_attributes.sql | 3 ++- .../optional/sample_notices_message_transports.sql | 4 +++- .../data/mysql/uk-UA/mandatory/sample_notices.sql | 1 + .../optional/sample_notices_message_attributes.sql | 4 +++- .../optional/sample_notices_message_transports.sql | 4 +++- installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ .../prog/en/includes/messaging-preference-form.inc | 1 + .../prog/en/modules/admin/categorie.tt | 1 + .../opac-tmpl/prog/en/modules/opac-messaging.tt | 1 + kohaversion.pl | 2 +- 30 files changed, 84 insertions(+), 20 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 47068f9..400c857 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2298,6 +2298,22 @@ sub AddRenewal { } # Log the renewal UpdateStats( $branch, 'renew', $charge, '', $itemnumber, $item->{itype}, $borrowernumber); + my $borrower = GetMemberDetails( $borrowernumber); + my $circulation_alert = 'C4::ItemCirculationAlertPreference'; + my %conditions = ( + branchcode => $branch, + categorycode => $borrower->{categorycode}, + item_type => $item->{itype}, + notification => 'ITEMRENEW', + ); + if ($circulation_alert->is_enabled_for(\%conditions)) { + SendCirculationAlert({ + type => 'ITEMRENEW', + item => $item, + borrower => $borrower, + branch => $branch, + }); + } return $datedue; } @@ -2617,6 +2633,7 @@ sub SendCirculationAlert { my %message_name = ( CHECKIN => 'Item_Check_in', CHECKOUT => 'Item_Checkout', + ITEMRENEW => 'Item_Renew', ); my $borrower_preferences = C4::Members::Messaging::GetMessagingPreferences({ borrowernumber => $borrower->{borrowernumber}, diff --git a/installer/data/mysql/en/mandatory/sample_notices.sql b/installer/data/mysql/en/mandatory/sample_notices.sql index 689fa0f..4bb8d4f 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.sql +++ b/installer/data/mysql/en/mandatory/sample_notices.sql @@ -11,6 +11,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <>\r\n<>\r\n<>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<> <>\r\n<>\r\n<> <>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<> <> <>\r\n\r\nYou have a hold available for pickup as of <>:\r\n\r\nTitle: <>\r\nAuthor: <>\r\nCopy: <>\r\n'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<>\r\n----\r\nThank you for visiting <>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<>\r\n----\r\nThank you for visiting <>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/en/optional/sample_notices_message_attributes.sql b/installer/data/mysql/en/optional/sample_notices_message_attributes.sql index a7a6032..459b913 100644 --- a/installer/data/mysql/en/optional/sample_notices_message_attributes.sql +++ b/installer/data/mysql/en/optional/sample_notices_message_attributes.sql @@ -5,5 +5,6 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); diff --git a/installer/data/mysql/en/optional/sample_notices_message_transports.sql b/installer/data/mysql/en/optional/sample_notices_message_transports.sql index ae68378..60ddd52 100644 --- a/installer/data/mysql/en/optional/sample_notices_message_transports.sql +++ b/installer/data/mysql/en/optional/sample_notices_message_transports.sql @@ -14,4 +14,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/es-ES/mandatory/sample_notices.sql b/installer/data/mysql/es-ES/mandatory/sample_notices.sql index 689fa0f..4bb8d4f 100644 --- a/installer/data/mysql/es-ES/mandatory/sample_notices.sql +++ b/installer/data/mysql/es-ES/mandatory/sample_notices.sql @@ -11,6 +11,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/es-ES/optional/sample_notices_message_attributes.sql b/installer/data/mysql/es-ES/optional/sample_notices_message_attributes.sql index a7a6032..4f2f6ef 100644 --- a/installer/data/mysql/es-ES/optional/sample_notices_message_attributes.sql +++ b/installer/data/mysql/es-ES/optional/sample_notices_message_attributes.sql @@ -5,5 +5,5 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); - +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); diff --git a/installer/data/mysql/es-ES/optional/sample_notices_message_transports.sql b/installer/data/mysql/es-ES/optional/sample_notices_message_transports.sql index ae68378..60ddd52 100644 --- a/installer/data/mysql/es-ES/optional/sample_notices_message_transports.sql +++ b/installer/data/mysql/es-ES/optional/sample_notices_message_transports.sql @@ -14,4 +14,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql index 977e59d..8fcb471 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql @@ -13,6 +13,7 @@ VALUES ('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup at <<branches.branchname>>', '<<branches.branchname>>\n<<branches.branchaddress1>>\n<<branches.branchaddress2>>\n\n\nChange Service Requested\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>>\n<<borrowers.address>>\n<<borrowers.city>> <<borrowers.zipcode>>\n\n\n\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\n\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.sql b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.sql index 8e919e9..367bf24 100644 --- a/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.sql +++ b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.sql @@ -5,5 +5,5 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); - +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); diff --git a/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.sql b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.sql index ae68378..60ddd52 100644 --- a/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.sql +++ b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.sql @@ -14,4 +14,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/it-IT/necessari/notices.sql b/installer/data/mysql/it-IT/necessari/notices.sql index 689fa0f..4bb8d4f 100644 --- a/installer/data/mysql/it-IT/necessari/notices.sql +++ b/installer/data/mysql/it-IT/necessari/notices.sql @@ -11,6 +11,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/it-IT/necessari/sample_notices_message_attributes.sql b/installer/data/mysql/it-IT/necessari/sample_notices_message_attributes.sql index 63d07fd..672d6da 100644 --- a/installer/data/mysql/it-IT/necessari/sample_notices_message_attributes.sql +++ b/installer/data/mysql/it-IT/necessari/sample_notices_message_attributes.sql @@ -7,5 +7,6 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); SET FOREIGN_KEY_CHECKS=1; diff --git a/installer/data/mysql/it-IT/necessari/sample_notices_message_transports.sql b/installer/data/mysql/it-IT/necessari/sample_notices_message_transports.sql index c1b1f29..1961d85 100644 --- a/installer/data/mysql/it-IT/necessari/sample_notices_message_transports.sql +++ b/installer/data/mysql/it-IT/necessari/sample_notices_message_transports.sql @@ -18,6 +18,7 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); - +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); SET FOREIGN_KEY_CHECKS=1; diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql index cdb5529..45d0e67 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql @@ -32,6 +32,7 @@ VALUES ('circulation','ODUE','Purring','Purring p?? dokument','<<borrowers.first ('reserves', 'HOLD_PRINT', 'Hentemelding (p?? papir)', 'Hentemelding', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nDu har et reservert dokument som kan hentes fra <<reserves.waitingdate>>:\r\n\r\nTittel: <<biblio.title>>\r\nForfatter: <<biblio.author>>\r\nEksemplar: <<items.copynumber>>\r\n'), ('circulation','CHECKIN','Innlevering','Melding om innlevering','F??lgende dokument har blitt innlevert:\r\n----\r\n<<biblio.title>>\r\n----\r\nVennlig hilsen\r\nBiblioteket'), ('circulation','CHECKOUT','Utl??n','Melding om utl??n','F??lgende dokument har blitt l??nt ut:\r\n----\r\n<<biblio.title>>\r\n----\r\nVennlig hilsen\r\nBiblioteket'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Melding om reservasjon', 'Melding om reservasjon','F??lgende dokument har blitt reservert : <<title>> (<<biblionumber>>) av <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Forslag godtatt', 'Innkj??psforslag godtatt','<<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foresl??tt at biblioteket kj??per inn <<suggestions.title>> av <<suggestions.author>>.\n\nBiblioteket har vurdert forslaget i dag. Dokumentet vil bli bestilt s?? fort det lar seg gj??re. Du vil f?? en ny melding n??r bestillingen er gjort, og n??r dokumentet ankommer biblioteket.\n\nEr det noe du lurer p??, vennligst kontakt oss p?? <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Foresl??tt dokument tilgjengelig', 'Foresl??tt dokument tilgjengelig','<<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foresl??tt at biblioteket kj??per inn <<suggestions.title>> av <<suggestions.author>>.\n\nVi har gleden av ?? informere deg om at dokumentet n?? er innlemmet i samlingen.\n\nEr det noe du lurer p??, vennligst kontakt oss p?? <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_attributes.sql b/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_attributes.sql index a7a6032..459b913 100644 --- a/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_attributes.sql +++ b/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_attributes.sql @@ -5,5 +5,6 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); diff --git a/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_transports.sql b/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_transports.sql index ae68378..60ddd52 100644 --- a/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_transports.sql +++ b/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_transports.sql @@ -14,4 +14,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql index 6be2eb8..916f05d 100644 --- a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql +++ b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql @@ -13,6 +13,7 @@ VALUES ('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/pl-PL/optional/sample_notices_message_attributes.sql b/installer/data/mysql/pl-PL/optional/sample_notices_message_attributes.sql index 8e919e9..debe7d5 100644 --- a/installer/data/mysql/pl-PL/optional/sample_notices_message_attributes.sql +++ b/installer/data/mysql/pl-PL/optional/sample_notices_message_attributes.sql @@ -5,5 +5,6 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); diff --git a/installer/data/mysql/pl-PL/optional/sample_notices_message_transports.sql b/installer/data/mysql/pl-PL/optional/sample_notices_message_transports.sql index ae68378..60ddd52 100644 --- a/installer/data/mysql/pl-PL/optional/sample_notices_message_transports.sql +++ b/installer/data/mysql/pl-PL/optional/sample_notices_message_transports.sql @@ -14,4 +14,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql index 689fa0f..4bb8d4f 100644 --- a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql +++ b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql @@ -11,6 +11,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/ru-RU/optional/sample_notices_message_attributes.sql b/installer/data/mysql/ru-RU/optional/sample_notices_message_attributes.sql index c9d9bd1..af73e8b 100644 --- a/installer/data/mysql/ru-RU/optional/sample_notices_message_attributes.sql +++ b/installer/data/mysql/ru-RU/optional/sample_notices_message_attributes.sql @@ -7,5 +7,6 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); diff --git a/installer/data/mysql/ru-RU/optional/sample_notices_message_transports.sql b/installer/data/mysql/ru-RU/optional/sample_notices_message_transports.sql index ade4d03..6433ab5 100644 --- a/installer/data/mysql/ru-RU/optional/sample_notices_message_transports.sql +++ b/installer/data/mysql/ru-RU/optional/sample_notices_message_transports.sql @@ -15,4 +15,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql index 358205b..e081454 100644 --- a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql +++ b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql @@ -10,6 +10,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>\r\n<<branches.branchcity>> <<branches.branchzip>>'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/uk-UA/optional/sample_notices_message_attributes.sql b/installer/data/mysql/uk-UA/optional/sample_notices_message_attributes.sql index 75e2793..a8738a0 100644 --- a/installer/data/mysql/uk-UA/optional/sample_notices_message_attributes.sql +++ b/installer/data/mysql/uk-UA/optional/sample_notices_message_attributes.sql @@ -7,5 +7,7 @@ values (2, 'Advance_Notice' , 1), (4, 'Hold_Filled' , 0), (5, 'Item_Check_in' , 0), -(6, 'Item_Checkout' , 0); +(6, 'Item_Checkout' , 0), +(7, 'Item_Renew' , 0); + diff --git a/installer/data/mysql/uk-UA/optional/sample_notices_message_transports.sql b/installer/data/mysql/uk-UA/optional/sample_notices_message_transports.sql index ade4d03..6433ab5 100644 --- a/installer/data/mysql/uk-UA/optional/sample_notices_message_transports.sql +++ b/installer/data/mysql/uk-UA/optional/sample_notices_message_transports.sql @@ -15,4 +15,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bdfc9ac..9725285 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4439,6 +4439,20 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.05.00.011"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { +$dbh->do(q{ + INSERT INTO `letter` (`module`, `code`, `name`, `title`, `content`) VALUES + ('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'); + }); + $dbh->do(q{INSERT INTO message_attributes (message_attribute_id, message_name, takes_days) VALUES (7, 'Item_Renew', 0);}); + $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (7, 'email', 0, 'circulation', 'ITEMRENEW');}); + $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (7, 'sms', 0, 'circulation', 'ITEMRENEW');}); + print "Upgrade to $DBversion done (Add letter for Item Renew notifications)\n"; + SetVersion ($DBversion); +} + + =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc index 7ece680..4f55666 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc @@ -33,6 +33,7 @@ [% ELSIF ( messaging_preference.Hold_Filled ) %]Hold Filled [% ELSIF ( messaging_preference.Item_Check_in ) %]Item Check-in [% ELSIF ( messaging_preference.Item_Checkout ) %]Item Checkout + [% ELSIF ( messaging_preference.Item_Renew ) %]Item Renew [% ELSE %]Unknown [% END %]</td> [% IF ( messaging_preference.takes_days ) %] <td> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt index b50012f..f9a5e70 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt @@ -349,6 +349,7 @@ Confirm Deletion of Category [% categorycode |html %][% END %]</legend> [% ELSIF ( prefs.Hold_Filled ) %]Hold Filled [% ELSIF ( prefs.Item_Check_in ) %]Item Check-in [% ELSIF ( prefs.Item_Checkout ) %]Item Checkout + [% ELSIF ( prefs.Item_Renew ) %]Item Renew [% ELSE %]Unknown [% END %]: <strong>[% transport.transport %]</strong><br /> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt index ebb1e26..851a9cb 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt @@ -45,6 +45,7 @@ [% ELSIF ( messaging_preference.Hold_Filled ) %]Hold Filled [% ELSIF ( messaging_preference.Item_Check_in ) %]Item Check-in [% ELSIF ( messaging_preference.Item_Checkout ) %]Item Checkout + [% ELSIF ( messaging_preference.Item_Renew ) %]Item Renew [% ELSE %]Unknown [% END %]</td> [% IF ( messaging_preference.takes_days ) %] <td><select name="[% messaging_preference.message_attribute_id %]-DAYS"> diff --git a/kohaversion.pl b/kohaversion.pl index 5b72642..f864378 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts : use strict; sub kohaversion { - our $VERSION = '3.05.00.010'; + our $VERSION = '3.05.00.011'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 1.6.4.2 From amit.gupta at osslabs.biz Thu Sep 8 04:23:26 2011 From: amit.gupta at osslabs.biz (Amit Gupta) Date: Thu, 8 Sep 2011 07:53:26 +0530 Subject: [Koha-patches] [PATCH] Bug 6761 - Longer userid field Message-ID: <1315448606-14089-1-git-send-email-amit.gupta@osslabs.biz> From: Navya <navya.vp at osslabs.biz> Some libraries use email ids as userids. The current length of the userid field is 30 and is not sufficient to accomodate some email addresses. This change will increase the length to 75. Signed-off-by: Amit Gupta <amit.gupta at osslabs.biz> --- installer/data/mysql/kohastructure.sql | 2 +- installer/data/mysql/updatedatabase.pl | 6 ++++++ kohaversion.pl | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 13fa53d..d5c91e4 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -244,7 +244,7 @@ CREATE TABLE `borrowers` ( `sex` varchar(1) default NULL, `password` varchar(30) default NULL, `flags` int(11) default NULL, - `userid` varchar(30) default NULL, + `userid` varchar(75) default NULL, `opacnote` mediumtext, `contactnote` varchar(255) default NULL, `sort1` varchar(80) default NULL, diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bdfc9ac..e093645 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4439,6 +4439,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.05.00.011"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE `borrowers` MODIFY `userid` VARCHAR(75);"); + print "Modified userid column length into 75 in borrowers\n"; + SetVersion($DBversion); +} =head1 FUNCTIONS diff --git a/kohaversion.pl b/kohaversion.pl index 5b72642..f864378 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts : use strict; sub kohaversion { - our $VERSION = '3.05.00.010'; + our $VERSION = '3.05.00.011'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 1.6.4.2 From nengard at bywatersolutions.com Thu Sep 8 03:19:20 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 7 Sep 2011 21:19:20 -0400 Subject: [Koha-patches] [PATCH] Bug 6716: Document suggestions table Message-ID: <1315444760-2178-1-git-send-email-nengard@bywatersolutions.com> This patch documents the suggestions database table. Several fields appear to be unused: * volumedesc * publicationyear * mailoverseeing They are left undocumented by this patch. --- installer/data/mysql/kohastructure.sql | 58 ++++++++++++++++---------------- 1 files changed, 29 insertions(+), 29 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 13fa53d..6d46afe 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1821,38 +1821,38 @@ CREATE TABLE `subscriptionroutinglist` ( -- DROP TABLE IF EXISTS `suggestions`; -CREATE TABLE `suggestions` ( - `suggestionid` int(8) NOT NULL auto_increment, - `suggestedby` int(11) NOT NULL default 0, - `suggesteddate` date NOT NULL default 0, - `managedby` int(11) default NULL, - `manageddate` date default NULL, - acceptedby INT(11) default NULL, - accepteddate date default NULL, - rejectedby INT(11) default NULL, - rejecteddate date default NULL, - `STATUS` varchar(10) NOT NULL default '', - `note` mediumtext, - `author` varchar(80) default NULL, - `title` varchar(80) default NULL, - `copyrightdate` smallint(6) default NULL, - `publishercode` varchar(255) default NULL, - `date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, +CREATE TABLE `suggestions` ( -- purchase suggestions + `suggestionid` int(8) NOT NULL auto_increment, -- unique identifier assigned automatically by Koha + `suggestedby` int(11) NOT NULL default 0, -- borrowernumber for the person making the suggestion, foreign key linking to the borrowers table + `suggesteddate` date NOT NULL default 0, -- date the suggestion was submitted + `managedby` int(11) default NULL, -- borrowernumber for the librarian managing the suggestion, foreign key linking to the borrowers table + `manageddate` date default NULL, -- date the suggestion was updated + acceptedby INT(11) default NULL, -- borrowernumber for the librarian who accepted the suggestion, foreign key linking to the borrowers table + accepteddate date default NULL, -- date the suggestion was marked as accepted + rejectedby INT(11) default NULL, -- borrowernumber for the librarian who rejected the suggestion, foreign key linking to the borrowers table + rejecteddate date default NULL, -- date the suggestion was marked as rejected + `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED) + `note` mediumtext, -- note entered on the suggestion + `author` varchar(80) default NULL, -- author of the suggested item + `title` varchar(80) default NULL, -- title of the suggested item + `copyrightdate` smallint(6) default NULL, -- copyright date of the suggested item + `publishercode` varchar(255) default NULL, -- publisher of the suggested item + `date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time the suggestion was updated `volumedesc` varchar(255) default NULL, `publicationyear` smallint(6) default 0, - `place` varchar(255) default NULL, - `isbn` varchar(30) default NULL, + `place` varchar(255) default NULL, -- publication place of the suggested item + `isbn` varchar(30) default NULL, -- isbn of the suggested item `mailoverseeing` smallint(1) default 0, - `biblionumber` int(11) default NULL, - `reason` text, - budgetid INT(11), - branchcode VARCHAR(10) default NULL, - collectiontitle text default NULL, - itemtype VARCHAR(30) default NULL, - quantity SMALLINT(6) default NULL, - currency VARCHAR(3) default NULL, - price DECIMAL(28,6) default NULL, - total DECIMAL(28,6) default NULL, + `biblionumber` int(11) default NULL, -- foreign key linking the suggestion to the biblio table after the suggestion has been ordered + `reason` text, -- reason for making the suggestion + budgetid INT(11), -- foreign key linking the suggested budget to the aqbudgets table + branchcode VARCHAR(10) default NULL, -- foreign key linking the suggested branch to the branches table + collectiontitle text default NULL, -- collection name for the suggested item + itemtype VARCHAR(30) default NULL, -- suggested item type + quantity SMALLINT(6) default NULL, -- suggested quantity to be purchased + currency VARCHAR(3) default NULL, -- suggested currency for the suggested price + price DECIMAL(28,6) default NULL, -- suggested price + total DECIMAL(28,6) default NULL, -- suggested total cost (price*quantity updated for currency) PRIMARY KEY (`suggestionid`), KEY `suggestedby` (`suggestedby`), KEY `managedby` (`managedby`) -- 1.7.2.3 From nengard at bywatersolutions.com Thu Sep 8 03:48:49 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 7 Sep 2011 21:48:49 -0400 Subject: [Koha-patches] [PATCH] Bug 6716: Document suggestions DB table Message-ID: <1315446529-2372-1-git-send-email-nengard@bywatersolutions.com> This patch documents the suggestions database table. Several fields appear to be unused: * volumedesc * publicationyear * mailoverseeing They are left undocumented by this patch. --- installer/data/mysql/kohastructure.sql | 58 ++++++++++++++++---------------- 1 files changed, 29 insertions(+), 29 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 13fa53d..6d46afe 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1821,38 +1821,38 @@ CREATE TABLE `subscriptionroutinglist` ( -- DROP TABLE IF EXISTS `suggestions`; -CREATE TABLE `suggestions` ( - `suggestionid` int(8) NOT NULL auto_increment, - `suggestedby` int(11) NOT NULL default 0, - `suggesteddate` date NOT NULL default 0, - `managedby` int(11) default NULL, - `manageddate` date default NULL, - acceptedby INT(11) default NULL, - accepteddate date default NULL, - rejectedby INT(11) default NULL, - rejecteddate date default NULL, - `STATUS` varchar(10) NOT NULL default '', - `note` mediumtext, - `author` varchar(80) default NULL, - `title` varchar(80) default NULL, - `copyrightdate` smallint(6) default NULL, - `publishercode` varchar(255) default NULL, - `date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, +CREATE TABLE `suggestions` ( -- purchase suggestions + `suggestionid` int(8) NOT NULL auto_increment, -- unique identifier assigned automatically by Koha + `suggestedby` int(11) NOT NULL default 0, -- borrowernumber for the person making the suggestion, foreign key linking to the borrowers table + `suggesteddate` date NOT NULL default 0, -- date the suggestion was submitted + `managedby` int(11) default NULL, -- borrowernumber for the librarian managing the suggestion, foreign key linking to the borrowers table + `manageddate` date default NULL, -- date the suggestion was updated + acceptedby INT(11) default NULL, -- borrowernumber for the librarian who accepted the suggestion, foreign key linking to the borrowers table + accepteddate date default NULL, -- date the suggestion was marked as accepted + rejectedby INT(11) default NULL, -- borrowernumber for the librarian who rejected the suggestion, foreign key linking to the borrowers table + rejecteddate date default NULL, -- date the suggestion was marked as rejected + `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED) + `note` mediumtext, -- note entered on the suggestion + `author` varchar(80) default NULL, -- author of the suggested item + `title` varchar(80) default NULL, -- title of the suggested item + `copyrightdate` smallint(6) default NULL, -- copyright date of the suggested item + `publishercode` varchar(255) default NULL, -- publisher of the suggested item + `date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time the suggestion was updated `volumedesc` varchar(255) default NULL, `publicationyear` smallint(6) default 0, - `place` varchar(255) default NULL, - `isbn` varchar(30) default NULL, + `place` varchar(255) default NULL, -- publication place of the suggested item + `isbn` varchar(30) default NULL, -- isbn of the suggested item `mailoverseeing` smallint(1) default 0, - `biblionumber` int(11) default NULL, - `reason` text, - budgetid INT(11), - branchcode VARCHAR(10) default NULL, - collectiontitle text default NULL, - itemtype VARCHAR(30) default NULL, - quantity SMALLINT(6) default NULL, - currency VARCHAR(3) default NULL, - price DECIMAL(28,6) default NULL, - total DECIMAL(28,6) default NULL, + `biblionumber` int(11) default NULL, -- foreign key linking the suggestion to the biblio table after the suggestion has been ordered + `reason` text, -- reason for making the suggestion + budgetid INT(11), -- foreign key linking the suggested budget to the aqbudgets table + branchcode VARCHAR(10) default NULL, -- foreign key linking the suggested branch to the branches table + collectiontitle text default NULL, -- collection name for the suggested item + itemtype VARCHAR(30) default NULL, -- suggested item type + quantity SMALLINT(6) default NULL, -- suggested quantity to be purchased + currency VARCHAR(3) default NULL, -- suggested currency for the suggested price + price DECIMAL(28,6) default NULL, -- suggested price + total DECIMAL(28,6) default NULL, -- suggested total cost (price*quantity updated for currency) PRIMARY KEY (`suggestionid`), KEY `suggestedby` (`suggestedby`), KEY `managedby` (`managedby`) -- 1.7.2.3 From nengard at gmail.com Thu Sep 8 14:45:23 2011 From: nengard at gmail.com (Nicole Engard) Date: Thu, 8 Sep 2011 08:45:23 -0400 Subject: [Koha-patches] [PATCH] Bug 6716: Document suggestions table In-Reply-To: <1315444760-2178-1-git-send-email-nengard@bywatersolutions.com> References: <1315444760-2178-1-git-send-email-nengard@bywatersolutions.com> Message-ID: <CAC0K6VG-nMvhM_btftyTM5kYGO7kuDLR-1vJCWrE0USjPt9oBQ@mail.gmail.com> ignore this ... On Wed, Sep 7, 2011 at 9:19 PM, Nicole C. Engard <nengard at bywatersolutions.com> wrote: > This patch documents the suggestions database table. ?Several fields > appear to be unused: > > * volumedesc > * publicationyear > * mailoverseeing > > They are left undocumented by this patch. From cnighswonger at foundations.edu Thu Sep 8 15:19:57 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Thu, 8 Sep 2011 09:19:57 -0400 Subject: [Koha-patches] [PATCH] Bug 6841 - A member with cataloging permissions cannot change branches (when independent branches is set on) Message-ID: <1315487997-18074-1-git-send-email-cnighswonger@foundations.edu> From: Liz Rea <lrea at nekls.org> This patch does a couple of things. 1. Changes permission over all to set branch printer (change branch/Set Library) from "circulation" privileges to "view catalogue" permissions. Reasoning: anyone who has privileges to view catalogue could reasonably be expected to perhaps need to change the set branch, but you might have people who don't have circulate permissions who need to change the branch, centralized cataloguing, for example. Those people would never circ and wouldn't need circ privileges, but *would* need to be able to change the set branch. 2. Changes the template flags to see the "Set Library" link with independent branches set from "manage users" to "manage users or edit catalogue." Reasoning: even with indy branches on, there might be reasons for catalogers to be able to change the set branch (that reason was the impetus for this patch in the first place). To test: Create a user with only "View Catalogue" Permissions (no circulate permissions), that user should be able to change set library with Independent branches OFF. With independent branches on, give a user edit catalogue permissions. That user should be able to change set library. I want to add that this patch was specifically written in response to chris_n's bug report. It may not be practical for these changes to be in mainline, but I haven't thought of any reasons why it would be explicitly bad. That doesn't mean there aren't some, though. Signed-off-by: Chris Nighswonger <cnighswonger at foundations.edu> --- circ/selectbranchprinter.pl | 3 ++- .../intranet-tmpl/prog/en/includes/header.inc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/circ/selectbranchprinter.pl b/circ/selectbranchprinter.pl index 5ec6c11..b5adcfc 100755 --- a/circ/selectbranchprinter.pl +++ b/circ/selectbranchprinter.pl @@ -31,13 +31,14 @@ use C4::Branch; # GetBranches GetBranchesLoop # this will be the script that chooses branch and printer settings.... my $query = CGI->new(); + my ( $template, $borrowernumber, $cookie ) = get_template_and_user({ template_name => "circ/selectbranchprinter.tmpl", query => $query, type => "intranet", debug => 1, authnotrequired => 0, - flagsrequired => { circulate => "circulate_remaining_permissions" }, + flagsrequired => { catalogue => 1, }, }); my $sessionID = $query->cookie("CGISESSID"); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 0db885a..0e91820 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -52,7 +52,7 @@ [% ELSE %] <strong>[% LoginBranchname %]</strong> [% IF ( IndependantBranches ) %] - [% IF ( CAN_user_management ) %] + [% IF ( CAN_user_management || CAN_user_editcatalogue_edit_catalogue ) %] (<a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set library</a>) [% END %] [% ELSE %] -- 1.7.0.4 From nengard at bywatersolutions.com Thu Sep 8 04:35:38 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 7 Sep 2011 22:35:38 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6807 - Add ISBN filter to advanced order search. Message-ID: <1315449338-2619-1-git-send-email-nengard@bywatersolutions.com> From: Amit Gupta <amit.gupta at osslabs.biz> Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- C4/Acquisition.pm | 8 ++++++++ acqui/histsearch.pl | 5 ++++- .../prog/en/modules/acqui/histsearch.tt | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index f682256..cfc261f 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -1530,6 +1530,7 @@ sub GetHistory { my %params = @_; my $title = $params{title}; my $author = $params{author}; + my $isbn = $params{isbn}; my $name = $params{name}; my $from_placed_on = $params{from_placed_on}; my $to_placed_on = $params{to_placed_on}; @@ -1546,6 +1547,7 @@ sub GetHistory { SELECT biblio.title, biblio.author, + biblioitems.isbn, aqorders.basketno, aqbasket.basketname, aqbasket.basketgroupid, @@ -1564,6 +1566,7 @@ sub GetHistory { LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno LEFT JOIN aqbasketgroups ON aqbasket.basketgroupid=aqbasketgroups.id LEFT JOIN aqbooksellers ON aqbasket.booksellerid=aqbooksellers.id + LEFT JOIN biblioitems ON biblioitems.biblionumber=aqorders.biblionumber LEFT JOIN biblio ON biblio.biblionumber=aqorders.biblionumber"; $query .= " LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber" @@ -1584,6 +1587,11 @@ sub GetHistory { push @query_params, "%$author%"; } + if ( defined $isbn ) { + $query .= " AND biblioitems.isbn LIKE ? "; + push @query_params, "%$isbn%"; + } + if ( defined $name ) { $query .= " AND aqbooksellers.name LIKE ? "; push @query_params, "%$name%"; diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index e158842..99ea937 100755 --- a/acqui/histsearch.pl +++ b/acqui/histsearch.pl @@ -61,6 +61,7 @@ use C4::Debug; my $input = new CGI; my $title = $input->param( 'title'); my $author = $input->param('author'); +my $isbn = $input->param('isbn'); my $name = $input->param( 'name' ); my $basket = $input->param( 'basket' ); my $booksellerinvoicenumber = $input->param( 'booksellerinvoicenumber' ); @@ -89,12 +90,13 @@ if ( $d = $input->param('iso') ) { my ( $order_loop, $total_qty, $total_price, $total_qtyreceived ); # If we're supplied any value then we do a search. Otherwise we don't. -my $do_search = $title || $author || $name || $basket || $booksellerinvoicenumber || +my $do_search = $title || $author || $isbn || $name || $basket || $booksellerinvoicenumber || $from_placed_on || $to_placed_on; if ($do_search) { ( $order_loop, $total_qty, $total_price, $total_qtyreceived ) = GetHistory( title => $title, author => $author, + isbn => $isbn, name => $name, from_placed_on => $from_iso, to_placed_on => $to_iso, @@ -114,6 +116,7 @@ $template->param( numresults => $order_loop ? scalar(@$order_loop) : undef, title => $title, author => $author, + isbn => $isbn, name => $name, basket => $basket, booksellerinvoicenumber => $booksellerinvoicenumber, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt index 495f313..9321cf9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt @@ -21,6 +21,7 @@ <ol> <li><label for="title">Title: </label> <input type="text" name="title" id="title" value="[% title %]" /></li> <li><label for="author">Author: </label> <input type="text" name="author" id="author" value="[% author %]" /></li> + <li><label for="isbn">ISBN: </label> <input type="isbn" name="isbn" id="isbn" value="[% isbn %]" /></li> <li><label for="name">Vendor: </label> <input type="text" name="name" id="name" value="[% name %]" /></li> <li><label for="basket">Basket: </label> <input type="text" name="basket" id="basket" value="[% basket %]" /></li> <li><label for="booksellerinvoicenumber ">Bookseller Invoice No: </label> <input type="text" name="booksellerinvoicenumber" id="booksellerinvoicenumber" value="[% booksellerinvoicenumber %]" /></li> @@ -83,7 +84,7 @@ [% END %] </td> <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% suggestions_loo.biblionumber %]">[% suggestions_loo.title |html %]</a> - <br />[% suggestions_loo.author %]</td> + <br />[% suggestions_loo.author %] <br /> [% suggestions_loo.isbn %]</td> <td><a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=[% suggestions_loo.id %]">[% suggestions_loo.name %]</a></td> <td>[% suggestions_loo.creationdate %]</td> <td>[% suggestions_loo.datereceived %]</td> -- 1.7.2.3 From colin.campbell at ptfs-europe.com Thu Sep 8 15:53:03 2011 From: colin.campbell at ptfs-europe.com (Colin Campbell) Date: Thu, 8 Sep 2011 14:53:03 +0100 Subject: [Koha-patches] [PATCH] Bug 6831: Add ability to enter adding child record from parent Message-ID: <1315489983-17811-1-git-send-email-colin.campbell@ptfs-europe.com> Simplifies the adding of analytical records and ensures that the data populating the 773 tag is correct. From the host record add child record is selected and create bib is entered to generate a new record with host item tag populated from the parent Caveat: currently prepare_host_field only returns a field for MARC21. Values for UNIMARC and NORMARC can easily be added but should be done by someone familar with those formats and conventions --- C4/Biblio.pm | 58 ++++++++++++++++++++ cataloguing/addbiblio.pl | 19 +++++++ .../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 14 ++++- 3 files changed, 88 insertions(+), 3 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 96baaef..dabb73f 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -128,6 +128,7 @@ BEGIN { &TransformHtmlToXml &PrepareItemrecordDisplay &GetNoZebraIndexes + prepare_host_field ); } @@ -3681,8 +3682,65 @@ sub get_biblio_authorised_values { return $authorised_values; } +=head2 prepare_host_field + +$marcfield = prepare_host_field( $hostbiblioitem, $marcflavour ); +Generate the host item entry for an analytic child entry + +=cut + +sub prepare_host_field { + my ( $hostbiblio, $marcflavour ) = @_; + $marcflavour ||= 'MARC21'; + my $host = GetMarcBiblio($hostbiblio); + if ( $marcflavour eq 'MARC21' ) { + + # unfortunately as_string does not 'do the right thing' + # if field returns undef + my %sfd; + my $field; + if ( $field = $host->author() ) { + $sfd{a} = $field; + } + if ( $field = $host->title() ) { + $sfd{t} = $field; + } + if ( $field = $host->field('260') ) { + my $s = $field->as_string('abc'); + if ($s) { + $sfd{d} = $s; + } + } + if ( $field = $host->field('240') ) { + my $s = $field->as_string(); + if ($s) { + $sfd{b} = $s; + } + } + if ( $field = $host->field('022') ) { + my $s = $field->as_string('a'); + if ($s) { + $sfd{x} = $s; + } + } + if ( $field = $host->field('020') ) { + my $s = $field->as_string('a'); + if ($s) { + $sfd{x} = $s; + } + } + if ( $field = $host->field('001') ) { + $sfd{w} = $field->data(),; + } + my $host_field = MARC::Field->new( 773, '0', ' ', %sfd ); + return $host_field; + } + return; +} + 1; + __END__ =head1 AUTHOR diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 637d82d..1ad043b 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -827,6 +827,7 @@ AND (authtypecode IS NOT NULL AND authtypecode<>\"\")|); my $input = new CGI; my $error = $input->param('error'); my $biblionumber = $input->param('biblionumber'); # if biblionumber exists, it's a modif, not a new biblio. +my $parentbiblio = $input->param('parentbiblionumber'); my $breedingid = $input->param('breedingid'); my $z3950 = $input->param('z3950'); my $op = $input->param('op'); @@ -904,6 +905,15 @@ if (($biblionumber) && !($breedingid)){ if ($breedingid) { ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ; } +# This is a child record +if ($parentbiblio) { + my $marcflavour = C4::Context->preference('marcflavour'); + $record = MARC::Record->new(); + my $hostfield = prepare_host_field($parentbiblio,$marcflavour); + if ($hostfield) { + $record->append_fields($hostfield); + } +} $is_a_modif = 0; @@ -1070,3 +1080,12 @@ $template->param( ); output_html_with_http_headers $input, $cookie, $template->output; + +sub get_host_control_num { + my $host_biblio_nr = shift; + my $host = GetMarcBiblio($host_biblio_nr); + my $control_num = GetMarcControlnumber($host, C4::Context->preference('marcflavour')); + $host = GetBiblioData($host_biblio_nr); + $host->{control_number} = $control_num; + return $host; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index 9766494..47ca4b3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -78,10 +78,18 @@ function confirm_items_deletion() { YAHOO.util.Event.onContentReady("cattoolbar", function () { // Menu for new record, new item, new subscription var newmenu = [ - [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{text: _("New Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl" },[% END %] - [% IF ( CAN_user_editcatalogue_edit_items ) %]{text: _("New Item"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]#additema" },[% END %] + [% IF CAN_user_editcatalogue_edit_catalogue %] + {text: _("New Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl" }, + [% END %] + [% IF ( CAN_user_editcatalogue_edit_items ) %] + {text: _("New Item"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]#additema" }, + [% END %] [% IF ( CAN_user_serials_create_subscription ) %] - {text: _("New Subscription"), url: "/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber %]"},[% END %] + {text: _("New Subscription"), url: "/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber %]"}, + [% END %] + [% IF CAN_user_editcatalogue_edit_catalogue %] + {text: _("New Child Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?parentbiblionumber=[% biblionumber %]" }, + [% END %] ]; if(newmenu.length){ new YAHOO.widget.Button({ -- 1.7.6 From nengard at bywatersolutions.com Thu Sep 8 12:33:14 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 8 Sep 2011 06:33:14 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Enh 6165: Add OPACResultsSidebar system preference Message-ID: <1315477994-4598-1-git-send-email-nengard@bywatersolutions.com> From: Ian Walls <ian.walls at bywatersolutions.com> Adds a system preference for displaying content under the "Refine your Search" menu on OPAC search results. Arbitrary HTML can be added, like OpacNav, opacheader, opaccredits and other such system preferences Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/preferences/opac.pref | 5 +++++ .../opac-tmpl/prog/en/includes/opac-facets.inc | 5 +++++ opac/opac-search.pl | 1 + 5 files changed, 19 insertions(+), 0 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 8407505..79d4893 100755 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -85,6 +85,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation History in OPAC','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACResultsSidebar','','Define HTML to be included on the search results page, underneath the facets sidebar','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacsmallimage','','Enter a complete URL to an image to replace the default Koha logo','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout stylesheet in OPAC','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacthemes','prog','Define the current theme for the OPAC interface.','','Themes'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bdfc9ac..afdd954 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4439,6 +4439,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACResultsSidebar','','Define HTML to be included on the search results page, underneath the facets sidebar','70|10','Textarea')"); + print "Upgrade to $DBversion done (add OPACResultsSidebar syspref (enh 6165))\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 4a7c652..8bbf692 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -165,6 +165,11 @@ OPAC: type: textarea class: code - + - "Include the following HTML under the facets in OPAC search results:" + - pref: OPACResultsSidebar + type: textarea + class: code + - - pref: OpacAddMastheadLibraryPulldown choices: yes: Add diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc index 7a2b743..4e6c935 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc @@ -25,5 +25,10 @@ [% END %] </ul> </div> +[% IF ( OPACResultsSidebar ) %] +<div id="opacresultssidebar"> +[% OPACResultsSidebar %] +</div> +[% END %] [% END %] [% END %] diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 8f6b67a..dfe4d74 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -405,6 +405,7 @@ if (C4::Context->preference('OpacSuppression')) { } $template->param ( LIMIT_INPUTS => \@limit_inputs ); +$template->param ( OPACResultsSidebar => C4::Context->preference('OPACResultsSidebar')); ## II. DO THE SEARCH AND GET THE RESULTS my $total = 0; # the total results for the whole set -- 1.7.2.3 From robin at catalyst.net.nz Fri Sep 9 00:55:58 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Fri, 09 Sep 2011 10:55:58 +1200 Subject: [Koha-patches] [PATCH] Bug 6761 - Longer userid field In-Reply-To: <1315448606-14089-1-git-send-email-amit.gupta@osslabs.biz> References: <1315448606-14089-1-git-send-email-amit.gupta@osslabs.biz> Message-ID: <1315522558.13770.170.camel@zarathud> Amit Gupta schreef op do 08-09-2011 om 07:53 [+0530]: > Some libraries use email ids as userids. The current length of the > userid field > is 30 and is not sufficient to accomodate some email addresses. > This change will increase the length to 75. Why not just make it 'text' or something, thereby removing the limit? -- Robin Sheat Catalyst IT Ltd. ? +64 4 803 2204 GPG: 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: </pipermail/koha-patches/attachments/20110909/3ed12f1a/attachment.pgp> From srdjan at catalyst.net.nz Fri Sep 9 03:41:44 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Fri, 9 Sep 2011 13:41:44 +1200 Subject: [Koha-patches] [PATCH] bug_5473: Add 952 fields when receiving an order In-Reply-To: <bug 5473> References: <bug 5473> Message-ID: <1315532504-28058-1-git-send-email-srdjan@catalyst.net.nz> --- C4/Biblio.pm | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ acqui/finishreceive.pl | 9 ++++++++ 2 files changed, 59 insertions(+), 0 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 96baaef..b0cb247 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -99,6 +99,7 @@ BEGIN { &ModBiblio &ModBiblioframework &ModZebra + &AddMarcFields ); # To delete something @@ -3681,6 +3682,55 @@ sub get_biblio_authorised_values { return $authorised_values; } +=head2 AddMarcFields + +Adds fields/subfields to existing marcxml + +parameters: + biblionumber + fields + +returns: nothing + + $fields: { tag1 => val1, tag2 => val2, ... } + $valX : $val for tags < 10, + [ subfld1 => subval1, subfld2 => subval2, ... ] for the rest + +Notes: no indicator support + +=cut + +sub AddMarcFields { + my ( $biblionumber, $fields ) = @_; + + my $rec = GetMarcBiblio($biblionumber) or die "Invalid biblionumber $biblionumber"; + + while ( my ($tag, $val) = each %$fields ) { + if ( my ($field) = $rec->field($tag) ) { + if (ref $val) { + $field->update(@$val); + } else { + $field->update($val); + } + } + else { + my $newfield; + if (ref $val) { + $newfield = MARC::Field->new( $tag, '', '', @$val ); + } else { + $newfield = MARC::Field->new( $tag, $val ); + } + $rec->insert_fields_ordered($newfield); + } + } + + my $dbh = C4::Context->dbh; + my $encoding = C4::Context->preference("marcflavour"); + $dbh->do("UPDATE biblioitems SET marcxml=? WHERE biblionumber=?", undef, + $rec->as_xml_record($encoding), + $biblionumber ); +} + 1; __END__ diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index 71b13d6..c74a165 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -114,4 +114,13 @@ if ($quantityrec > $origquantityrec ) { $datereceived = ModReceiveOrder($biblionumber,$ordernumber, $quantityrec ,$user,$unitprice,$invoiceno,$freight,$replacement,undef,$datereceived); } } + +AddMarcFields( $biblionumber, { 952 => [ e => $supplierid, + d => $datereceived, + g => $unitprice, + v => $replacement, + w => $datereceived, # XXX + ], + } ); + print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoice=$invoiceno&supplierid=$supplierid&freight=$freight&gst=$gst&datereceived=$datereceived$error_url_str"); -- 1.6.5 From robin at catalyst.net.nz Fri Sep 9 05:50:07 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Fri, 9 Sep 2011 15:50:07 +1200 Subject: [Koha-patches] [PATCH] Bug 5602 - [3.4.x] Rewrite of package building script Message-ID: <1315540207-12355-1-git-send-email-robin@catalyst.net.nz> Note: this is pulling in the most recent version from master. Working with two different versions that have two different options was getting painful, and it doesn't touch anything outside of debian/ --- debian/README.build | 13 +++ debian/build-git-snapshot | 180 +++++++++++++++++++++++++++++++++------------ 2 files changed, 147 insertions(+), 46 deletions(-) create mode 100644 debian/README.build diff --git a/debian/README.build b/debian/README.build new file mode 100644 index 0000000..9d33726 --- /dev/null +++ b/debian/README.build @@ -0,0 +1,13 @@ +In order to build .deb packages, following debian packages need to be present +(installed): +devscripts +pbuilder +dh-make +fakeroot + +As root (or sudo) execute: +pbuilder create + +Executing build-git-snapshot without any arguments will leave package and the +rest in some pbuilder dir, eg. /var/cache/pbuilder/result It is highly +recommended that --buildresult option is used. diff --git a/debian/build-git-snapshot b/debian/build-git-snapshot index 3847024..91552ff 100755 --- a/debian/build-git-snapshot +++ b/debian/build-git-snapshot @@ -1,64 +1,152 @@ -#!/bin/sh +#!/usr/bin/perl + +# Copyright 2010 Catalyst IT Ltd. +# +# 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 2 of the License, or (at your option) any later +# version. # -# This script will build a .deb from a git snapshot of koha. -# Don't use it for building actual versions for uploading to Debian. +# 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. # -# To use: -# - commit any changes into git -# - run this script +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +# Written by Robin Sheat <robin at catalyst.net.nz> and +# Srdjan Jankovic <srdjan at catalyst.net.nz> +# Based on an sh version by Lars Wirzenius. + +use strict; +use warnings; + +use Getopt::Long; +use POSIX qw/strftime/; -set -e +my $buildresult; +my $distribution='squeeze-dev'; +my $git_checks='all'; +my $version='3.5-1~git'; +my $auto_version=1; +my $need_help; +my $debug; -die() -{ - echo "$@" - exit 1 +GetOptions( + 'buildresult|r=s' => \$buildresult, + 'distribution|D=s' => \$distribution, + 'git-checks|g=s' => \$git_checks, + 'version|v=s' => \$version, + 'autoversion!' => \$auto_version, + 'help|h' => \$need_help, + 'debug|d' => \$debug, +); + +help_and_exit() if $need_help; + + +sub sys_command_output { + my ($command) = @_; + + print "$command\n" if $debug; + my $command_output; + open($command_output, "-|", "$command ") + or die qq{Cannot execute "$command": $!"}; + return map { chomp; $_ } <$command_output>; } -everything_is_commited() -{ - if git status --short | grep -q '^' - then - return 1 - else - return 0 - fi +sub sys_command_output_screen { + my ($command) = @_; + + print "$command\n" if $debug; + system($command); } -latest_sha1() { - git rev-parse --short=8 HEAD +sub everything_is_committed { + my $filter; + for ($git_checks) { + $_ eq "none" + and return 1; + + $_ eq "modified" + and $filter = "no", + last; + + $_ eq "all" + and $filter = "normal", + last; + + help_and_exit("$0: --git-checks/-g must be one of 'all', 'modified', or 'none'"); + } + my $has_changes = grep /^xxx/, sys_command_output("git status --porcelain -u${filter}"); + + return !$has_changes; } -newversion() { - printf '3.5-1~git%s.%s' $(date +%Y%m%d%H%M%S) $(latest_sha1) +sub help_and_exit { + my $msg = shift; + if ($msg) { + print "$msg\n\n"; + } + print <<EOH; +This builds Koha deb packages, from a git snapshot. It's not suitable for +making upstreamable verions, but handy for your own local packages. + +Options: + --buildresult, -r + the location that the resulting .deb, .changes, etc. will be placed in. + Default is whatever pdebuild uses. + --distribution, -D + the distribution value to set in the changelog when editing it. Default + is 'squeeze-dev'. + --git-checks, -g + what level of git checks are run to determine if the working copy is + clean enough. One of 'all' (any changes are bad), 'modified' (only + tracked files with untracked changes will cause an error), and 'none' + (checking git status is skipped totally.) Default is 'all'. + --version, -v + the version string for the resulting package. Default is '3.5-1~git'. + --(no)autoversion + whether or not to use the date and git commit ID in the version value. + Default is to include it. + --debug, -d +EOH + exit; } -adjust_debian_changelog() { - dch --force-distribution -D squeeze-dev -v "$1" \ - "Building git snapshot." - dch -r "Building git snapshot." +sub latest_sha1 { + return sys_command_output("git rev-parse --short=8 HEAD"); } -reset_debian_changelog() { - git checkout -- debian/changelog +sub adjust_debian_changelog { + my ($newversion) = @_; + + sys_command_output( qq{dch --force-distribution -D "$distribution" -v "$newversion" "Building git snapshot."} ); + sys_command_output( qq{dch -r "Building git snapshot."} ); } -build_package() { - git archive --format=tar --prefix="koha-$1/" HEAD | - gzip -9 > "../koha_$1.tar.gz" - pdebuild $2 +sub reset_debian_changelog { + sys_command_output( qq{git checkout -- debian/changelog} ); } -if ! everything_is_commited -then - die "cannot build: uncommited changes" -fi - -version="$(newversion)" -if [ -n "$1" ] -then - pdebuildopts="--buildresult $1" -fi -adjust_debian_changelog "$version" -build_package "$version" "$pdebuildopts" -reset_debian_changelog +sub build_package { + my ($newversion) = @_; + sys_command_output( qq{git archive --format=tar --prefix="koha-$newversion/" HEAD | gzip -9 > "../koha_$newversion.tar.gz"} ); + + my $pdebuildopts = $buildresult ? "--buildresult $buildresult" : ""; + sys_command_output_screen( "pdebuild $pdebuildopts" ); +} + +everything_is_committed() or die "cannot build: uncommited changes"; + +my $newversion = $auto_version + ? sprintf ('%s%s.%s', $version, strftime("+%Y%m%d%H%M%S", localtime), latest_sha1()) + : $version; + +adjust_debian_changelog( $newversion ); +build_package( $newversion ); +reset_debian_changelog(); + -- 1.7.4.1 From srdjan at catalyst.net.nz Fri Sep 9 05:51:47 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Fri, 9 Sep 2011 15:51:47 +1200 Subject: [Koha-patches] [PATCH] bug_6504: Reintroduced freight costs when receiving orders In-Reply-To: <bug 6504> References: <bug 6504> Message-ID: <1315540307-13754-1-git-send-email-srdjan@catalyst.net.nz> --- C4/Acquisition.pm | 1 + acqui/addorder.pl | 3 +++ acqui/neworderempty.pl | 1 + acqui/parcel.pl | 16 +++++----------- .../prog/en/modules/acqui/neworderempty.tt | 6 ++++++ .../prog/en/modules/acqui/orderreceive.tt | 2 +- .../intranet-tmpl/prog/en/modules/acqui/parcels.tt | 3 +-- 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index f682256..4227830 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -1264,6 +1264,7 @@ sub GetParcel { aqorders.listprice, aqorders.rrp, aqorders.ecost, + aqorders.freight, biblio.title FROM aqorders LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno diff --git a/acqui/addorder.pl b/acqui/addorder.pl index e321d2c..a20c79c 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -103,6 +103,8 @@ budget_id used to pay this order. =item C<cost> +=item C<freight> + =item C<sub> =item C<invoice> @@ -174,6 +176,7 @@ $orderinfo->{'uncertainprice'} ||= 0; #my $gst = $input->param('GST'); #my $budget = $input->param('budget'); #my $cost = $input->param('cost'); +#my $freight = $input->param('freight'); #my $sub = $input->param('sub'); #my $purchaseorder = $input->param('purchaseordernumber'); #my $invoice = $input->param('invoice'); diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index e99eeb0..2c528b7 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -380,6 +380,7 @@ $template->param( quantityrec => $data->{'quantity'}, rrp => $data->{'rrp'}, listprice => sprintf("%.2f", $data->{'listprice'}||$data->{'price'}||$listprice), + freight => sprintf("%.2f", $data->{'freight'}||0), total => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ), ecost => $data->{'ecost'}, notes => $data->{'notes'}, diff --git a/acqui/parcel.pl b/acqui/parcel.pl index ec5071b..ae937fd 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -216,19 +216,14 @@ for (my $i = 0 ; $i < $countlines ; $i++) { $totalprice += $parcelitems[$i]->{'unitprice'}; $line{unitprice} = sprintf($cfstr, $parcelitems[$i]->{'unitprice'}); - #double FIXME - totalfreight is redefined later. - -# FIXME - each order in a parcel holds the freight for the whole parcel. This means if you receive a parcel with items from multiple budgets, you'll see the freight charge in each budget.. - if ($i > 0 && $totalfreight != $parcelitems[$i]->{'freight'}) { - warn "FREIGHT CHARGE MISMATCH!!"; - } - $totalfreight = $parcelitems[$i]->{'freight'}; + $totalfreight += $parcelitems[$i]->{'freight'}; $totalquantity += $parcelitems[$i]->{'quantityreceived'}; $tototal += $total; } my $pendingorders = GetPendingOrders($supplierid); my $countpendings = scalar @$pendingorders; +my $freight_per_order = $freight && $countpendings ? $freight/$countpendings : 0; # pending orders totals my ($totalPunitprice, $totalPquantity, $totalPecost, $totalPqtyrcvd); @@ -247,6 +242,7 @@ for (my $i = 0 ; $i < $countpendings ; $i++) { $line{ecost} = sprintf("%.2f",$line{ecost}); $line{ordertotal} = sprintf("%.2f",$line{ecost}*$line{quantity}); $line{unitprice} = sprintf("%.2f",$line{unitprice}); + $line{freight} = sprintf("%.2f",$freight_per_order); $line{invoice} = $invoice; $line{gst} = $gst; $line{total} = $total; @@ -254,7 +250,6 @@ for (my $i = 0 ; $i < $countpendings ; $i++) { $ordergrandtotal += $line{ecost} * $line{quantity}; push @loop_orders, \%line if ($i >= $startfrom and $i < $startfrom + $resultsperpage); } -$freight = $totalfreight unless $freight; my $count = $countpendings; @@ -289,8 +284,7 @@ if ($count>$resultsperpage){ ); } -#$totalfreight=$freight; -$tototal = $tototal + $freight; +$tototal = $tototal + $totalfreight; $template->param( invoice => $invoice, @@ -307,7 +301,7 @@ $template->param( countpending => $countpendings, loop_orders => \@loop_orders, totalprice => sprintf($cfstr, $totalprice), - totalfreight => $totalfreight, + totalfreight => sprintf($cfstr, $totalfreight), totalquantity => $totalquantity, tototal => sprintf($cfstr, $tototal), ordergrandtotal => sprintf($cfstr, $ordergrandtotal), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt index 39e9ca2..73fbb58 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -422,6 +422,12 @@ $(document).ready(function() <input type="text" id="cost" size="20" name="cost" value="[% ecost %]" /> [% END %] </li> + [% IF ( quantityrec ) %] + <li> + <label for="freight">Freight: </label> + <input type="text" id="freight" size="20" name="freight" value="[% freight %]" [% IF close %] readonly="readonly" [% END %]/> + </li> + [% END %] <li> <label for="notes">Notes: </label> <textarea id="notes" cols="30" rows="3" name="notes" >[% notes %]</textarea> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt index 746155f..0e20e39 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -82,7 +82,6 @@ <input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" /> <input type="hidden" name="supplierid" value="[% supplierid %]" /> <input type="hidden" name="datereceived" value="[% datereceived_iso %]" /> - <input type="hidden" name="freight" value="[% freight %]" /> <input type="hidden" name="gst" value="[% gst %]" /> </div> <div class="yui-u"> @@ -127,6 +126,7 @@ [% ELSE %] <input type="text" size="20" name="cost" id="cost" value="[% ecost %]" /> [% END %]</li></ol> + <li><label for="freight">Freight: </label><input type="text" size="20" name="freight" id="freight" value="[% freight %]" /></li> <label for="note">Notes: </label><textarea name="note" width="40" rows="8" >[% notes %]</textarea> <input type="hidden" name="invoice" value="[% invoice %]" /> </fieldset> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt index a7d704d..53d44d7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt @@ -96,11 +96,10 @@ <input type="text" size="20" id="gst" name="gst" /> </li> [% END %] - <!-- // Removing freight input until shipping can be proplerly handled . <li> <label for="freight">Shipping:</label> <input type="text" size="20" id="freight" name="freight" /> - </li> --> + </li> <li><label for="datereceived">Shipment date: </label> <input type="text" id="datereceived" name="datereceived" maxlength="10" size="10" value="[% datereceived_today %]" /> <img src="[% themelang %]/lib/calendar/cal.gif" id="datereceived_button" alt="Show Calendar" /> -- 1.6.5 From amit.gupta at osslabs.biz Fri Sep 9 01:18:35 2011 From: amit.gupta at osslabs.biz (Amit Gupta) Date: Fri, 9 Sep 2011 04:48:35 +0530 Subject: [Koha-patches] [PATCH] Bug 6774 - Display barcode on OPAC detail page. Message-ID: <1315523915-8591-1-git-send-email-amit.gupta@osslabs.biz> Display barcode on OPAC detail normal view including in XSLT view. --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 ++++++- .../prog/en/modules/admin/preferences/opac.pref | 7 +++++++ koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 2 ++ opac/opac-detail.pl | 1 + 5 files changed, 17 insertions(+), 1 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 8407505..fae729f 100755 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -317,3 +317,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACShowBarcode','0','Show items barcode in holiding tab','','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bdfc9ac..cf56619 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4439,7 +4439,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } - +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACShowBarcode','0','Show items barcode in holiding tab','','YesNo')"); + print "Upgrade to $DBversion done (Add syspref OPACShowBarcode)\n"; + SetVersion ($DBversion); +} =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 4a7c652..c65160d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -86,6 +86,13 @@ OPAC: no: "Don't show" - the name of the patron that has an item checked out on item detail pages on the OPAC. - + - pref: OPACShowBarcode + default: 0 + choices: + yes: Show + no: "Don't show" + - Show items barcode in holding tab. + - - pref: OpacHighlightedWords choices: yes: Highlight diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 1950e4e..2100837 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -408,6 +408,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { <th>Status</th> [% IF ( itemdata_itemnotes ) %]<th>Notes</th>[% END %] <th>Date Due</th> + [% IF ( OPACShowBarcode ) %]<th>Barcode</th>[% END %] </tr></thead> <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %] <tr>[% IF ( item_level_itypes ) %]<td>[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %] @@ -420,6 +421,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { <td>[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td> [% IF ( itemdata_itemnotes ) %]<td>[% ITEM_RESULT.itemnotes %]</td>[% END %] <td>[% ITEM_RESULT.datedue %]</td> + [% IF ( OPACShowBarcode ) %]<td>[% ITEM_RESULT.barcode %]</td>[% END %] </tr> [% END %]</tbody> </table> diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index e18e046..9d1ed56 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -84,6 +84,7 @@ if (C4::Context->preference("OPACXSLTDetailsDisplay") ) { } $template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); +$template->param('OPACShowBarcode' => C4::Context->preference("OPACShowBarcode") ); # change back when ive fixed request.pl my @all_items = GetItemsInfo( $biblionumber ); my @items; -- 1.6.4.2 From savitra.sirohi at osslabs.biz Fri Sep 9 07:14:05 2011 From: savitra.sirohi at osslabs.biz (savitra sirohi) Date: Fri, 9 Sep 2011 10:44:05 +0530 Subject: [Koha-patches] [PATCH] Bug 6761 - Longer userid field In-Reply-To: <1315522558.13770.170.camel@zarathud> References: <1315448606-14089-1-git-send-email-amit.gupta@osslabs.biz> <1315522558.13770.170.camel@zarathud> Message-ID: <CAOC8d3CbGO=dvsg_+=hrK_FLpwRcK7EXSSPZ0bZ=08wJibxsGQ@mail.gmail.com> Robin, it might be a good idea to limit the username field's length, for instance what would happen to the display if the length was arbitrarily long? Thanks, Savitra On Fri, Sep 9, 2011 at 4:25 AM, Robin Sheat <robin at catalyst.net.nz> wrote: > Amit Gupta schreef op do 08-09-2011 om 07:53 [+0530]: >> Some libraries use email ids as userids. The current length of the >> userid field >> is 30 and is not sufficient to accomodate some email addresses. >> This change will increase the length to 75. > > Why not just make it 'text' or something, thereby removing the limit? > > -- > Robin Sheat > Catalyst IT Ltd. > ? +64 4 803 2204 > GPG: 5957 6D23 8B16 EFAB FEF8 ?7175 14D3 6485 A99C EB6D > > _______________________________________________ > Koha-patches mailing list > Koha-patches at lists.koha-community.org > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > website : http://www.koha-community.org/ > git : http://git.koha-community.org/ > bugs : http://bugs.koha-community.org/ > From amit.gupta at osslabs.biz Fri Sep 9 02:36:24 2011 From: amit.gupta at osslabs.biz (Amit Gupta) Date: Fri, 9 Sep 2011 06:06:24 +0530 Subject: [Koha-patches] [PATCH] Bug 6811 - Send renewal notice with $DBversion = "3.05.00.XXX"; Message-ID: <1315528584-15185-1-git-send-email-amit.gupta@osslabs.biz> Similar to checkin, checkout notices already present. Renewal notices can be set in messaging preferences at borrower and membership category level. Contents will be picked up from a notice template. --- C4/Circulation.pm | 17 +++++++++++++++++ .../data/mysql/de-DE/mandatory/sample_notices.sql | 1 + .../optional/sample_notices_message_attributes.sql | 3 ++- .../optional/sample_notices_message_transports.sql | 4 +++- .../data/mysql/en/mandatory/sample_notices.sql | 1 + .../optional/sample_notices_message_attributes.sql | 4 +++- .../optional/sample_notices_message_transports.sql | 5 ++++- .../data/mysql/es-ES/mandatory/sample_notices.sql | 1 + .../optional/sample_notices_message_attributes.sql | 4 ++-- .../optional/sample_notices_message_transports.sql | 4 +++- .../mysql/fr-FR/1-Obligatoire/sample_notices.sql | 1 + .../sample_notices_message_attributes.sql | 3 ++- .../sample_notices_message_transports.sql | 4 +++- installer/data/mysql/it-IT/necessari/notices.sql | 1 + .../sample_notices_message_attributes.sql | 3 ++- .../sample_notices_message_transports.sql | 5 +++-- .../mysql/nb-NO/1-Obligatorisk/sample_notices.sql | 1 + .../sample_notices_message_attributes.sql | 3 ++- .../sample_notices_message_transports.sql | 4 +++- .../data/mysql/pl-PL/mandatory/sample_notices.sql | 1 + .../optional/sample_notices_message_attributes.sql | 3 ++- .../optional/sample_notices_message_transports.sql | 4 +++- .../data/mysql/ru-RU/mandatory/sample_notices.sql | 1 + .../optional/sample_notices_message_attributes.sql | 3 ++- .../optional/sample_notices_message_transports.sql | 4 +++- .../data/mysql/uk-UA/mandatory/sample_notices.sql | 1 + .../optional/sample_notices_message_attributes.sql | 3 ++- .../optional/sample_notices_message_transports.sql | 4 +++- installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ .../prog/en/includes/messaging-preference-form.inc | 1 + .../prog/en/modules/admin/categorie.tt | 1 + .../opac-tmpl/prog/en/modules/opac-messaging.tt | 1 + 32 files changed, 90 insertions(+), 20 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 47068f9..3aa7ab6 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2298,6 +2298,22 @@ sub AddRenewal { } # Log the renewal UpdateStats( $branch, 'renew', $charge, '', $itemnumber, $item->{itype}, $borrowernumber); + my $borrower = GetMemberDetails( $borrowernumber); + my $circulation_alert = 'C4::ItemCirculationAlertPreference'; + my %conditions = ( + branchcode => $branch, + categorycode => $borrower->{categorycode}, + item_type => $item->{itype}, + notification => 'ITEMRENEW', + ); + if ($circulation_alert->is_enabled_for(\%conditions)) { + SendCirculationAlert({ + type => 'ITEMRENEW', + item => $item, + borrower => $borrower, + branch => $branch, + }); + } return $datedue; } @@ -2617,6 +2633,7 @@ sub SendCirculationAlert { my %message_name = ( CHECKIN => 'Item_Check_in', CHECKOUT => 'Item_Checkout', + ITEMRENEW => 'Item_Renew', ); my $borrower_preferences = C4::Members::Messaging::GetMessagingPreferences({ borrowernumber => $borrower->{borrowernumber}, diff --git a/installer/data/mysql/de-DE/mandatory/sample_notices.sql b/installer/data/mysql/de-DE/mandatory/sample_notices.sql index 166c36d..721e8b3 100644 --- a/installer/data/mysql/de-DE/mandatory/sample_notices.sql +++ b/installer/data/mysql/de-DE/mandatory/sample_notices.sql @@ -11,6 +11,7 @@ VALUES ('circulation','ODUE','Mahnung','Mahnung','Liebe/r <<borrowers.firstname> ('reserves', 'HOLD_PRINT', 'Vormerkbenachrichtigung (Print)', 'Vormerkbenachrichtigung (Print)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchzip>> <<branches.branchcity>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.address2>>\r\n<<borrowers.zipcode>> <<borrowers.city>>\r\n<<borrowers.country>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nLiebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nF??r Sie liegt seit dem <<reserves.waitingdate>> eine Vormerkung zur Abholung bereit:\r\n\r\nTitel: <<biblio.title>>\r\nVerfasser: <<biblio.author>>\r\nSignatur: <<items.itemcallnumber>>\r\n'), ('circulation','CHECKIN','R??ckgabequittung (Zusammenfassung)','R??ckgabequittung','Die folgenden Medien wurden zur??ckgegeben:\r\n----\r\n<<biblio.title>>\r\n----\r\nVielen Dank.'), ('circulation','CHECKOUT','Ausleihquittung (Zusammenfassung)','Ausleihquittung','Die folgenden Medien wurden entliehen:\r\n----\r\n<<biblio.title>>\r\n----\r\nVielen Dank f??r Ihren Besuch in <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Neue Vormerkung', 'Neue Vormerkung','Folgender Titel wurde vorgemerkt: <<title>> (<<biblionumber>>) durch den Benutzer <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Anschaffungsvorschlag wurde angenommen', 'Ihr Anschaffungsvorschlag wurde angenommen','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> by <<suggestions.author>>.\n\nDie Bibliothek hat diesen Titel heute recherchiert und wird Ihn sobald wie m??glich im Buchhandel bestellen. Sie erhalten Nachricht, sobald die Bestellung abgeschlossen ist und sobald der Titel in der Bibliotek verf??gbar ist.\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Vorgeschlagenes Medium verf??gbar', 'Das vorgeschlagene Medium ist jetzt verf??gbar','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> von <<suggestions.author>>.\n\nWir freuen uns Ihnen mitteilen zu k??nnen, dass dieser Titel jetzt im Bestand der Bibliothek verf??gbar ist.\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/de-DE/optional/sample_notices_message_attributes.sql b/installer/data/mysql/de-DE/optional/sample_notices_message_attributes.sql index b505486..367bf24 100644 --- a/installer/data/mysql/de-DE/optional/sample_notices_message_attributes.sql +++ b/installer/data/mysql/de-DE/optional/sample_notices_message_attributes.sql @@ -5,4 +5,5 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); \ No newline at end of file +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); diff --git a/installer/data/mysql/de-DE/optional/sample_notices_message_transports.sql b/installer/data/mysql/de-DE/optional/sample_notices_message_transports.sql index ae68378..60ddd52 100644 --- a/installer/data/mysql/de-DE/optional/sample_notices_message_transports.sql +++ b/installer/data/mysql/de-DE/optional/sample_notices_message_transports.sql @@ -14,4 +14,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/en/mandatory/sample_notices.sql b/installer/data/mysql/en/mandatory/sample_notices.sql index 689fa0f..4bb8d4f 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.sql +++ b/installer/data/mysql/en/mandatory/sample_notices.sql @@ -11,6 +11,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/en/optional/sample_notices_message_attributes.sql b/installer/data/mysql/en/optional/sample_notices_message_attributes.sql index a7a6032..ae68f2b 100644 --- a/installer/data/mysql/en/optional/sample_notices_message_attributes.sql +++ b/installer/data/mysql/en/optional/sample_notices_message_attributes.sql @@ -5,5 +5,7 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); + diff --git a/installer/data/mysql/en/optional/sample_notices_message_transports.sql b/installer/data/mysql/en/optional/sample_notices_message_transports.sql index ae68378..5b8e2c3 100644 --- a/installer/data/mysql/en/optional/sample_notices_message_transports.sql +++ b/installer/data/mysql/en/optional/sample_notices_message_transports.sql @@ -14,4 +14,7 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); + diff --git a/installer/data/mysql/es-ES/mandatory/sample_notices.sql b/installer/data/mysql/es-ES/mandatory/sample_notices.sql index 689fa0f..4bb8d4f 100644 --- a/installer/data/mysql/es-ES/mandatory/sample_notices.sql +++ b/installer/data/mysql/es-ES/mandatory/sample_notices.sql @@ -11,6 +11,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/es-ES/optional/sample_notices_message_attributes.sql b/installer/data/mysql/es-ES/optional/sample_notices_message_attributes.sql index a7a6032..4f2f6ef 100644 --- a/installer/data/mysql/es-ES/optional/sample_notices_message_attributes.sql +++ b/installer/data/mysql/es-ES/optional/sample_notices_message_attributes.sql @@ -5,5 +5,5 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); - +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); diff --git a/installer/data/mysql/es-ES/optional/sample_notices_message_transports.sql b/installer/data/mysql/es-ES/optional/sample_notices_message_transports.sql index ae68378..60ddd52 100644 --- a/installer/data/mysql/es-ES/optional/sample_notices_message_transports.sql +++ b/installer/data/mysql/es-ES/optional/sample_notices_message_transports.sql @@ -14,4 +14,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql index 977e59d..8fcb471 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql @@ -13,6 +13,7 @@ VALUES ('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup at <<branches.branchname>>', '<<branches.branchname>>\n<<branches.branchaddress1>>\n<<branches.branchaddress2>>\n\n\nChange Service Requested\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>>\n<<borrowers.address>>\n<<borrowers.city>> <<borrowers.zipcode>>\n\n\n\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\n\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.sql b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.sql index 8e919e9..debe7d5 100644 --- a/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.sql +++ b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.sql @@ -5,5 +5,6 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); diff --git a/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.sql b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.sql index ae68378..60ddd52 100644 --- a/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.sql +++ b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.sql @@ -14,4 +14,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/it-IT/necessari/notices.sql b/installer/data/mysql/it-IT/necessari/notices.sql index 689fa0f..4bb8d4f 100644 --- a/installer/data/mysql/it-IT/necessari/notices.sql +++ b/installer/data/mysql/it-IT/necessari/notices.sql @@ -11,6 +11,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/it-IT/necessari/sample_notices_message_attributes.sql b/installer/data/mysql/it-IT/necessari/sample_notices_message_attributes.sql index 63d07fd..672d6da 100644 --- a/installer/data/mysql/it-IT/necessari/sample_notices_message_attributes.sql +++ b/installer/data/mysql/it-IT/necessari/sample_notices_message_attributes.sql @@ -7,5 +7,6 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); SET FOREIGN_KEY_CHECKS=1; diff --git a/installer/data/mysql/it-IT/necessari/sample_notices_message_transports.sql b/installer/data/mysql/it-IT/necessari/sample_notices_message_transports.sql index c1b1f29..1961d85 100644 --- a/installer/data/mysql/it-IT/necessari/sample_notices_message_transports.sql +++ b/installer/data/mysql/it-IT/necessari/sample_notices_message_transports.sql @@ -18,6 +18,7 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); - +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); SET FOREIGN_KEY_CHECKS=1; diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql index cdb5529..45d0e67 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql @@ -32,6 +32,7 @@ VALUES ('circulation','ODUE','Purring','Purring p?? dokument','<<borrowers.first ('reserves', 'HOLD_PRINT', 'Hentemelding (p?? papir)', 'Hentemelding', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nDu har et reservert dokument som kan hentes fra <<reserves.waitingdate>>:\r\n\r\nTittel: <<biblio.title>>\r\nForfatter: <<biblio.author>>\r\nEksemplar: <<items.copynumber>>\r\n'), ('circulation','CHECKIN','Innlevering','Melding om innlevering','F??lgende dokument har blitt innlevert:\r\n----\r\n<<biblio.title>>\r\n----\r\nVennlig hilsen\r\nBiblioteket'), ('circulation','CHECKOUT','Utl??n','Melding om utl??n','F??lgende dokument har blitt l??nt ut:\r\n----\r\n<<biblio.title>>\r\n----\r\nVennlig hilsen\r\nBiblioteket'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Melding om reservasjon', 'Melding om reservasjon','F??lgende dokument har blitt reservert : <<title>> (<<biblionumber>>) av <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Forslag godtatt', 'Innkj??psforslag godtatt','<<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foresl??tt at biblioteket kj??per inn <<suggestions.title>> av <<suggestions.author>>.\n\nBiblioteket har vurdert forslaget i dag. Dokumentet vil bli bestilt s?? fort det lar seg gj??re. Du vil f?? en ny melding n??r bestillingen er gjort, og n??r dokumentet ankommer biblioteket.\n\nEr det noe du lurer p??, vennligst kontakt oss p?? <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Foresl??tt dokument tilgjengelig', 'Foresl??tt dokument tilgjengelig','<<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foresl??tt at biblioteket kj??per inn <<suggestions.title>> av <<suggestions.author>>.\n\nVi har gleden av ?? informere deg om at dokumentet n?? er innlemmet i samlingen.\n\nEr det noe du lurer p??, vennligst kontakt oss p?? <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_attributes.sql b/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_attributes.sql index a7a6032..459b913 100644 --- a/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_attributes.sql +++ b/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_attributes.sql @@ -5,5 +5,6 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); diff --git a/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_transports.sql b/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_transports.sql index ae68378..60ddd52 100644 --- a/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_transports.sql +++ b/installer/data/mysql/nb-NO/2-Valgfritt/sample_notices_message_transports.sql @@ -14,4 +14,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql index 6be2eb8..916f05d 100644 --- a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql +++ b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql @@ -13,6 +13,7 @@ VALUES ('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/pl-PL/optional/sample_notices_message_attributes.sql b/installer/data/mysql/pl-PL/optional/sample_notices_message_attributes.sql index 8e919e9..debe7d5 100644 --- a/installer/data/mysql/pl-PL/optional/sample_notices_message_attributes.sql +++ b/installer/data/mysql/pl-PL/optional/sample_notices_message_attributes.sql @@ -5,5 +5,6 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); diff --git a/installer/data/mysql/pl-PL/optional/sample_notices_message_transports.sql b/installer/data/mysql/pl-PL/optional/sample_notices_message_transports.sql index ae68378..60ddd52 100644 --- a/installer/data/mysql/pl-PL/optional/sample_notices_message_transports.sql +++ b/installer/data/mysql/pl-PL/optional/sample_notices_message_transports.sql @@ -14,4 +14,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql index 689fa0f..4bb8d4f 100644 --- a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql +++ b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql @@ -11,6 +11,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/ru-RU/optional/sample_notices_message_attributes.sql b/installer/data/mysql/ru-RU/optional/sample_notices_message_attributes.sql index c9d9bd1..af73e8b 100644 --- a/installer/data/mysql/ru-RU/optional/sample_notices_message_attributes.sql +++ b/installer/data/mysql/ru-RU/optional/sample_notices_message_attributes.sql @@ -7,5 +7,6 @@ values (2, 'Advance_Notice', 1), (4, 'Hold_Filled', 0), (5, 'Item_Check_in', 0), -(6, 'Item_Checkout', 0); +(6, 'Item_Checkout', 0), +(7, 'Item_Renew', 0); diff --git a/installer/data/mysql/ru-RU/optional/sample_notices_message_transports.sql b/installer/data/mysql/ru-RU/optional/sample_notices_message_transports.sql index ade4d03..6433ab5 100644 --- a/installer/data/mysql/ru-RU/optional/sample_notices_message_transports.sql +++ b/installer/data/mysql/ru-RU/optional/sample_notices_message_transports.sql @@ -15,4 +15,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql index 358205b..e081454 100644 --- a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql +++ b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql @@ -10,6 +10,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>\r\n<<branches.branchcity>> <<branches.branchzip>>'), ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'), ('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), +('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'), ('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<title>> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'), ('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'), diff --git a/installer/data/mysql/uk-UA/optional/sample_notices_message_attributes.sql b/installer/data/mysql/uk-UA/optional/sample_notices_message_attributes.sql index 75e2793..9156b78 100644 --- a/installer/data/mysql/uk-UA/optional/sample_notices_message_attributes.sql +++ b/installer/data/mysql/uk-UA/optional/sample_notices_message_attributes.sql @@ -7,5 +7,6 @@ values (2, 'Advance_Notice' , 1), (4, 'Hold_Filled' , 0), (5, 'Item_Check_in' , 0), -(6, 'Item_Checkout' , 0); +(6, 'Item_Checkout' , 0), +(7, 'Item_Renew' , 0); diff --git a/installer/data/mysql/uk-UA/optional/sample_notices_message_transports.sql b/installer/data/mysql/uk-UA/optional/sample_notices_message_transports.sql index ade4d03..6433ab5 100644 --- a/installer/data/mysql/uk-UA/optional/sample_notices_message_transports.sql +++ b/installer/data/mysql/uk-UA/optional/sample_notices_message_transports.sql @@ -15,4 +15,6 @@ values (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'sms', 0, 'circulation', 'CHECKOUT'), +(7, 'email', 0, 'circulation', 'ITEMRENEW'), +(7, 'sms', 0, 'circulation', 'ITEMRENEW'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bdfc9ac..4c0b063 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4439,6 +4439,20 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { +$dbh->do(q{ + INSERT INTO `letter` (`module`, `code`, `name`, `title`, `content`) VALUES + ('circulation','ITEMRENEW','Item_Renew','ItemRenew','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'); + }); + $dbh->do(q{INSERT INTO message_attributes (message_attribute_id, message_name, takes_days) VALUES (7, 'Item_Renew', 0);}); + $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (7, 'email', 0, 'circulation', 'ITEMRENEW');}); + $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (7, 'sms', 0, 'circulation', 'ITEMRENEW');}); + print "Upgrade to $DBversion done (Add letter for Item Renew notifications)\n"; + SetVersion ($DBversion); +} + + =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc index 7ece680..4f55666 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc @@ -33,6 +33,7 @@ [% ELSIF ( messaging_preference.Hold_Filled ) %]Hold Filled [% ELSIF ( messaging_preference.Item_Check_in ) %]Item Check-in [% ELSIF ( messaging_preference.Item_Checkout ) %]Item Checkout + [% ELSIF ( messaging_preference.Item_Renew ) %]Item Renew [% ELSE %]Unknown [% END %]</td> [% IF ( messaging_preference.takes_days ) %] <td> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt index b50012f..f9a5e70 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt @@ -349,6 +349,7 @@ Confirm Deletion of Category [% categorycode |html %][% END %]</legend> [% ELSIF ( prefs.Hold_Filled ) %]Hold Filled [% ELSIF ( prefs.Item_Check_in ) %]Item Check-in [% ELSIF ( prefs.Item_Checkout ) %]Item Checkout + [% ELSIF ( prefs.Item_Renew ) %]Item Renew [% ELSE %]Unknown [% END %]: <strong>[% transport.transport %]</strong><br /> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt index ebb1e26..851a9cb 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt @@ -45,6 +45,7 @@ [% ELSIF ( messaging_preference.Hold_Filled ) %]Hold Filled [% ELSIF ( messaging_preference.Item_Check_in ) %]Item Check-in [% ELSIF ( messaging_preference.Item_Checkout ) %]Item Checkout + [% ELSIF ( messaging_preference.Item_Renew ) %]Item Renew [% ELSE %]Unknown [% END %]</td> [% IF ( messaging_preference.takes_days ) %] <td><select name="[% messaging_preference.message_attribute_id %]-DAYS"> -- 1.6.4.2 From amit.gupta at osslabs.biz Fri Sep 9 02:49:42 2011 From: amit.gupta at osslabs.biz (Amit Gupta) Date: Fri, 9 Sep 2011 06:19:42 +0530 Subject: [Koha-patches] [PATCH] Bug 6761 - Longer userid field with $DBversion = "3.05.00.XXX"; Message-ID: <1315529382-17034-1-git-send-email-amit.gupta@osslabs.biz> Some libraries use email ids as userids. The current length of the userid field is 30 and is not sufficient to accomodate some email addresses. This change will increase the length to 75. --- installer/data/mysql/kohastructure.sql | 2 +- installer/data/mysql/updatedatabase.pl | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 13fa53d..d5c91e4 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -244,7 +244,7 @@ CREATE TABLE `borrowers` ( `sex` varchar(1) default NULL, `password` varchar(30) default NULL, `flags` int(11) default NULL, - `userid` varchar(30) default NULL, + `userid` varchar(75) default NULL, `opacnote` mediumtext, `contactnote` varchar(255) default NULL, `sort1` varchar(80) default NULL, diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bdfc9ac..76540ca 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4439,6 +4439,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE `borrowers` MODIFY `userid` VARCHAR(75)"); + print "Modified userid column length into 75 in borrowers\n"; + SetVersion($DBversion); +} + + =head1 FUNCTIONS -- 1.6.4.2 From amit.gupta at osslabs.biz Fri Sep 9 04:10:35 2011 From: amit.gupta at osslabs.biz (Amit Gupta) Date: Fri, 9 Sep 2011 07:40:35 +0530 Subject: [Koha-patches] [PATCH] Bug-6810 Send membership expiry reminder notices. Message-ID: <1315534235-24742-1-git-send-email-amit.gupta@osslabs.biz> A new crontab based perl script to send membership expiry reminders. A system preference controls the number of days in advance of membership expiry that the notices will be sent on. --- C4/Letters.pm | 4 + C4/Members.pm | 22 +++++ .../data/mysql/de-DE/mandatory/sample_notices.sql | 1 + .../data/mysql/en/mandatory/sample_notices.sql | 1 + .../data/mysql/es-ES/mandatory/sample_notices.sql | 1 + .../mysql/fr-FR/1-Obligatoire/sample_notices.sql | 1 + installer/data/mysql/it-IT/necessari/notices.sql | 1 + .../mysql/nb-NO/1-Obligatorisk/sample_notices.sql | 1 + .../data/mysql/pl-PL/mandatory/sample_notices.sql | 3 +- .../data/mysql/ru-RU/mandatory/sample_notices.sql | 1 + installer/data/mysql/sysprefs.sql | 1 + .../data/mysql/uk-UA/mandatory/sample_notices.sql | 1 + installer/data/mysql/updatedatabase.pl | 9 ++ .../prog/en/modules/admin/preferences/patrons.pref | 5 + misc/cronjobs/membership_expiry.pl | 100 ++++++++++++++++++++ 15 files changed, 151 insertions(+), 1 deletions(-) create mode 100755 misc/cronjobs/membership_expiry.pl diff --git a/C4/Letters.pm b/C4/Letters.pm index 6846a00..961fa00 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -525,6 +525,10 @@ sub parseletter { } my $values = $sth->fetchrow_hashref; + + if ($table eq 'borrowers' && $values->{'dateexpiry'}){ + my @dateexpiry = split /-/, $values->{'dateexpiry'}; + $values->{'dateexpiry'} = C4::Dates->new(sprintf('%04d-%02d-%02d', Add_Delta_Days( @dateexpiry,0)),'iso' )->output(); } # TEMPORARY hack until the expirationdate column is added to reserves if ( $table eq 'reserves' && $values->{'waitingdate'} ) { diff --git a/C4/Members.pm b/C4/Members.pm index dcc168b..3031acc 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -86,6 +86,7 @@ BEGIN { &GetBorrowersWithIssuesHistoryOlderThan &GetExpiryDate + &GetUpcomingMembershipExpires &AddMessage &DeleteMessage @@ -2260,6 +2261,27 @@ sub GetMessagesCount { return $count; } +=head2 GetUpcomingMembershipExpires + + my $upcoming_mem_expires = GetUpcomingMembershipExpires(); + +=cut + +sub GetUpcomingMembershipExpires { + my $dbh = C4::Context->dbh; + my $days = C4::Context->preference("MemExpDaysNotice"); + my $query = " + SELECT borrowers.* , categories.description, +branches.branchname FROM borrowers + LEFT JOIN branches on borrowers.branchcode = branches.branchcode + LEFT JOIN categories on borrowers.categorycode = categories.categorycode + WHERE dateexpiry = DATE_ADD(CURDATE(),INTERVAL $days DAY); + "; + my $sth = $dbh->prepare($query); + $sth->execute; + my $results = $sth->fetchall_arrayref({}); + return $results; +} =head2 DeleteMessage diff --git a/installer/data/mysql/de-DE/mandatory/sample_notices.sql b/installer/data/mysql/de-DE/mandatory/sample_notices.sql index 166c36d..deb6eae 100644 --- a/installer/data/mysql/de-DE/mandatory/sample_notices.sql +++ b/installer/data/mysql/de-DE/mandatory/sample_notices.sql @@ -3,6 +3,7 @@ VALUES ('circulation','ODUE','Mahnung','Mahnung','Liebe/r <<borrowers.firstname> ('claimacquisition','ACQCLAIM','Reklamation (Erwerbung)','Titel nicht eingetroffen','<<aqbooksellers.name>>\r\n<<aqbooksellers.address1>>\r\n<<aqbooksellers.address2>>\r\n<<aqbooksellers.address3>>\r\n<<aqbooksellers.address4>>\r\n<<aqbooksellers.phone>>\r\n\r\nOrdernumber <<aqorders.ordernumber>> (<<aqorders.title>>) (<<aqorders.quantity>> bestellt) (je $<<aqorders.listprice>> ???) sind nicht eingetroffen.'), ('serial','RLIST','Umlaufliste','Zeitschrift ist jetzt verf??gbar','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nDas folgende Heft ist jetzt verf??gbar:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)\r\n\r\nBitte holen Sie es sobald m??glich ab.'), ('members','ACCTDETAILS','Kontoinformationen - Standard','Ihr neues Benutzerkonto','Liebe/r <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>.\r\n\r\nDie Daten Ihres neuen Benutzerkontos sind:\r\n\r\nBenutzer: <<borrowers.userid>>\r\nPasswort: <<borrowers.password>>\r\n\r\nWenn Sie Probleme in Hinsicht auf Ihr Benutzerkonto haben, wenden Sie sich bitte an die Bibliothek.\r\n\r\nVielen Dank,\r\nIhr Bibliotheksteam'), +('members','MEMEXP','Membership Expiry Notice','Membership Expiry Notice','Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour membership expires soon on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\n<<branches.branchname>>'), ('circulation','DUE','F??lligkeitsbenachrichtigung','F??lligkeitsbenachrichtigung','Liebe/r <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nDie folgenden Medien sind ab heute f??llig:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), ('circulation','DUEDGST','F??lligkeitsbenachrichtigung (Zusammenfassung)','F??lligkeitsbenachrichtigung','Sie haben <<count>> ??berf??llige Medien.'), ('circulation','PREDUE','Erinnerungsbenachrichtigung','Erinnerungsbenachrichtigung','Liebe/r <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nFolgende Ausleihe wird bald f??llig:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), diff --git a/installer/data/mysql/en/mandatory/sample_notices.sql b/installer/data/mysql/en/mandatory/sample_notices.sql index 689fa0f..b7d4fe8 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.sql +++ b/installer/data/mysql/en/mandatory/sample_notices.sql @@ -3,6 +3,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('claimacquisition','ACQCLAIM','Acquisition Claim','Item Not Received','<<aqbooksellers.name>>\r\n<<aqbooksellers.address1>>\r\n<<aqbooksellers.address2>>\r\n<<aqbooksellers.address3>>\r\n<<aqbooksellers.address4>>\r\n<<aqbooksellers.phone>>\r\n\r\nOrdernumber <<aqorders.ordernumber>> (<<aqorders.title>>) (<<aqorders.quantity>> ordered) ($<<aqorders.listprice>> each) has not been received.'), ('serial','RLIST','Routing List','Serial is now available','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following issue is now available:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)\r\n\r\nPlease pick it up at your convenience.'), ('members','ACCTDETAILS','Account Details Template - DEFAULT','Your new Koha account details.','Hello <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>.\r\n\r\nYour new Koha account details are:\r\n\r\nUser: <<borrowers.userid>>\r\nPassword: <<borrowers.password>>\r\n\r\nIf you have any problems or questions regarding your account, please contact your Koha Administrator.\r\n\r\nThank you,\r\nKoha Administrator\r\nkohaadmin at yoursite.org'), +('members','MEMEXP','Membership Expiry Notice','Membership Expiry Notice','Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour membership expires soon on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\n<<branches.branchname>>'), ('circulation','DUE','Item Due Reminder','Item Due Reminder','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item is now due:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), ('circulation','DUEDGST','Item Due Reminder (Digest)','Item Due Reminder','You have <<count>> items due'), ('circulation','PREDUE','Advance Notice of Item Due','Advance Notice of Item Due','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item will be due soon:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), diff --git a/installer/data/mysql/es-ES/mandatory/sample_notices.sql b/installer/data/mysql/es-ES/mandatory/sample_notices.sql index 689fa0f..b7d4fe8 100644 --- a/installer/data/mysql/es-ES/mandatory/sample_notices.sql +++ b/installer/data/mysql/es-ES/mandatory/sample_notices.sql @@ -3,6 +3,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('claimacquisition','ACQCLAIM','Acquisition Claim','Item Not Received','<<aqbooksellers.name>>\r\n<<aqbooksellers.address1>>\r\n<<aqbooksellers.address2>>\r\n<<aqbooksellers.address3>>\r\n<<aqbooksellers.address4>>\r\n<<aqbooksellers.phone>>\r\n\r\nOrdernumber <<aqorders.ordernumber>> (<<aqorders.title>>) (<<aqorders.quantity>> ordered) ($<<aqorders.listprice>> each) has not been received.'), ('serial','RLIST','Routing List','Serial is now available','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following issue is now available:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)\r\n\r\nPlease pick it up at your convenience.'), ('members','ACCTDETAILS','Account Details Template - DEFAULT','Your new Koha account details.','Hello <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>.\r\n\r\nYour new Koha account details are:\r\n\r\nUser: <<borrowers.userid>>\r\nPassword: <<borrowers.password>>\r\n\r\nIf you have any problems or questions regarding your account, please contact your Koha Administrator.\r\n\r\nThank you,\r\nKoha Administrator\r\nkohaadmin at yoursite.org'), +('members','MEMEXP','Membership Expiry Notice','Membership Expiry Notice','Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour membership expires soon on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\n<<branches.branchname>>'), ('circulation','DUE','Item Due Reminder','Item Due Reminder','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item is now due:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), ('circulation','DUEDGST','Item Due Reminder (Digest)','Item Due Reminder','You have <<count>> items due'), ('circulation','PREDUE','Advance Notice of Item Due','Advance Notice of Item Due','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item will be due soon:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql index 977e59d..d4307f1 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql @@ -5,6 +5,7 @@ VALUES ('claimacquisition','ACQCLAIM','Acquisition Claim','Item Not Received','<<aqbooksellers.name>>\r\n<<aqbooksellers.address1>>\r\n<<aqbooksellers.address2>>\r\n<<aqbooksellers.address3>>\r\n<<aqbooksellers.address4>>\r\n<<aqbooksellers.phone>>\r\n\r\nOrdernumber <<aqorders.ordernumber>> (<<aqorders.title>>) (<<aqorders.quantity>> ordered) ($<<aqorders.listprice>> each) has not been received.'), ('serial','RLIST','Routing List','Serial is now available','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following issue is now available:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)\r\n\r\nPlease pick it up at your convenience.'), ('members','ACCTDETAILS','Account Details Template - DEFAULT','Your new Koha account details.','Hello <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>.\r\n\r\nYour new Koha account details are:\r\n\r\nUser: <<borrowers.userid>>\r\nPassword: <<borrowers.password>>\r\n\r\nIf you have any problems or questions regarding your account, please contact your Koha Administrator.\r\n\r\nThank you,\r\nKoha Administrator\r\nkohaadmin at yoursite.org'), +('members','MEMEXP','Membership Expiry Notice','Membership Expiry Notice','Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour membership expires soon on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\n<<branches.branchname>>'), ('circulation','DUE','Item Due Reminder','Item Due Reminder','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item is now due:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), ('circulation','DUEDGST','Item Due Reminder (Digest)','Item Due Reminder','You have <<count>> items due'), ('circulation','PREDUE','Advance Notice of Item Due','Advance Notice of Item Due','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item will be due soon:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), diff --git a/installer/data/mysql/it-IT/necessari/notices.sql b/installer/data/mysql/it-IT/necessari/notices.sql index 689fa0f..b7d4fe8 100644 --- a/installer/data/mysql/it-IT/necessari/notices.sql +++ b/installer/data/mysql/it-IT/necessari/notices.sql @@ -3,6 +3,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('claimacquisition','ACQCLAIM','Acquisition Claim','Item Not Received','<<aqbooksellers.name>>\r\n<<aqbooksellers.address1>>\r\n<<aqbooksellers.address2>>\r\n<<aqbooksellers.address3>>\r\n<<aqbooksellers.address4>>\r\n<<aqbooksellers.phone>>\r\n\r\nOrdernumber <<aqorders.ordernumber>> (<<aqorders.title>>) (<<aqorders.quantity>> ordered) ($<<aqorders.listprice>> each) has not been received.'), ('serial','RLIST','Routing List','Serial is now available','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following issue is now available:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)\r\n\r\nPlease pick it up at your convenience.'), ('members','ACCTDETAILS','Account Details Template - DEFAULT','Your new Koha account details.','Hello <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>.\r\n\r\nYour new Koha account details are:\r\n\r\nUser: <<borrowers.userid>>\r\nPassword: <<borrowers.password>>\r\n\r\nIf you have any problems or questions regarding your account, please contact your Koha Administrator.\r\n\r\nThank you,\r\nKoha Administrator\r\nkohaadmin at yoursite.org'), +('members','MEMEXP','Membership Expiry Notice','Membership Expiry Notice','Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour membership expires soon on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\n<<branches.branchname>>'), ('circulation','DUE','Item Due Reminder','Item Due Reminder','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item is now due:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), ('circulation','DUEDGST','Item Due Reminder (Digest)','Item Due Reminder','You have <<count>> items due'), ('circulation','PREDUE','Advance Notice of Item Due','Advance Notice of Item Due','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item will be due soon:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql index cdb5529..29d86ac 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql @@ -24,6 +24,7 @@ VALUES ('circulation','ODUE','Purring','Purring p?? dokument','<<borrowers.first ('claimacquisition','ACQCLAIM','Periodikapurring','Eksemplar ikke mottatt','<<aqbooksellers.name>>\r\n<<aqbooksellers.address1>>\r\n<<aqbooksellers.address2>>\r\n<<aqbooksellers.address3>>\r\n<<aqbooksellers.address4>>\r\n<<aqbooksellers.phone>>\r\n\r\nBestillingsnummer <<aqorders.ordernumber>> (<<aqorders.title>>) (<<aqorders.quantity>> ordered) ($<<aqorders.listprice>> each) har ikke blitt mottatt.'), ('serial','RLIST','Sirkulasjon','Et dokument er n?? tilgjengelig','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nDette dokumentet er tilgjengelig:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)\r\n\r\nVennligst kom og hent det n??r det passer.'), ('members','ACCTDETAILS','Mal for kontodetaljer - STANDARD','Dine nye kontodetaljer i Koha.','Hei <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>.\r\n\r\nDine nye detaljer er:\r\n\r\nBruker: <<borrowers.userid>>\r\nPassord: <<borrowers.password>>\r\n\r\nDersom det oppst??r problemer, vennligst kontakt biblioteket.\r\n\r\nVennlig hilsen,\r\nBiblioteket\r\nkohaadmin at yoursite.org'), +('members','MEMEXP','Membership Expiry Notice','Membership Expiry Notice','Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour membership expires soon on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\n<<branches.branchname>>'), ('circulation','DUE','Innleveringsp??minnelse','Innleveringsp??minnelse','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nDette dokumentet m?? n?? leveres:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), ('circulation','DUEDGST','Innleveringsp??minnelse (sammendrag)','Innleveringsp??minnelse','Du har <<count>> dokumenter som skulle v??rt levert.'), ('circulation','PREDUE','Forh??ndsp??minnelse','Forh??ndsp??minnelse','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nDette dokumentet m?? snart leveres:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), diff --git a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql index 6be2eb8..1491625 100644 --- a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql +++ b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql @@ -4,7 +4,8 @@ VALUES 'Item Overdue','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nAccording to our current records, you have items that are overdue.Your library does not charge late fines, but please return or renew them at the branch below as soon as possible.\n\n<<branches.branchname>>\n<<branches.branchaddress1>>\n<<branches.branchaddress2>> <<branches.branchaddress3>>\nPhone: <<branches.branchphone>>\nFax: <<branches.branchfax>>\nEmail: <<branches.branchemail>>\n\nIf you have registered a password with the library, and you have a renewal available, you may renew online. If an item becomes more than 30 days overdue, you will be unable to use your library card until the item is returned.\n\nThe following item(s) is/are currently overdue:\n\n<item>"<<biblio.title>>" by <<biblio.author>>, <<items.itemcallnumber>>, Barcode: <<items.barcode>> Fine: <fine>GBP</fine></item>\n\nThank-you for your prompt attention to this matter.\n\n<<branches.branchname>> Staff\n'), ('claimacquisition','ACQCLAIM','Acquisition Claim','Item Not Received','<<aqbooksellers.name>>\r\n<<aqbooksellers.address1>>\r\n<<aqbooksellers.address2>>\r\n<<aqbooksellers.address3>>\r\n<<aqbooksellers.address4>>\r\n<<aqbooksellers.phone>>\r\n\r\nOrdernumber <<aqorders.ordernumber>> (<<aqorders.title>>) (<<aqorders.quantity>> ordered) ($<<aqorders.listprice>> each) has not been received.'), ('serial','RLIST','Routing List','Serial is now available','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following issue is now available:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)\r\n\r\nPlease pick it up at your convenience.'), -('members','ACCTDETAILS','Account Details Template - DEFAULT','Your new Koha account details.','Hello <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>.\r\n\r\nYour new Koha account details are:\r\n\r\nUser: <<borrowers.userid>>\r\nPassword: <<borrowers.password>>\r\n\r\nIf you have any problems or questions regarding your account, please contact your Koha Administrator.\r\n\r\nThank you,\r\nKoha Administrator\r\nkohaadmin at yoursite.org'), +('members','ACCTDETAILS','Account Details Template - DEFAULT','Your new Koha account details.','Hello <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>.\r\n\r\nYour new Koha account details are:\r\n\r\nUser: <<borrowers.userid>>\r\nPassword: <<borrowers.password>>\r\n\r\nIf you have any problems or questions regarding your account, please contact your Koha Administrator.\r\n\r\nThank you,\r\nKoha Administrator\r\nkohaadmin at yoursite.org'), +('members','MEMEXP','Membership Expiry Notice','Membership Expiry Notice','Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour membership expires soon on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\n<<branches.branchname>>'), ('circulation','DUE','Item Due Reminder','Item Due Reminder','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item is now due:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), ('circulation','DUEDGST','Item Due Reminder (Digest)','Item Due Reminder','You have <<count>> items due'), ('circulation','PREDUE','Advance Notice of Item Due','Advance Notice of Item Due','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item will be due soon:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), diff --git a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql index 689fa0f..b7d4fe8 100644 --- a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql +++ b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql @@ -3,6 +3,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('claimacquisition','ACQCLAIM','Acquisition Claim','Item Not Received','<<aqbooksellers.name>>\r\n<<aqbooksellers.address1>>\r\n<<aqbooksellers.address2>>\r\n<<aqbooksellers.address3>>\r\n<<aqbooksellers.address4>>\r\n<<aqbooksellers.phone>>\r\n\r\nOrdernumber <<aqorders.ordernumber>> (<<aqorders.title>>) (<<aqorders.quantity>> ordered) ($<<aqorders.listprice>> each) has not been received.'), ('serial','RLIST','Routing List','Serial is now available','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following issue is now available:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)\r\n\r\nPlease pick it up at your convenience.'), ('members','ACCTDETAILS','Account Details Template - DEFAULT','Your new Koha account details.','Hello <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>.\r\n\r\nYour new Koha account details are:\r\n\r\nUser: <<borrowers.userid>>\r\nPassword: <<borrowers.password>>\r\n\r\nIf you have any problems or questions regarding your account, please contact your Koha Administrator.\r\n\r\nThank you,\r\nKoha Administrator\r\nkohaadmin at yoursite.org'), +('members','MEMEXP','Membership Expiry Notice','Membership Expiry Notice','Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour membership expires soon on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\n<<branches.branchname>>'), ('circulation','DUE','Item Due Reminder','Item Due Reminder','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item is now due:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), ('circulation','DUEDGST','Item Due Reminder (Digest)','Item Due Reminder','You have <<count>> items due'), ('circulation','PREDUE','Advance Notice of Item Due','Advance Notice of Item Due','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item will be due soon:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 8407505..6bb78f9 100755 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -317,3 +317,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO `systempreferences`(variable,value,explanation,options,type) VALUES('MemExpDaysNotice',14,'Send a membership expiry notice that a patron is about to expire after',NULL,'free'); diff --git a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql index 358205b..631481d 100644 --- a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql +++ b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql @@ -3,6 +3,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f ('claimacquisition','ACQCLAIM','Acquisition Claim','Item Not Received','<<aqbooksellers.name>>\r\n<<aqbooksellers.address1>>\r\n<<aqbooksellers.address2>>\r\n<<aqbooksellers.address3>>\r\n<<aqbooksellers.address4>>\r\n<<aqbooksellers.phone>>\r\n\r\nOrdernumber <<aqorders.ordernumber>> (<<aqorders.title>>) (<<aqorders.quantity>> ordered) ($<<aqorders.listprice>> each) has not been received.'), ('serial','RLIST','Routing List','Serial is now available','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following issue is now available:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)\r\n\r\nPlease pick it up at your convenience.'), ('members','ACCTDETAILS','Account Details Template - DEFAULT','Your new Koha account details.','Hello <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>.\r\n\r\nYour new Koha account details are:\r\n\r\nUser: <<borrowers.userid>>\r\nPassword: <<borrowers.password>>\r\n\r\nIf you have any problems or questions regarding your account, please contact your Koha Administrator.\r\n\r\nThank you,\r\nKoha Administrator\r\nkohaadmin at yoursite.org'), +('members','MEMEXP','Membership Expiry Notice','Membership Expiry Notice','Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour membership expires soon on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\n<<branches.branchname>>'), ('circulation','DUE','Item Due Reminder','Item Due Reminder','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item is now due:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), ('circulation','DUEDGST','Item Due Reminder (Digest)','Item Due Reminder','You have <<count>> items due'), ('circulation','PREDUE','Advance Notice of Item Due','Advance Notice of Item Due','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item will be due soon:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bdfc9ac..0a782d6 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4439,6 +4439,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { +$dbh->do(q{INSERT INTO `letter` (`module`, `code`, `name`, `title`,`content`) VALUES('members','MEMEXP','Membership Expiry','Your Membership Expires','Dear <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>,.\r\n\r\nYour membership expires soon on:\r\n\r\n<<borrowers.dateexpiry>>\r\n\r\nThank you,\r\n\r\n<<branches.branchname>>'); + }); + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MemExpDaysNotice',14,'Send a membership expiry notice that a patron is about to expire after',NULL,'free')"); + print "Upgrade to $DBversion done (Add letter and syspref for Membership expiry notifications)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index ac3e1d2..327246d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -82,6 +82,11 @@ Patrons: class: integer - characters long. - + - Send a membership expiry notice that a patron is about to expire after + - pref: MemExpDaysNotice + class: integer + - days. + - - Show a notice that a patron is about to expire - pref: NotifyBorrowerDeparture class: integer diff --git a/misc/cronjobs/membership_expiry.pl b/misc/cronjobs/membership_expiry.pl new file mode 100755 index 0000000..a50176d --- /dev/null +++ b/misc/cronjobs/membership_expiry.pl @@ -0,0 +1,100 @@ +#!/usr/bin/perl + +# Copyright 2011 Nucsoft Osslabs. +# +# 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 2 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +=head1 NAME + +membership_expires.pl - cron script to put item due reminders into message queue + +=head1 SYNOPSIS + +./membership_expires.pl + +or, in crontab: +0 1 * * * membership_expires.pl + +=cut + +use strict; +use warnings; +use Getopt::Long; +use Data::Dumper; +BEGIN { + # find Koha's Perl modules + # test carefully before changing this + use FindBin; + eval { require "$FindBin::Bin/../kohalib.pl" }; +} + +use C4::Context; +use C4::Letters; +use C4::Dates qw/format_date/; + +# These are defaults for command line options. +my $nomail; # -n: No mail. Will not send any emails. +my $fromaddress = C4::Context->preference('KohaAdminEmailAddress'); # -f: From address for the emails +my $verbose = 0; # -v: verbose + +GetOptions( 'n' => \$nomail, + 'v' => \$verbose, + ); + +warn 'getting upcoming membership expires' if $verbose; +my $upcoming_mem_expires = C4::Members::GetUpcomingMembershipExpires(); +warn 'found ' . scalar( @$upcoming_mem_expires ) . ' issues' if $verbose; + +UPCOMINGMEMEXP: foreach my $recent ( @$upcoming_mem_expires ) { + + my $letter_type = 'MEMEXP'; + my $letter = C4::Letters::getletter( 'members', $letter_type ); + die "no letter of type '$letter_type' found. Please see sample_notices.sql" unless $letter; + + $letter = parse_letter( { letter => $letter, + borrowernumber => $recent->{'borrowernumber'}, + categorycode => $recent->{'categorycode'}, + branchcode => $recent->{'branchcode'}, + + }); + if ($letter) { + C4::Letters::EnqueueLetter( { letter => $letter, + borrowernumber => $recent->{'borrowernumber'}, + message_transport_type => 'email' } ); + } + + + } + +=head1 METHODS + +=head2 parse_letter + +=cut + +sub parse_letter { + my $params = shift; + foreach my $required ( qw( letter borrowernumber ) ) { + return unless exists $params->{$required}; + } + C4::Letters::parseletter( $params->{'letter'}, 'borrowers', $params->{'borrowernumber'} ); + C4::Letters::parseletter( $params->{'letter'}, 'branches', $params->{'branchcode'} ); + return $params->{'letter'}; +} + +1; + +__END__ -- 1.6.4.2 From amit.gupta at osslabs.biz Fri Sep 9 04:27:03 2011 From: amit.gupta at osslabs.biz (Amit Gupta) Date: Fri, 9 Sep 2011 07:57:03 +0530 Subject: [Koha-patches] [PATCH] Bug 6776 - Add Checkin tab to patron search tool Message-ID: <1315535223-26053-1-git-send-email-amit.gupta@osslabs.biz> From: shinoy.m <shinoy.m at osslabs.biz> Add check-in as an option in patron-search.inc, thus allowing a checkin tab to be available in several patron and circulation pages Signed-off-by: Amit Gupta <amit.gupta at osslabs.biz> --- .../prog/en/includes/patron-search.inc | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index 0be014a..c783a46 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -45,6 +45,13 @@ YAHOO.util.Event.onContentReady("header_search", function() { //]]> </script>[% END %][% END %] <div id="header_search"> + <div id="checkin_search" class="residentsearch" style="display:none;"> + <p class="tip">Scan a barcode to check in:</p> + <form method="post" action="/cgi-bin/koha/circ/returns.pl"> + <input name="barcode" id="ret_barcode" size="40" accesskey="r" /> + <input value="Submit" class="submit" type="submit" /> + </form> + </div> <div id="patron_search" class="residentsearch"> <p class="tip">Enter patron card number or partial name:</p> <form action="/cgi-bin/koha/members/member.pl" method="post"> @@ -109,6 +116,7 @@ YAHOO.util.Event.onContentReady("header_search", function() { <ul> <li><a href="/cgi-bin/koha/members/members-home.pl#patron_search">Search Patrons</a></li> [% IF ( CAN_user_circulate ) %]<li><a href="/cgi-bin/koha/circ/circulation.pl#circ_search">Check Out</a></li>[% END %] + [% IF ( CAN_user_circulate ) %]<li><a href="/cgi-bin/koha/circ/returns.pl#checkin_search">Check In</a></li>[% END %] [% IF ( CAN_user_catalogue ) %]<li><a href="/cgi-bin/koha/catalogue/search.pl#catalog_search">Search the Catalog</a></li>[% END %] </ul> </div> -- 1.6.4.2 From amit.gupta at osslabs.biz Fri Sep 9 04:34:53 2011 From: amit.gupta at osslabs.biz (Amit Gupta) Date: Fri, 9 Sep 2011 08:04:53 +0530 Subject: [Koha-patches] [PATCH] Bug:6781--Log membership renewal Message-ID: <1315535693-26728-1-git-send-email-amit.gupta@osslabs.biz> From: Meenakshi.R <meenakshi.r at osslabs.biz> If patron related logging is tuned on, log membership renewal Signed-off-by: Amit Gupta <amit.gupta at osslabs.biz> --- C4/Members.pm | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index dcc168b..e43683a 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -1763,6 +1763,7 @@ EOF # insert fee in patron debts manualinvoice($borrower->{'borrowernumber'}, '', '', 'A', $enrolmentfee); } + logaction("MEMBERS", "RENEW", $borrower->{'borrowernumber'}, "Membership renewed")if C4::Context->preference("BorrowersLog"); return $date if ($sth); return 0; } -- 1.6.4.2 From paul.poulain at biblibre.com Fri Sep 9 15:09:25 2011 From: paul.poulain at biblibre.com (paul.poulain at biblibre.com) Date: Fri, 9 Sep 2011 15:09:25 +0200 Subject: [Koha-patches] [PATCH] Bug 5729 - Add CoinS to intranet Message-ID: <1315573765-4068-1-git-send-email-paul.poulain@biblibre.com> From: Paul Poulain <paul.poulain at biblibre.com> This patch adds CoinS support to biblio displays in staff interface. librarians can now use zotero on the staff interface --- catalogue/ISBDdetail.pl | 3 ++- catalogue/MARCdetail.pl | 2 ++ catalogue/detail.pl | 1 + .../prog/en/modules/catalogue/ISBDdetail.tt | 5 ++++- .../prog/en/modules/catalogue/MARCdetail.tt | 4 ++++ .../prog/en/modules/catalogue/detail.tt | 5 +++++ 6 files changed, 18 insertions(+), 2 deletions(-) diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl index 58a8d90..8daa13e 100755 --- a/catalogue/ISBDdetail.pl +++ b/catalogue/ISBDdetail.pl @@ -106,7 +106,8 @@ $template->param ( biblionumber => $biblionumber, isbdview => 1, z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)), - C4::Search::enabled_staff_search_views + C4::Search::enabled_staff_search_views, + ocoins => GetCOinSBiblio($biblionumber), ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index 0a2974b..52fbc6a 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -82,6 +82,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +$template->param( ocoins => GetCOinSBiblio($biblionumber) ); + my $record = GetMarcBiblio($biblionumber); if ( not defined $record ) { diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 8738737..d43038d 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -83,6 +83,7 @@ if (C4::Context->preference("XSLTDetailsDisplay") ) { } $template->param( 'SpineLabelShowPrintOnBibDetails' => C4::Context->preference("SpineLabelShowPrintOnBibDetails") ); +$template->param( ocoins => GetCOinSBiblio($biblionumber) ); # some useful variables for enhanced content; # in each case, we're grabbing the first value we find in diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt index b08f360..8b8fc97 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt @@ -30,7 +30,10 @@ <div id="yui-main"> <div class="yui-b"> [% INCLUDE 'cat-toolbar.inc' %] - + [% IF ( ocoins ) %] + <!-- COinS / OpenURL --> + <span class="Z3988" title="[% ocoins %]"></span> + [% END %] <div id="catalogue_ISBDdetail"> [% ISBD %] </div> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt index 3fac577..0202462 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt @@ -57,6 +57,10 @@ function Changefwk(FwkList) { [% IF ( frameworkcodeloo.selected ) %]<option value="[% frameworkcodeloo.value %]" selected="selected">[% frameworkcodeloo.frameworktext %]</option>[% ELSE %]<option value="[% frameworkcodeloo.value %]">[% frameworkcodeloo.frameworktext %]</option>[% END %] [% END %] </select> </b></p> +[% IF ( ocoins ) %] +<!-- COinS / OpenURL --> +<span class="Z3988" title="[% ocoins %]"></span> +[% END %] <div id="bibliotabs" class="toptabs numbered"> <ul> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index e723781..81686ad 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -68,6 +68,11 @@ function verify_images() { <div class="yui-b"> [% INCLUDE 'cat-toolbar.inc' %] + [% IF ( ocoins ) %] + <!-- COinS / OpenURL --> + <span class="Z3988" title="[% ocoins %]"></span> + [% END %] + [% IF ( AmazonEnabled ) %] [% IF ( XSLTDetailsDisplay ) %] <div class="yui-gc"> -- 1.7.4.1 From paul.poulain at biblibre.com Fri Sep 9 15:10:28 2011 From: paul.poulain at biblibre.com (paul.poulain at biblibre.com) Date: Fri, 9 Sep 2011 15:10:28 +0200 Subject: [Koha-patches] [PATCH] Bug 5729 - Add CoinS to intranet Message-ID: <1315573828-4203-1-git-send-email-paul.poulain@biblibre.com> From: Paul Poulain <paul.poulain at biblibre.com> This patch adds CoinS support to biblio displays in staff interface. librarians can now use zotero on the staff interface --- catalogue/ISBDdetail.pl | 3 ++- catalogue/MARCdetail.pl | 2 ++ catalogue/detail.pl | 1 + .../prog/en/modules/catalogue/ISBDdetail.tt | 5 ++++- .../prog/en/modules/catalogue/MARCdetail.tt | 4 ++++ .../prog/en/modules/catalogue/detail.tt | 5 +++++ 6 files changed, 18 insertions(+), 2 deletions(-) diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl index 58a8d90..8daa13e 100755 --- a/catalogue/ISBDdetail.pl +++ b/catalogue/ISBDdetail.pl @@ -106,7 +106,8 @@ $template->param ( biblionumber => $biblionumber, isbdview => 1, z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)), - C4::Search::enabled_staff_search_views + C4::Search::enabled_staff_search_views, + ocoins => GetCOinSBiblio($biblionumber), ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index 0a2974b..52fbc6a 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -82,6 +82,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +$template->param( ocoins => GetCOinSBiblio($biblionumber) ); + my $record = GetMarcBiblio($biblionumber); if ( not defined $record ) { diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 8738737..d43038d 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -83,6 +83,7 @@ if (C4::Context->preference("XSLTDetailsDisplay") ) { } $template->param( 'SpineLabelShowPrintOnBibDetails' => C4::Context->preference("SpineLabelShowPrintOnBibDetails") ); +$template->param( ocoins => GetCOinSBiblio($biblionumber) ); # some useful variables for enhanced content; # in each case, we're grabbing the first value we find in diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt index b08f360..8b8fc97 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt @@ -30,7 +30,10 @@ <div id="yui-main"> <div class="yui-b"> [% INCLUDE 'cat-toolbar.inc' %] - + [% IF ( ocoins ) %] + <!-- COinS / OpenURL --> + <span class="Z3988" title="[% ocoins %]"></span> + [% END %] <div id="catalogue_ISBDdetail"> [% ISBD %] </div> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt index 3fac577..0202462 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt @@ -57,6 +57,10 @@ function Changefwk(FwkList) { [% IF ( frameworkcodeloo.selected ) %]<option value="[% frameworkcodeloo.value %]" selected="selected">[% frameworkcodeloo.frameworktext %]</option>[% ELSE %]<option value="[% frameworkcodeloo.value %]">[% frameworkcodeloo.frameworktext %]</option>[% END %] [% END %] </select> </b></p> +[% IF ( ocoins ) %] +<!-- COinS / OpenURL --> +<span class="Z3988" title="[% ocoins %]"></span> +[% END %] <div id="bibliotabs" class="toptabs numbered"> <ul> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index e723781..81686ad 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -68,6 +68,11 @@ function verify_images() { <div class="yui-b"> [% INCLUDE 'cat-toolbar.inc' %] + [% IF ( ocoins ) %] + <!-- COinS / OpenURL --> + <span class="Z3988" title="[% ocoins %]"></span> + [% END %] + [% IF ( AmazonEnabled ) %] [% IF ( XSLTDetailsDisplay ) %] <div class="yui-gc"> -- 1.7.4.1 From M.de.Rooy at rijksmuseum.nl Fri Sep 9 16:41:44 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Fri, 9 Sep 2011 14:41:44 +0000 Subject: [Koha-patches] [PATCH] 6755 Problems with switching languages In-Reply-To: <1315578960-28438-1-git-send-email-m.de.rooy@rijksmuseum.nl> References: <1315578960-28438-1-git-send-email-m.de.rooy@rijksmuseum.nl> Message-ID: <809BE39CD64BFD4EB9036172EBCCFA3132AB24@S-MAIL-1B.rijksmuseum.intra> This patch solves the situation that news is in another language than the Koha interface AND makes that themelanguage routine is always called the same way in order to prevent mixed display. September 9: Adjusted with input of Frederic Demians. --- C4/Output.pm | 2 +- C4/Templates.pm | 3 ++- opac/opac-main.pl | 28 +--------------------------- 3 files changed, 4 insertions(+), 29 deletions(-) diff --git a/C4/Output.pm b/C4/Output.pm index 98f2d7a..2481fe7 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -96,7 +96,7 @@ sub gettemplate { my $opacstylesheet = C4::Context->preference('opacstylesheet'); $tmplbase =~ s/\.tmpl$/.tt/; my ( $htdocs, $theme, $lang, $filename ) = _get_template_file( $tmplbase, $interface, $query ); - my $template = C4::Templates->new( $interface, $filename, $tmplbase); + my $template = C4::Templates->new($interface, $filename, $tmplbase, $query); my $themelang=( $interface ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' ) . "/$theme/$lang"; $template->param( diff --git a/C4/Templates.pm b/C4/Templates.pm index 4368492..e0a01f8 100644 --- a/C4/Templates.pm +++ b/C4/Templates.pm @@ -41,6 +41,7 @@ sub new { my $interface = shift; my $filename = shift; my $tmplbase = shift; + my $query = @_? shift: undef; my $htdocs; if ( $interface ne "intranet" ) { $htdocs = C4::Context->config('opachtdocs'); @@ -49,7 +50,7 @@ sub new { $htdocs = C4::Context->config('intrahtdocs'); } - my ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, $interface ); + my ($theme, $lang)= C4::Output::themelanguage( $htdocs, $tmplbase, $interface, $query); my $template = Template->new( { EVAL_PERL => 1, diff --git a/opac/opac-main.pl b/opac/opac-main.pl index 177d812..cd76bc7 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -54,33 +54,7 @@ $template->param( # display news # use cookie setting for language, bug default to syspref if it's not set -(my $theme) = themelanguage(C4::Context->config('opachtdocs'),'opac-main.tmpl','opac',$input); - -my $translations = getTranslatedLanguages('opac',$theme); -my @languages = (); -foreach my $trans (@$translations) -{ - push(@languages, $trans->{rfc4646_subtag}); -} - -my $news_lang; -if($input->cookie('KohaOpacLanguage')){ - $news_lang = $input->cookie('KohaOpacLanguage'); -}else{ - if ($ENV{HTTP_ACCEPT_LANGUAGE}) { - while( !$news_lang && ( $ENV{HTTP_ACCEPT_LANGUAGE} =~ m/([a-zA-Z]{2,}-?[a-zA-Z]*)(;|,)?/g ) ){ - if( my @lang = grep { /^$1$/i } @languages ) { - $news_lang = $lang[0]; - } - } - } - if (not $news_lang) { - my @languages = split ",", C4::Context->preference("opaclanguages"); - $news_lang = $languages[0]; - } -} - -$news_lang = $news_lang ? $news_lang : 'en' ; +my ($theme, $news_lang) = C4::Output::themelanguage(C4::Context->config('opachtdocs'),'opac-main.tt','opac',$input); my $all_koha_news = &GetNewsToDisplay($news_lang); my $koha_news_count = scalar @$all_koha_news; -- 1.6.0.6 From lrea at nekls.org Fri Sep 9 16:58:52 2011 From: lrea at nekls.org (Liz Rea) Date: Fri, 9 Sep 2011 09:58:52 -0500 Subject: [Koha-patches] [PATCH 2/2] Bug 3498 - Documentation update to explain what every button does. Message-ID: <1315580332-30005-1-git-send-email-lrea@nekls.org> Help file updated to the following: Pay and Writeoff Fines Each line item can be paid in full, partially paid, or written off. Pay a fine in full Click "Pay" next to the fine you want to pay in full The full amount of the fine will be populated for you in the "Collect From Patron" box Click "Confirm" The fine will be removed from outstanding fines, and displayed as fully paid. Pay a partial fine Click "Pay" next to the fine you want to partially pay Enter the amount you are collecting from the patron in the "Collect From Patron" box Click "Confirm" The fine will be updated to show the original Amount, and the current Amount Outstanding Writeoff a single fine Click "Writeoff" next to the fine you wish to writeoff. The fine will be removed from outstanding fines, and displayed as fully paid. Pay an amount towards all fines Click the "Pay Amount" button Enter the amount you are collecting from the patron in "Collect from Patron." The sum of all fines is shown in "Total Amount Outstanding" Click "Confirm" The fine totals will be updated with the payment applied to oldest fines first. Writeoff All fines Click the "Writeoff All" button All fines will be removed from outstanding fines, and displayed as written off. Pay Selected fines Check the selection boxes next to the fines you wish to pay, click "Pay Selected" Enter an amount to pay towards the fines. Click "Confirm" The fine totals will be updated with the payment applied to the oldest selected fines first. --- .../prog/en/modules/help/members/pay.tt | 51 ++++++++++++++++---- 1 files changed, 42 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/pay.tt index f8eabfa..e0dbfd0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/pay.tt @@ -1,18 +1,51 @@ [% INCLUDE 'help-top.inc' %] -<h1>Pay/Reverse Fines</h1> +<h1>Pay and Writeoff Fines</h1> -<p>Each line item can be paid in full (or written off) using the 'Pay Fines' tab.</p> +<p>Each line item can be paid in full, partially paid, or written off.</p> +<h4>Pay a fine in full</h4> <ul> - <li>Choose the payment type (Unpaid, Paid, Writeoff) from the pull down menu</li> - <li>Click 'Make Payment'</li> - <li>A line item will be added to the account information showing the fee paid in full (or written off)</li> - <li>If you accidentally mark and item as paid, you can reverse that line item by clicking 'Reverse' to the right of the line + <li>Click "Pay" next to the fine you want to pay in full</li> + <li>The full amount of the fine will be populated for you in the "Collect From Patron" box</li> + <li>Click "Confirm" </li> + <li>The fine will be removed from outstanding fines, and displayed as fully paid.</li> +</ul> + +<h4>Pay a partial fine</h4> +<ul> + <li>Click "Pay" next to the fine you want to partially pay</li> + <li>Enter the amount you are collecting from the patron in the "Collect From Patron" box</li> + <li>Click "Confirm" </li> + <li>The fine will be updated to show the original Amount, and the current Amount Outstanding</li> +</ul> + +<h4>Writeoff a single fine</h4> +<ul> + <li>Click "Writeoff" next to the fine you wish to writeoff.</li> + <li>The fine will be removed from outstanding fines, and displayed as fully paid.</li> +</ul> + +<h4>Pay an amount towards all fines</h4> <ul> - <li>Once clicked a new line item will be added to the account, showing the payment as reversed</li> + <li>Click the "Pay Amount" button</li> + <li>Enter the amount you are collecting from the patron in "Collect from Patron." The sum of all fines is shown in "Total Amount Outstanding"</li> + <li>Click "Confirm"</li> + <li>The fine totals will be updated with the payment applied to oldest fines first.</li> </ul> -</li> + +<h4>Writeoff All fines</h4> +<ul> + <li>Click the "Writeoff All" button</li> + <li>All fines will be removed from outstanding fines, and displayed as written off.</li> +</ul> + +<h4>Pay Selected fines</h4> +<ul> + <li>Check the selection boxes next to the fines you wish to pay, click "Pay Selected"</li> + <li>Enter an amount to pay towards the fines.</li> + <li>Click "Confirm"</li> + <li>The fine totals will be updated with the payment applied to the oldest selected fines first.</li> </ul> -[% INCLUDE 'help-bottom.inc' %] \ No newline at end of file +[% INCLUDE 'help-bottom.inc' %] -- 1.7.2.5 From nengard at bywatersolutions.com Thu Sep 8 16:54:43 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 8 Sep 2011 10:54:43 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6774 - Display barcode on OPAC detail page. Message-ID: <1315493683-5491-1-git-send-email-nengard@bywatersolutions.com> From: Amit Gupta <amit.gupta at osslabs.biz> Display barcode on OPAC detail normal view including in XSLT view. Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 ++++++- .../prog/en/modules/admin/preferences/opac.pref | 7 +++++++ koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 2 ++ opac/opac-detail.pl | 1 + 5 files changed, 17 insertions(+), 1 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 8407505..fae729f 100755 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -317,3 +317,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACShowBarcode','0','Show items barcode in holiding tab','','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bdfc9ac..cf56619 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4439,7 +4439,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } - +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACShowBarcode','0','Show items barcode in holiding tab','','YesNo')"); + print "Upgrade to $DBversion done (Add syspref OPACShowBarcode)\n"; + SetVersion ($DBversion); +} =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 4a7c652..c65160d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -86,6 +86,13 @@ OPAC: no: "Don't show" - the name of the patron that has an item checked out on item detail pages on the OPAC. - + - pref: OPACShowBarcode + default: 0 + choices: + yes: Show + no: "Don't show" + - Show items barcode in holding tab. + - - pref: OpacHighlightedWords choices: yes: Highlight diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 1950e4e..2100837 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -408,6 +408,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { <th>Status</th> [% IF ( itemdata_itemnotes ) %]<th>Notes</th>[% END %] <th>Date Due</th> + [% IF ( OPACShowBarcode ) %]<th>Barcode</th>[% END %] </tr></thead> <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %] <tr>[% IF ( item_level_itypes ) %]<td>[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %] @@ -420,6 +421,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { <td>[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td> [% IF ( itemdata_itemnotes ) %]<td>[% ITEM_RESULT.itemnotes %]</td>[% END %] <td>[% ITEM_RESULT.datedue %]</td> + [% IF ( OPACShowBarcode ) %]<td>[% ITEM_RESULT.barcode %]</td>[% END %] </tr> [% END %]</tbody> </table> diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index e18e046..9d1ed56 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -84,6 +84,7 @@ if (C4::Context->preference("OPACXSLTDetailsDisplay") ) { } $template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); +$template->param('OPACShowBarcode' => C4::Context->preference("OPACShowBarcode") ); # change back when ive fixed request.pl my @all_items = GetItemsInfo( $biblionumber ); my @items; -- 1.7.2.3 From nengard at bywatersolutions.com Thu Sep 8 17:27:45 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 8 Sep 2011 11:27:45 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6860: SyndeticsClientCode improperly scoped on many OPAC pages Message-ID: <1315495665-5707-1-git-send-email-nengard@bywatersolutions.com> From: Ian Walls <ian.walls at bywatersolutions.com> SyndeticsClientCode was locally scoped in nearly all loops, preventing it from working. This patch fixes not only search results and shelf browsers, but also rarely-used parts of opac-detail, opac-opensearch, opac-readingrecord, opac-showreviews and opac-user Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 16 ++++++++-------- .../opac-tmpl/prog/en/modules/opac-opensearch.tt | 4 ++-- .../prog/en/modules/opac-readingrecord.tt | 4 ++-- .../opac-tmpl/prog/en/modules/opac-results.tt | 4 ++-- .../opac-tmpl/prog/en/modules/opac-shelves.tt | 4 ++-- .../prog/en/modules/opac-showreviews-rss.tt | 4 ++-- .../opac-tmpl/prog/en/modules/opac-showreviews.tt | 4 ++-- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 8 ++++---- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 1950e4e..7f42770 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -446,8 +446,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %]<img border="0" src="http://images.amazon.com/images/P/[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %] [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( PREVIOUS_SHELF_BROWS.content_identifier_exists ) %] [% IF ( using_https ) %] - <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&client=[% PREVIOUS_SHELF_BROWS.SyndeticsClientCode %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_upc ) %]&upc=[% PREVIOUS_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_oclc ) %]&oclc=[% PREVIOUS_SHELF_BROWS.browser_normalized_oclc %][% END %]&type=xw10" alt="" /> - [% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&client=[% PREVIOUS_SHELF_BROWS.SyndeticsClientCode %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_upc ) %]&upc=[% PREVIOUS_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_oclc ) %]&oclc=[% PREVIOUS_SHELF_BROWS.browser_normalized_oclc %][% END %]&type=xw10" alt="" />[% END %] + <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_upc ) %]&upc=[% PREVIOUS_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_oclc ) %]&oclc=[% PREVIOUS_SHELF_BROWS.browser_normalized_oclc %][% END %]&type=xw10" alt="" /> + [% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_upc ) %]&upc=[% PREVIOUS_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_oclc ) %]&oclc=[% PREVIOUS_SHELF_BROWS.browser_normalized_oclc %][% END %]&type=xw10" alt="" />[% END %] [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %] [% IF ( GoogleJackets ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %]<div style="block" title="[% PREVIOUS_SHELF_BROWS.biblionumber |url %]" class="[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]" id="gbs-thumbnail-preview[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %] [% IF ( BakerTaylorEnabled ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %] @@ -464,8 +464,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( NEXT_SHELF_BROWS.content_identifier_exists ) %] [% IF ( using_https ) %] - <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% NEXT_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&client=[% NEXT_SHELF_BROWS.SyndeticsClientCode %][% IF ( NEXT_SHELF_BROWS.browser_normalized_upc ) %]&upc=[% NEXT_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( NEXT_SHELF_BROWS.browser_normalized_oclc ) %]&oclc=[% NEXT_SHELF_BROWS.browser_normalized_oclc %][% END %]&type=xw10" alt="" /> - [% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% NEXT_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&client=[% NEXT_SHELF_BROWS.SyndeticsClientCode %][% IF ( NEXT_SHELF_BROWS.browser_normalized_upc ) %]&upc=[% NEXT_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( NEXT_SHELF_BROWS.browser_normalized_oclc ) %]&oclc=[% NEXT_SHELF_BROWS.browser_normalized_oclc %][% END %]&type=xw10" alt="" />[% END %] + <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% NEXT_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %][% IF ( NEXT_SHELF_BROWS.browser_normalized_upc ) %]&upc=[% NEXT_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( NEXT_SHELF_BROWS.browser_normalized_oclc ) %]&oclc=[% NEXT_SHELF_BROWS.browser_normalized_oclc %][% END %]&type=xw10" alt="" /> + [% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% NEXT_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %][% IF ( NEXT_SHELF_BROWS.browser_normalized_upc ) %]&upc=[% NEXT_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( NEXT_SHELF_BROWS.browser_normalized_oclc ) %]&oclc=[% NEXT_SHELF_BROWS.browser_normalized_oclc %][% END %]&type=xw10" alt="" />[% END %] [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %] [% IF ( GoogleJackets ) %][% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %]<div style="block" title="[% NEXT_SHELF_BROWS.biblionumber |url %]" class="[% NEXT_SHELF_BROWS.browser_normalized_isbn %]" id="gbs-thumbnail-preview[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %] @@ -737,8 +737,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( XISBN.content_identifier_exists ) %] [% IF ( using_https ) %] -<img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% XISBN.browser_normalized_isbn %]/SC.GIF&client=[% XISBN.SyndeticsClientCode %][% IF ( XISBN.browser_normalized_upc ) %]&upc=[% XISBN.browser_normalized_upc %][% END %][% IF ( XISBN.browser_normalized_oclc ) %]&oclc=[% XISBN.browser_normalized_oclc %][% END %]&type=xw10" alt="" /> -[% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% XISBN.browser_normalized_isbn %]/SC.GIF&client=[% XISBN.SyndeticsClientCode %][% IF ( XISBN.browser_normalized_upc ) %]&upc=[% XISBN.browser_normalized_upc %][% END %][% IF ( XISBN.browser_normalized_oclc ) %]&oclc=[% XISBN.browser_normalized_oclc %][% END %]&type=xw10" alt="" />[% END %] +<img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% XISBN.browser_normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %][% IF ( XISBN.browser_normalized_upc ) %]&upc=[% XISBN.browser_normalized_upc %][% END %][% IF ( XISBN.browser_normalized_oclc ) %]&oclc=[% XISBN.browser_normalized_oclc %][% END %]&type=xw10" alt="" /> +[% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% XISBN.browser_normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %][% IF ( XISBN.browser_normalized_upc ) %]&upc=[% XISBN.browser_normalized_upc %][% END %][% IF ( XISBN.browser_normalized_oclc ) %]&oclc=[% XISBN.browser_normalized_oclc %][% END %]&type=xw10" alt="" />[% END %] [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %] </td> @@ -762,8 +762,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () { <td>[% IF ( OPACAmazonCoverImages ) %]<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% similar_biblionumber.biblionumber %]"><img alt="" src="http://images.amazon.com/images/P/[% similar_biblionumber.ASIN %].01._SS50_.jpg" />[% END %] [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( similar_biblionumber.content_identifier_exists ) %] [% IF ( using_https ) %] - <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% similar_biblionumber.browser_normalized_isbn %]/SC.GIF&client=[% similar_biblionumber.SyndeticsClientCode %][% IF ( similar_biblionumber.browser_normalized_upc ) %]&upc=[% similar_biblionumber.browser_normalized_upc %][% END %][% IF ( similar_biblionumber.browser_normalized_oclc ) %]&oclc=[% similar_biblionumber.browser_normalized_oclc %][% END %]&type=xw10" alt="" /> - [% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% similar_biblionumber.browser_normalized_isbn %]/SC.GIF&client=[% similar_biblionumber.SyndeticsClientCode %][% IF ( similar_biblionumber.browser_normalized_upc ) %]&upc=[% similar_biblionumber.browser_normalized_upc %][% END %][% IF ( similar_biblionumber.browser_normalized_oclc ) %]&oclc=[% similar_biblionumber.browser_normalized_oclc %][% END %]&type=xw10" alt="" />[% END %] + <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% similar_biblionumber.browser_normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %][% IF ( similar_biblionumber.browser_normalized_upc ) %]&upc=[% similar_biblionumber.browser_normalized_upc %][% END %][% IF ( similar_biblionumber.browser_normalized_oclc ) %]&oclc=[% similar_biblionumber.browser_normalized_oclc %][% END %]&type=xw10" alt="" /> + [% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% similar_biblionumber.browser_normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %][% IF ( similar_biblionumber.browser_normalized_upc ) %]&upc=[% similar_biblionumber.browser_normalized_upc %][% END %][% IF ( similar_biblionumber.browser_normalized_oclc ) %]&oclc=[% similar_biblionumber.browser_normalized_oclc %][% END %]&type=xw10" alt="" />[% END %] [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %] <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% similar_biblionumber.biblionumber %]">[% similar_biblionumber.title |html %]</a> </td> [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tt index 5a13119..8c579e3 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tt @@ -37,9 +37,9 @@ <description><![CDATA[ [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %][% END %] -[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( SEARCH_RESULT.content_identifier_exists ) %][% IF ( using_https ) %]<img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SEARCH_RESULT.SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" /> +[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( SEARCH_RESULT.content_identifier_exists ) %][% IF ( using_https ) %]<img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" /> [% ELSE %] -<img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SEARCH_RESULT.SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" /> +<img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" /> [% END %][% END %][% END %][% END %] [% IF ( BakerTaylorEnabled ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% SEARCH_RESULT.normalized_isbn %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL |html %][% SEARCH_RESULT.normalized_isbn %]" /></a>[% END %][% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt index 2c097b5..683a5bd 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt @@ -70,9 +70,9 @@ You have never borrowed anything from this library. [% IF ( BakerTaylorEnabled ) %][% IF ( READING_RECOR.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% READING_RECOR.normalized_isbn %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL |html %][% READING_RECOR.normalized_isbn %]" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %] [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %] - <img src="https://secure.syndetics.com/index.aspx?isbn=[% READING_RECOR.normalized_isbn %]/SC.GIF&client=[% READING_RECOR.SyndeticsClientCode %]&type=xw10&upc=[% READING_RECOR.normalized_upc %]&oclc=[% READING_RECOR.normalized_oclc %]" alt="" class="thumbnail" /> + <img src="https://secure.syndetics.com/index.aspx?isbn=[% READING_RECOR.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% READING_RECOR.normalized_upc %]&oclc=[% READING_RECOR.normalized_oclc %]" alt="" class="thumbnail" /> [% ELSE %] - <img src="http://www.syndetics.com/index.aspx?isbn=[% READING_RECOR.normalized_isbn %]/SC.GIF&client=[% READING_RECOR.SyndeticsClientCode %]&type=xw10&upc=[% READING_RECOR.normalized_upc %]&oclc=[% READING_RECOR.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %] + <img src="http://www.syndetics.com/index.aspx?isbn=[% READING_RECOR.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% READING_RECOR.normalized_upc %]&oclc=[% READING_RECOR.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %] </td> <td>[% IF ( READING_RECOR.BiblioDefaultViewmarc ) %]<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% READING_RECOR.biblionumber |url %]">[% READING_RECOR.title |html %] [% IF ( READING_RECOR.subtitle ) %][% FOREACH subtitl IN READING_RECOR.subtitle %][% subtitl.subfield %][% END %][% END %]</a>[% ELSE %] [% IF ( READING_RECOR.BiblioDefaultViewisbd ) %]<a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% READING_RECOR.biblionumber |url %]">[% READING_RECOR.title |html %] [% IF ( READING_RECOR.subtitle ) %][% FOREACH subtitl IN READING_RECOR.subtitle %][% subtitl.subfield %][% END %][% END %]</a>[% ELSE %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt index bdc4050..7757d47 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt @@ -531,9 +531,9 @@ $(document).ready(function(){ [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %] [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %] - <img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SEARCH_RESULT.SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" class="thumbnail" /> + <img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" class="thumbnail" /> [% ELSE %] - <img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SEARCH_RESULT.SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %] + <img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %] [% IF ( GoogleJackets ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<div style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %] [% IF OpenLibraryCovers %][% IF SEARCH_RESULT.normalized_isbn %]<div style="block" title="[% SEARCH_RESULT.biblionumber %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt index 344f822..c50cfb1 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt @@ -337,9 +337,9 @@ $(function() { [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( itemsloo.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% itemsloo.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %] [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %] - <img src="https://secure.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn %]/SC.GIF&client=[% itemsloo.SyndeticsClientCode %]&type=xw10&upc=[% itemsloo.normalized_upc %]&oclc=[% itemsloo.normalized_oclc %]" alt="" class="thumbnail" /> + <img src="https://secure.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% itemsloo.normalized_upc %]&oclc=[% itemsloo.normalized_oclc %]" alt="" class="thumbnail" /> [% ELSE %] - <img src="http://www.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn %]/SC.GIF&client=[% itemsloo.SyndeticsClientCode %]&type=xw10&upc=[% itemsloo.normalized_upc %]&oclc=[% itemsloo.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %] + <img src="http://www.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% itemsloo.normalized_upc %]&oclc=[% itemsloo.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %] [% IF ( GoogleJackets ) %][% IF ( itemsloo.normalized_isbn ) %]<div style="block" title="[% itemsloo.biblionumber |url %]" class="[% itemsloo.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %] </a> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews-rss.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews-rss.tt index 2c6e179..9ddf1f4 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews-rss.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews-rss.tt @@ -13,9 +13,9 @@ <description><![CDATA[ [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( review.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% review.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %][% END %] -[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( review.content_identifier_exists ) %][% IF ( using_https ) %]<img src="https://secure.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&client=[% review.SyndeticsClientCode %]&type=xw10&upc=[% review.normalized_upc %]&oclc=[% review.normalized_oclc %]" alt="" /> +[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( review.content_identifier_exists ) %][% IF ( using_https ) %]<img src="https://secure.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% review.normalized_upc %]&oclc=[% review.normalized_oclc %]" alt="" /> [% ELSE %] -<img src="http://www.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&client=[% review.SyndeticsClientCode %]&type=xw10&upc=[% review.normalized_upc %]&oclc=[% review.normalized_oclc %]" alt="" /> +<img src="http://www.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% review.normalized_upc %]&oclc=[% review.normalized_oclc %]" alt="" /> [% END %][% END %][% END %][% END %] [% IF ( BakerTaylorEnabled ) %][% IF ( review.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% review.normalized_isbn %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL |html %][% review.normalized_isbn %]" /></a>[% END %][% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews.tt index a50d825..0885e2c 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews.tt @@ -69,9 +69,9 @@ $(document).ready(function(){ [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( review.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% review.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %] [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %] - <img src="https://secure.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&client=[% review.SyndeticsClientCode %]&type=xw10&upc=[% review.normalized_upc %]&oclc=[% review.normalized_oclc %]" alt="" class="thumbnail" /> + <img src="https://secure.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% review.normalized_upc %]&oclc=[% review.normalized_oclc %]" alt="" class="thumbnail" /> [% ELSE %] - <img src="http://www.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&client=[% review.SyndeticsClientCode %]&type=xw10&upc=[% review.normalized_upc %]&oclc=[% review.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %] + <img src="http://www.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% review.normalized_upc %]&oclc=[% review.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %] [% IF ( GoogleJackets ) %][% IF ( review.normalized_isbn ) %]<div style="block" title="[% review.biblionumber |url %]" class="[% review.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %] </a> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt index 9d7a2a7..9ba6c05 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -217,9 +217,9 @@ $.tablesorter.addParser({ [% IF ( BakerTaylorEnabled ) %][% IF ( ISSUE.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% ISSUE.normalized_isbn %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL |html %][% ISSUE.normalized_isbn %]" /></a>[% ELSE %]<span class="no-image">No cover image available</span><!-- BakerTaylor needs normalized_isbn! -->[% END %][% END %] [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %] -<img src="https://secure.syndetics.com/index.aspx?isbn=[% ISSUE.normalized_isbn %]/SC.GIF&client=[% ISSUE.SyndeticsClientCode %]&type=xw10&upc=[% ISSUE.normalized_upc %]&oclc=[% ISSUE.normalized_oclc %]" alt="" class="thumbnail" /> +<img src="https://secure.syndetics.com/index.aspx?isbn=[% ISSUE.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% ISSUE.normalized_upc %]&oclc=[% ISSUE.normalized_oclc %]" alt="" class="thumbnail" /> [% ELSE %] -<img src="http://www.syndetics.com/index.aspx?isbn=[% ISSUE.normalized_isbn %]/SC.GIF&client=[% ISSUE.SyndeticsClientCode %]&type=xw10&upc=[% ISSUE.normalized_upc %]&oclc=[% ISSUE.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %] +<img src="http://www.syndetics.com/index.aspx?isbn=[% ISSUE.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% ISSUE.normalized_upc %]&oclc=[% ISSUE.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %] </td>[% END %] @@ -306,9 +306,9 @@ $.tablesorter.addParser({ [% IF ( SyndeticsCoverImages ) %] [% IF ( using_https ) %] -<img src="https://secure.syndetics.com/index.aspx?isbn=[% OVERDUE.normalized_isbn %]/SC.GIF&client=[% OVERDUE.SyndeticsClientCode %]&upc=[% OVERDUE.normalized_upc %]&oclc=[% OVERDUE.normalized_oclc %]&type=xw10" alt="" class="thumbnail"/> +<img src="https://secure.syndetics.com/index.aspx?isbn=[% OVERDUE.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&upc=[% OVERDUE.normalized_upc %]&oclc=[% OVERDUE.normalized_oclc %]&type=xw10" alt="" class="thumbnail"/> [% ELSE %] -<img src="http://www.syndetics.com/index.aspx?isbn=[% OVERDUE.normalized_isbn %]/SC.GIF&client=[% OVERDUE.SyndeticsClientCode %]&upc=[% OVERDUE.normalized_upc %]&oclc=[% OVERDUE.normalized_oclc %]&type=xw10" alt="" class="thumbnail"/> +<img src="http://www.syndetics.com/index.aspx?isbn=[% OVERDUE.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&upc=[% OVERDUE.normalized_upc %]&oclc=[% OVERDUE.normalized_oclc %]&type=xw10" alt="" class="thumbnail"/> [% END %] [% END %] </td>[% END %] -- 1.7.2.3 From nengard at bywatersolutions.com Thu Sep 8 20:07:47 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 8 Sep 2011 14:07:47 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6687 - allow people to be moved in the holds queue Message-ID: <1315505267-6219-1-git-send-email-nengard@bywatersolutions.com> From: Robin Sheat <robin at catalyst.net.nz> This fixes a regression introduced by Bug 6526 that told you someone already had a reserve if you attempted to move their ordering in the hold queue. (note: it also cleans a host of trailing whitespace errors that were in that file) Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> Signed-off-by: Ian Walls <ian.walls at bywatersolutions.com> Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz> Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- reserve/request.pl | 117 ++++++++++++++++++++++++++-------------------------- 1 files changed, 58 insertions(+), 59 deletions(-) diff --git a/reserve/request.pl b/reserve/request.pl index 0c952b4..b345845 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -3,6 +3,7 @@ #writen 2/1/00 by chris at katipo.oc.nz # Copyright 2000-2002 Katipo Communications +# Parts Copyright 2011 Catalyst IT # # This file is part of Koha. # @@ -62,11 +63,11 @@ my $showallitems = $input->param('showallitems'); # get Branches and Itemtypes my $branches = GetBranches(); my $itemtypes = GetItemTypes(); - + my $default = C4::Context->userenv->{branch}; my @values; my %label_of; - + foreach my $branchcode (sort keys %{$branches} ) { push @values, $branchcode; $label_of{$branchcode} = $branches->{$branchcode}->{branchname}; @@ -99,9 +100,7 @@ if ( $action eq 'move' ) { my $where = $input->param('where'); my $borrowernumber = $input->param('borrowernumber'); my $biblionumber = $input->param('biblionumber'); - AlterPriority( $where, $borrowernumber, $biblionumber ); - } elsif ( $action eq 'cancel' ) { my $borrowernumber = $input->param('borrowernumber'); my $biblionumber = $input->param('biblionumber'); @@ -129,7 +128,9 @@ if ($findborrower) { } } -if ($borrowernumber_hold) { +# If we have the borrowernumber because we've performed an action, then we +# don't want to try to place another reserve. +if ($borrowernumber_hold && !$action) { my $borrowerinfo = GetMemberDetails( $borrowernumber_hold ); my $diffbranch; my @getreservloop; @@ -154,7 +155,6 @@ if ($borrowernumber_hold) { Date_to_Days(split /-/,$date) > Date_to_Days(split /-/,$expiry_date)) { $messages = $expiry = 1; } - # check if the borrower make the reserv in a different branch if ( $borrowerinfo->{'branchcode'} ne C4::Context->userenv->{'branch'} ) { @@ -265,11 +265,11 @@ foreach my $biblionumber (@biblionumbers) { warnings => $warnings, maxreserves=>$maxreserves ); - - + + # FIXME think @optionloop, is maybe obsolete, or must be switchable by a systeme preference fixed rank or not # make priorities options - + my @optionloop; for ( 1 .. $count + 1 ) { push( @@ -286,7 +286,7 @@ foreach my $biblionumber (@biblionumbers) { my @branchcodes; my %itemnumbers_of_biblioitem; my @itemnumbers; - + ## $items is array of 'item' table numbers if (my $items = get_itemnumbers_of($biblionumber)->{$biblionumber}){ @itemnumbers = @$items; @@ -295,61 +295,61 @@ foreach my $biblionumber (@biblionumbers) { $template->param('noitems' => 1); $biblioloopiter{noitems} = 1; } - + ## Hash of item number to 'item' table fields my $iteminfos_of = GetItemInfosOf(@itemnumbers); - + ## Here we go backwards again to create hash of biblioitemnumber to itemnumbers, ## when by definition all of the itemnumber have the same biblioitemnumber foreach my $itemnumber (@itemnumbers) { my $biblioitemnumber = $iteminfos_of->{$itemnumber}->{biblioitemnumber}; push( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} }, $itemnumber ); } - + ## Should be same as biblionumber my @biblioitemnumbers = keys %itemnumbers_of_biblioitem; - + my $notforloan_label_of = get_notforloan_label_of(); - + ## Hash of biblioitemnumber to 'biblioitem' table records my $biblioiteminfos_of = GetBiblioItemInfosOf(@biblioitemnumbers); - + my @bibitemloop; - + foreach my $biblioitemnumber (@biblioitemnumbers) { my $biblioitem = $biblioiteminfos_of->{$biblioitemnumber}; my $num_available = 0; my $num_override = 0; my $hiddencount = 0; - + $biblioitem->{description} = $itemtypes->{ $biblioitem->{itemtype} }{description}; $biblioloopiter{description} = $biblioitem->{description}; $biblioloopiter{itypename} = $biblioitem->{description}; $biblioloopiter{imageurl} = getitemtypeimagelocation('intranet', $itemtypes->{$biblioitem->{itemtype}}{imageurl}); - + foreach my $itemnumber ( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} } ) { my $item = $iteminfos_of->{$itemnumber}; - + unless (C4::Context->preference('item-level_itypes')) { $item->{itype} = $biblioitem->{itemtype}; } - + $item->{itypename} = $itemtypes->{ $item->{itype} }{description}; $item->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $item->{itype} }{imageurl} ); $item->{homebranchname} = $branches->{ $item->{homebranch} }{branchname}; - + # if the holdingbranch is different than the homebranch, we show the # holdingbranch of the document too if ( $item->{homebranch} ne $item->{holdingbranch} ) { $item->{holdingbranchname} = $branches->{ $item->{holdingbranch} }{branchname}; } - + # add information $item->{itemcallnumber} = $item->{itemcallnumber}; - + # if the item is currently on loan, we display its return date and # change the background color my $issues= GetItemIssue($itemnumber); @@ -357,11 +357,11 @@ foreach my $biblionumber (@biblionumbers) { $item->{date_due} = format_date($issues->{'date_due'}); $item->{backgroundcolor} = 'onloan'; } - + # checking reserve my ($reservedate,$reservedfor,$expectedAt) = GetReservesFromItemnumber($itemnumber); my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0); - + if ( defined $reservedate ) { $item->{backgroundcolor} = 'reserved'; $item->{reservedate} = format_date($reservedate); @@ -369,19 +369,19 @@ foreach my $biblionumber (@biblionumbers) { $item->{ReservedForSurname} = $ItemBorrowerReserveInfo->{'surname'}; $item->{ReservedForFirstname} = $ItemBorrowerReserveInfo->{'firstname'}; $item->{ExpectedAtLibrary} = $branches->{$expectedAt}{branchname}; - + } - + # Management of the notforloan document if ( $item->{notforloan} ) { $item->{backgroundcolor} = 'other'; $item->{notforloanvalue} = $notforloan_label_of->{ $item->{notforloan} }; } - + # Management of lost or long overdue items if ( $item->{itemlost} ) { - + # FIXME localized strings should never be in Perl code $item->{message} = $item->{itemlost} == 1 ? "(lost)" @@ -393,11 +393,11 @@ foreach my $biblionumber (@biblionumbers) { $hiddencount++; } } - + # Check the transit status my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itemnumber); - + if ( defined $transfertwhen && $transfertwhen ne '' ) { $item->{transfertwhen} = format_date($transfertwhen); $item->{transfertfrom} = @@ -405,13 +405,13 @@ foreach my $biblionumber (@biblionumbers) { $item->{transfertto} = $branches->{$transfertto}{branchname}; $item->{nocancel} = 1; } - + # If there is no loan, return and transfer, we show a checkbox. $item->{notforloan} = $item->{notforloan} || 0; - + # if independent branches is on we need to check if the person can reserve # for branches they arent logged in to - if ( C4::Context->preference("IndependantBranches") ) { + if ( C4::Context->preference("IndependantBranches") ) { if (! C4::Context->preference("canreservefromotherbranches")){ # cant reserve items so need to check if item homebranch and userenv branch match if not we cant reserve my $userenv = C4::Context->userenv; @@ -420,22 +420,22 @@ foreach my $biblionumber (@biblionumbers) { } } } - + my $branch = C4::Circulation::_GetCircControlBranch($item, $borrowerinfo); my $branchitemrule = GetBranchItemRule( $branch, $item->{'itype'} ); my $policy_holdallowed = 1; - + $item->{'holdallowed'} = $branchitemrule->{'holdallowed'}; - + if ( $branchitemrule->{'holdallowed'} == 0 || - ( $branchitemrule->{'holdallowed'} == 1 && + ( $branchitemrule->{'holdallowed'} == 1 && $borrowerinfo->{'branchcode'} ne $item->{'homebranch'} ) ) { $policy_holdallowed = 0; } - - if (IsAvailableForItemLevelRequest($itemnumber) and - not $item->{cantreserve} and + + if (IsAvailableForItemLevelRequest($itemnumber) and + not $item->{cantreserve} and CanItemBeReserved($borrowerinfo->{borrowernumber}, $itemnumber) ) { if ( $policy_holdallowed ) { $item->{available} = 1; @@ -449,10 +449,10 @@ foreach my $biblionumber (@biblionumbers) { if (C4::Context->preference( 'AllowHoldPolicyOverride' ) && !$item->{available} ) { $item->{override} = 1; $num_override++; - } + } # If none of the conditions hold true, then neither override nor available is set and the item cannot be checked - + # FIXME: move this to a pm my $sth2 = $dbh->prepare("SELECT * FROM reserves WHERE borrowernumber=? AND itemnumber=? AND found='W'"); $sth2->execute($item->{ReservedForBorrowernumber},$item->{itemnumber}); @@ -461,7 +461,7 @@ foreach my $biblionumber (@biblionumbers) { } push @{ $biblioitem->{itemloop} }, $item; } - + if ( $num_override == scalar( @{ $biblioitem->{itemloop} } ) ) { # That is, if all items require an override $template->param( override_required => 1 ); } elsif ( $num_available == 0 ) { @@ -471,17 +471,17 @@ foreach my $biblionumber (@biblionumbers) { $biblioloopiter{none_avail} = 1; } $template->param( hiddencount => $hiddencount); - + push @bibitemloop, $biblioitem; } # existingreserves building my @reserveloop; ( $count, $reserves ) = GetReservesFromBiblionumber($biblionumber,1); - foreach my $res ( sort { + foreach my $res ( sort { my $a_found = $a->{found} || ''; my $b_found = $a->{found} || ''; - $a_found cmp $b_found; + $a_found cmp $b_found; } @$reserves ) { my %reserve; my @optionloop; @@ -494,11 +494,11 @@ foreach my $biblionumber (@biblionumbers) { } ); } - + if ( defined $res->{'found'} && $res->{'found'} eq 'W' || $res->{'found'} eq 'T' ) { my $item = $res->{'itemnumber'}; $item = GetBiblioFromItemNumber($item,undef); - $reserve{'wait'}= 1; + $reserve{'wait'}= 1; $reserve{'holdingbranch'}=$item->{'holdingbranch'}; $reserve{'biblionumber'}=$item->{'biblionumber'}; $reserve{'barcodenumber'} = $item->{'barcode'}; @@ -519,21 +519,21 @@ foreach my $biblionumber (@biblionumbers) { $reserve{'item_level_hold'} = 1; } } - + # get borrowers reserve info my $reserveborrowerinfo = GetMemberDetails( $res->{'borrowernumber'}, 0); if (C4::Context->preference('HidePatronName')){ $reserve{'hidename'} = 1; $reserve{'cardnumber'} = $reserveborrowerinfo->{'cardnumber'}; } - $reserve{'expirationdate'} = format_date( $res->{'expirationdate'} ) + $reserve{'expirationdate'} = format_date( $res->{'expirationdate'} ) unless ( !defined($res->{'expirationdate'}) || $res->{'expirationdate'} eq '0000-00-00' ); $reserve{'date'} = format_date( $res->{'reservedate'} ); $reserve{'borrowernumber'} = $res->{'borrowernumber'}; $reserve{'biblionumber'} = $res->{'biblionumber'}; $reserve{'borrowernumber'} = $res->{'borrowernumber'}; $reserve{'firstname'} = $reserveborrowerinfo->{'firstname'}; - $reserve{'surname'} = $reserveborrowerinfo->{'surname'}; + $reserve{'surname'} = $reserveborrowerinfo->{'surname'}; $reserve{'notes'} = $res->{'reservenotes'}; $reserve{'wait'} = ( ( defined $res->{'found'} and $res->{'found'} eq 'W' ) or ( $res->{'priority'} eq '0' ) ); @@ -546,20 +546,20 @@ foreach my $biblionumber (@biblionumbers) { $reserve{'lowestPriority'} = $res->{'lowestPriority'}; $reserve{'branchloop'} = GetBranchesLoop($res->{'branchcode'}); $reserve{'optionloop'} = \@optionloop; - + push( @reserveloop, \%reserve ); } - + # get the time for the form name... my $time = time(); - + $template->param( CGIbranch => $CGIbranch, time => $time, fixedRank => $fixedRank, ); - + # display infos $template->param( optionloop => \@optionloop, @@ -588,7 +588,6 @@ foreach my $biblionumber (@biblionumbers) { if (@reserveloop) { $template->param( reserveloop => \@reserveloop ); } - push @biblioloop, \%biblioloopiter; } @@ -604,6 +603,6 @@ if ($multihold) { if ( C4::Context->preference( 'AllowHoldDateInFuture' ) ) { $template->param( reserve_in_future => 1 ); } - + # printout the page output_html_with_http_headers $input, $cookie, $template->output; -- 1.7.2.3 From nengard at gmail.com Fri Sep 9 20:51:35 2011 From: nengard at gmail.com (Nicole Engard) Date: Fri, 9 Sep 2011 14:51:35 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6687 - allow people to be moved in the holds queue In-Reply-To: <1315505267-6219-1-git-send-email-nengard@bywatersolutions.com> References: <1315505267-6219-1-git-send-email-nengard@bywatersolutions.com> Message-ID: <CAC0K6VGCPUoVSiGaEzZqBrAfvEdnQB0ZPOy=Q8BUog4TNQRAWw@mail.gmail.com> ignore this - was in the wrong place. On Thu, Sep 8, 2011 at 2:07 PM, Nicole C. Engard <nengard at bywatersolutions.com> wrote: > From: Robin Sheat <robin at catalyst.net.nz> > > This fixes a regression introduced by Bug 6526 that told you someone > already had a reserve if you attempted to move their ordering in the > hold queue. > > (note: it also cleans a host of trailing whitespace errors that were in > that file) > > Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> > Signed-off-by: Ian Walls <ian.walls at bywatersolutions.com> > Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz> > Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> > --- > ?reserve/request.pl | ?117 ++++++++++++++++++++++++++-------------------------- > ?1 files changed, 58 insertions(+), 59 deletions(-) > > diff --git a/reserve/request.pl b/reserve/request.pl > index 0c952b4..b345845 100755 > --- a/reserve/request.pl > +++ b/reserve/request.pl > @@ -3,6 +3,7 @@ > > ?#writen 2/1/00 by chris at katipo.oc.nz > ?# Copyright 2000-2002 Katipo Communications > +# Parts Copyright 2011 Catalyst IT > ?# > ?# This file is part of Koha. > ?# > @@ -62,11 +63,11 @@ my $showallitems = $input->param('showallitems'); > ?# get Branches and Itemtypes > ?my $branches = GetBranches(); > ?my $itemtypes = GetItemTypes(); > - > + > ?my $default = C4::Context->userenv->{branch}; > ?my @values; > ?my %label_of; > - > + > ?foreach my $branchcode (sort keys %{$branches} ) { > ? ? push @values, $branchcode; > ? ? $label_of{$branchcode} = $branches->{$branchcode}->{branchname}; > @@ -99,9 +100,7 @@ if ( $action eq 'move' ) { > ? my $where = $input->param('where'); > ? my $borrowernumber = $input->param('borrowernumber'); > ? my $biblionumber = $input->param('biblionumber'); > - > ? AlterPriority( $where, $borrowernumber, $biblionumber ); > - > ?} elsif ( $action eq 'cancel' ) { > ? my $borrowernumber = $input->param('borrowernumber'); > ? my $biblionumber = $input->param('biblionumber'); > @@ -129,7 +128,9 @@ if ($findborrower) { > ? ? } > ?} > > -if ($borrowernumber_hold) { > +# If we have the borrowernumber because we've performed an action, then we > +# don't want to try to place another reserve. > +if ($borrowernumber_hold && !$action) { > ? ? my $borrowerinfo = GetMemberDetails( $borrowernumber_hold ); > ? ? my $diffbranch; > ? ? my @getreservloop; > @@ -154,7 +155,6 @@ if ($borrowernumber_hold) { > ? ? ? ? ? ? Date_to_Days(split /-/,$date) > Date_to_Days(split /-/,$expiry_date)) { > ? ? ? ? ? ? ? ?$messages = $expiry = 1; > ? ? } > - > > ? ? # check if the borrower make the reserv in a different branch > ? ? if ( $borrowerinfo->{'branchcode'} ne C4::Context->userenv->{'branch'} ) { > @@ -265,11 +265,11 @@ foreach my $biblionumber (@biblionumbers) { > ? ? ? ? ? ? ? ? ? ? ? warnings => $warnings, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?maxreserves=>$maxreserves > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?); > - > - > + > + > ? ? # FIXME think @optionloop, is maybe obsolete, or ?must be switchable by a systeme preference fixed rank or not > ? ? # make priorities options > - > + > ? ? my @optionloop; > ? ? for ( 1 .. $count + 1 ) { > ? ? ? ? push( > @@ -286,7 +286,7 @@ foreach my $biblionumber (@biblionumbers) { > ? ? my @branchcodes; > ? ? my %itemnumbers_of_biblioitem; > ? ? my @itemnumbers; > - > + > ? ? ## $items is array of 'item' table numbers > ? ? if (my $items = get_itemnumbers_of($biblionumber)->{$biblionumber}){ > ? ? ? ? @itemnumbers ?= @$items; > @@ -295,61 +295,61 @@ foreach my $biblionumber (@biblionumbers) { > ? ? ? ? $template->param('noitems' => 1); > ? ? ? ? $biblioloopiter{noitems} = 1; > ? ? } > - > + > ? ? ## Hash of item number to 'item' table fields > ? ? my $iteminfos_of = GetItemInfosOf(@itemnumbers); > - > + > ? ? ## Here we go backwards again to create hash of biblioitemnumber to itemnumbers, > ? ? ## when by definition all of the itemnumber have the same biblioitemnumber > ? ? foreach my $itemnumber (@itemnumbers) { > ? ? ? ? my $biblioitemnumber = $iteminfos_of->{$itemnumber}->{biblioitemnumber}; > ? ? ? ? push( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} }, $itemnumber ); > ? ? } > - > + > ? ? ## Should be same as biblionumber > ? ? my @biblioitemnumbers = keys %itemnumbers_of_biblioitem; > - > + > ? ? my $notforloan_label_of = get_notforloan_label_of(); > - > + > ? ? ## Hash of biblioitemnumber to 'biblioitem' table records > ? ? my $biblioiteminfos_of ?= GetBiblioItemInfosOf(@biblioitemnumbers); > - > + > ? ? my @bibitemloop; > - > + > ? ? foreach my $biblioitemnumber (@biblioitemnumbers) { > ? ? ? ? my $biblioitem = $biblioiteminfos_of->{$biblioitemnumber}; > ? ? ? ? my $num_available = 0; > ? ? ? ? my $num_override ?= 0; > ? ? ? ? my $hiddencount ? = 0; > - > + > ? ? ? ? $biblioitem->{description} = > ? ? ? ? ? $itemtypes->{ $biblioitem->{itemtype} }{description}; > ? ? ? ? $biblioloopiter{description} = $biblioitem->{description}; > ? ? ? ? $biblioloopiter{itypename} = $biblioitem->{description}; > ? ? ? ? $biblioloopiter{imageurl} = > ? ? ? ? ? getitemtypeimagelocation('intranet', $itemtypes->{$biblioitem->{itemtype}}{imageurl}); > - > + > ? ? ? ? foreach my $itemnumber ( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} } ) ? ?{ > ? ? ? ? ? ? my $item = $iteminfos_of->{$itemnumber}; > - > + > ? ? ? ? ? ? unless (C4::Context->preference('item-level_itypes')) { > ? ? ? ? ? ? ? ? $item->{itype} = $biblioitem->{itemtype}; > ? ? ? ? ? ? } > - > + > ? ? ? ? ? ? $item->{itypename} = $itemtypes->{ $item->{itype} }{description}; > ? ? ? ? ? ? $item->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $item->{itype} }{imageurl} ); > ? ? ? ? ? ? $item->{homebranchname} = $branches->{ $item->{homebranch} }{branchname}; > - > + > ? ? ? ? ? ? # if the holdingbranch is different than the homebranch, we show the > ? ? ? ? ? ? # holdingbranch of the document too > ? ? ? ? ? ? if ( $item->{homebranch} ne $item->{holdingbranch} ) { > ? ? ? ? ? ? ? ? $item->{holdingbranchname} = > ? ? ? ? ? ? ? ? ? $branches->{ $item->{holdingbranch} }{branchname}; > ? ? ? ? ? ? } > - > + > ? ? ? ? ? ? # ? add information > ? ? ? ? ? ? $item->{itemcallnumber} = $item->{itemcallnumber}; > - > + > ? ? ? ? ? ? # if the item is currently on loan, we display its return date and > ? ? ? ? ? ? # change the background color > ? ? ? ? ? ? my $issues= GetItemIssue($itemnumber); > @@ -357,11 +357,11 @@ foreach my $biblionumber (@biblionumbers) { > ? ? ? ? ? ? ? ? $item->{date_due} = format_date($issues->{'date_due'}); > ? ? ? ? ? ? ? ? $item->{backgroundcolor} = 'onloan'; > ? ? ? ? ? ? } > - > + > ? ? ? ? ? ? # checking reserve > ? ? ? ? ? ? my ($reservedate,$reservedfor,$expectedAt) = GetReservesFromItemnumber($itemnumber); > ? ? ? ? ? ? my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0); > - > + > ? ? ? ? ? ? if ( defined $reservedate ) { > ? ? ? ? ? ? ? ? $item->{backgroundcolor} = 'reserved'; > ? ? ? ? ? ? ? ? $item->{reservedate} ? ? = format_date($reservedate); > @@ -369,19 +369,19 @@ foreach my $biblionumber (@biblionumbers) { > ? ? ? ? ? ? ? ? $item->{ReservedForSurname} ? ? = $ItemBorrowerReserveInfo->{'surname'}; > ? ? ? ? ? ? ? ? $item->{ReservedForFirstname} ? ? = $ItemBorrowerReserveInfo->{'firstname'}; > ? ? ? ? ? ? ? ? $item->{ExpectedAtLibrary} ? ? = $branches->{$expectedAt}{branchname}; > - > + > ? ? ? ? ? ? } > - > + > ? ? ? ? ? ? # Management of the notforloan document > ? ? ? ? ? ? if ( $item->{notforloan} ) { > ? ? ? ? ? ? ? ? $item->{backgroundcolor} = 'other'; > ? ? ? ? ? ? ? ? $item->{notforloanvalue} = > ? ? ? ? ? ? ? ? ? $notforloan_label_of->{ $item->{notforloan} }; > ? ? ? ? ? ? } > - > + > ? ? ? ? ? ? # Management of lost or long overdue items > ? ? ? ? ? ? if ( $item->{itemlost} ) { > - > + > ? ? ? ? ? ? ? ? # FIXME localized strings should never be in Perl code > ? ? ? ? ? ? ? ? $item->{message} = > ? ? ? ? ? ? ? ? ? $item->{itemlost} == 1 ? "(lost)" > @@ -393,11 +393,11 @@ foreach my $biblionumber (@biblionumbers) { > ? ? ? ? ? ? ? ? ? ? $hiddencount++; > ? ? ? ? ? ? ? ? } > ? ? ? ? ? ? } > - > + > ? ? ? ? ? ? # Check the transit status > ? ? ? ? ? ? my ( $transfertwhen, $transfertfrom, $transfertto ) = > ? ? ? ? ? ? ? GetTransfers($itemnumber); > - > + > ? ? ? ? ? ? if ( defined $transfertwhen && $transfertwhen ne '' ) { > ? ? ? ? ? ? ? ? $item->{transfertwhen} = format_date($transfertwhen); > ? ? ? ? ? ? ? ? $item->{transfertfrom} = > @@ -405,13 +405,13 @@ foreach my $biblionumber (@biblionumbers) { > ? ? ? ? ? ? ? ? $item->{transfertto} = $branches->{$transfertto}{branchname}; > ? ? ? ? ? ? ? ? $item->{nocancel} = 1; > ? ? ? ? ? ? } > - > + > ? ? ? ? ? ? # If there is no loan, return and transfer, we show a checkbox. > ? ? ? ? ? ? $item->{notforloan} = $item->{notforloan} || 0; > - > + > ? ? ? ? ? ? # if independent branches is on we need to check if the person can reserve > ? ? ? ? ? ? # for branches they arent logged in to > - ? ? ? ? ? ?if ( C4::Context->preference("IndependantBranches") ) { > + ? ? ? ? ? ?if ( C4::Context->preference("IndependantBranches") ) { > ? ? ? ? ? ? ? ? if (! C4::Context->preference("canreservefromotherbranches")){ > ? ? ? ? ? ? ? ? ? ? # cant reserve items so need to check if item homebranch and userenv branch match if not we cant reserve > ? ? ? ? ? ? ? ? ? ? my $userenv = C4::Context->userenv; > @@ -420,22 +420,22 @@ foreach my $biblionumber (@biblionumbers) { > ? ? ? ? ? ? ? ? ? ? } > ? ? ? ? ? ? ? ? } > ? ? ? ? ? ? } > - > + > ? ? ? ? ? ? my $branch = C4::Circulation::_GetCircControlBranch($item, $borrowerinfo); > > ? ? ? ? ? ? my $branchitemrule = GetBranchItemRule( $branch, $item->{'itype'} ); > ? ? ? ? ? ? my $policy_holdallowed = 1; > - > + > ? ? ? ? ? ? $item->{'holdallowed'} = $branchitemrule->{'holdallowed'}; > - > + > ? ? ? ? ? ? if ( $branchitemrule->{'holdallowed'} == 0 || > - ? ? ? ? ? ? ? ? ( $branchitemrule->{'holdallowed'} == 1 && > + ? ? ? ? ? ? ? ? ( $branchitemrule->{'holdallowed'} == 1 && > ? ? ? ? ? ? ? ? ? ? ?$borrowerinfo->{'branchcode'} ne $item->{'homebranch'} ) ) { > ? ? ? ? ? ? ? ? $policy_holdallowed = 0; > ? ? ? ? ? ? } > - > - ? ? ? ? ? ?if (IsAvailableForItemLevelRequest($itemnumber) and > - ? ? ? ? ? ? ? not $item->{cantreserve} and > + > + ? ? ? ? ? ?if (IsAvailableForItemLevelRequest($itemnumber) and > + ? ? ? ? ? ? ? not $item->{cantreserve} and > ? ? ? ? ? ? ? ?CanItemBeReserved($borrowerinfo->{borrowernumber}, $itemnumber) ) { > ? ? ? ? ? ? ? ? if ( $policy_holdallowed ) { > ? ? ? ? ? ? ? ? ? ? $item->{available} = 1; > @@ -449,10 +449,10 @@ foreach my $biblionumber (@biblionumbers) { > ? ? ? ? ? ? if (C4::Context->preference( 'AllowHoldPolicyOverride' ) && !$item->{available} ) { > ? ? ? ? ? ? ? ? $item->{override} = 1; > ? ? ? ? ? ? ? ? $num_override++; > - ? ? ? ? ? ?} > + ? ? ? ? ? ?} > > ? ? ? ? ? ? # If none of the conditions hold true, then neither override nor available is set and the item cannot be checked > - > + > ? ? ? ? ? ? # FIXME: move this to a pm > ? ? ? ? ? ? my $sth2 = $dbh->prepare("SELECT * FROM reserves WHERE borrowernumber=? AND itemnumber=? AND found='W'"); > ? ? ? ? ? ? $sth2->execute($item->{ReservedForBorrowernumber},$item->{itemnumber}); > @@ -461,7 +461,7 @@ foreach my $biblionumber (@biblionumbers) { > ? ? ? ? ? ? } > ? ? ? ? ? ? push @{ $biblioitem->{itemloop} }, $item; > ? ? ? ? } > - > + > ? ? ? ? if ( $num_override == scalar( @{ $biblioitem->{itemloop} } ) ) { # That is, if all items require an override > ? ? ? ? ? ? $template->param( override_required => 1 ); > ? ? ? ? } elsif ( $num_available == 0 ) { > @@ -471,17 +471,17 @@ foreach my $biblionumber (@biblionumbers) { > ? ? ? ? ? ? $biblioloopiter{none_avail} = 1; > ? ? ? ? } > ? ? ? ? $template->param( hiddencount => $hiddencount); > - > + > ? ? ? ? push @bibitemloop, $biblioitem; > ? ? } > > ? ? # existingreserves building > ? ? my @reserveloop; > ? ? ( $count, $reserves ) = GetReservesFromBiblionumber($biblionumber,1); > - ? ?foreach my $res ( sort { > + ? ?foreach my $res ( sort { > ? ? ? ? ? ? my $a_found = $a->{found} || ''; > ? ? ? ? ? ? my $b_found = $a->{found} || ''; > - ? ? ? ? ? ?$a_found cmp $b_found; > + ? ? ? ? ? ?$a_found cmp $b_found; > ? ? ? ? } @$reserves ) { > ? ? ? ? my %reserve; > ? ? ? ? my @optionloop; > @@ -494,11 +494,11 @@ foreach my $biblionumber (@biblionumbers) { > ? ? ? ? ? ? ? ? ?} > ? ? ? ? ? ? ? ? ); > ? ? ? ? } > - > + > ? ? ? ? if ( defined $res->{'found'} && $res->{'found'} eq 'W' || $res->{'found'} eq 'T' ) { > ? ? ? ? ? ? my $item = $res->{'itemnumber'}; > ? ? ? ? ? ? $item = GetBiblioFromItemNumber($item,undef); > - ? ? ? ? ? ?$reserve{'wait'}= 1; > + ? ? ? ? ? ?$reserve{'wait'}= 1; > ? ? ? ? ? ? $reserve{'holdingbranch'}=$item->{'holdingbranch'}; > ? ? ? ? ? ? $reserve{'biblionumber'}=$item->{'biblionumber'}; > ? ? ? ? ? ? $reserve{'barcodenumber'} ? = $item->{'barcode'}; > @@ -519,21 +519,21 @@ foreach my $biblionumber (@biblionumbers) { > ? ? ? ? ? ? ? ? $reserve{'item_level_hold'} = 1; > ? ? ? ? ? ? } > ? ? ? ? } > - > + > ? ? ? ? # ? ? get borrowers reserve info > ? ? ? ? my $reserveborrowerinfo = GetMemberDetails( $res->{'borrowernumber'}, 0); > ? ? ? ? if (C4::Context->preference('HidePatronName')){ > ? ? ? ? ? ?$reserve{'hidename'} = 1; > ? ? ? ? ? ?$reserve{'cardnumber'} = $reserveborrowerinfo->{'cardnumber'}; > ? ? ? ?} > - ? ? ? ?$reserve{'expirationdate'} = format_date( $res->{'expirationdate'} ) > + ? ? ? ?$reserve{'expirationdate'} = format_date( $res->{'expirationdate'} ) > ? ? ? ? ? ? unless ( !defined($res->{'expirationdate'}) || $res->{'expirationdate'} eq '0000-00-00' ); > ? ? ? ? $reserve{'date'} ? ? ? ? ? = format_date( $res->{'reservedate'} ); > ? ? ? ? $reserve{'borrowernumber'} = $res->{'borrowernumber'}; > ? ? ? ? $reserve{'biblionumber'} ? = $res->{'biblionumber'}; > ? ? ? ? $reserve{'borrowernumber'} = $res->{'borrowernumber'}; > ? ? ? ? $reserve{'firstname'} ? ? ?= $reserveborrowerinfo->{'firstname'}; > - ? ? ? ?$reserve{'surname'} ? ? ? ?= $reserveborrowerinfo->{'surname'}; > + ? ? ? ?$reserve{'surname'} ? ? ? ?= $reserveborrowerinfo->{'surname'}; > ? ? ? ? $reserve{'notes'} ? ? ? ? ?= $res->{'reservenotes'}; > ? ? ? ? $reserve{'wait'} ? ? ? ? ? = > ? ? ? ? ? ( ( defined $res->{'found'} and $res->{'found'} eq 'W' ) or ( $res->{'priority'} eq '0' ) ); > @@ -546,20 +546,20 @@ foreach my $biblionumber (@biblionumbers) { > ? ? ? ? $reserve{'lowestPriority'} ? ?= $res->{'lowestPriority'}; > ? ? ? ? $reserve{'branchloop'} = GetBranchesLoop($res->{'branchcode'}); > ? ? ? ? $reserve{'optionloop'} = \@optionloop; > - > + > ? ? ? ? push( @reserveloop, \%reserve ); > ? ? } > - > + > ? ? # get the time for the form name... > ? ? my $time = time(); > - > + > ? ? $template->param( > ? ? ? ? ? ? ? ? ? ? ?CGIbranch ? => $CGIbranch, > > ? ? ? ? ? ? ? ? ? ? ?time ? ? ? ?=> $time, > ? ? ? ? ? ? ? ? ? ? ?fixedRank ? => $fixedRank, > ? ? ? ? ? ? ? ? ? ? ); > - > + > ? ? # display infos > ? ? $template->param( > ? ? ? ? ? ? ? ? ? ? ?optionloop ? ? ? ?=> \@optionloop, > @@ -588,7 +588,6 @@ foreach my $biblionumber (@biblionumbers) { > ? ? if (@reserveloop) { > ? ? ? ? $template->param( reserveloop => \@reserveloop ); > ? ? } > - > > ? ? push @biblioloop, \%biblioloopiter; > ?} > @@ -604,6 +603,6 @@ if ($multihold) { > ?if ( C4::Context->preference( 'AllowHoldDateInFuture' ) ) { > ? ? $template->param( reserve_in_future => 1 ); > ?} > - > + > ?# printout the page > ?output_html_with_http_headers $input, $cookie, $template->output; > -- > 1.7.2.3 > > _______________________________________________ > Koha-patches mailing list > Koha-patches at lists.koha-community.org > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > website : http://www.koha-community.org/ > git : http://git.koha-community.org/ > bugs : http://bugs.koha-community.org/ > From nengard at bywatersolutions.com Thu Sep 8 20:12:50 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 8 Sep 2011 14:12:50 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6863: Shelf Browser images not showing up Message-ID: <1315505570-6325-1-git-send-email-nengard@bywatersolutions.com> From: Ian Walls <ian.walls at bywatersolutions.com> Fixes case for Syndetics (test condition was scoped wrong, leading to "no image available") as well as Baker and Taylor (bad scope and capitalization on BakerTaylorImageURL). Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 1950e4e..f609e36 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -444,14 +444,14 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% FOREACH PREVIOUS_SHELF_BROWS IN PREVIOUS_SHELF_BROWSE %] <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% PREVIOUS_SHELF_BROWS.biblionumber %]&shelfbrowse_itemnumber=[% PREVIOUS_SHELF_BROWS.itemnumber %]#shelfbrowser"> [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %]<img border="0" src="http://images.amazon.com/images/P/[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %] - [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( PREVIOUS_SHELF_BROWS.content_identifier_exists ) %] + [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( content_identifier_exists ) %] [% IF ( using_https ) %] <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&client=[% PREVIOUS_SHELF_BROWS.SyndeticsClientCode %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_upc ) %]&upc=[% PREVIOUS_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_oclc ) %]&oclc=[% PREVIOUS_SHELF_BROWS.browser_normalized_oclc %][% END %]&type=xw10" alt="" /> [% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&client=[% PREVIOUS_SHELF_BROWS.SyndeticsClientCode %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_upc ) %]&upc=[% PREVIOUS_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_oclc ) %]&oclc=[% PREVIOUS_SHELF_BROWS.browser_normalized_oclc %][% END %]&type=xw10" alt="" />[% END %] [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %] [% IF ( GoogleJackets ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %]<div style="block" title="[% PREVIOUS_SHELF_BROWS.biblionumber |url %]" class="[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]" id="gbs-thumbnail-preview[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %] [% IF ( BakerTaylorEnabled ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %] - <img alt="See Baker & Taylor" src="[% PREVIOUS_SHELF_BROWS.BakerTaylorImageurl |html %][% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %] + <img alt="See Baker & Taylor" src="[% BakerTaylorImageURL |html %][% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %] </a></td> [% END %] @@ -462,7 +462,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %] <img border="0" src="http://images.amazon.com/images/P/[% NEXT_SHELF_BROWS.browser_normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %] - [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( NEXT_SHELF_BROWS.content_identifier_exists ) %] + [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( content_identifier_exists ) %] [% IF ( using_https ) %] <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% NEXT_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&client=[% NEXT_SHELF_BROWS.SyndeticsClientCode %][% IF ( NEXT_SHELF_BROWS.browser_normalized_upc ) %]&upc=[% NEXT_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( NEXT_SHELF_BROWS.browser_normalized_oclc ) %]&oclc=[% NEXT_SHELF_BROWS.browser_normalized_oclc %][% END %]&type=xw10" alt="" /> [% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% NEXT_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&client=[% NEXT_SHELF_BROWS.SyndeticsClientCode %][% IF ( NEXT_SHELF_BROWS.browser_normalized_upc ) %]&upc=[% NEXT_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( NEXT_SHELF_BROWS.browser_normalized_oclc ) %]&oclc=[% NEXT_SHELF_BROWS.browser_normalized_oclc %][% END %]&type=xw10" alt="" />[% END %] @@ -470,7 +470,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( GoogleJackets ) %][% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %]<div style="block" title="[% NEXT_SHELF_BROWS.biblionumber |url %]" class="[% NEXT_SHELF_BROWS.browser_normalized_isbn %]" id="gbs-thumbnail-preview[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %] [% IF ( BakerTaylorEnabled ) %][% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %] - <img alt="See Baker & Taylor" src="[% NEXT_SHELF_BROWS.BakerTaylorImageurl |html %][% NEXT_SHELF_BROWS.browser_normalized_isbn %]" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %] + <img alt="See Baker & Taylor" src="[% BakerTaylorImageURL |html %][% NEXT_SHELF_BROWS.browser_normalized_isbn %]" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %] </a></td> [% END %] -- 1.7.2.3 From nengard at bywatersolutions.com Thu Sep 8 20:20:14 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 8 Sep 2011 14:20:14 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6857: display a charge warning alert for reserves Message-ID: <1315506014-6460-1-git-send-email-nengard@bywatersolutions.com> From: Robin Sheat <robin at catalyst.net.nz> If a user is placing a reserve on the OPAC, this'll let them know that it's going to cost them. Author: Chris Cormack <chrisc at catalyst.net.nz> Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- C4/Members.pm | 6 ++++-- .../opac-tmpl/prog/en/modules/opac-reserve.tt | 5 +++++ opac/opac-reserve.pl | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index dcc168b..8d4a6c5 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -2,6 +2,7 @@ package C4::Members; # Copyright 2000-2003 Katipo Communications # Copyright 2010 BibLibre +# Parts Copyright 2010 Catalyst IT # # This file is part of Koha. # @@ -352,11 +353,11 @@ sub GetMemberDetails { my $query; my $sth; if ($borrowernumber) { - $sth = $dbh->prepare("select borrowers.*,category_type,categories.description from borrowers left join categories on borrowers.categorycode=categories.categorycode where borrowernumber=?"); + $sth = $dbh->prepare("SELECT borrowers.*,category_type,categories.description,reservefee FROM borrowers LEFT JOIN categories ON borrowers.categorycode=categories.categorycode WHERE borrowernumber=?"); $sth->execute($borrowernumber); } elsif ($cardnumber) { - $sth = $dbh->prepare("select borrowers.*,category_type,categories.description from borrowers left join categories on borrowers.categorycode=categories.categorycode where cardnumber=?"); + $sth = $dbh->prepare("SELECT borrowers.*,category_type,categories.description,reservefee FROM borrowers LEFT JOIN categories ON borrowers.categorycode=categories.categorycode WHERE cardnumber=?"); $sth->execute($cardnumber); } else { @@ -386,6 +387,7 @@ sub GetMemberDetails { $sth->execute( $borrower->{'categorycode'} ); my $enrolment = $sth->fetchrow; $borrower->{'enrolmentperiod'} = $enrolment; + return ($borrower); #, $flags, $accessflagshash); } diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt index 4d81a17..12c5190 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt @@ -220,6 +220,11 @@ [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %]) [% END %] </h3>[% END %] + [% IF (RESERVE_CHARGE) %] + <div class="dialog alert"> + There is a charge of [% RESERVE_CHARGE %] for placing this reserve + </div> + [% END %] <form action="/cgi-bin/koha/opac-reserve.pl" method="post"> <input type="hidden" name="place_reserve" value="1"/> diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index a92a976..ab02afe 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -54,6 +54,10 @@ sub get_out ($$$) { # get borrower information .... my ( $borr ) = GetMemberDetails( $borrowernumber ); +# Pass through any reserve charge +if ($borr->{reservefee} > 0){ + $template->param( RESERVE_CHARGE => sprintf("%.2f",$borr->{reservefee})); +} # get branches and itemtypes my $branches = GetBranches(); my $itemTypes = GetItemTypes(); -- 1.7.2.3 From nengard at bywatersolutions.com Thu Sep 8 20:25:24 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 8 Sep 2011 14:25:24 -0400 Subject: [Koha-patches] [PATCH 1/2] [SIGNED-OFF] Bug 6857: display a charge warning alert for reserves Message-ID: <1315506325-6557-1-git-send-email-nengard@bywatersolutions.com> From: Robin Sheat <robin at catalyst.net.nz> If a user is placing a reserve on the OPAC, this'll let them know that it's going to cost them. Author: Chris Cormack <chrisc at catalyst.net.nz> Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- C4/Members.pm | 6 ++++-- .../opac-tmpl/prog/en/modules/opac-reserve.tt | 5 +++++ opac/opac-reserve.pl | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index dcc168b..8d4a6c5 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -2,6 +2,7 @@ package C4::Members; # Copyright 2000-2003 Katipo Communications # Copyright 2010 BibLibre +# Parts Copyright 2010 Catalyst IT # # This file is part of Koha. # @@ -352,11 +353,11 @@ sub GetMemberDetails { my $query; my $sth; if ($borrowernumber) { - $sth = $dbh->prepare("select borrowers.*,category_type,categories.description from borrowers left join categories on borrowers.categorycode=categories.categorycode where borrowernumber=?"); + $sth = $dbh->prepare("SELECT borrowers.*,category_type,categories.description,reservefee FROM borrowers LEFT JOIN categories ON borrowers.categorycode=categories.categorycode WHERE borrowernumber=?"); $sth->execute($borrowernumber); } elsif ($cardnumber) { - $sth = $dbh->prepare("select borrowers.*,category_type,categories.description from borrowers left join categories on borrowers.categorycode=categories.categorycode where cardnumber=?"); + $sth = $dbh->prepare("SELECT borrowers.*,category_type,categories.description,reservefee FROM borrowers LEFT JOIN categories ON borrowers.categorycode=categories.categorycode WHERE cardnumber=?"); $sth->execute($cardnumber); } else { @@ -386,6 +387,7 @@ sub GetMemberDetails { $sth->execute( $borrower->{'categorycode'} ); my $enrolment = $sth->fetchrow; $borrower->{'enrolmentperiod'} = $enrolment; + return ($borrower); #, $flags, $accessflagshash); } diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt index 4d81a17..12c5190 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt @@ -220,6 +220,11 @@ [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %]) [% END %] </h3>[% END %] + [% IF (RESERVE_CHARGE) %] + <div class="dialog alert"> + There is a charge of [% RESERVE_CHARGE %] for placing this reserve + </div> + [% END %] <form action="/cgi-bin/koha/opac-reserve.pl" method="post"> <input type="hidden" name="place_reserve" value="1"/> diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index a92a976..ab02afe 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -54,6 +54,10 @@ sub get_out ($$$) { # get borrower information .... my ( $borr ) = GetMemberDetails( $borrowernumber ); +# Pass through any reserve charge +if ($borr->{reservefee} > 0){ + $template->param( RESERVE_CHARGE => sprintf("%.2f",$borr->{reservefee})); +} # get branches and itemtypes my $branches = GetBranches(); my $itemTypes = GetItemTypes(); -- 1.7.2.3 From nengard at bywatersolutions.com Thu Sep 8 20:25:25 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 8 Sep 2011 14:25:25 -0400 Subject: [Koha-patches] [PATCH 2/2] Follow up to Bug 6857: Change language from 'reserve' to 'hold' In-Reply-To: <1315506325-6557-1-git-send-email-nengard@bywatersolutions.com> References: <1315506325-6557-1-git-send-email-nengard@bywatersolutions.com> Message-ID: <1315506325-6557-2-git-send-email-nengard@bywatersolutions.com> Reserves are called holds all throughout the OPAC so this follow up updates the language in this patch to match the standard. Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- .../opac-tmpl/prog/en/modules/opac-reserve.tt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt index 12c5190..deb09b0 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt @@ -222,7 +222,7 @@ </h3>[% END %] [% IF (RESERVE_CHARGE) %] <div class="dialog alert"> - There is a charge of [% RESERVE_CHARGE %] for placing this reserve + There is a charge of [% RESERVE_CHARGE %] for placing this hold </div> [% END %] -- 1.7.2.3 From nengard at bywatersolutions.com Thu Sep 8 20:31:14 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 8 Sep 2011 14:31:14 -0400 Subject: [Koha-patches] [PATCH 1/2] Bug 6857: display a charge warning alert for reserves Message-ID: <1315506675-6690-1-git-send-email-nengard@bywatersolutions.com> From: Robin Sheat <robin at catalyst.net.nz> If a user is placing a reserve on the OPAC, this'll let them know that it's going to cost them. Author: Chris Cormack <chrisc at catalyst.net.nz> Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- C4/Members.pm | 6 ++++-- .../opac-tmpl/prog/en/modules/opac-reserve.tt | 5 +++++ opac/opac-reserve.pl | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index dcc168b..8d4a6c5 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -2,6 +2,7 @@ package C4::Members; # Copyright 2000-2003 Katipo Communications # Copyright 2010 BibLibre +# Parts Copyright 2010 Catalyst IT # # This file is part of Koha. # @@ -352,11 +353,11 @@ sub GetMemberDetails { my $query; my $sth; if ($borrowernumber) { - $sth = $dbh->prepare("select borrowers.*,category_type,categories.description from borrowers left join categories on borrowers.categorycode=categories.categorycode where borrowernumber=?"); + $sth = $dbh->prepare("SELECT borrowers.*,category_type,categories.description,reservefee FROM borrowers LEFT JOIN categories ON borrowers.categorycode=categories.categorycode WHERE borrowernumber=?"); $sth->execute($borrowernumber); } elsif ($cardnumber) { - $sth = $dbh->prepare("select borrowers.*,category_type,categories.description from borrowers left join categories on borrowers.categorycode=categories.categorycode where cardnumber=?"); + $sth = $dbh->prepare("SELECT borrowers.*,category_type,categories.description,reservefee FROM borrowers LEFT JOIN categories ON borrowers.categorycode=categories.categorycode WHERE cardnumber=?"); $sth->execute($cardnumber); } else { @@ -386,6 +387,7 @@ sub GetMemberDetails { $sth->execute( $borrower->{'categorycode'} ); my $enrolment = $sth->fetchrow; $borrower->{'enrolmentperiod'} = $enrolment; + return ($borrower); #, $flags, $accessflagshash); } diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt index 4d81a17..12c5190 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt @@ -220,6 +220,11 @@ [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %]) [% END %] </h3>[% END %] + [% IF (RESERVE_CHARGE) %] + <div class="dialog alert"> + There is a charge of [% RESERVE_CHARGE %] for placing this reserve + </div> + [% END %] <form action="/cgi-bin/koha/opac-reserve.pl" method="post"> <input type="hidden" name="place_reserve" value="1"/> diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index a92a976..ab02afe 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -54,6 +54,10 @@ sub get_out ($$$) { # get borrower information .... my ( $borr ) = GetMemberDetails( $borrowernumber ); +# Pass through any reserve charge +if ($borr->{reservefee} > 0){ + $template->param( RESERVE_CHARGE => sprintf("%.2f",$borr->{reservefee})); +} # get branches and itemtypes my $branches = GetBranches(); my $itemTypes = GetItemTypes(); -- 1.7.2.3 From nengard at bywatersolutions.com Thu Sep 8 20:31:15 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 8 Sep 2011 14:31:15 -0400 Subject: [Koha-patches] [PATCH 2/2] Follow up to Bug 6857: Change language from 'reserve' to 'hold' In-Reply-To: <1315506675-6690-1-git-send-email-nengard@bywatersolutions.com> References: <1315506675-6690-1-git-send-email-nengard@bywatersolutions.com> Message-ID: <1315506675-6690-2-git-send-email-nengard@bywatersolutions.com> Reserves are called holds all throughout the OPAC so this follow up updates the language in this patch to match the standard. Also adds an id tag to the message for altering with JQuery. Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- .../opac-tmpl/prog/en/modules/opac-reserve.tt | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt index 12c5190..5c38ed4 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt @@ -221,8 +221,8 @@ [% END %] </h3>[% END %] [% IF (RESERVE_CHARGE) %] - <div class="dialog alert"> - There is a charge of [% RESERVE_CHARGE %] for placing this reserve + <div class="dialog alert" id="reserve_fee"> + There is a charge of [% RESERVE_CHARGE %] for placing this hold </div> [% END %] -- 1.7.2.3 From nengard at bywatersolutions.com Thu Sep 8 20:54:38 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 8 Sep 2011 14:54:38 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6861: Fast Add returns to circ/circulation.pl in all cases Message-ID: <1315508078-6891-1-git-send-email-nengard@bywatersolutions.com> From: Ian Walls <ian.walls at bywatersolutions.com> If Fast Add is accessed from either the circulation homepage or cataloguing, it should stay on the additem.pl page after saving the first item. Only when a Fast Add is done in the middle of a circulation transaction should it redirect back to circ/circulation.pl to complete that transaction. This patch adds a conditional check for a borrowernumber input param; the presense of such implies we're in the middle of a checkout. It's absense implies we should remain on additem.pl Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- cataloguing/additem.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 275e236..0db2d2d 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -422,7 +422,7 @@ if ($op eq "additem") { undef($itemrecord); } } - if ($frameworkcode eq 'FA'){ + if ($frameworkcode eq 'FA' && $input->param('borrowernumber')){ my $redirect_string = 'borrowernumber=' . uri_escape($input->param('borrowernumber')) . '&barcode=' . uri_escape($input->param('barcode')); $redirect_string .= '&duedatespec=' . uri_escape($input->param('duedatespec')) . -- 1.7.2.3 From cnighswonger at foundations.edu Sat Sep 10 04:11:02 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Fri, 9 Sep 2011 22:11:02 -0400 Subject: [Koha-patches] [PATCH] Bug 6722: Cause build output to appear on the screen In-Reply-To: <20110905012037.GP23576@rorohiko.wgtn.cat-it.co.nz> References: <1313385599-25436-1-git-send-email-robin@catalyst.net.nz> <CAP3yOomUzcMrojs2ZRbVmfTyBmW5Q=19+Mx0jO+b9guL9_7-Fw@mail.gmail.com> <20110905012037.GP23576@rorohiko.wgtn.cat-it.co.nz> Message-ID: <CAP3yOon2g1m7LJP9xhJp5fTKObEnj2CULkisJUp2HEHzh+ktsg@mail.gmail.com> On Sun, Sep 4, 2011 at 9:20 PM, Chris Cormack <chrisc at catalyst.net.nz>wrote: > * Chris Nighswonger (cnighswonger at foundations.edu) wrote: > > This patch does not apply cleanly to 3.4.x. If it should, please > rebase > > against 3.4.x and resubmit with [3.4.x] in the subject line. > > > This patch depends on the patches for 6722 being applied first. > > I think its safe to apply them to the 3.4.x tree, then this one after > > Chris > > 6722 does not apply cleanly to 3.4.x either. I'm not sure where the divergence occurred. Perhaps I'm missing a still earlier commit? Chris > > > Kind Regards, > > Chris > > > > On Mon, Aug 15, 2011 at 1:19 AM, Robin Sheat <robin at catalyst.net.nz> > > wrote: > > > > This allows the build information to not be suppressed when using > > build-git-snapshot. This makes seeing where problems are > substantially > > easier. > > --- > > A debian/build-git-snapshot | A A 9 ++++++++- > > A 1 files changed, 8 insertions(+), 1 deletions(-) > > > > diff --git a/debian/build-git-snapshot b/debian/build-git-snapshot > > index cd0545a..91552ff 100755 > > --- a/debian/build-git-snapshot > > +++ b/debian/build-git-snapshot > > @@ -58,6 +58,13 @@ sub sys_command_output { > > A A return map { chomp; $_ } <$command_output>; > > A } > > > > +sub sys_command_output_screen { > > + A A my ($command) = @_; > > + > > + A A print "$command\n" if $debug; > > + A A system($command); > > +} > > + > > A sub everything_is_committed { > > A A my $filter; > > A A for ($git_checks) { > > @@ -130,7 +137,7 @@ sub build_package { > > A A sys_command_output( qq{git archive --format=tar > > --prefix="koha-$newversion/" HEAD | gzip -9 > > > "../koha_$newversion.tar.gz"} ); > > > > A A my $pdebuildopts = $buildresult ? "--buildresult $buildresult" > : > > ""; > > - A A sys_command_output( "pdebuild $pdebuildopts" ); > > + A A sys_command_output_screen( "pdebuild $pdebuildopts" ); > > A } > > > > A everything_is_committed() or die "cannot build: uncommited > changes"; > > -- > > 1.7.4.1 > > > > _______________________________________________ > > Koha-patches mailing list > > Koha-patches at lists.koha-community.org > > > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > > website : http://www.koha-community.org/ > > git : http://git.koha-community.org/ > > bugs : http://bugs.koha-community.org/ > > > _______________________________________________ > > Koha-patches mailing list > > Koha-patches at lists.koha-community.org > > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > > website : http://www.koha-community.org/ > > git : http://git.koha-community.org/ > > bugs : http://bugs.koha-community.org/ > > > -- > Chris Cormack > Catalyst IT Ltd. > +64 4 803 2238 > PO Box 11-053, Manners St, Wellington 6142, New Zealand > -------------- next part -------------- An HTML attachment was scrubbed... URL: </pipermail/koha-patches/attachments/20110909/24d8602b/attachment.htm> From cnighswonger at foundations.edu Sat Sep 10 04:22:03 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Fri, 9 Sep 2011 22:22:03 -0400 Subject: [Koha-patches] [PATCH] Bug 6687 - allow people to be moved in the holds queue In-Reply-To: <1315360219-23892-1-git-send-email-robin@catalyst.net.nz> References: <1315360219-23892-1-git-send-email-robin@catalyst.net.nz> Message-ID: <CAP3yOon3Gu4=KMKjXn7XibcxrXO=-+rYj1q-cv6fqNhNG6RfZw@mail.gmail.com> This patch does not apply cleanly to the 3.4.x branch. If it should, please fixup and resubmit with [3.4.x] in the subject line. Kind Regards, Chris On Tue, Sep 6, 2011 at 9:50 PM, Robin Sheat <robin at catalyst.net.nz> wrote: > This fixes a regression introduced by Bug 6526 that told you someone > already had a reserve if you attempted to move their ordering in the > hold queue. > > (note: it also cleans a host of trailing whitespace errors that were in > that file) > --- > reserve/request.pl | 117 > ++++++++++++++++++++++++++-------------------------- > 1 files changed, 58 insertions(+), 59 deletions(-) > > diff --git a/reserve/request.pl b/reserve/request.pl > index 0c952b4..b345845 100755 > --- a/reserve/request.pl > +++ b/reserve/request.pl > @@ -3,6 +3,7 @@ > > #writen 2/1/00 by chris at katipo.oc.nz > # Copyright 2000-2002 Katipo Communications > +# Parts Copyright 2011 Catalyst IT > # > # This file is part of Koha. > # > @@ -62,11 +63,11 @@ my $showallitems = $input->param('showallitems'); > # get Branches and Itemtypes > my $branches = GetBranches(); > my $itemtypes = GetItemTypes(); > - > + > my $default = C4::Context->userenv->{branch}; > my @values; > my %label_of; > - > + > foreach my $branchcode (sort keys %{$branches} ) { > push @values, $branchcode; > $label_of{$branchcode} = $branches->{$branchcode}->{branchname}; > @@ -99,9 +100,7 @@ if ( $action eq 'move' ) { > my $where = $input->param('where'); > my $borrowernumber = $input->param('borrowernumber'); > my $biblionumber = $input->param('biblionumber'); > - > AlterPriority( $where, $borrowernumber, $biblionumber ); > - > } elsif ( $action eq 'cancel' ) { > my $borrowernumber = $input->param('borrowernumber'); > my $biblionumber = $input->param('biblionumber'); > @@ -129,7 +128,9 @@ if ($findborrower) { > } > } > > -if ($borrowernumber_hold) { > +# If we have the borrowernumber because we've performed an action, then we > +# don't want to try to place another reserve. > +if ($borrowernumber_hold && !$action) { > my $borrowerinfo = GetMemberDetails( $borrowernumber_hold ); > my $diffbranch; > my @getreservloop; > @@ -154,7 +155,6 @@ if ($borrowernumber_hold) { > Date_to_Days(split /-/,$date) > Date_to_Days(split > /-/,$expiry_date)) { > $messages = $expiry = 1; > } > - > > # check if the borrower make the reserv in a different branch > if ( $borrowerinfo->{'branchcode'} ne C4::Context->userenv->{'branch'} > ) { > @@ -265,11 +265,11 @@ foreach my $biblionumber (@biblionumbers) { > warnings => $warnings, > maxreserves=>$maxreserves > ); > - > - > + > + > # FIXME think @optionloop, is maybe obsolete, or must be switchable by > a systeme preference fixed rank or not > # make priorities options > - > + > my @optionloop; > for ( 1 .. $count + 1 ) { > push( > @@ -286,7 +286,7 @@ foreach my $biblionumber (@biblionumbers) { > my @branchcodes; > my %itemnumbers_of_biblioitem; > my @itemnumbers; > - > + > ## $items is array of 'item' table numbers > if (my $items = get_itemnumbers_of($biblionumber)->{$biblionumber}){ > @itemnumbers = @$items; > @@ -295,61 +295,61 @@ foreach my $biblionumber (@biblionumbers) { > $template->param('noitems' => 1); > $biblioloopiter{noitems} = 1; > } > - > + > ## Hash of item number to 'item' table fields > my $iteminfos_of = GetItemInfosOf(@itemnumbers); > - > + > ## Here we go backwards again to create hash of biblioitemnumber to > itemnumbers, > ## when by definition all of the itemnumber have the same > biblioitemnumber > foreach my $itemnumber (@itemnumbers) { > my $biblioitemnumber = > $iteminfos_of->{$itemnumber}->{biblioitemnumber}; > push( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} }, > $itemnumber ); > } > - > + > ## Should be same as biblionumber > my @biblioitemnumbers = keys %itemnumbers_of_biblioitem; > - > + > my $notforloan_label_of = get_notforloan_label_of(); > - > + > ## Hash of biblioitemnumber to 'biblioitem' table records > my $biblioiteminfos_of = GetBiblioItemInfosOf(@biblioitemnumbers); > - > + > my @bibitemloop; > - > + > foreach my $biblioitemnumber (@biblioitemnumbers) { > my $biblioitem = $biblioiteminfos_of->{$biblioitemnumber}; > my $num_available = 0; > my $num_override = 0; > my $hiddencount = 0; > - > + > $biblioitem->{description} = > $itemtypes->{ $biblioitem->{itemtype} }{description}; > $biblioloopiter{description} = $biblioitem->{description}; > $biblioloopiter{itypename} = $biblioitem->{description}; > $biblioloopiter{imageurl} = > getitemtypeimagelocation('intranet', > $itemtypes->{$biblioitem->{itemtype}}{imageurl}); > - > + > foreach my $itemnumber ( @{ > $itemnumbers_of_biblioitem{$biblioitemnumber} } ) { > my $item = $iteminfos_of->{$itemnumber}; > - > + > unless (C4::Context->preference('item-level_itypes')) { > $item->{itype} = $biblioitem->{itemtype}; > } > - > + > $item->{itypename} = $itemtypes->{ $item->{itype} > }{description}; > $item->{imageurl} = getitemtypeimagelocation( 'intranet', > $itemtypes->{ $item->{itype} }{imageurl} ); > $item->{homebranchname} = $branches->{ $item->{homebranch} > }{branchname}; > - > + > # if the holdingbranch is different than the homebranch, we > show the > # holdingbranch of the document too > if ( $item->{homebranch} ne $item->{holdingbranch} ) { > $item->{holdingbranchname} = > $branches->{ $item->{holdingbranch} }{branchname}; > } > - > + > # add information > $item->{itemcallnumber} = $item->{itemcallnumber}; > - > + > # if the item is currently on loan, we display its return date > and > # change the background color > my $issues= GetItemIssue($itemnumber); > @@ -357,11 +357,11 @@ foreach my $biblionumber (@biblionumbers) { > $item->{date_due} = format_date($issues->{'date_due'}); > $item->{backgroundcolor} = 'onloan'; > } > - > + > # checking reserve > my ($reservedate,$reservedfor,$expectedAt) = > GetReservesFromItemnumber($itemnumber); > my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, > 0); > - > + > if ( defined $reservedate ) { > $item->{backgroundcolor} = 'reserved'; > $item->{reservedate} = format_date($reservedate); > @@ -369,19 +369,19 @@ foreach my $biblionumber (@biblionumbers) { > $item->{ReservedForSurname} = > $ItemBorrowerReserveInfo->{'surname'}; > $item->{ReservedForFirstname} = > $ItemBorrowerReserveInfo->{'firstname'}; > $item->{ExpectedAtLibrary} = > $branches->{$expectedAt}{branchname}; > - > + > } > - > + > # Management of the notforloan document > if ( $item->{notforloan} ) { > $item->{backgroundcolor} = 'other'; > $item->{notforloanvalue} = > $notforloan_label_of->{ $item->{notforloan} }; > } > - > + > # Management of lost or long overdue items > if ( $item->{itemlost} ) { > - > + > # FIXME localized strings should never be in Perl code > $item->{message} = > $item->{itemlost} == 1 ? "(lost)" > @@ -393,11 +393,11 @@ foreach my $biblionumber (@biblionumbers) { > $hiddencount++; > } > } > - > + > # Check the transit status > my ( $transfertwhen, $transfertfrom, $transfertto ) = > GetTransfers($itemnumber); > - > + > if ( defined $transfertwhen && $transfertwhen ne '' ) { > $item->{transfertwhen} = format_date($transfertwhen); > $item->{transfertfrom} = > @@ -405,13 +405,13 @@ foreach my $biblionumber (@biblionumbers) { > $item->{transfertto} = > $branches->{$transfertto}{branchname}; > $item->{nocancel} = 1; > } > - > + > # If there is no loan, return and transfer, we show a checkbox. > $item->{notforloan} = $item->{notforloan} || 0; > - > + > # if independent branches is on we need to check if the person > can reserve > # for branches they arent logged in to > - if ( C4::Context->preference("IndependantBranches") ) { > + if ( C4::Context->preference("IndependantBranches") ) { > if (! > C4::Context->preference("canreservefromotherbranches")){ > # cant reserve items so need to check if item > homebranch and userenv branch match if not we cant reserve > my $userenv = C4::Context->userenv; > @@ -420,22 +420,22 @@ foreach my $biblionumber (@biblionumbers) { > } > } > } > - > + > my $branch = C4::Circulation::_GetCircControlBranch($item, > $borrowerinfo); > > my $branchitemrule = GetBranchItemRule( $branch, > $item->{'itype'} ); > my $policy_holdallowed = 1; > - > + > $item->{'holdallowed'} = $branchitemrule->{'holdallowed'}; > - > + > if ( $branchitemrule->{'holdallowed'} == 0 || > - ( $branchitemrule->{'holdallowed'} == 1 && > + ( $branchitemrule->{'holdallowed'} == 1 && > $borrowerinfo->{'branchcode'} ne $item->{'homebranch'} > ) ) { > $policy_holdallowed = 0; > } > - > - if (IsAvailableForItemLevelRequest($itemnumber) and > - not $item->{cantreserve} and > + > + if (IsAvailableForItemLevelRequest($itemnumber) and > + not $item->{cantreserve} and > CanItemBeReserved($borrowerinfo->{borrowernumber}, > $itemnumber) ) { > if ( $policy_holdallowed ) { > $item->{available} = 1; > @@ -449,10 +449,10 @@ foreach my $biblionumber (@biblionumbers) { > if (C4::Context->preference( 'AllowHoldPolicyOverride' ) && > !$item->{available} ) { > $item->{override} = 1; > $num_override++; > - } > + } > > # If none of the conditions hold true, then neither override > nor available is set and the item cannot be checked > - > + > # FIXME: move this to a pm > my $sth2 = $dbh->prepare("SELECT * FROM reserves WHERE > borrowernumber=? AND itemnumber=? AND found='W'"); > > $sth2->execute($item->{ReservedForBorrowernumber},$item->{itemnumber}); > @@ -461,7 +461,7 @@ foreach my $biblionumber (@biblionumbers) { > } > push @{ $biblioitem->{itemloop} }, $item; > } > - > + > if ( $num_override == scalar( @{ $biblioitem->{itemloop} } ) ) { # > That is, if all items require an override > $template->param( override_required => 1 ); > } elsif ( $num_available == 0 ) { > @@ -471,17 +471,17 @@ foreach my $biblionumber (@biblionumbers) { > $biblioloopiter{none_avail} = 1; > } > $template->param( hiddencount => $hiddencount); > - > + > push @bibitemloop, $biblioitem; > } > > # existingreserves building > my @reserveloop; > ( $count, $reserves ) = GetReservesFromBiblionumber($biblionumber,1); > - foreach my $res ( sort { > + foreach my $res ( sort { > my $a_found = $a->{found} || ''; > my $b_found = $a->{found} || ''; > - $a_found cmp $b_found; > + $a_found cmp $b_found; > } @$reserves ) { > my %reserve; > my @optionloop; > @@ -494,11 +494,11 @@ foreach my $biblionumber (@biblionumbers) { > } > ); > } > - > + > if ( defined $res->{'found'} && $res->{'found'} eq 'W' || > $res->{'found'} eq 'T' ) { > my $item = $res->{'itemnumber'}; > $item = GetBiblioFromItemNumber($item,undef); > - $reserve{'wait'}= 1; > + $reserve{'wait'}= 1; > $reserve{'holdingbranch'}=$item->{'holdingbranch'}; > $reserve{'biblionumber'}=$item->{'biblionumber'}; > $reserve{'barcodenumber'} = $item->{'barcode'}; > @@ -519,21 +519,21 @@ foreach my $biblionumber (@biblionumbers) { > $reserve{'item_level_hold'} = 1; > } > } > - > + > # get borrowers reserve info > my $reserveborrowerinfo = GetMemberDetails( > $res->{'borrowernumber'}, 0); > if (C4::Context->preference('HidePatronName')){ > $reserve{'hidename'} = 1; > $reserve{'cardnumber'} = $reserveborrowerinfo->{'cardnumber'}; > } > - $reserve{'expirationdate'} = format_date( $res->{'expirationdate'} > ) > + $reserve{'expirationdate'} = format_date( $res->{'expirationdate'} > ) > unless ( !defined($res->{'expirationdate'}) || > $res->{'expirationdate'} eq '0000-00-00' ); > $reserve{'date'} = format_date( $res->{'reservedate'} ); > $reserve{'borrowernumber'} = $res->{'borrowernumber'}; > $reserve{'biblionumber'} = $res->{'biblionumber'}; > $reserve{'borrowernumber'} = $res->{'borrowernumber'}; > $reserve{'firstname'} = $reserveborrowerinfo->{'firstname'}; > - $reserve{'surname'} = $reserveborrowerinfo->{'surname'}; > + $reserve{'surname'} = $reserveborrowerinfo->{'surname'}; > $reserve{'notes'} = $res->{'reservenotes'}; > $reserve{'wait'} = > ( ( defined $res->{'found'} and $res->{'found'} eq 'W' ) or ( > $res->{'priority'} eq '0' ) ); > @@ -546,20 +546,20 @@ foreach my $biblionumber (@biblionumbers) { > $reserve{'lowestPriority'} = $res->{'lowestPriority'}; > $reserve{'branchloop'} = GetBranchesLoop($res->{'branchcode'}); > $reserve{'optionloop'} = \@optionloop; > - > + > push( @reserveloop, \%reserve ); > } > - > + > # get the time for the form name... > my $time = time(); > - > + > $template->param( > CGIbranch => $CGIbranch, > > time => $time, > fixedRank => $fixedRank, > ); > - > + > # display infos > $template->param( > optionloop => \@optionloop, > @@ -588,7 +588,6 @@ foreach my $biblionumber (@biblionumbers) { > if (@reserveloop) { > $template->param( reserveloop => \@reserveloop ); > } > - > > push @biblioloop, \%biblioloopiter; > } > @@ -604,6 +603,6 @@ if ($multihold) { > if ( C4::Context->preference( 'AllowHoldDateInFuture' ) ) { > $template->param( reserve_in_future => 1 ); > } > - > + > # printout the page > output_html_with_http_headers $input, $cookie, $template->output; > -- > 1.7.4.1 > > _______________________________________________ > Koha-patches mailing list > Koha-patches at lists.koha-community.org > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > website : http://www.koha-community.org/ > git : http://git.koha-community.org/ > bugs : http://bugs.koha-community.org/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: </pipermail/koha-patches/attachments/20110909/391ecb8f/attachment-0001.htm> From nengard at bywatersolutions.com Fri Sep 9 05:21:25 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 8 Sep 2011 23:21:25 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug id:6783 - Circulation restrictions dont work when other withdrawn reasons are used Message-ID: <1315538485-8535-1-git-send-email-nengard@bywatersolutions.com> From: Meenakshi.R <meenakshi.r at osslabs.biz> Circulation restrictions work only when withdrawn reason (value 1) is selected. If ones sets up other withdrawn reasons using authorized values, and selects one of them (e.g. value 2), circulation restrictions don't work. This changes fixes this problem. Signed-off-by: Amit Gupta <amit.gupta at osslabs.biz> Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- C4/Circulation.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 47068f9..520c116 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -817,7 +817,7 @@ sub CanBookBeIssued { } } } - if ( $item->{'wthdrawn'} && $item->{'wthdrawn'} == 1 ) + if ( $item->{'wthdrawn'} && $item->{'wthdrawn'} > 0 ) { $issuingimpossible{WTHDRAWN} = 1; } -- 1.7.2.3 From nengard at bywatersolutions.com Fri Sep 9 07:26:11 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Fri, 9 Sep 2011 01:26:11 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6825 OpacNav menu hide user menu on opac-user.pl page Message-ID: <1315545971-9046-1-git-send-email-nengard@bywatersolutions.com> From: Fr?d?ric Demians <f.demians at tamil.fr> This patch add a new syspref OpacNavBottom which is placed on all pages after OpacNav. On Patron pages, specif patron links are placed between OpacNav and OpacNavBottom, like this: OpacNav Patron links OpacNavBottom To test: 1 Apply this patch 2 For RM, modify kohaversion.pl and updatedatabase.pl appropriately 3 Test that OPAC pages are displayed as before, OpacNav on the left 4 Test OPAC patron pages: OpacNav is as before displayed after patron links 5 Split OpacNav between itself and OpacNavBottom 6 Patron pages display patron links between OpacNav and OpacNavBottom Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- C4/Auth.pm | 2 ++ installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 8 ++++++++ .../prog/en/modules/admin/preferences/opac.pref | 5 +++++ .../opac-tmpl/prog/en/includes/navigation.inc | 7 ++++++- .../opac-tmpl/prog/en/modules/opac-account.tt | 3 +-- .../opac-tmpl/prog/en/modules/opac-messaging.tt | 3 +-- koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt | 3 +-- .../opac-tmpl/prog/en/modules/opac-privacy.tt | 3 +-- .../prog/en/modules/opac-readingrecord.tt | 3 +-- .../prog/en/modules/opac-search-history.tt | 6 ++---- .../opac-tmpl/prog/en/modules/opac-shelves.tt | 3 +-- .../opac-tmpl/prog/en/modules/opac-suggestions.tt | 3 +-- koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt | 3 +-- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 3 +-- .../opac-tmpl/prog/en/modules/opac-userupdate.tt | 3 +-- 16 files changed, 34 insertions(+), 25 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 495f04c..6ec71a3 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -437,6 +437,7 @@ sub get_template_and_user { OpacCloud => C4::Context->preference("OpacCloud"), OpacMainUserBlock => "" . C4::Context->preference("OpacMainUserBlock"), OpacNav => "" . C4::Context->preference("OpacNav"), + OpacNavBottom => "" . C4::Context->preference("OpacNavBottom"), OpacPasswordChange => C4::Context->preference("OpacPasswordChange"), OPACPatronDetails => C4::Context->preference("OPACPatronDetails"), OPACPrivacy => C4::Context->preference("OPACPrivacy"), @@ -956,6 +957,7 @@ sub checkauth { LibraryName => C4::Context->preference("LibraryName"), opacuserlogin => C4::Context->preference("opacuserlogin"), OpacNav => C4::Context->preference("OpacNav"), + OpacNavBottom => C4::Context->preference("OpacNavBottom"), opaccredits => C4::Context->preference("opaccredits"), OpacFavicon => C4::Context->preference("OpacFavicon"), opacreadinghistory => C4::Context->preference("opacreadinghistory"), diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 79d4893..3e80d5c 100755 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -81,6 +81,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMaintenance',0,'If ON, enables maintenance warning in OPAC','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMainUserBlock','Welcome to Koha...\r\n<hr>','A user-defined block of HTML in the main content area of the opac main page','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNav','Important links here.','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','70|10','Textarea'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNavBottom','Important links here.','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACNoResultsFound','','Display this HTML when no results are found for a search in the OPAC','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6b88c29..cf21e6d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4447,6 +4447,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { } +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNavBottom','','Links after OpacNav links','70|10','Textarea')"); + print "Upgrade to $DBversion done (add OpacNavBottom syspref (enh 6825): if appropriate, you can split OpacNav into OpacNav and OpacNavBottom)\n"; + SetVersion($DBversion); +} + + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 8bbf692..032c85a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -143,6 +143,11 @@ OPAC: type: textarea class: code - + - "Show the following HTML on the left hand column of the main page and patron account on the OPAC, after OpacNav, and before patron account links if available:" + - pref: OpacNavBottom + type: textarea + class: code + - - "Include the following HTML in the header of all pages in the OPAC:" - pref: opacheader type: textarea diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc b/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc index 637ed33..9cd2c12 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc @@ -1 +1,6 @@ -[% OpacNav %] \ No newline at end of file +[% OpacNav %] +[% IF IsPatronPage %] +[% INCLUDE usermenu.inc %] +[% END %] +[% OpacNavBottom %] + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt index eed66d3..b28fd08 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt @@ -54,8 +54,7 @@ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt index ebb1e26..e456f0f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt @@ -115,8 +115,7 @@ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt index 16c4532..1f3025a 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt @@ -54,8 +54,7 @@ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt index de34e02..b1c4d1f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt @@ -64,8 +64,7 @@ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt index 683a5bd..bedae0a 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt @@ -95,8 +95,7 @@ You have never borrowed anything from this library. </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt index e9f6be1..6c2cd82 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt @@ -82,13 +82,11 @@ [% IF ( OpacNav ) %] <div class="yui-b"><div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div></div> [% ELSIF ( loggedinusername ) %] <div class="yui-b"><div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div></div> [% ELSE %] [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt index c50cfb1..aa10dae 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt @@ -601,8 +601,7 @@ $(function() { [% IF ( OpacNav||loggedinusername ) %] <div class="yui-b"> <div is="leftmenus" class="container"> - [% INCLUDE 'navigation.inc' %] - [% INCLUDE 'usermenu.inc' %] + [% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt index 3f3aa34..d8757bb 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt @@ -212,8 +212,7 @@ $.tablesorter.addParser({ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt index e99d201..e93e00a 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt @@ -131,8 +131,7 @@ </div> [% IF ( OpacNav||loggedinusername ) %] <div class="yui-b"><div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div></div> [% END %] </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt index 9ba6c05..d9417ec 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -423,8 +423,7 @@ $.tablesorter.addParser({ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt index db5f7f5..58f4d2d 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt @@ -180,8 +180,7 @@ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> -- 1.7.2.3 From robin at catalyst.net.nz Mon Sep 12 01:16:26 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Mon, 12 Sep 2011 11:16:26 +1200 Subject: [Koha-patches] [PATCH] Bug 6722: Cause build output to appear on the screen In-Reply-To: <CAP3yOon2g1m7LJP9xhJp5fTKObEnj2CULkisJUp2HEHzh+ktsg@mail.gmail.com> References: <1313385599-25436-1-git-send-email-robin@catalyst.net.nz> <CAP3yOomUzcMrojs2ZRbVmfTyBmW5Q=19+Mx0jO+b9guL9_7-Fw@mail.gmail.com> <20110905012037.GP23576@rorohiko.wgtn.cat-it.co.nz> <CAP3yOon2g1m7LJP9xhJp5fTKObEnj2CULkisJUp2HEHzh+ktsg@mail.gmail.com> Message-ID: <1315782986.13770.195.camel@zarathud> Chris Nighswonger schreef op vr 09-09-2011 om 22:11 [-0400]: > 6722 does not apply cleanly to 3.4.x either. I'm not sure where the > divergence occurred. Perhaps I'm missing a still earlier commit? Try the one newly attached to Bug 5602, that avoids all the patchy stuff and just brings the build script up to master. There is a series of patches that would have to be applied otherwise. -- Robin Sheat Catalyst IT Ltd. ? +64 4 803 2204 GPG: 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: </pipermail/koha-patches/attachments/20110912/20aafa0c/attachment.pgp> From robin at catalyst.net.nz Mon Sep 12 01:21:09 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Mon, 12 Sep 2011 11:21:09 +1200 Subject: [Koha-patches] [PATCH] Bug 6687 - allow people to be moved in the holds queue In-Reply-To: <CAP3yOon3Gu4=KMKjXn7XibcxrXO=-+rYj1q-cv6fqNhNG6RfZw@mail.gmail.com> References: <1315360219-23892-1-git-send-email-robin@catalyst.net.nz> <CAP3yOon3Gu4=KMKjXn7XibcxrXO=-+rYj1q-cv6fqNhNG6RfZw@mail.gmail.com> Message-ID: <1315783269.13770.196.camel@zarathud> Chris Nighswonger schreef op vr 09-09-2011 om 22:22 [-0400]: > This patch does not apply cleanly to the 3.4.x branch. If it should, > please fixup and resubmit with [3.4.x] in the subject line. I don't think bug 6526 was applied to 3.4.x either, so the regression doesn't exist there, so this fix isn't needed. -- Robin Sheat Catalyst IT Ltd. ? +64 4 803 2204 GPG: 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: </pipermail/koha-patches/attachments/20110912/11e60939/attachment.pgp> From srdjan at catalyst.net.nz Mon Sep 12 04:49:17 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Mon, 12 Sep 2011 14:49:17 +1200 Subject: [Koha-patches] [PATCH] bug_5533: Improved marking items as lost In-Reply-To: <bug 5533> References: <bug 5533> Message-ID: <1315795757-481-1-git-send-email-srdjan@catalyst.net.nz> --- C4/Accounts.pm | 77 ++++++++------------------- C4/Circulation.pm | 40 ++++++++++++++- C4/Items.pm | 8 +++- catalogue/updateitem.pl | 3 +- cataloguing/additem.pl | 5 ++- misc/cronjobs/longoverdue.pl | 3 +- t/db_dependent/lib/KohaTest/Accounts.pm | 1 - t/db_dependent/lib/KohaTest/Circulation.pm | 1 + tools/batchMod.pl | 7 ++- 9 files changed, 81 insertions(+), 64 deletions(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index eea142c..70b3944 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -23,8 +23,7 @@ use strict; use C4::Context; use C4::Stats; use C4::Members; -use C4::Items; -use C4::Circulation qw(MarkIssueReturned); +use C4::Circulation qw(ReturnLostItem); use vars qw($VERSION @ISA @EXPORT); @@ -216,7 +215,7 @@ sub makepayment { #check to see what accounttype if ( $data->{'accounttype'} eq 'Rep' || $data->{'accounttype'} eq 'L' ) { - returnlost( $borrowernumber, $data->{'itemnumber'} ); + ReturnLostItem( $borrowernumber, $data->{'itemnumber'} ); } } @@ -276,64 +275,34 @@ EOT =cut -sub returnlost{ - my ( $borrowernumber, $itemnum ) = @_; - C4::Circulation::MarkIssueReturned( $borrowernumber, $itemnum ); - my $borrower = C4::Members::GetMember( 'borrowernumber'=>$borrowernumber ); - my @datearr = localtime(time); - my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3]; - my $bor = "$borrower->{'firstname'} $borrower->{'surname'} $borrower->{'cardnumber'}"; - ModItem({ paidfor => "Paid for by $bor $date" }, undef, $itemnum); -} - - sub chargelostitem{ # lost ==1 Lost, lost==2 longoverdue, lost==3 lost and paid for # FIXME: itemlost should be set to 3 after payment is made, should be a warning to the interface that # a charge has been added # FIXME : if no replacement price, borrower just doesn't get charged? - my $dbh = C4::Context->dbh(); - my ($itemnumber) = @_; - my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title - FROM issues - JOIN items USING (itemnumber) - JOIN biblio USING (biblionumber) - WHERE issues.itemnumber=?"); - $sth->execute($itemnumber); - my $issues=$sth->fetchrow_hashref(); - - # if a borrower lost the item, add a replacement cost to the their record - if ( $issues->{borrowernumber} ){ - - # first make sure the borrower hasn't already been charged for this item - my $sth1=$dbh->prepare("SELECT * from accountlines - WHERE borrowernumber=? AND itemnumber=? and accounttype='L'"); - $sth1->execute($issues->{'borrowernumber'},$itemnumber); - my $existing_charge_hashref=$sth1->fetchrow_hashref(); - - # OK, they haven't - unless ($existing_charge_hashref) { - # This item is on issue ... add replacement cost to the borrower's record and mark it returned - # Note that we add this to the account even if there's no replacement price, allowing some other - # process (or person) to update it, since we don't handle any defaults for replacement prices. - my $accountno = getnextacctno($issues->{'borrowernumber'}); - my $sth2=$dbh->prepare("INSERT INTO accountlines - (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber) - VALUES (?,?,now(),?,?,'L',?,?)"); - $sth2->execute($issues->{'borrowernumber'},$accountno,$issues->{'replacementprice'}, - "Lost Item $issues->{'title'} $issues->{'barcode'}", - $issues->{'replacementprice'},$itemnumber); - $sth2->finish; - # FIXME: Log this ? - } - #FIXME : Should probably have a way to distinguish this from an item that really was returned. - #warn " $issues->{'borrowernumber'} / $itemnumber "; - C4::Circulation::MarkIssueReturned($issues->{borrowernumber},$itemnumber); - # Shouldn't MarkIssueReturned do this? - C4::Items::ModItem({ onloan => undef }, undef, $itemnumber); + my ($borrowernumber, $itemnumber, $amount, $description) = @_; + + # first make sure the borrower hasn't already been charged for this item + my $sth1=$dbh->prepare("SELECT * from accountlines + WHERE borrowernumber=? AND itemnumber=? and accounttype='L'"); + $sth1->execute($borrowernumber,$itemnumber); + my $existing_charge_hashref=$sth1->fetchrow_hashref(); + + # OK, they haven't + unless ($existing_charge_hashref) { + # This item is on issue ... add replacement cost to the borrower's record and mark it returned + # Note that we add this to the account even if there's no replacement price, allowing some other + # process (or person) to update it, since we don't handle any defaults for replacement prices. + my $accountno = getnextacctno($borrowernumber); + my $sth2=$dbh->prepare("INSERT INTO accountlines + (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber) + VALUES (?,?,now(),?,?,'L',?,?)"); + $sth2->execute($borrowernumber,$accountno,$amount, + $description,$amount,$itemnumber); + $sth2->finish; + # FIXME: Log this ? } - $sth->finish; } =head2 manualinvoice diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 520c116..23769b4 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -59,8 +59,9 @@ BEGIN { # FIXME subs that should probably be elsewhere push @EXPORT, qw( - &FixOverduesOnReturn &barcodedecode + &LostItem + &ReturnLostItem ); # subs to deal with issuing a book @@ -2943,8 +2944,43 @@ sub DeleteBranchTransferLimits { $sth->execute(); } +sub ReturnLostItem{ + my ( $borrowernumber, $itemnum ) = @_; - 1; + MarkIssueReturned( $borrowernumber, $itemnum ); + my $borrower = C4::Members::GetMember( 'borrowernumber'=>$borrowernumber ); + my @datearr = localtime(time); + my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3]; + my $bor = "$borrower->{'firstname'} $borrower->{'surname'} $borrower->{'cardnumber'}"; + ModItem({ paidfor => "Paid for by $bor $date" }, undef, $itemnum); +} + + +sub LostItem{ + my ($itemnumber) = @_; + + my $dbh = C4::Context->dbh(); + my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title + FROM issues + JOIN items USING (itemnumber) + JOIN biblio USING (biblionumber) + WHERE issues.itemnumber=?"); + $sth->execute($itemnumber); + my $issues=$sth->fetchrow_hashref(); + + # if a borrower lost the item, add a replacement cost to the their record + if ( $issues->{borrowernumber} ){ + + C4::Accounts::chargelostitem($issues->{borrowernumber}, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}"); + #FIXME : Should probably have a way to distinguish this from an item that really was returned. + #warn " $issues->{'borrowernumber'} / $itemnumber "; + MarkIssueReturned($issues->{borrowernumber},$itemnumber); + } + $sth->finish; +} + + +1; __END__ diff --git a/C4/Items.pm b/C4/Items.pm index bc36dd1..9e7167d 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -397,6 +397,8 @@ Note that only columns that can be directly changed from the cataloging and serials item editors are included in this hash. +Returns item record + =cut my %default_values_for_mod_from_marc = ( @@ -446,7 +448,8 @@ sub ModItemFromMarc { } my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode ); - return ModItem($item, $biblionumber, $itemnumber, $dbh, $frameworkcode, $unlinked_item_subfields); + ModItem($item, $biblionumber, $itemnumber, $dbh, $frameworkcode, $unlinked_item_subfields); + return $item; } =head2 ModItem @@ -495,6 +498,9 @@ sub ModItem { }; $item->{'itemnumber'} = $itemnumber or return undef; + + $item->{onloan} = undef if $item->{itemlost}; + _set_derived_columns_for_mod($item); _do_column_fixes_for_mod($item); # FIXME add checks diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl index e8ce20d..8bdc74f 100755 --- a/catalogue/updateitem.pl +++ b/catalogue/updateitem.pl @@ -26,7 +26,6 @@ use C4::Biblio; use C4::Items; use C4::Output; use C4::Circulation; -use C4::Accounts; use C4::Reserves; my $cgi= new CGI; @@ -75,6 +74,6 @@ if (defined $itemnotes) { # i.e., itemnotes parameter passed from form ModItem($item_changes, $biblionumber, $itemnumber); -C4::Accounts::chargelostitem($itemnumber) if ($itemlost==1) ; +LostItem($itemnumber) if ($itemlost==1) ; print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber"); diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 0db2d2d..0d591c7 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -26,6 +26,7 @@ use C4::Auth; use C4::Output; use C4::Biblio; use C4::Items; +use C4::Circulation; use C4::Context; use C4::Koha; # XXX subfield_is_koha_internal_p use C4::Branch; # XXX subfield_is_koha_internal_p @@ -498,7 +499,9 @@ if ($op eq "additem") { if ($exist_itemnumber && $exist_itemnumber != $itemnumber) { push @errors,"barcode_not_unique"; } else { - my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = ModItemFromMarc($itemtosave,$biblionumber,$itemnumber); + if ( my $item = ModItemFromMarc($itemtosave,$biblionumber,$itemnumber) ) { + LostItem($itemnumber) if $item->{itemlost} == 1; + } $itemnumber=""; } $nextop="additem"; diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index 651b9d2..2179d10 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -35,7 +35,6 @@ BEGIN { } use C4::Context; use C4::Items; -use C4::Accounts; use Getopt::Long; my $lost; # key=lost value, value=num days. @@ -155,7 +154,7 @@ foreach my $startrange (sort keys %$lost) { printf ("Due %s: item %5s from borrower %5s to lost: %s\n", $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue) if($verbose); if($confirm) { ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'}); - chargelostitem($row->{'itemnumber'}) if( $charge && $charge eq $lostvalue); + LostItem($row->{'itemnumber'}) if( $charge && $charge eq $lostvalue); } $count++; } diff --git a/t/db_dependent/lib/KohaTest/Accounts.pm b/t/db_dependent/lib/KohaTest/Accounts.pm index 703d478..ac3a78e 100644 --- a/t/db_dependent/lib/KohaTest/Accounts.pm +++ b/t/db_dependent/lib/KohaTest/Accounts.pm @@ -15,7 +15,6 @@ sub methods : Test( 1 ) { my @methods = qw( recordpayment makepayment getnextacctno - returnlost manualinvoice fixcredit refund diff --git a/t/db_dependent/lib/KohaTest/Circulation.pm b/t/db_dependent/lib/KohaTest/Circulation.pm index 7d5e69d..b3a1ff8 100644 --- a/t/db_dependent/lib/KohaTest/Circulation.pm +++ b/t/db_dependent/lib/KohaTest/Circulation.pm @@ -47,6 +47,7 @@ sub methods : Test( 1 ) { CheckSpecialHolidays CheckRepeatableSpecialHolidays CheckValidBarcode + ReturnLostItem ); can_ok( $self->testing_class, @methods ); diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 9d4431b..f6d58a8 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -25,6 +25,7 @@ use C4::Auth; use C4::Output; use C4::Biblio; use C4::Items; +use C4::Circulation; use C4::Context; use C4::Koha; # XXX subfield_is_koha_internal_p use C4::Branch; # XXX subfield_is_koha_internal_p @@ -173,7 +174,11 @@ if ($op eq "action") { if ($values_to_modify || $values_to_blank) { my $localmarcitem = Item2Marc($itemdata); UpdateMarcWith( $marcitem, $localmarcitem ); - eval{ my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) }; + eval{ + if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) { + LostItem($itemnumber) if $item->{itemlost} == 1; + } + }; } } $i++; -- 1.6.5 From robin at catalyst.net.nz Mon Sep 12 06:30:30 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Mon, 12 Sep 2011 16:30:30 +1200 Subject: [Koha-patches] [PATCH] Bug 6496 - correct the order of the author display in the OPAC Message-ID: <1315801830-23671-1-git-send-email-robin@catalyst.net.nz> This sets the order to be 100,110,111,700,710,711, rather than 100,700,110,710,... like it was. Basically, it's a port of the way it's done in the staff client. As such, it should be able to handle a lot more than it could previously, including relator codes. --- .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 112 +++++++++---------- 1 files changed, 53 insertions(+), 59 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl index 8fe0cf7..91d0e95 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -128,66 +128,14 @@ </xsl:if> <xsl:choose> - <xsl:when test="marc:datafield[@tag=100] or marc:datafield[@tag=110] or marc:datafield[@tag=111] or marc:datafield[@tag=700] or marc:datafield[@tag=710] or marc:datafield[@tag=711]"> - <h5 class="author">by - <xsl:for-each select="marc:datafield[@tag=100 or @tag=700]"> - <a> - <xsl:choose> - <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> - <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> - </xsl:when> - <xsl:otherwise> - <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute> - </xsl:otherwise> - </xsl:choose> - <xsl:call-template name="nameABCDQ"/></a> - <xsl:choose> - <xsl:when test="position()!=last()"><xsl:text>; </xsl:text></xsl:when></xsl:choose> - </xsl:for-each> - - <xsl:for-each select="marc:datafield[@tag=110 or @tag=710]"> - <xsl:choose> - <xsl:when test="position()=1"> - <xsl:text>; </xsl:text> - </xsl:when> - </xsl:choose> - <a> - <xsl:choose> - <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> - <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> + <xsl:when test="marc:datafield[@tag=100] or marc:datafield[@tag=110] or marc:datafield[@tag=111] or marc:datafield[@tag=700] or marc:datafield[@tag=710] or marc:datafield[@tag=711]"> + <h5 class="author">by + <xsl:call-template name="showAuthor"> + <xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111 or @tag=700 or @tag=710 or @tag=711]"/> + <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/> + </xsl:call-template> + </h5> </xsl:when> - <xsl:otherwise> - <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute> - </xsl:otherwise> - </xsl:choose> - <xsl:call-template name="nameABCDN"/></a> - <xsl:choose><xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose> - </xsl:for-each> - - <xsl:for-each select="marc:datafield[@tag=111 or @tag=711]"> - <xsl:choose> - <xsl:when test="marc:subfield[@code='n']"> - <xsl:text> </xsl:text> - <xsl:call-template name="subfieldSelect"> - <xsl:with-param name="codes">n</xsl:with-param> </xsl:call-template> - <xsl:text> </xsl:text> - </xsl:when> - </xsl:choose> - <a> - <xsl:choose> - <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> - <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> - </xsl:when> - <xsl:otherwise> - <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute> - </xsl:otherwise> - </xsl:choose> - <xsl:call-template name="nameACDEQ"/></a> - <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose> - - </xsl:for-each> - </h5> - </xsl:when> </xsl:choose> <xsl:if test="$DisplayOPACiconsXSLT!='0'"> @@ -882,6 +830,52 @@ </xsl:template> + <!-- The next three templates are for displaying a the author related + fields. --> + + <xsl:template name="showAuthor"> + <xsl:param name="authorfield" /> + <xsl:param name="UseAuthoritiesForTracings" /> + <xsl:for-each select="$authorfield"> + <xsl:choose><xsl:when test="position()!=1"><xsl:text>; </xsl:text></xsl:when></xsl:choose> + <xsl:choose> + <xsl:when test="not(@tag=111 or @tag=711)" /> + <xsl:when test="marc:subfield[@code='n']"> + <xsl:text> </xsl:text> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">n</xsl:with-param> + </xsl:call-template> + <xsl:text> </xsl:text> + </xsl:when> + </xsl:choose> + <a> + <xsl:choose> + <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> + <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute> + </xsl:otherwise> + </xsl:choose> + <xsl:choose> + <xsl:when test="@tag=100 or @tag=700"><xsl:call-template name="nameABCDQ"/></xsl:when> + <xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when> + <xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when> + </xsl:choose> + <!-- add relator code too between brackets--> + <xsl:if test="marc:subfield[@code='4' or @code='e']"> + <xsl:text>[</xsl:text> + <xsl:choose> + <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when> + <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise> + </xsl:choose> + <xsl:text>]</xsl:text> + </xsl:if> + </a> + </xsl:for-each> + <xsl:text>.</xsl:text> + </xsl:template> + <xsl:template name="nameABCDQ"> <xsl:call-template name="chopPunctuation"> <xsl:with-param name="chopString"> -- 1.7.4.1 From mtj at kohaaloha.com Mon Sep 12 08:14:35 2011 From: mtj at kohaaloha.com (Mason James) Date: Mon, 12 Sep 2011 18:14:35 +1200 Subject: [Koha-patches] [PATCH] Bug 6636 - add 'powered by Koha' text to OPAC footer Message-ID: <1315808075-18776-1-git-send-email-mtj@kohaaloha.com> --- C4/Auth.pm | 1 + installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 ++++++ .../prog/en/modules/admin/preferences/opac.pref | 7 ++++++ koha-tmpl/opac-tmpl/prog/en/css/opac.css | 14 +++++++++++- .../opac-tmpl/prog/en/includes/opac-bottom.inc | 23 +++++++++++++------- 6 files changed, 44 insertions(+), 9 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 495f04c..4fe9ecd 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -435,6 +435,7 @@ sub get_template_and_user { opac_limit_override => $opac_limit_override, OpacBrowser => C4::Context->preference("OpacBrowser"), OpacCloud => C4::Context->preference("OpacCloud"), + OpacKohaUrl => C4::Context->preference("OpacKohaUrl"), OpacMainUserBlock => "" . C4::Context->preference("OpacMainUserBlock"), OpacNav => "" . C4::Context->preference("OpacNav"), OpacPasswordChange => C4::Context->preference("OpacPasswordChange"), diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 79d4893..1b40d2d 100755 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -318,3 +318,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6b88c29..cccf88f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4446,6 +4446,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(qq|INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','0',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL)|); + print "Upgrade to $DBversion done (Add syspref 'OpacKohaUrl')\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 8bbf692..8d6974e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -86,6 +86,13 @@ OPAC: no: "Don't show" - the name of the patron that has an item checked out on item detail pages on the OPAC. - + - pref: OpacKohaUrl + default: 0 + choices: + yes: Show + no: "Don't show" + - "'Powered by Koha' text on OPAC footer." + - - pref: OpacHighlightedWords choices: yes: Highlight diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 60afea7..e9e03ff 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -2038,4 +2038,16 @@ div.bibmessage { background-color : #ffffb0; border-radius : 5px; padding : 3px; #renewall_link { background-image : url(../../images/checks.png); -} \ No newline at end of file +} + +div.koha_url { + border-top: none !important; +} +span.koha_url { + position: absolute; + right: 0; +} +a.koha_url { + text-decoration:none; + color: #666666; +} diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc index c76d85c..a5ad55f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc @@ -1,14 +1,15 @@ - [% IF ( opaccredits ) %] <div class="ft"> [% opaccredits %] </div> [% END %] </div> -[% IF ( opaclanguagesdisplay ) %] -[% IF ( languages_loop ) %] + +[% IF opaclanguagesdisplay || OpacKohaUrl %] +<div id="changelanguage" class="ft"> +[% IF languages_loop && opaclanguagesdisplay %] [% UNLESS ( one_language_enabled ) %] - <div id="changelanguage" class="ft"><strong>Languages: </strong> + <strong>Languages: </strong> [% FOREACH languages_loo IN languages_loop %] [% IF ( languages_loo.group_enabled ) %] [% IF ( languages_loo.plural ) %] @@ -22,14 +23,13 @@ [% ELSE %] <li><a href="/cgi-bin/koha/opac-changelanguage.pl?language=[% sublanguages_loo.rfc4646_subtag %]"> [% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] ([% sublanguages_loo.rfc4646_subtag %])</a></li> [% END %] - [% END %] + [% END %] [% END %] </ul> </div> </div> - [% ELSE %] - [% IF ( languages_loo.group_enabled ) %] + [% IF ( languages_loo.group_enabled ) %] [% IF ( languages_loo.current ) %] [% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %] [% ELSE %] @@ -39,9 +39,16 @@ [% END %] [% END %][% UNLESS ( loop.last ) %] | [% END %] [% END %] - </div> [% END %] [% END %] + +[% IF ( OpacKohaUrl ) %] + <span class="koha_url"> + <a class="koha_url" href="http://koha-community.org">Powered by <strong>Koha</strong></a>   + </span> +[% END %] + +</div> [% END %] [% IF ( Babeltheque ) %] -- 1.7.1 From f.demians at tamil.fr Sun Sep 11 11:14:07 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Sun, 11 Sep 2011 11:14:07 +0200 Subject: [Koha-patches] [PATCH] Bug 6825 OpacNav menu hide user menu on opac-user.pl page Message-ID: <1315732447-5849-1-git-send-email-f.demians@tamil.fr> This patch add a new syspref OpacNavBottom which is placed on all pages after OpacNav. On Patron pages, specif patron links are placed between OpacNav and OpacNavBottom, like this: OpacNav Patron links OpacNavBottom To test: 1 Apply this patch 2 For RM, modify kohaversion.pl and updatedatabase.pl appropriately 3 Test that OPAC pages are displayed as before, OpacNav on the left 4 Test OPAC patron pages: OpacNav is as before displayed after patron links 5 Split OpacNav between itself and OpacNavBottom 6 Patron pages display patron links between OpacNav and OpacNavBottom --- C4/Auth.pm | 2 ++ installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 8 ++++++++ .../prog/en/modules/admin/preferences/opac.pref | 5 +++++ .../opac-tmpl/prog/en/includes/navigation.inc | 7 ++++++- .../opac-tmpl/prog/en/modules/opac-account.tt | 3 +-- .../opac-tmpl/prog/en/modules/opac-messaging.tt | 3 +-- koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt | 3 +-- .../opac-tmpl/prog/en/modules/opac-privacy.tt | 3 +-- .../prog/en/modules/opac-readingrecord.tt | 3 +-- .../prog/en/modules/opac-search-history.tt | 6 ++---- .../opac-tmpl/prog/en/modules/opac-shelves.tt | 3 +-- .../opac-tmpl/prog/en/modules/opac-suggestions.tt | 3 +-- koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt | 3 +-- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 3 +-- .../opac-tmpl/prog/en/modules/opac-userupdate.tt | 3 +-- 16 files changed, 34 insertions(+), 25 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 495f04c..6ec71a3 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -437,6 +437,7 @@ sub get_template_and_user { OpacCloud => C4::Context->preference("OpacCloud"), OpacMainUserBlock => "" . C4::Context->preference("OpacMainUserBlock"), OpacNav => "" . C4::Context->preference("OpacNav"), + OpacNavBottom => "" . C4::Context->preference("OpacNavBottom"), OpacPasswordChange => C4::Context->preference("OpacPasswordChange"), OPACPatronDetails => C4::Context->preference("OPACPatronDetails"), OPACPrivacy => C4::Context->preference("OPACPrivacy"), @@ -956,6 +957,7 @@ sub checkauth { LibraryName => C4::Context->preference("LibraryName"), opacuserlogin => C4::Context->preference("opacuserlogin"), OpacNav => C4::Context->preference("OpacNav"), + OpacNavBottom => C4::Context->preference("OpacNavBottom"), opaccredits => C4::Context->preference("opaccredits"), OpacFavicon => C4::Context->preference("OpacFavicon"), opacreadinghistory => C4::Context->preference("opacreadinghistory"), diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 79d4893..3e80d5c 100755 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -81,6 +81,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMaintenance',0,'If ON, enables maintenance warning in OPAC','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMainUserBlock','Welcome to Koha...\r\n<hr>','A user-defined block of HTML in the main content area of the opac main page','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNav','Important links here.','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','70|10','Textarea'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNavBottom','Important links here.','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACNoResultsFound','','Display this HTML when no results are found for a search in the OPAC','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6b88c29..cf21e6d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4447,6 +4447,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { } +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNavBottom','','Links after OpacNav links','70|10','Textarea')"); + print "Upgrade to $DBversion done (add OpacNavBottom syspref (enh 6825): if appropriate, you can split OpacNav into OpacNav and OpacNavBottom)\n"; + SetVersion($DBversion); +} + + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 8bbf692..032c85a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -143,6 +143,11 @@ OPAC: type: textarea class: code - + - "Show the following HTML on the left hand column of the main page and patron account on the OPAC, after OpacNav, and before patron account links if available:" + - pref: OpacNavBottom + type: textarea + class: code + - - "Include the following HTML in the header of all pages in the OPAC:" - pref: opacheader type: textarea diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc b/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc index 637ed33..9cd2c12 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc @@ -1 +1,6 @@ -[% OpacNav %] \ No newline at end of file +[% OpacNav %] +[% IF IsPatronPage %] +[% INCLUDE usermenu.inc %] +[% END %] +[% OpacNavBottom %] + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt index eed66d3..b28fd08 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt @@ -54,8 +54,7 @@ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt index ebb1e26..e456f0f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt @@ -115,8 +115,7 @@ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt index 16c4532..1f3025a 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt @@ -54,8 +54,7 @@ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt index de34e02..b1c4d1f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt @@ -64,8 +64,7 @@ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt index 683a5bd..bedae0a 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt @@ -95,8 +95,7 @@ You have never borrowed anything from this library. </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt index e9f6be1..6c2cd82 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt @@ -82,13 +82,11 @@ [% IF ( OpacNav ) %] <div class="yui-b"><div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div></div> [% ELSIF ( loggedinusername ) %] <div class="yui-b"><div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div></div> [% ELSE %] [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt index c50cfb1..aa10dae 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt @@ -601,8 +601,7 @@ $(function() { [% IF ( OpacNav||loggedinusername ) %] <div class="yui-b"> <div is="leftmenus" class="container"> - [% INCLUDE 'navigation.inc' %] - [% INCLUDE 'usermenu.inc' %] + [% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt index 3f3aa34..d8757bb 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt @@ -212,8 +212,7 @@ $.tablesorter.addParser({ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt index e99d201..e93e00a 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt @@ -131,8 +131,7 @@ </div> [% IF ( OpacNav||loggedinusername ) %] <div class="yui-b"><div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div></div> [% END %] </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt index 9ba6c05..d9417ec 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -423,8 +423,7 @@ $.tablesorter.addParser({ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt index db5f7f5..58f4d2d 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt @@ -180,8 +180,7 @@ </div> <div class="yui-b"> <div id="leftmenus" class="container"> -[% INCLUDE 'navigation.inc' %] -[% INCLUDE 'usermenu.inc' %] +[% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> </div> </div> -- 1.7.6.1 From srdjan at catalyst.net.nz Mon Sep 12 11:13:26 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Mon, 12 Sep 2011 21:13:26 +1200 Subject: [Koha-patches] [PATCH] bug_6576: Submit when changing framework rather then reloading In-Reply-To: <bug 6576> References: <bug 6576> Message-ID: <1315818806-6187-1-git-send-email-srdjan@catalyst.net.nz> TransformHtmlToMarc(): changed interface - no point passing params when they can be accessed from $cgi --- C4/Biblio.pm | 34 ++++++++++---------- authorities/authorities.pl | 3 +- cataloguing/addbiblio.pl | 21 +++++++----- cataloguing/merge.pl | 3 +- .../prog/en/modules/cataloguing/addbiblio.tt | 8 ++-- 5 files changed, 36 insertions(+), 33 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 96baaef..915139e 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1989,8 +1989,8 @@ sub _default_ind_to_space { =head2 TransformHtmlToMarc - L<$record> = TransformHtmlToMarc(L<$params>,L<$cgi>) - L<$params> is a ref to an array as below: + L<$record> = TransformHtmlToMarc(L<$cgi>) + L<$cgi> is the CGI object which containts the values for subfields { 'tag_010_indicator1_531951' , 'tag_010_indicator2_531951' , @@ -2007,15 +2007,15 @@ sub _default_ind_to_space { 'tag_200_code_f_873510_110730' , 'tag_200_subfield_f_873510_110730' , } - L<$cgi> is the CGI object which containts the value. L<$record> is the MARC::Record object. =cut sub TransformHtmlToMarc { - my $params = shift; my $cgi = shift; + my @params = $cgi->param(); + # explicitly turn on the UTF-8 flag for all # 'tag_' parameters to avoid incorrect character # conversion later on @@ -2035,8 +2035,8 @@ sub TransformHtmlToMarc { my $record = MARC::Record->new(); my $i = 0; my @fields; - while ( $params->[$i] ) { # browse all CGI params - my $param = $params->[$i]; + while ( $params[$i] ) { # browse all CGI params + my $param = $params[$i]; my $newfield = 0; # if we are on biblionumber, store it in the MARC::Record (it may not be in the edited fields) @@ -2052,7 +2052,7 @@ sub TransformHtmlToMarc { my $tag = $1; my $ind1 = _default_ind_to_space( substr( $cgi->param($param), 0, 1 ) ); - my $ind2 = _default_ind_to_space( substr( $cgi->param( $params->[ $i + 1 ] ), 0, 1 ) ); + my $ind2 = _default_ind_to_space( substr( $cgi->param( $params[ $i + 1 ] ), 0, 1 ) ); $newfield = 0; my $j = $i + 2; @@ -2062,27 +2062,27 @@ sub TransformHtmlToMarc { # Force a fake leader even if not provided to avoid crashing # during decoding MARC record containing UTF-8 characters $record->leader( - length( $cgi->param($params->[$j+1]) ) == 24 - ? $cgi->param( $params->[ $j + 1 ] ) + length( $cgi->param($params[$j+1]) ) == 24 + ? $cgi->param( $params[ $j + 1 ] ) : ' nam a22 4500' ) ; # between 001 and 009 (included) - } elsif ( $cgi->param( $params->[ $j + 1 ] ) ne '' ) { - $newfield = MARC::Field->new( $tag, $cgi->param( $params->[ $j + 1 ] ), ); + } elsif ( $cgi->param( $params[ $j + 1 ] ) ne '' ) { + $newfield = MARC::Field->new( $tag, $cgi->param( $params[ $j + 1 ] ), ); } # > 009, deal with subfields } else { - while ( defined $params->[$j] && $params->[$j] =~ /_code_/ ) { # browse all it's subfield - my $inner_param = $params->[$j]; + while ( defined $params[$j] && $params[$j] =~ /_code_/ ) { # browse all it's subfield + my $inner_param = $params[$j]; if ($newfield) { - if ( $cgi->param( $params->[ $j + 1 ] ) ne '' ) { # only if there is a value (code => value) - $newfield->add_subfields( $cgi->param($inner_param) => $cgi->param( $params->[ $j + 1 ] ) ); + if ( $cgi->param( $params[ $j + 1 ] ) ne '' ) { # only if there is a value (code => value) + $newfield->add_subfields( $cgi->param($inner_param) => $cgi->param( $params[ $j + 1 ] ) ); } } else { - if ( $cgi->param( $params->[ $j + 1 ] ) ne '' ) { # creating only if there is a value (code => value) - $newfield = MARC::Field->new( $tag, $ind1, $ind2, $cgi->param($inner_param) => $cgi->param( $params->[ $j + 1 ] ), ); + if ( $cgi->param( $params[ $j + 1 ] ) ne '' ) { # creating only if there is a value (code => value) + $newfield = MARC::Field->new( $tag, $ind1, $ind2, $cgi->param($inner_param) => $cgi->param( $params[ $j + 1 ] ), ); } } $j += 2; diff --git a/authorities/authorities.pl b/authorities/authorities.pl index d4f1601..2e18332 100755 --- a/authorities/authorities.pl +++ b/authorities/authorities.pl @@ -581,8 +581,7 @@ if ($op eq "add") { # build indicator hash. my @ind_tag = $input->param('ind_tag'); my @indicator = $input->param('indicator'); - my @params = $input->param(); - my $record = TransformHtmlToMarc(\@params,$input); + my $record = TransformHtmlToMarc($input); if (C4::Context->preference("marcflavour") eq "UNIMARC"){ unless ($record->field('100')){ use POSIX qw(strftime); diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 637d82d..2851c83 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -931,7 +931,7 @@ if ( $op eq "addbiblio" ) { ); # getting html input my @params = $input->param(); - $record = TransformHtmlToMarc( \@params , $input ); + $record = TransformHtmlToMarc( $input ); # check for a duplicate my ( $duplicatebiblionumber, $duplicatetitle ); if ( !$is_a_modif ) { @@ -1037,14 +1037,19 @@ elsif ( $op eq "delete" ) { $biblionumber = ""; } + if ( $record eq -1 ) { + $record = TransformHtmlToMarc( $input ); + } + else { #FIXME: it's kind of silly to go from MARC::Record to MARC::File::XML and then back again just to fix the encoding - eval { - my $uxml = $record->as_xml; - MARC::Record::default_record_format("UNIMARC") - if ( C4::Context->preference("marcflavour") eq "UNIMARC" ); - my $urecord = MARC::Record::new_from_xml( $uxml, 'UTF-8' ); - $record = $urecord; - }; + eval { + my $uxml = $record->as_xml; + MARC::Record::default_record_format("UNIMARC") + if ( C4::Context->preference("marcflavour") eq "UNIMARC" ); + my $urecord = MARC::Record::new_from_xml( $uxml, 'UTF-8' ); + $record = $urecord; + }; + } build_tabs( $template, $record, $dbh, $encoding,$input ); $template->param( biblionumber => $biblionumber, diff --git a/cataloguing/merge.pl b/cataloguing/merge.pl index cc2d01d..c97ca7a 100755 --- a/cataloguing/merge.pl +++ b/cataloguing/merge.pl @@ -48,12 +48,11 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( #------------------------ if ($merge) { - my @params = $input->param(); my $dbh = C4::Context->dbh; my $sth; # Creating a new record from the html code - my $record = TransformHtmlToMarc( \@params , $input ); + my $record = TransformHtmlToMarc( $input ); my $tobiblio = $input->param('biblio1'); my $frombiblio = $input->param('biblio2'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 37e6212..45d4784 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -254,9 +254,9 @@ function GetZ3950Terms(){ } function Changefwk(FwkList) { - var fwk = FwkList.options[FwkList.selectedIndex].value; - window.location = "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumberdata %]&op=[% op %]&breedingid=[% breedingid %]&mode=[% popup %]&frameworkcode="+fwk; - + var f = document.f; + f.op.value = ""; + f.submit(); } // returns the subfieldcode based upon subfieldid writing @@ -776,7 +776,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? <li id="savebutton"><input id="addbiblio" type="submit" value="Save" /></li> <li id="z3950searchc"><input type="button" id="z3950search" value="Z39.50 Search" onclick="PopupZ3950(); return false;" /></li> <li id="changeframework"><label for="Frameworks">Change framework: </label> - <select name="Frameworks" id="Frameworks" onchange="Changefwk(this);"> + <select name="frameworkcode" id="Frameworks" onchange="Changefwk(this);"> <option value="Default">Default</option> [% FOREACH frameworkcodeloo IN frameworkcodeloop %] <option value="[% frameworkcodeloo.value %]" [% frameworkcodeloo.selected %]> -- 1.6.5 From cnighswonger at foundations.edu Mon Sep 12 15:32:12 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Mon, 12 Sep 2011 09:32:12 -0400 Subject: [Koha-patches] [PATCH] Bug 6722: Cause build output to appear on the screen In-Reply-To: <1315782986.13770.195.camel@zarathud> References: <1313385599-25436-1-git-send-email-robin@catalyst.net.nz> <CAP3yOomUzcMrojs2ZRbVmfTyBmW5Q=19+Mx0jO+b9guL9_7-Fw@mail.gmail.com> <20110905012037.GP23576@rorohiko.wgtn.cat-it.co.nz> <CAP3yOon2g1m7LJP9xhJp5fTKObEnj2CULkisJUp2HEHzh+ktsg@mail.gmail.com> <1315782986.13770.195.camel@zarathud> Message-ID: <CAP3yOonw6oyMdy_54ez_=SEbVvof6d42NdQsaVZqobppAKDCSg@mail.gmail.com> On Sun, Sep 11, 2011 at 7:16 PM, Robin Sheat <robin at catalyst.net.nz> wrote: > Chris Nighswonger schreef op vr 09-09-2011 om 22:11 [-0400]: > > 6722 does not apply cleanly to 3.4.x either. I'm not sure where the > > divergence occurred. Perhaps I'm missing a still earlier commit? > > Try the one newly attached to Bug 5602, that avoids all the patchy stuff > and just brings the build script up to master. > Got it. Thanks, Robin! -------------- next part -------------- An HTML attachment was scrubbed... URL: </pipermail/koha-patches/attachments/20110912/6dab567e/attachment.htm> From lrea at nekls.org Mon Sep 12 17:03:35 2011 From: lrea at nekls.org (Liz Rea) Date: Mon, 12 Sep 2011 10:03:35 -0500 Subject: [Koha-patches] [PATCH] Bug 3498 Allow Partial Payment of Fines Message-ID: <1315839815-10675-1-git-send-email-lrea@nekls.org> From: Colin Campbell <colin.campbell at ptfs-europe.com> Allow partial payment of outstanding fines against either individual fine entries or as a lump payment Sponsered by East Brunswick Public Library, East Brunswick, NJ, USA NB: Adds a version of the include circ-menu.inc as circ-menu.tt this has the same functionality as the old include but does not require all the borrowers attributes to be passed as global scoped variables Signed-off-by: Liz Rea <lrea at nekls.org> Bug 3498 - Documentation update to explain what every button does. Help file updated to the following: Pay and Writeoff Fines Each line item can be paid in full, partially paid, or written off. Pay a fine in full Click "Pay" next to the fine you want to pay in full The full amount of the fine will be populated for you in the "Collect From Patron" box Click "Confirm" The fine will be removed from outstanding fines, and displayed as fully paid. Pay a partial fine Click "Pay" next to the fine you want to partially pay Enter the amount you are collecting from the patron in the "Collect From Patron" box Click "Confirm" The fine will be updated to show the original Amount, and the current Amount Outstanding Writeoff a single fine Click "Writeoff" next to the fine you wish to writeoff. The fine will be removed from outstanding fines, and displayed as fully paid. Pay an amount towards all fines Click the "Pay Amount" button Enter the amount you are collecting from the patron in "Collect from Patron." The sum of all fines is shown in "Total Amount Outstanding" Click "Confirm" The fine totals will be updated with the payment applied to oldest fines first. Writeoff All fines Click the "Writeoff All" button All fines will be removed from outstanding fines, and displayed as written off. Pay Selected fines Check the selection boxes next to the fines you wish to pay, click "Pay Selected" Enter an amount to pay towards the fines. Click "Confirm" The fine totals will be updated with the payment applied to the oldest selected fines first. Bug 3498 - adding parens to TT IF Statements for style pay.tt Bug 3498 - Add parens to TT IF statements for style paycollect.tt --- C4/Accounts.pm | 113 ++++++- .../intranet-tmpl/prog/en/includes/circ-menu.tt | 73 ++++ .../prog/en/modules/help/members/pay.tt | 51 +++- .../intranet-tmpl/prog/en/modules/members/pay.tt | 102 +++--- .../prog/en/modules/members/paycollect.tt | 227 ++++++++++++ members/pay.pl | 361 +++++++++++--------- members/paycollect.pl | 171 +++++++++ 7 files changed, 878 insertions(+), 220 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt create mode 100755 members/paycollect.pl diff --git a/C4/Accounts.pm b/C4/Accounts.pm index eea142c..2352e9e 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -38,7 +38,9 @@ BEGIN { &getnextacctno &reconcileaccount &getcharges &ModNote &getcredits &getrefunds &chargelostitem &ReversePayment - ); # removed &fixaccounts + makepartialpayment + recordpayment_selectaccts + ); } =head1 NAME @@ -369,7 +371,6 @@ sub manualinvoice { my $dbh = C4::Context->dbh; my $notifyid = 0; my $insert; - $itemnum =~ s/ //g; my $accountno = getnextacctno($borrowernumber); my $amountleft = $amount; @@ -413,12 +414,12 @@ sub manualinvoice { $notifyid = 1; } - if ( $itemnum ne '' ) { - $desc .= " " . $itemnum; + if ( $itemnum ) { + $desc .= ' ' . $itemnum; my $sth = $dbh->prepare( - "INSERT INTO accountlines + 'INSERT INTO accountlines (borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding, itemnumber,notify_id, note, manager_id) - VALUES (?, ?, now(), ?,?, ?,?,?,?,?,?)"); + VALUES (?, ?, now(), ?,?, ?,?,?,?,?,?)'); $sth->execute($borrowernumber, $accountno, $amount, $desc, $type, $amountleft, $itemnum,$notifyid, $note, $manager_id) || return $sth->errstr; } else { my $sth=$dbh->prepare("INSERT INTO accountlines @@ -686,6 +687,106 @@ sub ReversePayment { } } +=head2 recordpayment_selectaccts + + recordpayment_selectaccts($borrowernumber, $payment,$accts); + +Record payment by a patron. C<$borrowernumber> is the patron's +borrower number. C<$payment> is a floating-point number, giving the +amount that was paid. C<$accts> is an array ref to a list of +accountnos which the payment can be recorded against + +Amounts owed are paid off oldest first. That is, if the patron has a +$1 fine from Feb. 1, another $1 fine from Mar. 1, and makes a payment +of $1.50, then the oldest fine will be paid off in full, and $0.50 +will be credited to the next one. + +=cut + +sub recordpayment_selectaccts { + my ( $borrowernumber, $amount, $accts ) = @_; + + my $dbh = C4::Context->dbh; + my $newamtos = 0; + my $accdata = q{}; + my $branch = C4::Context->userenv->{branch}; + my $amountleft = $amount; + my $sql = 'SELECT * FROM accountlines WHERE (borrowernumber = ?) ' . + 'AND (amountoutstanding<>0) '; + if (@{$accts} ) { + $sql .= ' AND accountno IN ( ' . join ',', @{$accts}; + $sql .= ' ) '; + } + $sql .= ' ORDER BY date'; + # begin transaction + my $nextaccntno = getnextacctno($borrowernumber); + + # get lines with outstanding amounts to offset + my $rows = $dbh->selectall_arrayref($sql, { Slice => {} }, $borrowernumber); + + # offset transactions + my $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding= ? ' . + 'WHERE (borrowernumber = ?) AND (accountno=?)'); + for my $accdata ( @{$rows} ) { + if ($amountleft == 0) { + last; + } + if ( $accdata->{amountoutstanding} < $amountleft ) { + $newamtos = 0; + $amountleft -= $accdata->{amountoutstanding}; + } + else { + $newamtos = $accdata->{amountoutstanding} - $amountleft; + $amountleft = 0; + } + my $thisacct = $accdata->{accountno}; + $sth->execute( $newamtos, $borrowernumber, $thisacct ); + } + + # create new line + $sql = 'INSERT INTO accountlines ' . + '(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding) ' . + q|VALUES (?,?,now(),?,'Payment,thanks','Pay',?)|; + $dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft ); + UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno ); + return; +} + +# makepayment needs to be fixed to handle partials till then this separate subroutine +# fills in +sub makepartialpayment { + my ( $borrowernumber, $accountno, $amount, $user, $branch ) = @_; + if (!$amount || $amount < 0) { + return; + } + my $dbh = C4::Context->dbh; + + my $nextaccntno = getnextacctno($borrowernumber); + my $newamtos = 0; + + my $data = $dbh->selectrow_hashref( + 'SELECT * FROM accountlines WHERE borrowernumber=? AND accountno=?',undef,$borrowernumber,$accountno); + my $new_outstanding = $data->{amountoutstanding} - $amount; + + my $update = 'UPDATE accountlines SET amountoutstanding = ? WHERE borrowernumber = ? ' + . ' AND accountno = ?'; + $dbh->do( $update, undef, $new_outstanding, $borrowernumber, $accountno); + + # create new line + my $insert = 'INSERT INTO accountlines (borrowernumber, accountno, date, amount, ' + . 'description, accounttype, amountoutstanding) ' + . ' VALUES (?, ?, now(), ?, ?, ?, 0)'; + + $dbh->do( $insert, undef, $borrowernumber, $nextaccntno, $amount, + "Payment, thanks - $user", 'Pay'); + + UpdateStats( $user, 'payment', $amount, '', '', '', $borrowernumber, $accountno ); + + return; +} + + + END { } # module clean-up code here (global destructor) 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt new file mode 100644 index 0000000..39be1be --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt @@ -0,0 +1,73 @@ +[%# duplicates circ-menu.inc but assumes all borrower attributes are in a borrower variable rather than +in the global namespace %] +[% IF borrower %] +<div class="patroninfo"><h5>[% borrower.firstname %] [% borrower.surname %] ([% borrower.cardnumber %])</h5> +<!--[if IE 6]> +<style type="tex/css">img { width: expression(this.width > 140 ? 140: true); +}</style> +<![endif]--> +<ul> +[% IF ( patronimages ) %] +[% IF borrower.has_picture %] +<li><img src="/cgi-bin/koha/members/patronimage.pl?crdnum=[% borrower.cardnumber %]" id="patronimage" alt="[% borrower.firstname %] [% borrower.surname %] ([% borrower.cardnumber %])" border="0" style="max-width : 140px; margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC; width:auto !important; width:130px;" /></li> +[% ELSE %] +<li><img src="/intranet-tmpl/prog/img/patron-blank.png" alt="[% borrower.firstname %] [% borrower.surname %] ([% borrower.cardnumber %])" border="0" style="margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC;" /></li> +[% END %] +[% END %] + <li>[% IF borrower.address %] + [% borrower.address %] + [% ELSE %] + <span class="empty">No address stored.</span> + [% END %]</li> + [% IF borrower.address2 %] + <li>[% borrower.address2 %]</li> + [% END %]<li> + [% IF borrower.city %] + [% borrower.city %][% IF borrower.state %], [% borrower.state %][% END %] + [% borrower.zipcode %][% IF ( borrower.country ) %], [% borrower.country %][% END %] + [% ELSE %] + <span class="empty">No city stored.</span> + [% END %]</li> + <li>[% IF borrower.phone %] + [% borrower.phone %] + [% ELSE %] + [% IF borrower.mobile %] + [% borrower.mobile %] + [% ELSE %] + [% IF borrower.phonepro %] + [% borrower.phonepro %] + [% ELSE %] + <span class="empty">No phone stored.</span> + [% END %] + [% END %] + [% END %]</li> + [% IF borrower.email %] + <li class="email"> <a href="mailto:[% borrower.email %]" title="[% borrower.email %]">[% borrower.email %]</a></li> + [% ELSE %] + [% IF borrower.emailpro %] + <li class="email"> <a href="mailto:[% borrower.emailpro %]" title="[% borrower.emailpro %]">[% borrower.emailpro %]</a></li> + [% ELSE %] + <li> <span class="empty">No email stored.</span> </li> + [% END %] + [% END %] + <li>Category: [% borrower.description %] ([% borrower.categorycode %])</li> + <li>Home Library: [% IF ( borrower.branchname ) %][% borrower.branchname %][% ELSE %][% borrower.branch %][% END %]</li> +</ul></div> +<div id="menu"> +<ul> + [% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrower.borrowernumber %]">Check Out</a></li> + [% IF ( CAN_user_borrowers ) %] + [% IF ( detailview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber %]">Details</a></li> + [% END %] + [% IF ( CAN_user_updatecharges ) %] + [% IF ( finesview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Fines</a></li> + [% END %] + [% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrower.borrowernumber %]">Circulation History</a></li>[% END %] + [% IF ( CAN_user_parameters ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&modules=MEMBERS&modules=circulation&object=[% borrower.borrowernumber %]&src=circ">Modification Log</a></li>[% END %] + [% IF ( EnhancedMessagingPreferences ) %] + [% IF ( messagingview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/messaging.pl?borrowernumber=[% borrower.borrowernumber %]">Messaging</a></li> + [% END %] + [% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrower.borrowernumber %]">Notices</a></li> +</ul></div> +[% END %] + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/pay.tt index f8eabfa..e0dbfd0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/pay.tt @@ -1,18 +1,51 @@ [% INCLUDE 'help-top.inc' %] -<h1>Pay/Reverse Fines</h1> +<h1>Pay and Writeoff Fines</h1> -<p>Each line item can be paid in full (or written off) using the 'Pay Fines' tab.</p> +<p>Each line item can be paid in full, partially paid, or written off.</p> +<h4>Pay a fine in full</h4> <ul> - <li>Choose the payment type (Unpaid, Paid, Writeoff) from the pull down menu</li> - <li>Click 'Make Payment'</li> - <li>A line item will be added to the account information showing the fee paid in full (or written off)</li> - <li>If you accidentally mark and item as paid, you can reverse that line item by clicking 'Reverse' to the right of the line + <li>Click "Pay" next to the fine you want to pay in full</li> + <li>The full amount of the fine will be populated for you in the "Collect From Patron" box</li> + <li>Click "Confirm" </li> + <li>The fine will be removed from outstanding fines, and displayed as fully paid.</li> +</ul> + +<h4>Pay a partial fine</h4> +<ul> + <li>Click "Pay" next to the fine you want to partially pay</li> + <li>Enter the amount you are collecting from the patron in the "Collect From Patron" box</li> + <li>Click "Confirm" </li> + <li>The fine will be updated to show the original Amount, and the current Amount Outstanding</li> +</ul> + +<h4>Writeoff a single fine</h4> +<ul> + <li>Click "Writeoff" next to the fine you wish to writeoff.</li> + <li>The fine will be removed from outstanding fines, and displayed as fully paid.</li> +</ul> + +<h4>Pay an amount towards all fines</h4> <ul> - <li>Once clicked a new line item will be added to the account, showing the payment as reversed</li> + <li>Click the "Pay Amount" button</li> + <li>Enter the amount you are collecting from the patron in "Collect from Patron." The sum of all fines is shown in "Total Amount Outstanding"</li> + <li>Click "Confirm"</li> + <li>The fine totals will be updated with the payment applied to oldest fines first.</li> </ul> -</li> + +<h4>Writeoff All fines</h4> +<ul> + <li>Click the "Writeoff All" button</li> + <li>All fines will be removed from outstanding fines, and displayed as written off.</li> +</ul> + +<h4>Pay Selected fines</h4> +<ul> + <li>Check the selection boxes next to the fines you wish to pay, click "Pay Selected"</li> + <li>Enter an amount to pay towards the fines.</li> + <li>Click "Confirm"</li> + <li>The fine totals will be updated with the payment applied to the oldest selected fines first.</li> </ul> -[% INCLUDE 'help-bottom.inc' %] \ No newline at end of file +[% INCLUDE 'help-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt index ddc3d41..6dfd8f9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -1,12 +1,12 @@ [% INCLUDE 'doc-head-open.inc' %] -<title>Koha › Patrons › Pay Fines for [% firstname %] [% surname %] +Koha › Patrons › Pay Fines for [% borrower.firstname %] [% borrower.surname %] [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] - +
    @@ -18,85 +18,91 @@
    -[% IF ( allfile ) %] - +[% IF ( accounts ) %] + +
    ISSNRouting list   
    [% suggestions_loo.title |html %] -
    [% suggestions_loo.author %]
    [% suggestions_loo.name %] [% suggestions_loo.creationdate %] [% suggestions_loo.datereceived %]
    + - - -[% FOREACH allfil IN allfile %] - [% FOREACH loop_pa IN allfil.loop_pay %] + +[% FOREACH account_grp IN accounts %] + [% FOREACH line IN account_grp.accountlines %] - - + - - - - - + + + + + + [% END %] -[% IF ( allfil.total ) %] +[% IF ( account_grp.total ) %] - - + + [% END %] [% END %] - - + +
    Fines & ChargesSel DescriptionNote Account Type Notify id Level Amount Amount Outstanding
    - [% IF ( loop_pa.net_balance ) %] - - [% END %] - - - - - - - - - - [% loop_pa.description %] [% loop_pa.title |html %] - [% IF ( loop_pa.net_balance ) %] - - [% ELSE %] - [% loop_pa.note %] - [% END %] + [% IF ( line.amountoutstanding > 0 ) %] + + + [% END %] + + + + + + + + + + + + [% IF ( line.amountoutstanding > 0 ) %] + + [% END %] [% loop_pa.accounttype %][% loop_pa.notify_id %][% loop_pa.notify_level %][% loop_pa.amount %][% loop_pa.amountoutstanding %][% line.description %] [% line.title |html_entity %][% line.accounttype %][% line.notify_id %][% line.notify_level %][% line.amount | format('%.2f') %][% line.amountoutstanding | format('%.2f') %]
    Sub Total[% allfil.total %]Sub Total:[% account_grp.total | format('%.2f') %]
    Total Due[% total %]Total Due:[% total | format('%.2f') %]
    -
    Cancel
    [% ELSE %]

    [% firstname %] [% surname %] has no outstanding fines.

    [% END %] +
    + + + +Cancel +
    + +[% ELSE %] +

    [% borrower.firstname %] [% borrower.surname %] has no outstanding fines.

    +[% END %]
    -[% INCLUDE 'circ-menu.inc' %] +[% INCLUDE 'circ-menu.tt' %]
    [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt new file mode 100644 index 0000000..08ee909 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt @@ -0,0 +1,227 @@ +[% INCLUDE 'doc-head-open.inc' %] +Koha › Patrons › Collect Fine Payment for [% borrower.firstname %] [% borrower.surname %] +[% INCLUDE 'doc-head-close.inc' %] + + + +[% INCLUDE 'header.inc' %] +[% INCLUDE 'patron-search.inc' %] + + +
    + +
    +
    +
    +[% INCLUDE 'members-toolbar.inc' %] + + + +
    + +
    +[% IF ( error ) %] +
    + [% error %] +
    +[% END %] + +[% IF ( pay_individual ) %] +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    DescriptionAccount TypeNotify idLevelAmountAmount Outstanding
    + [% description %] [% title %] + [% accounttype %][% notify_id %][% notify_level %][% amount | format('%.2f') %][% amountoutstanding | format('%.2f') %]
    Total Amount Payable : [% amountoutstanding | format('%.2f') %]
    Collect From Patron: + + +
    + + Cancel +
    +
    +[% ELSIF ( writeoff_individual ) %] +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    DescriptionAccount TypeNotify idLevelAmountAmount Outstanding
    [% description %] [% title %][% accounttype %][% notify_id %][% notify_level %][% amount | format('%.2f') %][% amountoutstanding | format('%.2f') %]
    Writeoff This Charge?
    + + Cancel +
    +
    +[% ELSE %] + +
    + + + + + + + + + + + + + + + + + + +
    Total Amount Outstanding : [% total | format('%.2f') %]
    Collect From Patron: + + +
    + + Cancel +
    +
    +[% END %] +
    +
    +
    + +
    +[% INCLUDE 'circ-menu.tt' %] +
    +
    +[% INCLUDE 'intranet-bottom.inc' %] + diff --git a/members/pay.pl b/members/pay.pl index 4ecdcc9..555cfd9 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -2,6 +2,7 @@ # Copyright 2000-2002 Katipo Communications # Copyright 2010 BibLibre +# Copyright 2010,2011 PTFS-Europe Ltd # # This file is part of Koha. # @@ -18,7 +19,6 @@ # with Koha; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - =head1 pay.pl written 11/1/2000 by chris at katipo.oc.nz @@ -38,196 +38,243 @@ use C4::Accounts; use C4::Stats; use C4::Koha; use C4::Overdues; -use C4::Branch; # GetBranches +use C4::Branch; -my $input = new CGI; +my $input = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { - template_name => "members/pay.tmpl", + { template_name => 'members/pay.tmpl', query => $input, - type => "intranet", + type => 'intranet', authnotrequired => 0, flagsrequired => { borrowers => 1, updatecharges => 1 }, debug => 1, } ); +my $writeoff_sth; +my $add_writeoff_sth; + +my @names = $input->param; + my $borrowernumber = $input->param('borrowernumber'); -if ( $borrowernumber eq '' ) { +if ( !$borrowernumber ) { $borrowernumber = $input->param('borrowernumber0'); } # get borrower details -my $data = GetMember( borrowernumber => $borrowernumber ); +my $borrower = GetMember( borrowernumber => $borrowernumber ); my $user = $input->remote_user; +$user ||= q{}; -# get account details my $branches = GetBranches(); -my $branch = GetBranch( $input, $branches ); +my $branch = GetBranch( $input, $branches ); -my @names = $input->param; -my %inp; -my $check = 0; -for ( my $i = 0 ; $i < @names ; $i++ ) { - my $temp = $input->param( $names[$i] ); - if ( $temp eq 'wo' ) { - $inp{ $names[$i] } = $temp; - $check = 1; - } - if ( $temp eq 'yes' ) { - -# FIXME : using array +4, +5, +6 is dirty. Should use arrays for each accountline - my $amount = $input->param( $names[ $i + 4 ] ); - my $borrowernumber = $input->param( $names[ $i + 5 ] ); - my $accountno = $input->param( $names[ $i + 6 ] ); - makepayment( $borrowernumber, $accountno, $amount, $user, $branch ); - $check = 2; - } - if ( $temp eq 'no'||$temp eq 'yes'||$temp eq 'wo') { - my $borrowernumber = $input->param( $names[ $i + 5 ] ); - my $accountno = $input->param( $names[ $i + 6 ] ); - my $note = $input->param( $names[ $i + 10 ] ); - ModNote( $borrowernumber, $accountno, $note ); - } +my $writeoff_item = $input->param('confirm_writeoff'); +my $paycollect = $input->param('paycollect'); +if ($paycollect) { + print $input->redirect( + "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber"); +} +my $payselected = $input->param('payselected'); +if ($payselected) { + payselected(@names); } -my $total = $input->param('total') || ''; -if ( $check == 0 ) { - if ( $total ne '' ) { - recordpayment( $borrowernumber, $total ); +my $writeoff_all = $input->param('woall'); # writeoff all fines +if ($writeoff_all) { + writeoff_all(@names); +} elsif ($writeoff_item) { + my $accountno = $input->param('accountno'); + my $itemno = $input->param('itemnumber'); + my $account_type = $input->param('accounttype'); + my $amount = $input->param('amount'); + writeoff( $accountno, $itemno, $account_type, $amount ); +} + +for (@names) { + if (/^pay_indiv_(\d+)$/) { + my $line_no = $1; + redirect_to_paycollect( 'pay_individual', $line_no ); + } elsif (/^wo_indiv_(\d+)$/) { + my $line_no = $1; + redirect_to_paycollect( 'writeoff_individual', $line_no ); } +} - my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); - - my @allfile; - my @notify = NumberNotifyId($borrowernumber); - - my $numberofnotify = scalar(@notify); - for ( my $j = 0 ; $j < scalar(@notify) ; $j++ ) { - my @loop_pay; - my ( $total , $accts, $numaccts) = - GetBorNotifyAcctRecord( $borrowernumber, $notify[$j] ); - for ( my $i = 0 ; $i < $numaccts ; $i++ ) { - my %line; - if ( $accts->[$i]{'amountoutstanding'} != 0 ) { - $accts->[$i]{'amount'} += 0.00; - $accts->[$i]{'amountoutstanding'} += 0.00; - $line{i} = $j . "" . $i; - $line{itemnumber} = $accts->[$i]{'itemnumber'}; - $line{accounttype} = $accts->[$i]{'accounttype'}; - $line{amount} = sprintf( "%.2f", $accts->[$i]{'amount'} ); - $line{amountoutstanding} = - sprintf( "%.2f", $accts->[$i]{'amountoutstanding'} ); - $line{borrowernumber} = $borrowernumber; - $line{accountno} = $accts->[$i]{'accountno'}; - $line{description} = $accts->[$i]{'description'}; - $line{note} = $accts->[$i]{'note'}; - $line{title} = $accts->[$i]{'title'}; - $line{notify_id} = $accts->[$i]{'notify_id'}; - $line{notify_level} = $accts->[$i]{'notify_level'}; - $line{net_balance} = 1 if($accts->[$i]{'amountoutstanding'} > 0); # you can't pay a credit. - push( @loop_pay, \%line ); - } - } +add_accounts_to_template(); - my $totalnotify = AmountNotify( $notify[$j], $borrowernumber ); - ( $totalnotify = '0' ) if ( $totalnotify =~ /^0.00/ ); - push @allfile, - { - 'loop_pay' => \@loop_pay, - 'notify' => $notify[$j], - 'total' => sprintf( "%.2f",$totalnotify), - - }; - } - -if ( $data->{'category_type'} eq 'C') { - my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); - my $cnt = scalar(@$catcodes); - $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1; - $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1; +output_html_with_http_headers $input, $cookie, $template->output; + +sub writeoff { + my ( $accountnum, $itemnum, $accounttype, $amount ) = @_; + + # if no item is attached to fine, make sure to store it as a NULL + $itemnum ||= undef; + get_writeoff_sth(); + $writeoff_sth->execute( $accountnum, $borrowernumber ); + + my $acct = getnextacctno($borrowernumber); + $add_writeoff_sth->execute( $borrowernumber, $acct, $itemnum, $amount ); + + UpdateStats( $branch, 'writeoff', $amount, q{}, q{}, q{}, $borrowernumber ); + + return; } - -$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); -my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); -$template->param( picture => 1 ) if $picture; - + +sub add_accounts_to_template { + + my ( $total, undef, undef ) = GetMemberAccountRecords($borrowernumber); + my $accounts = []; + my @notify = NumberNotifyId($borrowernumber); + + my $notify_groups = []; + for my $notify_id (@notify) { + my ( $acct_total, $accountlines, undef ) = + GetBorNotifyAcctRecord( $borrowernumber, $notify_id ); + if ( @{$accountlines} ) { + my $totalnotify = AmountNotify( $notify_id, $borrowernumber ); + push @{$accounts}, + { accountlines => $accountlines, + notify => $notify_id, + total => $totalnotify, + }; + } + } + borrower_add_additional_fields($borrower); $template->param( - allfile => \@allfile, - firstname => $data->{'firstname'}, - surname => $data->{'surname'}, - borrowernumber => $borrowernumber, - cardnumber => $data->{'cardnumber'}, - categorycode => $data->{'categorycode'}, - category_type => $data->{'category_type'}, - categoryname => $data->{'description'}, - address => $data->{'address'}, - address2 => $data->{'address2'}, - city => $data->{'city'}, - state => $data->{'state'}, - zipcode => $data->{'zipcode'}, - country => $data->{'country'}, - phone => $data->{'phone'}, - email => $data->{'email'}, - branchcode => $data->{'branchcode'}, - branchname => GetBranchName($data->{'branchcode'}), - is_child => ($data->{'category_type'} eq 'C'), - total => sprintf( "%.2f", $total ) + accounts => $accounts, + borrower => $borrower, + total => $total, ); - output_html_with_http_headers $input, $cookie, $template->output; + return; } -else { - - my %inp; - my @name = $input->param; - for ( my $i = 0 ; $i < @name ; $i++ ) { - my $test = $input->param( $name[$i] ); - if ( $test eq 'wo' ) { - my $temp = $name[$i]; - $temp =~ s/payfine//; - $inp{ $name[$i] } = $temp; - } + +sub get_for_redirect { + my ( $name, $name_in, $money ) = @_; + my $s = q{&} . $name . q{=}; + my $value = $input->param($name_in); + if ( !defined $value ) { + $value = ( $money == 1 ) ? 0 : q{}; + } + if ($money) { + $s .= sprintf '%.2f', $value; + } else { + $s .= $value; } - my $borrowernumber; - while ( my ( $key, $value ) = each %inp ) { - - my $accounttype = $input->param("accounttype$value"); - $borrowernumber = $input->param("borrowernumber$value"); - my $itemno = $input->param("itemnumber$value"); - my $amount = $input->param("amount$value"); - my $accountno = $input->param("accountno$value"); - writeoff( $borrowernumber, $accountno, $itemno, $accounttype, $amount ); + return $s; +} + +sub redirect_to_paycollect { + my ( $action, $line_no ) = @_; + my $redirect = + "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber"; + $redirect .= q{&}; + $redirect .= "$action=1"; + $redirect .= get_for_redirect( 'accounttype', "accounttype$line_no", 0 ); + $redirect .= get_for_redirect( 'amount', "amount$line_no", 1 ); + $redirect .= + get_for_redirect( 'amountoutstanding', "amountoutstanding$line_no", 1 ); + $redirect .= get_for_redirect( 'accountno', "accountno$line_no", 0 ); + $redirect .= get_for_redirect( 'description', "description$line_no", 0 ); + $redirect .= get_for_redirect( 'title', "title$line_no", 0 ); + $redirect .= get_for_redirect( 'itemnumber', "itemnumber$line_no", 0 ); + $redirect .= get_for_redirect( 'notify_id', "notify_id$line_no", 0 ); + $redirect .= get_for_redirect( 'notify_level', "notify_level$line_no", 0 ); + $redirect .= '&remote_user='; + $redirect .= $user; + return print $input->redirect($redirect); +} + +sub writeoff_all { + my @params = @_; + my @wo_lines = grep { /^accountno\d+$/ } @params; + for (@wo_lines) { + if (/(\d+)/) { + my $value = $1; + my $accounttype = $input->param("accounttype$value"); + + # my $borrowernum = $input->param("borrowernumber$value"); + my $itemno = $input->param("itemnumber$value"); + my $amount = $input->param("amount$value"); + my $accountno = $input->param("accountno$value"); + writeoff( $accountno, $itemno, $accounttype, $amount ); + } } + $borrowernumber = $input->param('borrowernumber'); print $input->redirect( "/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber"); + return; } -sub writeoff { - my ( $borrowernumber, $accountnum, $itemnum, $accounttype, $amount ) = @_; - my $user = $input->remote_user; - my $dbh = C4::Context->dbh; - undef $itemnum unless $itemnum; # if no item is attached to fine, make sure to store it as a NULL - my $sth = - $dbh->prepare( -"Update accountlines set amountoutstanding=0 where accountno=? and borrowernumber=?" - ); - $sth->execute( $accountnum, $borrowernumber ); - $sth->finish; - $sth = $dbh->prepare("select max(accountno) from accountlines"); - $sth->execute; - my $account = $sth->fetchrow_hashref; - $sth->finish; - $account->{'max(accountno)'}++; - $sth = $dbh->prepare( -"insert into accountlines (borrowernumber,accountno,itemnumber,date,amount,description,accounttype) - values (?,?,?,now(),?,'Writeoff','W')" - ); - $sth->execute( $borrowernumber, $account->{'max(accountno)'}, - $itemnum, $amount ); - $sth->finish; - UpdateStats( $branch, 'writeoff', $amount, '', '', '', - $borrowernumber ); +sub borrower_add_additional_fields { + my $b_ref = shift; + +# some borrower info is not returned in the standard call despite being assumed +# in a number of templates. It should not be the business of this script but in lieu of +# a revised api here it is ... + if ( $b_ref->{category_type} eq 'C' ) { + my ( $catcodes, $labels ) = + GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); + if ( @{$catcodes} ) { + if ( @{$catcodes} > 1 ) { + $b_ref->{CATCODE_MULTI} = 1; + } elsif ( @{$catcodes} == 1 ) { + $b_ref->{catcode} = $catcodes->[0]; + } + } + } elsif ( $b_ref->{category_type} eq 'A' ) { + $b_ref->{adultborrower} = 1; + } + my ( $picture, $dberror ) = GetPatronImage( $b_ref->{cardnumber} ); + if ($picture) { + $b_ref->{has_picture} = 1; + } + + $b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} ); + return; +} + +sub payselected { + my @params = @_; + my $amt = 0; + my @lines_to_pay; + foreach (@params) { + if (/^incl_par_(\d+)$/) { + my $index = $1; + push @lines_to_pay, $input->param("accountno$index"); + $amt += $input->param("amountoutstanding$index"); + } + } + $amt = '&amt=' . $amt; + my $sel = '&selected=' . join ',', @lines_to_pay; + my $redirect = + "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber" + . $amt + . $sel; + + print $input->redirect($redirect); + return; +} + +sub get_writeoff_sth { + + # lets prepare these statement handles only once + if ($writeoff_sth) { + return; + } else { + my $dbh = C4::Context->dbh; + + # Do we need to validate accounttype + my $sql = 'Update accountlines set amountoutstanding=0 ' + . 'WHERE accountno=? and borrowernumber=?'; + $writeoff_sth = $dbh->prepare($sql); + my $insert = +q{insert into accountlines (borrowernumber,accountno,itemnumber,date,amount,description,accounttype)} + . q{values (?,?,?,now(),?,'Writeoff','W')}; + $add_writeoff_sth = $dbh->prepare($insert); + } + return; } diff --git a/members/paycollect.pl b/members/paycollect.pl new file mode 100755 index 0000000..cbddc05 --- /dev/null +++ b/members/paycollect.pl @@ -0,0 +1,171 @@ +#!/usr/bin/perl +# Copyright 2009,2010 PTFS Inc. +# Copyright 2011 PTFS-Europe Ltd +# +# 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 2 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use strict; +use warnings; +use C4::Context; +use C4::Auth; +use C4::Output; +use CGI; +use C4::Members; +use C4::Accounts; +use C4::Koha; +use C4::Branch; + +my $input = CGI->new(); + +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { template_name => 'members/paycollect.tmpl', + query => $input, + type => 'intranet', + authnotrequired => 0, + flagsrequired => { borrowers => 1, updatecharges => 1 }, + debug => 1, + } +); + +# get borrower details +my $borrowernumber = $input->param('borrowernumber'); +my $borrower = GetMember( borrowernumber => $borrowernumber ); +my $user = $input->remote_user; + +# get account details +my $branch = GetBranch( $input, GetBranches() ); + +my ( $total_due, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber); +my $total_paid = $input->param('paid'); + +my $individual = $input->param('pay_individual'); +my $writeoff = $input->param('writeoff_individual'); +my $select_lines = $input->param('selected'); +my $select = $input->param('selected_accts'); +my $accountno; + +if ( $individual || $writeoff ) { + if ($individual) { + $template->param( pay_individual => 1 ); + } elsif ($writeoff) { + $template->param( writeoff_individual => 1 ); + } + my $accounttype = $input->param('accounttype'); + my $amount = $input->param('amount'); + my $amountoutstanding = $input->param('amountoutstanding'); + $accountno = $input->param('accountno'); + my $description = $input->param('description'); + my $title = $input->param('title'); + my $notify_id = $input->param('notify_id'); + my $notify_level = $input->param('notify_level'); + $total_due = $amountoutstanding; + $template->param( + accounttype => $accounttype, + accountno => $accountno, + amount => $amount, + amountoutstanding => $amountoutstanding, + title => $title, + description => $description, + notify_id => $notify_id, + notify_level => $notify_level, + ); +} elsif ($select_lines) { + $total_due = $input->param('amt'); + $template->param( + selected_accts => $select_lines, + amt => $total_due + ); +} + +if ( $total_paid and $total_paid ne '0.00' ) { + if ( $total_paid < 0 or $total_paid > $total_due ) { + $template->param( + error => sprintf( 'You must pay a value less than or equal to %f.2', + $total_due ) + ); + } else { + if ($individual) { + if ( $total_paid == $total_due ) { + makepayment( $borrowernumber, $accountno, $total_paid, $user, + $branch ); + } else { + makepartialpayment( $borrowernumber, $accountno, $total_paid, + $user, $branch ); + } + print $input->redirect( + "/cgi-bin/koha/members/pay.pl?borrowernumber=$borrowernumber"); + } else { + if ($select) { + if ( $select =~ /^([\d,]*).*/ ) { + $select = $1; # ensure passing no junk + } + my @acc = split /,/, $select; + recordpayment_selectaccts( $borrowernumber, $total_paid, + \@acc ); + } else { + recordpayment( $borrowernumber, $total_paid ); + } + +# recordpayment does not return success or failure so lets redisplay the boraccount + + print $input->redirect( +"/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber" + ); + } + } +} else { + $total_paid = '0.00'; #TODO not right with pay_individual +} + +borrower_add_additional_fields($borrower); + +$template->param( + + #borrowenumber => $borrower->{borrowernumber}, # some templates require global + borrowenumber => $borrowernumber, # some templates require global + borrower => $borrower, + total => $total_due +); + +output_html_with_http_headers $input, $cookie, $template->output; + +sub borrower_add_additional_fields { + my $b_ref = shift; + +# some borrower info is not returned in the standard call despite being assumed +# in a number of templates. It should not be the business of this script but in lieu of +# a revised api here it is ... + if ( $b_ref->{category_type} eq 'C' ) { + my ( $catcodes, $labels ) = + GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); + if ( @{$catcodes} ) { + if ( @{$catcodes} > 1 ) { + $b_ref->{CATCODE_MULTI} = 1; + } elsif ( @{$catcodes} == 1 ) { + $b_ref->{catcode} = $catcodes->[0]; + } + } + } elsif ( $b_ref->{category_type} eq 'A' ) { + $b_ref->{adultborrower} = 1; + } + my ( $picture, $dberror ) = GetPatronImage( $b_ref->{cardnumber} ); + if ($picture) { + $b_ref->{has_picture} = 1; + } + + $b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} ); + return; +} -- 1.7.2.5 From f.demians at tamil.fr Mon Sep 12 17:18:37 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Mon, 12 Sep 2011 17:18:37 +0200 Subject: [Koha-patches] [PATCH] 6755 Problems with switching languages Message-ID: <1315840717-23766-1-git-send-email-f.demians@tamil.fr> This patch solves the situation that news is in another language than the Koha interface AND makes that themelanguage routine is always called the same way in order to prevent mixed display. It fixes also a bug related to language preselection based on web browser prefered language. September 9: Adjusted with input of Frederic Demians. Septembre 10: Avoid circular dependency, as pointed by Chris Cormack. Templates related functions are moved from C4::Output to C4::Templates --- C4/Auth.pm | 6 +- C4/Output.pm | 183 +-------------------------------- C4/Templates.pm | 173 ++++++++++++++++++++++++++++++- C4/XSLT.pm | 5 +- about.pl | 2 +- admin/preferences.pl | 3 +- catalogue/moredetail.pl | 2 +- catalogue/search.pl | 2 +- changelanguage.pl | 4 +- installer/InstallAuth.pm | 2 +- misc/cronjobs/gather_print_notices.pl | 6 +- misc/exportauth.pl | 1 - opac/opac-changelanguage.pl | 4 +- opac/opac-main.pl | 28 +----- opac/opac-search.pl | 2 +- tools/export.pl | 2 +- 16 files changed, 195 insertions(+), 230 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 495f04c..7211769 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -26,7 +26,7 @@ use CGI::Session; require Exporter; use C4::Context; -use C4::Output; # to get the template +use C4::Templates; # to get the template use C4::Members; use C4::Koha; use C4::Branch; # GetBranches @@ -136,7 +136,7 @@ EOQ sub get_template_and_user { my $in = shift; my $template = - gettemplate( $in->{'template_name'}, $in->{'type'}, $in->{'query'} ); + C4::Templates::gettemplate( $in->{'template_name'}, $in->{'type'}, $in->{'query'} ); my ( $user, $cookie, $sessionID, $flags ); if ( $in->{'template_name'} !~m/maintenance/ ) { ( $user, $cookie, $sessionID, $flags ) = checkauth( @@ -936,7 +936,7 @@ sub checkauth { } my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tmpl' : 'auth.tmpl'; - my $template = gettemplate( $template_name, $type, $query ); + my $template = C4::Templates::gettemplate( $template_name, $type, $query ); $template->param(branchloop => \@branch_loop,); my $checkstyle = C4::Context->preference("opaccolorstylesheet"); if ($checkstyle =~ /\//) diff --git a/C4/Output.pm b/C4/Output.pm index 98f2d7a..6a8f82d 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -29,7 +29,6 @@ use strict; #use warnings; FIXME - Bug 2505 use C4::Context; -use C4::Languages qw(getTranslatedLanguages get_bidi regex_lang_subtags language_get_description accept_language ); use C4::Dates qw(format_date); use C4::Budgets qw(GetCurrency); use C4::Templates; @@ -43,192 +42,16 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw(&is_ajax ajax_fail); # More stuff should go here instead - %EXPORT_TAGS = ( all =>[qw(&themelanguage &gettemplate setlanguagecookie pagination_bar - &output_with_http_headers &output_html_with_http_headers)], + %EXPORT_TAGS = ( all =>[qw(&pagination_bar + &output_with_http_headers &output_html_with_http_headers)], ajax =>[qw(&output_with_http_headers is_ajax)], html =>[qw(&output_with_http_headers &output_html_with_http_headers)] ); push @EXPORT, qw( - &themelanguage &gettemplate setlanguagecookie getlanguagecookie pagination_bar - ); - push @EXPORT, qw( - &output_html_with_http_headers &output_with_http_headers FormatData FormatNumber - ); -} - -=head1 NAME - -C4::Output - Functions for managing templates - -=head1 FUNCTIONS - -=over 2 - -=cut - -#FIXME: this is a quick fix to stop rc1 installing broken -#Still trying to figure out the correct fix. -my $path = C4::Context->config('intrahtdocs') . "/prog/en/includes/"; - -#--------------------------------------------------------------------------------------------------------- -# FIXME - POD - -sub _get_template_file { - my ( $tmplbase, $interface, $query ) = @_; - my $htdocs = C4::Context->config( $interface ne 'intranet' ? 'opachtdocs' : 'intrahtdocs' ); - my ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, $interface, $query ); - my $opacstylesheet = C4::Context->preference('opacstylesheet'); - - # if the template doesn't exist, load the English one as a last resort - my $filename = "$htdocs/$theme/$lang/modules/$tmplbase"; - unless (-f $filename) { - $lang = 'en'; - $filename = "$htdocs/$theme/$lang/modules/$tmplbase"; - } - - return ( $htdocs, $theme, $lang, $filename ); -} - -sub gettemplate { - my ( $tmplbase, $interface, $query ) = @_; - ($query) or warn "no query in gettemplate"; - my $path = C4::Context->preference('intranet_includes') || 'includes'; - my $opacstylesheet = C4::Context->preference('opacstylesheet'); - $tmplbase =~ s/\.tmpl$/.tt/; - my ( $htdocs, $theme, $lang, $filename ) = _get_template_file( $tmplbase, $interface, $query ); - my $template = C4::Templates->new( $interface, $filename, $tmplbase); - my $themelang=( $interface ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' ) - . "/$theme/$lang"; - $template->param( - themelang => $themelang, - yuipath => (C4::Context->preference("yuipath") eq "local"?"$themelang/lib/yui":C4::Context->preference("yuipath")), - interface => ( $interface ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' ), - theme => $theme, - lang => $lang - ); - - # Bidirectionality - my $current_lang = regex_lang_subtags($lang); - my $bidi; - $bidi = get_bidi($current_lang->{script}) if $current_lang->{script}; - # Languages - my $languages_loop = getTranslatedLanguages($interface,$theme,$lang); - my $num_languages_enabled = 0; - foreach my $lang (@$languages_loop) { - foreach my $sublang (@{ $lang->{'sublanguages_loop'} }) { - $num_languages_enabled++ if $sublang->{enabled}; - } - } - $template->param( - languages_loop => $languages_loop, - bidi => $bidi, - one_language_enabled => ($num_languages_enabled <= 1) ? 1 : 0, # deal with zero enabled langs as well - ) unless @$languages_loop<2; - - return $template; -} - -# FIXME - this is a horrible hack to cache -# the current known-good language, temporarily -# put in place to resolve bug 4403. It is -# used only by C4::XSLT::XSLTParse4Display; -# the language is set via the usual call -# to themelanguage. -my $_current_language = 'en'; -sub _current_language { - return $_current_language; -} - -#--------------------------------------------------------------------------------------------------------- -# FIXME - POD -sub themelanguage { - my ( $htdocs, $tmpl, $interface, $query ) = @_; - ($query) or warn "no query in themelanguage"; - - # Set some defaults for language and theme - # First, check the user's preferences - my $lang; - my $http_accept_language = $ENV{ HTTP_ACCEPT_LANGUAGE }; - $lang = accept_language( $http_accept_language, - getTranslatedLanguages($interface,'prog') ) - if $http_accept_language; - # But, if there's a cookie set, obey it - $lang = $query->cookie('KohaOpacLanguage') if (defined $query and $query->cookie('KohaOpacLanguage')); - # Fall back to English - my @languages; - if ($interface eq 'intranet') { - @languages = split ",", C4::Context->preference("language"); - } else { - @languages = split ",", C4::Context->preference("opaclanguages"); - } - if ($lang){ - @languages=($lang, at languages); - } else { - $lang = $languages[0]; - } - my $theme = 'prog'; # in the event of theme failure default to 'prog' -fbcit - my $dbh = C4::Context->dbh; - my @themes; - if ( $interface eq "intranet" ) { - @themes = split " ", C4::Context->preference("template"); - } - else { - # we are in the opac here, what im trying to do is let the individual user - # set the theme they want to use. - # and perhaps the them as well. - #my $lang = $query->cookie('KohaOpacLanguage'); - @themes = split " ", C4::Context->preference("opacthemes"); - } - - # searches through the themes and languages. First template it find it returns. - # Priority is for getting the theme right. - THEME: - foreach my $th (@themes) { - foreach my $la (@languages) { - #for ( my $pass = 1 ; $pass <= 2 ; $pass += 1 ) { - # warn "$htdocs/$th/$la/modules/$interface-"."tmpl"; - #$la =~ s/([-_])/ $1 eq '-'? '_': '-' /eg if $pass == 2; - if ( -e "$htdocs/$th/$la/modules/$tmpl") { - #".($interface eq 'intranet'?"modules":"")."/$tmpl" ) { - $theme = $th; - $lang = $la; - last THEME; - } - last unless $la =~ /[-_]/; - #} - } - } - - $_current_language = $lang; # FIXME part of bad hack to paper over bug 4403 - return ( $theme, $lang ); -} - -sub setlanguagecookie { - my ( $query, $language, $uri ) = @_; - my $cookie = $query->cookie( - -name => 'KohaOpacLanguage', - -value => $language, - -expires => '' - ); - print $query->redirect( - -uri => $uri, - -cookie => $cookie + &output_html_with_http_headers &output_with_http_headers FormatData FormatNumber pagination_bar ); } -sub getlanguagecookie { - my ($query) = @_; - my $lang; - if ($query->cookie('KohaOpacLanguage')){ - $lang = $query->cookie('KohaOpacLanguage') ; - }else{ - $lang = $ENV{HTTP_ACCEPT_LANGUAGE}; - - } - $lang = substr($lang, 0, 2); - - return $lang; -} =item FormatNumber =cut diff --git a/C4/Templates.pm b/C4/Templates.pm index 4368492..4f2c485 100644 --- a/C4/Templates.pm +++ b/C4/Templates.pm @@ -31,16 +31,20 @@ use CGI; use base qw(Class::Accessor); use Template; use Template::Constants qw( :debug ); +use C4::Languages qw(getTranslatedLanguages get_bidi regex_lang_subtags language_get_description accept_language ); use C4::Context; __PACKAGE__->mk_accessors(qw( theme lang filename htdocs interface vars)); + + sub new { my $class = shift; my $interface = shift; my $filename = shift; my $tmplbase = shift; + my $query = @_? shift: undef; my $htdocs; if ( $interface ne "intranet" ) { $htdocs = C4::Context->config('opachtdocs'); @@ -49,7 +53,7 @@ sub new { $htdocs = C4::Context->config('intrahtdocs'); } - my ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, $interface ); + my ($theme, $lang)= themelanguage( $htdocs, $tmplbase, $interface, $query); my $template = Template->new( { EVAL_PERL => 1, @@ -164,7 +168,7 @@ sub _current_language { return $_current_language; } -sub themelanguage { +sub themelanguage_lite { my ( $htdocs, $tmpl, $interface ) = @_; my $query = new CGI; @@ -228,5 +232,170 @@ sub param { } } + +=head1 NAME + +C4::Templates - Functions for managing templates + +=head1 FUNCTIONS + +=over 2 + +=cut + +#FIXME: this is a quick fix to stop rc1 installing broken +#Still trying to figure out the correct fix. +my $path = C4::Context->config('intrahtdocs') . "/prog/en/includes/"; + +#--------------------------------------------------------------------------------------------------------- +# FIXME - POD + +sub _get_template_file { + my ( $tmplbase, $interface, $query ) = @_; + my $htdocs = C4::Context->config( $interface ne 'intranet' ? 'opachtdocs' : 'intrahtdocs' ); + my ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, $interface, $query ); + my $opacstylesheet = C4::Context->preference('opacstylesheet'); + + # if the template doesn't exist, load the English one as a last resort + my $filename = "$htdocs/$theme/$lang/modules/$tmplbase"; + unless (-f $filename) { + $lang = 'en'; + $filename = "$htdocs/$theme/$lang/modules/$tmplbase"; + } + + return ( $htdocs, $theme, $lang, $filename ); +} + +sub gettemplate { + my ( $tmplbase, $interface, $query ) = @_; + ($query) or warn "no query in gettemplate"; + my $path = C4::Context->preference('intranet_includes') || 'includes'; + my $opacstylesheet = C4::Context->preference('opacstylesheet'); + $tmplbase =~ s/\.tmpl$/.tt/; + my ( $htdocs, $theme, $lang, $filename ) = _get_template_file( $tmplbase, $interface, $query ); + my $template = C4::Templates->new($interface, $filename, $tmplbase, $query); + my $themelang=( $interface ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' ) + . "/$theme/$lang"; + $template->param( + themelang => $themelang, + yuipath => (C4::Context->preference("yuipath") eq "local"?"$themelang/lib/yui":C4::Context->preference("yuipath")), + interface => ( $interface ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' ), + theme => $theme, + lang => $lang + ); + + # Bidirectionality + my $current_lang = regex_lang_subtags($lang); + my $bidi; + $bidi = get_bidi($current_lang->{script}) if $current_lang->{script}; + # Languages + my $languages_loop = getTranslatedLanguages($interface,$theme,$lang); + my $num_languages_enabled = 0; + foreach my $lang (@$languages_loop) { + foreach my $sublang (@{ $lang->{'sublanguages_loop'} }) { + $num_languages_enabled++ if $sublang->{enabled}; + } + } + $template->param( + languages_loop => $languages_loop, + bidi => $bidi, + one_language_enabled => ($num_languages_enabled <= 1) ? 1 : 0, # deal with zero enabled langs as well + ) unless @$languages_loop<2; + + return $template; +} + + +#--------------------------------------------------------------------------------------------------------- +# FIXME - POD +sub themelanguage { + my ( $htdocs, $tmpl, $interface, $query ) = @_; + ($query) or warn "no query in themelanguage"; + + # Set some defaults for language and theme + # First, check the user's preferences + my $lang; + my $http_accept_language = $ENV{ HTTP_ACCEPT_LANGUAGE }; + $lang = accept_language( $http_accept_language, + getTranslatedLanguages($interface,'prog') ) + if $http_accept_language; + # But, if there's a cookie set, obey it + $lang = $query->cookie('KohaOpacLanguage') if (defined $query and $query->cookie('KohaOpacLanguage')); + # Fall back to English + my @languages; + if ($interface eq 'intranet') { + @languages = split ",", C4::Context->preference("language"); + } else { + @languages = split ",", C4::Context->preference("opaclanguages"); + } + if ($lang){ + @languages=($lang, at languages); + } else { + $lang = $languages[0]; + } + my $theme = 'prog'; # in the event of theme failure default to 'prog' -fbcit + my $dbh = C4::Context->dbh; + my @themes; + if ( $interface eq "intranet" ) { + @themes = split " ", C4::Context->preference("template"); + } + else { + # we are in the opac here, what im trying to do is let the individual user + # set the theme they want to use. + # and perhaps the them as well. + #my $lang = $query->cookie('KohaOpacLanguage'); + @themes = split " ", C4::Context->preference("opacthemes"); + } + + # searches through the themes and languages. First template it find it returns. + # Priority is for getting the theme right. + THEME: + foreach my $th (@themes) { + foreach my $la (@languages) { + #for ( my $pass = 1 ; $pass <= 2 ; $pass += 1 ) { + # warn "$htdocs/$th/$la/modules/$interface-"."tmpl"; + #$la =~ s/([-_])/ $1 eq '-'? '_': '-' /eg if $pass == 2; + if ( -e "$htdocs/$th/$la/modules/$tmpl") { + #".($interface eq 'intranet'?"modules":"")."/$tmpl" ) { + $theme = $th; + $lang = $la; + last THEME; + } + last unless $la =~ /[-_]/; + #} + } + } + + $_current_language = $lang; # FIXME part of bad hack to paper over bug 4403 + return ( $theme, $lang ); +} + +sub setlanguagecookie { + my ( $query, $language, $uri ) = @_; + my $cookie = $query->cookie( + -name => 'KohaOpacLanguage', + -value => $language, + -expires => '' + ); + print $query->redirect( + -uri => $uri, + -cookie => $cookie + ); +} + +sub getlanguagecookie { + my ($query) = @_; + my $lang; + if ($query->cookie('KohaOpacLanguage')){ + $lang = $query->cookie('KohaOpacLanguage') ; + }else{ + $lang = $ENV{HTTP_ACCEPT_LANGUAGE}; + + } + $lang = substr($lang, 0, 2); + + return $lang; +} + 1; diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 4dafff3..8bc4000 100755 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -29,7 +29,6 @@ use C4::Koha; use C4::Biblio; use C4::Circulation; use C4::Reserves; -use C4::Output qw//; use Encode; use XML::LibXML; use XML::LibXSLT; @@ -160,14 +159,14 @@ sub XSLTParse4Display { if ($interface eq 'intranet') { $xslfile = C4::Context->config('intrahtdocs') . '/' . C4::Context->preference("template") . - '/' . C4::Output::_current_language() . + '/' . C4::Templates::_current_language() . '/xslt/' . C4::Context->preference('marcflavour') . "slim2intranet$xsl_suffix.xsl"; } else { $xslfile = C4::Context->config('opachtdocs') . '/' . C4::Context->preference("opacthemes") . - '/' . C4::Output::_current_language() . + '/' . C4::Templates::_current_language() . '/xslt/' . C4::Context->preference('marcflavour') . "slim2OPAC$xsl_suffix.xsl"; diff --git a/about.pl b/about.pl index 2ad7393..ae2d0dc 100755 --- a/about.pl +++ b/about.pl @@ -28,7 +28,7 @@ use LWP::Simple; use XML::Simple; use Config; -use C4::Output; # contains gettemplate +use C4::Output; use C4::Auth; use C4::Context; use C4::Installer; diff --git a/admin/preferences.pl b/admin/preferences.pl index d523c75..ff8ffd7 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -28,6 +28,7 @@ use C4::Languages qw(getTranslatedLanguages); use C4::ClassSource; use C4::Log; use C4::Output; +use C4::Templates; use C4::Budgets qw(GetCurrency); use File::Spec; use IO::File; @@ -41,7 +42,7 @@ our $lang; sub GetTab { my ( $input, $tab ) = @_; - my $tab_template = C4::Output::gettemplate( 'admin/preferences/' . $tab . '.pref', 'intranet', $input ); + my $tab_template = C4::Templates::gettemplate( 'admin/preferences/' . $tab . '.pref', 'intranet', $input ); my $active_currency = GetCurrency(); my $local_currency; diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index d848188..d285a49 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -27,7 +27,7 @@ use C4::Biblio; use C4::Items; use C4::Branch; use C4::Acquisition; -use C4::Output; # contains gettemplate +use C4::Output; use C4::Auth; use C4::Serials; use C4::Dates qw/format_date/; diff --git a/catalogue/search.pl b/catalogue/search.pl index b9f9ed3..97fa3d7 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -471,7 +471,7 @@ my ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit my @results; ## I. BUILD THE QUERY -my $lang = C4::Output::getlanguagecookie($cgi); +my $lang = C4::Templates::getlanguagecookie($cgi); ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by,$scan,$lang); ## parse the query_cgi string and put it into a form suitable for s diff --git a/changelanguage.pl b/changelanguage.pl index f906c23..c4d68e3 100755 --- a/changelanguage.pl +++ b/changelanguage.pl @@ -18,7 +18,7 @@ use strict; use warnings; -use C4::Output qw(setlanguagecookie); +use C4::Templates; use CGI; my $query = new CGI; @@ -26,4 +26,4 @@ my $language = $query->param('language'); my $url = $query->referer(); #warn "Language : $query // $language // $url"; -setlanguagecookie( $query, $language, $url ); +C4::Templates::setlanguagecookie( $query, $language, $url ); diff --git a/installer/InstallAuth.pm b/installer/InstallAuth.pm index 3efc407..3918698 100644 --- a/installer/InstallAuth.pm +++ b/installer/InstallAuth.pm @@ -103,7 +103,7 @@ InstallAuth - Authenticates Koha users for Install process authenticated page. More information on the C sub can be found in the - Output.pm module. + Templates.pm module. =cut diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl index 03b65b4..a72d6a6 100755 --- a/misc/cronjobs/gather_print_notices.pl +++ b/misc/cronjobs/gather_print_notices.pl @@ -28,12 +28,12 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } -use CGI; # NOT a CGI script, this is just to keep C4::Output::gettemplate happy +use CGI; # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy use C4::Context; use C4::Dates; use C4::Debug; use C4::Letters; -use C4::Output; +use C4::Templates; use File::Spec; use Getopt::Long; @@ -70,7 +70,7 @@ exit unless( @messages ); open OUTPUT, '>', File::Spec->catdir( $output_directory, "holdnotices-" . $today->output( 'iso' ) . ".html" ); -my $template = C4::Output::gettemplate( 'batch/print-notices.tmpl', 'intranet', new CGI ); +my $template = C4::Templates::gettemplate( 'batch/print-notices.tmpl', 'intranet', new CGI ); my $stylesheet_contents = ''; if ($stylesheet) { diff --git a/misc/exportauth.pl b/misc/exportauth.pl index 4ac916c..d6236d2 100755 --- a/misc/exportauth.pl +++ b/misc/exportauth.pl @@ -13,7 +13,6 @@ BEGIN { } use C4::Context; -use C4::Output; # contains gettemplate use C4::Biblio; use C4::Auth; my $outfile = $ARGV[0]; diff --git a/opac/opac-changelanguage.pl b/opac/opac-changelanguage.pl index 0cfbca4..1c3ee8e 100755 --- a/opac/opac-changelanguage.pl +++ b/opac/opac-changelanguage.pl @@ -17,7 +17,7 @@ use strict; use warnings; -use C4::Output qw(setlanguagecookie); +use C4::Templates; use CGI; my $query = new CGI; @@ -25,4 +25,4 @@ my $language = $query->param('language'); my $url = $query->referer(); # warn "Language : $query // $language // $url"; -setlanguagecookie( $query, $language, $url ); +C4::Templates::setlanguagecookie( $query, $language, $url ); diff --git a/opac/opac-main.pl b/opac/opac-main.pl index 177d812..ff71006 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -54,33 +54,7 @@ $template->param( # display news # use cookie setting for language, bug default to syspref if it's not set -(my $theme) = themelanguage(C4::Context->config('opachtdocs'),'opac-main.tmpl','opac',$input); - -my $translations = getTranslatedLanguages('opac',$theme); -my @languages = (); -foreach my $trans (@$translations) -{ - push(@languages, $trans->{rfc4646_subtag}); -} - -my $news_lang; -if($input->cookie('KohaOpacLanguage')){ - $news_lang = $input->cookie('KohaOpacLanguage'); -}else{ - if ($ENV{HTTP_ACCEPT_LANGUAGE}) { - while( !$news_lang && ( $ENV{HTTP_ACCEPT_LANGUAGE} =~ m/([a-zA-Z]{2,}-?[a-zA-Z]*)(;|,)?/g ) ){ - if( my @lang = grep { /^$1$/i } @languages ) { - $news_lang = $lang[0]; - } - } - } - if (not $news_lang) { - my @languages = split ",", C4::Context->preference("opaclanguages"); - $news_lang = $languages[0]; - } -} - -$news_lang = $news_lang ? $news_lang : 'en' ; +my ($theme, $news_lang) = C4::Templates::themelanguage(C4::Context->config('opachtdocs'),'opac-main.tt','opac',$input); my $all_koha_news = &GetNewsToDisplay($news_lang); my $koha_news_count = scalar @$all_koha_news; diff --git a/opac/opac-search.pl b/opac/opac-search.pl index dfe4d74..ff437da 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -373,7 +373,7 @@ my ($error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_ my @results; ## I. BUILD THE QUERY -my $lang = C4::Output::getlanguagecookie($cgi); +my $lang = C4::Templates::getlanguagecookie($cgi); ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by, 0, $lang); sub _input_cgi_parse ($) { diff --git a/tools/export.pl b/tools/export.pl index 4a09868..4b3e3f5 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -20,7 +20,7 @@ use strict; use warnings; use C4::Auth; -use C4::Output; # contains gettemplate +use C4::Output; use C4::Biblio; # GetMarcBiblio GetXmlBiblio use CGI; use C4::Koha; # GetItemTypes -- 1.7.6.1 From oleonard at myacpl.org Mon Sep 12 21:53:58 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Mon, 12 Sep 2011 15:53:58 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 6855 - List bullet showing in wrong place on error message Message-ID: <1315857238-13650-1-git-send-email-oleonard@myacpl.org> Added some more specific CSS to help Webkit browsers display the lists bullets correctly. --- .../intranet-tmpl/prog/en/css/staff-global.css | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 36cef19..6ce6629 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -1199,6 +1199,9 @@ div.dialog { text-align : center; } +.dialog li { + list-style-position:inside; +} a.document { background-position : left middle; background-repeat : no-repeat; -- 1.7.3 From robin at catalyst.net.nz Tue Sep 13 01:13:57 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Tue, 13 Sep 2011 11:13:57 +1200 Subject: [Koha-patches] [PATCH] Bug 6496 - correct the order of the author display in the OPAC Message-ID: <1315869237-7632-1-git-send-email-robin@catalyst.net.nz> This sets the order the fields are displayed in to be as it is in the MARC (typically numerical order), rather than 100,700,110,710,... like it was. Basically, it's a port of the way it's done in the staff client. As such, it should be able to handle a lot more than it could previously, including relator codes. (replaces the previous commit, just removing an erronious comment and making the commit message more accurate) --- .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 109 +++++++++----------- 1 files changed, 50 insertions(+), 59 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl index 8fe0cf7..74a7da0 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -128,66 +128,14 @@ - -
    by - - - - - /cgi-bin/koha/opac-search.pl?q=an: - - - /cgi-bin/koha/opac-search.pl?q=au: - - - - - ; - - - - - - ; - - - - - - /cgi-bin/koha/opac-search.pl?q=an: - - - /cgi-bin/koha/opac-search.pl?q=au: - - - - ; - - - - - - - - n - - - - - - - /cgi-bin/koha/opac-search.pl?q=an: + +
    by + + + + +
    - - /cgi-bin/koha/opac-search.pl?q=au: - -
    -
    - .; - -
    -
    -
    @@ -882,6 +830,49 @@ + + + + + ; + + + + + + n + + + + + + + + /cgi-bin/koha/opac-search.pl?q=an: + + + /cgi-bin/koha/opac-search.pl?q=au: + + + + + + + + + + [ + + + + + ] + + + + . + + -- 1.7.4.1 From srdjan at catalyst.net.nz Tue Sep 13 02:27:55 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Tue, 13 Sep 2011 12:27:55 +1200 Subject: [Koha-patches] [PATCH] bug_5473: add 952 fields MARC21 when receiving an order In-Reply-To: References: Message-ID: <1315873675-25974-1-git-send-email-srdjan@catalyst.net.nz> --- C4/Biblio.pm | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ acqui/finishreceive.pl | 11 ++++++++++ 2 files changed, 61 insertions(+), 0 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 96baaef..b0cb247 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -99,6 +99,7 @@ BEGIN { &ModBiblio &ModBiblioframework &ModZebra + &AddMarcFields ); # To delete something @@ -3681,6 +3682,55 @@ sub get_biblio_authorised_values { return $authorised_values; } +=head2 AddMarcFields + +Adds fields/subfields to existing marcxml + +parameters: + biblionumber + fields + +returns: nothing + + $fields: { tag1 => val1, tag2 => val2, ... } + $valX : $val for tags < 10, + [ subfld1 => subval1, subfld2 => subval2, ... ] for the rest + +Notes: no indicator support + +=cut + +sub AddMarcFields { + my ( $biblionumber, $fields ) = @_; + + my $rec = GetMarcBiblio($biblionumber) or die "Invalid biblionumber $biblionumber"; + + while ( my ($tag, $val) = each %$fields ) { + if ( my ($field) = $rec->field($tag) ) { + if (ref $val) { + $field->update(@$val); + } else { + $field->update($val); + } + } + else { + my $newfield; + if (ref $val) { + $newfield = MARC::Field->new( $tag, '', '', @$val ); + } else { + $newfield = MARC::Field->new( $tag, $val ); + } + $rec->insert_fields_ordered($newfield); + } + } + + my $dbh = C4::Context->dbh; + my $encoding = C4::Context->preference("marcflavour"); + $dbh->do("UPDATE biblioitems SET marcxml=? WHERE biblionumber=?", undef, + $rec->as_xml_record($encoding), + $biblionumber ); +} + 1; __END__ diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index 71b13d6..9391b5c 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -114,4 +114,15 @@ if ($quantityrec > $origquantityrec ) { $datereceived = ModReceiveOrder($biblionumber,$ordernumber, $quantityrec ,$user,$unitprice,$invoiceno,$freight,$replacement,undef,$datereceived); } } + +if (C4::Context->preference("marcflavour") eq "MARC21") { + AddMarcFields( $biblionumber, { 952 => [ e => $supplierid, + d => $datereceived, + g => $unitprice, + v => $replacement, + w => $datereceived, # XXX + ], + } ); +} + print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoice=$invoiceno&supplierid=$supplierid&freight=$freight&gst=$gst&datereceived=$datereceived$error_url_str"); -- 1.6.5 From robin at catalyst.net.nz Tue Sep 13 03:03:40 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Tue, 13 Sep 2011 13:03:40 +1200 Subject: [Koha-patches] [PATCH] Bug 6636 - add 'powered by Koha' text to OPAC footer Message-ID: <1315875820-9987-1-git-send-email-robin@catalyst.net.nz> From: Mason James Signed-off-by: Robin Sheat --- C4/Auth.pm | 1 + installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 ++++++ .../prog/en/modules/admin/preferences/opac.pref | 7 ++++++ koha-tmpl/opac-tmpl/prog/en/css/opac.css | 14 +++++++++++- .../opac-tmpl/prog/en/includes/opac-bottom.inc | 23 +++++++++++++------- 6 files changed, 44 insertions(+), 9 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 495f04c..4fe9ecd 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -435,6 +435,7 @@ sub get_template_and_user { opac_limit_override => $opac_limit_override, OpacBrowser => C4::Context->preference("OpacBrowser"), OpacCloud => C4::Context->preference("OpacCloud"), + OpacKohaUrl => C4::Context->preference("OpacKohaUrl"), OpacMainUserBlock => "" . C4::Context->preference("OpacMainUserBlock"), OpacNav => "" . C4::Context->preference("OpacNav"), OpacPasswordChange => C4::Context->preference("OpacPasswordChange"), diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 79d4893..1b40d2d 100755 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -318,3 +318,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6b88c29..cccf88f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4446,6 +4446,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(qq|INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','0',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL)|); + print "Upgrade to $DBversion done (Add syspref 'OpacKohaUrl')\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 8bbf692..8d6974e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -86,6 +86,13 @@ OPAC: no: "Don't show" - the name of the patron that has an item checked out on item detail pages on the OPAC. - + - pref: OpacKohaUrl + default: 0 + choices: + yes: Show + no: "Don't show" + - "'Powered by Koha' text on OPAC footer." + - - pref: OpacHighlightedWords choices: yes: Highlight diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 60afea7..e9e03ff 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -2038,4 +2038,16 @@ div.bibmessage { background-color : #ffffb0; border-radius : 5px; padding : 3px; #renewall_link { background-image : url(../../images/checks.png); -} \ No newline at end of file +} + +div.koha_url { + border-top: none !important; +} +span.koha_url { + position: absolute; + right: 0; +} +a.koha_url { + text-decoration:none; + color: #666666; +} diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc index c76d85c..a5ad55f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc @@ -1,14 +1,15 @@ - [% IF ( opaccredits ) %]
    [% opaccredits %]
    [% END %]
    -[% IF ( opaclanguagesdisplay ) %] -[% IF ( languages_loop ) %] + +[% IF opaclanguagesdisplay || OpacKohaUrl %] +
    +[% IF languages_loop && opaclanguagesdisplay %] [% UNLESS ( one_language_enabled ) %] -
    Languages: + Languages: [% FOREACH languages_loo IN languages_loop %] [% IF ( languages_loo.group_enabled ) %] [% IF ( languages_loo.plural ) %] @@ -22,14 +23,13 @@ [% ELSE %]
  • [% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] ([% sublanguages_loo.rfc4646_subtag %])
  • [% END %] - [% END %] + [% END %] [% END %]
    - [% ELSE %] - [% IF ( languages_loo.group_enabled ) %] + [% IF ( languages_loo.group_enabled ) %] [% IF ( languages_loo.current ) %] [% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %] [% ELSE %] @@ -39,9 +39,16 @@ [% END %] [% END %][% UNLESS ( loop.last ) %] | [% END %] [% END %] - [% END %] [% END %] + +[% IF ( OpacKohaUrl ) %] + + Powered by Koha   + +[% END %] + + [% END %] [% IF ( Babeltheque ) %] -- 1.7.4.1 From robin at catalyst.net.nz Tue Sep 13 06:26:43 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Tue, 13 Sep 2011 16:26:43 +1200 Subject: [Koha-patches] [PATCH] Bug 6360 - add some more sounds to some happenings on returns Message-ID: <1315888003-14789-1-git-send-email-robin@catalyst.net.nz> This adds an alert sound to various events around transfers and holds when items are being returned, to make it more apparent that attention is needed. --- .../intranet-tmpl/prog/en/modules/circ/returns.tt | 32 ++++++++++++++----- 1 files changed, 23 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 4224ab1..2a9b47e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -109,8 +109,8 @@ function Dopop(link) { [% IF ( soundon ) %] -[% END %] - +[% END %] +

    Hold Found (item is already waiting): [% title |html %]

    [% IF ( reservenotes ) %]

    Notes: [% reservenotes %]

    [% END %] @@ -150,6 +150,9 @@ function Dopop(link) { [% IF ( diffbranch ) %] + [% IF ( soundon ) %] + + [% END %]

    Hold needing transfer found: [% title |html %]

    Hold for:

    @@ -188,10 +191,18 @@ function Dopop(link) { [% IF ( transfer ) %]
    -

    Please return [% title or "item" |html %] to [% homebranchname %]

    [% END %] +

    Please return [% title or "item" |html %] to [% homebranchname %]

    +
    + [% IF ( soundon ) %] + + [% END %] + [% END %] [% IF ( needstransfer ) %] + [% IF ( soundon ) %] + + [% END %]

    This item needs to be transferred to [% homebranchname %]

    Transfer Now?
    @@ -208,10 +219,13 @@ function Dopop(link) { [% END %]
    - [% END %] + [% END %] [% IF ( diffbranch ) %] + [% IF ( soundon ) %] + + [% END %]

    Item Consigned:

    @@ -236,11 +250,11 @@ function Dopop(link) { [% IF ( reserved ) %] - -[% IF ( soundon ) %] - -[% END %] - + + [% IF ( soundon ) %] + + [% END %] +

    Hold Found: [% title |html %]

    [% IF ( reservenotes ) %]

    Notes: [% reservenotes %]

    [% END %] -- 1.7.4.1 From magnus at enger.priv.no Tue Sep 13 08:30:12 2011 From: magnus at enger.priv.no (Magnus Enger) Date: Tue, 13 Sep 2011 08:30:12 +0200 Subject: [Koha-patches] [PATCH] Bug 4877 [ENH] Use DocBook for koha-common manual pages Message-ID: <1315895412-3405-1-git-send-email-magnus@enger.priv.no> This patch - deletes debian/scripts/koha-create.8 - adds debian/docs/koha-create.xml and koha-remove.xml --- debian/docs/koha-create.xml | 216 +++++++++++++++++++++++++++++++++++++++++ debian/docs/koha-remove.xml | 36 +++++++ debian/scripts/koha-create.8 | 221 ------------------------------------------ 3 files changed, 252 insertions(+), 221 deletions(-) create mode 100644 debian/docs/koha-create.xml create mode 100644 debian/docs/koha-remove.xml delete mode 100644 debian/scripts/koha-create.8 diff --git a/debian/docs/koha-create.xml b/debian/docs/koha-create.xml new file mode 100644 index 0000000..32cdec3 --- /dev/null +++ b/debian/docs/koha-create.xml @@ -0,0 +1,216 @@ +
    +koha-create + +Koha is the first free software library automation package. + + The Koha Communnity + http://koha-community.org/ + + + + + + + koha-create + 8 + + + + koha-create + Create a new Koha instance. + UNIX/Linux + + + + + koha-create + || + marc21|normarc|unimarc + en|nb|fr + /path/to/some.sql + /path/to/config + n + instancename + + + + Options + + + + + + Create a new datbase on localhost. If the database you want to use does not reside on localhost, you can use and , see below. + + + + + + + This option will create a file called instancename-db-request.txt in your current directory that contains information about how the database needs to be set up. + + + + + + + When you have run koha-create with the option, and a database has been set up, you can finnish your installation by running koha-create with this option. + + + + + + + Path to an alternative config file. This file can hold the same variables as the default config file, see below for details. + + + + + + + Path to an SQL-file other than the one pointed to in the default or alternative config file. Corresponds to the DEFAULTSQL config file variable. + + + + + + + Specifies format of MARC records to be indexed by Zebra. Corresponds to the ZEBRA_MARC_FORMAT config file variable. + + + + + + + Primary language for Zebra indexing. Corresponds to the ZEBRA_LANGUAGE config file variable. + + + + + + + Description + koha-create creates a new Koha instance. It is meant for a site that provides Koha hosting, and serves several sites from the same host. + The name of the instance is used as the domain name for Apache, Unix user and group names, and MySQL username and database names are derived from it. Unix user and group are named instance-koha. MySQL username is koha_instance, and database is koha_instance. + The Unix user has logins disabled. The password for MySQL is generated randomly, and printed to the terminal. + The instance name is used as the domain name (ServerName) for Apache. The public catalogue (OPAC), for library customers, is on port 80. The staff client interface is configured similarly, depending on the settings in /etc/koha/koha-sites.conf or alternate config file. + After the Koha instance is created, it is ready to be used, but the librarian needs to log in via the intranet and configure things. + Several configuration variables are available for adjusting this behavior. The variables are put into /etc/koha/koha-site.conf. The following variables are obeyed: + + + + + + + The domain to append to the instance name, for Apache ServerName. Default is empty. The value must begin with a period. + + + + + + + The port for the intranet. If you set this to empty or 80, then you must also define INTRAPREFIX or INTRASUFFIX. + + + + + + + This is inserted before the instance name when forming Apache ServerName. For subdomains, make sure it ends with a period. + + + + + + + This is inserted after the instance name, but before the domain name, when forming Apache ServerName. + + + + + + + An SQL file (compressed with gzip) that can be fed to mysql(1) to initialize the database after it has been created. Might be created using koha-dump-defaults(8). + + + + + + + Specifies format of MARC records to be indexed by Zebra. Possible values are 'marc21', 'normarc' and 'unimarc'. + + + + + + + Primary language for Zebra indexing. Possible values are 'en', 'fr' and 'nb'. + + + + + + Order of precedence for config options, from lowest to highest: + + + The defaults set in the code of koha-create + /etc/koha/koha-sites.conf + Config file specified with + Individual command line options + + + + + Files + + + + + Configuration variables are read from this file, if it exists. + + + + + + Bugs + The program is a bit fragile. If something goes wrong, it does not clean up after itself. + Bugs can be reported here: http://bugs.koha-community.org/bugzilla3/ + + + Example + + To create a new Koha instance: + + koha-create hslibrary + + The public catalog is now at http://hslibrary/ and the librarian interface at http://hslibrary:8080/. + + To use full domain names, and have the intranet interface on port 80, but on a different domain name, add the following variables to the configuration file: + + + DOMAIN=".example.com" + INTRAPORT="" + INTRASUFFIX="-intra" + + + This will result in the addresses for the public and intranet interfaces becoming these: + + + http://hslibrary.example.com/ + http://hslibrary-intra.example.com/ + + Configuration changes only apply to instances created afterwards. + + + + See also + + + koha-remove(8) + + + + + + +
    diff --git a/debian/docs/koha-remove.xml b/debian/docs/koha-remove.xml new file mode 100644 index 0000000..5d5767f --- /dev/null +++ b/debian/docs/koha-remove.xml @@ -0,0 +1,36 @@ +
    +koha-remove + +Koha is the first free software library automation package. + + The Koha Communnity + http://koha-community.org/ + + + + + + + koha-remove + 8 + + + + koha-remove + Remove one or more Koha instance(s). + UNIX/Linux + + + + + koha-remove + instancename + + + + Description + Remove one or more Koha instance(s). This removes all files associated with a Koha instance. + + + +
    diff --git a/debian/scripts/koha-create.8 b/debian/scripts/koha-create.8 deleted file mode 100644 index 1c570fe..0000000 --- a/debian/scripts/koha-create.8 +++ /dev/null @@ -1,221 +0,0 @@ -.\" Copyright 2010 Catalyst IT, Ltd -.\" -.\" This program 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. -.\" -.\" This program 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 this program. If not, see . -.\=========================================================== -.TH KOHA-CREATE 8 "2011-08-28" "Koha" -.\=========================================================== -.SH NAME -koha-create \(em create a new Koha instance -.\=========================================================== -.SH SYNOPSIS -.B koha-create -[ -.B \-\^\-create-db|--request-db|--populate-db -] -.br -[ -.B \-\^\-marcflavor \fImarc21|normarc|unimarc\fP -] -.br -[ -.B \-\^\-zebralang \fIen|nb|fr\fP -] -[ -.B \-\^\-defaultsql \fIsql-file\fP -] -.br -[ -.B \-\^\-configfile \fIconfig-file\fP -] -.IR instancename -.\=========================================================== -.SH OPTIONS -.TP \w'\fB\-\^\-populate-db\fP'u+3n -.B \-\^\-create-db -Create a new datbase on localhost. If the database you want to use does -not reside on localhost, you can use --request-db and --populate-db, see below. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-request-db -This option will create a file called -.IR instancename-db-request.txt -in your current directory that contains information about -how the database needs to be set up. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-populate-db -When you have run koha-create with the --request-db option, and a database -has been set up, you can finnish your installation by running koha-create -with this option. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-configfile -Path to an alternative config file. This file can hold the same variables as -the default config file, see below for details. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-defaultsql -Path to an SQL-file other than the one pointed to in the default or alternative -config file. Corresponds to the DEFAULTSQL config file variable. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-marcflavor -Specifies format of MARC records to be indexed by Zebra. Corresponds to the -ZEBRA_MARC_FORMAT config file variable. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-zebralang -Primary language for Zebra indexing. Corresponds to the ZEBRA_LANGUAGE -config file variable. -.\=========================================================== -.SH DESCRIPTION -.B koha-create -creates a new Koha instance. -It is meant for a site that provides Koha hosting, -and serves several sites from the same host. -.PP -The name of the instance is used as the domain name for Apache, -Unix user and group names, and MySQL username and database names -are derived from it. -Unix user and group are named -.IR instance -koha. -MySQL username is -.RI koha_ instance , -and database is -.RI koha_ instance . -.PP -The Unix user has logins disabled. -The password for MySQL is generated randomly, and printed to the terminal. -.PP -The instance name is used as the domain name (ServerName) for Apache. -The public catalogue (OPAC), for library customers, is on port 80. -The staff client interface is configured similarly, depending on the settings -in -.B /etc/koha/koha-site.conf -or alternate config file. -.PP -After the Koha instance is created, it is ready to be used, -but the librarian needs to log in via the intranet and configure things. -.PP -Several configuration variables are available for adjusting this behavior. -The variables are put into -.BR /etc/koha/koha-site.conf . -The following variables are obeyed: -.PP -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B DOMAIN -The domain to append to the instance name, for Apache ServerName. -Default is empty. -The value must begin with a period. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B INTRAPORT -The port for the intranet. -If you set this to empty or 80, then you -.I must -also define -.B INTRAPREFIX -or -.BR INTRASUFFIX . -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B INTRAPREFIX -This is inserted before the instance name when forming Apache ServerName. -For subdomains, make sure it ends with a period. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B INTRASUFFIX -This is inserted after the instance name, -but before the domain name, -when forming Apache ServerName. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B DEFAULTSQL -An SQL file (compressed with gzip) that can be fed to -.BR mysql (1) -to initialize the database after it has been created. -Might be created using -.BR koha-dump-defaults (8). -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B ZEBRA_MARC_FORMAT -Specifies format of MARC records to be indexed by Zebra. Possible values are 'marc21', 'normarc' and 'unimarc'. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B ZEBRA_LANGUAGE -Primary language for Zebra indexing. Possible values are 'en', 'fr' and 'nb'. -.TP -Order of precedence for config options, from lowest to highest: -.RS -.nf -1. The defaults set in the code of koha-create -2. /etc/koha/koha-sites.conf -3. Config file specified with --configfile -4. Individual command line options -.fi -.RE -.\=========================================================== -.SH FILES -.TP -.B /etc/koha/koha-site.conf -Configuration variables are read from this file, if it exists. -.\=========================================================== -.SH BUGS -.TP -The program is a bit fragile. If something goes wrong, it does not clean up after itself. -.TP -Bugs can be reported here: http://bugs.koha-community.org/bugzilla3/ -.\=========================================================== -.SH EXAMPLE -To create a new Koha instance: -.PP -.RS -koha-create hslibrary -.RE -.PP -The public catalog is now at -.I http://hslibrary/ -and the librarian interface at -.IR http://hslibrary:8080/ . -.PP -To use full domain names, and have the intranet interface on port 80, but -on a different domain name, add the following variables to the -configuration file: -.PP -.nf -.RS -DOMAIN=".example.com" -INTRAPORT="" -INTRASUFFIX="-intra" -.RE -.fi -.PP -This will result in the addresses for the public and intranet interfaces -becoming these: -.PP -.nf -.RS -http://hslibrary.example.com/ -http://hslibrary-intra.example.com/ -.RE -.fi -.PP -Configuration changes only apply to instances created afterwards. -.\=========================================================== -.SH "SEE ALSO" -.BR koha-remove (8). -.PP -.B http://koha-community.org/ - -- 1.7.4.1 From oleonard at myacpl.org Tue Sep 13 16:04:07 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Tue, 13 Sep 2011 10:04:07 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 6458 - incorrect parsing result in translation processing Message-ID: <1315922647-17790-1-git-send-email-oleonard@myacpl.org> Fixing improperly nested template logic inside HTML tags in budgets admin search form. --- .../prog/en/includes/budgets-admin-search.inc | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-admin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-admin-search.inc index 099707d..050699b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-admin-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-admin-search.inc @@ -61,7 +61,11 @@ YAHOO.util.Event.onContentReady("header_search", function() { [% FOREACH branchloo IN branchloop %] - + [% IF ( branchloo.selected ) %] + + [% ELSE %] + + [% END %] [% END %] -- 1.7.3 From oleonard at myacpl.org Tue Sep 13 16:08:25 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Tue, 13 Sep 2011 10:08:25 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 6458 - incorrect parsing result in translation processing Message-ID: <1315922905-17885-1-git-send-email-oleonard@myacpl.org> Fixing improperly nested template logic inside HTML tags in CSV profiles template Also fixing improperly scoped template variable which prevented the current profile from being preselected under the edit tab. --- .../prog/en/modules/tools/csv-profiles.tt | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt index 7432bf6..f3c5192 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt @@ -101,7 +101,11 @@ function reloadPage(p) {
  • @@ -129,7 +133,7 @@ function reloadPage(p) { - [% IF ( selected_subfield_separator == ',' ) %] [% ELSE %] -- 1.7.3 From oleonard at myacpl.org Tue Sep 13 18:31:52 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Tue, 13 Sep 2011 12:31:52 -0400 Subject: [Koha-patches] [PATCH] Follow-up fix for Bug 6458, incorrect parsing result in translation processing Message-ID: <1315931512-18842-1-git-send-email-oleonard@myacpl.org> Somehow some markup which should have been deleted by a previous patch has reappeared, messing up the display of the MARC editor. This patch removes that section again. --- .../prog/en/modules/cataloguing/addbiblio.tt | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index a69a1f4..09bf2d6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -857,7 +857,6 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
    [% UNLESS advancedMARCEditor %] -
    [% END %] [% ELSE %] @@ -72,15 +86,29 @@ [% IF ( messaging_preference.transport_email ) %] [% ELSE %] @@ -90,15 +118,29 @@ [% IF ( messaging_preference.has_digest ) %] [% ELSE %] -- 1.7.3 From f.demians at tamil.fr Wed Sep 14 22:01:10 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Wed, 14 Sep 2011 22:01:10 +0200 Subject: [Koha-patches] [PATCH] Bug 6869 Batch item modification fails whit accented characters Message-ID: <1316030471-18211-1-git-send-email-f.demians@tamil.fr> Corrects a problem in batchMod.pl when accented characters are used. When modifying multiple items in batchMod.pl, the batch modification fails if accented characters are used in any of the fields of the modification form. This is a port of Fr?d?rick Capovilla patch from 3.2 to 3.4 version --- tools/batchMod.pl | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 9d4431b..04cfc87 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -135,6 +135,7 @@ if ($op eq "action") { my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField("items.itemnumber", ""); if ($values_to_modify){ my $xml = TransformHtmlToXml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag, 'ITEM'); + utf8::encode($xml); $marcitem = MARC::Record::new_from_xml($xml, 'UTF-8'); } if ($values_to_blank){ -- 1.7.6.1 From f.demians at tamil.fr Wed Sep 14 22:01:11 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Wed, 14 Sep 2011 22:01:11 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] [3.2] Corrects a problem in batchMod.pl when accented characters are used. In-Reply-To: <1316030471-18211-1-git-send-email-f.demians@tamil.fr> References: <1316030471-18211-1-git-send-email-f.demians@tamil.fr> Message-ID: <1316030471-18211-2-git-send-email-f.demians@tamil.fr> From: Fr?d?rick Capovilla The batch modification failed with a XML parsing error if any of the modified fields contains accented characters. To be applied on 3.2 if this branch isn't orphean. Signed-off-by: Fr?d?ric Demians --- tools/batchMod.pl | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tools/batchMod.pl b/tools/batchMod.pl index c400ae9..aa683ad 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -145,6 +145,7 @@ if ($op eq "action") { } else { if ($something_to_modify) { my $xml = TransformHtmlToXml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag, 'ITEM'); + utf8::encode($xml); my $marcitem = MARC::Record::new_from_xml($xml, 'UTF-8'); my $localitem = TransformMarcToKoha( $dbh, $marcitem, "", 'items' ); my $localmarcitem=Item2Marc($itemdata); -- 1.7.6.1 From lrea at nekls.org Wed Sep 14 22:04:16 2011 From: lrea at nekls.org (Liz Rea) Date: Wed, 14 Sep 2011 15:04:16 -0500 Subject: [Koha-patches] [PATCH] Bug 6870 [enh] - allow opac-userupdate.pl to use the patron's email as 'from' address Message-ID: <1316030656-2757-1-git-send-email-lrea@nekls.org> Patch makes it so that Koha sends patron update emails from the first valid patron email address, instead of from the KohaAdmin or branch email address. This patch should make it so that libraries can directly reply to patrons regarding patron updates. To test: Create a patron with no email address, do a patron update and observe the to: and from: - they should both be the KohaAdminEmail address. Add an email address to that same patron, and send a patron update. Observe the to: and from: - the from: should be the first valid email address of the patron, to should be the KohaAdminEmail address. --- opac/opac-userupdate.pl | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/opac/opac-userupdate.pl b/opac/opac-userupdate.pl index aa5858a..f8273ce 100755 --- a/opac/opac-userupdate.pl +++ b/opac/opac-userupdate.pl @@ -48,6 +48,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( # get borrower information .... my ( $borr ) = GetMemberDetails( $borrowernumber ); +my ( $patronemail ) = GetFirstValidEmailAddress($borrowernumber); my $lib = GetBranchDetail($borr->{'branchcode'}); # handle the new information.... @@ -80,6 +81,10 @@ if ( !$updateemailaddress || $updateemailaddress eq '' ) { exit; } +if ( !$patronemail || $patronemail eq '' ) { + $patronemail = $updateemailaddress; +}; + if ( $query->param('modify') ) { # get all the fields: @@ -117,7 +122,7 @@ EOF $message .= "\n\nThanks,\nKoha\n\n"; my %mail = ( To => $updateemailaddress, - From => $updateemailaddress, + From => $patronemail, Subject => "User Request for update of Record.", Message => $message, 'Content-Type' => 'text/plain; charset="utf8"', -- 1.7.2.5 From robin at catalyst.net.nz Thu Sep 15 08:02:35 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Thu, 15 Sep 2011 18:02:35 +1200 Subject: [Koha-patches] [PATCH] Bug 4877 [ENH] Use DocBook for koha-common manual pages Message-ID: <1316066555-2313-1-git-send-email-robin@catalyst.net.nz> From: Magnus Enger This patch - deletes debian/scripts/koha-create.8 - adds debian/docs/koha-create.xml and koha-remove.xml Signed-off-by: Robin Sheat --- debian/docs/koha-create.xml | 216 +++++++++++++++++++++++++++++++++++++++++ debian/docs/koha-remove.xml | 36 +++++++ debian/scripts/koha-create.8 | 221 ------------------------------------------ 3 files changed, 252 insertions(+), 221 deletions(-) create mode 100644 debian/docs/koha-create.xml create mode 100644 debian/docs/koha-remove.xml delete mode 100644 debian/scripts/koha-create.8 diff --git a/debian/docs/koha-create.xml b/debian/docs/koha-create.xml new file mode 100644 index 0000000..32cdec3 --- /dev/null +++ b/debian/docs/koha-create.xml @@ -0,0 +1,216 @@ +
    +koha-create + +Koha is the first free software library automation package. + + The Koha Communnity + http://koha-community.org/ + + + + + + + koha-create + 8 + + + + koha-create + Create a new Koha instance. + UNIX/Linux + + + + + koha-create + || + marc21|normarc|unimarc + en|nb|fr + /path/to/some.sql + /path/to/config + n + instancename + + + + Options + + + + + + Create a new datbase on localhost. If the database you want to use does not reside on localhost, you can use and , see below. + + + + + + + This option will create a file called instancename-db-request.txt in your current directory that contains information about how the database needs to be set up. + + + + + + + When you have run koha-create with the option, and a database has been set up, you can finnish your installation by running koha-create with this option. + + + + + + + Path to an alternative config file. This file can hold the same variables as the default config file, see below for details. + + + + + + + Path to an SQL-file other than the one pointed to in the default or alternative config file. Corresponds to the DEFAULTSQL config file variable. + + + + + + + Specifies format of MARC records to be indexed by Zebra. Corresponds to the ZEBRA_MARC_FORMAT config file variable. + + + + + + + Primary language for Zebra indexing. Corresponds to the ZEBRA_LANGUAGE config file variable. + + + + + + + Description + koha-create creates a new Koha instance. It is meant for a site that provides Koha hosting, and serves several sites from the same host. + The name of the instance is used as the domain name for Apache, Unix user and group names, and MySQL username and database names are derived from it. Unix user and group are named instance-koha. MySQL username is koha_instance, and database is koha_instance. + The Unix user has logins disabled. The password for MySQL is generated randomly, and printed to the terminal. + The instance name is used as the domain name (ServerName) for Apache. The public catalogue (OPAC), for library customers, is on port 80. The staff client interface is configured similarly, depending on the settings in /etc/koha/koha-sites.conf or alternate config file. + After the Koha instance is created, it is ready to be used, but the librarian needs to log in via the intranet and configure things. + Several configuration variables are available for adjusting this behavior. The variables are put into /etc/koha/koha-site.conf. The following variables are obeyed: + + + + + + + The domain to append to the instance name, for Apache ServerName. Default is empty. The value must begin with a period. + + + + + + + The port for the intranet. If you set this to empty or 80, then you must also define INTRAPREFIX or INTRASUFFIX. + + + + + + + This is inserted before the instance name when forming Apache ServerName. For subdomains, make sure it ends with a period. + + + + + + + This is inserted after the instance name, but before the domain name, when forming Apache ServerName. + + + + + + + An SQL file (compressed with gzip) that can be fed to mysql(1) to initialize the database after it has been created. Might be created using koha-dump-defaults(8). + + + + + + + Specifies format of MARC records to be indexed by Zebra. Possible values are 'marc21', 'normarc' and 'unimarc'. + + + + + + + Primary language for Zebra indexing. Possible values are 'en', 'fr' and 'nb'. + + + + + + Order of precedence for config options, from lowest to highest: + + + The defaults set in the code of koha-create + /etc/koha/koha-sites.conf + Config file specified with + Individual command line options + + + + + Files + + + + + Configuration variables are read from this file, if it exists. + + + + + + Bugs + The program is a bit fragile. If something goes wrong, it does not clean up after itself. + Bugs can be reported here: http://bugs.koha-community.org/bugzilla3/ + + + Example + + To create a new Koha instance: + + koha-create hslibrary + + The public catalog is now at http://hslibrary/ and the librarian interface at http://hslibrary:8080/. + + To use full domain names, and have the intranet interface on port 80, but on a different domain name, add the following variables to the configuration file: + + + DOMAIN=".example.com" + INTRAPORT="" + INTRASUFFIX="-intra" + + + This will result in the addresses for the public and intranet interfaces becoming these: + + + http://hslibrary.example.com/ + http://hslibrary-intra.example.com/ + + Configuration changes only apply to instances created afterwards. + + + + See also + + + koha-remove(8) + + + + + + +
    diff --git a/debian/docs/koha-remove.xml b/debian/docs/koha-remove.xml new file mode 100644 index 0000000..5d5767f --- /dev/null +++ b/debian/docs/koha-remove.xml @@ -0,0 +1,36 @@ +
    +koha-remove + +Koha is the first free software library automation package. + + The Koha Communnity + http://koha-community.org/ + + + + + + + koha-remove + 8 + + + + koha-remove + Remove one or more Koha instance(s). + UNIX/Linux + + + + + koha-remove + instancename + + + + Description + Remove one or more Koha instance(s). This removes all files associated with a Koha instance. + + + +
    diff --git a/debian/scripts/koha-create.8 b/debian/scripts/koha-create.8 deleted file mode 100644 index 1c570fe..0000000 --- a/debian/scripts/koha-create.8 +++ /dev/null @@ -1,221 +0,0 @@ -.\" Copyright 2010 Catalyst IT, Ltd -.\" -.\" This program 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. -.\" -.\" This program 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 this program. If not, see . -.\=========================================================== -.TH KOHA-CREATE 8 "2011-08-28" "Koha" -.\=========================================================== -.SH NAME -koha-create \(em create a new Koha instance -.\=========================================================== -.SH SYNOPSIS -.B koha-create -[ -.B \-\^\-create-db|--request-db|--populate-db -] -.br -[ -.B \-\^\-marcflavor \fImarc21|normarc|unimarc\fP -] -.br -[ -.B \-\^\-zebralang \fIen|nb|fr\fP -] -[ -.B \-\^\-defaultsql \fIsql-file\fP -] -.br -[ -.B \-\^\-configfile \fIconfig-file\fP -] -.IR instancename -.\=========================================================== -.SH OPTIONS -.TP \w'\fB\-\^\-populate-db\fP'u+3n -.B \-\^\-create-db -Create a new datbase on localhost. If the database you want to use does -not reside on localhost, you can use --request-db and --populate-db, see below. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-request-db -This option will create a file called -.IR instancename-db-request.txt -in your current directory that contains information about -how the database needs to be set up. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-populate-db -When you have run koha-create with the --request-db option, and a database -has been set up, you can finnish your installation by running koha-create -with this option. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-configfile -Path to an alternative config file. This file can hold the same variables as -the default config file, see below for details. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-defaultsql -Path to an SQL-file other than the one pointed to in the default or alternative -config file. Corresponds to the DEFAULTSQL config file variable. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-marcflavor -Specifies format of MARC records to be indexed by Zebra. Corresponds to the -ZEBRA_MARC_FORMAT config file variable. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-zebralang -Primary language for Zebra indexing. Corresponds to the ZEBRA_LANGUAGE -config file variable. -.\=========================================================== -.SH DESCRIPTION -.B koha-create -creates a new Koha instance. -It is meant for a site that provides Koha hosting, -and serves several sites from the same host. -.PP -The name of the instance is used as the domain name for Apache, -Unix user and group names, and MySQL username and database names -are derived from it. -Unix user and group are named -.IR instance -koha. -MySQL username is -.RI koha_ instance , -and database is -.RI koha_ instance . -.PP -The Unix user has logins disabled. -The password for MySQL is generated randomly, and printed to the terminal. -.PP -The instance name is used as the domain name (ServerName) for Apache. -The public catalogue (OPAC), for library customers, is on port 80. -The staff client interface is configured similarly, depending on the settings -in -.B /etc/koha/koha-site.conf -or alternate config file. -.PP -After the Koha instance is created, it is ready to be used, -but the librarian needs to log in via the intranet and configure things. -.PP -Several configuration variables are available for adjusting this behavior. -The variables are put into -.BR /etc/koha/koha-site.conf . -The following variables are obeyed: -.PP -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B DOMAIN -The domain to append to the instance name, for Apache ServerName. -Default is empty. -The value must begin with a period. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B INTRAPORT -The port for the intranet. -If you set this to empty or 80, then you -.I must -also define -.B INTRAPREFIX -or -.BR INTRASUFFIX . -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B INTRAPREFIX -This is inserted before the instance name when forming Apache ServerName. -For subdomains, make sure it ends with a period. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B INTRASUFFIX -This is inserted after the instance name, -but before the domain name, -when forming Apache ServerName. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B DEFAULTSQL -An SQL file (compressed with gzip) that can be fed to -.BR mysql (1) -to initialize the database after it has been created. -Might be created using -.BR koha-dump-defaults (8). -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B ZEBRA_MARC_FORMAT -Specifies format of MARC records to be indexed by Zebra. Possible values are 'marc21', 'normarc' and 'unimarc'. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B ZEBRA_LANGUAGE -Primary language for Zebra indexing. Possible values are 'en', 'fr' and 'nb'. -.TP -Order of precedence for config options, from lowest to highest: -.RS -.nf -1. The defaults set in the code of koha-create -2. /etc/koha/koha-sites.conf -3. Config file specified with --configfile -4. Individual command line options -.fi -.RE -.\=========================================================== -.SH FILES -.TP -.B /etc/koha/koha-site.conf -Configuration variables are read from this file, if it exists. -.\=========================================================== -.SH BUGS -.TP -The program is a bit fragile. If something goes wrong, it does not clean up after itself. -.TP -Bugs can be reported here: http://bugs.koha-community.org/bugzilla3/ -.\=========================================================== -.SH EXAMPLE -To create a new Koha instance: -.PP -.RS -koha-create hslibrary -.RE -.PP -The public catalog is now at -.I http://hslibrary/ -and the librarian interface at -.IR http://hslibrary:8080/ . -.PP -To use full domain names, and have the intranet interface on port 80, but -on a different domain name, add the following variables to the -configuration file: -.PP -.nf -.RS -DOMAIN=".example.com" -INTRAPORT="" -INTRASUFFIX="-intra" -.RE -.fi -.PP -This will result in the addresses for the public and intranet interfaces -becoming these: -.PP -.nf -.RS -http://hslibrary.example.com/ -http://hslibrary-intra.example.com/ -.RE -.fi -.PP -Configuration changes only apply to instances created afterwards. -.\=========================================================== -.SH "SEE ALSO" -.BR koha-remove (8). -.PP -.B http://koha-community.org/ - -- 1.7.4.1 From robin at catalyst.net.nz Thu Sep 15 08:03:04 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Thu, 15 Sep 2011 18:03:04 +1200 Subject: [Koha-patches] [PATCH] Bug 4877 [ENH] Use DocBook for koha-common manual pages In-Reply-To: <1316066555-2313-1-git-send-email-robin@catalyst.net.nz> References: <1316066555-2313-1-git-send-email-robin@catalyst.net.nz> Message-ID: <1316066584-2363-1-git-send-email-robin@catalyst.net.nz> From: Magnus Enger This patch - deletes debian/scripts/koha-create.8 - adds debian/docs/koha-create.xml and koha-remove.xml Signed-off-by: Robin Sheat --- debian/docs/koha-create.xml | 216 +++++++++++++++++++++++++++++++++++++++++ debian/docs/koha-remove.xml | 36 +++++++ debian/scripts/koha-create.8 | 221 ------------------------------------------ 3 files changed, 252 insertions(+), 221 deletions(-) create mode 100644 debian/docs/koha-create.xml create mode 100644 debian/docs/koha-remove.xml delete mode 100644 debian/scripts/koha-create.8 diff --git a/debian/docs/koha-create.xml b/debian/docs/koha-create.xml new file mode 100644 index 0000000..32cdec3 --- /dev/null +++ b/debian/docs/koha-create.xml @@ -0,0 +1,216 @@ +
    +koha-create + +Koha is the first free software library automation package. + + The Koha Communnity + http://koha-community.org/ + + + + + + + koha-create + 8 + + + + koha-create + Create a new Koha instance. + UNIX/Linux + + + + + koha-create + || + marc21|normarc|unimarc + en|nb|fr + /path/to/some.sql + /path/to/config + n + instancename + + + + Options + + + + + + Create a new datbase on localhost. If the database you want to use does not reside on localhost, you can use and , see below. + + + + + + + This option will create a file called instancename-db-request.txt in your current directory that contains information about how the database needs to be set up. + + + + + + + When you have run koha-create with the option, and a database has been set up, you can finnish your installation by running koha-create with this option. + + + + + + + Path to an alternative config file. This file can hold the same variables as the default config file, see below for details. + + + + + + + Path to an SQL-file other than the one pointed to in the default or alternative config file. Corresponds to the DEFAULTSQL config file variable. + + + + + + + Specifies format of MARC records to be indexed by Zebra. Corresponds to the ZEBRA_MARC_FORMAT config file variable. + + + + + + + Primary language for Zebra indexing. Corresponds to the ZEBRA_LANGUAGE config file variable. + + + + + + + Description + koha-create creates a new Koha instance. It is meant for a site that provides Koha hosting, and serves several sites from the same host. + The name of the instance is used as the domain name for Apache, Unix user and group names, and MySQL username and database names are derived from it. Unix user and group are named instance-koha. MySQL username is koha_instance, and database is koha_instance. + The Unix user has logins disabled. The password for MySQL is generated randomly, and printed to the terminal. + The instance name is used as the domain name (ServerName) for Apache. The public catalogue (OPAC), for library customers, is on port 80. The staff client interface is configured similarly, depending on the settings in /etc/koha/koha-sites.conf or alternate config file. + After the Koha instance is created, it is ready to be used, but the librarian needs to log in via the intranet and configure things. + Several configuration variables are available for adjusting this behavior. The variables are put into /etc/koha/koha-site.conf. The following variables are obeyed: + + + + + + + The domain to append to the instance name, for Apache ServerName. Default is empty. The value must begin with a period. + + + + + + + The port for the intranet. If you set this to empty or 80, then you must also define INTRAPREFIX or INTRASUFFIX. + + + + + + + This is inserted before the instance name when forming Apache ServerName. For subdomains, make sure it ends with a period. + + + + + + + This is inserted after the instance name, but before the domain name, when forming Apache ServerName. + + + + + + + An SQL file (compressed with gzip) that can be fed to mysql(1) to initialize the database after it has been created. Might be created using koha-dump-defaults(8). + + + + + + + Specifies format of MARC records to be indexed by Zebra. Possible values are 'marc21', 'normarc' and 'unimarc'. + + + + + + + Primary language for Zebra indexing. Possible values are 'en', 'fr' and 'nb'. + + + + + + Order of precedence for config options, from lowest to highest: + + + The defaults set in the code of koha-create + /etc/koha/koha-sites.conf + Config file specified with + Individual command line options + + + + + Files + + + + + Configuration variables are read from this file, if it exists. + + + + + + Bugs + The program is a bit fragile. If something goes wrong, it does not clean up after itself. + Bugs can be reported here: http://bugs.koha-community.org/bugzilla3/ + + + Example + + To create a new Koha instance: + + koha-create hslibrary + + The public catalog is now at http://hslibrary/ and the librarian interface at http://hslibrary:8080/. + + To use full domain names, and have the intranet interface on port 80, but on a different domain name, add the following variables to the configuration file: + + + DOMAIN=".example.com" + INTRAPORT="" + INTRASUFFIX="-intra" + + + This will result in the addresses for the public and intranet interfaces becoming these: + + + http://hslibrary.example.com/ + http://hslibrary-intra.example.com/ + + Configuration changes only apply to instances created afterwards. + + + + See also + + + koha-remove(8) + + + + + + +
    diff --git a/debian/docs/koha-remove.xml b/debian/docs/koha-remove.xml new file mode 100644 index 0000000..5d5767f --- /dev/null +++ b/debian/docs/koha-remove.xml @@ -0,0 +1,36 @@ +
    +koha-remove + +Koha is the first free software library automation package. + + The Koha Communnity + http://koha-community.org/ + + + + + + + koha-remove + 8 + + + + koha-remove + Remove one or more Koha instance(s). + UNIX/Linux + + + + + koha-remove + instancename + + + + Description + Remove one or more Koha instance(s). This removes all files associated with a Koha instance. + + + +
    diff --git a/debian/scripts/koha-create.8 b/debian/scripts/koha-create.8 deleted file mode 100644 index 1c570fe..0000000 --- a/debian/scripts/koha-create.8 +++ /dev/null @@ -1,221 +0,0 @@ -.\" Copyright 2010 Catalyst IT, Ltd -.\" -.\" This program 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. -.\" -.\" This program 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 this program. If not, see . -.\=========================================================== -.TH KOHA-CREATE 8 "2011-08-28" "Koha" -.\=========================================================== -.SH NAME -koha-create \(em create a new Koha instance -.\=========================================================== -.SH SYNOPSIS -.B koha-create -[ -.B \-\^\-create-db|--request-db|--populate-db -] -.br -[ -.B \-\^\-marcflavor \fImarc21|normarc|unimarc\fP -] -.br -[ -.B \-\^\-zebralang \fIen|nb|fr\fP -] -[ -.B \-\^\-defaultsql \fIsql-file\fP -] -.br -[ -.B \-\^\-configfile \fIconfig-file\fP -] -.IR instancename -.\=========================================================== -.SH OPTIONS -.TP \w'\fB\-\^\-populate-db\fP'u+3n -.B \-\^\-create-db -Create a new datbase on localhost. If the database you want to use does -not reside on localhost, you can use --request-db and --populate-db, see below. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-request-db -This option will create a file called -.IR instancename-db-request.txt -in your current directory that contains information about -how the database needs to be set up. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-populate-db -When you have run koha-create with the --request-db option, and a database -has been set up, you can finnish your installation by running koha-create -with this option. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-configfile -Path to an alternative config file. This file can hold the same variables as -the default config file, see below for details. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-defaultsql -Path to an SQL-file other than the one pointed to in the default or alternative -config file. Corresponds to the DEFAULTSQL config file variable. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-marcflavor -Specifies format of MARC records to be indexed by Zebra. Corresponds to the -ZEBRA_MARC_FORMAT config file variable. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B \-\^\-zebralang -Primary language for Zebra indexing. Corresponds to the ZEBRA_LANGUAGE -config file variable. -.\=========================================================== -.SH DESCRIPTION -.B koha-create -creates a new Koha instance. -It is meant for a site that provides Koha hosting, -and serves several sites from the same host. -.PP -The name of the instance is used as the domain name for Apache, -Unix user and group names, and MySQL username and database names -are derived from it. -Unix user and group are named -.IR instance -koha. -MySQL username is -.RI koha_ instance , -and database is -.RI koha_ instance . -.PP -The Unix user has logins disabled. -The password for MySQL is generated randomly, and printed to the terminal. -.PP -The instance name is used as the domain name (ServerName) for Apache. -The public catalogue (OPAC), for library customers, is on port 80. -The staff client interface is configured similarly, depending on the settings -in -.B /etc/koha/koha-site.conf -or alternate config file. -.PP -After the Koha instance is created, it is ready to be used, -but the librarian needs to log in via the intranet and configure things. -.PP -Several configuration variables are available for adjusting this behavior. -The variables are put into -.BR /etc/koha/koha-site.conf . -The following variables are obeyed: -.PP -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B DOMAIN -The domain to append to the instance name, for Apache ServerName. -Default is empty. -The value must begin with a period. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B INTRAPORT -The port for the intranet. -If you set this to empty or 80, then you -.I must -also define -.B INTRAPREFIX -or -.BR INTRASUFFIX . -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B INTRAPREFIX -This is inserted before the instance name when forming Apache ServerName. -For subdomains, make sure it ends with a period. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B INTRASUFFIX -This is inserted after the instance name, -but before the domain name, -when forming Apache ServerName. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B DEFAULTSQL -An SQL file (compressed with gzip) that can be fed to -.BR mysql (1) -to initialize the database after it has been created. -Might be created using -.BR koha-dump-defaults (8). -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B ZEBRA_MARC_FORMAT -Specifies format of MARC records to be indexed by Zebra. Possible values are 'marc21', 'normarc' and 'unimarc'. -.\---------------------------------------------------------------------------------------------------------------------- -.TP -.B ZEBRA_LANGUAGE -Primary language for Zebra indexing. Possible values are 'en', 'fr' and 'nb'. -.TP -Order of precedence for config options, from lowest to highest: -.RS -.nf -1. The defaults set in the code of koha-create -2. /etc/koha/koha-sites.conf -3. Config file specified with --configfile -4. Individual command line options -.fi -.RE -.\=========================================================== -.SH FILES -.TP -.B /etc/koha/koha-site.conf -Configuration variables are read from this file, if it exists. -.\=========================================================== -.SH BUGS -.TP -The program is a bit fragile. If something goes wrong, it does not clean up after itself. -.TP -Bugs can be reported here: http://bugs.koha-community.org/bugzilla3/ -.\=========================================================== -.SH EXAMPLE -To create a new Koha instance: -.PP -.RS -koha-create hslibrary -.RE -.PP -The public catalog is now at -.I http://hslibrary/ -and the librarian interface at -.IR http://hslibrary:8080/ . -.PP -To use full domain names, and have the intranet interface on port 80, but -on a different domain name, add the following variables to the -configuration file: -.PP -.nf -.RS -DOMAIN=".example.com" -INTRAPORT="" -INTRASUFFIX="-intra" -.RE -.fi -.PP -This will result in the addresses for the public and intranet interfaces -becoming these: -.PP -.nf -.RS -http://hslibrary.example.com/ -http://hslibrary-intra.example.com/ -.RE -.fi -.PP -Configuration changes only apply to instances created afterwards. -.\=========================================================== -.SH "SEE ALSO" -.BR koha-remove (8). -.PP -.B http://koha-community.org/ - -- 1.7.4.1 From robin at catalyst.net.nz Thu Sep 15 08:05:17 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Thu, 15 Sep 2011 18:05:17 +1200 Subject: [Koha-patches] [PATCH] Bug 4877 - install generated man pages with build process In-Reply-To: <1316066555-2313-1-git-send-email-robin@catalyst.net.nz> References: <1316066555-2313-1-git-send-email-robin@catalyst.net.nz> Message-ID: <1316066717-2569-1-git-send-email-robin@catalyst.net.nz> This uses the docbook source files to generate the man pages, and installs them to their correct location when the packages are being built. This will make it easier for people to write man pages, thereby ensuring that people join in keeping documentation up to date. Note: adds docbook-xsl and xsltproc to the dependencies. Note2: applies on top of Magnus' other patch on this ticket. --- debian/control | 2 +- debian/control.in | 2 +- debian/koha-common.install | 2 +- debian/rules | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/debian/control b/debian/control index 8268b6b..0384e18 100644 --- a/debian/control +++ b/debian/control @@ -79,7 +79,7 @@ Build-Depends: libcgi-session-driver-memcached-perl, libyaml-syck-perl, perl, perl-modules, - debhelper (>= 7.0.50), gettext, python, python-debian + debhelper (>= 7.0.50), gettext, python, python-debian, xsltproc, docbook-xsl Package: koha-common Architecture: all diff --git a/debian/control.in b/debian/control.in index febc37e..5cafcb4 100644 --- a/debian/control.in +++ b/debian/control.in @@ -7,7 +7,7 @@ Standards-Version: 3.8.4 # See debian/rules, the override_dh_gencontrol rules. # There are some exceptions. Build-Depends:__AUTODEPENDS__, - debhelper (>= 7.0.50), gettext, python, python-debian + debhelper (>= 7.0.50), gettext, python, python-debian, xsltproc, docbook-xsl Package: koha-common Architecture: all diff --git a/debian/koha-common.install b/debian/koha-common.install index 1f78b0e..50affbd 100644 --- a/debian/koha-common.install +++ b/debian/koha-common.install @@ -28,4 +28,4 @@ debian/scripts/koha-start-zebra usr/sbin debian/scripts/koha-stop-zebra usr/sbin debian/scripts/koha-upgrade-schema usr/sbin debian/scripts/koha-upgrade-to-3.4 usr/sbin -debian/scripts/*.8 usr/share/man/man8 +debian/tmp_docbook/*.8 usr/share/man/man8 diff --git a/debian/rules b/debian/rules index 1b20293..64a1790 100755 --- a/debian/rules +++ b/debian/rules @@ -92,4 +92,7 @@ override_dh_auto_install: $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css/opac.css \ $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css/sco.css \ $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/css/staff-global*.css - + mkdir -p $(TMP)/debian/tmp_docbook + xsltproc --output $(TMP)/debian/tmp_docbook/ \ + /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \ + debian/docs/*.xml -- 1.7.4.1 From magnus at enger.priv.no Thu Sep 15 11:52:16 2011 From: magnus at enger.priv.no (Magnus Enger) Date: Thu, 15 Sep 2011 11:52:16 +0200 Subject: [Koha-patches] [PATCH] Bug 4877 [ENH] [SIGNED-OFF] install generated man pages with build process Message-ID: <1316080336-2835-1-git-send-email-magnus@enger.priv.no> From: Robin Sheat This uses the docbook source files to generate the man pages, and installs them to their correct location when the packages are being built. This will make it easier for people to write man pages, thereby ensuring that people join in keeping documentation up to date. Note: adds docbook-xsl and xsltproc to the dependencies. Note2: applies on top of Magnus' other patch on this ticket. Signed-off-by: Magnus Enger --- debian/control | 2 +- debian/control.in | 2 +- debian/koha-common.install | 2 +- debian/rules | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/debian/control b/debian/control index 8268b6b..0384e18 100644 --- a/debian/control +++ b/debian/control @@ -79,7 +79,7 @@ Build-Depends: libcgi-session-driver-memcached-perl, libyaml-syck-perl, perl, perl-modules, - debhelper (>= 7.0.50), gettext, python, python-debian + debhelper (>= 7.0.50), gettext, python, python-debian, xsltproc, docbook-xsl Package: koha-common Architecture: all diff --git a/debian/control.in b/debian/control.in index febc37e..5cafcb4 100644 --- a/debian/control.in +++ b/debian/control.in @@ -7,7 +7,7 @@ Standards-Version: 3.8.4 # See debian/rules, the override_dh_gencontrol rules. # There are some exceptions. Build-Depends:__AUTODEPENDS__, - debhelper (>= 7.0.50), gettext, python, python-debian + debhelper (>= 7.0.50), gettext, python, python-debian, xsltproc, docbook-xsl Package: koha-common Architecture: all diff --git a/debian/koha-common.install b/debian/koha-common.install index 1f78b0e..50affbd 100644 --- a/debian/koha-common.install +++ b/debian/koha-common.install @@ -28,4 +28,4 @@ debian/scripts/koha-start-zebra usr/sbin debian/scripts/koha-stop-zebra usr/sbin debian/scripts/koha-upgrade-schema usr/sbin debian/scripts/koha-upgrade-to-3.4 usr/sbin -debian/scripts/*.8 usr/share/man/man8 +debian/tmp_docbook/*.8 usr/share/man/man8 diff --git a/debian/rules b/debian/rules index 1b20293..64a1790 100755 --- a/debian/rules +++ b/debian/rules @@ -92,4 +92,7 @@ override_dh_auto_install: $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css/opac.css \ $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css/sco.css \ $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/css/staff-global*.css - + mkdir -p $(TMP)/debian/tmp_docbook + xsltproc --output $(TMP)/debian/tmp_docbook/ \ + /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \ + debian/docs/*.xml -- 1.7.4.1 From oleonard at myacpl.org Thu Sep 15 15:44:20 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 15 Sep 2011 09:44:20 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 6872 - Can't set default SMS messaging options for patron category Message-ID: <1316094260-27347-1-git-send-email-oleonard@myacpl.org> Passing SMS driver preference value to the template so that SMS options can be displayed when appropriate. --- admin/categorie.pl | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/admin/categorie.pl b/admin/categorie.pl index 576d7ca..521346b 100755 --- a/admin/categorie.pl +++ b/admin/categorie.pl @@ -113,6 +113,7 @@ if ($op eq 'add_form') { category_type => $data->{'category_type'}, DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), "type_".$data->{'category_type'} => 1, + SMSSendDriver => C4::Context->preference("SMSSendDriver") ); if (C4::Context->preference('EnhancedMessagingPreferences')) { C4::Form::MessagingPreferences::set_form_values({ categorycode => $categorycode } , $template); -- 1.7.3 From oleonard at myacpl.org Thu Sep 15 16:22:56 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 15 Sep 2011 10:22:56 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 6842 - Branch transfer limits broken Message-ID: <1316096576-28634-1-git-send-email-oleonard@myacpl.org> - Changing library select form so that chosen library is preselected - Changing pager
    to a

    so that nested form tags don't conflict. It was the addition of the javascript table pager which broke the functionality on this page. --- admin/branch_transfer_limits.pl | 1 + .../en/modules/admin/branch_transfer_limits.tt | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/admin/branch_transfer_limits.pl b/admin/branch_transfer_limits.pl index abba127..8c6f42e 100755 --- a/admin/branch_transfer_limits.pl +++ b/admin/branch_transfer_limits.pl @@ -58,6 +58,7 @@ my @branch_loop; for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { my %row =(value => $thisbranch, branchname => $branches->{$thisbranch}->{'branchname'}, + selected => $thisbranch eq $branchcode ? 1 : 0, ); push @branch_loop, \%row; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt index 5bb5185..2b007bf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt @@ -71,7 +71,11 @@ @@ -99,8 +103,8 @@ }).tablesorterPager({container: $("#pager[% codes_loo.code %]table"),positionFixed: false,size: 10}); }); - -  page(s) : +

    +

     page(s) : @@ -115,8 +119,8 @@ - - +

    +
    [% title |html %]
    [% IF ( messaging_form_inactive ) %] + [% IF ( messaging_preference.transports_sms ) %] + value="sms" checked="checked" disabled="disabled" /> + [% ELSE %] + + [% END %] [% ELSE %] + [% IF ( messaging_preference.transports_sms ) %] + + [% ELSE %] + value="sms" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').attr('checked','');" /> + [% END %] [% END %] [% IF ( messaging_form_inactive ) %] + [% IF ( messaging_preference.transports_email ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ( messaging_preference.transports_email ) %] - [% ELSE %] + value="email" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').attr('checked','');" /> + [% ELSE %] + value="email" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').attr('checked','');" /> + [% END %] [% END %] [% IF ( messaging_form_inactive ) %] - + [% IF ( messaging_preference.digest ) %] + + [% ELSE %] + + [% END %] [% ELSE %] - + [% IF ( messaging_preference.digest ) %] + + [% ELSE %] + + [% END %] [% END %]
    -- 1.7.3 From julian.maurice at biblibre.com Fri Sep 16 12:35:02 2011 From: julian.maurice at biblibre.com (Julian Maurice) Date: Fri, 16 Sep 2011 12:35:02 +0200 Subject: [Koha-patches] [PATCH] Bug 6874: Adds the ability to upload a file for a subfield Message-ID: <1316169302-9437-1-git-send-email-julian.maurice@biblibre.com> From: Matthias Meusburger Biblibre MT5108 --- C4/Biblio.pm | 18 ++- basket/basket.pl | 2 +- catalogue/MARCdetail.pl | 11 ++ catalogue/detail.pl | 2 +- cataloguing/value_builder/upload.pl | 188 ++++++++++++++++++++ installer/data/mysql/sysprefs.sql | 2 + installer/data/mysql/updatedatabase.pl | 14 ++ .../prog/en/modules/catalogue/MARCdetail.tt | 80 ++++++++- .../en/modules/cataloguing/value_builder/upload.tt | 50 +++++ .../value_builder/upload_delete_file.tt | 52 ++++++ kohaversion.pl | 2 +- misc/strip_value_from_tag.pl | 60 ++++++ opac/opac-MARCdetail.pl | 10 + opac/opac-basket.pl | 2 +- opac/opac-detail.pl | 2 +- 15 files changed, 475 insertions(+), 20 deletions(-) create mode 100755 cataloguing/value_builder/upload.pl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload_delete_file.tt create mode 100644 misc/strip_value_from_tag.pl diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 96baaef..d4d98c0 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1624,7 +1624,7 @@ sub GetMarcAuthors { =head2 GetMarcUrls - $marcurls = GetMarcUrls($record,$marcflavour); + $marcurls = GetMarcUrls($record,$marcflavour,$frameworkcode); Returns arrayref of URLs from MARC data, suitable to pass to tmpl loop. Assumes web resources (not uncommon in MARC21 to omit resource type ind) @@ -1632,15 +1632,19 @@ Assumes web resources (not uncommon in MARC21 to omit resource type ind) =cut sub GetMarcUrls { - my ( $record, $marcflavour ) = @_; + my ( $record, $marcflavour, $frameworkcode ) = @_; + + my $tagslib = &GetMarcStructure(1, $frameworkcode); + my $urltag = '856'; + my $urlsubtag = 'u'; my @marcurls; - for my $field ( $record->field('856') ) { + for my $field ( $record->field($urltag) ) { my @notes; for my $note ( $field->subfield('z') ) { push @notes, { note => $note }; } - my @urls = $field->subfield('u'); + my @urls = $field->subfield($urlsubtag); foreach my $url (@urls) { my $marcurl; if ( $marcflavour eq 'MARC21' ) { @@ -1669,7 +1673,11 @@ sub GetMarcUrls { $marcurl->{'toc'} = 1 if ( defined($s3) && $s3 =~ /^[Tt]able/ ); } else { $marcurl->{'linktext'} = $field->subfield('2') || C4::Context->preference('URLLinkText') || $url; - $marcurl->{'MARCURL'} = $url; + if ($tagslib->{ $urltag }->{ $urlsubtag }->{value_builder} eq "upload.pl") { + $marcurl->{'MARCURL'} = C4::Context->preference('uploadWebPath') . "/" . $url; + } else { + $marcurl->{'MARCURL'} = $url; + } } push @marcurls, $marcurl; } diff --git a/basket/basket.pl b/basket/basket.pl index 8fc15e4..59894b3 100755 --- a/basket/basket.pl +++ b/basket/basket.pl @@ -65,7 +65,7 @@ foreach my $biblionumber ( @bibs ) { my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); - my $marcurlsarray = GetMarcUrls ($record,$marcflavour); + my $marcurlsarray = GetMarcUrls ($record,$marcflavour, GetFrameworkCode($biblionumber)); my @items = GetItemsInfo( $biblionumber ); my $hasauthors = 0; diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index 0a2974b..19d26b8 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -82,6 +82,11 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +my $uploadWebPath; +if (C4::Context->preference('uploadWebPath')) { + $uploadWebPath = C4::Context->preference('uploadWebPath'); +} + my $record = GetMarcBiblio($biblionumber); if ( not defined $record ) { @@ -215,6 +220,12 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { GetAuthorisedValueDesc( $fields[$x_i]->tag(), $subf[$i][0], $subf[$i][1], '', $tagslib) || $subf[$i][1]; + if ($tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{value_builder} eq "upload.pl" and $uploadWebPath) { + my $file_uri = qq($uploadWebPath/$subf[$i][1]); + $subfield_data{marc_value} = qq/$subfield_data{marc_value}<\/a>/; + $subfield_data{is_file} = 1; + } + } $subfield_data{marc_subfield} = $subf[$i][0]; $subfield_data{marc_tag} = $fields[$x_i]->tag(); diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 8738737..744af0c 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -104,7 +104,7 @@ my $marcisbnsarray = GetMarcISBN( $record, $marcflavour ); my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries($record,$marcflavour); -my $marcurlsarray = GetMarcUrls ($record,$marcflavour); +my $marcurlsarray = GetMarcUrls ($record, $marcflavour, $fw); my $subtitle = GetRecordValue('subtitle', $record, $fw); # Get Branches, Itemtypes and Locations diff --git a/cataloguing/value_builder/upload.pl b/cataloguing/value_builder/upload.pl new file mode 100755 index 0000000..88e30de --- /dev/null +++ b/cataloguing/value_builder/upload.pl @@ -0,0 +1,188 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use C4::Auth; +use CGI qw/-utf8/; +use C4::Context; +use C4::Debug; + +use C4::AuthoritiesMarc; +use C4::Output; +use File::Basename; +use Text::Undiacritic qw/undiacritic/; +use Encode; + +#use open qw(:std :utf8); + + +my $upload_path = C4::Context->preference('uploadPath'); + +=head1 + +plugin_parameters : other parameters added when the plugin is called by the dopop function + +=cut + +sub plugin_parameters { + my ( $dbh, $record, $tagslib, $i, $tabloop ) = @_; + return ""; +} + +sub plugin_javascript { + my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; + my $function_name = $field_number; + my $res = " + +"; + + return ( $function_name, $res ); +} + +sub plugin { + my ($input) = @_; + my $index = $input->param('index'); + my $result = $input->param('result'); + my $delete = $input->param('delete'); + my $uploaded_file = $input->param('uploaded_file'); + + my $template_name = $result || $delete ? "upload_delete_file.tmpl" : "upload.tmpl"; + + my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { template_name => "cataloguing/value_builder/$template_name", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { editcatalogue => '*' }, + debug => 1, + } + ); + + + my $filefield = CGI::filefield( -name=>'uploaded_file', + -default=>'starting value', + -size=>50, + -maxlength=>80); + + $template->param( + index => $index, + result => $result, + filefield => $filefield + ); + + + # If there's already a file uploaded for this field, + # We handle is deletion + if ($delete) { + warn "deletion of $upload_path/$result"; + my $success = unlink("$upload_path/$result"); + if ($success) { + $template->param(success => $success); + } else { + $template->param(error => 1); + } + } + + + # Dealing with the uploaded file + if ($uploaded_file) { + + my $fh = $input->upload('uploaded_file'); + my $error; + my $success; + + if (defined $fh) { + + # Dealing with filenames: + + # Normalizing filename: + $uploaded_file = normalize_string($uploaded_file); + $uploaded_file = undiacritic($uploaded_file); + + # Checking for an existing filename in destination directory + if (-f "$upload_path/$uploaded_file") { + + # And getting a new one if needed + my ($dir, $file, $ext) = fileparse("$upload_path/$uploaded_file", qr/\.[^.]*/); + $uploaded_file = findname($dir, $file, $ext); + } + + # Copying the temp file to the destination directory + my $io_fh = $fh->handle; + open (OUTFILE, '>', "$upload_path/$uploaded_file") or $error = $!; + if (!$error) { + my $buffer; + while (my $bytesread = $io_fh->read($buffer,1024)) { + print OUTFILE $buffer; + } + close(OUTFILE); + $success = 1; + } else { + $error = "Could not write to destination file"; + } + } else { + $error = "Could not get the file"; + } + $template->param(success => $success) if ($success); + $template->param(error => $error) if ($error); + $template->param(uploaded_file => $uploaded_file); + } + + output_html_with_http_headers $input, $cookie, $template->output; +} + +sub findname { + my $file = shift; + my $dir = shift; + my $ext = shift; + + my $count = 1; + my $found = 0; + + while ($found == 0) { + if (-f "$dir/$file-$count$ext") { + $count++; + } else { + $found = 1; + } + } + + return "$file-$count$ext"; +} + +=head2 normalize_string + Given + a string + Returns a utf8 NFC normalized string + + Sample code : +=cut + +sub normalize_string{ + my ($string)=@_; + $debug and warn " string in normalize before normalize :",$string; + $string=decode_utf8($string,1); + $debug and warn " string in normalize :",$string; + $string=~s/\<|\>|\^|\;|\?|,|\-|\(|\)|\[|\]|\{|\}|\$|\%|\!|\*|\:|\\|\/|\&|\"|\'|\s/_/g; + $string=~s/\s+$//g; + $string=~s/^\s+//g; + return $string; +} + + +1; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 79d4893..a8562c0 100755 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -318,3 +318,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('uploadPath','','Sets the upload path for the upload.pl plugin','',''); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('uploadWebPath','','Set the upload path starting from document root for the upload.pl plugin','',''); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6b88c29..a903e07 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4446,6 +4446,20 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do(" + INSERT IGNORE INTO `systempreferences` (variable,value,explanation,options,type) VALUES('uploadPath','','Sets the upload path for the upload.pl plugin','',''); + "); + + $dbh->do(" + INSERT IGNORE INTO `systempreferences` (variable,value,explanation,options,type) VALUES('uploadWebPath','','Set the upload path starting from document root for the upload.pl plugin','',''); + "); + print "Upgrade to $DBversion done (Adding upload plugin sysprefs)\n"; + SetVersion($DBversion); +} + +=item DropAllForeignKeys($table) =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt index 3fac577..d774d9a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt @@ -109,7 +109,13 @@ function Changefwk(FwkList) {   [% UNLESS ( subfiel.hide_marc ) %][% subfiel.marc_subfield %][% END %] [% subfiel.short_desc %] - [% IF ( subfiel.is_url ) %][% subfiel.marc_value |html %][% ELSE %][% subfiel.marc_value |html %][% END %] + [% IF ( subfiel.is_url ) %] + [% subfiel.marc_value |html %] + [% ELSIF ( subfiel.is_file ) %] + [% subfiel.marc_value %] + [% ELSE %] + [% subfiel.marc_value |html %] + [% END %] [% IF ( subfiel.link ) %] Search on [% subfiel.marc_value |html %] @@ -139,7 +145,13 @@ function Changefwk(FwkList) {   [% UNLESS ( subfiel.hide_marc ) %][% subfiel.marc_subfield %][% END %] [% subfiel.short_desc %] - [% IF ( subfiel.is_url ) %][% subfiel.marc_value |html %][% ELSE %][% subfiel.marc_value |html %][% END %] + [% IF ( subfiel.is_url ) %] + [% subfiel.marc_value |html %] + [% ELSIF ( subfiel.is_file ) %] + [% subfiel.marc_value %] + [% ELSE %] + [% subfiel.marc_value |html %] + [% END %] [% IF ( subfiel.link ) %] Search on [% subfiel.marc_value |html %] @@ -169,7 +181,13 @@ function Changefwk(FwkList) {   [% UNLESS ( subfiel.hide_marc ) %][% subfiel.marc_subfield %][% END %] [% subfiel.short_desc %] - [% IF ( subfiel.is_url ) %][% subfiel.marc_value |html %][% ELSE %][% subfiel.marc_value |html %][% END %] + [% IF ( subfiel.is_url ) %] + [% subfiel.marc_value |html %] + [% ELSIF ( subfiel.is_file ) %] + [% subfiel.marc_value %] + [% ELSE %] + [% subfiel.marc_value |html %] + [% END %] [% IF ( subfiel.link ) %] Search on [% subfiel.marc_value |html %] @@ -199,7 +217,13 @@ function Changefwk(FwkList) {   [% UNLESS ( subfiel.hide_marc ) %][% subfiel.marc_subfield %][% END %] [% subfiel.short_desc %] - [% IF ( subfiel.is_url ) %][% subfiel.marc_value |html %][% ELSE %][% subfiel.marc_value |html %][% END %] + [% IF ( subfiel.is_url ) %] + [% subfiel.marc_value |html %] + [% ELSIF ( subfiel.is_url ) %] + [% subfiel.marc_value %] + [% ELSE %] + [% subfiel.marc_value |html %] + [% END %] [% IF ( subfiel.link ) %] Search on [% subfiel.marc_value |html %] @@ -229,7 +253,13 @@ function Changefwk(FwkList) {   [% UNLESS ( subfiel.hide_marc ) %][% subfiel.marc_subfield %][% END %] [% subfiel.short_desc %] - [% IF ( subfiel.is_url ) %][% subfiel.marc_value |html %][% ELSE %][% subfiel.marc_value |html %][% END %] + [% IF ( subfiel.is_url ) %] + [% subfiel.marc_value |html %] + [% ELSIF (subfiel.is_url ) %] + [% subfiel.marc_value %] + [% ELSE %] + [% subfiel.marc_value |html %] + [% END %] [% IF ( subfiel.link ) %] Search on [% subfiel.marc_value |html %] @@ -259,7 +289,13 @@ function Changefwk(FwkList) {   [% UNLESS ( subfiel.hide_marc ) %][% subfiel.marc_subfield %][% END %] [% subfiel.short_desc %] - [% IF ( subfiel.is_url ) %][% subfiel.marc_value |html %][% ELSE %][% subfiel.marc_value |html %][% END %] + [% IF ( subfiel.is_url ) %] + [% subfiel.marc_value |html %] + [% ELSIF (subfiel.is_url ) %] + [% subfiel.marc_value %] + [% ELSE %] + [% subfiel.marc_value |html %] + [% END %] [% IF ( subfiel.link ) %] Search on [% subfiel.marc_value |html %] @@ -289,7 +325,13 @@ function Changefwk(FwkList) {   [% UNLESS ( subfiel.hide_marc ) %][% subfiel.marc_subfield %][% END %] [% subfiel.short_desc %] - [% IF ( subfiel.is_url ) %][% subfiel.marc_value |html %][% ELSE %][% subfiel.marc_value |html %][% END %] + [% IF ( subfiel.is_url ) %] + [% subfiel.marc_value |html %] + [% ELSIF (subfiel.is_url ) %] + [% subfiel.marc_value %] + [% ELSE %] + [% subfiel.marc_value |html %] + [% END %] [% IF ( subfiel.link ) %] Search on [% subfiel.marc_value |html %] @@ -319,7 +361,13 @@ function Changefwk(FwkList) {   [% UNLESS ( subfiel.hide_marc ) %][% subfiel.marc_subfield %][% END %] [% subfiel.short_desc %] - [% IF ( subfiel.is_url ) %][% subfiel.marc_value |html %][% ELSE %][% subfiel.marc_value |html %][% END %] + [% IF ( subfiel.is_url ) %] + [% subfiel.marc_value |html %] + [% ELSIF (subfiel.is_url ) %] + [% subfiel.marc_value %] + [% ELSE %] + [% subfiel.marc_value |html %] + [% END %] [% IF ( subfiel.link ) %] Search on [% subfiel.marc_value |html %] @@ -349,7 +397,13 @@ function Changefwk(FwkList) {   [% UNLESS ( subfiel.hide_marc ) %][% subfiel.marc_subfield %][% END %] [% subfiel.short_desc %] - [% IF ( subfiel.is_url ) %][% subfiel.marc_value |html %][% ELSE %][% subfiel.marc_value |html %][% END %] + [% IF ( subfiel.is_url ) %] + [% subfiel.marc_value |html %] + [% ELSIF (subfiel.is_url ) %] + [% subfiel.marc_value %] + [% ELSE %] + [% subfiel.marc_value |html %] + [% END %] [% IF ( subfiel.link ) %] Search on [% subfiel.marc_value |html %] @@ -379,7 +433,13 @@ function Changefwk(FwkList) {   [% UNLESS ( subfiel.hide_marc ) %][% subfiel.marc_subfield %][% END %] [% subfiel.short_desc %] - [% IF ( subfiel.is_url ) %][% subfiel.marc_value |html %][% ELSE %][% subfiel.marc_value |html %][% END %] + [% IF ( subfiel.is_url ) %] + [% subfiel.marc_value |html %] + [% ELSIF (subfiel.is_url ) %] + [% subfiel.marc_value %] + [% ELSE %] + [% subfiel.marc_value |html %] + [% END %] [% IF ( subfiel.link ) %] Search on [% subfiel.marc_value |html %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload.tt new file mode 100644 index 0000000..0a8235e --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload.tt @@ -0,0 +1,50 @@ + + + + Upload plugin + + + + + + +[% IF ( success ) %] + + + + + The file [% uploaded_file %] has been successfully added. +

    + +[% ELSE %] + + [% IF ( error ) %] + Error: [% error %] +

    + [% ELSE %] + + [% IF ( uploaded_file ) %] + uploaded file: [% uploaded_file %] + [% ELSE %] +

    Please select the file to upload :

    +
    + [% filefield %] + + + + + [% END %] + [% END %] +[% END %] + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload_delete_file.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload_delete_file.tt new file mode 100644 index 0000000..cf0dc66 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload_delete_file.tt @@ -0,0 +1,52 @@ + + + + Upload plugin + + + + + + +[% IF ( success ) %] + + + + The file has been successfully deleted. +

    + +[% ELSE %] + + [% IF ( error ) %] + Error: Unable to delete the file. +

    + [% ELSE %] + + [% IF ( uploaded_file ) %] + uploaded file: [% uploaded_file %] + [% ELSE %] +

    File deletion

    +

    A file has already been uploaded for this field. Do you want to delete it?

    +
    + + + + + + + + [% END %] + [% END %] +[% END %] + + + diff --git a/kohaversion.pl b/kohaversion.pl index f864378..aa2eac2 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts : use strict; sub kohaversion { - our $VERSION = '3.05.00.011'; + our $VERSION = 'XXX'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install diff --git a/misc/strip_value_from_tag.pl b/misc/strip_value_from_tag.pl new file mode 100644 index 0000000..807e7b5 --- /dev/null +++ b/misc/strip_value_from_tag.pl @@ -0,0 +1,60 @@ +#!/usr/bin/perl + +# This script takes every biblio record in the database, +# looks for a value beginning with $find in $fieldtag$$subfieldtag +# and strips $find from this value. +# This was originally made for the file upload plugin, but might +# be used for other purposes. + +use strict; + +use Getopt::Long; +use C4::Context; +use C4::Biblio; + +my $debug = 0; + +# Which field are we processing? +my $fieldtag = "857"; +my $subfieldtag = "u"; + +# Whichi beginning pattern are we looking to delete? +my $find = "http://myurl.tld/"; +my $length = length($find); +my $pattern = qr|^$find|; + +print "Field $fieldtag\$$subfieldtag\n"; + +# Getting db connection +my $dbh = C4::Context->dbh; + +# Getting max bibnumber +my $query = "SELECT MAX(biblionumber) from biblio"; +my $sth = $dbh->prepare($query); +$sth->execute(); +my $bibliocount = $sth->fetchrow; + +warn "unable to get biblio count" and exit -1 unless $bibliocount; + +print "Biblio count : $bibliocount\n"; + +# Foreach each biblio +foreach (1..$bibliocount) { + my $found = 0; + my $record = GetMarcBiblio($_); + $debug and warn "unable to get marc for record $_" unless $record; + next unless $record; + foreach my $field ($record->field($fieldtag)) { + my $newfield = $field->clone(); + my $subfield = $newfield->subfield($subfieldtag); + if ($subfield and $subfield =~ $pattern) { + my $newsubfield = substr $subfield, $length; + $newsubfield =~ s/\s+$//; + $newfield->update($subfieldtag, $newsubfield); + $field->replace_with($newfield); + $found = 1; + } + } + print "processing $_\n" if ($found == 1); + ModBiblioMarc($record, $_, GetFrameworkCode($_)) if ($found == 1); +} diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index ffa0a6d..4005ee4 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -90,6 +90,11 @@ if (C4::Context->preference("RequestOnOpac")) { $RequestOnOpac = 1; } +my $uploadWebPath; +if (C4::Context->preference('uploadWebPath')) { + $uploadWebPath = C4::Context->preference('uploadWebPath'); +} + # fill arrays my @loop_data = (); my $tag; @@ -161,6 +166,11 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { } $subfield_data{marc_value} = GetAuthorisedValueDesc( $fields[$x_i]->tag(), $subf[$i][0], $subf[$i][1], '', $tagslib, '', 'opac' ); + if ($tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{value_builder} eq "upload.pl" and $uploadWebPath) { + my $file_uri = qq($uploadWebPath/$subf[$i][1]); + $subfield_data{marc_value} = qq/
    $subfield_data{marc_value}<\/a>/; + } + } $subfield_data{marc_subfield} = $subf[$i][0]; $subfield_data{marc_tag} = $fields[$x_i]->tag(); diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index 5e92d15..8f31ba8 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -67,7 +67,7 @@ foreach my $biblionumber ( @bibs ) { my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); - my $marcurlsarray = GetMarcUrls ($record,$marcflavour); + my $marcurlsarray = GetMarcUrls ($record, $marcflavour, GetFrameworkCode($biblionumber)); my @items = &GetItemsLocationInfo( $biblionumber ); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index e18e046..5a830b6 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -223,7 +223,7 @@ my $marcisbnsarray = GetMarcISBN ($record,$marcflavour); my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour); my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); -my $marcurlsarray = GetMarcUrls ($record,$marcflavour); +my $marcurlsarray = GetMarcUrls ($record, $marcflavour, $dat->{'frameworkcode'}); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); $template->param( -- 1.7.6.3 From f.demians at tamil.fr Fri Sep 16 18:51:02 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Fri, 16 Sep 2011 18:51:02 +0200 Subject: [Koha-patches] [PATCH] Bug 6321 Add a 1/4 months frequency Message-ID: <1316191862-715-1-git-send-email-f.demians@tamil.fr> Thanks Stefano Bargioni for the typo fix [2011.09.16] Thanks Paul for catching the display error. Signed-off-by: Colin Campbell --- C4/Serials.pm | 11 ++++++++++- .../prog/en/modules/serials/subscription-add.tt | 5 +++++ .../prog/en/modules/serials/subscription-detail.tt | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 8aa6ebc..18e0ce4 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -2154,7 +2154,7 @@ sub abouttoexpire { @res=Date::Calc::Today; } my @endofsubscriptiondate=split(/-/,$expirationdate); - my @per_list = (0, 7, 7, 14, 21, 31, 62, 93, 93, 190, 365, 730, 0, 0, 0, 0); + my @per_list = (0, 7, 7, 14, 21, 31, 62, 93, 93, 190, 365, 730, 0, 124, 0, 0); my @datebeforeend; @datebeforeend = Add_Delta_Days( $endofsubscriptiondate[0],$endofsubscriptiondate[1],$endofsubscriptiondate[2], - (3 * $per_list[$per])) if (@endofsubscriptiondate && $endofsubscriptiondate[0]*$endofsubscriptiondate[1]*$endofsubscriptiondate[2]); @@ -2317,6 +2317,15 @@ sub GetNextDate(@) { } @resultdate = Add_Delta_YMD( $year, $month, $day, 0, 3, 0 ); } + if ( $subscription->{periodicity} == 13 ) { + for ( my $i = 0 ; $i < @irreg ; $i++ ) { + if ( $irreg[$i] == ( ( $tmpmonth != 8 ) ? ( $tmpmonth + 4 ) % 12 : 12 ) ) { + ( $year, $month, $day ) = Add_Delta_YMD( $year, $month, $day, 0, 4, 0 ); + $tmpmonth = ( ( $tmpmonth != 8 ) ? ( $tmpmonth + 4 ) % 12 : 12 ); + } + } + @resultdate = Add_Delta_YMD( $year, $month, $day, 0, 4, 0 ); + } if ( $subscription->{periodicity} == 9 ) { for ( my $i = 0 ; $i < @irreg ; $i++ ) { if ( $irreg[$i] == ( ( $tmpmonth != 9 ) ? ( $tmpmonth + 3 ) % 12 : 12 ) ) { 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 f21e72d..733fe36 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 @@ -1216,6 +1216,11 @@ $(document).ready(function() { [% ELSE %] [% END %] + [% IF ( periodicity13 ) %] + + [% ELSE %] + + [% END %] [% IF ( periodicity9 ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index bba6a2e..ed89f48 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -119,7 +119,7 @@ function popup(subscriptionid) { 1/day [% END %] [% IF ( periodicity13 ) %] - 3/week + 1/4 months (3/year) [% END %] [% IF ( periodicity2 ) %] 1/week -- 1.7.6.1 From f.demians at tamil.fr Sat Sep 17 08:06:13 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Sat, 17 Sep 2011 08:06:13 +0200 Subject: [Koha-patches] [PATCH 2/2] Bug 6679 Followup for acqui/histsearch.pl In-Reply-To: <1316239573-29764-1-git-send-email-f.demians@tamil.fr> References: <1316239573-29764-1-git-send-email-f.demians@tamil.fr> Message-ID: <1316239573-29764-2-git-send-email-f.demians@tamil.fr> --- acqui/histsearch.pl | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index e158842..82ba04f 100755 --- a/acqui/histsearch.pl +++ b/acqui/histsearch.pl @@ -64,8 +64,10 @@ my $author = $input->param('author'); my $name = $input->param( 'name' ); my $basket = $input->param( 'basket' ); my $booksellerinvoicenumber = $input->param( 'booksellerinvoicenumber' ); -my $from_placed_on = C4::Dates->new($input->param('from')) if $input->param('from'); -my $to_placed_on = C4::Dates->new($input->param( 'to')) if $input->param('to'); +my $from_placed_on = $input->param('from'); +$from_placed_on = C4::Dates->new($from_placed_on) if $from_placed_on; +my $to_placed_on = $input->param('to'); +$to_placed_on = C4::Dates->new($to_placed_on) if $to_placed_on; my $dbh = C4::Context->dbh; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( @@ -103,8 +105,8 @@ if ($do_search) { ); } -my $from_date = $from_placed_on->output('syspref') if $from_placed_on; -my $to_date = $to_placed_on->output('syspref') if $to_placed_on; +my $from_date = $from_placed_on ? $from_placed_on->output('syspref') : undef; +my $to_date = $to_placed_on ? $to_placed_on->output('syspref') : undef; $template->param( suggestions_loop => $order_loop, -- 1.7.6.1 From f.demians at tamil.fr Sat Sep 17 08:06:12 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Sat, 17 Sep 2011 08:06:12 +0200 Subject: [Koha-patches] [PATCH 1/2] Bug 6679 Fix scripts in admin & acqui to pass Perl::Critic Message-ID: <1316239573-29764-1-git-send-email-f.demians@tamil.fr> From: Chris Cormack Scripts in admin & acqui subdirectores weren't passing t/00-testcritic.t. This patch add admin & acqui scripts to test case and fix various errors related to Perl::Critic compliancy. - Fixing a style error to pass Perl::Critic, plus silencing a warn - More style errors, plus fixing a security issue - Explicitly using Carp Contrary to common belief, subroutine prototypes do not enable compile-time checks for proper arguments. Don't use them. Defining a named sub within another sub, does not prevent that subroutine being global --- acqui/addorderiso2709.pl | 19 ++++++++++++++++--- acqui/basketgroup.pl | 36 +++++++++++++++++++++++++++++++----- acqui/neworderempty.pl | 3 ++- admin/authorised_values.pl | 2 +- admin/preferences.pl | 19 +++++++++---------- t/00-testcritic.t | 2 +- 6 files changed, 60 insertions(+), 21 deletions(-) diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 0b9d860..46d05dd 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -24,6 +24,7 @@ use strict; use warnings; use CGI; +use Carp; use Number::Format qw(:all); use C4::Context; @@ -210,8 +211,20 @@ if ($op eq ""){ } if ($price){ $orderinfo{'listprice'} = $price; - eval "use C4::Acquisition qw/GetBasket/;"; - eval "use C4::Bookseller qw/GetBookSellerFromId/;"; + eval { + require C4::Acquisition; + import C4::Acquisition qw/GetBasket/; + }; + if ($@){ + croak $@; + } + eval { + require C4::Bookseller; + import C4::Bookseller qw/GetBookSellerFromId/; + }; + if ($@){ + croak $@; + } my $basket = GetBasket( $orderinfo{basketno} ); my $bookseller = GetBookSellerFromId( $basket->{booksellerid} ); my $gst = $bookseller->{gstrate} || C4::Context->preference("gist") || 0; @@ -265,7 +278,7 @@ my $budget = GetBudget($budget_id); # build budget list my $budget_loop = []; -my $budgets = GetBudgetHierarchy( q{}, $borrower->{branchcode}, $borrower->{borrowernumber} ); +$budgets = GetBudgetHierarchy( q{}, $borrower->{branchcode}, $borrower->{borrowernumber} ); foreach my $r ( @{$budgets} ) { if ( !defined $r->{budget_amount} || $r->{budget_amount} == 0 ) { next; diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index 0846603..5dbae17 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -45,6 +45,7 @@ The bookseller who we want to display the baskets (and basketgroups) of. use strict; use warnings; +use Carp; use C4::Input; use C4::Auth; @@ -184,9 +185,21 @@ sub printbasketgrouppdf{ my ($basketgroupid) = @_; my $pdfformat = C4::Context->preference("OrderPdfFormat"); - eval "use $pdfformat"; - # FIXME consider what would happen if $pdfformat does not - # contain the name of a valid Perl module. + if ($pdfformat eq 'pdfformat::layout3pages' || $pdfformat eq 'pdfformat::layout2pages'){ + eval { + require $pdfformat; + import $pdfformat; + }; + if ($@){ + } + } + else { + print $input->header; + print $input->start_html; # FIXME Should do a nicer page + print "

    Invalid PDF Format set

    "; + print "Please go to the systempreferences and set a valid pdfformat"; + exit; + } my $basketgroup = GetBasketgroup($basketgroupid); my $bookseller = GetBookSellerFromId($basketgroup->{'booksellerid'}); @@ -202,8 +215,20 @@ sub printbasketgrouppdf{ #isbn, itemtype, author, title, publishercode, quantity, listprice ecost discount gstrate my @ba_order; if ( $ord->{biblionumber} && $ord->{quantity}> 0 ) { - eval "use C4::Biblio"; - eval "use C4::Koha"; + eval { + require C4::Biblio; + import C4::Biblio; + }; + if ($@){ + croak $@; + } + eval { + require C4::Koha; + import C4::Koha; + }; + if ($@){ + croak $@; + } my $bib = GetBiblioData($ord->{biblionumber}); my $itemtypes = GetItemTypes(); if($ord->{isbn}){ @@ -246,6 +271,7 @@ sub printbasketgrouppdf{ ); my $pdf = printpdf($basketgroup, $bookseller, $baskets, \%orders, $bookseller->{gstrate} // C4::Context->preference("gist")) || die "pdf generation failed"; print $pdf; + } my $op = $input->param('op'); diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index e99eeb0..6361125 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -330,7 +330,8 @@ if (C4::Context->preference('AcqCreateItem') eq 'ordering' && !$ordernumber) { $template->param(items => \@itemloop); } # Get the item types list, but only if item_level_itype is YES. Otherwise, it will be in the item, no need to display it in the biblio -my @itemtypes = C4::ItemType->all unless C4::Context->preference('item-level_itypes'); +my @itemtypes; + at itemtypes = C4::ItemType->all unless C4::Context->preference('item-level_itypes'); # fill template $template->param( diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl index c26f3a9..d7872d6 100755 --- a/admin/authorised_values.pl +++ b/admin/authorised_values.pl @@ -27,7 +27,7 @@ use C4::Koha; use C4::Output; -sub AuthorizedValuesForCategory ($) { +sub AuthorizedValuesForCategory { my ($searchstring) = shift or return; my $dbh = C4::Context->dbh; $searchstring=~ s/\'/\\\'/g; diff --git a/admin/preferences.pl b/admin/preferences.pl index d523c75..f4d1823 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -194,12 +194,6 @@ sub SearchPrefs { my %tab_files = _get_pref_files( $input ); our @terms = split( /\s+/, $searchfield ); - sub matches { - my ( $text ) = @_; - - return !grep( { $text !~ /$_/i } @terms ); - } - foreach my $tab_name ( keys %tab_files ) { my $data = GetTab( $input, $tab_name ); my $title = ( keys( %$data ) )[0]; @@ -209,7 +203,7 @@ sub SearchPrefs { my $matched_groups; while ( my ( $group_title, $contents ) = each %$tab ) { - if ( matches( $group_title ) ) { + if ( matches( $group_title, \@terms ) ) { $matched_groups->{$group_title} = $contents; next; } @@ -225,12 +219,12 @@ sub SearchPrefs { my ( undef, $LINES ) = TransformPrefsToHTML( $data, $searchfield ); return { search_jumped => 1, tab => $tab_name, tab_title => $title, LINES => $LINES }; - } elsif ( matches( $piece->{'pref'} ) ) { + } elsif ( matches( $piece->{'pref'}, \@terms) ) { $matched = 1; - } elsif ( ref( $piece->{'choices'} ) eq 'HASH' && grep( { $_ && matches( $_ ) } values( %{ $piece->{'choices'} } ) ) ) { + } elsif ( ref( $piece->{'choices'} ) eq 'HASH' && grep( { $_ && matches( $_, \@terms ) } values( %{ $piece->{'choices'} } ) ) ) { $matched = 1; } - } elsif ( matches( $piece ) ) { + } elsif ( matches( $piece, \@terms ) ) { $matched = 1; } last if ( $matched ); @@ -252,6 +246,11 @@ sub SearchPrefs { return @tabs; } +sub matches { + my ( $text, $terms ) = @_; + return !grep( { $text !~ /$_/i } @$terms ); +} + my $dbh = C4::Context->dbh; our $input = new CGI; diff --git a/t/00-testcritic.t b/t/00-testcritic.t index 65f2288..bc7a3cd 100755 --- a/t/00-testcritic.t +++ b/t/00-testcritic.t @@ -16,7 +16,7 @@ my @all_koha_dirs = qw( acqui admin authorities basket C4 catalogue cataloguing labels members misc offline_circ opac patroncards reports reserve reviews rotating_collections serials sms suggestion t tags test tools virtualshelves); -my @dirs = qw( basket circ debian errors offline_circ reserve reviews rotating_collections +my @dirs = qw( acqui admin basket circ debian errors offline_circ reserve reviews rotating_collections serials sms virtualshelves ); if ( not $ENV{TEST_QA} ) { -- 1.7.6.1 From f.demians at tamil.fr Sat Sep 17 09:15:06 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Sat, 17 Sep 2011 09:15:06 +0200 Subject: [Koha-patches] [PATCH] Bug 6649 Allow help screens editing Message-ID: <1316243706-29425-1-git-send-email-f.demians@tamil.fr> edithelp.pl hadn't been updated to allow help screen editing. --- edithelp.pl | 31 ++++++++++++++++--------------- help.pl | 3 ++- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/edithelp.pl b/edithelp.pl index d1975ba..4d7e0c0 100755 --- a/edithelp.pl +++ b/edithelp.pl @@ -41,7 +41,7 @@ my $error; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { - template_name => "help/edithelp.tmpl", + template_name => "help/edithelp.tt", query => $input, type => "intranet", authnotrequired => 0, @@ -63,29 +63,30 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( sub _get_filepath ($;$) { my $referer = shift; - $referer =~ /.*koha\/(.+)\.pl.*/; - my $from = "help/$1.tmpl"; + $referer =~ /koha\/(.*)\.pl/; + my $from = "help/$1.tt"; my $htdocs = C4::Context->config('intrahtdocs'); my ($theme, $lang) = themelanguage( $htdocs, $from, "intranet", $input ); $debug and print STDERR "help filepath: $htdocs/$theme/$lang/modules/$from"; return "$htdocs/$theme/$lang/modules/$from"; } -if ( $type eq 'addnew' ) { - $type = 'create'; -} -elsif ( $type eq 'create' || $type eq 'save' ) { +$type = 'create' if $type eq 'addnew'; +if ( $type eq 'create' || $type eq 'save' ) { my $file = _get_filepath($referer); - unless (open (OUTFILE, ">$file")) {$error = "Cannot write file: '$file'";} else { - #open (OUTFILE, ">$file") or die "Cannot write file: '$file'"; # unlikely death, since we just checked + open my $fh, ">", $file; + if ( $fh ) { # file is open write to it - print OUTFILE "\n"; - print OUTFILE ($type eq 'create') ? "
    \n$help\n
    " : $help; - print OUTFILE "\n\n"; - close OUTFILE; + print $fh + " [% INCLUDE 'help-top.inc' %]\n", + $type eq 'create' ? "
    \n$help\n
    " : $help, + "\n[% INCLUDE 'help-bottom.inc' %]\n"; + close $fh; print $input->redirect("/cgi-bin/koha/help.pl?url=$oldreferer"); } - + else { + $error = "Cannot write file: '$file'"; + } } elsif ( $type eq 'modify' ) { # open file load data, kill include calls, pass data to the template @@ -98,7 +99,7 @@ elsif ( $type eq 'modify' ) { open (INFILE, $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked my $help = ''; while ( my $inp = ) { - unless ( $inp =~ /TMPL\_INCLUDE/ ) { + unless ( $inp =~ /INCLUDE/ ) { $help .= $inp; } } diff --git a/help.pl b/help.pl index 58354b0..21c27c64 100755 --- a/help.pl +++ b/help.pl @@ -28,7 +28,7 @@ use CGI; my $query = new CGI; # find the script that called the online help using the CGI referer() -our $refer = $query->referer(); +our $refer = $query->param('url') || $query->referer(); $refer =~ /koha\/(.*)\.pl/; my $from = "modules/help/$1.tt"; @@ -40,6 +40,7 @@ unless ( -e "$htdocs/$theme/$lang/$from" ) { ( $theme, $lang ) = themelanguage( $htdocs, $from, "intranet", $query ); } my $template = C4::Templates->new('intranet', "$htdocs/$theme/$lang/$from"); +$template->param( referer => $refer ); output_html_with_http_headers $query, "", $template->output; -- 1.7.6.1 From colin.campbell at ptfs-europe.com Sat Sep 17 14:06:34 2011 From: colin.campbell at ptfs-europe.com (Colin Campbell) Date: Sat, 17 Sep 2011 13:06:34 +0100 Subject: [Koha-patches] [PATCH] Bug 6877 - use is executed and errors at compile time Message-ID: <1316261194-2426-1-git-send-email-colin.campbell@ptfs-europe.com> Although use is being called in an eval it will still be executed at compile time so that an error can cause the script to abort before the eval is executed. The eval expression syntax is not checked so eval block should be preferred. Use require/import which execute at runtime which is the intention here. --- opac/opac-detail.pl | 5 ++++- opac/opac-showreviews.pl | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index e18e046..009e276 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -299,7 +299,10 @@ $template->param( ); my $libravatar_enabled = 0; -eval 'use Libravatar::URL'; +eval { + require Libravatar::URL; + Libravatar::URL->import(); +}; if (!$@ and C4::Context->preference('ShowReviewer') and C4::Context->preference('ShowReviewerPhoto')) { $libravatar_enabled = 1; } diff --git a/opac/opac-showreviews.pl b/opac/opac-showreviews.pl index 3a74270..6402831 100755 --- a/opac/opac-showreviews.pl +++ b/opac/opac-showreviews.pl @@ -66,7 +66,10 @@ if($format eq "rss"){ } my $libravatar_enabled = 0; -eval 'use Libravatar::URL'; +eval { + require Libravatar::URL; + Libravatar::URL->import(); +}; if (!$@ and C4::Context->preference('ShowReviewer') and C4::Context->preference('ShowReviewerPhoto')) { $libravatar_enabled = 1; } -- 1.7.6 From Katrin.Fischer.83 at web.de Sun Sep 18 20:57:22 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Sun, 18 Sep 2011 20:57:22 +0200 Subject: [Koha-patches] [PATCH] Bug 5675 : CheckReserves not honouring item level itemtypes preferences Message-ID: <1316372242-26872-1-git-send-email-Katrin.Fischer.83@web.de> From: Chris Cormack Signed-off-by: Katrin Fischer With item level itypes activated only the item for which holds were allowed in circulation rules triggered the hold notice on checkin. Also checked that biblio level itype still trigered correctly. --- C4/Reserves.pm | 29 ++++++++++++++++++++++------- 1 files changed, 22 insertions(+), 7 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 8373840..f83f0ff 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -760,17 +760,32 @@ sub CheckReserves { my ( $item, $barcode ) = @_; my $dbh = C4::Context->dbh; my $sth; - my $select = " - SELECT items.biblionumber, + my $select; + if (C4::Context->preference('item-level_itypes')){ + $select = " + SELECT items.biblionumber, items.biblioitemnumber, itemtypes.notforloan, items.notforloan AS itemnotforloan, items.itemnumber - FROM items - LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber - LEFT JOIN itemtypes ON biblioitems.itemtype = itemtypes.itemtype - "; - + FROM items + LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber + LEFT JOIN itemtypes ON items.itype = itemtypes.itemtype + "; + } + else { + $select = " + SELECT items.biblionumber, + items.biblioitemnumber, + itemtypes.notforloan, + items.notforloan AS itemnotforloan, + items.itemnumber + FROM items + LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber + LEFT JOIN itemtypes ON biblioitems.itemtype = itemtypes.itemtype + "; + } + if ($item) { $sth = $dbh->prepare("$select WHERE itemnumber = ?"); $sth->execute($item); -- 1.7.4.1 From Katrin.Fischer.83 at web.de Sun Sep 18 22:29:58 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Sun, 18 Sep 2011 22:29:58 +0200 Subject: [Koha-patches] [PATCH] bug_4831: Use unitprice (actual cost) when totalling spent amounts for "All available funds", as in "Already received" Message-ID: <1316377798-31236-1-git-send-email-Katrin.Fischer.83@web.de> From: Srdjan Jankovic Signed-off-by: Katrin Fischer To test: - add new fund for an active budget - order item, price 8.00 - check funds page and acq home: committed amount should be 8.00 - receive item, enter actual price 10.00 - check funds page and acq home: spent amount should be 10.00 --- C4/Budgets.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/C4/Budgets.pm b/C4/Budgets.pm index 888b4fd..7c867e0 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -304,7 +304,7 @@ sub GetBudgetSpent { my ($budget_id) = @_; my $dbh = C4::Context->dbh; my $sth = $dbh->prepare(qq| - SELECT SUM(ecost * quantity) AS sum FROM aqorders + SELECT SUM( COALESCE(unitprice, ecost) * quantity ) AS sum FROM aqorders WHERE budget_id = ? AND quantityreceived > 0 AND datecancellationprinted IS NULL -- 1.7.4.1 From oleonard at myacpl.org Mon Sep 19 15:10:08 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Mon, 19 Sep 2011 09:10:08 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 6884, Improve TinyMCE configuration on Koha News page Message-ID: <1316437808-11360-1-git-send-email-oleonard@myacpl.org> - Increases the width of the editor to fill the space provided - Adjusts the layout of the toolbars to better fit the space - Adds a custom editor stylesheet to make the contents of the editor better match the expected output In changing the toolbar configuration I chose to make the display of each button explicit rather than assuming a default set of buttons and adding or subtracting from that. I think this is clearer for someone approaching the configuration trying to under- stand how buttons are displayed. I also chose to use the shorthand "|" instead of "separator" for brevity. This last change is the only one made to the edithelp configuration. --- koha-tmpl/intranet-tmpl/prog/en/css/tinymce.css | 4 ++++ .../intranet-tmpl/prog/en/modules/help/edithelp.tt | 9 +++++---- .../prog/en/modules/tools/koha-news.tt | 16 +++++++++------- 3 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/css/tinymce.css diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/tinymce.css b/koha-tmpl/intranet-tmpl/prog/en/css/tinymce.css new file mode 100644 index 0000000..57fec75 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/css/tinymce.css @@ -0,0 +1,4 @@ +body, td, pre { + font-family: Arial,Helvetica,sans-serif; + font-size: 13px; +} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/edithelp.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/edithelp.tt index 3a40f2d..ad4b4a1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/edithelp.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/edithelp.tt @@ -5,12 +5,13 @@ tinyMCE.init({ mode : "textareas", theme : "advanced", + content_css : "[% themelang %]/css/tinymce.css", plugins : "table,save,advhr,advlink,iespell,searchreplace,print,contextmenu", theme_advanced_disable : "underline,strikethrough,styleselect,image", - theme_advanced_buttons1_add_before : "save,separator", - theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator", - theme_advanced_buttons3_add_before : "tablecontrols,separator", - theme_advanced_buttons3_add : "iespell,advhr,separator,print", + theme_advanced_buttons1_add_before : "save,|", + theme_advanced_buttons2_add_before: "cut,copy,paste,|,search,replace,|", + theme_advanced_buttons3_add_before : "tablecontrols,|", + theme_advanced_buttons3_add : "iespell,advhr,|,print", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_path_location : "bottom", diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt index 313701b..dfee834 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt @@ -17,19 +17,21 @@ $(document).ready(function() { -- 1.7.3 From f.demians at tamil.fr Mon Sep 19 19:59:10 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Mon, 19 Sep 2011 19:59:10 +0200 Subject: [Koha-patches] [PATCH] Bug 6885 Allow superlib to delete items from any library Message-ID: <1316455150-29532-1-git-send-email-f.demians@tamil.fr> When IndependantBranches syspref is enabled, a 'regular' user can only delete items belonging to his/her library. But a superlibrarian should have the permission to delete items from all libraries. He can't for the time being. This is fix by this patch. How to test? - On a multi-libraries Koha, activate IndependantBranches - Log in with a superlibrarian user - Find a biblio with one item from another library than the user home library - Click on Edit > Edit Items - On the list of items, all lines have Delete link - If you try to delete an item from another library than the user home library, deletion will fail. --- C4/Items.pm | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index bc36dd1..4aabf3d 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -2100,7 +2100,11 @@ sub DelItemCheck { if ($onloan) { $error = "book_on_loan"; } - elsif (C4::Context->preference("IndependantBranches") and (C4::Context->userenv->{branch} ne $item->{C4::Context->preference("HomeOrHoldingBranch")||'homebranch'})){ + elsif ( C4::Context->userenv->{flags} != 1 and + C4::Context->preference("IndependantBranches") and + (C4::Context->userenv->{branch} ne + $item->{C4::Context->preference("HomeOrHoldingBranch")||'homebranch'}) ) + { $error = "not_same_branch"; } else { -- 1.7.6.1 From oleonard at myacpl.org Mon Sep 19 21:58:01 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Mon, 19 Sep 2011 15:58:01 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6870 [enh] - allow opac-userupdate.pl to use the patron's email as 'from' address Message-ID: <1316462281-13640-1-git-send-email-oleonard@myacpl.org> From: Liz Rea Patch makes it so that Koha sends patron update emails from the first valid patron email address, instead of from the KohaAdmin or branch email address. This patch should make it so that libraries can directly reply to patrons regarding patron updates. To test: Create a patron with no email address, do a patron update and observe the to: and from: - they should both be the KohaAdminEmail address. Add an email address to that same patron, and send a patron update. Observe the to: and from: - the from: should be the first valid email address of the patron, to should be the KohaAdminEmail address. Signed-off-by: Owen Leonard --- opac/opac-userupdate.pl | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/opac/opac-userupdate.pl b/opac/opac-userupdate.pl index aa5858a..f8273ce 100755 --- a/opac/opac-userupdate.pl +++ b/opac/opac-userupdate.pl @@ -48,6 +48,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( # get borrower information .... my ( $borr ) = GetMemberDetails( $borrowernumber ); +my ( $patronemail ) = GetFirstValidEmailAddress($borrowernumber); my $lib = GetBranchDetail($borr->{'branchcode'}); # handle the new information.... @@ -80,6 +81,10 @@ if ( !$updateemailaddress || $updateemailaddress eq '' ) { exit; } +if ( !$patronemail || $patronemail eq '' ) { + $patronemail = $updateemailaddress; +}; + if ( $query->param('modify') ) { # get all the fields: @@ -117,7 +122,7 @@ EOF $message .= "\n\nThanks,\nKoha\n\n"; my %mail = ( To => $updateemailaddress, - From => $updateemailaddress, + From => $patronemail, Subject => "User Request for update of Record.", Message => $message, 'Content-Type' => 'text/plain; charset="utf8"', -- 1.7.3 From Katrin.Fischer.83 at web.de Mon Sep 19 22:20:12 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Mon, 19 Sep 2011 22:20:12 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6831: Add ability to enter adding child record from parent Message-ID: <1316463612-12222-1-git-send-email-Katrin.Fischer.83@web.de> From: Colin Campbell Simplifies the adding of analytical records and ensures that the data populating the 773 tag is correct. From the host record add child record is selected and create bib is entered to generate a new record with host item tag populated from the parent Caveat: currently prepare_host_field only returns a field for MARC21. Values for UNIMARC and NORMARC can easily be added but should be done by someone familar with those formats and conventions Signed-off-by: Katrin Fischer To test: - create a new record --> if you enter a value in 001 anaytics will use that in $w for linking later --> if you set 000/LDR 19 - Multipart resource record level to 'a' there will be a link from the parent record to the child record later - save your record and go to the staff detail page - in toolbar select 'New' > 'New child record' - check field 773, 245 and 001 from the parent record should have been copied there - check links between child and parent in staff --- C4/Biblio.pm | 58 ++++++++++++++++++++ cataloguing/addbiblio.pl | 19 +++++++ .../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 14 ++++- 3 files changed, 88 insertions(+), 3 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 96baaef..dabb73f 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -128,6 +128,7 @@ BEGIN { &TransformHtmlToXml &PrepareItemrecordDisplay &GetNoZebraIndexes + prepare_host_field ); } @@ -3681,8 +3682,65 @@ sub get_biblio_authorised_values { return $authorised_values; } +=head2 prepare_host_field + +$marcfield = prepare_host_field( $hostbiblioitem, $marcflavour ); +Generate the host item entry for an analytic child entry + +=cut + +sub prepare_host_field { + my ( $hostbiblio, $marcflavour ) = @_; + $marcflavour ||= 'MARC21'; + my $host = GetMarcBiblio($hostbiblio); + if ( $marcflavour eq 'MARC21' ) { + + # unfortunately as_string does not 'do the right thing' + # if field returns undef + my %sfd; + my $field; + if ( $field = $host->author() ) { + $sfd{a} = $field; + } + if ( $field = $host->title() ) { + $sfd{t} = $field; + } + if ( $field = $host->field('260') ) { + my $s = $field->as_string('abc'); + if ($s) { + $sfd{d} = $s; + } + } + if ( $field = $host->field('240') ) { + my $s = $field->as_string(); + if ($s) { + $sfd{b} = $s; + } + } + if ( $field = $host->field('022') ) { + my $s = $field->as_string('a'); + if ($s) { + $sfd{x} = $s; + } + } + if ( $field = $host->field('020') ) { + my $s = $field->as_string('a'); + if ($s) { + $sfd{x} = $s; + } + } + if ( $field = $host->field('001') ) { + $sfd{w} = $field->data(),; + } + my $host_field = MARC::Field->new( 773, '0', ' ', %sfd ); + return $host_field; + } + return; +} + 1; + __END__ =head1 AUTHOR diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 21601e9..f50fdce 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -827,6 +827,7 @@ AND (authtypecode IS NOT NULL AND authtypecode<>\"\")|); my $input = new CGI; my $error = $input->param('error'); my $biblionumber = $input->param('biblionumber'); # if biblionumber exists, it's a modif, not a new biblio. +my $parentbiblio = $input->param('parentbiblionumber'); my $breedingid = $input->param('breedingid'); my $z3950 = $input->param('z3950'); my $op = $input->param('op'); @@ -904,6 +905,15 @@ if (($biblionumber) && !($breedingid)){ if ($breedingid) { ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ; } +# This is a child record +if ($parentbiblio) { + my $marcflavour = C4::Context->preference('marcflavour'); + $record = MARC::Record->new(); + my $hostfield = prepare_host_field($parentbiblio,$marcflavour); + if ($hostfield) { + $record->append_fields($hostfield); + } +} $is_a_modif = 0; @@ -1070,3 +1080,12 @@ $template->param( ); output_html_with_http_headers $input, $cookie, $template->output; + +sub get_host_control_num { + my $host_biblio_nr = shift; + my $host = GetMarcBiblio($host_biblio_nr); + my $control_num = GetMarcControlnumber($host, C4::Context->preference('marcflavour')); + $host = GetBiblioData($host_biblio_nr); + $host->{control_number} = $control_num; + return $host; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index 9766494..47ca4b3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -78,10 +78,18 @@ function confirm_items_deletion() { YAHOO.util.Event.onContentReady("cattoolbar", function () { // Menu for new record, new item, new subscription var newmenu = [ - [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{text: _("New Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl" },[% END %] - [% IF ( CAN_user_editcatalogue_edit_items ) %]{text: _("New Item"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]#additema" },[% END %] + [% IF CAN_user_editcatalogue_edit_catalogue %] + {text: _("New Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl" }, + [% END %] + [% IF ( CAN_user_editcatalogue_edit_items ) %] + {text: _("New Item"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]#additema" }, + [% END %] [% IF ( CAN_user_serials_create_subscription ) %] - {text: _("New Subscription"), url: "/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber %]"},[% END %] + {text: _("New Subscription"), url: "/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber %]"}, + [% END %] + [% IF CAN_user_editcatalogue_edit_catalogue %] + {text: _("New Child Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?parentbiblionumber=[% biblionumber %]" }, + [% END %] ]; if(newmenu.length){ new YAHOO.widget.Button({ -- 1.7.4.1 From srdjan at catalyst.net.nz Tue Sep 20 05:57:53 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Tue, 20 Sep 2011 15:57:53 +1200 Subject: [Koha-patches] [PATCH] bug_2830: Remove reserve when checking out if the borrower is not the first one in the reserve queue In-Reply-To: References: Message-ID: <1316491073-4280-1-git-send-email-srdjan@catalyst.net.nz> --- C4/Circulation.pm | 34 +----------------- C4/Reserves.pm | 58 ++++++++++++++++++++++++++++-- t/db_dependent/lib/KohaTest/Reserves.pm | 1 + 3 files changed, 57 insertions(+), 36 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 520c116..5865d91 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -984,38 +984,8 @@ sub AddIssue { } # See if the item is on reserve. - my ( $restype, $res ) = - C4::Reserves::CheckReserves( $item->{'itemnumber'} ); - if ($restype) { - my $resbor = $res->{'borrowernumber'}; - if ( $resbor eq $borrower->{'borrowernumber'} ) { - # The item is reserved by the current patron - ModReserveFill($res); - } - elsif ( $restype eq "Waiting" ) { - # warn "Waiting"; - # The item is on reserve and waiting, but has been - # reserved by some other patron. - } - elsif ( $restype eq "Reserved" ) { - # warn "Reserved"; - # The item is reserved by someone else. - if ($cancelreserve) { # cancel reserves on this item - CancelReserve(0, $res->{'itemnumber'}, $res->{'borrowernumber'}); - } - } - if ($cancelreserve) { - CancelReserve($res->{'biblionumber'}, 0, $res->{'borrowernumber'}); - } - else { - # set waiting reserve to first in reserve queue as book isn't waiting now - ModReserve(1, - $res->{'biblionumber'}, - $res->{'borrowernumber'}, - $res->{'branchcode'} - ); - } - } + MoveReserve( $item->{'itemnumber'}, $borrower->{'borrowernumber'}, $cancelreserve ); + # Starting process for transfer job (checking transfert and validate it if we have one) my ($datesent) = GetTransfers($item->{'itemnumber'}); diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 8373840..469b719 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -109,6 +109,7 @@ BEGIN { &ModReserveStatus &ModReserveCancelAll &ModReserveMinusPriority + &MoveReserve &CheckReserves &CanBookBeReserved @@ -731,8 +732,8 @@ sub GetReserveStatus { =head2 CheckReserves - ($status, $reserve) = &CheckReserves($itemnumber); - ($status, $reserve) = &CheckReserves(undef, $barcode); + ($status, $reserve, $all_reserves) = &CheckReserves($itemnumber); + ($status, $reserve, $all_reserves) = &CheckReserves(undef, $barcode); Find a book in the reserves. @@ -800,7 +801,7 @@ sub CheckReserves { my $priority = 10000000; foreach my $res (@reserves) { if ( $res->{'itemnumber'} == $itemnumber && $res->{'priority'} == 0) { - return ( "Waiting", $res ); # Found it + return ( "Waiting", $res, \@reserves ); # Found it } else { # See if this item is more important than what we've got so far if ( $res->{'priority'} && $res->{'priority'} < $priority ) { @@ -821,7 +822,7 @@ sub CheckReserves { # We return the most important (i.e. next) reservation. if ($highest) { $highest->{'itemnumber'} = $item; - return ( "Reserved", $highest ); + return ( "Reserved", $highest, \@reserves ); } else { return ( 0, 0 ); @@ -1794,6 +1795,55 @@ sub _ShiftPriorityByDateAndPriority { return $new_priority; # so the caller knows what priority they wind up receiving } + +=head2 MoveReserve + + MoveReserve( $itemnumber, $borrowernumber, $cancelreserve ) + +Use when checking out an item to handle reserves +If $cancelreserve boolean is set to true, it will remove existing reserve + +=cut + +sub MoveReserve { + my ( $itemnumber, $borrowernumber, $cancelreserve ) = @_; + + my ( $restype, $res, $all_reserves ) = CheckReserves( $itemnumber ); + return unless $res; + + my $biblionumber = $res->{biblionumber}; + my $biblioitemnumber = $res->{biblioitemnumber}; + + if ($res->{borrowernumber} == $borrowernumber) { + ModReserveFill($res); + } + else { + # warn "Reserved"; + # The item is reserved by someone else. + # Find this item in the reserves + + my $borr_res; + foreach (@$all_reserves) { + $_->{'borrowernumber'} == $borrowernumber or next; + $_->{'biblionumber'} == $biblionumber or next; + + $borr_res = $_; + last; + } + + if ( $borr_res ) { + # The item is reserved by the current patron + ModReserveFill($borr_res); + } + + if ($cancelreserve) { # cancel reserves on this item + CancelReserve(0, $res->{'itemnumber'}, $res->{'borrowernumber'}); + CancelReserve($res->{'biblionumber'}, 0, $res->{'borrowernumber'}); + } + } +} + + =head1 AUTHOR Koha Development Team diff --git a/t/db_dependent/lib/KohaTest/Reserves.pm b/t/db_dependent/lib/KohaTest/Reserves.pm index 5317029..8b05dd0 100644 --- a/t/db_dependent/lib/KohaTest/Reserves.pm +++ b/t/db_dependent/lib/KohaTest/Reserves.pm @@ -29,6 +29,7 @@ sub methods : Test( 1 ) { ModReserveAffect ModReserveCancelAll ModReserveMinusPriority + MoveReserve GetReserveInfo _FixPriority _Findgroupreserve -- 1.6.5 From f.demians at tamil.fr Tue Sep 20 06:41:44 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Tue, 20 Sep 2011 06:41:44 +0200 Subject: [Koha-patches] [PATCH] Fix for Bug 6884, Improve TinyMCE configuration on Koha News page Message-ID: <1316493704-25276-1-git-send-email-f.demians@tamil.fr> From: Owen Leonard - Increases the width of the editor to fill the space provided - Adjusts the layout of the toolbars to better fit the space - Adds a custom editor stylesheet to make the contents of the editor better match the expected output In changing the toolbar configuration I chose to make the display of each button explicit rather than assuming a default set of buttons and adding or subtracting from that. I think this is clearer for someone approaching the configuration trying to under- stand how buttons are displayed. I also chose to use the shorthand "|" instead of "separator" for brevity. This last change is the only one made to the edithelp configuration. [2011.09.20] F. Demians. This patch is compatible with bug 6649 patch, fixing help pages editing, and so could be applied before or after it. Signed-off-by: Fr?d?ric Demians --- koha-tmpl/intranet-tmpl/prog/en/css/tinymce.css | 4 ++++ .../intranet-tmpl/prog/en/modules/help/edithelp.tt | 9 +++++---- .../prog/en/modules/tools/koha-news.tt | 16 +++++++++------- 3 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/css/tinymce.css diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/tinymce.css b/koha-tmpl/intranet-tmpl/prog/en/css/tinymce.css new file mode 100644 index 0000000..57fec75 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/css/tinymce.css @@ -0,0 +1,4 @@ +body, td, pre { + font-family: Arial,Helvetica,sans-serif; + font-size: 13px; +} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/edithelp.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/edithelp.tt index 3a40f2d..ad4b4a1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/edithelp.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/edithelp.tt @@ -5,12 +5,13 @@ tinyMCE.init({ mode : "textareas", theme : "advanced", + content_css : "[% themelang %]/css/tinymce.css", plugins : "table,save,advhr,advlink,iespell,searchreplace,print,contextmenu", theme_advanced_disable : "underline,strikethrough,styleselect,image", - theme_advanced_buttons1_add_before : "save,separator", - theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator", - theme_advanced_buttons3_add_before : "tablecontrols,separator", - theme_advanced_buttons3_add : "iespell,advhr,separator,print", + theme_advanced_buttons1_add_before : "save,|", + theme_advanced_buttons2_add_before: "cut,copy,paste,|,search,replace,|", + theme_advanced_buttons3_add_before : "tablecontrols,|", + theme_advanced_buttons3_add : "iespell,advhr,|,print", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_path_location : "bottom", diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt index 313701b..dfee834 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt @@ -17,19 +17,21 @@ $(document).ready(function() { -- 1.7.6.1 From Katrin.Fischer.83 at web.de Tue Sep 20 08:34:50 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Tue, 20 Sep 2011 08:34:50 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 6842 - Branch transfer limits broken Message-ID: <1316500490-2998-1-git-send-email-Katrin.Fischer.83@web.de> From: Owen Leonard - Changing library select form so that chosen library is preselected - Changing pager
    to a

    so that nested form tags don't conflict. It was the addition of the javascript table pager which broke the functionality on this page. Signed-off-by: Katrin Fischer - It's possible to select a different library now. The pull down shows the chosen library correctly. - I can make changes and save them without any problems. --- admin/branch_transfer_limits.pl | 1 + .../en/modules/admin/branch_transfer_limits.tt | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/admin/branch_transfer_limits.pl b/admin/branch_transfer_limits.pl index abba127..8c6f42e 100755 --- a/admin/branch_transfer_limits.pl +++ b/admin/branch_transfer_limits.pl @@ -58,6 +58,7 @@ my @branch_loop; for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { my %row =(value => $thisbranch, branchname => $branches->{$thisbranch}->{'branchname'}, + selected => $thisbranch eq $branchcode ? 1 : 0, ); push @branch_loop, \%row; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt index 5bb5185..2b007bf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt @@ -71,7 +71,11 @@ @@ -99,8 +103,8 @@ }).tablesorterPager({container: $("#pager[% codes_loo.code %]table"),positionFixed: false,size: 10}); }); - -  page(s) : +

    +

     page(s) : @@ -115,8 +119,8 @@ - - +

    +
    -- 1.7.4.1 From Katrin.Fischer.83 at web.de Tue Sep 20 08:41:08 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Tue, 20 Sep 2011 08:41:08 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6649 Allow help screens editing Message-ID: <1316500868-3525-1-git-send-email-Katrin.Fischer.83@web.de> From: Fr?d?ric Demians edithelp.pl hadn't been updated to allow help screen editing. Signed-off-by: Katrin Fischer Only a note: Apparently you need to be 'superlibrarian' permission to edit help pages. --- edithelp.pl | 31 +++++++++--------- help.pl | 4 ++- .../prog/en/modules/help/circ/circulation-home.tt | 34 ++++++++++--------- 3 files changed, 37 insertions(+), 32 deletions(-) diff --git a/edithelp.pl b/edithelp.pl index d1975ba..4d7e0c0 100755 --- a/edithelp.pl +++ b/edithelp.pl @@ -41,7 +41,7 @@ my $error; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { - template_name => "help/edithelp.tmpl", + template_name => "help/edithelp.tt", query => $input, type => "intranet", authnotrequired => 0, @@ -63,29 +63,30 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( sub _get_filepath ($;$) { my $referer = shift; - $referer =~ /.*koha\/(.+)\.pl.*/; - my $from = "help/$1.tmpl"; + $referer =~ /koha\/(.*)\.pl/; + my $from = "help/$1.tt"; my $htdocs = C4::Context->config('intrahtdocs'); my ($theme, $lang) = themelanguage( $htdocs, $from, "intranet", $input ); $debug and print STDERR "help filepath: $htdocs/$theme/$lang/modules/$from"; return "$htdocs/$theme/$lang/modules/$from"; } -if ( $type eq 'addnew' ) { - $type = 'create'; -} -elsif ( $type eq 'create' || $type eq 'save' ) { +$type = 'create' if $type eq 'addnew'; +if ( $type eq 'create' || $type eq 'save' ) { my $file = _get_filepath($referer); - unless (open (OUTFILE, ">$file")) {$error = "Cannot write file: '$file'";} else { - #open (OUTFILE, ">$file") or die "Cannot write file: '$file'"; # unlikely death, since we just checked + open my $fh, ">", $file; + if ( $fh ) { # file is open write to it - print OUTFILE "\n"; - print OUTFILE ($type eq 'create') ? "
    \n$help\n
    " : $help; - print OUTFILE "\n\n"; - close OUTFILE; + print $fh + " [% INCLUDE 'help-top.inc' %]\n", + $type eq 'create' ? "
    \n$help\n
    " : $help, + "\n[% INCLUDE 'help-bottom.inc' %]\n"; + close $fh; print $input->redirect("/cgi-bin/koha/help.pl?url=$oldreferer"); } - + else { + $error = "Cannot write file: '$file'"; + } } elsif ( $type eq 'modify' ) { # open file load data, kill include calls, pass data to the template @@ -98,7 +99,7 @@ elsif ( $type eq 'modify' ) { open (INFILE, $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked my $help = ''; while ( my $inp = ) { - unless ( $inp =~ /TMPL\_INCLUDE/ ) { + unless ( $inp =~ /INCLUDE/ ) { $help .= $inp; } } diff --git a/help.pl b/help.pl index 58354b0..7208a8a 100755 --- a/help.pl +++ b/help.pl @@ -28,7 +28,8 @@ use CGI; my $query = new CGI; # find the script that called the online help using the CGI referer() -our $refer = $query->referer(); +our $refer = $query->param('url'); +$refer = $query->referer() if !$refer || $refer eq 'undefined'; $refer =~ /koha\/(.*)\.pl/; my $from = "modules/help/$1.tt"; @@ -40,6 +41,7 @@ unless ( -e "$htdocs/$theme/$lang/$from" ) { ( $theme, $lang ) = themelanguage( $htdocs, $from, "intranet", $query ); } my $template = C4::Templates->new('intranet', "$htdocs/$theme/$lang/$from"); +$template->param( referer => $refer ); output_html_with_http_headers $query, "", $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation-home.tt index 2bae339..1f069b7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation-home.tt @@ -1,23 +1,25 @@ -[% INCLUDE 'help-top.inc' %] - + [% INCLUDE 'help-top.inc' %]

    Circulation

    - -

    Circulation functions can be accessed in several different ways. On the main page of the staff client there are some quick links in the center of the page to check items out, in or transfer them. For a complete listing of Circulation functions you can visit the Circulation page which is linked from the top left of every page or from the center of the main page.

    - -

    Before circulating your collection you will want to set your Global System Preferences, Basic Parameters and Patrons & Circulation Rules.

    - -

    While in Circulation you can jump between the tabs on the quick search box at the top of the screen by using the following hot keys:

    - +

    +Circulation functions can be accessed in several different ways. On the main page of the staff client there are some quick links in the center of the page to check items out, in or transfer them. For a complete listing of Circulation functions you can visit the Circulation page which is linked from the top left of every page or from the center of the main page. +

    +

    +Before circulating your collection you will want to set your Global System Preferences, Basic Parameters and Patrons & Circulation Rules. +

    +

    +While in Circulation you can jump between the tabs on the quick search box at the top of the screen by using the following hot keys: +

    • jump to the catalog search with Alt+Q
    • jump to the checkout with Alt+U -
        -
      • this will not work for Mac user
      • -
      -
    • +
        +
      • this will not work for Mac user
      • +
      +
    • jump to the checkin with Alt+R
    +

    +Tip: Mac users use the OPTION button in place of ALT +

    -

    Tip: Mac users use the OPTION button in place of ALT

    - -[% INCLUDE 'help-bottom.inc' %] \ No newline at end of file +[% INCLUDE 'help-bottom.inc' %] -- 1.7.4.1 From srdjan at catalyst.net.nz Tue Sep 20 09:17:31 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Tue, 20 Sep 2011 19:17:31 +1200 Subject: [Koha-patches] [PATCH] bug_5533: new function C4::Circulation::LostItem($itemnumber, $mark_returned) In-Reply-To: References: Message-ID: <1316503051-8467-1-git-send-email-srdjan@catalyst.net.nz> Disabled Lost Status on cataloging full item edit longoverdue.pl calls LostItem() *without* $mark_returned Item moredetail calls LostItem() *with* $mark_returned Batch mode edit calls LostItem() *with* $mark_returned --- C4/Accounts.pm | 77 ++++++++------------------- C4/Circulation.pm | 40 ++++++++++++++- C4/Items.pm | 8 +++- catalogue/updateitem.pl | 3 +- cataloguing/additem.pl | 6 ++- misc/cronjobs/longoverdue.pl | 3 +- t/db_dependent/lib/KohaTest/Accounts.pm | 1 - t/db_dependent/lib/KohaTest/Circulation.pm | 1 + tools/batchMod.pl | 7 ++- 9 files changed, 82 insertions(+), 64 deletions(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index 2352e9e..860e187 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -23,8 +23,7 @@ use strict; use C4::Context; use C4::Stats; use C4::Members; -use C4::Items; -use C4::Circulation qw(MarkIssueReturned); +use C4::Circulation qw(ReturnLostItem); use vars qw($VERSION @ISA @EXPORT); @@ -218,7 +217,7 @@ sub makepayment { #check to see what accounttype if ( $data->{'accounttype'} eq 'Rep' || $data->{'accounttype'} eq 'L' ) { - returnlost( $borrowernumber, $data->{'itemnumber'} ); + ReturnLostItem( $borrowernumber, $data->{'itemnumber'} ); } } @@ -278,64 +277,34 @@ EOT =cut -sub returnlost{ - my ( $borrowernumber, $itemnum ) = @_; - C4::Circulation::MarkIssueReturned( $borrowernumber, $itemnum ); - my $borrower = C4::Members::GetMember( 'borrowernumber'=>$borrowernumber ); - my @datearr = localtime(time); - my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3]; - my $bor = "$borrower->{'firstname'} $borrower->{'surname'} $borrower->{'cardnumber'}"; - ModItem({ paidfor => "Paid for by $bor $date" }, undef, $itemnum); -} - - sub chargelostitem{ # lost ==1 Lost, lost==2 longoverdue, lost==3 lost and paid for # FIXME: itemlost should be set to 3 after payment is made, should be a warning to the interface that # a charge has been added # FIXME : if no replacement price, borrower just doesn't get charged? - my $dbh = C4::Context->dbh(); - my ($itemnumber) = @_; - my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title - FROM issues - JOIN items USING (itemnumber) - JOIN biblio USING (biblionumber) - WHERE issues.itemnumber=?"); - $sth->execute($itemnumber); - my $issues=$sth->fetchrow_hashref(); - - # if a borrower lost the item, add a replacement cost to the their record - if ( $issues->{borrowernumber} ){ - - # first make sure the borrower hasn't already been charged for this item - my $sth1=$dbh->prepare("SELECT * from accountlines - WHERE borrowernumber=? AND itemnumber=? and accounttype='L'"); - $sth1->execute($issues->{'borrowernumber'},$itemnumber); - my $existing_charge_hashref=$sth1->fetchrow_hashref(); - - # OK, they haven't - unless ($existing_charge_hashref) { - # This item is on issue ... add replacement cost to the borrower's record and mark it returned - # Note that we add this to the account even if there's no replacement price, allowing some other - # process (or person) to update it, since we don't handle any defaults for replacement prices. - my $accountno = getnextacctno($issues->{'borrowernumber'}); - my $sth2=$dbh->prepare("INSERT INTO accountlines - (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber) - VALUES (?,?,now(),?,?,'L',?,?)"); - $sth2->execute($issues->{'borrowernumber'},$accountno,$issues->{'replacementprice'}, - "Lost Item $issues->{'title'} $issues->{'barcode'}", - $issues->{'replacementprice'},$itemnumber); - $sth2->finish; - # FIXME: Log this ? - } - #FIXME : Should probably have a way to distinguish this from an item that really was returned. - #warn " $issues->{'borrowernumber'} / $itemnumber "; - C4::Circulation::MarkIssueReturned($issues->{borrowernumber},$itemnumber); - # Shouldn't MarkIssueReturned do this? - C4::Items::ModItem({ onloan => undef }, undef, $itemnumber); + my ($borrowernumber, $itemnumber, $amount, $description) = @_; + + # first make sure the borrower hasn't already been charged for this item + my $sth1=$dbh->prepare("SELECT * from accountlines + WHERE borrowernumber=? AND itemnumber=? and accounttype='L'"); + $sth1->execute($borrowernumber,$itemnumber); + my $existing_charge_hashref=$sth1->fetchrow_hashref(); + + # OK, they haven't + unless ($existing_charge_hashref) { + # This item is on issue ... add replacement cost to the borrower's record and mark it returned + # Note that we add this to the account even if there's no replacement price, allowing some other + # process (or person) to update it, since we don't handle any defaults for replacement prices. + my $accountno = getnextacctno($borrowernumber); + my $sth2=$dbh->prepare("INSERT INTO accountlines + (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber) + VALUES (?,?,now(),?,?,'L',?,?)"); + $sth2->execute($borrowernumber,$accountno,$amount, + $description,$amount,$itemnumber); + $sth2->finish; + # FIXME: Log this ? } - $sth->finish; } =head2 manualinvoice diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 520c116..589b5c5 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -59,8 +59,9 @@ BEGIN { # FIXME subs that should probably be elsewhere push @EXPORT, qw( - &FixOverduesOnReturn &barcodedecode + &LostItem + &ReturnLostItem ); # subs to deal with issuing a book @@ -2943,8 +2944,43 @@ sub DeleteBranchTransferLimits { $sth->execute(); } +sub ReturnLostItem{ + my ( $borrowernumber, $itemnum ) = @_; - 1; + MarkIssueReturned( $borrowernumber, $itemnum ); + my $borrower = C4::Members::GetMember( 'borrowernumber'=>$borrowernumber ); + my @datearr = localtime(time); + my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3]; + my $bor = "$borrower->{'firstname'} $borrower->{'surname'} $borrower->{'cardnumber'}"; + ModItem({ paidfor => "Paid for by $bor $date" }, undef, $itemnum); +} + + +sub LostItem{ + my ($itemnumber, $mark_returned) = @_; + + my $dbh = C4::Context->dbh(); + my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title + FROM issues + JOIN items USING (itemnumber) + JOIN biblio USING (biblionumber) + WHERE issues.itemnumber=?"); + $sth->execute($itemnumber); + my $issues=$sth->fetchrow_hashref(); + $sth->finish; + + # if a borrower lost the item, add a replacement cost to the their record + if ( my $borrowernumber = $issues->{borrowernumber} ){ + + C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}"); + #FIXME : Should probably have a way to distinguish this from an item that really was returned. + #warn " $issues->{'borrowernumber'} / $itemnumber "; + MarkIssueReturned($borrowernumber,$itemnumber) if $mark_returned; + } +} + + +1; __END__ diff --git a/C4/Items.pm b/C4/Items.pm index bc36dd1..9e7167d 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -397,6 +397,8 @@ Note that only columns that can be directly changed from the cataloging and serials item editors are included in this hash. +Returns item record + =cut my %default_values_for_mod_from_marc = ( @@ -446,7 +448,8 @@ sub ModItemFromMarc { } my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode ); - return ModItem($item, $biblionumber, $itemnumber, $dbh, $frameworkcode, $unlinked_item_subfields); + ModItem($item, $biblionumber, $itemnumber, $dbh, $frameworkcode, $unlinked_item_subfields); + return $item; } =head2 ModItem @@ -495,6 +498,9 @@ sub ModItem { }; $item->{'itemnumber'} = $itemnumber or return undef; + + $item->{onloan} = undef if $item->{itemlost}; + _set_derived_columns_for_mod($item); _do_column_fixes_for_mod($item); # FIXME add checks diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl index e8ce20d..345d0c8 100755 --- a/catalogue/updateitem.pl +++ b/catalogue/updateitem.pl @@ -26,7 +26,6 @@ use C4::Biblio; use C4::Items; use C4::Output; use C4::Circulation; -use C4::Accounts; use C4::Reserves; my $cgi= new CGI; @@ -75,6 +74,6 @@ if (defined $itemnotes) { # i.e., itemnotes parameter passed from form ModItem($item_changes, $biblionumber, $itemnumber); -C4::Accounts::chargelostitem($itemnumber) if ($itemlost==1) ; +LostItem($itemnumber, 'MARK RETURNED') if ($itemlost==1) ; print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber"); diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 0db2d2d..b62f1cc 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -26,6 +26,7 @@ use C4::Auth; use C4::Output; use C4::Biblio; use C4::Items; +use C4::Circulation; use C4::Context; use C4::Koha; # XXX subfield_is_koha_internal_p use C4::Branch; # XXX subfield_is_koha_internal_p @@ -217,6 +218,7 @@ sub generate_subfield_form { -tabindex => 1, -id => "tag_".$tag."_subfield_".$subfieldtag."_".$index_subfield, -class => "input_marceditor", + $subfieldlib->{'hidden'} ? (-disabled => 'disabled') : (), ); # it's a thesaurus / authority field @@ -498,7 +500,7 @@ if ($op eq "additem") { if ($exist_itemnumber && $exist_itemnumber != $itemnumber) { push @errors,"barcode_not_unique"; } else { - my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = ModItemFromMarc($itemtosave,$biblionumber,$itemnumber); + ModItemFromMarc($itemtosave,$biblionumber,$itemnumber); $itemnumber=""; } $nextop="additem"; @@ -608,6 +610,8 @@ if($itemrecord){ next if subfield_is_koha_internal_p($subfieldtag); next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"); + $subfieldlib->{hidden} = 1 + if $tagslib->{$tag}->{$subfieldtag}->{authorised_value} eq 'LOST'; my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i); push @fields, "$tag$subfieldtag"; diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index 651b9d2..2179d10 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -35,7 +35,6 @@ BEGIN { } use C4::Context; use C4::Items; -use C4::Accounts; use Getopt::Long; my $lost; # key=lost value, value=num days. @@ -155,7 +154,7 @@ foreach my $startrange (sort keys %$lost) { printf ("Due %s: item %5s from borrower %5s to lost: %s\n", $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue) if($verbose); if($confirm) { ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'}); - chargelostitem($row->{'itemnumber'}) if( $charge && $charge eq $lostvalue); + LostItem($row->{'itemnumber'}) if( $charge && $charge eq $lostvalue); } $count++; } diff --git a/t/db_dependent/lib/KohaTest/Accounts.pm b/t/db_dependent/lib/KohaTest/Accounts.pm index 703d478..ac3a78e 100644 --- a/t/db_dependent/lib/KohaTest/Accounts.pm +++ b/t/db_dependent/lib/KohaTest/Accounts.pm @@ -15,7 +15,6 @@ sub methods : Test( 1 ) { my @methods = qw( recordpayment makepayment getnextacctno - returnlost manualinvoice fixcredit refund diff --git a/t/db_dependent/lib/KohaTest/Circulation.pm b/t/db_dependent/lib/KohaTest/Circulation.pm index 7d5e69d..b3a1ff8 100644 --- a/t/db_dependent/lib/KohaTest/Circulation.pm +++ b/t/db_dependent/lib/KohaTest/Circulation.pm @@ -47,6 +47,7 @@ sub methods : Test( 1 ) { CheckSpecialHolidays CheckRepeatableSpecialHolidays CheckValidBarcode + ReturnLostItem ); can_ok( $self->testing_class, @methods ); diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 9d4431b..a7848b9 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -25,6 +25,7 @@ use C4::Auth; use C4::Output; use C4::Biblio; use C4::Items; +use C4::Circulation; use C4::Context; use C4::Koha; # XXX subfield_is_koha_internal_p use C4::Branch; # XXX subfield_is_koha_internal_p @@ -173,7 +174,11 @@ if ($op eq "action") { if ($values_to_modify || $values_to_blank) { my $localmarcitem = Item2Marc($itemdata); UpdateMarcWith( $marcitem, $localmarcitem ); - eval{ my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) }; + eval{ + if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) { + LostItem($itemnumber, 'MARK RETURNED') if $item->{itemlost} == 1; + } + }; } } $i++; -- 1.6.5 From nengard at bywatersolutions.com Mon Sep 19 11:30:16 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 19 Sep 2011 05:30:16 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6471: add tablesorter to Holds Queue Message-ID: <1316424616-3100-1-git-send-email-nengard@bywatersolutions.com> From: Ian Walls This patch adds the table sorter to Holds Queue. Sponsored by Farmington Public Library. Signed-off-by: Nicole C. Engard --- .../prog/en/modules/circ/view_holdsqueue.tt | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt index f016158..e54529a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt @@ -7,6 +7,16 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] + + +
    - + + @@ -701,6 +702,7 @@ No patron matched [% message %] [% IF ( todayissue.multiple_borrowers ) %][% END %] + @@ -775,6 +777,7 @@ No patron matched [% message %] [% IF ( previssue.multiple_borrowers ) %][% END %] + @@ -859,6 +862,7 @@ No patron matched [% message %] + @@ -878,6 +882,7 @@ No patron matched [% message %] + @@ -898,6 +903,7 @@ No patron matched [% message %] + [% IF ( relprevissue.multiple_borrowers ) %][% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index db9ae4d..60a6cb4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -422,6 +422,7 @@ function validate1(date) { + @@ -453,6 +454,7 @@ function validate1(date) { + @@ -529,6 +531,7 @@ function validate1(date) { + @@ -559,6 +562,7 @@ function validate1(date) { + diff --git a/members/moremember.pl b/members/moremember.pl index bfaa402..a76652f 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -268,6 +268,7 @@ sub build_issue_data { $issue->[$i]{'date_due'} = C4::Dates->new($issue->[$i]{'date_due'}, 'iso')->output('syspref'); $issue->[$i]{'issuedate'} = C4::Dates->new($issue->[$i]{'issuedate'},'iso')->output('syspref'); my $biblionumber = $issue->[$i]{'biblionumber'}; + $issue->[$i]{'issuingbranchname'} = GetBranchName($issue->[$i]{'branchcode'}); my %row = %{ $issue->[$i] }; $totalprice += $issue->[$i]{'replacementprice'}; $row{'replacementprice'} = $issue->[$i]{'replacementprice'}; -- 1.7.2.3 From oleonard at myacpl.org Tue Sep 20 20:33:49 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Tue, 20 Sep 2011 14:33:49 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6806 Fix encoding of title in subscription-add Message-ID: <1316543629-16269-1-git-send-email-oleonard@myacpl.org> From: Colin Campbell Port of Maxime Pelletier 's patch for 3.2 to TT Stops the mangling of titles containing accented characters Signed-off-by: Owen Leonard --- .../prog/en/modules/serials/result.tt | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/result.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/result.tt index 2f46119..30ec303 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/result.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/result.tt @@ -5,9 +5,7 @@ // [% FOREACH resultsloo IN resultsloop %] - - + [% END %]
    Totals:Totals: [% totaldue %] [% totalprice %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index dd77fcc..724818f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -678,6 +678,7 @@ No patron matched [% message %] Title Item Type Checked out onChecked out from Call no Charge Price [% UNLESS ( noItemTypeImages ) %] [% IF ( todayissue.itemtype_image ) %][% END %][% END %][% todayissue.itemtype %] [% todayissue.checkoutdate %][% todayissue.borrowername %][% todayissue.issuingbranchname %] [% todayissue.itemcallnumber %] [% todayissue.charge %] [% todayissue.replacementprice %] [% previssue.displaydate %][% previssue.borrowername %][% previssue.issuingbranchname %] [% previssue.itemcallnumber %] [% previssue.charge %] [% previssue.replacementprice %] Title Item Type Checked out onChecked out from Call no Charge Price [% relissue.title |html %][% IF ( relissue.author ) %], by [% relissue.author %][% END %][% IF ( relissue.itemnotes ) %]- [% relissue.itemnotes %][% END %] [% relissue.barcode %] [% UNLESS ( noItemTypeImages ) %] [% IF ( relissue.itemtype_image ) %][% END %][% END %][% relissue.itemtype %] [% relissue.displaydate %][% relissue.issuingbranchname %] [% relissue.itemcallnumber %] [% relissue.charge %] [% relissue.replacementprice %][% relissue.borrowername %] ([% relissue.cardnumber %]) [% relprevissue.title |html %][% IF ( relprevissue.author ) %], by [% relprevissue.author %][% END %] [% IF ( relprevissue.itemnotes ) %]- [% relprevissue.itemnotes %][% END %] [% relprevissue.barcode %] [% UNLESS noItemTypeImages %][% IF relprevissue.itemtype_image %][% END %][% END %][% relprevissue.itemtype %] [% relprevissue.displaydate %][% relprevissue.issuingbranchname %] [% relprevissue.itemcallnumber %][% relprevissue.borrowername %][% relprevissue.charge %]Title Item Type Checked out onChecked out from Call no Charge Price[% issueloo.title |html %][% IF ( issueloo.author ) %], by [% issueloo.author %][% END %] [% IF ( issueloo.publishercode ) %]; [% issueloo.publishercode %] [% END %] [% IF ( issueloo.publicationyear ) %], [% issueloo.publicationyear %][% END %] [% issueloo.barcode %] [% UNLESS ( noItemTypeImages ) %] [% IF ( issueloo.itemtype_image ) %][% END %][% END %][% issueloo.itemtype_description %] [% issueloo.issuedate %][% issueloo.issuingbranchname %] [% issueloo.itemcallnumber %] [% issueloo.charge %] [% issueloo.replacementprice %]Title Item Type Checked out onChecked out from Call no Charge Price[% relissueloo.title |html %][% IF relissueloo.author %], by [% relissueloo.author %][% END %] [% IF relissueloo.publishercode %]; [% relissueloo.publishercode %] [% END %] [% IF relissueloo.publicationyear %], [% relissueloo.publicationyear %][% END %] [% relissueloo.barcode %] [% UNLESS ( noItemTypeImages ) %] [% IF ( relissueloo.itemtype_image ) %][% END %][% END %][% relissueloo.itemtype_description %] [% relissueloo.issuedate %][% relissueloo.issuingbranchname %] [% relissueloo.itemcallnumber %] [% relissueloo.charge %] [% relissueloo.replacementprice %]
    [% resultsloo.title |html %] [% resultsloo.subtitle |html %] + [% resultsloo.title |html %] [% resultsloo.subtitle |html %] [% resultsloo.author |html %] @@ -44,7 +42,7 @@ function GetIt(bibno,title) [% resultsloo.publicationyear |html %] ChooseChoose
    -- 1.7.3 From lrea at nekls.org Tue Sep 20 21:45:31 2011 From: lrea at nekls.org (Liz Rea) Date: Tue, 20 Sep 2011 14:45:31 -0500 Subject: [Koha-patches] [PATCH] [Signed Off] Enh 6887: Add 'checked out from' column to issued items display tables Message-ID: <1316547931-28210-1-git-send-email-lrea@nekls.org> From: Ian Walls Adds "checked out from" column to the right of "checked out on" on both circ/circulation.pl and members/moremembers.pl. Columns are sortable with tablesort (though only on circ/circulation.pl if syspref enabled). The branch name is sourced from issues.branchcode. EDIT BY Owen Leonard: Adjusting table columns which are sorted by default to accommodate the new column. Things look good! Thanks! Signed-off-by: Nicole C. Engard Signed-off-by: Liz Rea --- circ/circulation.pl | 1 + .../prog/en/includes/checkouts-table-footer.inc | 2 +- .../prog/en/modules/circ/circulation.tt | 12 +++++++++--- .../prog/en/modules/members/moremember.tt | 10 +++++++--- members/moremember.pl | 1 + 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index da4878f..fff32a2 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -438,6 +438,7 @@ sub build_issue_data { $it->{'can_confirm'} = !$can_renew && !$restype; $it->{'renew_error'} = $restype; $it->{'checkoutdate'} = C4::Dates->new($it->{'issuedate'},'iso')->output('syspref'); + $it->{'issuingbranchname'} = GetBranchName($it->{'branchcode'}); $totalprice += $it->{'replacementprice'}; $it->{'itemtype'} = $itemtypeinfo->{'description'}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc index 4cf58c4..5638710 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc @@ -1,6 +1,6 @@ - Totals: + Totals: [% totaldue %] [% totalprice %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index dd77fcc..d6b2b22 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -22,11 +22,11 @@ [% IF ( UseTablesortForCirc ) %]$.tablesorter.defaults.widgets = ['zebra']; $("#issuest").tablesorter({[% IF ( dateformat_metric ) %] dateFormat: 'uk',[% END %] - headers: { 1: { sorter: 'articles' },5: { sorter: false },6:{sorter:false},7:{sorter:false},8:{sorter:false}} + headers: { 1: { sorter: 'articles' },6: { sorter: false },7:{sorter:false},8:{sorter:false},9:{sorter:false}} }); $("#relissuest").tablesorter({[% IF ( dateformat_metric ) %] dateFormat: 'uk',[% END %] - headers: { 1: { sorter: 'articles' },5: { sorter: false },6:{sorter:false},7:{sorter:false},8:{sorter:false}} + headers: { 1: { sorter: 'articles' },6: { sorter: false },7:{sorter:false},8:{sorter:false},9:{sorter:false}} }); //FIXME: Sorting does not work when there are previous checkouts only @@ -40,7 +40,7 @@ $("#holdst").tablesorter({[% IF ( dateformat_metric ) %] dateFormat: 'uk',[% END %] sortList: [[0,0]], - headers: { 1: { sorter: 'articles' }} + headers: { 1: { sorter: 'articles' },5: { sorter: false }} });[% END %] [% IF ( AllowRenewalLimitOverride ) %] $( '#override_limit' ).click( function () { @@ -678,6 +678,7 @@ No patron matched [% message %] Title Item Type Checked out on + Checked out from Call no Charge Price @@ -701,6 +702,7 @@ No patron matched [% message %] [% UNLESS ( noItemTypeImages ) %] [% IF ( todayissue.itemtype_image ) %][% END %][% END %][% todayissue.itemtype %] [% todayissue.checkoutdate %] [% IF ( todayissue.multiple_borrowers ) %][% todayissue.borrowername %][% END %] + [% todayissue.issuingbranchname %] [% todayissue.itemcallnumber %] [% todayissue.charge %] [% todayissue.replacementprice %] @@ -775,6 +777,7 @@ No patron matched [% message %] [% previssue.displaydate %] [% IF ( previssue.multiple_borrowers ) %][% previssue.borrowername %][% END %] + [% previssue.issuingbranchname %] [% previssue.itemcallnumber %] [% previssue.charge %] [% previssue.replacementprice %] @@ -859,6 +862,7 @@ No patron matched [% message %] Title Item Type Checked out on + Checked out from Call no Charge Price @@ -878,6 +882,7 @@ No patron matched [% message %] [% relissue.title |html %][% IF ( relissue.author ) %], by [% relissue.author %][% END %][% IF ( relissue.itemnotes ) %]- [% relissue.itemnotes %][% END %] [% relissue.barcode %] [% UNLESS ( noItemTypeImages ) %] [% IF ( relissue.itemtype_image ) %][% END %][% END %][% relissue.itemtype %] [% relissue.displaydate %] + [% relissue.issuingbranchname %] [% relissue.itemcallnumber %] [% relissue.charge %] [% relissue.replacementprice %][% relissue.borrowername %] ([% relissue.cardnumber %]) @@ -898,6 +903,7 @@ No patron matched [% message %] [% relprevissue.title |html %][% IF ( relprevissue.author ) %], by [% relprevissue.author %][% END %] [% IF ( relprevissue.itemnotes ) %]- [% relprevissue.itemnotes %][% END %] [% relprevissue.barcode %] [% UNLESS noItemTypeImages %][% IF relprevissue.itemtype_image %][% END %][% END %][% relprevissue.itemtype %] [% relprevissue.displaydate %] + [% relprevissue.issuingbranchname %] [% relprevissue.itemcallnumber %] [% IF ( relprevissue.multiple_borrowers ) %][% relprevissue.borrowername %][% END %] [% relprevissue.charge %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index db9ae4d..84a9c48 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -17,16 +17,16 @@ $(document).ready(function() { $.tablesorter.defaults.widgets = ['zebra']; $("#issuest").tablesorter({[% IF ( dateformat_metric ) %] dateFormat: 'uk',[% END %] - headers: { 1: { sorter: 'articles' }} + headers: { 1: { sorter: 'articles'},8:{sorter:false},9:{sorter:false }} }); $("#relissuest").tablesorter({[% IF ( dateformat_metric ) %] dateFormat: 'uk',[% END %] - headers: { 1: { sorter: 'articles' }} + headers: { 1: { sorter: 'articles'},8:{sorter:false},9:{sorter:false }} }); $("#holdst").tablesorter({[% IF ( dateformat_metric ) %] dateFormat: 'uk',[% END %] sortList: [[0,0]], - headers: { 1: { sorter: 'articles' },6: { sorter: false }} + headers: { 1: { sorter: 'articles' },5: { sorter: false }} }); [% IF ( picture ) %] // new YAHOO.widget.Button("delpicture"); // FIXME: formatting mismatch between YUI and normal button @@ -422,6 +422,7 @@ function validate1(date) { Title Item Type Checked out on + Checked out from Call no Charge Price @@ -453,6 +454,7 @@ function validate1(date) { [% issueloo.title |html %][% IF ( issueloo.author ) %], by [% issueloo.author %][% END %] [% IF ( issueloo.publishercode ) %]; [% issueloo.publishercode %] [% END %] [% IF ( issueloo.publicationyear ) %], [% issueloo.publicationyear %][% END %] [% issueloo.barcode %] [% UNLESS ( noItemTypeImages ) %] [% IF ( issueloo.itemtype_image ) %][% END %][% END %][% issueloo.itemtype_description %] [% issueloo.issuedate %] + [% issueloo.issuingbranchname %] [% issueloo.itemcallnumber %] [% issueloo.charge %] [% issueloo.replacementprice %] @@ -529,6 +531,7 @@ function validate1(date) { Title Item Type Checked out on + Checked out from Call no Charge Price @@ -559,6 +562,7 @@ function validate1(date) { [% relissueloo.title |html %][% IF relissueloo.author %], by [% relissueloo.author %][% END %] [% IF relissueloo.publishercode %]; [% relissueloo.publishercode %] [% END %] [% IF relissueloo.publicationyear %], [% relissueloo.publicationyear %][% END %] [% relissueloo.barcode %] [% UNLESS ( noItemTypeImages ) %] [% IF ( relissueloo.itemtype_image ) %][% END %][% END %][% relissueloo.itemtype_description %] [% relissueloo.issuedate %] + [% relissueloo.issuingbranchname %] [% relissueloo.itemcallnumber %] [% relissueloo.charge %] [% relissueloo.replacementprice %] diff --git a/members/moremember.pl b/members/moremember.pl index bfaa402..a76652f 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -268,6 +268,7 @@ sub build_issue_data { $issue->[$i]{'date_due'} = C4::Dates->new($issue->[$i]{'date_due'}, 'iso')->output('syspref'); $issue->[$i]{'issuedate'} = C4::Dates->new($issue->[$i]{'issuedate'},'iso')->output('syspref'); my $biblionumber = $issue->[$i]{'biblionumber'}; + $issue->[$i]{'issuingbranchname'} = GetBranchName($issue->[$i]{'branchcode'}); my %row = %{ $issue->[$i] }; $totalprice += $issue->[$i]{'replacementprice'}; $row{'replacementprice'} = $issue->[$i]{'replacementprice'}; -- 1.7.2.5 From lrea at nekls.org Tue Sep 20 23:48:42 2011 From: lrea at nekls.org (Liz Rea) Date: Tue, 20 Sep 2011 16:48:42 -0500 Subject: [Koha-patches] [PATCH] [Signed Off] bug_6576: Submit when changing framework rather then reloading Message-ID: <1316555322-31369-1-git-send-email-lrea@nekls.org> From: Srdjan Jankovic TransformHtmlToMarc(): changed interface - no point passing params when they can be accessed from $cgi Signed-off-by: Liz Rea --- C4/Biblio.pm | 34 ++++++++++---------- authorities/authorities.pl | 3 +- cataloguing/addbiblio.pl | 21 +++++++----- cataloguing/merge.pl | 3 +- .../prog/en/modules/cataloguing/addbiblio.tt | 8 ++-- 5 files changed, 36 insertions(+), 33 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 96baaef..915139e 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1989,8 +1989,8 @@ sub _default_ind_to_space { =head2 TransformHtmlToMarc - L<$record> = TransformHtmlToMarc(L<$params>,L<$cgi>) - L<$params> is a ref to an array as below: + L<$record> = TransformHtmlToMarc(L<$cgi>) + L<$cgi> is the CGI object which containts the values for subfields { 'tag_010_indicator1_531951' , 'tag_010_indicator2_531951' , @@ -2007,15 +2007,15 @@ sub _default_ind_to_space { 'tag_200_code_f_873510_110730' , 'tag_200_subfield_f_873510_110730' , } - L<$cgi> is the CGI object which containts the value. L<$record> is the MARC::Record object. =cut sub TransformHtmlToMarc { - my $params = shift; my $cgi = shift; + my @params = $cgi->param(); + # explicitly turn on the UTF-8 flag for all # 'tag_' parameters to avoid incorrect character # conversion later on @@ -2035,8 +2035,8 @@ sub TransformHtmlToMarc { my $record = MARC::Record->new(); my $i = 0; my @fields; - while ( $params->[$i] ) { # browse all CGI params - my $param = $params->[$i]; + while ( $params[$i] ) { # browse all CGI params + my $param = $params[$i]; my $newfield = 0; # if we are on biblionumber, store it in the MARC::Record (it may not be in the edited fields) @@ -2052,7 +2052,7 @@ sub TransformHtmlToMarc { my $tag = $1; my $ind1 = _default_ind_to_space( substr( $cgi->param($param), 0, 1 ) ); - my $ind2 = _default_ind_to_space( substr( $cgi->param( $params->[ $i + 1 ] ), 0, 1 ) ); + my $ind2 = _default_ind_to_space( substr( $cgi->param( $params[ $i + 1 ] ), 0, 1 ) ); $newfield = 0; my $j = $i + 2; @@ -2062,27 +2062,27 @@ sub TransformHtmlToMarc { # Force a fake leader even if not provided to avoid crashing # during decoding MARC record containing UTF-8 characters $record->leader( - length( $cgi->param($params->[$j+1]) ) == 24 - ? $cgi->param( $params->[ $j + 1 ] ) + length( $cgi->param($params[$j+1]) ) == 24 + ? $cgi->param( $params[ $j + 1 ] ) : ' nam a22 4500' ) ; # between 001 and 009 (included) - } elsif ( $cgi->param( $params->[ $j + 1 ] ) ne '' ) { - $newfield = MARC::Field->new( $tag, $cgi->param( $params->[ $j + 1 ] ), ); + } elsif ( $cgi->param( $params[ $j + 1 ] ) ne '' ) { + $newfield = MARC::Field->new( $tag, $cgi->param( $params[ $j + 1 ] ), ); } # > 009, deal with subfields } else { - while ( defined $params->[$j] && $params->[$j] =~ /_code_/ ) { # browse all it's subfield - my $inner_param = $params->[$j]; + while ( defined $params[$j] && $params[$j] =~ /_code_/ ) { # browse all it's subfield + my $inner_param = $params[$j]; if ($newfield) { - if ( $cgi->param( $params->[ $j + 1 ] ) ne '' ) { # only if there is a value (code => value) - $newfield->add_subfields( $cgi->param($inner_param) => $cgi->param( $params->[ $j + 1 ] ) ); + if ( $cgi->param( $params[ $j + 1 ] ) ne '' ) { # only if there is a value (code => value) + $newfield->add_subfields( $cgi->param($inner_param) => $cgi->param( $params[ $j + 1 ] ) ); } } else { - if ( $cgi->param( $params->[ $j + 1 ] ) ne '' ) { # creating only if there is a value (code => value) - $newfield = MARC::Field->new( $tag, $ind1, $ind2, $cgi->param($inner_param) => $cgi->param( $params->[ $j + 1 ] ), ); + if ( $cgi->param( $params[ $j + 1 ] ) ne '' ) { # creating only if there is a value (code => value) + $newfield = MARC::Field->new( $tag, $ind1, $ind2, $cgi->param($inner_param) => $cgi->param( $params[ $j + 1 ] ), ); } } $j += 2; diff --git a/authorities/authorities.pl b/authorities/authorities.pl index d4f1601..2e18332 100755 --- a/authorities/authorities.pl +++ b/authorities/authorities.pl @@ -581,8 +581,7 @@ if ($op eq "add") { # build indicator hash. my @ind_tag = $input->param('ind_tag'); my @indicator = $input->param('indicator'); - my @params = $input->param(); - my $record = TransformHtmlToMarc(\@params,$input); + my $record = TransformHtmlToMarc($input); if (C4::Context->preference("marcflavour") eq "UNIMARC"){ unless ($record->field('100')){ use POSIX qw(strftime); diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 21601e9..ba10332 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -931,7 +931,7 @@ if ( $op eq "addbiblio" ) { ); # getting html input my @params = $input->param(); - $record = TransformHtmlToMarc( \@params , $input ); + $record = TransformHtmlToMarc( $input ); # check for a duplicate my ( $duplicatebiblionumber, $duplicatetitle ); if ( !$is_a_modif ) { @@ -1037,14 +1037,19 @@ elsif ( $op eq "delete" ) { $biblionumber = ""; } + if ( $record eq -1 ) { + $record = TransformHtmlToMarc( $input ); + } + else { #FIXME: it's kind of silly to go from MARC::Record to MARC::File::XML and then back again just to fix the encoding - eval { - my $uxml = $record->as_xml; - MARC::Record::default_record_format("UNIMARC") - if ( C4::Context->preference("marcflavour") eq "UNIMARC" ); - my $urecord = MARC::Record::new_from_xml( $uxml, 'UTF-8' ); - $record = $urecord; - }; + eval { + my $uxml = $record->as_xml; + MARC::Record::default_record_format("UNIMARC") + if ( C4::Context->preference("marcflavour") eq "UNIMARC" ); + my $urecord = MARC::Record::new_from_xml( $uxml, 'UTF-8' ); + $record = $urecord; + }; + } build_tabs( $template, $record, $dbh, $encoding,$input ); $template->param( biblionumber => $biblionumber, diff --git a/cataloguing/merge.pl b/cataloguing/merge.pl index cc2d01d..c97ca7a 100755 --- a/cataloguing/merge.pl +++ b/cataloguing/merge.pl @@ -48,12 +48,11 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( #------------------------ if ($merge) { - my @params = $input->param(); my $dbh = C4::Context->dbh; my $sth; # Creating a new record from the html code - my $record = TransformHtmlToMarc( \@params , $input ); + my $record = TransformHtmlToMarc( $input ); my $tobiblio = $input->param('biblio1'); my $frombiblio = $input->param('biblio2'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index baa84c7..91d926e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -254,9 +254,9 @@ function GetZ3950Terms(){ } function Changefwk(FwkList) { - var fwk = FwkList.options[FwkList.selectedIndex].value; - window.location = "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumberdata %]&op=[% op %]&breedingid=[% breedingid %]&mode=[% popup %]&frameworkcode="+fwk; - + var f = document.f; + f.op.value = ""; + f.submit(); } // returns the subfieldcode based upon subfieldid writing @@ -776,7 +776,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
  • - [% FOREACH frameworkcodeloo IN frameworkcodeloop %] [% IF ( frameworkcodeloo.selected ) %] -- 1.7.2.5 From srdjan at catalyst.net.nz Wed Sep 21 03:13:00 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Wed, 21 Sep 2011 13:13:00 +1200 Subject: [Koha-patches] [PATCH] bug_5533: new function C4::Circulation::LostItem($itemnumber, $mark_returned) In-Reply-To: References: Message-ID: <1316567580-21107-1-git-send-email-srdjan@catalyst.net.nz> Disabled Lost Status on cataloging full item edit longoverdue.pl calls LostItem() *without* $mark_returned Item moredetail calls LostItem() *with* $mark_returned Batch mode edit calls LostItem() *with* $mark_returned --- C4/Accounts.pm | 77 ++++++++------------------- C4/Circulation.pm | 40 ++++++++++++++- C4/Items.pm | 8 +++- catalogue/updateitem.pl | 3 +- cataloguing/additem.pl | 38 ++++++++----- misc/cronjobs/longoverdue.pl | 3 +- t/db_dependent/lib/KohaTest/Accounts.pm | 1 - t/db_dependent/lib/KohaTest/Circulation.pm | 1 + tools/batchMod.pl | 7 ++- 9 files changed, 100 insertions(+), 78 deletions(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index 2352e9e..860e187 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -23,8 +23,7 @@ use strict; use C4::Context; use C4::Stats; use C4::Members; -use C4::Items; -use C4::Circulation qw(MarkIssueReturned); +use C4::Circulation qw(ReturnLostItem); use vars qw($VERSION @ISA @EXPORT); @@ -218,7 +217,7 @@ sub makepayment { #check to see what accounttype if ( $data->{'accounttype'} eq 'Rep' || $data->{'accounttype'} eq 'L' ) { - returnlost( $borrowernumber, $data->{'itemnumber'} ); + ReturnLostItem( $borrowernumber, $data->{'itemnumber'} ); } } @@ -278,64 +277,34 @@ EOT =cut -sub returnlost{ - my ( $borrowernumber, $itemnum ) = @_; - C4::Circulation::MarkIssueReturned( $borrowernumber, $itemnum ); - my $borrower = C4::Members::GetMember( 'borrowernumber'=>$borrowernumber ); - my @datearr = localtime(time); - my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3]; - my $bor = "$borrower->{'firstname'} $borrower->{'surname'} $borrower->{'cardnumber'}"; - ModItem({ paidfor => "Paid for by $bor $date" }, undef, $itemnum); -} - - sub chargelostitem{ # lost ==1 Lost, lost==2 longoverdue, lost==3 lost and paid for # FIXME: itemlost should be set to 3 after payment is made, should be a warning to the interface that # a charge has been added # FIXME : if no replacement price, borrower just doesn't get charged? - my $dbh = C4::Context->dbh(); - my ($itemnumber) = @_; - my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title - FROM issues - JOIN items USING (itemnumber) - JOIN biblio USING (biblionumber) - WHERE issues.itemnumber=?"); - $sth->execute($itemnumber); - my $issues=$sth->fetchrow_hashref(); - - # if a borrower lost the item, add a replacement cost to the their record - if ( $issues->{borrowernumber} ){ - - # first make sure the borrower hasn't already been charged for this item - my $sth1=$dbh->prepare("SELECT * from accountlines - WHERE borrowernumber=? AND itemnumber=? and accounttype='L'"); - $sth1->execute($issues->{'borrowernumber'},$itemnumber); - my $existing_charge_hashref=$sth1->fetchrow_hashref(); - - # OK, they haven't - unless ($existing_charge_hashref) { - # This item is on issue ... add replacement cost to the borrower's record and mark it returned - # Note that we add this to the account even if there's no replacement price, allowing some other - # process (or person) to update it, since we don't handle any defaults for replacement prices. - my $accountno = getnextacctno($issues->{'borrowernumber'}); - my $sth2=$dbh->prepare("INSERT INTO accountlines - (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber) - VALUES (?,?,now(),?,?,'L',?,?)"); - $sth2->execute($issues->{'borrowernumber'},$accountno,$issues->{'replacementprice'}, - "Lost Item $issues->{'title'} $issues->{'barcode'}", - $issues->{'replacementprice'},$itemnumber); - $sth2->finish; - # FIXME: Log this ? - } - #FIXME : Should probably have a way to distinguish this from an item that really was returned. - #warn " $issues->{'borrowernumber'} / $itemnumber "; - C4::Circulation::MarkIssueReturned($issues->{borrowernumber},$itemnumber); - # Shouldn't MarkIssueReturned do this? - C4::Items::ModItem({ onloan => undef }, undef, $itemnumber); + my ($borrowernumber, $itemnumber, $amount, $description) = @_; + + # first make sure the borrower hasn't already been charged for this item + my $sth1=$dbh->prepare("SELECT * from accountlines + WHERE borrowernumber=? AND itemnumber=? and accounttype='L'"); + $sth1->execute($borrowernumber,$itemnumber); + my $existing_charge_hashref=$sth1->fetchrow_hashref(); + + # OK, they haven't + unless ($existing_charge_hashref) { + # This item is on issue ... add replacement cost to the borrower's record and mark it returned + # Note that we add this to the account even if there's no replacement price, allowing some other + # process (or person) to update it, since we don't handle any defaults for replacement prices. + my $accountno = getnextacctno($borrowernumber); + my $sth2=$dbh->prepare("INSERT INTO accountlines + (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber) + VALUES (?,?,now(),?,?,'L',?,?)"); + $sth2->execute($borrowernumber,$accountno,$amount, + $description,$amount,$itemnumber); + $sth2->finish; + # FIXME: Log this ? } - $sth->finish; } =head2 manualinvoice diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 520c116..589b5c5 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -59,8 +59,9 @@ BEGIN { # FIXME subs that should probably be elsewhere push @EXPORT, qw( - &FixOverduesOnReturn &barcodedecode + &LostItem + &ReturnLostItem ); # subs to deal with issuing a book @@ -2943,8 +2944,43 @@ sub DeleteBranchTransferLimits { $sth->execute(); } +sub ReturnLostItem{ + my ( $borrowernumber, $itemnum ) = @_; - 1; + MarkIssueReturned( $borrowernumber, $itemnum ); + my $borrower = C4::Members::GetMember( 'borrowernumber'=>$borrowernumber ); + my @datearr = localtime(time); + my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3]; + my $bor = "$borrower->{'firstname'} $borrower->{'surname'} $borrower->{'cardnumber'}"; + ModItem({ paidfor => "Paid for by $bor $date" }, undef, $itemnum); +} + + +sub LostItem{ + my ($itemnumber, $mark_returned) = @_; + + my $dbh = C4::Context->dbh(); + my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title + FROM issues + JOIN items USING (itemnumber) + JOIN biblio USING (biblionumber) + WHERE issues.itemnumber=?"); + $sth->execute($itemnumber); + my $issues=$sth->fetchrow_hashref(); + $sth->finish; + + # if a borrower lost the item, add a replacement cost to the their record + if ( my $borrowernumber = $issues->{borrowernumber} ){ + + C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}"); + #FIXME : Should probably have a way to distinguish this from an item that really was returned. + #warn " $issues->{'borrowernumber'} / $itemnumber "; + MarkIssueReturned($borrowernumber,$itemnumber) if $mark_returned; + } +} + + +1; __END__ diff --git a/C4/Items.pm b/C4/Items.pm index bc36dd1..9e7167d 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -397,6 +397,8 @@ Note that only columns that can be directly changed from the cataloging and serials item editors are included in this hash. +Returns item record + =cut my %default_values_for_mod_from_marc = ( @@ -446,7 +448,8 @@ sub ModItemFromMarc { } my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode ); - return ModItem($item, $biblionumber, $itemnumber, $dbh, $frameworkcode, $unlinked_item_subfields); + ModItem($item, $biblionumber, $itemnumber, $dbh, $frameworkcode, $unlinked_item_subfields); + return $item; } =head2 ModItem @@ -495,6 +498,9 @@ sub ModItem { }; $item->{'itemnumber'} = $itemnumber or return undef; + + $item->{onloan} = undef if $item->{itemlost}; + _set_derived_columns_for_mod($item); _do_column_fixes_for_mod($item); # FIXME add checks diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl index e8ce20d..345d0c8 100755 --- a/catalogue/updateitem.pl +++ b/catalogue/updateitem.pl @@ -26,7 +26,6 @@ use C4::Biblio; use C4::Items; use C4::Output; use C4::Circulation; -use C4::Accounts; use C4::Reserves; my $cgi= new CGI; @@ -75,6 +74,6 @@ if (defined $itemnotes) { # i.e., itemnotes parameter passed from form ModItem($item_changes, $biblionumber, $itemnumber); -C4::Accounts::chargelostitem($itemnumber) if ($itemlost==1) ; +LostItem($itemnumber, 'MARK RETURNED') if ($itemlost==1) ; print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber"); diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 0db2d2d..4b99654 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -26,6 +26,7 @@ use C4::Auth; use C4::Output; use C4::Biblio; use C4::Items; +use C4::Circulation; use C4::Context; use C4::Koha; # XXX subfield_is_koha_internal_p use C4::Branch; # XXX subfield_is_koha_internal_p @@ -206,28 +207,33 @@ sub generate_subfield_form { } } - $subfield_data{marc_value} =CGI::scrolling_list( # FIXME: factor out scrolling_list - -name => "field_value", - -values => \@authorised_values, - -default => $value, - -labels => \%authorised_lib, - -override => 1, - -size => 1, - -multiple => 0, - -tabindex => 1, - -id => "tag_".$tag."_subfield_".$subfieldtag."_".$index_subfield, - -class => "input_marceditor", - ); + if ($subfieldlib->{'hidden'}) { + $subfield_data{marc_value} = qq( $authorised_lib{$value}); + } + else { + $subfield_data{marc_value} =CGI::scrolling_list( # FIXME: factor out scrolling_list + -name => "field_value", + -values => \@authorised_values, + -default => $value, + -labels => \%authorised_lib, + -override => 1, + -size => 1, + -multiple => 0, + -tabindex => 1, + -id => "tag_".$tag."_subfield_".$subfieldtag."_".$index_subfield, + -class => "input_marceditor", + ); + } - # it's a thesaurus / authority field } + # it's a thesaurus / authority field elsif ( $subfieldlib->{authtypecode} ) { $subfield_data{marc_value} = " {authtypecode}."&index=$subfield_data{id}','$subfield_data{id}'); return false;\" title=\"Tag Editor\">... "; - # it's a plugin field } + # it's a plugin field elsif ( $subfieldlib->{value_builder} ) { # opening plugin my $plugin = C4::Context->intranetdir . "/cataloguing/value_builder/" . $subfieldlib->{'value_builder'}; @@ -498,7 +504,7 @@ if ($op eq "additem") { if ($exist_itemnumber && $exist_itemnumber != $itemnumber) { push @errors,"barcode_not_unique"; } else { - my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = ModItemFromMarc($itemtosave,$biblionumber,$itemnumber); + ModItemFromMarc($itemtosave,$biblionumber,$itemnumber); $itemnumber=""; } $nextop="additem"; @@ -608,6 +614,8 @@ if($itemrecord){ next if subfield_is_koha_internal_p($subfieldtag); next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"); + $subfieldlib->{hidden} = 1 + if $tagslib->{$tag}->{$subfieldtag}->{authorised_value} eq 'LOST'; my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i); push @fields, "$tag$subfieldtag"; diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index 651b9d2..2179d10 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -35,7 +35,6 @@ BEGIN { } use C4::Context; use C4::Items; -use C4::Accounts; use Getopt::Long; my $lost; # key=lost value, value=num days. @@ -155,7 +154,7 @@ foreach my $startrange (sort keys %$lost) { printf ("Due %s: item %5s from borrower %5s to lost: %s\n", $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue) if($verbose); if($confirm) { ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'}); - chargelostitem($row->{'itemnumber'}) if( $charge && $charge eq $lostvalue); + LostItem($row->{'itemnumber'}) if( $charge && $charge eq $lostvalue); } $count++; } diff --git a/t/db_dependent/lib/KohaTest/Accounts.pm b/t/db_dependent/lib/KohaTest/Accounts.pm index 703d478..ac3a78e 100644 --- a/t/db_dependent/lib/KohaTest/Accounts.pm +++ b/t/db_dependent/lib/KohaTest/Accounts.pm @@ -15,7 +15,6 @@ sub methods : Test( 1 ) { my @methods = qw( recordpayment makepayment getnextacctno - returnlost manualinvoice fixcredit refund diff --git a/t/db_dependent/lib/KohaTest/Circulation.pm b/t/db_dependent/lib/KohaTest/Circulation.pm index 7d5e69d..b3a1ff8 100644 --- a/t/db_dependent/lib/KohaTest/Circulation.pm +++ b/t/db_dependent/lib/KohaTest/Circulation.pm @@ -47,6 +47,7 @@ sub methods : Test( 1 ) { CheckSpecialHolidays CheckRepeatableSpecialHolidays CheckValidBarcode + ReturnLostItem ); can_ok( $self->testing_class, @methods ); diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 9d4431b..a7848b9 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -25,6 +25,7 @@ use C4::Auth; use C4::Output; use C4::Biblio; use C4::Items; +use C4::Circulation; use C4::Context; use C4::Koha; # XXX subfield_is_koha_internal_p use C4::Branch; # XXX subfield_is_koha_internal_p @@ -173,7 +174,11 @@ if ($op eq "action") { if ($values_to_modify || $values_to_blank) { my $localmarcitem = Item2Marc($itemdata); UpdateMarcWith( $marcitem, $localmarcitem ); - eval{ my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) }; + eval{ + if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) { + LostItem($itemnumber, 'MARK RETURNED') if $item->{itemlost} == 1; + } + }; } } $i++; -- 1.6.5 From Katrin.Fischer.83 at web.de Wed Sep 21 07:12:53 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Wed, 21 Sep 2011 07:12:53 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] 6278 Funny translation bug with XSLT subfieldSelect parameters Message-ID: <1316581973-7486-1-git-send-email-Katrin.Fischer.83@web.de> From: Marcel de Rooy This patch resolves the situation of translating the parameters at (meaning subfield a and t) of subfieldSelect by replacing at with a_t. This string will not be translated and the xslt function subfieldSelect just ignores the underscore. It is a pragmatic and easy solution. Theoretically, we should look for a solution in the translation parser. This is much harder and would probably not result in better code in those modules. Test this patch with the following remarks in mind: 1) This patch deals with XSLT. So you should enable XSLT at OPAC detail. 2) In English or any language not translating the word at: Just check if the links for a MARC 490, 773, 780 or 785 still work at the opac detail page. 3) For a language translating the word at (like Dutch where at becomes bij), you should first rerun your translation process (at least for the OPAC). 4) In that language: Check the results on the vernacular opac detail page for MARC 490, 773, 780 or 785. Without the patch, you would not see a link following e.g. the Series label (with 490 first indicator set to 1). With the patch, you should see a link now. Signed-off-by: Katrin Fischer Pragmatic solution for an annoying problem. --- .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 10 +++++----- .../prog/en/xslt/NORMARCslim2OPACDetail.xsl | 4 ++-- .../prog/en/xslt/UNIMARCslim2OPACDetail.xsl | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl index d4f763f..a0b72de 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -246,7 +246,7 @@ - at + a_t @@ -257,7 +257,7 @@ - at + a_t @@ -668,7 +668,7 @@ - at + a_t @@ -786,7 +786,7 @@ - at + a_t @@ -848,7 +848,7 @@ - at + a_t diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl index 961f0c9..d2b6b1b 100644 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl @@ -419,7 +419,7 @@ - at + a_t /cgi-bin/koha/opac-search.pl?q= @@ -469,7 +469,7 @@ - at + a_t diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl index 2832b6b..61054ea 100644 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl @@ -411,7 +411,7 @@ - at + a_t /cgi-bin/koha/opac-search.pl?q= @@ -464,7 +464,7 @@ - at + a_t -- 1.7.4.1 From Katrin.Fischer.83 at web.de Wed Sep 21 07:17:23 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Wed, 21 Sep 2011 07:17:23 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6519 : Changing analytic searches from Title: to ti, phr Message-ID: <1316582243-7913-1-git-send-email-Katrin.Fischer.83@web.de> From: Chris Cormack To test, you should get similar but better results when clicking a volume or set title from a record that is part of a set, (or a single volume) Signed-off-by: Katrin Fischer Note: if you are using $w for record linking you have to turn system preference UseControlnumber off to test this patch. --- .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 8 ++++---- .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index 4af47bd..e71685d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -242,7 +242,7 @@ /cgi-bin/koha/catalogue/search.pl?q=rcn: - /cgi-bin/koha/catalogue/search.pl?q=Title: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: Show volumes @@ -260,7 +260,7 @@ /cgi-bin/koha/catalogue/search.pl?q=Control-number: - /cgi-bin/koha/catalogue/search.pl?q=Title: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -565,7 +565,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=Title: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -597,7 +597,7 @@ /cgi-bin/koha/catalogue/search.pl?q=Control-number: - /cgi-bin/koha/catalogue/search.pl?q=Title: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl index d4f763f..3e57fec 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -299,7 +299,7 @@ /cgi-bin/koha/opac-search.pl?q=rcn: - /cgi-bin/koha/opac-search.pl?q=Title: + /cgi-bin/koha/opac-search.pl?q=ti,phr: Show volumes @@ -317,7 +317,7 @@ /cgi-bin/koha/opac-search.pl?q=Control-number: - /cgi-bin/koha/opac-search.pl?q=Title: + /cgi-bin/koha/opac-search.pl?q=ti,phr: @@ -679,7 +679,7 @@ - /cgi-bin/koha/opac-search.pl?q=Title: + /cgi-bin/koha/opac-search.pl?q=ti,phr: @@ -738,7 +738,7 @@ /cgi-bin/koha/opac-search.pl?q=Control-number: - /cgi-bin/koha/opac-search.pl?q=Title: + /cgi-bin/koha/opac-search.pl?q=ti,phr: -- 1.7.4.1 From srdjan at catalyst.net.nz Wed Sep 21 07:19:07 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Wed, 21 Sep 2011 17:19:07 +1200 Subject: [Koha-patches] [PATCH] bug_6253: Unified member Search() In-Reply-To: References: Message-ID: <1316582347-32713-1-git-send-email-srdjan@catalyst.net.nz> Removed SearchMembers() and replaced with more generic Search() Amended Search() to try cardnumber first Replaced SearchMembers() calls with Search() Replaced SELECT with Search() where appropriate C4::SQLHelper - added support for '' key for search filter. --- C4/Members.pm | 232 ++++++++++++-------------------- C4/Members/Attributes.pm | 2 +- C4/SQLHelper.pm | 49 ++++++- admin/aqbudget_owner_search.pl | 2 +- circ/circulation.pl | 2 +- circ/ysearch.pl | 28 ++--- members/guarantor_search.pl | 11 +- patroncards/members-search.pl | 14 +-- reserve/request.pl | 22 ++-- t/db_dependent/Koha.t | 14 ++- t/db_dependent/Members.t | 181 ++++++++++++++++++------- t/db_dependent/lib/KohaTest/Members.pm | 2 +- 12 files changed, 303 insertions(+), 256 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index 8d4a6c5..d42bfca 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -44,7 +44,6 @@ BEGIN { #Get data push @EXPORT, qw( &Search - &SearchMember &GetMemberDetails &GetMemberRelatives &GetMember @@ -141,178 +140,121 @@ This module contains routines for adding, modifying and deleting members/patrons =head1 FUNCTIONS -=head2 SearchMember - - ($count, $borrowers) = &SearchMember($searchstring, $type, - $category_type, $filter, $showallbranches); +=head2 Search -Looks up patrons (borrowers) by name. + $borrowers_result_array_ref = &Search($filter,$orderby, $limit, + $columns_out, $search_on_fields,$searchtype); -BUGFIX 499: C<$type> is now used to determine type of search. -if $type is "simple", search is performed on the first letter of the -surname only. +Looks up patrons (borrowers) on filter. A wrapper for SearchInTable('borrowers'). -$category_type is used to get a specified type of user. -(mainly adults when creating a child.) +For C<$filter>, C<$orderby>, C<$limit>, C<&columns_out>, C<&search_on_fields> and C<&searchtype> +refer to C4::SQLHelper:SearchInTable(). -C<$searchstring> is a space-separated list of search terms. Each term -must match the beginning a borrower's surname, first name, or other -name. +Special C<$filter> key '' is effectively expanded to search on surname firstname othernamescw +and cardnumber unless C<&search_on_fields> is defined -C<$filter> is assumed to be a list of elements to filter results on +Examples: -C<$showallbranches> is used in IndependantBranches Context to display all branches results. + $borrowers = Search('abcd', 'cardnumber'); -C<&SearchMember> returns a two-element list. C<$borrowers> is a -reference-to-array; each element is a reference-to-hash, whose keys -are the fields of the C table in the Koha database. -C<$count> is the number of elements in C<$borrowers>. + $borrowers = Search({''=>'abcd', category_type=>'I'}, 'surname'); =cut -#' -#used by member enquiries from the intranet -sub SearchMember { - my ($searchstring, $orderby, $type,$category_type,$filter,$showallbranches ) = @_; - my $dbh = C4::Context->dbh; - my $query = ""; - my $count; - my @data; - my @bind = (); - +sub _express_member_find { + my ($filter) = @_; + # this is used by circulation everytime a new borrowers cardnumber is scanned # so we can check an exact match first, if that works return, otherwise do the rest - $query = "SELECT * FROM borrowers - LEFT JOIN categories ON borrowers.categorycode=categories.categorycode - "; - my $sth = $dbh->prepare("$query WHERE cardnumber = ?"); - $sth->execute($searchstring); - my $data = $sth->fetchall_arrayref({}); - if (@$data){ - return ( scalar(@$data), $data ); - } - - if ( $type eq "simple" ) # simple search for one letter only - { - $query .= ($category_type ? " AND category_type = ".$dbh->quote($category_type) : ""); - $query .= " WHERE (surname LIKE ? OR cardnumber like ?) "; - if (C4::Context->preference("IndependantBranches") && !$showallbranches){ - if (C4::Context->userenv && C4::Context->userenv->{flags} % 2 !=1 && C4::Context->userenv->{'branch'}){ - $query.=" AND borrowers.branchcode =".$dbh->quote(C4::Context->userenv->{'branch'}) unless (C4::Context->userenv->{'branch'} eq "insecure"); - } - } - $query.=" ORDER BY $orderby"; - @bind = ("$searchstring%","$searchstring"); + my $dbh = C4::Context->dbh; + my $query = "SELECT borrowernumber FROM borrowers WHERE cardnumber = ?"; + if ( my $borrowernumber = $dbh->selectrow_array($query, undef, $filter) ) { + return( {"borrowernumber"=>$borrowernumber} ); } - else # advanced search looking in surname, firstname and othernames - { - @data = split( ' ', $searchstring ); - $count = @data; - $query .= " WHERE "; - if (C4::Context->preference("IndependantBranches") && !$showallbranches){ - if (C4::Context->userenv && C4::Context->userenv->{flags} % 2 !=1 && C4::Context->userenv->{'branch'}){ - $query.=" borrowers.branchcode =".$dbh->quote(C4::Context->userenv->{'branch'})." AND " unless (C4::Context->userenv->{'branch'} eq "insecure"); - } - } - $query.="((surname LIKE ? OR (surname LIKE ? AND surname REGEXP ?) - OR firstname LIKE ? OR (firstname LIKE ? AND firstname REGEXP ?) - OR othernames LIKE ? OR (othernames LIKE ? AND othernames REGEXP ?)) - " . - ($category_type?" AND category_type = ".$dbh->quote($category_type):""); - my $regex = '[[:punct:][:space:]]'.$data[0]; - @bind = ( - "$data[0]%", "%$data[0]%", $regex, - "$data[0]%", "%$data[0]%", $regex, - "$data[0]%", "%$data[0]%", $regex - ); - for ( my $i = 1 ; $i < $count ; $i++ ) { - $query = $query . " AND (" . " surname LIKE ? OR (surname LIKE ? AND surname REGEXP ?) - OR firstname LIKE ? OR (firstname LIKE ? AND firstname REGEXP ?) - OR othernames LIKE ? OR (othernames LIKE ? AND othernames REGEXP ?))"; - $regex = '[[:punct:][:space:]]'.$data[$i]; - push( @bind, - "$data[$i]%", "%$data[$i]%", $regex, - "$data[$i]%", "%$data[$i]%", $regex, - "$data[$i]%", "%$data[$i]%", $regex - ); - - - # FIXME - .= <prepare($query); - - $debug and print STDERR "Q $orderby : $query\n"; - $sth->execute(@bind); - my @results; - $data = $sth->fetchall_arrayref({}); - - return ( scalar(@$data), $data ); + return (undef, $search_on_fields, $searchtype); } -=head2 Search - - $borrowers_result_array_ref = &Search($filter,$orderby, $limit, - $columns_out, $search_on_fields,$searchtype); - -Looks up patrons (borrowers) on filter. - -BUGFIX 499: C<$type> is now used to determine type of search. -if $type is "simple", search is performed on the first letter of the -surname only. - -$category_type is used to get a specified type of user. -(mainly adults when creating a child.) - -C<$filter> can be - - a space-separated list of search terms. Implicit AND is done on them - - a hash ref containing fieldnames associated with queried value - - an array ref combining the two previous elements Implicit OR is done between each array element - - -C<$orderby> is an arrayref of hashref. Contains the name of the field and 0 or 1 depending if order is ascending or descending - -C<$limit> is there to allow limiting number of results returned - -C<&columns_out> is an array ref to the fieldnames you want to see in the result list - -C<&search_on_fields> is an array ref to the fieldnames you want to limit search on when you are using string search - -C<&searchtype> is a string telling the type of search you want todo : start_with, exact or contains are allowed - -=cut - sub Search { my ( $filter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype ) = @_; - my @filters; - my %filtersmatching_record; - my @finalfilter; - if ( ref($filter) eq "ARRAY" ) { - push @filters, @$filter; - } else { - push @filters, $filter; + + my $search_string; + my $found_borrower; + + if ( my $fr = ref $filter ) { + if ( $fr eq "HASH" ) { + if ( my $search_string = $filter->{''} ) { + my ($member_filter, $member_search_on_fields, $member_searchtype) = _express_member_find($search_string); + if ($member_filter) { + $filter = $member_filter; + $found_borrower = 1; + } else { + $search_on_fields ||= $member_search_on_fields; + $searchtype ||= $member_searchtype; + } + } + } + else { + $search_string = $filter; + } } - if ( C4::Context->preference('ExtendedPatronAttributes') ) { - my $matching_records = C4::Members::Attributes::SearchIdMatchingAttribute($filter); + else { + $search_string = $filter; + my ($member_filter, $member_search_on_fields, $member_searchtype) = _express_member_find($search_string); + if ($member_filter) { + $filter = $member_filter; + $found_borrower = 1; + } else { + $search_on_fields ||= $member_search_on_fields; + $searchtype ||= $member_searchtype; + } + } + + if ( !$found_borrower && C4::Context->preference('ExtendedPatronAttributes' && $search_string) ) { + my $matching_records = C4::Members::Attributes::SearchIdMatchingAttribute($search_string); if(scalar(@$matching_records)>0) { + my %filtersmatching_record; foreach my $matching_record (@$matching_records) { $filtersmatching_record{$$matching_record[0]}=1; } - foreach my $k (keys(%filtersmatching_record)) { - push @filters, {"borrowernumber"=>$k}; - } + # push @filters, [ map {"borrowernumber"=>$_}, keys %filtersmatching_record]; + $filter = [ map {"borrowernumber"=>$_}, keys %filtersmatching_record ]; + $found_borrower = 1; } } + + # $showallbranches was not used at the time SearchMember() was mainstreamed into Search(). + # Mentioning for the reference + + if ( C4::Context->preference("IndependantBranches") ) { # && !$showallbranches){ + if ( my $userenv = C4::Context->userenv ) { + my $branch = $userenv->{'branch'}; + if ( ($userenv->{flags} % 2 !=1) && + $branch && $branch ne "insecure" ){ + + my $fr = ref $filter; + $filter = { '' => $filter } unless $fr && $fr eq 'HASH'; + + $filter->{branchcode} = $branch; + } + } + } + + if ($found_borrower) { + $searchtype = "exact"; + } $searchtype ||= "start_with"; - push @finalfilter, \@filters; - my $data = SearchInTable( "borrowers", \@finalfilter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype ); - return ($data); + + return SearchInTable( "borrowers", $filter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype ); } =head2 GetMemberDetails diff --git a/C4/Members/Attributes.pm b/C4/Members/Attributes.pm index 35d6702..9d33ec6 100644 --- a/C4/Members/Attributes.pm +++ b/C4/Members/Attributes.pm @@ -124,7 +124,7 @@ sub GetBorrowerAttributeValue { sub SearchIdMatchingAttribute{ my $filter = shift; - my $finalfilter=$filter->[0]; + my $finalfilter = ref($filter) ? $filter : $filter->[0]; my $dbh = C4::Context->dbh(); my $query = qq{ SELECT borrowernumber diff --git a/C4/SQLHelper.pm b/C4/SQLHelper.pm index a15beb8..a53aad1 100644 --- a/C4/SQLHelper.pm +++ b/C4/SQLHelper.pm @@ -85,6 +85,21 @@ $filtercolums is an array ref on field names : is used to limit expansion of res $searchtype is string Can be "start_with" or "exact" +This query builder is very limited, it should be replaced with DBIx::Class +or similar very soon +Meanwhile adding support for special key '' in case of a data_hashref to +support filters of type + + ( f1 = a OR f2 = a ) AND fx = b AND fy = c + +Call for the query above is: + + SearchInTable($tablename, {'' => a, fx => b, fy => c}, $orderby, $limit, + $columns_out, [f1, f2], 'exact'); + +NOTE: Current implementation may remove parts of the iinput hashrefs. If that is a problem +a copy needs to be created in _filter_fields() below + =cut sub SearchInTable{ @@ -109,8 +124,12 @@ sub SearchInTable{ if ($orderby){ #Order by desc by default my @orders; - foreach my $order (@$orderby){ - push @orders,map{ "$_".($order->{$_}? " DESC " : "") } keys %$order; + foreach my $order ( ref($orderby) ? @$orderby : $orderby ){ + if (ref $order) { + push @orders,map{ "$_".($order->{$_}? " DESC " : "") } keys %$order; + } else { + push @orders,$order; + } } $sql.= do { local $"=', '; qq{ ORDER BY @orders} @@ -287,13 +306,21 @@ sub _filter_fields{ my @keys; my @values; if (ref($filter_input) eq "HASH"){ - my ($keys, $values) = _filter_hash($tablename,$filter_input, $searchtype); + my ($keys, $values); + if (my $special = delete $filter_input->{''}) { # XXX destroyes '' key + ($keys, $values) = _filter_fields($tablename,$special, $searchtype,$filtercolumns); + } + my ($hkeys, $hvalues) = _filter_hash($tablename,$filter_input, $searchtype); + if ($hkeys){ + push @$keys, @$hkeys; + push @$values, @$hvalues; + } if ($keys){ - my $stringkey="(".join (") AND (",@$keys).")"; - return [$stringkey],$values; + my $stringkey="(".join (") AND (",@$keys).")"; + return [$stringkey],$values; } else { - return (); + return (); } } elsif (ref($filter_input) eq "ARRAY"){ foreach my $element_data (@$filter_input){ @@ -334,7 +361,9 @@ sub _filter_hash{ my $elements=join "|", at columns_filtered; foreach my $field (grep {/\b($elements)\b/} keys %$filter_input){ ## supposed to be a hash of simple values, hashes of arrays could be implemented - $filter_input->{$field}=format_date_in_iso($filter_input->{$field}) if ($columns->{$field}{Type}=~/date/ && $filter_input->{$field} !~C4::Dates->regexp("iso")); + $filter_input->{$field}=format_date_in_iso($filter_input->{$field}) + if $columns->{$field}{Type}=~/date/ && + $filter_input->{$field} && $filter_input->{$field} !~C4::Dates->regexp("iso"); my ($tmpkeys, $localvalues)=_Process_Operands($filter_input->{$field},"$tablename.$field",$searchtype,$columns); if (@$tmpkeys){ push @values, @$localvalues; @@ -352,7 +381,11 @@ sub _filter_hash{ sub _filter_string{ my ($tablename,$filter_input, $searchtype,$filtercolumns)=@_; return () unless($filter_input); - my @operands=split / /,$filter_input; + my @operands=split /\s+/,$filter_input; + + # An act of desperation + $searchtype = 'contain' if @operands > 1 && $searchtype =~ /start_with/o; + my @columns_filtered= _filter_columns($tablename,$searchtype,$filtercolumns); my $columns= _get_columns($tablename); my (@values, at keys); diff --git a/admin/aqbudget_owner_search.pl b/admin/aqbudget_owner_search.pl index 69e465f..5c73e9e 100755 --- a/admin/aqbudget_owner_search.pl +++ b/admin/aqbudget_owner_search.pl @@ -64,7 +64,7 @@ my @resultsdata; my $toggle = 0; if ( $member ) { - my $results= SearchMember($member,"surname",undef,undef,undef); + my $results= Search($member,"surname"); foreach my $res (@$results) { diff --git a/circ/circulation.pl b/circ/circulation.pl index fff32a2..d2bd78c 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -186,7 +186,7 @@ if ( $print eq 'yes' && $borrowernumber ne '' ) { my $borrowerslist; my $message; if ($findborrower) { - my ($count, $borrowers) = SearchMember($findborrower, 'cardnumber', 'web'); + my $borrowers = Search($findborrower, 'cardnumber'); my @borrowers = @$borrowers; if (C4::Context->preference("AddPatronLists")) { $template->param( diff --git a/circ/ysearch.pl b/circ/ysearch.pl index f8fc52a..7e458aa 100755 --- a/circ/ysearch.pl +++ b/circ/ysearch.pl @@ -28,6 +28,7 @@ use strict; #use warnings; FIXME - Bug 2505 use CGI; use C4::Context; +use C4::Members; use C4::Auth qw/check_cookie_auth/; my $input = new CGI; @@ -41,22 +42,11 @@ if ($auth_status ne "ok") { exit 0; } -my $dbh = C4::Context->dbh; -my $sql = qq(SELECT surname, firstname, cardnumber, address, city, zipcode, country - FROM borrowers - WHERE surname LIKE ? - OR firstname LIKE ? - OR cardnumber LIKE ? - ORDER BY surname, firstname); -my $sth = $dbh->prepare( $sql ); -$sth->execute("$query%", "$query%", "$query%"); - -while ( my $rec = $sth->fetchrow_hashref ) { - print $rec->{surname} . ", " . $rec->{firstname} . "\t" . - $rec->{cardnumber} . "\t" . - $rec->{address} . "\t" . - $rec->{city} . "\t" . - $rec->{zip} . "\t" . - $rec->{country} . - "\n"; -} +print map $_->{surname} . ", " . $_->{firstname} . "\t" . + $_->{cardnumber} . "\t" . + $_->{address} . "\t" . + $_->{city} . "\t" . + $_->{zipcode} . "\t" . + $_->{country} . + "\n", + @{ Search($query, [qw(surname firstname)], [20], [qw(surname firstname cardnumber address city zipcode country)]) }; diff --git a/members/guarantor_search.pl b/members/guarantor_search.pl index 9eb60de..59ea5b1 100755 --- a/members/guarantor_search.pl +++ b/members/guarantor_search.pl @@ -66,14 +66,9 @@ my @resultsdata; my $background = 0; if ($member ne ''){ - if(length($member) == 1) - { - ($count,$results)=SearchMember($member,$orderby,"simple",$search_category); - } - else - { - ($count,$results)=SearchMember($member,$orderby,"advanced",$search_category); - } + $results = Search({''=>$member, category_type=>$search_category},$orderby); + $count = $results ? @$results : 0; + for (my $i=0; $i < $count; $i++){ #find out stats my ($od,$issue,$fines)=GetMemberIssuesAndFines($results->[$i]{'borrowerid'}); diff --git a/patroncards/members-search.pl b/patroncards/members-search.pl index c2abe07..dfa0462 100755 --- a/patroncards/members-search.pl +++ b/patroncards/members-search.pl @@ -49,17 +49,9 @@ $member =~ s/,//g; #remove any commas from search string $member =~ s/\*/%/g; if ($member || $category) { - my ($count,$results) = 0,0; - - if(length($member) == 1) - { - ($count,$results) = SearchMember($member,$orderby,"simple"); - } - else - { - ($count,$results) = SearchMember($member,$orderby,"advanced",$category); - } - + my $results = $category ? Search({''=>$member, category_type=>$category}, $orderby) + : Search($member, $orderby); + my $count = $results ? @$results : 0; my @resultsdata = (); my $to = ($count>($startfrom * $resultsperpage)?$startfrom * $resultsperpage:$count); diff --git a/reserve/request.pl b/reserve/request.pl index b345845..d2ba55a 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -112,20 +112,18 @@ if ( $action eq 'move' ) { } if ($findborrower) { - my ( $count, $borrowers ) = - SearchMember($findborrower, 'cardnumber', 'web' ); + my $borrowers = Search($findborrower, 'cardnumber'); - my @borrowers = @$borrowers; - - if ( !@borrowers ) { + if ($borrowers && @$borrowers) { + if ( @$borrowers == 1 ) { + $borrowernumber_hold = $borrowers->[0]->{'borrowernumber'}; + } + else { + $borrowerslist = $borrowers; + } + } else { $messageborrower = "'$findborrower'"; } - elsif ( @borrowers == 1 ) { - $borrowernumber_hold = $borrowers[0]->{'borrowernumber'}; - } - else { - $borrowerslist = \@borrowers; - } } # If we have the borrowernumber because we've performed an action, then we diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t index 016525a..378a0c1 100644 --- a/t/db_dependent/Koha.t +++ b/t/db_dependent/Koha.t @@ -7,10 +7,11 @@ use strict; use warnings; use C4::Context; -use Test::More tests => 4; +use Test::More tests => 8; BEGIN { use_ok('C4::Koha'); + use_ok('C4::Members'); } my $data = { @@ -32,10 +33,19 @@ ok($insert_success, "Insert data in database"); # Tests SKIP: { - skip "INSERT failed", 2 unless $insert_success; + skip "INSERT failed", 5 unless $insert_success; is ( GetAuthorisedValueByCode($data->{category}, $data->{authorised_value}), $data->{lib}, "GetAuthorisedValueByCode" ); is ( GetKohaImageurlFromAuthorisedValues($data->{category}, $data->{lib}), $data->{imageurl}, "GetKohaImageurlFromAuthorisedValues" ); + + my $sortdet=C4::Members::GetSortDetails("lost", "3"); + is ($sortdet, "Lost and Paid For", "lost and paid works"); + + my $sortdet2=C4::Members::GetSortDetails("loc", "child"); + is ($sortdet2, "Children's Area", "Child area works"); + + my $sortdet3=C4::Members::GetSortDetails("withdrawn", "1"); + is ($sortdet3, "Withdrawn", "Withdrawn works"); } # Clean up diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t index e28fbae..b09d887 100755 --- a/t/db_dependent/Members.t +++ b/t/db_dependent/Members.t @@ -6,62 +6,146 @@ use strict; use warnings; -use Test::More tests => 15; +use Test::More tests => 20; +use Data::Dumper; BEGIN { use_ok('C4::Members'); } -# Make a borrower for testing -my $data = { cardnumber => 'TESTCARD01', - firstname => 'Marie', - surname => 'Mcknight', - categorycode => 'S', - branchcode => 's' - }; +my $CARDNUMBER = 'TESTCARD01'; +my $FIRSTNAME = 'Marie'; +my $SURNAME = 'Mcknight'; +my $CATEGORYCODE = 'S'; +my $BRANCHCODE = 's'; -my $addmem=AddMember(%$data); +my $CHANGED_FIRSTNAME = "Marry Ann"; +my $EMAIL = "Marie\@email.com"; +my $ETHNICITY = "German"; +my $PHONE = "555-12123"; +# XXX should be randomised and checked against the database +my $IMPOSSIBLE_CARDNUMBER = "XYZZZ999"; -my $member=GetMemberDetails("","TESTCARD01"); -is ($member->{firstname}, "Marie", "Got member"); +my $INDEPENDENT_BRANCHES_PREF = 'IndependantBranches'; -$member->{firstname}="Claire"; -ModMember(%$member); -my $changedmember=GetMemberDetails("","TESTCARD01"); -is ($changedmember->{firstname}, "Claire", "Member Changed"); +# XXX make a non-commit transaction and rollback rather than insert/delete -$member->{firstname}="Marie"; -ModMember(%$member); -$changedmember=GetMemberDetails("","TESTCARD01"); -is ($changedmember->{firstname}, "Marie", "Member Returned"); +#my ($usernum, $userid, $usercnum, $userfirstname, $usersurname, $userbranch, $branchname, $userflags, $emailaddress, $branchprinter)= @_; +my @USERENV = ( + 1, + 'test', + 'MASTERTEST', + 'Test', + 'Test', + 't', + 'Test', + 0, +); +my $BRANCH_IDX = 5; -$member->{email}="Marie\@email.com"; -ModMember(%$member); -$changedmember=GetMemberDetails("","TESTCARD01"); -is ($changedmember->{email}, "Marie\@email.com", "Email Set works"); +C4::Context->_new_userenv ('DUMMY_SESSION_ID'); +C4::Context->set_userenv ( @USERENV ); -$member->{ethnicity}="German"; -ModMember(%$member); -$changedmember=GetMemberDetails("","TESTCARD01"); -is ($changedmember->{ethnicity}, "German", "Ethnicity Works"); - -my @searchstring=("Mcknight"); -my ($results) = Search(\@searchstring,undef,undef,undef,["surname"]); -is ($results->[0]->{surname}, "Mcknight", "Surname Search works"); +my $userenv = C4::Context->userenv + or BAIL_OUT("No userenv"); -$member->{phone}="555-12123"; +# Make a borrower for testing +my %data = ( + cardnumber => $CARDNUMBER, + firstname => $FIRSTNAME, + surname => $SURNAME, + categorycode => $CATEGORYCODE, + branchcode => $BRANCHCODE, +); + +my $addmem=AddMember(%data); +ok($addmem, "AddMember()"); + +my $member=GetMemberDetails("",$CARDNUMBER) + or BAIL_OUT("Cannot read member with card $CARDNUMBER"); + +ok ( $member->{firstname} eq $FIRSTNAME && + $member->{surname} eq $SURNAME && + $member->{categorycode} eq $CATEGORYCODE && + $member->{branchcode} eq $BRANCHCODE + , "Got member") + or diag("Mismatching member details: ".Dumper(\%data, $member)); + +$member->{firstname} = $CHANGED_FIRSTNAME; +$member->{email} = $EMAIL; +$member->{ethnicity} = $ETHNICITY; +$member->{phone} = $PHONE; ModMember(%$member); - - at searchstring=("555-12123"); -($results) = Search(\@searchstring,undef,undef,undef,["phone"]); -is ($results->[0]->{phone}, "555-12123", "phone Search works"); - -my $checkcardnum=C4::Members::checkcardnumber("TESTCARD01", ""); +my $changedmember=GetMemberDetails("",$CARDNUMBER); +ok ( $changedmember->{firstname} eq $CHANGED_FIRSTNAME && + $changedmember->{email} eq $EMAIL && + $changedmember->{ethnicity} eq $ETHNICITY && + $changedmember->{phone} eq $PHONE + , "Member Changed") + or diag("Mismatching member details: ".Dumper($member, $changedmember)); + +C4::Context->set_preference( $INDEPENDENT_BRANCHES_PREF, '0' ); +C4::Context->clear_syspref_cache(); + +my $results = Search($CARDNUMBER); +ok (@$results == 1, "Search cardnumber returned only one result") + or diag("Multiple members with Card $CARDNUMBER: ".Dumper($results)); +ok (_find_member($results), "Search cardnumber") + or diag("Card $CARDNUMBER not found in the resultset: ".Dumper($results)); + +my @searchstring=($SURNAME); +$results = Search(\@searchstring); +ok (_find_member($results), "Search (arrayref)") + or diag("Card $CARDNUMBER not found in the resultset: ".Dumper($results)); + +$results = Search(\@searchstring,undef,undef,undef,["surname"]); +ok (_find_member($results), "Surname Search (arrayref)") + or diag("Card $CARDNUMBER not found in the resultset: ".Dumper($results)); + +$results = Search("$CHANGED_FIRSTNAME $SURNAME", "surname"); +ok (_find_member($results), "Full name Search (string)") + or diag("Card $CARDNUMBER not found in the resultset: ".Dumper($results)); + + at searchstring=($PHONE); +$results = Search(\@searchstring,undef,undef,undef,["phone"]); +ok (_find_member($results), "Phone Search (arrayref)") + or diag("Card $CARDNUMBER not found in the resultset: ".Dumper($results)); + +$results = Search($PHONE,undef,undef,undef,["phone"]); +ok (_find_member($results), "Phone Search (string)") + or diag("Card $CARDNUMBER not found in the resultset: ".Dumper($results)); + +C4::Context->set_preference( $INDEPENDENT_BRANCHES_PREF, '1' ); +C4::Context->clear_syspref_cache(); + +$results = Search("$CHANGED_FIRSTNAME $SURNAME", "surname"); +ok (!_find_member($results), "Full name Search (string) for independent branches, different branch") + or diag("Card $CARDNUMBER found in the resultset for independent branches: ".Dumper(C4::Context->preference($INDEPENDENT_BRANCHES_PREF), $results)); + + at searchstring=($SURNAME); +$results = Search(\@searchstring); +ok (!_find_member($results), "Search (arrayref) for independent branches, different branch") + or diag("Card $CARDNUMBER found in the resultset for independent branches: ".Dumper(C4::Context->preference($INDEPENDENT_BRANCHES_PREF), $results)); + +$USERENV[$BRANCH_IDX] = $BRANCHCODE; +C4::Context->set_userenv ( @USERENV ); + +$results = Search("$CHANGED_FIRSTNAME $SURNAME", "surname"); +ok (_find_member($results), "Full name Search (string) for independent branches, same branch") + or diag("Card $CARDNUMBER not found in the resultset for independent branches: ".Dumper(C4::Context->preference($INDEPENDENT_BRANCHES_PREF), $results)); + + at searchstring=($SURNAME); +$results = Search(\@searchstring); +ok (_find_member($results), "Search (arrayref) for independent branches, same branch") + or diag("Card $CARDNUMBER not found in the resultset for independent branches: ".Dumper(C4::Context->preference($INDEPENDENT_BRANCHES_PREF), $results)); + + +my $checkcardnum=C4::Members::checkcardnumber($CARDNUMBER, ""); is ($checkcardnum, "1", "Card No. in use"); -$checkcardnum=C4::Members::checkcardnumber("67", ""); +$checkcardnum=C4::Members::checkcardnumber($IMPOSSIBLE_CARDNUMBER, ""); is ($checkcardnum, "0", "Card No. not used"); my $age=GetAge("1992-08-14", "2011-01-19"); @@ -70,14 +154,17 @@ is ($age, "18", "Age correct"); $age=GetAge("2011-01-19", "1992-01-19"); is ($age, "-19", "Birthday In the Future"); -my $sortdet=C4::Members::GetSortDetails("lost", "3"); -is ($sortdet, "Lost and Paid For", "lost and paid works"); +# clean up +DelMember($member->{borrowernumber}); +$results = Search($CARDNUMBER,undef,undef,undef,["cardnumber"]); +ok (!_find_member($results), "Delete member") + or diag("Card $CARDNUMBER found for the deleted member in the resultset: ".Dumper($results)); -my $sortdet2=C4::Members::GetSortDetails("loc", "child"); -is ($sortdet2, "Children's Area", "Child area works"); -my $sortdet3=C4::Members::GetSortDetails("withdrawn", "1"); -is ($sortdet3, "Withdrawn", "Withdrawn works"); +exit; -# clean up -DelMember($member->{borrowernumber}); +sub _find_member { + my ($resultset) = @_; + my $found = $resultset && grep( { $_->{cardnumber} && $_->{cardnumber} eq $CARDNUMBER } @$resultset ); + return $found; +} diff --git a/t/db_dependent/lib/KohaTest/Members.pm b/t/db_dependent/lib/KohaTest/Members.pm index ff18869..5646be1 100644 --- a/t/db_dependent/lib/KohaTest/Members.pm +++ b/t/db_dependent/lib/KohaTest/Members.pm @@ -12,7 +12,7 @@ sub testing_class { 'C4::Members' }; sub methods : Test( 1 ) { my $self = shift; - my @methods = qw( SearchMember + my @methods = qw( Search GetMemberDetails patronflags GetMember -- 1.6.5 From paul.poulain at biblibre.com Wed Sep 21 16:34:44 2011 From: paul.poulain at biblibre.com (paul.poulain at biblibre.com) Date: Wed, 21 Sep 2011 16:34:44 +0200 Subject: [Koha-patches] [PATCH] Bug 5729 - Add CoinS to intranet Message-ID: <1316615684-19271-1-git-send-email-paul.poulain@biblibre.com> From: Paul Poulain This patch adds CoinS support to biblio displays in staff interface. librarians can now use zotero on the staff interface --- catalogue/ISBDdetail.pl | 3 ++- catalogue/MARCdetail.pl | 2 ++ catalogue/detail.pl | 1 + .../prog/en/modules/catalogue/ISBDdetail.tt | 5 ++++- .../prog/en/modules/catalogue/MARCdetail.tt | 4 ++++ .../prog/en/modules/catalogue/detail.tt | 5 +++++ 6 files changed, 18 insertions(+), 2 deletions(-) diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl index 58a8d90..8daa13e 100755 --- a/catalogue/ISBDdetail.pl +++ b/catalogue/ISBDdetail.pl @@ -106,7 +106,8 @@ $template->param ( biblionumber => $biblionumber, isbdview => 1, z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)), - C4::Search::enabled_staff_search_views + C4::Search::enabled_staff_search_views, + ocoins => GetCOinSBiblio($biblionumber), ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index 0a2974b..52fbc6a 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -82,6 +82,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +$template->param( ocoins => GetCOinSBiblio($biblionumber) ); + my $record = GetMarcBiblio($biblionumber); if ( not defined $record ) { diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 8738737..d43038d 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -83,6 +83,7 @@ if (C4::Context->preference("XSLTDetailsDisplay") ) { } $template->param( 'SpineLabelShowPrintOnBibDetails' => C4::Context->preference("SpineLabelShowPrintOnBibDetails") ); +$template->param( ocoins => GetCOinSBiblio($biblionumber) ); # some useful variables for enhanced content; # in each case, we're grabbing the first value we find in diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt index b08f360..8b8fc97 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt @@ -30,7 +30,10 @@
    [% INCLUDE 'cat-toolbar.inc' %] - + [% IF ( ocoins ) %] + + + [% END %]
    [% ISBD %]
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt index 3fac577..0202462 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt @@ -57,6 +57,10 @@ function Changefwk(FwkList) { [% IF ( frameworkcodeloo.selected ) %][% ELSE %][% END %] [% END %]

    +[% IF ( ocoins ) %] + + +[% END %]
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc index a7b77e2..cadd1cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc @@ -8,7 +8,6 @@ [% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]
  • [% ELSE %]
  • [% END %]Circulation History
  • [% END %] [% IF ( CAN_user_parameters ) %][% IF ( logview ) %]
  • [% ELSE %]
  • [% END %]Modification Log
  • [% END %] [% IF ( EnhancedMessagingPreferences ) %] - [% IF ( messagingview ) %]
  • [% ELSE %]
  • [% END %]Messaging
  • [% END %] [% IF ( sentnotices ) %]
  • [% ELSE %]
  • [% END %]Notices
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/messaging.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/messaging.tt deleted file mode 100644 index 2980a53..0000000 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/messaging.tt +++ /dev/null @@ -1,68 +0,0 @@ -[% INCLUDE 'doc-head-open.inc' %] -Koha › Patrons › [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron Details for [% firstname %] [% surname %] ([% cardnumber %])[% END %] -[% INCLUDE 'doc-head-close.inc' %] - - -[% INCLUDE 'header.inc' %] -[% INCLUDE 'patron-search.inc' %] - - - -
    - -
    -
    -
    -[% INCLUDE 'members-toolbar.inc' %] -[% IF ( error ) %] -
    -[% IF ( AUTH_UPDATE_FAILED ) %] -

    Userid / Password update failed

    -Insufficient privileges. -

    Other fields updated.

    -[% END %] -[% IF ( CANT_DELETE_STAFF ) %] -

    Unable to delete staff user

    -

    Insufficient privileges.

    -[% END %] -[% IF ( CANT_DELETE_OTHERLIBRARY ) %] -

    Unable to delete patrons from other libraries with current settings

    -

    Insufficient privileges.

    -[% END %] -[% IF ( CANT_DELETE ) %] -

    Unable to delete patron:

    -

    Insufficient privileges.

    -[% END %] -
    -[% END %] -
    -[% IF ( unknowuser ) %] -
    - This patron does not exist. -
    -[% ELSE %] - - - - -[% IF ( message_queue ) %] - [% FOREACH message_queu IN message_queue %] - - [% END %] -[% ELSE %] - -[% END %] -
    Message Queue
    TypeSubjectStatusTime Prepared
    [% message_queu.message_transport_type %][% message_queu.subject %][% message_queu.status %][% message_queu.time_queued %]
    There is no record of any messages that have been sent to this patron.
    - -
    - -[% END %] - - -
    -
    -
    -[% INCLUDE 'circ-menu.inc' %] -
    -
    -[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt index 2bce08a..8dcf7d7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt @@ -10,10 +10,20 @@ dateFormat: 'uk' [% END %] }); + + $("a.message-title").click(function(e){ + $("p.message").hide(); + $(this).next("p").show(); + e.preventDefault(); + }); + }); //]]> - + [% INCLUDE 'header.inc' %] @@ -22,34 +32,53 @@
    - -
    -
    -
    +
    +
    +
    [% INCLUDE 'circ-toolbar.inc' %]

    Sent notices for [% firstname %] [% surname %]

    + - - + +[% IF ( QUEUED_MESSAGES ) %] [% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %] - - - - + + + [% END %] + [% ELSE %] + + [% END %]
    SubjectContentNotice Type Status Time
    [% QUEUED_MESSAGE.subject %][% QUEUED_MESSAGE.content %][% QUEUED_MESSAGE.message_transport_type %][% QUEUED_MESSAGE.status %] + [% QUEUED_MESSAGE.subject %] +

    + [% QUEUED_MESSAGE.content FILTER html_line_break %] +

    +
    + [% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]email + [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'print' ) %]print + [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'feed' ) %]feed + [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'sms' ) %]sms + [% ELSE %][% QUEUED_MESSAGE.message_transport_type %][% END %] + + [% IF ( QUEUED_MESSAGE.status == 'sent' ) %]sent + [% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]pending + [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]failed + [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted + [% ELSE %][% QUEUED_MESSAGE.status %][% END %] + [% QUEUED_MESSAGE.time_queued %]
    There is no record of any messages that have been sent to this patron.
    diff --git a/members/messaging.pl b/members/messaging.pl deleted file mode 100755 index 8791dcf..0000000 --- a/members/messaging.pl +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/perl - -# Copyright 2008 LibLime -# -# 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 2 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, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -use strict; -use warnings; - -use CGI; -use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Members; -use C4::Members::Messaging; -use C4::Dates; -use C4::Reserves; -use C4::Circulation; -use C4::Koha; -use C4::Letters; -use C4::Biblio; -use C4::Reserves; -use C4::Branch; # GetBranchName - -use Data::Dumper; - -use vars qw($debug); - -BEGIN { - $debug = $ENV{DEBUG} || 0; -} - -my $dbh = C4::Context->dbh; - -my $query = CGI->new(); - -my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { - template_name => 'members/messaging.tmpl', - query => $query, - type => "intranet", - authnotrequired => 0, - flagsrequired => { borrowers => 1 }, - debug => 1, - } -); -my $borrowernumber = $query->param('borrowernumber'); -my $borrower = GetMember( 'borrowernumber' => $borrowernumber ); -my $branch = C4::Context->userenv->{'branch'}; - -$template->param( $borrower ); - -$borrower = GetMemberDetails( $borrowernumber ); - - - if ( $borrower->{'category_type'} eq 'C') { - my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); - my $cnt = scalar(@$catcodes); - $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1; - $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1; - } - -my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'}); -$template->param( picture => 1 ) if $picture; - -# get some recent messages sent to this borrower for display: -my $message_queue = C4::Letters::GetQueuedMessages( { borrowernumber => $query->param('borrowernumber') } ); - -$template->param( messagingview => 1, - message_queue => $message_queue, - DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), - borrowernumber => $borrowernumber, - branchname => GetBranchName($borrower->{'branchcode'}), - dateformat => C4::Context->preference("dateformat"), - categoryname => $borrower->{'description'}, - $borrower->{'categorycode'} => 1, -); - -#$messaging_preferences->{'SMSnumber'}{'value'} = defined $borrower->{'smsalertnumber'} -# ? $borrower->{'smsalertnumber'} : $borrower->{'mobile'}; - -$template->param( %{ $borrower } ); -$template->param( - messagingview => 1, - is_child => ($borrower->{'category_type'} eq 'C'), - ); - -output_html_with_http_headers $query, $cookie, $template->output; diff --git a/members/notices.pl b/members/notices.pl index 088d5a8..7955581 100755 --- a/members/notices.pl +++ b/members/notices.pl @@ -56,7 +56,9 @@ $template->param( %{$borrower} ); $template->param( QUEUED_MESSAGES => $queued_messages, borrowernumber => $borrowernumber, - sentnotices => 1 + sentnotices => 1, + branchname => GetBranchName($borrower->{'branchcode'}), + categoryname => $borrower->{'description'}, ); output_html_with_http_headers $input, $cookie, $template->output; -- 1.7.2.5 From robin at catalyst.net.nz Fri Sep 23 01:38:06 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Fri, 23 Sep 2011 11:38:06 +1200 Subject: [Koha-patches] [PATCH] Bug 6871 - add schema and sql library reports to guided reports sidebar Message-ID: <1316734686-21321-1-git-send-email-robin@catalyst.net.nz> From: Liz Rea This patch adds links for schema.k-c.org and the sql report library to the guided reports sidebar. Signed-off-by: Robin Sheat --- .../prog/en/includes/guided-reports-view.inc | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc index d0101e6..d354170 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc @@ -8,3 +8,8 @@ +
    Useful Resources
    + -- 1.7.4.1 From srdjan at catalyst.net.nz Fri Sep 23 02:21:30 2011 From: srdjan at catalyst.net.nz (Srdjan Jankovic) Date: Fri, 23 Sep 2011 12:21:30 +1200 Subject: [Koha-patches] [PATCH] bug_3966: Update items on receive In-Reply-To: References: Message-ID: <1316737290-5155-1-git-send-email-srdjan@catalyst.net.nz> Changed AddItem() and ModItem() interface so now they return item record. AddItemFromMarc() looks for itemnumber, and calls ModItem() if one is found. --- C4/Biblio.pm | 6 +- C4/ImportBatch.pm | 4 +- C4/Items.pm | 19 +++-- acqui/addorder.pl | 5 +- acqui/addorderiso2709.pl | 4 +- acqui/finishreceive.pl | 93 +++++++++++--------- acqui/orderreceive.pl | 63 ++++++------- cataloguing/additem.pl | 10 +- .../prog/en/modules/acqui/orderreceive.tt | 14 ++-- t/db_dependent/lib/KohaTest.pm | 16 ++-- t/db_dependent/lib/KohaTest/Biblio/ModBiblio.pm | 6 +- tools/batchMod.pl | 2 +- 12 files changed, 124 insertions(+), 118 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 915139e..53f2f97 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2343,7 +2343,7 @@ sub TransformMarcToKohaOneField { =head2 PrepareItemrecordDisplay - PrepareItemrecordDisplay($itemrecord,$bibnum,$itemumber,$frameworkcode); + PrepareItemrecordDisplay($bibnum,$itemumber,$defaultvalues,$frameworkcode); Returns a hash with all the fields for Display a given item data in a template @@ -2522,14 +2522,14 @@ sub PrepareItemrecordDisplay { $subfield_data{random} = int(rand(1000000)); # why do we need 2 different randoms? my $index_subfield = int(rand(1000000)); $subfield_data{id} = "tag_".$tag."_subfield_".$subfield."_".$index_subfield; - $subfield_data{marc_value} = qq[ ... $javascript]; } else { warn "Plugin Failed: $plugin"; - $subfield_data{marc_value} = qq(); # supply default input form + $subfield_data{marc_value} = qq(); # supply default input form } } elsif ( $tag eq '' ) { # it's an hidden field diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index b6db406..a121d08 100644 --- a/C4/ImportBatch.pm +++ b/C4/ImportBatch.pm @@ -547,10 +547,10 @@ sub BatchCommitItems { $updsth->execute(); $num_items_errored++; } else { - my ($item_biblionumber, $biblioitemnumber, $itemnumber) = AddItemFromMarc($item_marc, $biblionumber); + my $item = AddItemFromMarc($item_marc, $biblionumber); my $updsth = $dbh->prepare("UPDATE import_items SET status = ?, itemnumber = ? WHERE import_items_id = ?"); $updsth->bind_param(1, 'imported'); - $updsth->bind_param(2, $itemnumber); + $updsth->bind_param(2, $item->{itemnumber}); $updsth->bind_param(3, $row->{'import_items_id'}); $updsth->execute(); $updsth->finish(); diff --git a/C4/Items.pm b/C4/Items.pm index bc36dd1..e8e590e 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -190,11 +190,11 @@ sub CartToShelf { =head2 AddItemFromMarc - my ($biblionumber, $biblioitemnumber, $itemnumber) - = AddItemFromMarc($source_item_marc, $biblionumber); + my $item = AddItemFromMarc($source_item_marc, $biblionumber); Given a MARC::Record object containing an embedded item -record and a biblionumber, create a new item record. +record and a biblionumber, create a new item record or update +existing one. =cut @@ -210,13 +210,15 @@ sub AddItemFromMarc { $localitemmarc->append_fields($source_item_marc->field($itemtag)); my $item = &TransformMarcToKoha( $dbh, $localitemmarc, $frameworkcode ,'items'); my $unlinked_item_subfields = _get_unlinked_item_subfields($localitemmarc, $frameworkcode); + if (my $itemnumber = $item->{itemnumber}) { + return ModItem($item, $biblionumber, $itemnumber, $dbh, $frameworkcode, $unlinked_item_subfields); + } return AddItem($item, $biblionumber, $dbh, $frameworkcode, $unlinked_item_subfields); } =head2 AddItem - my ($biblionumber, $biblioitemnumber, $itemnumber) - = AddItem($item, $biblionumber[, $dbh, $frameworkcode, $unlinked_item_subfields]); + my $item = AddItem($item, $biblionumber[, $dbh, $frameworkcode, $unlinked_item_subfields]); Given a hash containing item column names as keys, create a new Koha item record. @@ -268,7 +270,7 @@ sub AddItem { logaction("CATALOGUING", "ADD", $itemnumber, "item") if C4::Context->preference("CataloguingLog"); - return ($item->{biblionumber}, $item->{biblioitemnumber}, $itemnumber); + return $item; } =head2 AddItemBatchFromMarc @@ -445,13 +447,14 @@ sub ModItemFromMarc { $item->{$item_field} = $default_values_for_mod_from_marc{$item_field} unless (exists $item->{$item_field}); } my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode ); + $itemnumber ||= $item->{itemnumber}; return ModItem($item, $biblionumber, $itemnumber, $dbh, $frameworkcode, $unlinked_item_subfields); } =head2 ModItem - ModItem({ column => $newvalue }, $biblionumber, + my $item = ModItem({ column => $newvalue }, $biblionumber, $itemnumber[, $original_item_marc]); Change one or more columns in an item record and update @@ -512,6 +515,8 @@ sub ModItem { ModZebra( $biblionumber, "specialUpdate", "biblioserver", undef, undef ); logaction("CATALOGUING", "MODIFY", $itemnumber, Dumper($item)) if C4::Context->preference("CataloguingLog"); + + return $item; } =head2 ModItemTransfer diff --git a/acqui/addorder.pl b/acqui/addorder.pl index e321d2c..5352535 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -260,9 +260,8 @@ if ( $orderinfo->{quantity} ne '0' ) { $itemhash{$item}->{'indicator'}, 'ITEM'); my $record=MARC::Record::new_from_xml($xml, 'UTF-8'); - my ($biblionumber,$bibitemnum,$itemnumber) = AddItemFromMarc($record,$$orderinfo{biblionumber}); - NewOrderItem($itemnumber, $$orderinfo{ordernumber}); - + my $item = AddItemFromMarc($record,$$orderinfo{biblionumber}); + NewOrderItem($item->{itemnumber}, $$orderinfo{ordernumber}); } } diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 46d05dd..4ab36eb 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -259,8 +259,8 @@ if ($op eq ""){ my $xml = TransformHtmlToXml( \@tags, \@subfields, \@field_values, \@ind_tag, \@indicator ); my $record = MARC::Record::new_from_xml( $xml, 'UTF-8' ); for (my $qtyloop=1;$qtyloop <=$quantity;$qtyloop++) { - my ( $biblionumber, $bibitemnum, $itemnumber ) = AddItemFromMarc( $record, $biblionumber ); - NewOrderItem( $itemnumber, $ordernumber ); + my $item = AddItemFromMarc( $record, $biblionumber ); + NewOrderItem( $item->{itemnumber}, $ordernumber ); } } } diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index 71b13d6..7327d18 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -50,7 +50,7 @@ my $gst=$input->param('gst'); my $freight=$input->param('freight'); my $supplierid = $input->param('supplierid'); my $cnt=0; -my $error_url_str; +my $error_url_str = ''; my $ecost = $input->param('ecost'); my $note = $input->param("note"); @@ -73,45 +73,56 @@ if ( any { $order->{$_} ne $tplorder{$_} } qw(quantity quantityreceived notes rr } #need old recievedate if we update the order, parcel.pl only shows the right parcel this way FIXME -if ($quantityrec > $origquantityrec ) { - # now, add items if applicable - if (C4::Context->preference('AcqCreateItem') eq 'receiving') { - my @tags = $input->param('tag'); - my @subfields = $input->param('subfield'); - my @field_values = $input->param('field_value'); - my @serials = $input->param('serial'); - my @itemid = $input->param('itemid'); - my @ind_tag = $input->param('ind_tag'); - my @indicator = $input->param('indicator'); - #Rebuilding ALL the data for items into a hash - # parting them on $itemid. - my %itemhash; - my $countdistinct; - my $range=scalar(@itemid); - for (my $i=0; $i<$range; $i++){ - unless ($itemhash{$itemid[$i]}){ - $countdistinct++; - } - push @{$itemhash{$itemid[$i]}->{'tags'}},$tags[$i]; - push @{$itemhash{$itemid[$i]}->{'subfields'}},$subfields[$i]; - push @{$itemhash{$itemid[$i]}->{'field_values'}},$field_values[$i]; - push @{$itemhash{$itemid[$i]}->{'ind_tag'}},$ind_tag[$i]; - push @{$itemhash{$itemid[$i]}->{'indicator'}},$indicator[$i]; - } - foreach my $item (keys %itemhash){ - my $xml = TransformHtmlToXml( $itemhash{$item}->{'tags'}, - $itemhash{$item}->{'subfields'}, - $itemhash{$item}->{'field_values'}, - $itemhash{$item}->{'ind_tag'}, - $itemhash{$item}->{'indicator'},'ITEM'); - my $record=MARC::Record::new_from_xml($xml, 'UTF-8'); - my ($biblionumber,$bibitemnum,$itemnumber) = AddItemFromMarc($record,$biblionumber); - } + +# now, add or update items if applicable +my @tags = $input->param('tag'); +my @subfields = $input->param('subfield'); +my @field_values = $input->param('field_value'); +my @serials = $input->param('serial'); +my @itemid = $input->param('itemid'); +my @ind_tag = $input->param('ind_tag'); +my @indicator = $input->param('indicator'); +#Rebuilding ALL the data for items into a hash +# parting them on $itemid. +my %itemhash; +my $countdistinct; +my $range=scalar(@itemid); +for (my $i=0; $i<$range; $i++){ + unless ($itemhash{$itemid[$i]}){ + $countdistinct++; + } + push @{$itemhash{$itemid[$i]}->{'tags'}},$tags[$i]; + push @{$itemhash{$itemid[$i]}->{'subfields'}},$subfields[$i]; + push @{$itemhash{$itemid[$i]}->{'field_values'}},$field_values[$i]; + push @{$itemhash{$itemid[$i]}->{'ind_tag'}},$ind_tag[$i]; + push @{$itemhash{$itemid[$i]}->{'indicator'}},$indicator[$i]; +} +my $error; +my %itemnumbers = map { $_ => 1 } GetItemnumbersFromOrder($ordernumber); +foreach my $item (keys %itemhash){ + my $xml = TransformHtmlToXml( $itemhash{$item}->{'tags'}, + $itemhash{$item}->{'subfields'}, + $itemhash{$item}->{'field_values'}, + $itemhash{$item}->{'ind_tag'}, + $itemhash{$item}->{'indicator'},'ITEM'); + my $record=MARC::Record::new_from_xml($xml, 'UTF-8'); + my $item = AddItemFromMarc($record,$biblionumber); + my $itemnumber = $item ? $item->{itemnumber} : undef; + if ($itemnumber) { + NewOrderItem($itemnumber, $ordernumber) unless $itemnumbers{$itemnumber}; + } else { + $error++; + } +} + +if ($error) { + $error_url_str = "&error=Datbase+write+error"; +} +else { + if ($quantityrec != $origquantityrec ) { + # save the quantity received. + $datereceived = ModReceiveOrder($biblionumber,$ordernumber, $quantityrec ,$user,$unitprice,$invoiceno,$freight,$replacement,undef,$datereceived); } - - # save the quantity received. - if( $quantityrec > 0 ) { - $datereceived = ModReceiveOrder($biblionumber,$ordernumber, $quantityrec ,$user,$unitprice,$invoiceno,$freight,$replacement,undef,$datereceived); - } } - print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoice=$invoiceno&supplierid=$supplierid&freight=$freight&gst=$gst&datereceived=$datereceived$error_url_str"); + +print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoice=$invoiceno&supplierid=$supplierid&freight=$freight&gst=$gst&datereceived=$datereceived$error_url_str"); diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index 98ba544..26ca81f 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -85,21 +85,13 @@ my $search = $input->param('receive'); my $invoice = $input->param('invoice'); my $freight = $input->param('freight'); my $datereceived = $input->param('datereceived'); - - $datereceived = $datereceived ? C4::Dates->new($datereceived, 'iso') : C4::Dates->new(); my $bookseller = GetBookSellerFromId($supplierid); my $input_gst = ($input->param('gst') eq '' ? undef : $input->param('gst')); my $gst= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0; my $results = SearchOrder($ordernumber,$search); - - my $count = scalar @$results; -my $order = GetOrder($ordernumber); - - -my $date = @$results[0]->{'entrydate'}; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -114,47 +106,50 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( # prepare the form for receiving if ( $count == 1 ) { - if (C4::Context->preference('AcqCreateItem') eq 'receiving') { + my $order = GetOrder($results->[0]->{ordernumber}); + my $biblionumber = $order->{biblionumber}; + + my @itemloop; + if ( my @itemnumbers = GetItemnumbersFromOrder($ordernumber) ) { + @itemloop = map PrepareItemrecordDisplay($biblionumber,$_), @itemnumbers; + } + elsif (C4::Context->preference('AcqCreateItem') eq 'receiving') { # prepare empty item form my $cell = PrepareItemrecordDisplay('','','','ACQ'); unless ($cell) { $cell = PrepareItemrecordDisplay('','','',''); $template->param('NoACQframework' => 1); } - my @itemloop; push @itemloop,$cell; - - $template->param(items => \@itemloop); } + + $template->param(items => \@itemloop) if @itemloop; - if ( @$results[0]->{'quantityreceived'} == 0 ) { - @$results[0]->{'quantityreceived'} = ''; - } - if ( @$results[0]->{'unitprice'} == 0 ) { - @$results[0]->{'unitprice'} = ''; + if ( $order->{'unitprice'} == 0 ) { + $order->{'unitprice'} = ''; } $template->param( count => 1, - biblionumber => @$results[0]->{'biblionumber'}, - ordernumber => @$results[0]->{'ordernumber'}, - biblioitemnumber => @$results[0]->{'biblioitemnumber'}, - supplierid => @$results[0]->{'booksellerid'}, + biblionumber => $biblionumber, + ordernumber => $order->{'ordernumber'}, + biblioitemnumber => $order->{'biblioitemnumber'}, + supplierid => $supplierid, freight => $freight, gst => $gst, name => $bookseller->{'name'}, - date => format_date($date), - title => @$results[0]->{'title'}, - author => @$results[0]->{'author'}, - copyrightdate => @$results[0]->{'copyrightdate'}, - isbn => @$results[0]->{'isbn'}, - seriestitle => @$results[0]->{'seriestitle'}, - bookfund => @$results[0]->{'bookfundid'}, - quantity => @$results[0]->{'quantity'}, - quantityreceivedplus1 => @$results[0]->{'quantityreceived'} + 1, - quantityreceived => @$results[0]->{'quantityreceived'}, - rrp => @$results[0]->{'rrp'}, - ecost => @$results[0]->{'ecost'}, - unitprice => @$results[0]->{'unitprice'}, + date => format_date($order->{'entrydate'}), + title => $order->{'title'}, + author => $order->{'author'}, + copyrightdate => $order->{'copyrightdate'}, + isbn => $order->{'isbn'}, + seriestitle => $order->{'seriestitle'}, + bookfund => $order->{'bookfundid'}, + quantity => $order->{'quantity'}, + quantityreceived => scalar(@itemloop) || 1, + origquantityrec => $order->{'quantityreceived'}, + rrp => $order->{'rrp'}, + ecost => $order->{'ecost'}, + unitprice => $order->{'unitprice'}, invoice => $invoice, datereceived => $datereceived->output(), datereceived_iso => $datereceived->output('iso'), diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 0db2d2d..dc0fc1d 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -340,8 +340,8 @@ if ($op eq "additem") { push @errors,"barcode_not_unique" if($exist_itemnumber); # if barcode exists, don't create, but report The problem. unless ($exist_itemnumber) { - my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = AddItemFromMarc($record,$biblionumber); - set_item_default_location($oldbibitemnum); + my $item = AddItemFromMarc($record,$biblionumber); + set_item_default_location($item->{biblioitemnumber}); } $nextop = "additem"; if ($exist_itemnumber) { @@ -407,8 +407,8 @@ if ($op eq "additem") { # Adding the item if (!$exist_itemnumber) { - my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = AddItemFromMarc($record,$biblionumber); - set_item_default_location($oldbibitemnum); + my $item = AddItemFromMarc($record,$biblionumber); + set_item_default_location($item->{biblioitemnumber}); # We count the item only if it was really added # That way, all items are added, even if there was some already existing barcodes @@ -498,7 +498,7 @@ if ($op eq "additem") { if ($exist_itemnumber && $exist_itemnumber != $itemnumber) { push @errors,"barcode_not_unique"; } else { - my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = ModItemFromMarc($itemtosave,$biblionumber,$itemnumber); + ModItemFromMarc($itemtosave,$biblionumber,$itemnumber); $itemnumber=""; } $nextop="additem"; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt index 746155f..d42e898 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -42,6 +42,7 @@

    No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used

    [% END %] + [% itemid = 1 %] [% FOREACH item IN items %]
    @@ -50,7 +51,7 @@ [% iteminformatio.marc_value %] - + @@ -72,8 +73,9 @@ - + + [% itemid = itemid + 1 %] [% END %] [% END %] @@ -101,14 +103,12 @@ [% IF ( quantityreceived ) %] [% IF ( edit ) %] - [% ELSE %] [% IF ( items ) %] - + [% ELSE %] - + [% END %] - [% END %] [% ELSE %] [% IF ( items ) %] @@ -116,8 +116,8 @@ [% ELSE %] [% END %] - [% END %] +
  • diff --git a/t/db_dependent/lib/KohaTest.pm b/t/db_dependent/lib/KohaTest.pm index 70c963d..77e91d1 100644 --- a/t/db_dependent/lib/KohaTest.pm +++ b/t/db_dependent/lib/KohaTest.pm @@ -572,16 +572,12 @@ sub add_biblios { ok( $biblionumber, "the biblionumber is $biblionumber" ); ok( $biblioitemnumber, "the biblioitemnumber is $biblioitemnumber" ); if ( $param{'add_items'} ) { - # my @iteminfo = AddItem( {}, $biblionumber ); - my @iteminfo = AddItemFromMarc( $marcrecord, $biblionumber ); - is( $iteminfo[0], $biblionumber, "biblionumber is $biblionumber" ); - is( $iteminfo[1], $biblioitemnumber, "biblioitemnumber is $biblioitemnumber" ); - ok( $iteminfo[2], "itemnumber is $iteminfo[2]" ); - push @{ $self->{'items'} }, - { biblionumber => $iteminfo[0], - biblioitemnumber => $iteminfo[1], - itemnumber => $iteminfo[2], - }; + # my $item = AddItem( {}, $biblionumber ); + my $item = AddItemFromMarc( $marcrecord, $biblionumber ); + is( $item->{biblionumber}, "biblionumber is $biblionumber" ); + is( $item->{biblioitemnumber}, "biblioitemnumber is $biblioitemnumber" ); + ok( $item->{itemnumber}, "itemnumber is $item->{itemnumber}" ); + push @{ $self->{'items'} }, $item; } push @{$self->{'biblios'}}, $biblionumber; } diff --git a/t/db_dependent/lib/KohaTest/Biblio/ModBiblio.pm b/t/db_dependent/lib/KohaTest/Biblio/ModBiblio.pm index 5b29ea8..8a83268 100644 --- a/t/db_dependent/lib/KohaTest/Biblio/ModBiblio.pm +++ b/t/db_dependent/lib/KohaTest/Biblio/ModBiblio.pm @@ -31,10 +31,10 @@ sub add_bib_to_modify : Test( startup => 3 ) { $self->{'bib_to_modify'} = $bibnum; # add an item - my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum); + my $item = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum); - cmp_ok($item_bibnum, '==', $bibnum, "new item is linked to correct biblionumber"); - cmp_ok($item_bibitemnum, '==', $bibitemnum, "new item is linked to correct biblioitemnumber"); + cmp_ok($item->{biblionumber}, '==', $bibnum, "new item is linked to correct biblionumber"); + cmp_ok($item->{biblioitemnumber}, '==', $bibitemnum, "new item is linked to correct biblioitemnumber"); $self->reindex_marc(); diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 9d4431b..ebf9d6e 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -173,7 +173,7 @@ if ($op eq "action") { if ($values_to_modify || $values_to_blank) { my $localmarcitem = Item2Marc($itemdata); UpdateMarcWith( $marcitem, $localmarcitem ); - eval{ my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) }; + eval{ ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) }; } } $i++; -- 1.6.5 From robin at catalyst.net.nz Fri Sep 23 05:25:06 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Fri, 23 Sep 2011 15:25:06 +1200 Subject: [Koha-patches] [PATCH] Bug 6905: [master] change which page clicking users in circ history takes you to Message-ID: <1316748306-24253-1-git-send-email-robin@catalyst.net.nz> Adds a syspref (borrowerhistorylink) that allows you to choose where links to borrowers on the item circulation page go, choosing between the circ page for them, or their details page. Default is the current behaviour (go the the circ page.) --- catalogue/moredetail.pl | 12 +++++++++--- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 6 ++++++ .../en/modules/admin/preferences/circulation.pref | 6 ++++++ .../prog/en/modules/catalogue/moredetail.tt | 6 +++--- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index d285a49..58a395f 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -146,10 +146,16 @@ foreach my $item (@items){ $item->{'issue'}= 0; } } -$template->param(count => $data->{'count'}, - subscriptionsnumber => $subscriptionsnumber, +my $borrower_link + = ( C4::Context->preference("BorrowingHistoryLink") eq 'details' ) + ? 'members/moremember.pl' + : 'circ/circulation.pl'; +$template->param( + count => $data->{'count'}, + subscriptionsnumber => $subscriptionsnumber, subscriptiontitle => $data->{title}, - C4::Search::enabled_staff_search_views, + borrowerlink => $borrower_link, + C4::Search::enabled_staff_search_views, ); $template->param(BIBITEM_DATA => \@results); $template->param(ITEM_DATA => \@items); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 79d4893..c02b567 100755 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -171,6 +171,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CircControl',"ItemHomeLibrary",'Specify the agency that controls the circulation and fines policy',"PickupLibrary|PatronLibrary|ItemHomeLibrary",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar',"noFinesWhenClosed",'Specify whether to use the Calendar in calculating duedates and fines',"ignoreCalendar|noFinesWhenClosed",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('previousIssuesDefaultSortOrder',"asc",'Specify the sort order of Previous Issues on the circulation page',"asc|desc",'Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowingHistoryLink','circhist','When showing borrower history for an item on the catalogue page, link to borrower','detail|circhist','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('todaysIssuesDefaultSortOrder',"desc",'Specify the sort order of Todays Issues on the circulation page',"asc|desc",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACBaseURL',NULL,'Specify the Base URL of the OPAC, e.g., opac.mylibrary.com, the http:// will be added automatically by Koha.',NULL,'Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('language','en','Set the default language in the staff client.',NULL,'Languages'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6b88c29..46c017e 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4446,6 +4446,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "xxx"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowingHistoryLink','circhist','When showing borrower history for an item on the catalogue page, link to borrower','detail|circhist','Choice')"); + print "Add the system preference 'BorrowingHistoryLink' (bug 6905)\n"; + SetVersion($DBversion); +} =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index dc821a8..d2590fd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -24,6 +24,12 @@ Circulation: desc: latest to earliest - due date. - + - When showing borrower history for an item on the catalogue page, link to borrower + - pref: BorrowingHistoryLink + choices: + details: details + circhist: circulation history + - - "Sort today's checkouts on the circulation page from" - pref: todaysIssuesDefaultSortOrder type: choice diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index 86c8a3f..ae73330 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -169,9 +169,9 @@
  • Last seen: [% ITEM_DAT.datelastseen %] 
  • Last borrowed: [% ITEM_DAT.datelastborrowed %] 
  • - [% IF ( ITEM_DAT.card0 ) %]
  • Last Borrower: [% ITEM_DAT.card0 %] 
  • [% END %] - [% IF ( ITEM_DAT.card1 ) %]
  • Previous Borrower: [% ITEM_DAT.card1 %] 
  • [% END %] - [% IF ( ITEM_DAT.card2 ) %]
  • Previous Borrower: [% ITEM_DAT.card2 %] 
  • [% END %] + [% IF ( ITEM_DAT.card0 ) %]
  • Last Borrower: [% ITEM_DAT.card0 %] 
  • [% END %] + [% IF ( ITEM_DAT.card1 ) %]
  • Previous Borrower: [% ITEM_DAT.card1 %] 
  • [% END %] + [% IF ( ITEM_DAT.card2 ) %]
  • Previous Borrower: [% ITEM_DAT.card2 %] 
  • [% END %]
  • Paid for?: [% ITEM_DAT.paidfor %] 
  • Serial enumeration: [% ITEM_DAT.enumchron %] 
  • Public Note: -- 1.7.4.1 From robin at catalyst.net.nz Fri Sep 23 05:26:05 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Fri, 23 Sep 2011 15:26:05 +1200 Subject: [Koha-patches] =?utf-8?b?W1BBVENIXSBCdWcgNjkwNTogWzMuNC54XSBjaGFu?= =?utf-8?q?ge_which_page_clicking_users_in_circ_history_takes_you_t?= =?utf-8?q?o?= Message-ID: <1316748365-24333-1-git-send-email-robin@catalyst.net.nz> Adds a syspref (borrowerhistorylink) that allows you to choose where links to borrowers on the item circulation page go, choosing between the circ page for them, or their details page. Default is the current behaviour (go the the circ page.) --- catalogue/moredetail.pl | 12 +++++++++--- installer/data/mysql/de-DE/mandatory/sysprefs.sql | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 1 + .../1-Obligatoire/unimarc_standard_systemprefs.sql | 1 + installer/data/mysql/it-IT/necessari/sysprefs.sql | 1 + installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 1 + ...m_preferences_full_optimal_for_install_only.sql | 1 + ...m_preferences_full_optimal_for_install_only.sql | 1 + installer/data/mysql/updatedatabase.pl | 8 ++++++++ .../en/modules/admin/preferences/circulation.pref | 6 ++++++ .../prog/en/modules/catalogue/moredetail.tt | 6 +++--- 11 files changed, 33 insertions(+), 6 deletions(-) diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index d848188..cb8dfed 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -146,10 +146,16 @@ foreach my $item (@items){ $item->{'issue'}= 0; } } -$template->param(count => $data->{'count'}, - subscriptionsnumber => $subscriptionsnumber, +my $borrower_link + = ( C4::Context->preference("BorrowingHistoryLink") eq 'details' ) + ? 'members/moremember.pl' + : 'circ/circulation.pl'; +$template->param( + count => $data->{'count'}, + subscriptionsnumber => $subscriptionsnumber, subscriptiontitle => $data->{title}, - C4::Search::enabled_staff_search_views, + borrowerlink => $borrower_link, + C4::Search::enabled_staff_search_views, ); $template->param(BIBITEM_DATA => \@results); $template->param(ITEM_DATA => \@items); diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index ec0e85c..d7f2f7f 100755 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -168,6 +168,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CircControl',"ItemHomeLibrary",'Specify the agency that controls the circulation and fines policy',"PickupLibrary|PatronLibrary|ItemHomeLibrary",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar',"noFinesWhenClosed",'Specify whether to use the Calendar in calculating duedates and fines',"ignoreCalendar|noFinesWhenClosed",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('previousIssuesDefaultSortOrder',"asc",'Specify the sort order of Previous Issues on the circulation page',"asc|desc",'Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowingHistoryLink','circhist','When showing borrower history for an item on the catalogue page, link to borrower','detail|circhist','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('todaysIssuesDefaultSortOrder',"desc",'Specify the sort order of Todays Issues on the circulation page',"asc|desc",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACBaseURL',NULL,'Specify the Base URL of the OPAC, e.g., opac.mylibrary.com, the http:// will be added automatically by Koha.',NULL,'Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('language','en','Set the default language in the staff client.',NULL,'Languages'); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index f313a39..269b024 100755 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -169,6 +169,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CircControl',"ItemHomeLibrary",'Specify the agency that controls the circulation and fines policy',"PickupLibrary|PatronLibrary|ItemHomeLibrary",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar',"noFinesWhenClosed",'Specify whether to use the Calendar in calculating duedates and fines',"ignoreCalendar|noFinesWhenClosed",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('previousIssuesDefaultSortOrder',"asc",'Specify the sort order of Previous Issues on the circulation page',"asc|desc",'Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowingHistoryLink','circhist','When showing borrower history for an item on the catalogue page, link to borrower','detail|circhist','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('todaysIssuesDefaultSortOrder',"desc",'Specify the sort order of Todays Issues on the circulation page',"asc|desc",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACBaseURL',NULL,'Specify the Base URL of the OPAC, e.g., opac.mylibrary.com, the http:// will be added automatically by Koha.',NULL,'Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('language','en','Set the default language in the staff client.',NULL,'Languages'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index 52a95d3..e2a3721 100755 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -182,6 +182,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar',"noFinesWhenClosed",'Sp?cifie l''utilisation du calendrier pour le calcul des dates de retours et les amendes',"ignoreCalendar|noFinesWhenClosed",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('previousIssuesDefaultSortOrder',"asc",'Ordre d''affichage des pr?ts en cours sur la page de circulation hors pr?ts du jour',"asc|desc",'Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowingHistoryLink','circhist','When showing borrower history for an item on the catalogue page, link to borrower','detail|circhist','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('todaysIssuesDefaultSortOrder',"desc",'Ordre d''affichage des pr?ts en cours (pr?ts du jour)',"asc|desc",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Si activ?, les adh?rents peuvent placer des r?servations sur un exemplaire sp?cifique. Sinon, il ne peuvent que r?server le prochain disponible.','','YesNo'); INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Slectionner categorycode ou category_type permet d''afficher la liste des cat?gories ou des types de cat?gories ? l''ajout d''un lecteur'); diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql index e49a22f..a4f14ff 100755 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -152,6 +152,7 @@ insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('patronimages','jpg','','Per impostare il formato immagine per le foto degli utenti','free'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('PatronsPerPage','20','20','Numero di utenti visualizzati di default per pagina','Integer'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('previousIssuesDefaultSortOrder','asc','asc|desc','Specifica l?ordine dei prestiti precedenti nella pagina di circolazione','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowingHistoryLink','circhist','When showing borrower history for an item on the catalogue page, link to borrower','detail|circhist','Choice'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('printcirculationslips','1','','Se ON, abilita la stampa delle ricevute del prestito','YesNo'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('QueryAutoTruncate','1','','Se ON, ? abilitato il troncamento delle query di default','YesNo'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('QueryFuzzy','0','','Se ON, abilita le opzioni di ricerca fuzzy','YesNo'); diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index 0a96d52..a5d1c08 100755 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -167,6 +167,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CircControl',"ItemHomeLibrary",'Specify the agency that controls the circulation and fines policy',"PickupLibrary|PatronLibrary|ItemHomeLibrary",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar',"noFinesWhenClosed",'Specify whether to use the Calendar in calculating duedates and fines',"ignoreCalendar|noFinesWhenClosed",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('previousIssuesDefaultSortOrder',"asc",'Specify the sort order of Previous Issues on the circulation page',"asc|desc",'Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowingHistoryLink','circhist','When showing borrower history for an item on the catalogue page, link to borrower','detail|circhist','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('todaysIssuesDefaultSortOrder',"desc",'Specify the sort order of Todays Issues on the circulation page',"asc|desc",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACBaseURL',NULL,'Specify the Base URL of the OPAC, e.g., opac.mylibrary.com, the http:// will be added automatically by Koha.',NULL,'Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('language','en','Set the default language in the staff client.',NULL,'Languages'); diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql index 72dfdf4..203ea7a 100755 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -195,6 +195,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CircControl',"ItemHomeLibrary",'Specify the agency that controls the circulation and fines policy',"PickupLibrary|PatronLibrary|ItemHomeLibrary",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar',"noFinesWhenClosed",'Specify whether to use the Calendar in calculating duedates and fines',"ignoreCalendar|noFinesWhenClosed",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('previousIssuesDefaultSortOrder',"asc",'Specify the sort order of Previous Issues on the circulation page',"asc|desc",'Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowingHistoryLink','circhist','When showing borrower history for an item on the catalogue page, link to borrower','detail|circhist','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('todaysIssuesDefaultSortOrder',"desc",'Specify the sort order of Todays Issues on the circulation page',"asc|desc",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACBaseURL',NULL,'Specify the Base URL of the OPAC, e.g., opac.mylibrary.com, the http:// will be added automatically by Koha.',NULL,'Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('language','ru-RU,uk-UA,en,fr-FR,de-DE','Set the default language in the staff client.',NULL,'Languages'); diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql index 78360a7..6fe9812 100755 --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -194,6 +194,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CircControl',"ItemHomeLibrary",'Specify the agency that controls the circulation and fines policy',"PickupLibrary|PatronLibrary|ItemHomeLibrary",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar',"noFinesWhenClosed",'Specify whether to use the Calendar in calculating duedates and fines',"ignoreCalendar|noFinesWhenClosed",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('previousIssuesDefaultSortOrder',"asc",'Specify the sort order of Previous Issues on the circulation page',"asc|desc",'Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowingHistoryLink','circhist','When showing borrower history for an item on the catalogue page, link to borrower','detail|circhist','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('todaysIssuesDefaultSortOrder',"desc",'Specify the sort order of Todays Issues on the circulation page',"asc|desc",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACBaseURL',NULL,'Specify the Base URL of the OPAC, e.g., opac.mylibrary.com, the http:// will be added automatically by Koha.',NULL,'Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('language','uk-UA,ru-RU,en,fr-FR,de-DE','Set the default language in the staff client.',NULL,'Languages'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 59e43bf..93e0876 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4415,6 +4415,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { print "Create an index on reserves to speed up holds awaiting pickup report bug 5866\n"; SetVersion($DBversion); } + +$DBversion = "xxx"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowingHistoryLink','circhist','When showing borrower history for an item on the catalogue page, link to borrower','detail|circhist','Choice')"); + print "Add the system preference 'BorrowingHistoryLink' (bug 6905)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index dc821a8..d2590fd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -24,6 +24,12 @@ Circulation: desc: latest to earliest - due date. - + - When showing borrower history for an item on the catalogue page, link to borrower + - pref: BorrowingHistoryLink + choices: + details: details + circhist: circulation history + - - "Sort today's checkouts on the circulation page from" - pref: todaysIssuesDefaultSortOrder type: choice diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index 86c8a3f..ae73330 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -169,9 +169,9 @@
  • Last seen: [% ITEM_DAT.datelastseen %] 
  • Last borrowed: [% ITEM_DAT.datelastborrowed %] 
  • - [% IF ( ITEM_DAT.card0 ) %]
  • Last Borrower: [% ITEM_DAT.card0 %] 
  • [% END %] - [% IF ( ITEM_DAT.card1 ) %]
  • Previous Borrower: [% ITEM_DAT.card1 %] 
  • [% END %] - [% IF ( ITEM_DAT.card2 ) %]
  • Previous Borrower: [% ITEM_DAT.card2 %] 
  • [% END %] + [% IF ( ITEM_DAT.card0 ) %]
  • Last Borrower: [% ITEM_DAT.card0 %] 
  • [% END %] + [% IF ( ITEM_DAT.card1 ) %]
  • Previous Borrower: [% ITEM_DAT.card1 %] 
  • [% END %] + [% IF ( ITEM_DAT.card2 ) %]
  • Previous Borrower: [% ITEM_DAT.card2 %] 
  • [% END %]
  • Paid for?: [% ITEM_DAT.paidfor %] 
  • Serial enumeration: [% ITEM_DAT.enumchron %] 
  • Public Note: -- 1.7.4.1 From mjr at phonecoop.coop Fri Sep 23 12:52:56 2011 From: mjr at phonecoop.coop (MJ Ray) Date: Fri, 23 Sep 2011 11:52:56 +0100 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6193 - Use memcached cache koha-conf.xml configuration variables In-Reply-To: <1316696491-9581-1-git-send-email-frinaudo@infocpt.com.ar> References: <1316696491-9581-1-git-send-email-frinaudo@infocpt.com.ar> Message-ID: <1316775176-28479-1-git-send-email-mjr@phonecoop.coop> From: Tomas Cohen Arazi Basically I add some code to Context.pm so it stores koha-conf.xml config vars in memcached server. It is arguable whether this is an improvement or not, tests are needed to conclude something about this. Error handling was an issue with Cache::Memcached, I tried to do it the simplest I could. Note: As it was pointless to read the xml file to get the memcached server info for accessing them for retreiving the info in the koha-conf.xml file... I passed those values through apache's SetEnv. These variables are set acordingly through the install scripts and commented out if koha was setup not to use it. Bug 6193 - Properly comment the code Required by slef. Regards To+ Signed-off-by: Federico Rinaudo Signed-off-by: MJ Ray --- C4/Context.pm | 43 +++++++++++++++++++++++++++++++++++++++---- etc/koha-httpd.conf | 4 ++++ 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index 85d1c18..eed9270 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -18,7 +18,7 @@ package C4::Context; use strict; use warnings; -use vars qw($VERSION $AUTOLOAD $context @context_stack); +use vars qw($VERSION $AUTOLOAD $context @context_stack $servers $memcached $ismemcached); BEGIN { if ($ENV{'HTTP_USER_AGENT'}) { @@ -78,6 +78,22 @@ BEGIN { $main::SIG{__DIE__} = \&CGI::Carp::confess; } } # else there is no browser to send fatals to! + + # Check if there are memcached servers set + $servers = $ENV{'MEMCACHED_SERVERS'}; + if ($servers) { + # Load required libraries and create the memcached object + require Cache::Memcached; + $memcached = Cache::Memcached->new({ + servers => [ $servers ], + debug => 0, + compress_threshold => 10_000, + namespace => $ENV{'MEMCACHED_NAMESPACE'} || 'koha' + }); + # Verify memcached available (set a variable and test the output) + $ismemcached = $memcached->set('ismemcached','1'); + } + $VERSION = '3.00.00.036'; } @@ -229,6 +245,11 @@ Returns undef in case of error. sub read_config_file { # Pass argument naming config file to read my $koha = XMLin(shift, keyattr => ['id'], forcearray => ['listen', 'server', 'serverinfo'], suppressempty => ''); + + if ($ismemcached) { + $memcached->set('kohaconf',$koha); + } + return $koha; # Return value: ref-to-hash holding the configuration } @@ -274,6 +295,10 @@ Allocates a new context. Initializes the context from the specified file, which defaults to either the file given by the C<$KOHA_CONF> environment variable, or F. +It saves the koha-conf.xml values in the declared memcached server(s) +if currently available and uses those values until them expire and +re-reads them. + C<&new> does not set this context as the new default context; for that, use C<&set_context>. @@ -308,10 +333,20 @@ sub new { return undef; } } - # Load the desired config file. - $self = read_config_file($conf_fname); - $self->{"config_file"} = $conf_fname; + if ($ismemcached) { + # retreive from memcached + $self = $memcached->get('kohaconf'); + if (not defined $self) { + # not in memcached yet + $self = read_config_file($conf_fname); + } + } else { + # non-memcached env, read from file + $self = read_config_file($conf_fname); + } + + $self->{"config_file"} = $conf_fname; warn "read_config_file($conf_fname) returned undef" if !defined($self->{"config"}); return undef if !defined($self->{"config"}); diff --git a/etc/koha-httpd.conf b/etc/koha-httpd.conf index bf8cdc7..2b986ac 100644 --- a/etc/koha-httpd.conf +++ b/etc/koha-httpd.conf @@ -17,6 +17,8 @@ # TransferLog __LOG_DIR__/koha-opac-access_log SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml" SetEnv PERL5LIB "__PERL_MODULE_DIR__" + SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__" + SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__" mod_gzip_on yes @@ -107,6 +109,8 @@ # TransferLog __LOG_DIR__/koha-access_log SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml" SetEnv PERL5LIB "__PERL_MODULE_DIR__" + SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__" + SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__" Options +FollowSymLinks ErrorDocument 400 /cgi-bin/koha/errors/400.pl -- 1.7.2.5 From Katrin.Fischer.83 at web.de Fri Sep 23 14:06:17 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Fri, 23 Sep 2011 14:06:17 +0200 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6460: alternative fix, updating template and script instead of C4::Log - a bit rushed Message-ID: <1316779577-2661-1-git-send-email-Katrin.Fischer.83@web.de> From: MJ Ray Add some test cases and fix a bug in C4::Log found by in review. Thanks-to: Katrin Fischer. Signed-off-by: Katrin Fischer Tested the inferface and ran the tests. No problems found. --- C4/Log.pm | 3 +- .../intranet-tmpl/prog/en/modules/tools/viewlog.tt | 85 +------------------ t/db_dependent/Log.t | 32 ++++++++ tools/viewlog.pl | 6 +- 4 files changed, 44 insertions(+), 82 deletions(-) create mode 100644 t/db_dependent/Log.t diff --git a/C4/Log.pm b/C4/Log.pm index 98cd8d5..6b8ff17 100644 --- a/C4/Log.pm +++ b/C4/Log.pm @@ -4,6 +4,7 @@ package C4::Log; # Copyright 2000-2002 Katipo Communications +# Copyright 2011 MJ Ray and software.coop # # This file is part of Koha. # @@ -217,7 +218,7 @@ sub GetLogs { $query .= " AND user = ? "; push(@parameters,$user); } - if(scalar @$modules > 1 or @$modules[0] ne "") { + if($modules && scalar(@$modules)) { $query .= " AND module IN (".join(",",map {"?"} @$modules).") "; push(@parameters,@$modules); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt index c109744..f20569d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -59,11 +59,11 @@
  • @@ -133,81 +133,6 @@ - [% IF ( do_it ) %] - [% IF ( total ) %] -

    [% total %] lines found.

    - - - - - - - - - - [% FOREACH loopro IN looprow %] - [% UNLESS ( loop.odd ) %][% ELSE %][% END %] - - - - - - - - [% END %] -
    DateLibrarianModuleActionObjectInfo
    [% loopro.timestamp %] - [% loopro.user %] - [% loopro.module %][% loopro.action %] - [% IF ( module == 'MEMBERS' ) %] - member [% loopro.object %] - [% ELSE %] - [% IF ( module == 'CIRCULATION' ) %] - - [% IF ( loopro.object ) %] - member [% loopro.object %] - [% END %] - - [% ELSE %] - [% IF ( module == 'CATALOGUING' ) %] - [% IF ( info == 'item' ) %] - Item [% loopro.object %] - [% ELSE %] - biblio [% loopro.object %] - [% END %] - [% ELSE %] - [% IF ( module == 'SERIAL' ) %] - [% loopro.object %] - [% ELSE %] - [% IF ( module == 'AUTHORITIES' ) %] - auth [% loopro.object %] - [% ELSE %] - [% loopro.object %] - [% END %] - [% END %] - [% END %] - [% END %] - [% END %] - - [% IF ( loopro.CIRCULATION ) %] - biblio [% loopro.info |html %] - [% ELSE %] - [% loopro.info |html %] - [% END %] -
    - [% ELSE %] -
    - No log found - [% IF ( CATALOGUING ) %] - for Bibliographic Record [% object %] - [% END %] - [% IF ( MEMBERS ) %] - for [% firstname %] [% surname %] ([% cardnumber %]) - [% END %] - . -
    - [% END %] - [% END %] - [% END %] [% IF ( do_it ) %] diff --git a/t/db_dependent/Log.t b/t/db_dependent/Log.t new file mode 100644 index 0000000..13910e2 --- /dev/null +++ b/t/db_dependent/Log.t @@ -0,0 +1,32 @@ +#!/usr/bin/perl +# +# Copyright 2011 MJ Ray and software.coop +# This Koha test module is a stub! +# Add more tests here!!! + +use strict; +use warnings; +use Test::More tests => 3; +use C4::Log; + +BEGIN { + use_ok('C4::Log'); +} +my $success; + +eval { + # FIXME: US formatted date hardcoded into test for now + $success = GetLogs("","","",undef,undef,"",""); +} or do { + diag($@); + $success = 0; +}; +ok($success, "GetLogs returns results for an open search"); +eval { + # FIXME: US formatted date hardcoded into test for now + $success = GetLogs("09/01/2011","10/01/2011","",undef,undef,"",""); +} or do { + diag($@); + $success = 0; +}; +ok($success, "GetLogs accepts dates in an All-matching search"); diff --git a/tools/viewlog.pl b/tools/viewlog.pl index d689217..5c43098 100755 --- a/tools/viewlog.pl +++ b/tools/viewlog.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl # Copyright 2010 BibLibre +# Copyright 2011 MJ Ray and software.coop # # This file is part of Koha. # @@ -105,7 +106,10 @@ $template->param( if ($do_it) { my @data; - my $results = GetLogs($datefrom,$dateto,$user,\@modules,\@action,$object,$info); + my ($results,$modules,$action); + if ($action[0] ne '') { $action = \@action; } # match All means no limit + if ($modules[0] ne '') { $modules = \@modules; } # match All means no limit + $results = GetLogs($datefrom,$dateto,$user,$modules,$action,$object,$info); @data=@$results; my $total = scalar @data; foreach my $result (@data){ -- 1.7.4.1 From oleonard at myacpl.org Fri Sep 23 15:38:26 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 23 Sep 2011 09:38:26 -0400 Subject: [Koha-patches] [PATCH] [REVISED] Fix for Bug 6674 - Collapse display of patron address by default Message-ID: <1316785106-24058-1-git-send-email-oleonard@myacpl.org> This patch takes the feature implemented in the original patch for Bug 5436 and reimplements it in a slightly more abstracted way. The JavaScript can now be applied to any pair of elements like this: a block with class "collapsed" followed by a link with class "togglecollapse." In the circ-menu include, both the address info block and the link to show/hide it have unique ids ("contact" and "showcontact" respectively) so that IntranetUserCSS can be used to force them to show: #contact { display : block; } #showcontact { display : none; } Revision adds compatibility for display of extended patron attributes and makes changes consistent across includes, including circ-menu.tt. --- .../intranet-tmpl/prog/en/css/staff-global.css | 33 +++++++++++++++++++- .../intranet-tmpl/prog/en/includes/circ-menu.inc | 21 ++++++++---- .../intranet-tmpl/prog/en/includes/circ-menu.tt | 17 ++++++--- koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 11 ++++++ .../intranet-tmpl/prog/img/more-right-arrow.gif | Bin 0 -> 81 bytes 5 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/img/more-right-arrow.gif diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 8b2b8f5..c53fa8a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -484,7 +484,7 @@ div.patroninfo ul { border-right : 1px solid #000; border-bottom : 0; border-top : 0; - padding : 0; + padding : .5em 0; margin : 0; } @@ -496,6 +496,19 @@ div.patroninfo ul li, div.patronviews ul li { list-style-type : none; } +#patronimage { + border-right : 1px solid #000; +} + +#patronimage img { + max-width : 140px; + margin: .3em 0 .3em .3em; + padding: .2em; + border: 1px solid #CCCCCC; + width:auto !important; + width:130px; +} + div.patronviews { border-right : 1px solid #000; border-top : 1px solid #000; @@ -1912,6 +1925,24 @@ ul.budget_hierarchy li:last-child:after { ul.budget_hierarchy li:first-child:after { content: ""; } +.collapse { + display : none; +} +.togglecollapse { + border-right : 1px solid #000; + font-size: 85%; + display: block; + padding: .2em .2em .2em 15px; + margin: 0; + cursor: pointer; +} +.toggleclosed { + background: #eee url(../../img/more-right-arrow.gif) 0 50% no-repeat; +} +.toggleopen { + background: #eee url(../../img/more-up-arrow.gif) 0 50% no-repeat; +} + .holdcount { font-size : 105%; line-height : 200%; } .holdcount a { border : 1px solid #a4bedd; background-color : #e4ecf5; font-weight : bold; -moz-border-radius: 4px; padding : .1em .4em; text-decoration : none; } .holdcount a:hover { background-color : #ebeff7; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc index a9fd453..8ef3409 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -1,17 +1,19 @@ + + [% IF ( borrowernumber ) %]
    [% firstname %] [% surname %] ([% cardnumber %])
    -
      [% IF ( patronimages ) %] [% IF ( picture ) %] -
    • [% firstname %] [% surname %] ([% cardnumber %])
    • +
      [% firstname %] [% surname %] ([% cardnumber %])
      [% ELSE %] -
    • [% firstname %] [% surname %] ([% cardnumber %])
    • +
      [% firstname %] [% surname %] ([% cardnumber %])
      [% END %] [% END %] +
      • [% IF ( address ) %] [% address %] [% ELSE %] @@ -22,7 +24,7 @@ [% END %]
      • [% IF ( city ) %] [% city %][% IF ( state ) %], [% state %][% END %] - [% zipcode %][% IF ( country ) %], [% country %][% END %] + [% zipcode %][% IF ( country ) %]
        [% country %][% END %] [% ELSE %] No city stored. [% END %]
      • @@ -48,6 +50,11 @@
      • No email stored.
      • [% END %] [% END %] +
      +Contact Information +
        +
      • Category: [% categoryname %] ([% categorycode %])
      • +
      • Home Library: [% IF ( branchname ) %][% branchname %][% ELSE %][% branch %][% END %]
      • [% FOREACH extendedattribute IN extendedattributes %] [% IF ( extendedattribute.display_checkout ) %] [% IF ( extendedattribute.value ) %] @@ -55,9 +62,9 @@ [% END %] [% END %] [% END %] -
      • Category: [% categoryname %] ([% categorycode %])
      • -
      • Home Library: [% IF ( branchname ) %][% branchname %][% ELSE %][% branch %][% END %]
      • -
    + +Library Information +
  • + +Library Information +
    -- 1.7.2.5 From lrea at nekls.org Tue Sep 27 22:12:25 2011 From: lrea at nekls.org (Liz Rea) Date: Tue, 27 Sep 2011 15:12:25 -0500 Subject: [Koha-patches] [PATCH] Bug 6871 - Have a link to the schema page on the reports page Message-ID: <1317154345-7696-1-git-send-email-lrea@nekls.org> From: Thatcher Rea Adds schema and reports library to reports-home.tt To Test: Verify that schema and report library links are visible on reports-home.pl Signed-off-by: Liz Rea Works as advertised, links are correct. --- .../prog/en/modules/reports/reports-home.tt | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt index 4a5f590..e8bb4d5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt @@ -54,6 +54,8 @@
  • Items lost
  • Catalog by itemtype
  • Average loan time
  • +
  • Koha Database Schema
  • +
  • Koha Reports Library
  • -- 1.7.2.5 From robin at catalyst.net.nz Wed Sep 28 08:10:24 2011 From: robin at catalyst.net.nz (Robin Sheat) Date: Wed, 28 Sep 2011 19:10:24 +1300 Subject: [Koha-patches] [PATCH] Bug 6929 - ensure that koha-stop-zebra will try to stop everything Message-ID: <1317190224-6610-1-git-send-email-robin@catalyst.net.nz> Currently, if it attempts to stop a zebra process that doesn't exist, the script will abort, which leaves things running. This patch prevents it from aborting. --- debian/scripts/koha-stop-zebra | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/debian/scripts/koha-stop-zebra b/debian/scripts/koha-stop-zebra index 3ddd697..7f3efcc 100755 --- a/debian/scripts/koha-stop-zebra +++ b/debian/scripts/koha-stop-zebra @@ -33,5 +33,5 @@ do --stop \ -- \ zebrasrv \ - -f "/etc/koha/sites/$name/koha-conf.xml" + -f "/etc/koha/sites/$name/koha-conf.xml" || true done -- 1.7.4.1 From oleonard at myacpl.org Wed Sep 28 16:00:30 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Wed, 28 Sep 2011 10:00:30 -0400 Subject: [Koha-patches] [PATCH] Fix for Bug 4223 - Too much serials info - design work needed Message-ID: <1317218430-8453-1-git-send-email-oleonard@myacpl.org> This patch reimplements the changes suggested in the original patch. It puts each main section of the display into its own tab. --- .../prog/en/modules/serials/subscription-detail.tt | 152 +++++++++++--------- 1 files changed, 84 insertions(+), 68 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index bba6a2e..f3ab9a2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -1,9 +1,8 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Serials › Details for Subscription #[% subscriptionid %] [% INCLUDE 'doc-head-close.inc' %] - @@ -75,34 +76,54 @@ function popup(subscriptionid) {
    [% END %] - -
    -

    Subscription information

    -
      +
      + + +
      +
      +
      +
      +
      1. Subscription ID: [% subscriptionid %]
      2. Librarian identity: [% librarian %]
      3. -
      4. Vendor: [% aqbooksellername %] 
      5. -
      6. Biblio: ([% bibnum %]) [% bibliotitle %]
      7. -[% IF ( branchcode ) %]
      8. Library: [% branchcode %] 
      9. [% END %] +
      10. Vendor: [% aqbooksellername %]
      11. +
      12. Biblio: [% bibliotitle %] ([% bibnum %])
      13. +[% IF ( branchcode ) %]
      14. Library: [% branchcode %]
      15. [% END %] [% IF ( serialsadditems ) %] -
      16. Serial receipt creates an item record.
      17. +
      18. Items: Serial receipt creates an item record.
      19. [% ELSE %] -
      20. Serial receipt does not create an item record.
      21. +
      22. Items: Serial receipt does not create an item record.
      23. [% END %] -
      24. Grace period: [% graceperiod %] 
      25. - [% IF ( location ) %]
      26. Location: [% location %] 
      27. [% END %] - [% IF ( callnumber ) %]
      28. Call Number: [% callnumber %] 
      29. [% END %] - [% IF ( staffdisplaycount ) %]
      30. Number of issues to display to staff: [% staffdisplaycount %] 
      31. [% END %] - [% IF ( opacdisplaycount ) %]
      32. Number of issues to display to the public: [% opacdisplaycount %] 
      33. [% END %] - [% IF ( letter ) %]
      34. Patron alert with: [% letter %] 
      35. [% END %] - [% IF ( hasRouting ) %]
      36. Routing: yes
      37. [% END %] -
    +
  • Grace period: [% graceperiod %]
  • + +
    +
    +
    +
      + [% IF ( location ) %]
    1. Location: [% location %]
    2. [% END %] + [% IF ( callnumber ) %]
    3. Call Number: [% callnumber %]
    4. [% END %] + [% IF ( staffdisplaycount ) %]
    5. Number of issues to display to staff:[% staffdisplaycount %]
    6. [% END %] + [% IF ( opacdisplaycount ) %]
    7. Number of issues to display to the public:[% opacdisplaycount %]
    8. [% END %] + [% IF ( letter ) %]
    9. Patron alert with: [% letter %]
    10. [% END %] + [% IF ( hasRouting ) %]
    11. Routing: yes
    12. [% END %] +
    +
    +
    +
    +
    -

    Planning

    -

    [% startdate %] -

    -

    +

    +
    +
      +
    1. Beginning date: [% startdate %] +
    2. +
    3. Frequency (*): [% IF ( periodicity16 ) %] Without regularity [% END %] @@ -151,14 +172,16 @@ function popup(subscriptionid) { [% IF ( periodicity11 ) %] 1/2 years [% END %] - Manual history : +
    4. +
    5. + Manual history: [% IF ( manualhistory ) %] - + Disabled [% ELSE %] - + Enabled [% END %] -

      -

      +

    6. +
    7. Number pattern: [% IF ( numberpattern1 ) %] Number only [% END %] @@ -183,9 +206,9 @@ function popup(subscriptionid) { [% IF ( numberpattern7 ) %] None of the above [% END %] -

      - - + +
    8. Starting with:

      + [% IF ( lastvalue2 ) %] [% END %] - + [% IF ( whenmorethan2 ) %] [% END %] -
      Starting with: [% lastvalue1 %]  @@ -198,7 +221,7 @@ function popup(subscriptionid) {

      Rollover:

      Rollover: [% whenmorethan1 %]  @@ -211,16 +234,19 @@ function popup(subscriptionid) {
      +
    9. [% IF ( irregular_issues ) %] -

      [% irregular_issues %] issues -

      +
    10. Irregularity: [% irregular_issues %] issues +
    11. [% END %] -

      [% firstacquidate %] -

      - [% IF ( numberlength ) %]

      [% numberlength %]

      [% END %] - [% IF ( weeklength ) %]

      [% weeklength %]

      [% END %] - [% IF ( monthlength ) %]

      [% monthlength %]

      [% END %] +
    12. First arrival: [% firstacquidate %] +
    13. + [% IF ( numberlength ) %]
    14. Number of issues: [% numberlength %]
    15. [% END %] + [% IF ( weeklength ) %]
    16. Number of weeks: [% weeklength %]
    17. [% END %] + [% IF ( monthlength ) %]
    18. Number of months: [% monthlength %]
    19. [% END %] +
    +
    +
    -

    Serial issues

    @@ -331,31 +356,22 @@ function popup(subscriptionid) {
    Issue number
    -

    Subscription summary

    - - - - - - - - - - - - - - - - - - - - - -
    [% startdate %]
    [% enddate %]
    [% histstartdate %]
    [% histenddate %]
    [% recievedlist %]
    [% missinglist %]
    [% internalnotes %]
    [% notes %]
    +
    +
    +
      +
    1. Start date: [% startdate %]
    2. +
    3. End date: [% enddate %]
    4. +
    5. History start date: [% histstartdate %]
    6. +
    7. History end date: [% histenddate %]
    8. +
    9. Received issues:[% recievedlist %]
    10. +
    11. Missing issues:[% missinglist %]
    12. +
    13. Nonpublic note:[% internalnotes %]
    14. +
    15. Public note:[% notes %]
    16. +
    +
    +
    +
    - -- 1.7.3 From lrea at nekls.org Wed Sep 28 16:07:01 2011 From: lrea at nekls.org (Liz Rea) Date: Wed, 28 Sep 2011 09:07:01 -0500 Subject: [Koha-patches] [PATCH] Bug 6323 -- Error handling cleanup for moveitem.tt Message-ID: <1317218821-27412-1-git-send-email-lrea@nekls.org> Added button to retry attaching item, added default bib view handling, cosmetic changes to the error display (buttons now in error div). --- .../prog/en/modules/cataloguing/moveitem.tt | 112 +++++++++++++++----- 1 files changed, 83 insertions(+), 29 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt index 553d130..738aafa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt @@ -5,38 +5,92 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] - +
    [% IF ( error ) %]
    - [% IF ( errornonewitem ) %]ERROR: Unable to create the new item.[% END %] - [% IF ( errornoitem ) %]ERROR: Unable to get the item.[% END %] - [% IF ( errornoitemnumber ) %]ERROR: Unable to get the item number from this barcode.[% END %] -
    -
    - - -
    -[% ELSE %] - [% IF ( success ) %] -
    The item has successfully been attached to [% INCLUDE 'biblio-default-view.inc' %][% bibliotitle |html %].[% IF ( BiblioDefaultViewmarc ) %] -
    -[% ELSIF ( BiblioDefaultViewlabeled_marc ) %] - -[% ELSIF ( BiblioDefaultViewisbd ) %] - -[% ELSE %] - -[% END %] - - -
    -
    - - -
    -
    + + [% IF ( errornonewitem ) %]ERROR: Unable to create the new item.

    + + [% IF ( BiblioDefaultViewmarc ) %] +

    + [% ELSIF ( BiblioDefaultViewlabeled_marc ) %] + + [% ELSIF ( BiblioDefaultViewisbd ) %] + + [% ELSE %] + + [% END %] + + +
    +
    + + +
    +
    + [% END %] + + [% IF ( errornoitem ) %]ERROR: Unable to get the item.

    + + [% IF ( BiblioDefaultViewmarc ) %] +

    + [% ELSIF ( BiblioDefaultViewlabeled_marc ) %] + + [% ELSIF ( BiblioDefaultViewisbd ) %] + + [% ELSE %] + + [% END %] + + +
    +
    + + +
    + + [% END %] + + [% IF ( errornoitemnumber ) %]ERROR: Unable to get the item number from this barcode.

    + + [% IF ( BiblioDefaultViewmarc ) %] +

    + [% ELSIF ( BiblioDefaultViewlabeled_marc ) %] + + [% ELSIF ( BiblioDefaultViewisbd ) %] + + [% ELSE %] + + [% END %] + + +
    +
    + + +
    + + [% END %] + + [% ELSE %] + [% IF ( success ) %] +
    The item has successfully been attached to [% INCLUDE 'biblio-default-view.inc' %][% bibliotitle |html %]. + [% IF ( BiblioDefaultViewmarc ) %] +
    + [% ELSIF ( BiblioDefaultViewlabeled_marc ) %] + + [% ELSIF ( BiblioDefaultViewisbd ) %] + + [% ELSE %] + + [% END %] + + +
    +
    + [% ELSE %] [% IF ( missingparameter ) %] @@ -44,7 +98,7 @@ [% IF ( missingbiblionumber ) %]
    -
    Enter biblionumber:
    +
    Enter biblionumber:
    -- 1.7.2.5 From nengard at bywatersolutions.com Tue Sep 27 19:35:57 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Tue, 27 Sep 2011 13:35:57 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 4223 - Too much serials info - design work needed Message-ID: <1317144957-5959-1-git-send-email-nengard@bywatersolutions.com> From: Owen Leonard This patch reimplements the changes suggested in the original patch. It puts each main section of the display into its own tab. Signed-off-by: Nicole C. Engard --- .../prog/en/modules/serials/subscription-detail.tt | 152 +++++++++++--------- 1 files changed, 84 insertions(+), 68 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index bba6a2e..f3ab9a2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -1,9 +1,8 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Serials › Details for Subscription #[% subscriptionid %] [% INCLUDE 'doc-head-close.inc' %] - @@ -75,34 +76,54 @@ function popup(subscriptionid) { [% END %] - -
    -

    Subscription information

    -
      +
      + + +
      +
      +
      +
      +
      1. Subscription ID: [% subscriptionid %]
      2. Librarian identity: [% librarian %]
      3. -
      4. Vendor: [% aqbooksellername %] 
      5. -
      6. Biblio: ([% bibnum %]) [% bibliotitle %]
      7. -[% IF ( branchcode ) %]
      8. Library: [% branchcode %] 
      9. [% END %] +
      10. Vendor: [% aqbooksellername %]
      11. +
      12. Biblio: [% bibliotitle %] ([% bibnum %])
      13. +[% IF ( branchcode ) %]
      14. Library: [% branchcode %]
      15. [% END %] [% IF ( serialsadditems ) %] -
      16. Serial receipt creates an item record.
      17. +
      18. Items: Serial receipt creates an item record.
      19. [% ELSE %] -
      20. Serial receipt does not create an item record.
      21. +
      22. Items: Serial receipt does not create an item record.
      23. [% END %] -
      24. Grace period: [% graceperiod %] 
      25. - [% IF ( location ) %]
      26. Location: [% location %] 
      27. [% END %] - [% IF ( callnumber ) %]
      28. Call Number: [% callnumber %] 
      29. [% END %] - [% IF ( staffdisplaycount ) %]
      30. Number of issues to display to staff: [% staffdisplaycount %] 
      31. [% END %] - [% IF ( opacdisplaycount ) %]
      32. Number of issues to display to the public: [% opacdisplaycount %] 
      33. [% END %] - [% IF ( letter ) %]
      34. Patron alert with: [% letter %] 
      35. [% END %] - [% IF ( hasRouting ) %]
      36. Routing: yes
      37. [% END %] -
    +
  • Grace period: [% graceperiod %]
  • + +
    +
    +
    +
      + [% IF ( location ) %]
    1. Location: [% location %]
    2. [% END %] + [% IF ( callnumber ) %]
    3. Call Number: [% callnumber %]
    4. [% END %] + [% IF ( staffdisplaycount ) %]
    5. Number of issues to display to staff:[% staffdisplaycount %]
    6. [% END %] + [% IF ( opacdisplaycount ) %]
    7. Number of issues to display to the public:[% opacdisplaycount %]
    8. [% END %] + [% IF ( letter ) %]
    9. Patron alert with: [% letter %]
    10. [% END %] + [% IF ( hasRouting ) %]
    11. Routing: yes
    12. [% END %] +
    +
    +
    + +
    -

    Planning

    -

    [% startdate %] -

    -

    +

    +
    +
      +
    1. Beginning date: [% startdate %] +
    2. +
    3. Frequency (*): [% IF ( periodicity16 ) %] Without regularity [% END %] @@ -151,14 +172,16 @@ function popup(subscriptionid) { [% IF ( periodicity11 ) %] 1/2 years [% END %] - Manual history : +
    4. +
    5. + Manual history: [% IF ( manualhistory ) %] - + Disabled [% ELSE %] - + Enabled [% END %] -

      -

      +

    6. +
    7. Number pattern: [% IF ( numberpattern1 ) %] Number only [% END %] @@ -183,9 +206,9 @@ function popup(subscriptionid) { [% IF ( numberpattern7 ) %] None of the above [% END %] -

      - - + +
    8. Starting with:

      + [% IF ( lastvalue2 ) %] [% END %] - + [% IF ( whenmorethan2 ) %] [% END %] -
      Starting with: [% lastvalue1 %]  @@ -198,7 +221,7 @@ function popup(subscriptionid) {

      Rollover:

      Rollover: [% whenmorethan1 %]  @@ -211,16 +234,19 @@ function popup(subscriptionid) {
      +
    9. [% IF ( irregular_issues ) %] -

      [% irregular_issues %] issues -

      +
    10. Irregularity: [% irregular_issues %] issues +
    11. [% END %] -

      [% firstacquidate %] -

      - [% IF ( numberlength ) %]

      [% numberlength %]

      [% END %] - [% IF ( weeklength ) %]

      [% weeklength %]

      [% END %] - [% IF ( monthlength ) %]

      [% monthlength %]

      [% END %] +
    12. First arrival: [% firstacquidate %] +
    13. + [% IF ( numberlength ) %]
    14. Number of issues: [% numberlength %]
    15. [% END %] + [% IF ( weeklength ) %]
    16. Number of weeks: [% weeklength %]
    17. [% END %] + [% IF ( monthlength ) %]
    18. Number of months: [% monthlength %]
    19. [% END %] +
    +
    +
    -

    Serial issues

    @@ -331,31 +356,22 @@ function popup(subscriptionid) {
    Issue number
    -

    Subscription summary

    - - - - - - - - - - - - - - - - - - - - - -
    [% startdate %]
    [% enddate %]
    [% histstartdate %]
    [% histenddate %]
    [% recievedlist %]
    [% missinglist %]
    [% internalnotes %]
    [% notes %]
    +
    +
    +
      +
    1. Start date: [% startdate %]
    2. +
    3. End date: [% enddate %]
    4. +
    5. History start date: [% histstartdate %]
    6. +
    7. History end date: [% histenddate %]
    8. +
    9. Received issues:[% recievedlist %]
    10. +
    11. Missing issues:[% missinglist %]
    12. +
    13. Nonpublic note:[% internalnotes %]
    14. +
    15. Public note:[% notes %]
    16. +
    +
    +
    +
    - -- 1.7.2.3 From nengard at bywatersolutions.com Tue Sep 27 19:50:08 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Tue, 27 Sep 2011 13:50:08 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 6674 - Collapse display of patron address by default Message-ID: <1317145808-6107-1-git-send-email-nengard@bywatersolutions.com> From: Owen Leonard This patch takes the feature implemented in the original patch for Bug 5436 and reimplements it in a slightly more abstracted way. The JavaScript can now be applied to any pair of elements like this: a block with class "collapsed" followed by a link with class "togglecollapse." In the circ-menu include, both the address info block and the link to show/hide it have unique ids ("contact" and "showcontact" respectively) so that IntranetUserCSS can be used to force them to show: #contact { display : block; } #showcontact { display : none; } Revision adds compatibility for display of extended patron attributes and makes changes consistent across includes, including circ-menu.tt. Signed-off-by: Nicole C. Engard --- .../intranet-tmpl/prog/en/css/staff-global.css | 33 +++++++++++++++++++- .../intranet-tmpl/prog/en/includes/circ-menu.inc | 21 ++++++++---- .../intranet-tmpl/prog/en/includes/circ-menu.tt | 17 ++++++--- koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 11 ++++++ .../intranet-tmpl/prog/img/more-right-arrow.gif | Bin 0 -> 81 bytes 5 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/img/more-right-arrow.gif diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index c52c252..64aead2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -484,7 +484,7 @@ div.patroninfo ul { border-right : 1px solid #000; border-bottom : 0; border-top : 0; - padding : 0; + padding : .5em 0; margin : 0; } @@ -496,6 +496,19 @@ div.patroninfo ul li, div.patronviews ul li { list-style-type : none; } +#patronimage { + border-right : 1px solid #000; +} + +#patronimage img { + max-width : 140px; + margin: .3em 0 .3em .3em; + padding: .2em; + border: 1px solid #CCCCCC; + width:auto !important; + width:130px; +} + div.patronviews { border-right : 1px solid #000; border-top : 1px solid #000; @@ -1912,6 +1925,24 @@ ul.budget_hierarchy li:last-child:after { ul.budget_hierarchy li:first-child:after { content: ""; } +.collapse { + display : none; +} +.togglecollapse { + border-right : 1px solid #000; + font-size: 85%; + display: block; + padding: .2em .2em .2em 15px; + margin: 0; + cursor: pointer; +} +.toggleclosed { + background: #eee url(../../img/more-right-arrow.gif) 0 50% no-repeat; +} +.toggleopen { + background: #eee url(../../img/more-up-arrow.gif) 0 50% no-repeat; +} + .holdcount { font-size : 105%; line-height : 200%; } .holdcount a { border : 1px solid #a4bedd; background-color : #e4ecf5; font-weight : bold; -moz-border-radius: 4px; padding : .1em .4em; text-decoration : none; } .holdcount a:hover { background-color : #ebeff7; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc index a9fd453..8ef3409 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -1,17 +1,19 @@ + + [% IF ( borrowernumber ) %]
    [% firstname %] [% surname %] ([% cardnumber %])
    -
      [% IF ( patronimages ) %] [% IF ( picture ) %] -
    • [% firstname %] [% surname %] ([% cardnumber %])
    • +
      [% firstname %] [% surname %] ([% cardnumber %])
      [% ELSE %] -
    • [% firstname %] [% surname %] ([% cardnumber %])
    • +
      [% firstname %] [% surname %] ([% cardnumber %])
      [% END %] [% END %] +
      • [% IF ( address ) %] [% address %] [% ELSE %] @@ -22,7 +24,7 @@ [% END %]
      • [% IF ( city ) %] [% city %][% IF ( state ) %], [% state %][% END %] - [% zipcode %][% IF ( country ) %], [% country %][% END %] + [% zipcode %][% IF ( country ) %]
        [% country %][% END %] [% ELSE %] No city stored. [% END %]
      • @@ -48,6 +50,11 @@
      • No email stored.
      • [% END %] [% END %] +
      +Contact Information +
        +
      • Category: [% categoryname %] ([% categorycode %])
      • +
      • Home Library: [% IF ( branchname ) %][% branchname %][% ELSE %][% branch %][% END %]
      • [% FOREACH extendedattribute IN extendedattributes %] [% IF ( extendedattribute.display_checkout ) %] [% IF ( extendedattribute.value ) %] @@ -55,9 +62,9 @@ [% END %] [% END %] [% END %] -
      • Category: [% categoryname %] ([% categorycode %])
      • -
      • Home Library: [% IF ( branchname ) %][% branchname %][% ELSE %][% branch %][% END %]
      • -
    + +Library Information + + +Library Information + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index bba6a2e..097c25e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -353,6 +353,8 @@ function popup(subscriptionid) { [% missinglist %] [% internalnotes %] [% notes %] + [% librariannote %] + [% opacnote %] -- 1.7.4.1 From colin.campbell at ptfs-europe.com Thu Sep 29 12:39:19 2011 From: colin.campbell at ptfs-europe.com (Colin Campbell) Date: Thu, 29 Sep 2011 11:39:19 +0100 Subject: [Koha-patches] [Signed Off] Bug 6938 - replace two subscription fields that were incorrectly removed Message-ID: <1317292759-10275-1-git-send-email-colin.campbell@ptfs-europe.com> From: Robin Sheat The "Note for OPAC" and "Note for staff" fields in subscriptions were removed, but they are their own fields in the database and display in other places too. This patch puts them back so that they can once again be edited. Signed-off-by: Colin Campbell --- .../prog/en/modules/serials/subscription-add.tt | 41 +++++++++++-------- .../prog/en/modules/serials/subscription-detail.tt | 2 + 2 files changed, 26 insertions(+), 17 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 f21e72d..40e1ebe 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 @@ -1077,25 +1077,32 @@ $(document).ready(function() {

    Subscription history

    [cancel manual history]

    Hint: you can update the serial history manually. This can be useful for an old subscription or to clean the existing history. Modify these fields with care, as future serial receive will continue to update them automatically.

    -
      -
    1. - -
      (start date of the 1st subscription)
      -
    2. -
    3. - -
      (if empty, subscription is still active)
      -
    4. -
    5. +
        +
      1. + +
        (start date of the 1st subscription)
        +
      2. +
      3. + +
        (if empty, subscription is still active)
        +
      4. +
      5. - -
      6. -
      7. + +
      8. +
      9. - -
      10. -
      11. -
      + +
    6. +
    7. + + +
    8. +
    9. + + +
    10. +
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index bba6a2e..097c25e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -353,6 +353,8 @@ function popup(subscriptionid) { [% missinglist %] [% internalnotes %] [% notes %] + [% librariannote %] + [% opacnote %] -- 1.7.6.2 From nengard at bywatersolutions.com Wed Sep 28 01:38:20 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Tue, 27 Sep 2011 19:38:20 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6937 - change "Fines" to "Fees & Charges" on circ page Message-ID: <1317166700-7240-1-git-send-email-nengard@bywatersolutions.com> From: Robin Sheat Signed-off-by: Nicole C. Engard http://bugs.koha-community.org/show_bug.cgi?id=6674 --- .../prog/en/modules/circ/circulation.tt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 4f56504..ff1b015 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -571,7 +571,7 @@ No patron matched [% message %] [% IF ( charges ) %]
  • - Fines: Patron has Outstanding fines[% IF ( chargesamount ) %] of [% chargesamount %][% END %]. + Fees & Charges: Patron has Outstanding fees & charges[% IF ( chargesamount ) %] of [% chargesamount %][% END %]. [% IF ( charges_is_blocker ) %] Checkouts are BLOCKED because fine balance is OVER THE LIMIT. [% END %] -- 1.7.2.3 From nengard at bywatersolutions.com Wed Sep 28 04:55:27 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Tue, 27 Sep 2011 22:55:27 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6633: SCO return button doesn't work Message-ID: <1317178527-8241-1-git-send-email-nengard@bywatersolutions.com> From: Ian Walls A template toolkit scope issue was preventing the Renew button from working properly, as well as displaying the fines column even if no fines column header was displaying. This patch adjusts the scope of several T:T variables on the sco-main template to fix this Signed-off-by: Ian Walls Signed-off-by: Nicole C. Engard --- .../opac-tmpl/prog/en/modules/sco/sco-main.tt | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt index 67b5ba8..fb9e0be 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt @@ -203,14 +203,14 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a [% FOREACH ISSUE IN ISSUES %] [% UNLESS ( loop.odd ) %][% ELSE %][% END %] - [% IF ( ISSUE.amazonimages ) %] [% IF ( ISSUE.isbn ) %]Book Cover Image[% END %] [% END %][% UNLESS ( ISSUE.noitemlinks ) %][% ISSUE.title |html %][% ELSE %][% ISSUE.title |html %][% END %] + [% UNLESS ( ISSUE.noitemlinks ) %][% ISSUE.title |html %][% ELSE %][% ISSUE.title |html %][% END %] [% ISSUE.author %] ([% ISSUE.barcode %]) [% ISSUE.itemcallnumber %] [% IF ( ISSUE.overdue ) %][% ISSUE.date_due_display %][% ELSE %][% ISSUE.date_due_display %][% END %]
    - + [% IF ( ISSUE.norenew ) %] @@ -225,7 +225,7 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a [% END %]
    - [% UNLESS ( ISSUE.nofines ) %][% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %][% END %] + [% UNLESS ( nofines ) %][% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %][% END %] [% END %] -- 1.7.2.3 From lrea at nekls.org Thu Sep 29 18:28:00 2011 From: lrea at nekls.org (Liz Rea) Date: Thu, 29 Sep 2011 11:28:00 -0500 Subject: [Koha-patches] [PATCH] Bug 6940 - Add reports library and schema to reports online help Message-ID: <1317313680-24072-1-git-send-email-lrea@nekls.org> - Adds link to full online manual reports section to reports-home.pl online (in app) help. - Adds link to full online manual for custom reports to guided_reports.pl online (in app) help. - Adds links to schema and sql report library wiki page to guided_reports.pl online (in app) help. All links are located at the bottom of the help file/page/window thinger. To test: Verify that the links appear in the onlin help for reports-home.pl and guided_reports.pl --- .../prog/en/modules/help/reports/guided_reports.tt | 12 ++++++++++++ .../prog/en/modules/help/reports/reports-home.tt | 3 +++ 2 files changed, 15 insertions(+), 0 deletions(-) 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 240a05a..7c370a2 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 @@ -65,4 +65,16 @@

    Sample :

    • SELECT surname,firstname FROM borrowers WHERE branchcode=<<Enter patrons library|branches>> AND surname like <<Enter filter for patron surname (% if none)>>
    +

    +

    +

    Useful Links

    + + +

    +See the full documentation for custom reports in the manual (online). + + [% INCLUDE 'help-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/reports-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/reports-home.tt index 7ebc985..ddd7a6c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/reports-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/reports-home.tt @@ -12,3 +12,6 @@

    Guided Reports Wizard

    The Guided Reports Wizard helps you build reports using all the fields in the database for each module. The reports can then be saved and run using the scheduler.

    [% INCLUDE 'help-bottom.inc' %] + +

    +See the full documentation for Reports in the manual (online). -- 1.7.2.5 From nengard at bywatersolutions.com Wed Sep 28 05:30:21 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Tue, 27 Sep 2011 23:30:21 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6940 - Add reports library and schema to reports online help Message-ID: <1317180621-8472-1-git-send-email-nengard@bywatersolutions.com> From: Liz Rea - Adds link to full online manual reports section to reports-home.pl online (in app) help. - Adds link to full online manual for custom reports to guided_reports.pl online (in app) help. - Adds links to schema and sql report library wiki page to guided_reports.pl online (in app) help. All links are located at the bottom of the help file/page/window thinger. To test: Verify that the links appear in the onlin help for reports-home.pl and guided_reports.pl Signed-off-by: Nicole C. Engard --- .../prog/en/modules/help/reports/guided_reports.tt | 12 ++++++++++++ .../prog/en/modules/help/reports/reports-home.tt | 3 +++ 2 files changed, 15 insertions(+), 0 deletions(-) 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 240a05a..7c370a2 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 @@ -65,4 +65,16 @@

    Sample :

    • SELECT surname,firstname FROM borrowers WHERE branchcode=<<Enter patrons library|branches>> AND surname like <<Enter filter for patron surname (% if none)>>
    +

    +

    +

    Useful Links

    + + +

    +See the full documentation for custom reports in the manual (online). + + [% INCLUDE 'help-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/reports-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/reports-home.tt index 7ebc985..ddd7a6c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/reports-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/reports-home.tt @@ -12,3 +12,6 @@

    Guided Reports Wizard

    The Guided Reports Wizard helps you build reports using all the fields in the database for each module. The reports can then be saved and run using the scheduler.

    [% INCLUDE 'help-bottom.inc' %] + +

    +See the full documentation for Reports in the manual (online). -- 1.7.2.3 From nengard at bywatersolutions.com Wed Sep 28 09:08:55 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 28 Sep 2011 03:08:55 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6942 - Add link to manual to help/admin/admin-home.tt Message-ID: <1317193735-9251-1-git-send-email-nengard@bywatersolutions.com> From: Liz Rea To test: Verify link to manual shows on administration home page in-app help. Signed-off-by: Nicole C. Engard --- .../prog/en/modules/help/admin/admin-home.tt | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/admin-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/admin-home.tt index fd8e2bd..b256280 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/admin-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/admin-home.tt @@ -29,5 +29,7 @@

    Additional Parameters

    This list of parameters includes functionality that didn't fit in any other category. These items are optional and may not need to be altered depending on how your library is using Koha.

    +

    +

    See the full documentation for system Administration in the manual (online).

    -[% INCLUDE 'help-bottom.inc' %] \ No newline at end of file +[% INCLUDE 'help-bottom.inc' %] -- 1.7.2.3 From nengard at bywatersolutions.com Wed Sep 28 09:09:11 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 28 Sep 2011 03:09:11 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6942 - Add link to manual to help/acqui-home.tmpl Message-ID: <1317193751-9287-1-git-send-email-nengard@bywatersolutions.com> From: Liz Rea To test: Verify link to manual shows on acquisitions home page in-app help. Signed-off-by: Nicole C. Engard --- .../prog/en/modules/help/acqui/acqui-home.tt | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/acqui-home.tt index 0b3e484..5ad1ab6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/acqui-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/acqui-home.tt @@ -10,4 +10,6 @@

    First, set your Acquisitions System Preferences and Acquisitions Administration to match your library's workflow.

    -[% INCLUDE 'help-bottom.inc' %] \ No newline at end of file +

    +

    See the full documentation for Acquisitions in the manual (online). +[% INCLUDE 'help-bottom.inc' %] -- 1.7.2.3 From nengard at bywatersolutions.com Wed Sep 28 09:10:43 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 28 Sep 2011 03:10:43 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6942 - Add link to manual to help/authorities/authorities-home.tt Message-ID: <1317193843-9410-1-git-send-email-nengard@bywatersolutions.com> From: Liz Rea To test: Verify link to manual shows on authorities home page in-app help. Signed-off-by: Nicole C. Engard --- .../modules/help/authorities/authorities-home.tt | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/authorities/authorities-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/authorities/authorities-home.tt index 0b081f5..fcb8b9c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/authorities/authorities-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/authorities/authorities-home.tt @@ -12,4 +12,7 @@

    Clicking on the authority record summary will open the full record and the option to edit the record.

    +

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

    + + [% INCLUDE 'help-bottom.inc' %] -- 1.7.2.3 From nengard at bywatersolutions.com Wed Sep 28 09:17:37 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 28 Sep 2011 03:17:37 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Add a link to show a MARC preview in the normal view of the detail Message-ID: <1317194257-9569-1-git-send-email-nengard@bywatersolutions.com> From: Maxime Pelletier http://bugs.koha-community.org/show_bug.cgi?id=6945 Signed-off-by: Nicole C. Engard --- .../prog/en/modules/catalogue/detail.tt | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 8903ce1..b1aea09 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1,4 +1,5 @@ [% INCLUDE 'doc-head-open.inc' %] +[% INCLUDE 'greybox.inc' %] Koha › Catalog › [% IF ( unknownbiblionumber ) %] Unknown record @@ -156,6 +157,10 @@ function verify_images() { <a href="http://[% OpacUrl %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]" target="_blank">Open in new window</a> </li> [% END %] + <li> + <strong>MARC Preview:</strong> + <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Show</a> + </li> </ul> </div> -- 1.7.2.3 From oleonard at myacpl.org Fri Sep 30 14:43:55 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 30 Sep 2011 08:43:55 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5981 : (MT 4231) Adds limits to search history Message-ID: <1317386635-16151-1-git-send-email-oleonard@myacpl.org> From: Paul Poulain <paul.poulain at biblibre.com> before this patch, if you do an advanced search, with limits like branch/itemtype, it was not saved correctly in the search history, so if you re-do a search from there you won't get the same results Signed-off-by: Owen Leonard <oleonard at myacpl.org> --- C4/Auth.pm | 7 +-- C4/Search.pm | 17 +++++--- installer/data/mysql/kohastructure.sql | 4 +- installer/data/mysql/updatedatabase.pl | 16 +++++++ .../prog/en/modules/opac-search-history.tt | 5 +- opac/opac-search-history.pl | 44 ++++++++++---------- opac/opac-search.pl | 12 ++++- 7 files changed, 68 insertions(+), 37 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 7211769..bab94cd 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -130,8 +130,8 @@ Output.pm module. =cut my $SEARCH_HISTORY_INSERT_SQL =<<EOQ; -INSERT INTO search_history(userid, sessionid, query_desc, query_cgi, total, time ) -VALUES ( ?, ?, ?, ?, ?, FROM_UNIXTIME(?)) +INSERT INTO search_history(userid, sessionid, query_desc, query_cgi, limit_desc, limit_cgi, total, time ) +VALUES ( ?, ?, ?, ?, ?, ?, ?, FROM_UNIXTIME(?)) EOQ sub get_template_and_user { my $in = shift; @@ -383,8 +383,7 @@ sub get_template_and_user { StaffSerialIssueDisplayCount => C4::Context->preference("StaffSerialIssueDisplayCount"), NoZebra => C4::Context->preference('NoZebra'), ); - } - else { + } else { warn "template type should be OPAC, here it is=[" . $in->{'type'} . "]" unless ( $in->{'type'} eq 'opac' ); #TODO : replace LibraryName syspref with 'system name', and remove this html processing my $LibraryNameTitle = C4::Context->preference("LibraryName"); diff --git a/C4/Search.pm b/C4/Search.pm index c3cff65..fbd4abd 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1238,6 +1238,11 @@ sub buildQuery { $truncated_operand .= $index_plus_comma . "rltrn:@$rightlefttruncated "; $previous_truncation_operand = 1; } + if ( scalar @$regexpr ) { + $truncated_operand .= "and " if $previous_truncation_operand; + $truncated_operand .= $index_plus_comma . "regExpr-1:@$regexpr "; + $previous_truncation_operand = 1; + } } $operand = $truncated_operand if $truncated_operand; warn "TRUNCATED OPERAND: >$truncated_operand<" if $DEBUG; @@ -2534,15 +2539,15 @@ sub enabled_staff_search_views ); } -sub AddSearchHistory{ - my ($borrowernumber,$session,$query_desc,$query_cgi, $total)=@_; +sub AddSearchHistory { + my ( $borrowernumber, $session, $query_desc, $query_cgi, $limit_desc, $limit_cgi, $total ) = @_; my $dbh = C4::Context->dbh; # Add the request the user just made - my $sql = "INSERT INTO search_history(userid, sessionid, query_desc, query_cgi, total, time) VALUES(?, ?, ?, ?, ?, NOW())"; - my $sth = $dbh->prepare($sql); - $sth->execute($borrowernumber, $session, $query_desc, $query_cgi, $total); - return $dbh->last_insert_id(undef, 'search_history', undef,undef,undef); + my $sql = "INSERT INTO search_history(userid, sessionid, query_desc, query_cgi, limit_desc, limit_cgi, total, time) VALUES(?, ?, ?, ?, ?, ?, ?, NOW())"; + my $sth = $dbh->prepare($sql); + $sth->execute( $borrowernumber, $session, $query_desc, $query_cgi, $limit_desc, $limit_cgi, $total ); + return $dbh->last_insert_id( undef, 'search_history', undef, undef, undef ); } sub GetSearchHistory{ diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3a51df5..049e50c 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1641,7 +1641,9 @@ CREATE TABLE IF NOT EXISTS `search_history` ( `userid` int(11) NOT NULL, `sessionid` varchar(32) NOT NULL, `query_desc` varchar(255) NOT NULL, - `query_cgi` varchar(255) NOT NULL, + `limit_desc` varchar(255) DEFAULT NULL, + `limit_cgi` varchar(255) DEFAULT NULL, + `query_cgi` text NOT NULL, `total` int(11) NOT NULL, `time` timestamp NOT NULL default CURRENT_TIMESTAMP, KEY `userid` (`userid`), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6b88c29..8412666 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4446,6 +4446,22 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(q{ + ALTER TABLE `search_history` ADD `limit_desc` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `query_cgi` , + ADD `limit_cgi` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `limit_desc` + }); + print "Upgrade to $DBversion done (adding limits to the opac search history)\n"; + SetVersion ($DBversion); +} +$DBversion = "3.05.00.xxx"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE search_history MODIFY COLUMN query_cgi text NOT NULL"); + print "Upgrade to $DBversion done (Change search_history.query_cgi type to text. bug 9581)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt index e9f6be1..6de4756 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt @@ -47,7 +47,8 @@ [% FOREACH recentSearche IN recentSearches %] <tr> <td>[% recentSearche.time %]</td> - <td><a href="/cgi-bin/koha/opac-search.pl?[% recentSearche.query_cgi |html %]">[% recentSearche.query_desc |html %]</a></td> + <td><a href="/cgi-bin/koha/opac-search.pl?[% recentSearche.query_cgi |html %][% recentSearche.limit_cgi|html %]">[% recentSearche.query_desc|html %] [% recentSearche.limit_desc|html %]</a></td> + <td>[% recentSearche.total %]</td> </tr> [% END %] @@ -65,7 +66,7 @@ [% FOREACH previousSearche IN previousSearches %] <tr> <td>[% previousSearche.time %]</td> - <td><a href="/cgi-bin/koha/opac-search.pl?[% previousSearche.query_cgi |html %]">[% previousSearche.query_desc |html %]</a></td> + <td><a href="/cgi-bin/koha/opac-search.pl?[% previousSearche.query_cgi |html %][% previousSearche.limit_cgi|html %]">[% previousSearche.query_desc|html %] [% previousSearche.limit_desc|html %]</a></td> <td>[% previousSearche.total %]</td> </tr> [% END %] diff --git a/opac/opac-search-history.pl b/opac/opac-search-history.pl index 65141b9..d52e57d 100755 --- a/opac/opac-search-history.pl +++ b/opac/opac-search-history.pl @@ -113,28 +113,28 @@ if (!$loggedinuser) { # Showing search history } else { - my $date = C4::Dates->new(); - my $dateformat = $date->DHTMLcalendar() . " %H:%i:%S"; # Current syspref date format + standard time format - - # Getting the data with date format work done by mysql - my $query = "SELECT userid, sessionid, query_desc, query_cgi, total, DATE_FORMAT(time, \"$dateformat\") as time FROM search_history WHERE userid = ? AND sessionid = ?"; - my $sth = $dbh->prepare($query); - $sth->execute($loggedinuser, $cgi->cookie("CGISESSID")); - my $searches = $sth->fetchall_arrayref({}); - $template->param(recentSearches => $searches); - - # Getting searches from previous sessions - $query = "SELECT COUNT(*) FROM search_history WHERE userid = ? AND sessionid != ?"; - $sth = $dbh->prepare($query); - $sth->execute($loggedinuser, $cgi->cookie("CGISESSID")); - - # If at least one search from previous sessions has been performed - if ($sth->fetchrow_array > 0) { - $query = "SELECT userid, sessionid, query_desc, query_cgi, total, DATE_FORMAT(time, \"$dateformat\") as time FROM search_history WHERE userid = ? AND sessionid != ?"; - $sth = $dbh->prepare($query); - $sth->execute($loggedinuser, $cgi->cookie("CGISESSID")); - my $previoussearches = $sth->fetchall_arrayref({}); - $template->param(previousSearches => $previoussearches); + my $date = C4::Dates->new(); + my $dateformat = $date->DHTMLcalendar() . " %H:%i:%S"; # Current syspref date format + standard time format + + # Getting the data with date format work done by mysql + my $query = "SELECT userid, sessionid, query_desc, query_cgi, limit_desc, limit_cgi, total, DATE_FORMAT(time, \"$dateformat\") as time FROM search_history WHERE userid = ? AND sessionid = ?"; + my $sth = $dbh->prepare($query); + $sth->execute( $loggedinuser, $cgi->cookie("CGISESSID") ); + my $searches = $sth->fetchall_arrayref( {} ); + $template->param( recentSearches => $searches ); + + # Getting searches from previous sessions + $query = "SELECT COUNT(*) FROM search_history WHERE userid = ? AND sessionid != ?"; + $sth = $dbh->prepare($query); + $sth->execute( $loggedinuser, $cgi->cookie("CGISESSID") ); + + # If at least one search from previous sessions has been performed + if ( $sth->fetchrow_array > 0 ) { + $query = "SELECT userid, sessionid, query_desc, query_cgi, limit_desc, limit_cgi, total, DATE_FORMAT(time, \"$dateformat\") as time FROM search_history WHERE userid = ? AND sessionid != ?"; + $sth = $dbh->prepare($query); + $sth->execute( $loggedinuser, $cgi->cookie("CGISESSID") ); + my $previoussearches = $sth->fetchall_arrayref( {} ); + $template->param( previousSearches => $previoussearches ); } diff --git a/opac/opac-search.pl b/opac/opac-search.pl index ff437da..a09aa21 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -509,6 +509,12 @@ for (my $i=0;$i<@servers;$i++) { } # Adding the new search if needed + my $path_info = $cgi->url(-path_info=>1); + $query_cgi = $cgi->url(-query=>1); + $query_cgi =~ s/^$path_info\?//; + $query_cgi =~ s/;/&/g; + $query_desc .= ", $limit_desc"; + if (!$borrowernumber || $borrowernumber eq '') { # To a cookie (the user is not logged in) @@ -517,6 +523,8 @@ for (my $i=0;$i<@servers;$i++) { push @recentSearches, { "query_desc" => $query_desc || "unknown", "query_cgi" => $query_cgi || "unknown", + "limit_desc" => $limit_desc, + "limit_cgi" => $limit_cgi, "time" => time(), "total" => $total }; @@ -535,8 +543,8 @@ for (my $i=0;$i<@servers;$i++) { } else { # To the session (the user is logged in) - if (($params->{'offset'}||'') eq '') { - AddSearchHistory($borrowernumber, $cgi->cookie("CGISESSID"), $query_desc, $query_cgi, $total); + if (($params->{'offset'}||'') eq '') { + AddSearchHistory( $borrowernumber, $cgi->cookie("CGISESSID"), $query_desc, $query_cgi, $limit_desc, $limit_cgi, $total ); $template->param(ShowOpacRecentSearchLink => 1); } } -- 1.7.3 From oleonard at myacpl.org Fri Sep 30 15:09:41 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 30 Sep 2011 09:09:41 -0400 Subject: [Koha-patches] [PATCH] Follow-up fix for Bug 6945, Add a link to show a MARC preview in the normal view Message-ID: <1317388181-16652-1-git-send-email-oleonard@myacpl.org> Adding the same MARC preview link to the section of the template which is displayed when XSLT is on. --- .../prog/en/modules/catalogue/detail.tt | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index b1aea09..a24137f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -98,6 +98,7 @@ function verify_images() { [% END %] </span> [% END %] + <span class="results_summary"><span class="label">MARC Preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Show</a></span> [% IF ( holdcount ) %]<span class="results_summary"><span class="label">Holds:</span> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></span>[% ELSE %][% END %] [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]</div><div class="yui-u" id="bookcoverimg"> -- 1.7.3 From nengard at bywatersolutions.com Wed Sep 28 10:55:36 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 28 Sep 2011 04:55:36 -0400 Subject: [Koha-patches] [PATCH 1/2] [SIGNED-OFF] Add a link to show a MARC preview in the normal view of the detail Message-ID: <1317200137-10031-1-git-send-email-nengard@bywatersolutions.com> From: Maxime Pelletier <maxime.pelletier at libeo.com> http://bugs.koha-community.org/show_bug.cgi?id=6945 Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- .../prog/en/modules/catalogue/detail.tt | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 8903ce1..b1aea09 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1,4 +1,5 @@ [% INCLUDE 'doc-head-open.inc' %] +[% INCLUDE 'greybox.inc' %] <title>Koha › Catalog › [% IF ( unknownbiblionumber ) %] Unknown record @@ -156,6 +157,10 @@ function verify_images() { <a href="http://[% OpacUrl %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]" target="_blank">Open in new window</a> </li> [% END %] + <li> + <strong>MARC Preview:</strong> + <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Show</a> + </li> </ul> </div> -- 1.7.2.3 From nengard at bywatersolutions.com Wed Sep 28 10:55:37 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 28 Sep 2011 04:55:37 -0400 Subject: [Koha-patches] [PATCH 2/2] [SIGNED-OFF] Follow-up fix for Bug 6945, Add a link to show a MARC preview in the normal view In-Reply-To: <1317200137-10031-1-git-send-email-nengard@bywatersolutions.com> References: <1317200137-10031-1-git-send-email-nengard@bywatersolutions.com> Message-ID: <1317200137-10031-2-git-send-email-nengard@bywatersolutions.com> From: Owen Leonard <oleonard at myacpl.org> Adding the same MARC preview link to the section of the template which is displayed when XSLT is on. Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com> --- .../prog/en/modules/catalogue/detail.tt | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index b1aea09..a24137f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -98,6 +98,7 @@ function verify_images() { [% END %] </span> [% END %] + <span class="results_summary"><span class="label">MARC Preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Show</a></span> [% IF ( holdcount ) %]<span class="results_summary"><span class="label">Holds:</span> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></span>[% ELSE %][% END %] [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]</div><div class="yui-u" id="bookcoverimg"> -- 1.7.2.3 From nengard at bywatersolutions.com Wed Sep 28 12:46:04 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 28 Sep 2011 06:46:04 -0400 Subject: [Koha-patches] [PATCH] bug6716: documenting reserves and old_reserves tables Message-ID: <1317206764-10646-1-git-send-email-nengard@bywatersolutions.com> This patch documents the reserves and the old_reserves table. Note that a few fields are marked unused: notificationdate and reminderdate. Also two fields are left undocumented: lowestPriority which never seems to be anything other than 0 and constrainttype which is either 'a' or 0, but there doesn't appear to be any explanation as to what each stands for. --- installer/data/mysql/kohastructure.sql | 60 ++++++++++++++++---------------- 1 files changed, 30 insertions(+), 30 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3a51df5..0fbbdc1 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1369,22 +1369,22 @@ CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r -- Table structure for table `old_reserves` -- DROP TABLE IF EXISTS `old_reserves`; -CREATE TABLE `old_reserves` ( - `borrowernumber` int(11) default NULL, - `reservedate` date default NULL, - `biblionumber` int(11) default NULL, +CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have been completed (either filled or cancelled) + `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table defining which patron this hold is for + `reservedate` date default NULL, -- the date the hold was places + `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bib record this hold is on `constrainttype` varchar(1) default NULL, - `branchcode` varchar(10) default NULL, - `notificationdate` date default NULL, - `reminderdate` date default NULL, - `cancellationdate` date default NULL, - `reservenotes` mediumtext, - `priority` smallint(6) default NULL, - `found` varchar(1) default NULL, - `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `itemnumber` int(11) default NULL, - `waitingdate` date default NULL, - `expirationdate` DATE DEFAULT NULL, + `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at + `notificationdate` date default NULL, -- currently unused + `reminderdate` date default NULL, -- currently unused + `cancellationdate` date default NULL, -- the date this hold was cancelled + `reservenotes` mediumtext, -- notes related to this hold + `priority` smallint(6) default NULL, -- where in the queue the patron sits + `found` varchar(1) default NULL, -- a one letter code defining what the the status is of the hold is after it has been confirmed + `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this hold was last updated + `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with + `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library + `expirationdate` DATE DEFAULT NULL, -- the date the hold expires (usually the date entered by the patron to say they don't need the hold after a certain date) `lowestPriority` tinyint(1) NOT NULL, KEY `old_reserves_borrowernumber` (`borrowernumber`), KEY `old_reserves_biblionumber` (`biblionumber`), @@ -1544,22 +1544,22 @@ CREATE TABLE `reserveconstraints` ( -- DROP TABLE IF EXISTS `reserves`; -CREATE TABLE `reserves` ( - `borrowernumber` int(11) NOT NULL default 0, - `reservedate` date default NULL, - `biblionumber` int(11) NOT NULL default 0, +CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha + `borrowernumber` int(11) NOT NULL default 0, -- foreign key from the borrowers table defining which patron this hold is for + `reservedate` date default NULL, -- the date the hold was places + `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this hold is on `constrainttype` varchar(1) default NULL, - `branchcode` varchar(10) default NULL, - `notificationdate` date default NULL, - `reminderdate` date default NULL, - `cancellationdate` date default NULL, - `reservenotes` mediumtext, - `priority` smallint(6) default NULL, - `found` varchar(1) default NULL, - `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `itemnumber` int(11) default NULL, - `waitingdate` date default NULL, - `expirationdate` DATE DEFAULT NULL, + `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at + `notificationdate` date default NULL, -- currently unused + `reminderdate` date default NULL, -- currently unused + `cancellationdate` date default NULL, -- the date this hold was cancelled + `reservenotes` mediumtext, -- notes related to this hold + `priority` smallint(6) default NULL, -- where in the queue the patron sits + `found` varchar(1) default NULL, -- a one letter code defining what the the status is of the hold is after it has been confirmed + `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this hold was last updated + `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with + `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library + `expirationdate` DATE DEFAULT NULL, -- the date the hold expires (usually the date entered by the patron to say they don't need the hold after a certain date) `lowestPriority` tinyint(1) NOT NULL, KEY priorityfoundidx (priority,found), KEY `borrowernumber` (`borrowernumber`), -- 1.7.2.3 From nengard at bywatersolutions.com Wed Sep 28 14:07:23 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 28 Sep 2011 08:07:23 -0400 Subject: [Koha-patches] [PATCH] bug6716 - document the aqbooksellers table Message-ID: <1317211643-10956-1-git-send-email-nengard@bywatersolutions.com> This documents the table that stores vendor info in Koha. There were 4 unused fields found: `accountnumber` `othersupplier` `currency` `booksellerurl` --- installer/data/mysql/kohastructure.sql | 66 ++++++++++++++++---------------- 1 files changed, 33 insertions(+), 33 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3a51df5..34ccf01 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2448,39 +2448,39 @@ CREATE TABLE `aqbasket` ( -- DROP TABLE IF EXISTS `aqbooksellers`; -CREATE TABLE `aqbooksellers` ( - `id` int(11) NOT NULL auto_increment, - `name` mediumtext NOT NULL, - `address1` mediumtext, - `address2` mediumtext, - `address3` mediumtext, - `address4` mediumtext, - `phone` varchar(30) default NULL, - `accountnumber` mediumtext, - `othersupplier` mediumtext, - `currency` varchar(3) NOT NULL default '', - `booksellerfax` mediumtext, - `notes` mediumtext, - `bookselleremail` mediumtext, - `booksellerurl` mediumtext, - `contact` varchar(100) default NULL, - `postal` mediumtext, - `url` varchar(255) default NULL, - `contpos` varchar(100) default NULL, - `contphone` varchar(100) default NULL, - `contfax` varchar(100) default NULL, - `contaltphone` varchar(100) default NULL, - `contemail` varchar(100) default NULL, - `contnotes` mediumtext, - `active` tinyint(4) default NULL, - `listprice` varchar(10) default NULL, - `invoiceprice` varchar(10) default NULL, - `gstreg` tinyint(4) default NULL, - `listincgst` tinyint(4) default NULL, - `invoiceincgst` tinyint(4) default NULL, - `gstrate` decimal(6,4) default NULL, - `discount` float(6,4) default NULL, - `fax` varchar(50) default NULL, +CREATE TABLE `aqbooksellers` ( -- information about the vendors listed in acquisitions + `id` int(11) NOT NULL auto_increment, -- primary key and unique identifier assigned by Koha + `name` mediumtext NOT NULL, -- vendor name + `address1` mediumtext, -- first line of vendor physical address + `address2` mediumtext, -- second line of vendor physical address + `address3` mediumtext, -- third line of vendor physical address + `address4` mediumtext, -- fourth line of vendor physical address + `phone` varchar(30) default NULL, -- vendor phone number + `accountnumber` mediumtext, -- unused in Koha + `othersupplier` mediumtext, -- unused in Koha + `currency` varchar(3) NOT NULL default '', -- unused in Koha + `booksellerfax` mediumtext, -- vendor fax number + `notes` mediumtext, -- order notes + `bookselleremail` mediumtext, -- vendor email + `booksellerurl` mediumtext, -- unused in Koha + `contact` varchar(100) default NULL, -- name of contact at vendor + `postal` mediumtext, -- vendor postal address (all lines) + `url` varchar(255) default NULL, -- vendor web address + `contpos` varchar(100) default NULL, -- contact person's position + `contphone` varchar(100) default NULL, -- contact's phone number + `contfax` varchar(100) default NULL, -- contact's fax number + `contaltphone` varchar(100) default NULL, -- contact's alternate phone number + `contemail` varchar(100) default NULL, -- contact's email address + `contnotes` mediumtext, -- notes related to the contact + `active` tinyint(4) default NULL, -- is this vendor active (1 for yes, 0 for no) + `listprice` varchar(10) default NULL, -- currency code for list prices + `invoiceprice` varchar(10) default NULL, -- currency code for invoice prices + `gstreg` tinyint(4) default NULL, -- is your library charged tax (1 for yes, 0 for no) + `listincgst` tinyint(4) default NULL, -- is tax included in list prices (1 for yes, 0 for no) + `invoiceincgst` tinyint(4) default NULL, -- is tax included in invoice prices (1 for yes, 0 for no) + `gstrate` decimal(6,4) default NULL, -- the tax rate the library is charged + `discount` float(6,4) default NULL, -- discount offered on all items ordered from this vendor + `fax` varchar(50) default NULL, -- vendor fax number PRIMARY KEY (`id`), KEY `listprice` (`listprice`), KEY `invoiceprice` (`invoiceprice`), -- 1.7.2.3 From nengard at bywatersolutions.com Wed Sep 28 14:36:36 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 28 Sep 2011 08:36:36 -0400 Subject: [Koha-patches] [PATCH] bug 6717 - document the items table Message-ID: <1317213396-11149-1-git-send-email-nengard@bywatersolutions.com> This patch documents the items table. Some fields were left undocumented because I was unsure of what data was stored there: stack paidfor cn_sort permanent_location stocknumber http://bugs.koha-community.org/show_bug.cgi?id=6716 --- installer/data/mysql/kohastructure.sql | 70 ++++++++++++++++---------------- 1 files changed, 35 insertions(+), 35 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3a51df5..337d555 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -996,45 +996,45 @@ CREATE TABLE `issuingrules` ( -- DROP TABLE IF EXISTS `items`; -CREATE TABLE `items` ( - `itemnumber` int(11) NOT NULL auto_increment, - `biblionumber` int(11) NOT NULL default 0, - `biblioitemnumber` int(11) NOT NULL default 0, - `barcode` varchar(20) default NULL, - `dateaccessioned` date default NULL, - `booksellerid` mediumtext default NULL, - `homebranch` varchar(10) default NULL, - `price` decimal(8,2) default NULL, - `replacementprice` decimal(8,2) default NULL, - `replacementpricedate` date default NULL, - `datelastborrowed` date default NULL, - `datelastseen` date default NULL, +CREATE TABLE `items` ( -- holdings/item information + `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha + `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record + `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information + `barcode` varchar(20) default NULL, -- item barcode (952$p) + `dateaccessioned` date default NULL, -- date the item was acquired or added to Koha (952$d) + `booksellerid` mediumtext default NULL, -- where the item was purchased (952$e) + `homebranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this item (952$a) + `price` decimal(8,2) default NULL, -- purchase price (952$g) + `replacementprice` decimal(8,2) default NULL, -- cost the library charges to replace the item if it has been marked lost (952$v) + `replacementpricedate` date default NULL, -- the date the price is effective from (952$w) + `datelastborrowed` date default NULL, -- the date the item was last checked out + `datelastseen` date default NULL, -- the date the item was last see (usually the last time the barcode was scanned or inventory was done) `stack` tinyint(1) default NULL, - `notforloan` tinyint(1) NOT NULL default 0, - `damaged` tinyint(1) NOT NULL default 0, - `itemlost` tinyint(1) NOT NULL default 0, - `wthdrawn` tinyint(1) NOT NULL default 0, - `itemcallnumber` varchar(255) default NULL, - `issues` smallint(6) default NULL, - `renewals` smallint(6) default NULL, - `reserves` smallint(6) default NULL, - `restricted` tinyint(1) default NULL, - `itemnotes` mediumtext, - `holdingbranch` varchar(10) default NULL, + `notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (952$7) + `damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (952$4) + `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (952$1) + `wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (952$0) + `itemcallnumber` varchar(255) default NULL, -- call number for this item (952$o) + `issues` smallint(6) default NULL, -- number of times this item has been checked out + `renewals` smallint(6) default NULL, -- number of times this item has been renewed + `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved + `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (952$5) + `itemnotes` mediumtext, -- public notes on this item (952$x) + `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (952$b) `paidfor` mediumtext, - `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `location` varchar(80) default NULL, + `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered + `location` varchar(80) default NULL, -- authorized value for the shelving location for this item (952$c) `permanent_location` varchar(80) default NULL, - `onloan` date default NULL, - `cn_source` varchar(10) default NULL, + `onloan` date default NULL, -- defines if this item is currently checked out (1 for yes, 0 for no) + `cn_source` varchar(10) default NULL, -- classification source used on this item (952$2) `cn_sort` varchar(30) default NULL, - `ccode` varchar(10) default NULL, - `materials` varchar(10) default NULL, - `uri` varchar(255) default NULL, - `itype` varchar(10) default NULL, - `more_subfields_xml` longtext default NULL, - `enumchron` text default NULL, - `copynumber` varchar(32) default NULL, + `ccode` varchar(10) default NULL, -- authorized value for the collection code associated with this item (952$8) + `materials` varchar(10) default NULL, -- materials specified (952$3) + `uri` varchar(255) default NULL, -- URL for the item (952$u) + `itype` varchar(10) default NULL, -- foreign key from the itemtypes table defining the type for this item (952$y) + `more_subfields_xml` longtext default NULL, -- additional 952 subfields in XML format + `enumchron` text default NULL, -- serial enumeration/chronology for the item (952$h) + `copynumber` varchar(32) default NULL, -- copy number (952$t) `stocknumber` varchar(32) default NULL, PRIMARY KEY (`itemnumber`), UNIQUE KEY `itembarcodeidx` (`barcode`), -- 1.7.2.3 From nengard at bywatersolutions.com Wed Sep 28 15:03:04 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 28 Sep 2011 09:03:04 -0400 Subject: [Koha-patches] [PATCH] Bug 6716 - document the items table Message-ID: <1317214984-11282-1-git-send-email-nengard@bywatersolutions.com> This patch documents the items table. Some fields were left undocumented because I was unsure of what data was stored there: stack paidfor permanent_location stocknumber --- installer/data/mysql/kohastructure.sql | 70 ++++++++++++++++---------------- 1 files changed, 35 insertions(+), 35 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3a51df5..337d555 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -996,45 +996,45 @@ CREATE TABLE `issuingrules` ( -- DROP TABLE IF EXISTS `items`; -CREATE TABLE `items` ( - `itemnumber` int(11) NOT NULL auto_increment, - `biblionumber` int(11) NOT NULL default 0, - `biblioitemnumber` int(11) NOT NULL default 0, - `barcode` varchar(20) default NULL, - `dateaccessioned` date default NULL, - `booksellerid` mediumtext default NULL, - `homebranch` varchar(10) default NULL, - `price` decimal(8,2) default NULL, - `replacementprice` decimal(8,2) default NULL, - `replacementpricedate` date default NULL, - `datelastborrowed` date default NULL, - `datelastseen` date default NULL, +CREATE TABLE `items` ( -- holdings/item information + `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha + `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record + `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information + `barcode` varchar(20) default NULL, -- item barcode (952$p) + `dateaccessioned` date default NULL, -- date the item was acquired or added to Koha (952$d) + `booksellerid` mediumtext default NULL, -- where the item was purchased (952$e) + `homebranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this item (952$a) + `price` decimal(8,2) default NULL, -- purchase price (952$g) + `replacementprice` decimal(8,2) default NULL, -- cost the library charges to replace the item if it has been marked lost (952$v) + `replacementpricedate` date default NULL, -- the date the price is effective from (952$w) + `datelastborrowed` date default NULL, -- the date the item was last checked out + `datelastseen` date default NULL, -- the date the item was last see (usually the last time the barcode was scanned or inventory was done) `stack` tinyint(1) default NULL, - `notforloan` tinyint(1) NOT NULL default 0, - `damaged` tinyint(1) NOT NULL default 0, - `itemlost` tinyint(1) NOT NULL default 0, - `wthdrawn` tinyint(1) NOT NULL default 0, - `itemcallnumber` varchar(255) default NULL, - `issues` smallint(6) default NULL, - `renewals` smallint(6) default NULL, - `reserves` smallint(6) default NULL, - `restricted` tinyint(1) default NULL, - `itemnotes` mediumtext, - `holdingbranch` varchar(10) default NULL, + `notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (952$7) + `damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (952$4) + `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (952$1) + `wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (952$0) + `itemcallnumber` varchar(255) default NULL, -- call number for this item (952$o) + `issues` smallint(6) default NULL, -- number of times this item has been checked out + `renewals` smallint(6) default NULL, -- number of times this item has been renewed + `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved + `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (952$5) + `itemnotes` mediumtext, -- public notes on this item (952$x) + `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (952$b) `paidfor` mediumtext, - `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `location` varchar(80) default NULL, + `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered + `location` varchar(80) default NULL, -- authorized value for the shelving location for this item (952$c) `permanent_location` varchar(80) default NULL, - `onloan` date default NULL, - `cn_source` varchar(10) default NULL, + `onloan` date default NULL, -- defines if this item is currently checked out (1 for yes, 0 for no) + `cn_source` varchar(10) default NULL, -- classification source used on this item (952$2) `cn_sort` varchar(30) default NULL, - `ccode` varchar(10) default NULL, - `materials` varchar(10) default NULL, - `uri` varchar(255) default NULL, - `itype` varchar(10) default NULL, - `more_subfields_xml` longtext default NULL, - `enumchron` text default NULL, - `copynumber` varchar(32) default NULL, + `ccode` varchar(10) default NULL, -- authorized value for the collection code associated with this item (952$8) + `materials` varchar(10) default NULL, -- materials specified (952$3) + `uri` varchar(255) default NULL, -- URL for the item (952$u) + `itype` varchar(10) default NULL, -- foreign key from the itemtypes table defining the type for this item (952$y) + `more_subfields_xml` longtext default NULL, -- additional 952 subfields in XML format + `enumchron` text default NULL, -- serial enumeration/chronology for the item (952$h) + `copynumber` varchar(32) default NULL, -- copy number (952$t) `stocknumber` varchar(32) default NULL, PRIMARY KEY (`itemnumber`), UNIQUE KEY `itembarcodeidx` (`barcode`), -- 1.7.2.3 From nengard at gmail.com Fri Sep 30 19:52:03 2011 From: nengard at gmail.com (Nicole Engard) Date: Fri, 30 Sep 2011 13:52:03 -0400 Subject: [Koha-patches] [PATCH] bug 6717 - document the items table In-Reply-To: <1317213396-11149-1-git-send-email-nengard@bywatersolutions.com> References: <1317213396-11149-1-git-send-email-nengard@bywatersolutions.com> Message-ID: <CAC0K6VF1AeA3gbWhoOqOijEPwu+FE7Bfj2RizT_F0fsR2yjJUg@mail.gmail.com> ignore this On Wed, Sep 28, 2011 at 8:36 AM, Nicole C. Engard <nengard at bywatersolutions.com> wrote: > This patch documents the items table. Some fields were left > undocumented because I was unsure of what data was stored there: > > stack > paidfor > cn_sort > permanent_location > stocknumber > > http://bugs.koha-community.org/show_bug.cgi?id=6716 > --- > ?installer/data/mysql/kohastructure.sql | ? 70 ++++++++++++++++---------------- > ?1 files changed, 35 insertions(+), 35 deletions(-) > > diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql > index 3a51df5..337d555 100644 > --- a/installer/data/mysql/kohastructure.sql > +++ b/installer/data/mysql/kohastructure.sql > @@ -996,45 +996,45 @@ CREATE TABLE `issuingrules` ( > ?-- > > ?DROP TABLE IF EXISTS `items`; > -CREATE TABLE `items` ( > - ?`itemnumber` int(11) NOT NULL auto_increment, > - ?`biblionumber` int(11) NOT NULL default 0, > - ?`biblioitemnumber` int(11) NOT NULL default 0, > - ?`barcode` varchar(20) default NULL, > - ?`dateaccessioned` date default NULL, > - ?`booksellerid` mediumtext default NULL, > - ?`homebranch` varchar(10) default NULL, > - ?`price` decimal(8,2) default NULL, > - ?`replacementprice` decimal(8,2) default NULL, > - ?`replacementpricedate` date default NULL, > - ?`datelastborrowed` date default NULL, > - ?`datelastseen` date default NULL, > +CREATE TABLE `items` ( -- holdings/item information > + ?`itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha > + ?`biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record > + ?`biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information > + ?`barcode` varchar(20) default NULL, -- item barcode (952$p) > + ?`dateaccessioned` date default NULL, -- date the item was acquired or added to Koha (952$d) > + ?`booksellerid` mediumtext default NULL, -- where the item was purchased (952$e) > + ?`homebranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this item (952$a) > + ?`price` decimal(8,2) default NULL, -- purchase price (952$g) > + ?`replacementprice` decimal(8,2) default NULL, -- cost the library charges to replace the item if it has been marked lost (952$v) > + ?`replacementpricedate` date default NULL, -- the date the price is effective from (952$w) > + ?`datelastborrowed` date default NULL, -- the date the item was last checked out > + ?`datelastseen` date default NULL, -- the date the item was last see (usually the last time the barcode was scanned or inventory was done) > ? `stack` tinyint(1) default NULL, > - ?`notforloan` tinyint(1) NOT NULL default 0, > - ?`damaged` tinyint(1) NOT NULL default 0, > - ?`itemlost` tinyint(1) NOT NULL default 0, > - ?`wthdrawn` tinyint(1) NOT NULL default 0, > - ?`itemcallnumber` varchar(255) default NULL, > - ?`issues` smallint(6) default NULL, > - ?`renewals` smallint(6) default NULL, > - ?`reserves` smallint(6) default NULL, > - ?`restricted` tinyint(1) default NULL, > - ?`itemnotes` mediumtext, > - ?`holdingbranch` varchar(10) default NULL, > + ?`notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (952$7) > + ?`damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (952$4) > + ?`itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (952$1) > + ?`wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (952$0) > + ?`itemcallnumber` varchar(255) default NULL, -- call number for this item (952$o) > + ?`issues` smallint(6) default NULL, -- number of times this item has been checked out > + ?`renewals` smallint(6) default NULL, -- number of times this item has been renewed > + ?`reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved > + ?`restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (952$5) > + ?`itemnotes` mediumtext, -- public notes on this item (952$x) > + ?`holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (952$b) > ? `paidfor` mediumtext, > - ?`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, > - ?`location` varchar(80) default NULL, > + ?`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered > + ?`location` varchar(80) default NULL, -- authorized value for the shelving location for this item (952$c) > ? `permanent_location` varchar(80) default NULL, > - ?`onloan` date default NULL, > - ?`cn_source` varchar(10) default NULL, > + ?`onloan` date default NULL, -- defines if this item is currently checked out (1 for yes, 0 for no) > + ?`cn_source` varchar(10) default NULL, -- classification source used on this item (952$2) > ? `cn_sort` varchar(30) default NULL, > - ?`ccode` varchar(10) default NULL, > - ?`materials` varchar(10) default NULL, > - ?`uri` varchar(255) default NULL, > - ?`itype` varchar(10) default NULL, > - ?`more_subfields_xml` longtext default NULL, > - ?`enumchron` text default NULL, > - ?`copynumber` varchar(32) default NULL, > + ?`ccode` varchar(10) default NULL, -- authorized value for the collection code associated with this item (952$8) > + ?`materials` varchar(10) default NULL, -- materials specified (952$3) > + ?`uri` varchar(255) default NULL, -- URL for the item (952$u) > + ?`itype` varchar(10) default NULL, -- foreign key from the itemtypes table defining the type for this item (952$y) > + ?`more_subfields_xml` longtext default NULL, -- additional 952 subfields in XML format > + ?`enumchron` text default NULL, -- serial enumeration/chronology for the item (952$h) > + ?`copynumber` varchar(32) default NULL, -- copy number (952$t) > ? `stocknumber` varchar(32) default NULL, > ? PRIMARY KEY ?(`itemnumber`), > ? UNIQUE KEY `itembarcodeidx` (`barcode`), > -- > 1.7.2.3 > > _______________________________________________ > Koha-patches mailing list > Koha-patches at lists.koha-community.org > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > website : http://www.koha-community.org/ > git : http://git.koha-community.org/ > bugs : http://bugs.koha-community.org/ > From oleonard at myacpl.org Fri Sep 30 20:23:00 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 30 Sep 2011 14:23:00 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] The way to show the plural of the word "Item" is not compatible with multilanguage Message-ID: <1317406980-18691-1-git-send-email-oleonard@myacpl.org> From: Juan Romay Sieira <juan.sieira at xercode.es> http://bugs.koha-community.org/show_bug.cgi?id=6925 Signed-off-by: Owen Leonard <oleonard at myacpl.org> --- .../intranet-tmpl/prog/en/modules/circ/overdue.tt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt index 3e8dfba..37190d2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt @@ -91,7 +91,7 @@ [% ELSE %] -<h2>[% nnoverdue %] Item[% IF ( noverdue_is_plural ) %]s[% END %] +<h2>[% nnoverdue %] [% IF ( noverdue_is_plural ) %]Items[% ELSE %]Item[% END %] Overdue as of [% todaysdate %][% IF ( isfiltered ) %] (filtered)[% END %]</h2> <p> -- 1.7.3 From nengard at bywatersolutions.com Wed Sep 28 15:41:11 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 28 Sep 2011 09:41:11 -0400 Subject: [Koha-patches] [PATCH] bug 6716 - document deleted items table Message-ID: <1317217271-11440-1-git-send-email-nengard@bywatersolutions.com> This patch documents the deleted items table. Some fields were left undocumented because I was unsure of what data was stored there: stack paidfor permanent_location stocknumber --- installer/data/mysql/kohastructure.sql | 72 ++++++++++++++++---------------- 1 files changed, 36 insertions(+), 36 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3a51df5..265d427 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -731,46 +731,46 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower DROP TABLE IF EXISTS `deleteditems`; CREATE TABLE `deleteditems` ( - `itemnumber` int(11) NOT NULL default 0, - `biblionumber` int(11) NOT NULL default 0, - `biblioitemnumber` int(11) NOT NULL default 0, - `barcode` varchar(20) default NULL, - `dateaccessioned` date default NULL, - `booksellerid` mediumtext default NULL, - `homebranch` varchar(10) default NULL, - `price` decimal(8,2) default NULL, - `replacementprice` decimal(8,2) default NULL, - `replacementpricedate` date default NULL, - `datelastborrowed` date default NULL, - `datelastseen` date default NULL, + `itemnumber` int(11) NOT NULL default 0, -- primary key and unique identifier added by Koha + `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record + `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information + `barcode` varchar(20) default NULL, -- item barcode (952$p) + `dateaccessioned` date default NULL, -- date the item was acquired or added to Koha (952$d) + `booksellerid` mediumtext default NULL, -- where the item was purchased (952$e) + `homebranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this item (952$a) + `price` decimal(8,2) default NULL, -- purchase price (952$g) + `replacementprice` decimal(8,2) default NULL, -- cost the library charges to replace the item if it has been marked lost (952$v) + `replacementpricedate` date default NULL, -- the date the price is effective from (952$w) + `datelastborrowed` date default NULL, -- the date the item was last checked out + `datelastseen` date default NULL, -- the date the item was last see (usually the last time the barcode was scanned or inventory was done) `stack` tinyint(1) default NULL, - `notforloan` tinyint(1) NOT NULL default 0, - `damaged` tinyint(1) NOT NULL default 0, - `itemlost` tinyint(1) NOT NULL default 0, - `wthdrawn` tinyint(1) NOT NULL default 0, - `itemcallnumber` varchar(255) default NULL, - `issues` smallint(6) default NULL, - `renewals` smallint(6) default NULL, - `reserves` smallint(6) default NULL, - `restricted` tinyint(1) default NULL, - `itemnotes` mediumtext, - `holdingbranch` varchar(10) default NULL, + `notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (952$7) + `damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (952$4) + `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (952$1) + `wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (952$0) + `itemcallnumber` varchar(255) default NULL, -- call number for this item (952$o) + `issues` smallint(6) default NULL, -- number of times this item has been checked out + `renewals` smallint(6) default NULL, -- number of times this item has been renewed + `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved + `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (952$5) + `itemnotes` mediumtext, -- public notes on this item (952$x) + `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (952$b) `paidfor` mediumtext, - `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `location` varchar(80) default NULL, + `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered + `location` varchar(80) default NULL, -- authorized value for the shelving location for this item (952$c) `permanent_location` varchar(80) default NULL, - `onloan` date default NULL, - `cn_source` varchar(10) default NULL, - `cn_sort` varchar(30) default NULL, - `ccode` varchar(10) default NULL, - `materials` varchar(10) default NULL, - `uri` varchar(255) default NULL, - `itype` varchar(10) default NULL, - `more_subfields_xml` longtext default NULL, - `enumchron` text default NULL, - `copynumber` varchar(32) default NULL, + `onloan` date default NULL, -- defines if this item is currently checked out (1 for yes, 0 for no) + `cn_source` varchar(10) default NULL, -- classification source used on this item (952$2) + `cn_sort` varchar(30) default NULL, -- normalized form of the call number (952$o) used for sorting + `ccode` varchar(10) default NULL, -- authorized value for the collection code associated with this item (952$8) + `materials` varchar(10) default NULL, -- materials specified (952$3) + `uri` varchar(255) default NULL, -- URL for the item (952$u) + `itype` varchar(10) default NULL, -- foreign key from the itemtypes table defining the type for this item (952$y) + `more_subfields_xml` longtext default NULL, -- additional 952 subfields in XML format + `enumchron` text default NULL, -- serial enumeration/chronology for the item (952$h) + `copynumber` varchar(32) default NULL, -- copy number (952$t) `stocknumber` varchar(32) default NULL, - `marc` longblob, + `marc` longblob, -- unused in Koha PRIMARY KEY (`itemnumber`), KEY `delitembarcodeidx` (`barcode`), KEY `delitemstocknumberidx` (`stocknumber`), -- 1.7.2.3 From oleonard at myacpl.org Fri Sep 30 20:31:46 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 30 Sep 2011 14:31:46 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6862: Duplicate VOKAL Book icons Message-ID: <1317407506-18875-1-git-send-email-oleonard@myacpl.org> From: Ian Walls <ian.walls at bywatersolutions.com> Removes duplicate VOKAL icons for Book.png and Book-32px.png. Database updated in both itemtypes and authorised_values tables to reflect change, so no icon loss should be seen Signed-off-by: Owen Leonard <oleonard at myacpl.org> --- installer/data/mysql/updatedatabase.pl | 10 ++++++++++ .../prog/img/itemtypeimg/vokal/BOOK-32px.png | Bin 897 -> 0 bytes .../prog/img/itemtypeimg/vokal/BOOK.png | Bin 3825 -> 0 bytes .../opac-tmpl/prog/itemtypeimg/vokal/BOOK-32px.png | Bin 897 -> 0 bytes .../opac-tmpl/prog/itemtypeimg/vokal/BOOK.png | Bin 3825 -> 0 bytes 5 files changed, 10 insertions(+), 0 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/vokal/BOOK-32px.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/vokal/BOOK.png delete mode 100644 koha-tmpl/opac-tmpl/prog/itemtypeimg/vokal/BOOK-32px.png delete mode 100644 koha-tmpl/opac-tmpl/prog/itemtypeimg/vokal/BOOK.png diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6b88c29..18583bb 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4446,6 +4446,16 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("UPDATE itemtypes SET imageurl = 'vokal/Book.png' WHERE imageurl = 'vokal/BOOK.png'"); + $dbh->do("UPDATE itemtypes SET imageurl = 'vokal/Book-32px.png' WHERE imageurl = 'vokal/BOOK-32px.png'"); + $dbh->do("UPDATE authorised_values SET imageurl = 'vokal/Book.png' WHERE imageurl = 'vokal/BOOK.png'"); + $dbh->do("UPDATE authorised_values SET imageurl = 'vokal/Book-32px.png' WHERE imageurl = 'vokal/BOOK-32px.png'"); + print "Upgrade to $DBversion done (remove duplicate VOKAL Book icons, bug 6862)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/vokal/BOOK-32px.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/vokal/BOOK-32px.png deleted file mode 100644 index c0aaad545f8be43e5010a2137f8cb92c51ce34b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 897 zcmV-{1AhF8P)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F80000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU#BS}O-RCwC#S4&S5Q562>;S_31ODM1a z+cA<9k~Ri(MMCS+1sfI;7rqwg%9R2e!H}pcNi;FWg;D;3KR^@YQDdSD0=h7QU;`A8 z;*^JN+L`g*JJVui+F&(645vN0GxwhMeD|DhZohK6u46xq$3EL30P*2?uTR(1E2^eK z%VeObDpbuJbJxT*dasdDWAkhzuCZ&~bg)q+uB(7b_@$}Fnoic(yq+H`5)d-+f#gOC zs|(*z;jv?3dIjDl4 at 0P|Y+)_74qufYoMr&viN`mVz*nXq+KeK`=QmO3 at EhCGIYhtB zAcY^OsI}*In@(m-07h~_5*Pqxi!-YjIR6;WhlcR9_ZeP~jIdyr*M(pp0F8Z+?3z?5 zlTnc-<J)&{@Z!TG)alK*dASQ7PZf at cA_PGIPkcSGj>)M>a2yBvqVHG3FVTLs9XFm_ zh5MLe8vr$z%Y^_*MlBo)F#x)m*veW?p2m2j1zp#!Lz1K&>u$FTp|&>gyip|zL{Sn5 z1_Rq1C`J%k1!O_wdZ)s1)B%5EBa3Mcp322XA`xTvBq7h!ku!EroNnk~J_W at Vvu&U) zu;Re)*4o;d#{q#<g6=-sf<Fdu=k7g9X_E`s24i|hM at L@#{lP&qDREMMo+PKtyWQVc z8i4-3TSY67PNy+9H<yd=>F&0yK*=pAL_&HX`5XPPm)rB=i;+<F`5?>ke?~&uf;}f; zeSIA|&vjbH7b0Oe94dGYluSY^D at 4MQE3liBa5p486Am9>J+K!iVaWjg_9T>jGA>=b zP&$BraS|SUP5A50=;#=tU!#ouZX!;+UN0slCJ^6T!P at 3BrkAI%mD<3<+85ZQ3N%zV zAr-UX<NSNXlqe*dz`n;RdT^rN4_{3~-t#|eR_nW><mR{sV?ALaN{6$ebahd|R)T0b zPdVbT1Uz1cr6_ee-K0GlW<SkCC3z)@hbZzpMCsCJ#o!RtfhLy(66>h8=S1l&6{T53 zl{F5Myo{;cTG`E1v6U%G9OdN4$XQi}WHL>XbFflw)yFFes$y1w!@p*S0QMWePXPu1 XMD=b^@6P1_00000NkvXXu0mjf(Ib;M diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/vokal/BOOK.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/vokal/BOOK.png deleted file mode 100644 index b6fe7ac72ed46f0125e4c6551c4e4569a4d26d2d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3825 zcmV<N4i52&P)<h;3K|Lk000e1NJLTq002Ay002A)1^@s6I{evk0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU=lSxEDRCwC#TUl&W*BSn2#-16E$77FI zJjN@=HrQqjn+XAez!1_<f`ZzTs8OXfO@(-C+J`*kEkae=q^(pnQj-cb4 at s&PMX3-3 zTEMI}5CZ|*7%v#__F#{fnXzZN{l9<ioebW<%{WRMAL;5YbA9jm{^k3>bMCQDQ55<v zH9dXD+C1QS!1I9T0sl|67 at bZ>u_m(y-f-xTFXSiK&AGu~kQCm6T(%S?bgZby!HDC~ zZwlY19*3_J-={=eQ`GyEh<g;d at 2fpcagM)Jk4e2A4DI;|L{t7<<aLESBffhV-mhz6 zd;y&X_7{ISu-2YoeNU&?m4`tEHE<Jvsn@>xO?l|Po>mumM}1^9+IdTg034)#cPGW# zf at DoL$+e+=FVRRG*-Xh~jESRkYc}<bbdcBY=5Fbz+to&%aW|#sC#uFGK at yzNP?HTA z3<TRooZcVA$Ww_dN$Cl1>kYc{_FGQ!`rNc2&n}%e#>G<W)qct-vXaRX`%rj{xqZ~# zGC-;E4obB+C<R-bgNk<-lQlk`jS!$fAY_=(77)<w9i4Qgp^7^D+vrCXKct0OS)|wN zNvG43!JwC8z1|So8$$b<ni?8(JE?21jXDQf=}y-z0hF3&3-`y>?WS18Ofe<{1x at 2} z4zPI{h1Bi2mlL02J_ZjP_}+}eCl7Wg+ at bWrGTLAHBK__Uzo#u*w$SaCTFOZ)BwK=w z1_lPi!;#)!zka>!L%;%|W9-%QsQ at F?1H8X_^(sB_#A+4b%zzEp)MM>Bu3fxziS(S7 zIzG<N%cuPOJo?RV-=U2a8)$TNlqxDJ$Y?aumY=RBdv*fFsJUyNnB3)M<+QB4oC+5$ zqT1`%Y5B5p>0}68APfM2W@<x2L#iPZvRdP#PC`#^+!!_j41!i#T1sVQWpw%S<;kR_ zhO}WeFKKFOitt*H9z1v;;e~y7cQ+YLCc1g!2CZJbni?A$1vIRjmX^kbTSj?#d6S+w zHa13`on5?jP<na>4G#~?wFL_n$o<L5$<bkHb+4PvAKkrsm(HF&OAd#FJRVQDQ?0G7 zR9sw4Y3b=4A!U at 1kRaCfcsRFWjnv!QOQ~t8Q$Dk<u8vw-S}8HnMz?O=BD2{nfbp)A zCr{Gy<;&&oy<RUZUAmMCIP$C(3yqDB)53)dDLy`aR)8Pbob0{NKKmz?m6uXwWhHIj zzFk6fWW+6dco+GMJa4;qPdsg6Pq($T$=|1 at riuYdii;$?C$<$URxsE^e%=VJTD6*d zJ|E at g=2ClmJ7s2O(l`SHU~DkPDK<h^SC{<l=FOXF*REaB1soR_C!V at _<0ifT=l98O zx65?^+^}JT?BQ*6(!?Fg$jA_Y at P^mxp`M;zKDSQ${My=Ds;;gPU@(-;W)lOz!#FP~ zDUo*qyoEhm$`Lf=8l;qzR550Cb+wRQ1(Q`&0HZzs{62EKM`_QVJ>+ycC4Z5dPUiyw z3Qu=-cGB_V$7%86#nRz>>}}*X^0%q!E_X16Qj$|9J-eWwfQ?fs&jkVDdDxG$r;*S1 zIZ^-^Y4gPwUr1>0f8hoC_~TE+*l4IKQS&fD_N}+x5>MmB2rGCL7Qc4wn&dG&F*rCV zKoQCS`7kk!(?=hDOh13^wMozK=;)yO`Uc6{{{DU`Cn#Hp6f`^^#05|9-o0DOl8^6A zVed9KH%mxsEFBfV5C?}3AEt&o4a~fEsUSa}jo_qQu6-+4t_(AFPEL*(M`|{o!_)98 zj!`4EIy|wV&M#TAgp!gHB{X4JfJJ>BXJBCaix)3)YV^>-g9j;@pK0cM7BP9 at 9kXTW zM>f3hPw%}a%#4>HbP=j`w{HupmXs{vP`gGhmrFW|-;jr^R;_xh=MN1JNjSH(G)p8v z<D((8Q2{D<?4aJhKH&s}`qwQ>k8D{?{Ra*l5Y~jZ5YF%<LK~exIm*q=5s+ at R4D~Qm z<M+P4UKSk*d~N2}0VvV{V26f=#c&`o at BmT-r4Y~Cw{M at 2)|>+FV4$Z at pQg2I*NSBG zxZNxZpAgbQ4k6r7D^Hv_A>O at n=T0b8*#OAxKK2g&7Hs^|OD|GPOzb4mLhcU_k8o)k zX7Q0O*V7p^IK#nQ@$}PAi-`F~JdB)Kw{9KXU<Cy$L(JD)xk42z?OIw|#2dK2jFl8X zKJ&~o;k=HGjg>tJZMxEQz4kiQ)z?e9fR*88ohowhT;wi at 3#0}E;6BuP5E<Ty(iBy| zXb9uVot5Msb<_U+`@>qggP9Y6;AxN*I#SL$911BrJDcv`zb{?~DQ$XkV|efo+19RG zOY2y;KzP7|*n_x0TFDF$*HCLwgJF!@%pFK`hz|gcx`)x=-DAg&32-!6KA%GoV=w?k zZN$rqIG+)cd-v`Y at qrw~9)vc;-m}JAr<9hbPW?-cpL^~(`t;LJB^BUNggU$npfDQ3 z-@#SGpw~&>qom<JREVenPT|lwbm)+HvXASeoAcOYGIIDP3cDhg-JI7TvNLDTkcrP> zAb`}QWmcAh%TL0TWhsq+fBEGfizkzklIWFJUXjp6z3pQ;2 at b$- at F>7ReBc;H&tmY< z(@_N+*}#?{F^3~lR2Fg=9)Ks{WwXgF#~7mF+-QsykTXe3c&fgkfkU-UJc$U=N*vDd zeB?2_3$gR$rcIN^$WagJaEantT*{>g9$m3=l`u9ss4=#YJ at 0XQm{DCE{$2 at Z{D!av z+fLVvMicGedW+n}2J%8#LLLt>cz7IMMMbc4#Qp5mSLcqU+c{5;967?d<KQrg6AvfZ zlcYq!`X7AofrtbQx;L@)!N>rKh9Mu+8EWfvEy0#RCZ|d2JftNe1SJR|3*mt<hv-2# zW1PLHurN%dk2^G+wY0?Gp}qaSs4lQBhK%_vF+o`96vPKSgejgA$4{tZVULWKAWp2- z=|dXC1E6NJi3$rBiBaKU00nT!OQaG~1lzW4+a#5Q$vNafmKe1~bv%6cZlid02aktk zGLF3gPn<u0UJL+H0n$Rpkbl|$0>|)nK|wx`hl{696E^7hxKGL$W<3B>Jj{R)IY@=A zEIbh6$Yqo#7{+3Wm;9ZRI*eAsV^#n~;YYZ+)e;3ypkv78Y-UTaaaGk>zOPW~_28f@ zJb0L@)z{TiHH#UD8+aQ70x4q*`U+piF;WK&`h3nw3!w>BvvcQ831gI}erG=!V@)#7 z#e5V(?d+K|GN*--gnYYl<*Fzzlofb!@Avmi`TUY4B_ceoU%xJ)2>?Y!MdHag-u&!Y zm&i&3d$@b<r6n3f2SOHXiQK{QMwXTsx5C5F(uur>cMzHgIXAO4q$NlUvzF6&7)C+s z at 9z^fhi9SHudsYYY0 at Mm8b}LMJcUeLcrJ1n?2UImDvxJHT5rDjW>|PAfdGwiIYMW) zZrv*40|r1OVBpZeH5Gb0Bte4$2%-I`2GYX-!mi56O;0@~(cxnc;~c6D?*PD*lw>yc zHTgTF!sE<r&T2gT&b#l at Q``XnbIWLHHGTg1=W>p427$o<Hr_)^Pn_|XsllrNiaHL# zf>{(zzG^d=kd=rmcol<|A>PA4 at Gy*l+%KMn6lV<>Vfy;(zoeiNpvF6)vXq(W5U~J| zU}1O?r2^K6N5A~?OYt`D1?fPFZeymMscqP>Ugo7C6H%4`5FQ3#JQwE}oLsnYL5vLJ zU_^!fA=08MJWikfH<t-B*^@%K)ZE-8(h_A!o3TVEa14-OY^W at F1Z6|h)l=qhf=#A& zyxuVxcLQ{PU#}1q#?jiqK^q!spIQ(Zm^McKMs-dL`2m40xynN00q+rN2xoLe^D;ae z3++6^x20)?2R{>F($mw}!`W=uL>XNnN?<I!4>^nm;c at EJDLK{vM}5Wv^>@wMHS*as ziSx9PLkVEP(%R>idLG0-`@Lr=dtvsh$_2*55FVHqL_Pu__L$>_hf$s&EnTi5mXa3v zea)IRvY(SlJj{4t_VMUHj*6GdST;5>!7N|}6e5;5CX6DHcn~8{S at 0@q at 8dM6v~%aq zbA%*tBxOqoLscPnF(-{ZN+0&v3JMl6VQqhGh4o*3c_=JgEa9VlJ%sQ;=z_5^i+S|u zQ3-8`4$K|b)Ks%j*(HXWs&#dDPnw9gSmLJrTnYnV0HWuCza>6?ZiNRz_QMbVD*MPz zqKrWDX&=<Ut_ZczhqR^P9G()e`fW%P9w4np866`d%@A`6SQ8$YpVCMO<K9GD;*1}} zzjcdRW<B_4;IsK4{%r*u)fJ|fFIS5}+6Noe#V<;D;fqyCrOm9?BHM-P^W=1Q(U{*u zeWRT;?g`N1tfhpB+9YclCC8@;Nord9>jDN?pMTunWr)#bwskjC)wwG9v8t+yyv&Hx z%_yKm+_-U*+6Ee^clbW_j at +jqkCU=W>>-d=C1Qz_3YraY;gi49(zFU{ZEvBs|Mn}g zWOI}liGs0wk2%z%JIdM63LF<-8z4GTJxY4NksS6sTD+i?iX7#%oaL*13jN&9X;*db z99_C}SyukEJ6l5wU4qJpwx}iLz#El6Sz3|zhTfoyhgX_vJHktnOa?QhS+gEmx8-v8 zlUMJev>e-{WlN!RCF1(SfKkV>tZCTELr#ZPo(Yh_iR-f_tkasfY-yl#l%v5<IjIF? zF<E6H!>zX3P{{J{3F&bHRC`WO<KV9WSf?&($<ADqvTVt^++_iOForv><C}D$<<yG0 z*h^6thp7v{)YV^#dOh?zMcn(<A~Ee5wlwSVIGb^&&+n&zKR`ZTaMV3GcGU0ow=3F0 zGd0N+wddNB?(lW>!o&Az{h4%KVe<ElIK53h4TD#85v%Ylydg<2Fg4D0-N$TNN>+l^ zQDQIfGx>Ga4K%xY+#_?yQ<Ad0VFqzPK&ha0YEBze1L)}gr=gVi2}=*>{{>(k at I2so n!1I9T0nY=T2mDR7{|GPua^x|HAy})700000NkvXXu0mjfB#b++ diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/vokal/BOOK-32px.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/vokal/BOOK-32px.png deleted file mode 100644 index c0aaad545f8be43e5010a2137f8cb92c51ce34b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 897 zcmV-{1AhF8P)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F80000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU#BS}O-RCwC#S4&S5Q562>;S_31ODM1a z+cA<9k~Ri(MMCS+1sfI;7rqwg%9R2e!H}pcNi;FWg;D;3KR^@YQDdSD0=h7QU;`A8 z;*^JN+L`g*JJVui+F&(645vN0GxwhMeD|DhZohK6u46xq$3EL30P*2?uTR(1E2^eK z%VeObDpbuJbJxT*dasdDWAkhzuCZ&~bg)q+uB(7b_@$}Fnoic(yq+H`5)d-+f#gOC zs|(*z;jv?3dIjDl4 at 0P|Y+)_74qufYoMr&viN`mVz*nXq+KeK`=QmO3 at EhCGIYhtB zAcY^OsI}*In@(m-07h~_5*Pqxi!-YjIR6;WhlcR9_ZeP~jIdyr*M(pp0F8Z+?3z?5 zlTnc-<J)&{@Z!TG)alK*dASQ7PZf at cA_PGIPkcSGj>)M>a2yBvqVHG3FVTLs9XFm_ zh5MLe8vr$z%Y^_*MlBo)F#x)m*veW?p2m2j1zp#!Lz1K&>u$FTp|&>gyip|zL{Sn5 z1_Rq1C`J%k1!O_wdZ)s1)B%5EBa3Mcp322XA`xTvBq7h!ku!EroNnk~J_W at Vvu&U) zu;Re)*4o;d#{q#<g6=-sf<Fdu=k7g9X_E`s24i|hM at L@#{lP&qDREMMo+PKtyWQVc z8i4-3TSY67PNy+9H<yd=>F&0yK*=pAL_&HX`5XPPm)rB=i;+<F`5?>ke?~&uf;}f; zeSIA|&vjbH7b0Oe94dGYluSY^D at 4MQE3liBa5p486Am9>J+K!iVaWjg_9T>jGA>=b zP&$BraS|SUP5A50=;#=tU!#ouZX!;+UN0slCJ^6T!P at 3BrkAI%mD<3<+85ZQ3N%zV zAr-UX<NSNXlqe*dz`n;RdT^rN4_{3~-t#|eR_nW><mR{sV?ALaN{6$ebahd|R)T0b zPdVbT1Uz1cr6_ee-K0GlW<SkCC3z)@hbZzpMCsCJ#o!RtfhLy(66>h8=S1l&6{T53 zl{F5Myo{;cTG`E1v6U%G9OdN4$XQi}WHL>XbFflw)yFFes$y1w!@p*S0QMWePXPu1 XMD=b^@6P1_00000NkvXXu0mjf(Ib;M diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/vokal/BOOK.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/vokal/BOOK.png deleted file mode 100644 index b6fe7ac72ed46f0125e4c6551c4e4569a4d26d2d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3825 zcmV<N4i52&P)<h;3K|Lk000e1NJLTq002Ay002A)1^@s6I{evk0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU=lSxEDRCwC#TUl&W*BSn2#-16E$77FI zJjN@=HrQqjn+XAez!1_<f`ZzTs8OXfO@(-C+J`*kEkae=q^(pnQj-cb4 at s&PMX3-3 zTEMI}5CZ|*7%v#__F#{fnXzZN{l9<ioebW<%{WRMAL;5YbA9jm{^k3>bMCQDQ55<v zH9dXD+C1QS!1I9T0sl|67 at bZ>u_m(y-f-xTFXSiK&AGu~kQCm6T(%S?bgZby!HDC~ zZwlY19*3_J-={=eQ`GyEh<g;d at 2fpcagM)Jk4e2A4DI;|L{t7<<aLESBffhV-mhz6 zd;y&X_7{ISu-2YoeNU&?m4`tEHE<Jvsn@>xO?l|Po>mumM}1^9+IdTg034)#cPGW# zf at DoL$+e+=FVRRG*-Xh~jESRkYc}<bbdcBY=5Fbz+to&%aW|#sC#uFGK at yzNP?HTA z3<TRooZcVA$Ww_dN$Cl1>kYc{_FGQ!`rNc2&n}%e#>G<W)qct-vXaRX`%rj{xqZ~# zGC-;E4obB+C<R-bgNk<-lQlk`jS!$fAY_=(77)<w9i4Qgp^7^D+vrCXKct0OS)|wN zNvG43!JwC8z1|So8$$b<ni?8(JE?21jXDQf=}y-z0hF3&3-`y>?WS18Ofe<{1x at 2} z4zPI{h1Bi2mlL02J_ZjP_}+}eCl7Wg+ at bWrGTLAHBK__Uzo#u*w$SaCTFOZ)BwK=w z1_lPi!;#)!zka>!L%;%|W9-%QsQ at F?1H8X_^(sB_#A+4b%zzEp)MM>Bu3fxziS(S7 zIzG<N%cuPOJo?RV-=U2a8)$TNlqxDJ$Y?aumY=RBdv*fFsJUyNnB3)M<+QB4oC+5$ zqT1`%Y5B5p>0}68APfM2W@<x2L#iPZvRdP#PC`#^+!!_j41!i#T1sVQWpw%S<;kR_ zhO}WeFKKFOitt*H9z1v;;e~y7cQ+YLCc1g!2CZJbni?A$1vIRjmX^kbTSj?#d6S+w zHa13`on5?jP<na>4G#~?wFL_n$o<L5$<bkHb+4PvAKkrsm(HF&OAd#FJRVQDQ?0G7 zR9sw4Y3b=4A!U at 1kRaCfcsRFWjnv!QOQ~t8Q$Dk<u8vw-S}8HnMz?O=BD2{nfbp)A zCr{Gy<;&&oy<RUZUAmMCIP$C(3yqDB)53)dDLy`aR)8Pbob0{NKKmz?m6uXwWhHIj zzFk6fWW+6dco+GMJa4;qPdsg6Pq($T$=|1 at riuYdii;$?C$<$URxsE^e%=VJTD6*d zJ|E at g=2ClmJ7s2O(l`SHU~DkPDK<h^SC{<l=FOXF*REaB1soR_C!V at _<0ifT=l98O zx65?^+^}JT?BQ*6(!?Fg$jA_Y at P^mxp`M;zKDSQ${My=Ds;;gPU@(-;W)lOz!#FP~ zDUo*qyoEhm$`Lf=8l;qzR550Cb+wRQ1(Q`&0HZzs{62EKM`_QVJ>+ycC4Z5dPUiyw z3Qu=-cGB_V$7%86#nRz>>}}*X^0%q!E_X16Qj$|9J-eWwfQ?fs&jkVDdDxG$r;*S1 zIZ^-^Y4gPwUr1>0f8hoC_~TE+*l4IKQS&fD_N}+x5>MmB2rGCL7Qc4wn&dG&F*rCV zKoQCS`7kk!(?=hDOh13^wMozK=;)yO`Uc6{{{DU`Cn#Hp6f`^^#05|9-o0DOl8^6A zVed9KH%mxsEFBfV5C?}3AEt&o4a~fEsUSa}jo_qQu6-+4t_(AFPEL*(M`|{o!_)98 zj!`4EIy|wV&M#TAgp!gHB{X4JfJJ>BXJBCaix)3)YV^>-g9j;@pK0cM7BP9 at 9kXTW zM>f3hPw%}a%#4>HbP=j`w{HupmXs{vP`gGhmrFW|-;jr^R;_xh=MN1JNjSH(G)p8v z<D((8Q2{D<?4aJhKH&s}`qwQ>k8D{?{Ra*l5Y~jZ5YF%<LK~exIm*q=5s+ at R4D~Qm z<M+P4UKSk*d~N2}0VvV{V26f=#c&`o at BmT-r4Y~Cw{M at 2)|>+FV4$Z at pQg2I*NSBG zxZNxZpAgbQ4k6r7D^Hv_A>O at n=T0b8*#OAxKK2g&7Hs^|OD|GPOzb4mLhcU_k8o)k zX7Q0O*V7p^IK#nQ@$}PAi-`F~JdB)Kw{9KXU<Cy$L(JD)xk42z?OIw|#2dK2jFl8X zKJ&~o;k=HGjg>tJZMxEQz4kiQ)z?e9fR*88ohowhT;wi at 3#0}E;6BuP5E<Ty(iBy| zXb9uVot5Msb<_U+`@>qggP9Y6;AxN*I#SL$911BrJDcv`zb{?~DQ$XkV|efo+19RG zOY2y;KzP7|*n_x0TFDF$*HCLwgJF!@%pFK`hz|gcx`)x=-DAg&32-!6KA%GoV=w?k zZN$rqIG+)cd-v`Y at qrw~9)vc;-m}JAr<9hbPW?-cpL^~(`t;LJB^BUNggU$npfDQ3 z-@#SGpw~&>qom<JREVenPT|lwbm)+HvXASeoAcOYGIIDP3cDhg-JI7TvNLDTkcrP> zAb`}QWmcAh%TL0TWhsq+fBEGfizkzklIWFJUXjp6z3pQ;2 at b$- at F>7ReBc;H&tmY< z(@_N+*}#?{F^3~lR2Fg=9)Ks{WwXgF#~7mF+-QsykTXe3c&fgkfkU-UJc$U=N*vDd zeB?2_3$gR$rcIN^$WagJaEantT*{>g9$m3=l`u9ss4=#YJ at 0XQm{DCE{$2 at Z{D!av z+fLVvMicGedW+n}2J%8#LLLt>cz7IMMMbc4#Qp5mSLcqU+c{5;967?d<KQrg6AvfZ zlcYq!`X7AofrtbQx;L@)!N>rKh9Mu+8EWfvEy0#RCZ|d2JftNe1SJR|3*mt<hv-2# zW1PLHurN%dk2^G+wY0?Gp}qaSs4lQBhK%_vF+o`96vPKSgejgA$4{tZVULWKAWp2- z=|dXC1E6NJi3$rBiBaKU00nT!OQaG~1lzW4+a#5Q$vNafmKe1~bv%6cZlid02aktk zGLF3gPn<u0UJL+H0n$Rpkbl|$0>|)nK|wx`hl{696E^7hxKGL$W<3B>Jj{R)IY@=A zEIbh6$Yqo#7{+3Wm;9ZRI*eAsV^#n~;YYZ+)e;3ypkv78Y-UTaaaGk>zOPW~_28f@ zJb0L@)z{TiHH#UD8+aQ70x4q*`U+piF;WK&`h3nw3!w>BvvcQ831gI}erG=!V@)#7 z#e5V(?d+K|GN*--gnYYl<*Fzzlofb!@Avmi`TUY4B_ceoU%xJ)2>?Y!MdHag-u&!Y zm&i&3d$@b<r6n3f2SOHXiQK{QMwXTsx5C5F(uur>cMzHgIXAO4q$NlUvzF6&7)C+s z at 9z^fhi9SHudsYYY0 at Mm8b}LMJcUeLcrJ1n?2UImDvxJHT5rDjW>|PAfdGwiIYMW) zZrv*40|r1OVBpZeH5Gb0Bte4$2%-I`2GYX-!mi56O;0@~(cxnc;~c6D?*PD*lw>yc zHTgTF!sE<r&T2gT&b#l at Q``XnbIWLHHGTg1=W>p427$o<Hr_)^Pn_|XsllrNiaHL# zf>{(zzG^d=kd=rmcol<|A>PA4 at Gy*l+%KMn6lV<>Vfy;(zoeiNpvF6)vXq(W5U~J| zU}1O?r2^K6N5A~?OYt`D1?fPFZeymMscqP>Ugo7C6H%4`5FQ3#JQwE}oLsnYL5vLJ zU_^!fA=08MJWikfH<t-B*^@%K)ZE-8(h_A!o3TVEa14-OY^W at F1Z6|h)l=qhf=#A& zyxuVxcLQ{PU#}1q#?jiqK^q!spIQ(Zm^McKMs-dL`2m40xynN00q+rN2xoLe^D;ae z3++6^x20)?2R{>F($mw}!`W=uL>XNnN?<I!4>^nm;c at EJDLK{vM}5Wv^>@wMHS*as ziSx9PLkVEP(%R>idLG0-`@Lr=dtvsh$_2*55FVHqL_Pu__L$>_hf$s&EnTi5mXa3v zea)IRvY(SlJj{4t_VMUHj*6GdST;5>!7N|}6e5;5CX6DHcn~8{S at 0@q at 8dM6v~%aq zbA%*tBxOqoLscPnF(-{ZN+0&v3JMl6VQqhGh4o*3c_=JgEa9VlJ%sQ;=z_5^i+S|u zQ3-8`4$K|b)Ks%j*(HXWs&#dDPnw9gSmLJrTnYnV0HWuCza>6?ZiNRz_QMbVD*MPz zqKrWDX&=<Ut_ZczhqR^P9G()e`fW%P9w4np866`d%@A`6SQ8$YpVCMO<K9GD;*1}} zzjcdRW<B_4;IsK4{%r*u)fJ|fFIS5}+6Noe#V<;D;fqyCrOm9?BHM-P^W=1Q(U{*u zeWRT;?g`N1tfhpB+9YclCC8@;Nord9>jDN?pMTunWr)#bwskjC)wwG9v8t+yyv&Hx z%_yKm+_-U*+6Ee^clbW_j at +jqkCU=W>>-d=C1Qz_3YraY;gi49(zFU{ZEvBs|Mn}g zWOI}liGs0wk2%z%JIdM63LF<-8z4GTJxY4NksS6sTD+i?iX7#%oaL*13jN&9X;*db z99_C}SyukEJ6l5wU4qJpwx}iLz#El6Sz3|zhTfoyhgX_vJHktnOa?QhS+gEmx8-v8 zlUMJev>e-{WlN!RCF1(SfKkV>tZCTELr#ZPo(Yh_iR-f_tkasfY-yl#l%v5<IjIF? zF<E6H!>zX3P{{J{3F&bHRC`WO<KV9WSf?&($<ADqvTVt^++_iOForv><C}D$<<yG0 z*h^6thp7v{)YV^#dOh?zMcn(<A~Ee5wlwSVIGb^&&+n&zKR`ZTaMV3GcGU0ow=3F0 zGd0N+wddNB?(lW>!o&Az{h4%KVe<ElIK53h4TD#85v%Ylydg<2Fg4D0-N$TNN>+l^ zQDQIfGx>Ga4K%xY+#_?yQ<Ad0VFqzPK&ha0YEBze1L)}gr=gVi2}=*>{{>(k at I2so n!1I9T0nY=T2mDR7{|GPua^x|HAy})700000NkvXXu0mjfB#b++ -- 1.7.3 From nengard at bywatersolutions.com Wed Sep 28 15:43:50 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Wed, 28 Sep 2011 09:43:50 -0400 Subject: [Koha-patches] [PATCH] bug 6716 - document items table Message-ID: <1317217430-11519-1-git-send-email-nengard@bywatersolutions.com> This patch documents the items table. Some fields were left undocumented because I was unsure of what data was stored there: stack paidfor permanent_location stocknumber --- installer/data/mysql/kohastructure.sql | 72 ++++++++++++++++---------------- 1 files changed, 36 insertions(+), 36 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3a51df5..3263b96 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -996,45 +996,45 @@ CREATE TABLE `issuingrules` ( -- DROP TABLE IF EXISTS `items`; -CREATE TABLE `items` ( - `itemnumber` int(11) NOT NULL auto_increment, - `biblionumber` int(11) NOT NULL default 0, - `biblioitemnumber` int(11) NOT NULL default 0, - `barcode` varchar(20) default NULL, - `dateaccessioned` date default NULL, - `booksellerid` mediumtext default NULL, - `homebranch` varchar(10) default NULL, - `price` decimal(8,2) default NULL, - `replacementprice` decimal(8,2) default NULL, - `replacementpricedate` date default NULL, - `datelastborrowed` date default NULL, - `datelastseen` date default NULL, +CREATE TABLE `items` ( -- holdings/item information + `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha + `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record + `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information + `barcode` varchar(20) default NULL, -- item barcode (952$p) + `dateaccessioned` date default NULL, -- date the item was acquired or added to Koha (952$d) + `booksellerid` mediumtext default NULL, -- where the item was purchased (952$e) + `homebranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this item (952$a) + `price` decimal(8,2) default NULL, -- purchase price (952$g) + `replacementprice` decimal(8,2) default NULL, -- cost the library charges to replace the item if it has been marked lost (952$v) + `replacementpricedate` date default NULL, -- the date the price is effective from (952$w) + `datelastborrowed` date default NULL, -- the date the item was last checked out + `datelastseen` date default NULL, -- the date the item was last see (usually the last time the barcode was scanned or inventory was done) `stack` tinyint(1) default NULL, - `notforloan` tinyint(1) NOT NULL default 0, - `damaged` tinyint(1) NOT NULL default 0, - `itemlost` tinyint(1) NOT NULL default 0, - `wthdrawn` tinyint(1) NOT NULL default 0, - `itemcallnumber` varchar(255) default NULL, - `issues` smallint(6) default NULL, - `renewals` smallint(6) default NULL, - `reserves` smallint(6) default NULL, - `restricted` tinyint(1) default NULL, - `itemnotes` mediumtext, - `holdingbranch` varchar(10) default NULL, + `notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (952$7) + `damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (952$4) + `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (952$1) + `wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (952$0) + `itemcallnumber` varchar(255) default NULL, -- call number for this item (952$o) + `issues` smallint(6) default NULL, -- number of times this item has been checked out + `renewals` smallint(6) default NULL, -- number of times this item has been renewed + `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved + `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (952$5) + `itemnotes` mediumtext, -- public notes on this item (952$x) + `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (952$b) `paidfor` mediumtext, - `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `location` varchar(80) default NULL, + `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered + `location` varchar(80) default NULL, -- authorized value for the shelving location for this item (952$c) `permanent_location` varchar(80) default NULL, - `onloan` date default NULL, - `cn_source` varchar(10) default NULL, - `cn_sort` varchar(30) default NULL, - `ccode` varchar(10) default NULL, - `materials` varchar(10) default NULL, - `uri` varchar(255) default NULL, - `itype` varchar(10) default NULL, - `more_subfields_xml` longtext default NULL, - `enumchron` text default NULL, - `copynumber` varchar(32) default NULL, + `onloan` date default NULL, -- defines if this item is currently checked out (1 for yes, 0 for no) + `cn_source` varchar(10) default NULL, -- classification source used on this item (952$2) + `cn_sort` varchar(30) default NULL, -- normalized form of the call number (952$o) used for sorting + `ccode` varchar(10) default NULL, -- authorized value for the collection code associated with this item (952$8) + `materials` varchar(10) default NULL, -- materials specified (952$3) + `uri` varchar(255) default NULL, -- URL for the item (952$u) + `itype` varchar(10) default NULL, -- foreign key from the itemtypes table defining the type for this item (952$y) + `more_subfields_xml` longtext default NULL, -- additional 952 subfields in XML format + `enumchron` text default NULL, -- serial enumeration/chronology for the item (952$h) + `copynumber` varchar(32) default NULL, -- copy number (952$t) `stocknumber` varchar(32) default NULL, PRIMARY KEY (`itemnumber`), UNIQUE KEY `itembarcodeidx` (`barcode`), -- 1.7.2.3 From nengard at gmail.com Fri Sep 30 20:32:58 2011 From: nengard at gmail.com (Nicole Engard) Date: Fri, 30 Sep 2011 14:32:58 -0400 Subject: [Koha-patches] [PATCH] Bug 6716 - document the items table In-Reply-To: <1317214984-11282-1-git-send-email-nengard@bywatersolutions.com> References: <1317214984-11282-1-git-send-email-nengard@bywatersolutions.com> Message-ID: <CAC0K6VEEZs8cy+ak9x69QRbL=frhuEt3eJpSEnFaO0CAxB_UrQ@mail.gmail.com> oops - ignore this too On Wed, Sep 28, 2011 at 9:03 AM, Nicole C. Engard <nengard at bywatersolutions.com> wrote: > This patch documents the items table. Some fields were left > undocumented because I was unsure of what data was stored there: > > stack > paidfor > permanent_location > stocknumber > --- > ?installer/data/mysql/kohastructure.sql | ? 70 ++++++++++++++++---------------- > ?1 files changed, 35 insertions(+), 35 deletions(-) > > diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql > index 3a51df5..337d555 100644 > --- a/installer/data/mysql/kohastructure.sql > +++ b/installer/data/mysql/kohastructure.sql > @@ -996,45 +996,45 @@ CREATE TABLE `issuingrules` ( > ?-- > > ?DROP TABLE IF EXISTS `items`; > -CREATE TABLE `items` ( > - ?`itemnumber` int(11) NOT NULL auto_increment, > - ?`biblionumber` int(11) NOT NULL default 0, > - ?`biblioitemnumber` int(11) NOT NULL default 0, > - ?`barcode` varchar(20) default NULL, > - ?`dateaccessioned` date default NULL, > - ?`booksellerid` mediumtext default NULL, > - ?`homebranch` varchar(10) default NULL, > - ?`price` decimal(8,2) default NULL, > - ?`replacementprice` decimal(8,2) default NULL, > - ?`replacementpricedate` date default NULL, > - ?`datelastborrowed` date default NULL, > - ?`datelastseen` date default NULL, > +CREATE TABLE `items` ( -- holdings/item information > + ?`itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha > + ?`biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record > + ?`biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information > + ?`barcode` varchar(20) default NULL, -- item barcode (952$p) > + ?`dateaccessioned` date default NULL, -- date the item was acquired or added to Koha (952$d) > + ?`booksellerid` mediumtext default NULL, -- where the item was purchased (952$e) > + ?`homebranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this item (952$a) > + ?`price` decimal(8,2) default NULL, -- purchase price (952$g) > + ?`replacementprice` decimal(8,2) default NULL, -- cost the library charges to replace the item if it has been marked lost (952$v) > + ?`replacementpricedate` date default NULL, -- the date the price is effective from (952$w) > + ?`datelastborrowed` date default NULL, -- the date the item was last checked out > + ?`datelastseen` date default NULL, -- the date the item was last see (usually the last time the barcode was scanned or inventory was done) > ? `stack` tinyint(1) default NULL, > - ?`notforloan` tinyint(1) NOT NULL default 0, > - ?`damaged` tinyint(1) NOT NULL default 0, > - ?`itemlost` tinyint(1) NOT NULL default 0, > - ?`wthdrawn` tinyint(1) NOT NULL default 0, > - ?`itemcallnumber` varchar(255) default NULL, > - ?`issues` smallint(6) default NULL, > - ?`renewals` smallint(6) default NULL, > - ?`reserves` smallint(6) default NULL, > - ?`restricted` tinyint(1) default NULL, > - ?`itemnotes` mediumtext, > - ?`holdingbranch` varchar(10) default NULL, > + ?`notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (952$7) > + ?`damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (952$4) > + ?`itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (952$1) > + ?`wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (952$0) > + ?`itemcallnumber` varchar(255) default NULL, -- call number for this item (952$o) > + ?`issues` smallint(6) default NULL, -- number of times this item has been checked out > + ?`renewals` smallint(6) default NULL, -- number of times this item has been renewed > + ?`reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved > + ?`restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (952$5) > + ?`itemnotes` mediumtext, -- public notes on this item (952$x) > + ?`holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (952$b) > ? `paidfor` mediumtext, > - ?`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, > - ?`location` varchar(80) default NULL, > + ?`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered > + ?`location` varchar(80) default NULL, -- authorized value for the shelving location for this item (952$c) > ? `permanent_location` varchar(80) default NULL, > - ?`onloan` date default NULL, > - ?`cn_source` varchar(10) default NULL, > + ?`onloan` date default NULL, -- defines if this item is currently checked out (1 for yes, 0 for no) > + ?`cn_source` varchar(10) default NULL, -- classification source used on this item (952$2) > ? `cn_sort` varchar(30) default NULL, > - ?`ccode` varchar(10) default NULL, > - ?`materials` varchar(10) default NULL, > - ?`uri` varchar(255) default NULL, > - ?`itype` varchar(10) default NULL, > - ?`more_subfields_xml` longtext default NULL, > - ?`enumchron` text default NULL, > - ?`copynumber` varchar(32) default NULL, > + ?`ccode` varchar(10) default NULL, -- authorized value for the collection code associated with this item (952$8) > + ?`materials` varchar(10) default NULL, -- materials specified (952$3) > + ?`uri` varchar(255) default NULL, -- URL for the item (952$u) > + ?`itype` varchar(10) default NULL, -- foreign key from the itemtypes table defining the type for this item (952$y) > + ?`more_subfields_xml` longtext default NULL, -- additional 952 subfields in XML format > + ?`enumchron` text default NULL, -- serial enumeration/chronology for the item (952$h) > + ?`copynumber` varchar(32) default NULL, -- copy number (952$t) > ? `stocknumber` varchar(32) default NULL, > ? PRIMARY KEY ?(`itemnumber`), > ? UNIQUE KEY `itembarcodeidx` (`barcode`), > -- > 1.7.2.3 > > _______________________________________________ > Koha-patches mailing list > Koha-patches at lists.koha-community.org > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > website : http://www.koha-community.org/ > git : http://git.koha-community.org/ > bugs : http://bugs.koha-community.org/ > From oleonard at myacpl.org Fri Sep 30 20:40:02 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 30 Sep 2011 14:40:02 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 6840 warning in logs Message-ID: <1317408002-19024-1-git-send-email-oleonard@myacpl.org> From: Paul Poulain <paul.poulain at biblibre.com> In staff interface, in search (catalogue/search.pl), there is a warning saying: [Fri Sep 2 18:20:24 2011] search.pl: Use of uninitialized value $key in hash element at /home/paul/koha.dev/koha-community/C4/Templates.pm line 227. The problem happens when searching from the quick search toolbar, not when you search from advanced search. Investigating, it seems it's because the sort_by is not defined in this case. This patch * fixes the problem in Search.pl by setting the parameter only if there is a sort_by field * modify te Template->param sub to get a better error message. Instead of having just "use of uninitia..." get the value you try to set to an empty key. Much easier to understand which line causes the problem Signed-off-by: Owen Leonard <oleonard at myacpl.org> --- C4/Templates.pm | 6 +++++- catalogue/search.pl | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/C4/Templates.pm b/C4/Templates.pm index c3a9850..c2a5911 100644 --- a/C4/Templates.pm +++ b/C4/Templates.pm @@ -179,7 +179,11 @@ sub param { my $val = shift; if ( ref($val) eq 'ARRAY' && !scalar @$val ) { $val = undef; } elsif ( ref($val) eq 'HASH' && !scalar %$val ) { $val = undef; } - $self->{VARS}->{$key} = $val; + if ( $key ) { + $self->{VARS}->{$key} = $val; + } else { + warn "Problem = a value of $val has been passed to param without key"; + } } } diff --git a/catalogue/search.pl b/catalogue/search.pl index 97fa3d7..907efdb 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -369,7 +369,7 @@ if ( C4::Context->preference('defaultSortField') @sort_by = split("\0",$params->{'sort_by'}) if $params->{'sort_by'}; $sort_by[0] = $default_sort_by unless $sort_by[0]; foreach my $sort (@sort_by) { - $template->param($sort => 1); + $template->param($sort => 1) if $sort; } $template->param('sort_by' => $sort_by[0]); -- 1.7.3