From paul.poulain at biblibre.com Tue Mar 1 11:42:50 2011 From: paul.poulain at biblibre.com (paul.poulain at biblibre.com) Date: Tue, 1 Mar 2011 11:42:50 +0100 Subject: [Koha-patches] [PATCH] BZ3624, proposed patch for kohastructure.sql rewritten Message-ID: <1298976170-23151-1-git-send-email-paul.poulain@biblibre.com> From: Paul Poulain --- installer/data/mysql/kohastructure.sql | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index e7ad97f..84cd31b 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2352,6 +2352,9 @@ CREATE TABLE `aqbasketgroups` ( `name` varchar(50) default NULL, `closed` tinyint(1) default NULL, `booksellerid` int(11) NOT NULL, + `deliveryplace` varchar(10) default NULL, + `deliverycomment` varchar(255) default NULL, + `billingplace` varchar(10) default NULL, PRIMARY KEY (`id`), KEY `booksellerid` (`booksellerid`), CONSTRAINT `aqbasketgroups_ibfk_1` FOREIGN KEY (`booksellerid`) REFERENCES `aqbooksellers` (`id`) ON UPDATE CASCADE ON DELETE CASCADE -- 1.7.1 From paul.poulain at biblibre.com Tue Mar 1 14:01:32 2011 From: paul.poulain at biblibre.com (paul.poulain at biblibre.com) Date: Tue, 1 Mar 2011 14:01:32 +0100 Subject: [Koha-patches] [PATCH] Fix for Bug 4290 - search for author in repository Message-ID: <1298984492-25483-1-git-send-email-paul.poulain@biblibre.com> From: Owen Leonard Reimplementation of Nahuel's patch from 2010-03-02 Signed-off-by: Paul Poulain --- C4/Breeding.pm | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/C4/Breeding.pm b/C4/Breeding.pm index 2b73729..9003f9a 100644 --- a/C4/Breeding.pm +++ b/C4/Breeding.pm @@ -169,7 +169,7 @@ C tables of the Koha database. =cut sub BreedingSearch { - my ($title,$isbn,$z3950random) = @_; + my ($search,$isbn,$z3950random) = @_; my $dbh = C4::Context->dbh; my $count = 0; my ($query, at bind); @@ -185,12 +185,13 @@ sub BreedingSearch { $query .= "z3950random = ?"; @bind=($z3950random); } else { + $search =~ s/(\s+)/\%/g; @bind=(); - if ($title) { - $query .= "title like ?"; - push(@bind,"$title%"); + if ($search) { + $query .= "title like ? OR author like ?"; + push(@bind,"%$search%", "%$search%"); } - if ($title && $isbn) { + if ($search && $isbn) { $query .= " and "; } if ($isbn) { -- 1.7.1 From tomascohen at gmail.com Tue Mar 1 15:12:51 2011 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Tue, 1 Mar 2011 11:12:51 -0300 Subject: [Koha-patches] [PATCH] [Bug 5546] Javascript driven ability to hide MARC documentation links In-Reply-To: <> References: <> Message-ID: <1298988771-7638-1-git-send-email-tomascohen@gmail.com> --- cataloguing/addbiblio.pl | 3 + .../prog/en/includes/doc-head-close.inc | 1 + .../en/lib/jquery/plugins/jquery.cookie.min.js | 1 + .../prog/en/modules/cataloguing/addbiblio.tmpl | 59 ++++++++++++++++++- 4 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.min.js diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index da58166..b1f63dd 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -1023,10 +1023,13 @@ $template->param( title => $record->title() ) if ( $record ne "-1" ); if (C4::Context->preference("marcflavour") eq "MARC21"){ $template->param(MARC21 => 1); } + + $template->param( popup => $mode, frameworkcode => $frameworkcode, itemtype => $frameworkcode, + borrowernumber => $loggedinuser ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc index 42f9df2..39be321 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc @@ -30,6 +30,7 @@ + diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.min.js new file mode 100644 index 0000000..9f554ba --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.min.js @@ -0,0 +1 @@ +jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h ul').tabs().bind('show.ui-tabs', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); }); + /* check cookie to hide/show marcdocs*/ + if($.cookie("marcdocs_") == 'false'){ + hideMARCdocLinks(); + $("#marcDocsSelect").attr('checked',false); + } else { + /* reset cookie expire date */ + $.cookie("marcdocs_",'true', + { path: "/", expires: 365 }); + } + + }); + + $('#header_search > ul').tabs().bind('show.ui-tabs', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); }); + function confirmnotdup(redirect){ $("#confirm_not_duplicate").attr("value","1"); @@ -101,6 +112,45 @@ function _UNIMARCFieldDoc(field, blocknumber) { } } +/* + * Functions to load/unload css from the head element + */ +function loadCSS(id,cssDef) { + + var cssElem=document.createElement("style"); + cssElem.setAttribute("type", "text/css"); + cssElem.setAttribute("id", id); + cssElem.innerHTML = cssDef; + + document.getElementsByTagName("head")[0].appendChild(cssElem); +} + +function unloadCSS(id) { + var elem = document.getElementById(id); + elem.parentNode.removeChild(elem); +} + +/* + * Functions to hide/show marc docs links + */ +function hideMARCdocLinks() { + loadCSS("marcDocsCSS",".marcdocs{display: none;}"); + $.cookie("marcdocs_",'false', { path: "/", expires: 365 }); +} + +function showMARCdocLinks() { + unloadCSS("marcDocsCSS"); + $.cookie("marcdocs_",'true', { path: "/", expires: 365 }); +} + +function toggleMARCDocs(checked) { + if (checked) { + showMARCdocLinks(); + } else { + hideMARCdocLinks(); + } +} + /** * check if mandatory subfields are written */ @@ -641,6 +691,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?

Editing (Record Number )

Add MARC Record +
Show MARC tag documentation links
@@ -786,7 +837,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? - Click to Expand this Tag" onclick="ExpandField('tag__'); return false;"> - ">">', ); return false;"> ? -- 1.7.1 From gmcharlt at gmail.com Tue Mar 1 17:33:10 2011 From: gmcharlt at gmail.com (Galen Charlton) Date: Tue, 1 Mar 2011 11:33:10 -0500 Subject: [Koha-patches] [PATCH] Revert "Bug 5734 (MT3625) Fix column order in issue history" Message-ID: <1298997190-21554-1-git-send-email-gmcharlt@gmail.com> This reverts commit adb1aefaf346456d2c5c559c85391e0c129d6aaa, which added a duplicated checkout date column. Signed-off-by: Galen Charlton --- .../prog/en/modules/catalogue/issuehistory.tmpl | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tmpl index 5156341..13b0e07 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tmpl @@ -57,11 +57,6 @@   - - - -   - -- 1.7.2.3 From ian.walls at bywatersolutions.com Tue Mar 1 23:01:01 2011 From: ian.walls at bywatersolutions.com (Ian Walls) Date: Tue, 1 Mar 2011 17:01:01 -0500 Subject: [Koha-patches] [PATCH] [SIGNED OFF] Bug 5595: (MT #5757)adding additional attributes support on patrons's search Message-ID: <1299016861-17608-1-git-send-email-ian.walls@bywatersolutions.com> From: St?phane Delaune Restores ability to search on extended borrower attributes that are configured to be searchable Signed-off-by: Ian Walls --- C4/Members.pm | 38 +++++++++++++++++++++++--------------- C4/Members/Attributes.pm | 10 +++++----- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index fafc99b..3a4899c 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -278,22 +278,30 @@ C<&searchtype> is a string telling the type of search you want todo : start_with =cut sub Search { - my ($filter,$orderby, $limit, $columns_out, $search_on_fields,$searchtype) = @_; - my @filters; - if (ref($filter) eq "ARRAY"){ - push @filters,@$filter; - } - else { - push @filters,$filter; - } - if (C4::Context->preference('ExtendedPatronAttributes')) { - my $matching_records = C4::Members::Attributes::SearchIdMatchingAttribute($filter); - push @filters,@$matching_records; - } - $searchtype||="start_with"; - my $data=SearchInTable("borrowers",\@filters,$orderby,$limit,$columns_out,$search_on_fields,$searchtype); - - return ( $data ); + 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; + } + if ( C4::Context->preference('ExtendedPatronAttributes') ) { + my $matching_records = C4::Members::Attributes::SearchIdMatchingAttribute($filter); + if(scalar(@$matching_records)>0) { + foreach my $matching_record (@$matching_records) { + $filtersmatching_record{$$matching_record[0]}=1; + } + foreach my $k (keys(%filtersmatching_record)) { + push @filters, {"borrowernumber"=>$k}; + } + } + } + $searchtype ||= "start_with"; + push @finalfilter, \@filters; + my $data = SearchInTable( "borrowers", \@finalfilter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype ); + return ($data); } =head2 GetMemberDetails diff --git a/C4/Members/Attributes.pm b/C4/Members/Attributes.pm index 70c34b4..b89b03a 100644 --- a/C4/Members/Attributes.pm +++ b/C4/Members/Attributes.pm @@ -102,17 +102,17 @@ sub GetBorrowerAttributes { sub SearchIdMatchingAttribute{ my $filter = shift; - - my $dbh = C4::Context->dbh(); + my $finalfilter=$$filter[0]; + my $dbh = C4::Context->dbh(); my $query = qq{ SELECT borrowernumber FROM borrower_attributes JOIN borrower_attribute_types USING (code) WHERE staff_searchable = 1 -AND attribute like ?}; +AND attribute like "%$finalfilter%"}; my $sth = $dbh->prepare_cached($query); - $sth->execute($filter); - return $sth->fetchall_arrayref; + $sth->execute(); + return $sth->fetchall_arrayref; } =head2 CheckUniqueness -- 1.5.6.5 From januszop at gmail.com Tue Mar 1 23:32:08 2011 From: januszop at gmail.com (Janusz Kaczmarek) Date: Tue, 1 Mar 2011 23:32:08 +0100 Subject: [Koha-patches] [PATCH] Bug 5819 - No toolbar in record view when quotes present in title Message-ID: <1299018728-27468-1-git-send-email-januszop@gmail.com> --- C4/Search.pm | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 3fff695..ff07c91 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -2497,8 +2497,10 @@ sub z3950_search_args { my $array = []; for my $field (qw/ lccn isbn issn title author dewey subject /) { - my $encvalue = URI::Escape::uri_escape_utf8($bibrec->{$field}); - push @$array, { name=>$field, value=>$bibrec->{$field}, encvalue=>$encvalue } if defined $bibrec->{$field}; + my $val = $bibrec->{$field}; + $val =~ s/["']/\$1/g; + my $encvalue = URI::Escape::uri_escape_utf8($val); + push @$array, { name=>$field, value=>$val, encvalue=>$encvalue } if defined $bibrec->{$field}; } return $array; } -- 1.7.2.3 From paul.poulain at biblibre.com Tue Mar 1 23:37:29 2011 From: paul.poulain at biblibre.com (Paul Poulain) Date: Tue, 01 Mar 2011 23:37:29 +0100 Subject: [Koha-patches] [PATCH] Bug 5819 - No toolbar in record view when quotes present in title In-Reply-To: <1299018728-27468-1-git-send-email-januszop@gmail.com> References: <1299018728-27468-1-git-send-email-januszop@gmail.com> Message-ID: <4D6D7529.9070303@biblibre.com> Le 01/03/2011 23:32, Janusz Kaczmarek a ?crit : > --- > C4/Search.pm | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) I fixed something like this yesterday (patch not submitted yet) : a TMPL_VAR name="title" ESCAPE="HTML" in the template solves the problem better than this code. -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc Tel : (33) 4 91 81 35 08 From januszop at gmail.com Wed Mar 2 00:07:53 2011 From: januszop at gmail.com (Janusz Kaczmarek) Date: Wed, 2 Mar 2011 00:07:53 +0100 Subject: [Koha-patches] [PATCH] Bug 5819 - No toolbar in record view when quotes present in title - fix Message-ID: <1299020873-28251-1-git-send-email-januszop@gmail.com> >> --- >> C4/Search.pm | 6 ++++-- >> 1 files changed, 4 insertions(+), 2 deletions(-) >I fixed something like this yesterday (patch not submitted yet) : a >TMPL_VAR name="title" ESCAPE="HTML" in the template solves the problem >better than this code. > >-- >Paul POULAIN >http://www.biblibre.com >Expert en Logiciels Libres pour l'info-doc >Tel : (33) 4 91 81 35 08 Something like this perpaps? Would be more general than just a title... Janusz Kaczmarek --- .../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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 8d4e02e..1c5b20f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -15,7 +15,7 @@ function GetZ3950Terms(){ var strQuery="&frameworkcode="; - strQuery += "&" + "" + "=" + ""; + strQuery += "&" + "" + "=" + ""; return strQuery; } -- 1.7.2.3 From paul.poulain at biblibre.com Wed Mar 2 06:22:07 2011 From: paul.poulain at biblibre.com (Paul Poulain) Date: Wed, 02 Mar 2011 06:22:07 +0100 Subject: [Koha-patches] [PATCH] Bug 5819 - No toolbar in record view when quotes present in title - fix In-Reply-To: <1299020873-28251-1-git-send-email-januszop@gmail.com> References: <1299020873-28251-1-git-send-email-januszop@gmail.com> Message-ID: <4D6DD3FF.4040101@biblibre.com> Le 02/03/2011 00:07, Janusz Kaczmarek a ?crit : >> > Something like this perpaps? Would be more general than just a title... > + strQuery += "&" + "" + "=" + ""; Yes, something like that (except it's better with "" = ESCAPE="HTML") The problem also happend in : * merge biblios * catalogue/detail.pl HTH -- Paul POULAIN http://www.biblibre.com Expert en Logiciels Libres pour l'info-doc Tel : (33) 4 91 81 35 08 From paul.poulain at biblibre.com Tue Mar 1 21:19:16 2011 From: paul.poulain at biblibre.com (paul.poulain at biblibre.com) Date: Tue, 1 Mar 2011 21:19:16 +0100 Subject: [Koha-patches] [PATCH] Fix for Bug 4853 - Rights needed to renew a document Message-ID: <1299010756-421-1-git-send-email-paul.poulain@biblibre.com> From: Owen Leonard Correcting check for circulation permission. Also updating updateitem.pl (for setting lost and damaged statuses) with circulate permissions. Signed-off-by: Paul Poulain --- catalogue/updateitem.pl | 2 +- reserve/renewscript.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl index 01a1605..e8ce20d 100755 --- a/catalogue/updateitem.pl +++ b/catalogue/updateitem.pl @@ -31,7 +31,7 @@ use C4::Reserves; my $cgi= new CGI; -my ($loggedinuser, $cookie, $sessionID) = checkauth($cgi, 0, {circulate => 1}, 'intranet'); +my ($loggedinuser, $cookie, $sessionID) = checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet'); my $biblionumber=$cgi->param('biblionumber'); my $itemnumber=$cgi->param('itemnumber'); diff --git a/reserve/renewscript.pl b/reserve/renewscript.pl index ad746c9..f4c7fb4 100755 --- a/reserve/renewscript.pl +++ b/reserve/renewscript.pl @@ -39,7 +39,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { circulate => 1 }, + flagsrequired => { circulate => 'circulate_remaining_permissions' }, debug => 0, } ); -- 1.7.1 From paul.poulain at biblibre.com Tue Mar 1 22:59:24 2011 From: paul.poulain at biblibre.com (paul.poulain at biblibre.com) Date: Tue, 1 Mar 2011 22:59:24 +0100 Subject: [Koha-patches] [PATCH] BZ5724 follow-up missing arg to sth->execute Message-ID: <1299016764-3634-1-git-send-email-paul.poulain@biblibre.com> From: Paul Poulain (thx to Fridolyn) --- misc/migration_tools/rebuild_zebra.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index 2bdcaa4..f125e73 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/misc/migration_tools/rebuild_zebra.pl @@ -420,7 +420,7 @@ sub get_raw_marc_record { if ($noxml) { my $fetch_sth = $dbh->prepare_cached("SELECT marc FROM biblioitems WHERE biblionumber = ? UNION SELECT marc from deletedbiblioitems where biblionumber=?"); - $fetch_sth->execute($record_number); + $fetch_sth->execute($record_number,$record_number); if (my ($blob) = $fetch_sth->fetchrow_array) { $marc = MARC::Record->new_from_usmarc($blob); $fetch_sth->finish(); -- 1.7.1 From paul.poulain at biblibre.com Tue Mar 1 22:08:06 2011 From: paul.poulain at biblibre.com (paul.poulain at biblibre.com) Date: Tue, 1 Mar 2011 22:08:06 +0100 Subject: [Koha-patches] [PATCH] BZ5432 follow-up, removing test string Message-ID: <1299013686-1864-1-git-send-email-paul.poulain@biblibre.com> From: Paul Poulain --- .../prog/en/modules/members/memberentrygen.tmpl | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl index 67ac528..6cee5b2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl @@ -73,7 +73,6 @@ "> DuplicateModify patron Organization patron Adult patron Child patron Professional patron Staff patron -tast
-- 1.7.1 From paul.poulain at biblibre.com Tue Mar 1 21:55:38 2011 From: paul.poulain at biblibre.com (paul.poulain at biblibre.com) Date: Tue, 1 Mar 2011 21:55:38 +0100 Subject: [Koha-patches] [PATCH] (bug #5157) fix borrowers top issues Message-ID: <1299012938-1454-1-git-send-email-paul.poulain@biblibre.com> From: Nahuel ANGELINETTI this fix filters of borrowers top issues that doesn't work really well... perhaps because reports scripts need too much improvment. Signed-off-by: Paul Poulain --- .../prog/en/modules/reports/bor_issues_top.tmpl | 14 +-------- reports/bor_issues_top.pl | 33 +++----------------- 2 files changed, 6 insertions(+), 41 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tmpl index b20a2f7..9fd5fcd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tmpl @@ -204,19 +204,6 @@ function Dopop(link) { -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • - @@ -227,6 +214,7 @@ function Dopop(link) { + - Budget: + Fund: " /> - + + @@ -172,7 +173,11 @@ "> - + + " title="Display detail for this authority">auth + + + -- 1.7.2.3 From gmcharlt at gmail.com Thu Mar 3 22:49:32 2011 From: gmcharlt at gmail.com (Galen Charlton) Date: Thu, 3 Mar 2011 16:49:32 -0500 Subject: [Koha-patches] [PATCH 3/3] [SIGNED-OFF] bug 5783: follow-up system preferences tweaks In-Reply-To: <1299188972-5677-2-git-send-email-gmcharlt@gmail.com> References: <1299188972-5677-1-git-send-email-gmcharlt@gmail.com> <1299188972-5677-2-git-send-email-gmcharlt@gmail.com> Message-ID: <1299188972-5677-3-git-send-email-gmcharlt@gmail.com> * add the AuthoritiesLog system preference to all language installer SQL scripts * options for a 'YesNo' should be '', not '0' * fix wording glitch on preferences page Signed-off-by: Galen Charlton --- installer/data/mysql/de-DE/mandatory/sysprefs.sql | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 2 +- .../1-Obligatoire/unimarc_standard_systemprefs.sql | 3 ++- installer/data/mysql/it-IT/necessari/sysprefs.sql | 3 ++- installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 3 ++- ...m_preferences_full_optimal_for_install_only.sql | 3 ++- ...m_preferences_full_optimal_for_install_only.sql | 3 ++- installer/data/mysql/updatedatabase.pl | 6 +++--- .../prog/en/modules/admin/preferences/logs.pref | 2 +- 9 files changed, 16 insertions(+), 10 deletions(-) diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index 02511d8..f491d89 100644 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -285,3 +285,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 674326d..2ce18c0 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -285,4 +285,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','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 757f255..c311f90 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -286,4 +286,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql index 79c469c..1298ab2 100644 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -271,4 +271,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index 8689c4c..cce2755 100644 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -283,4 +283,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','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 c862e60..5a07b61 100644 --- 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 @@ -338,4 +338,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','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 82e285b..23633e9 100644 --- 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 @@ -363,4 +363,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 25f7707..d529ded 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4016,9 +4016,9 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = 'XXX'; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','0','YesNo');"); - print "Upgrade to $DBversion done (Add AuthoritiesLog syspref)\n"; - SetVersion ($DBversion); + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo');"); + print "Upgrade to $DBversion done (Add AuthoritiesLog syspref)\n"; + SetVersion ($DBversion); } =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref index ade8a13..67cb299 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref @@ -22,7 +22,7 @@ Logging: choices: on: Log off: "Don't log" - - changes to authorities records. + - changes to authority records. - - pref: FinesLog choices: -- 1.7.2.3 From gmcharlt at gmail.com Thu Mar 3 22:54:01 2011 From: gmcharlt at gmail.com (Galen Charlton) Date: Thu, 3 Mar 2011 16:54:01 -0500 Subject: [Koha-patches] [PATCH 2/3] [SIGNED-OFF] bug 5783: follow-up - fix logging of modifications In-Reply-To: <1299189242-6009-1-git-send-email-gmcharlt@gmail.com> References: <1299189242-6009-1-git-send-email-gmcharlt@gmail.com> Message-ID: <1299189242-6009-2-git-send-email-gmcharlt@gmail.com> Fix so that modifying an authority record is not logged as both an ADD and a MODIFY. Signed-off-by: Galen Charlton --- C4/AuthoritiesMarc.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 5d1378c..f3cc948 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -701,8 +701,8 @@ sub AddAuthority { my $sth=$dbh->prepare("insert into auth_header (authid,datecreated,authtypecode,marc,marcxml) values (?,now(),?,?,?)"); $sth->execute($authid,$authtypecode,$record->as_usmarc,$record->as_xml_record($format)); $sth->finish; + logaction( "AUTHORITIES", "ADD", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog"); } - logaction( "AUTHORITIES", "ADD", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog"); ModZebra($authid,'specialUpdate',"authorityserver",$oldRecord,$record); return ($authid); } -- 1.7.2.3 From gmcharlt at gmail.com Thu Mar 3 22:54:00 2011 From: gmcharlt at gmail.com (Galen Charlton) Date: Thu, 3 Mar 2011 16:54:00 -0500 Subject: [Koha-patches] [PATCH 1/3] [SIGNED-OFF] bug 5783: Authorities edit logging Message-ID: <1299189242-6009-1-git-send-email-gmcharlt@gmail.com> From: Tomas Cohen Arazi Signed-off-by: Galen Charlton --- C4/AuthoritiesMarc.pm | 4 ++++ installer/data/mysql/en/mandatory/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/preferences/logs.pref | 6 ++++++ .../prog/en/modules/tools/viewlog.tmpl | 7 ++++++- 5 files changed, 24 insertions(+), 1 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index bd5fe64..5d1378c 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -26,6 +26,7 @@ use C4::Search; use C4::AuthoritiesMarc::MARC21; use C4::AuthoritiesMarc::UNIMARC; use C4::Charset; +use C4::Log; use vars qw($VERSION @ISA @EXPORT); @@ -701,6 +702,7 @@ sub AddAuthority { $sth->execute($authid,$authtypecode,$record->as_usmarc,$record->as_xml_record($format)); $sth->finish; } + logaction( "AUTHORITIES", "ADD", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog"); ModZebra($authid,'specialUpdate',"authorityserver",$oldRecord,$record); return ($authid); } @@ -718,6 +720,7 @@ sub DelAuthority { my ($authid) = @_; my $dbh=C4::Context->dbh; + logaction( "AUTHORITIES", "DELETE", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog"); ModZebra($authid,"recordDelete","authorityserver",GetAuthority($authid),undef); my $sth = $dbh->prepare("DELETE FROM auth_header WHERE authid=?"); $sth->execute($authid); @@ -748,6 +751,7 @@ sub ModAuthority { print AUTH $authid; close AUTH; } + logaction( "AUTHORITIES", "MODIFY", $authid, "BEFORE=>" . $oldrecord->as_formatted ) if C4::Context->preference("AuthoritiesLog"); return $authid; } diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 0b75e98..674326d 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -285,3 +285,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','0','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 31aa998..25f7707 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4014,6 +4014,13 @@ 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 ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','0','YesNo');"); + print "Upgrade to $DBversion done (Add AuthoritiesLog syspref)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref index 78140f8..ade8a13 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref @@ -18,6 +18,12 @@ Logging: off: "Don't log" - any changes to bibliographic or item records. Since this occurs whenever a book is checked in or out as well, it is not advisable to turn this on. - + - pref: AuthoritiesLog + choices: + on: Log + off: "Don't log" + - changes to authorities records. + - - pref: FinesLog choices: on: Log diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl index fa99af2..9984144 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl @@ -44,6 +44,7 @@ -
    " /> + " />
    @@ -109,7 +110,7 @@ $(document).ready(function() { - &categorycode=&branch=">Delete + &categorycode=&branch=">Delete @@ -139,7 +140,7 @@ $(document).ready(function() { - "/> + "/>
    @@ -149,7 +150,7 @@ $(document).ready(function() {

    You can set a default maximum number of checkouts and hold policy that will be used if none is defined below for a particular item type or category.

    - "/> + "/> @@ -188,7 +189,7 @@ $(document).ready(function() {
      - ">Unset + ">Unset
    @@ -205,7 +206,7 @@ $(document).ready(function() {

    - "/> + "/> @@ -231,7 +232,7 @@ $(document).ready(function() { @@ -274,7 +275,7 @@ $(document).ready(function() { - "/> + "/>
    Patron Category - &branch=">Delete + &branch=">Delete
    @@ -302,7 +303,7 @@ $(document).ready(function() { -- 1.7.2.3 From salvazm at masmedios.com Fri Mar 4 13:17:09 2011 From: salvazm at masmedios.com (Salvador Zaragoza Rubio) Date: Fri, 4 Mar 2011 13:17:09 +0100 Subject: [Koha-patches] [PATCH] Bug 3013 - 006/008 Type of Material Display on cataloguing plugin for MARC21 In-Reply-To: References: Message-ID: <1299241029-10651-1-git-send-email-salvazm@masmedios.com> Modification of the intranet cataloguing plugin for 006/008 fields to allow select a type of material and change the positions available to enter the data. Data are hard stored in xml files to allow easy translation and processing through Javascript and AJAX. Follow-up fix for Bug 3013 - 006/008 Type of Material Display on cataloguing plugin for MARC21 Add url functionality in the xml and updatedatabase Signed-off-by: Salvador Zaragoza Rubio --- cataloguing/value_builder/marc21_field_006.pl | 107 +- cataloguing/value_builder/marc21_field_008.pl | 141 ++- installer/data/mysql/de-DE/mandatory/sysprefs.sql | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 1 + .../1-Obligatoire/unimarc_standard_systemprefs.sql | 2 + 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 + .../intranet-tmpl/prog/en/js/xmlControlfield.js | 341 +++++ .../en/modules/admin/preferences/cataloguing.pref | 6 + .../value_builder/marc21_field_006.tmpl | 157 ++- .../cataloguing/value_builder/marc21_field_006.xml | 795 ++++++++++++ .../value_builder/marc21_field_008.tmpl | 533 +++++---- .../cataloguing/value_builder/marc21_field_008.xml | 1298 ++++++++++++++++++++ .../cataloguing/value_builder/marc21_field_CF.xsd | 83 ++ 17 files changed, 3097 insertions(+), 380 deletions(-) mode change 100644 => 100755 installer/data/mysql/de-DE/mandatory/sysprefs.sql mode change 100644 => 100755 installer/data/mysql/en/mandatory/sysprefs.sql mode change 100644 => 100755 installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql mode change 100644 => 100755 installer/data/mysql/it-IT/necessari/sysprefs.sql mode change 100644 => 100755 installer/data/mysql/pl-PL/mandatory/sysprefs.sql mode change 100644 => 100755 installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql mode change 100644 => 100755 installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql create mode 100755 koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js mode change 100644 => 100755 koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref mode change 100644 => 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl create mode 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml mode change 100644 => 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl create mode 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml create mode 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd mode change 100644 => 100755 kohaversion.pl diff --git a/cataloguing/value_builder/marc21_field_006.pl b/cataloguing/value_builder/marc21_field_006.pl index 6d84cb4..5f40e89 100755 --- a/cataloguing/value_builder/marc21_field_006.pl +++ b/cataloguing/value_builder/marc21_field_006.pl @@ -26,6 +26,8 @@ use C4::Context; use C4::Search; use C4::Output; +use XML::LibXML; + =head1 DESCRIPTION plugin_parameters : other parameters added when the plugin is called by the dopop function @@ -82,46 +84,71 @@ sub plugin { ); $result = "a|||||r|||| 00| 0 " unless $result; - # $result = "a r 00 0 " unless $result; - my $f0 = substr($result, 0, 1); - my $f014 = substr($result, 1, 4); - my $f5 = substr($result, 5, 1); - my $f6 = substr($result, 6, 1); - my $f710 = substr($result, 7, 4); - my $f11 = substr($result, 11, 1); - my $f12 = substr($result, 12, 1); - my $f13 = substr($result, 13, 1); - my $f14 = substr($result, 14, 1); - my $f15 = substr($result, 15, 1); - my $f16 = substr($result, 16, 1); - my $f17 = substr($result, 17, 1); - - $template->param( - index => $index, - f0 => $f0, - "f0$f0" => $f0, - f014 => $f014, - "f014$f014" => $f014, - f5 => $f5, - "f5$f5" => $f5, - f6 => $f6, - "f6$f6" => $f6, - f710 => $f710, - "f710$f710" => $f710, - f11 => $f11, - "f11$f11" => $f11, - f12 => $f12, - "f12$f12" => $f12, - f13 => $f13, - "f13$f13" => $f13, - f14 => $f14, - "f14$f14" => $f14, - f15 => $f15, - "f15$f15" => $f15, - f16 => $f16, - "f16$f16" => $f16, - f17 => $f17, - "f17$f17" => $f17, + # Check whether we want to use Type of Material display with xml + my $viewMaterialTypesMode = C4::Context->preference("TypeOfMaterialsView_006_008"); + # Check if the xml, xsd exists and is validated + if ($viewMaterialTypesMode) { + my $dir = C4::Context->config('intrahtdocs') . '/prog/' . $template->param('lang') . '/modules/cataloguing/value_builder/'; + if (-r $dir . 'marc21_field_006.xml') { + my $doc = XML::LibXML->new->parse_file($dir . 'marc21_field_006.xml'); + if (-r $dir . 'marc21_field_CF.xsd') { + my $xmlschema = XML::LibXML::Schema->new(location => $dir . 'marc21_field_CF.xsd'); + eval { + $xmlschema->validate( $doc ); + }; + $viewMaterialTypesMode = 0 if ($@); + } + } else { + $viewMaterialTypesMode = 0; + } + } + unless ($viewMaterialTypesMode) { + # $result = "a r 00 0 " unless $result; + my $f0 = substr($result, 0, 1); + my $f014 = substr($result, 1, 4); + my $f5 = substr($result, 5, 1); + my $f6 = substr($result, 6, 1); + my $f710 = substr($result, 7, 4); + my $f11 = substr($result, 11, 1); + my $f12 = substr($result, 12, 1); + my $f13 = substr($result, 13, 1); + my $f14 = substr($result, 14, 1); + my $f15 = substr($result, 15, 1); + my $f16 = substr($result, 16, 1); + my $f17 = substr($result, 17, 1); + + $template->param( + f0 => $f0, + "f0$f0" => $f0, + f014 => $f014, + "f014$f014" => $f014, + f5 => $f5, + "f5$f5" => $f5, + f6 => $f6, + "f6$f6" => $f6, + f710 => $f710, + "f710$f710" => $f710, + f11 => $f11, + "f11$f11" => $f11, + f12 => $f12, + "f12$f12" => $f12, + f13 => $f13, + "f13$f13" => $f13, + f14 => $f14, + "f14$f14" => $f14, + f15 => $f15, + "f15$f15" => $f15, + f16 => $f16, + "f16$f16" => $f16, + f17 => $f17, + "f17$f17" => $f17, + ); + } else { + $template->param(tagfield => '006'); + } + $template->param(index => $index, + result => $result, + viewMaterialTypesMode => $viewMaterialTypesMode, ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/cataloguing/value_builder/marc21_field_008.pl b/cataloguing/value_builder/marc21_field_008.pl index 57e0690..c63cda5 100755 --- a/cataloguing/value_builder/marc21_field_008.pl +++ b/cataloguing/value_builder/marc21_field_008.pl @@ -26,6 +26,8 @@ use C4::Context; use C4::Search; use C4::Output; +use XML::LibXML; + =head1 DESCRIPTION plugin_parameters : other parameters added when the plugin is called by the dopop function @@ -96,65 +98,90 @@ sub plugin { # $result = " t xxu 00 0 eng d" unless $result; $result = "$dateentered" . "t xxu||||| |||| 00| 0 eng d" unless $result; - my $f1 = substr($result, 0, 6); - my $f6 = substr($result, 6, 1); - my $f710 = substr($result, 7, 4); - my $f1114 = substr($result, 11, 4); - my $f1517 = substr($result, 15, 3); - my $f1821 = substr($result, 18, 4); - my $f22 = substr($result, 22, 1); - my $f23 = substr($result, 23, 1); - my $f2427 = substr($result, 24, 4); - my $f28 = substr($result, 28, 1); - my $f29 = substr($result, 29, 1); - my $f30 = substr($result, 30, 1); - my $f31 = substr($result, 31, 1); - my $f33 = substr($result, 33, 1); - my $f34 = substr($result, 34, 1); - my $f3537 = substr($result, 35, 3); - my $f38 = substr($result, 38, 1); - my $f39 = substr($result, 39, 1); - - # bug 2563 - $f710 = "" if ($f710 =~ /^\s*$/); - $f1114 = "" if ($f1114 =~ /^\s*$/); - - if ((!$f1) || ($f1 =~ m/ /)) { - $f1 = $dateentered; + # Check whether we want to use Type of Material display with xml + my $viewMaterialTypesMode = C4::Context->preference("TypeOfMaterialsView_006_008"); + # Check if the xml, xsd exists and is validated + if ($viewMaterialTypesMode) { + my $dir = C4::Context->config('intrahtdocs') . '/prog/' . $template->param('lang') . '/modules/cataloguing/value_builder/'; + if (-r $dir . 'marc21_field_008.xml') { + my $doc = XML::LibXML->new->parse_file($dir . 'marc21_field_008.xml'); + if (-r $dir . 'marc21_field_CF.xsd') { + my $xmlschema = XML::LibXML::Schema->new(location => $dir . 'marc21_field_CF.xsd'); + eval { + $xmlschema->validate( $doc ); + }; + $viewMaterialTypesMode = 0 if ($@); + } + } else { + $viewMaterialTypesMode = 0; + } } + unless ($viewMaterialTypesMode) { + my $f1 = substr($result, 0, 6); + my $f6 = substr($result, 6, 1); + my $f710 = substr($result, 7, 4); + my $f1114 = substr($result, 11, 4); + my $f1517 = substr($result, 15, 3); + my $f1821 = substr($result, 18, 4); + my $f22 = substr($result, 22, 1); + my $f23 = substr($result, 23, 1); + my $f2427 = substr($result, 24, 4); + my $f28 = substr($result, 28, 1); + my $f29 = substr($result, 29, 1); + my $f30 = substr($result, 30, 1); + my $f31 = substr($result, 31, 1); + my $f33 = substr($result, 33, 1); + my $f34 = substr($result, 34, 1); + my $f3537 = substr($result, 35, 3); + my $f38 = substr($result, 38, 1); + my $f39 = substr($result, 39, 1); + + # bug 2563 + $f710 = "" if ($f710 =~ /^\s*$/); + $f1114 = "" if ($f1114 =~ /^\s*$/); + + if ((!$f1) || ($f1 =~ m/ /)) { + $f1 = $dateentered; + } - $template->param( - index => $index, - f1 => $f1, - f6 => $f6, - "f6$f6" => $f6, - f710 => $f710, - f1114 => $f1114, - f1517 => $f1517, - f1821 => $f1821, - f22 => $f22, - "f22$f22" => $f22, - f23 => $f23, - "f23$f23" => $f23, - f2427 => $f2427, - "f24$f2427" => $f2427, - f28 => $f28, - "f28$f28" => $f28, - f29 => $f29, - "f29$f29" => $f29, - f30 => $f30, - "f30$f30" => $f30, - f31 => $f31, - "f31$f31" => $f31, - f33 => $f33, - "f33$f33" => $f33, - f34 => $f34, - "f34$f34" => $f34, - f3537 => $f3537, - f38 => $f38, - "f38$f38" => $f38, - f39 => $f39, - "f39$f39" => $f39, + $template->param( + f1 => $f1, + f6 => $f6, + "f6$f6" => $f6, + f710 => $f710, + f1114 => $f1114, + f1517 => $f1517, + f1821 => $f1821, + f22 => $f22, + "f22$f22" => $f22, + f23 => $f23, + "f23$f23" => $f23, + f2427 => $f2427, + "f24$f2427" => $f2427, + f28 => $f28, + "f28$f28" => $f28, + f29 => $f29, + "f29$f29" => $f29, + f30 => $f30, + "f30$f30" => $f30, + f31 => $f31, + "f31$f31" => $f31, + f33 => $f33, + "f33$f33" => $f33, + f34 => $f34, + "f34$f34" => $f34, + f3537 => $f3537, + f38 => $f38, + "f38$f38" => $f38, + f39 => $f39, + "f39$f39" => $f39, + ); + } else { + $template->param(tagfield => '008'); + } + $template->param(index => $index, + result => $result, + viewMaterialTypesMode => $viewMaterialTypesMode, ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql old mode 100644 new mode 100755 index 221017a..eb7184a --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -287,3 +287,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','YesNo'); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql old mode 100644 new mode 100755 index 363774d..514ea94 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -287,3 +287,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','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 old mode 100644 new mode 100755 index 9386fee..7a1d90e --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -287,5 +287,7 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +<<<<<<< HEAD:installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','YesNo'); diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql old mode 100644 new mode 100755 index 49da6ce..53f4e64 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -274,3 +274,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','YesNo'); diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql old mode 100644 new mode 100755 index 5715de1..0867b83 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -286,3 +286,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','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 old mode 100644 new mode 100755 index 2b38cfa..1f06a1d --- 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 @@ -341,3 +341,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','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 old mode 100644 new mode 100755 index 874a6e4..33e0073 --- 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 @@ -366,3 +366,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index b4c51c0..b784c3d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4022,6 +4022,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); }; +$DBversion = '3.03.00.XXX'; #FIXME +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + # 006/008 plugins show Type of Materials and change fields form to view the allowed values for the different positions + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','YesNo')"); + print "Upgrade to $DBversion done (006/008 plugins show Type of Materials positions selection)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js b/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js new file mode 100755 index 0000000..67b0bf5 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js @@ -0,0 +1,341 @@ + + +// Add an option to a select form field +function add_option(select, text, value, selected) +{ + var option = document.createElement('option'); + option.text = text; + option.value = value; + if (selected) option.selected = true; + try { + select.add(option, null); + } + catch(ex) { + select.add(option); + } +}//add_option + + +// Return the value of a parameter from the url +function returnValueParam(param) +{ + var params = location.search.substr(1); + var arr = params.split("&"); + var pattern = param + "="; + for (var i=0; i < arr.length; i++) { + if (arr[i].indexOf(pattern) == 0) { + return unescape(arr[i].substr(pattern.length)); + } + } + return ""; +}//returnValueParam + + +// Return a value from a position on the result string +function returnValuePosFromResult(result, pos) +{ + var index; + if ((index = pos.indexOf("-")) > 0) { + var ini = parseInt(pos.substring(0, index) ,10); + var end = parseInt(pos.substr(index + 1) ,10); + return result.substring(ini, end + 1); + } else { + return result.substr(pos, 1); + } +}//returnValuePosFromResult + + +// Build string from form fields +function returnResultFromValues(form) +{ + var resultStr = form.result.value; + var pos; + var value; + for (var i=0; i < form.elements.length; i++) { + var pattern = new RegExp("f[0-9]+(?:[0-9]+)?"); + if (pattern.test(form.elements[i].name)) { + pos = form.elements[i].name.substr(1); + value = (pos.indexOf("-") > 0)?form.elements[i].value:form.elements[i].options[form.elements[i].selectedIndex].value; + resultStr = changePosResult(pos, value, resultStr); + } + } + return resultStr; +}//returnResultFromValues + + +// Build/modify result string for a position and a value +function changePosResult(pos, value, resultStr) +{ + var index; + var result = ""; + if ((index = pos.indexOf("-")) > 0) { + var ini = parseInt(pos.substring(0, index) ,10); + var end = parseInt(pos.substr(index + 1) ,10); + var roffset = (1 + end - ini)- value.length; + if (roffset > 0) for (var i=0; i < roffset; i++) value += " "; + if (ini == 0) + result = value + resultStr.substr(end + 1); + else { + result = resultStr.substring(0, ini) + value; + if (end < resultStr.length) + result += resultStr.substr(end + 1); + } + } else { + var ini = parseInt(pos, 10); + if (ini == 0) + result = value + resultStr.substr(1); + else { + result = resultStr.substring(0, ini) + value; + if (ini < resultStr.length) + result += resultStr.substr(ini + 1); + } + } + result = result.replace(/#/g, " "); + return result; +}//changePosResult + + +// Display the result string on a table indicating positions and coloring them if wrong or selected +function renderResult(tr_result, result) +{ + if (tr_result) { + var td; + if (tr_result.cells.length != result.length) { + for (var i = tr_result.cells.length - 1; i >= 0; i--) + tr_result.deleteCell(i); + for (var i=0; i < result.length; i++) { + value = result.charAt(i); + td = tr_result.insertCell(tr_result.cells.length); + } + } + var value; + var ini = -1; + var end = -1; + var args = renderResult.arguments; + if (args.length > 2) { + var index; + if ((index = args[2].indexOf("-")) > 0) { + ini = parseInt(args[2].substring(0, index) ,10); + end = parseInt(args[2].substr(index + 1) ,10); + } else ini = parseInt(args[2], 10); + } + for (var i=0; i < result.length; i++) { + value = result.charAt(i); + td = tr_result.cells[i]; + if (td.style.backgroundColor != "yellow") td.style.backgroundColor = "white"; + td.innerHTML = (value == " ")?" ":value; + td.title = "Pos " + i + ". Value: \"" + value + "\""; + if (ini >= 0) { + if (end > 0) { + if (ini <= i && i <= end) td.style.backgroundColor = "#cccccc"; + } else if (i == ini) td.style.backgroundColor = "#cccccc"; + } else { + var pos = (i < 10)?'0' + i:i + ''; + var obj; + if ((obj = document.getElementById('f' + pos)) != null) { + var found = false; + for (var j=0; j < obj.options.length && !found; j++) + if (obj.options[j].value == value) found = true; + if (!found) { + td.style.backgroundColor = "yellow"; + td.title = "Pos " + i + ". Bad Value: \"" + value + "\""; + } + } + } + }//for + } +}//renderResult + + +// Change displaying of result in the page +function changeH4Result(form, h4_result, tr_result, pos, value) +{ + var resultStr = form.result.value; + var result = changePosResult(pos, value, resultStr); + renderResult(tr_result, result, pos); + h4_result.innerHTML = result; + form.result.value = result; +}//changeH4Result + + + +// Class to read the xml and render the type of material +(function() +{ + + xmlControlField = function(tagfield, form_id, select, table, h4_result, tr_result, idMaterial) + { + this.tagfield = tagfield; + this.idMaterial = idMaterial; + this.form_id = form_id; + this.form = document.getElementById(form_id); + this.select = select; + this.table = table; + this.h4_result = h4_result; + this.tr_result = tr_result; + };//xmlControlField + + + xmlControlField.prototype = + { + tagfield: "", + idMaterial: "", + root: null, + form_id: "", + form: null, + select: null, + table: null, + h4_result: "", + tr_result: "", + + + setIdMaterial: function(idMaterial) + { + this.idMaterial = idMaterial; + },//setIdMaterial + + loadXmlValues: function() + { + var xmlhttp; + try { + if (window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + if (xmlhttp.overrideMimeType) { + xmlhttp.overrideMimeType('text/xml'); + } + } else if (window.ActiveXObject) { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP") || new ActiveXObject("Msxml2.XMLHTTP"); + } + xmlhttp.open("GET", "/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_" + this.tagfield + ".xml", false); + xmlhttp.send(null); + this.xmlDoc = xmlhttp.responseXML; + if (this.xmlDoc) this.renderTemplate(); + } catch (e) { + //alert(e); + } + },//loadXmlValues + + + renderTemplate: function() + { + this.root = this.xmlDoc.documentElement; + if (this.root.nodeName == "Tagfield" && this.root.nodeType == 1 && this.root.hasChildNodes()) { + var tag = this.root.attributes.getNamedItem("tag").nodeValue; + var nodeMaterial = this.root.getElementsByTagName('Material'); + if (nodeMaterial != null && nodeMaterial.length > 0) { + if (this.idMaterial == "") this.idMaterial = nodeMaterial[0].attributes.getNamedItem("id").nodeValue; + this.renderSelectMaterial(nodeMaterial); + this.renderPositions(nodeMaterial, (this.form.result.value != "")?this.form.result.value:returnValueParam("result")); + } + } + },//renderTemplate + + + renderSelectMaterial: function(nodeMaterial) + { + if (this.select != null && nodeMaterial != null && nodeMaterial.length > 0) { + if (this.select.options.length <= 1) { + var id; + var name; + var arrSort = new Array(); + var arrEquiv = new Array(); + for (var i=0; i < nodeMaterial.length; i++) { + id = nodeMaterial[i].attributes.getNamedItem("id").nodeValue; + name = nodeMaterial[i].attributes.getNamedItem("name").nodeValue; + arrEquiv[id] = i; + arrSort.push(id); + } + arrSort.sort(); + var j; + for (var i=0; i < arrSort.length; i++) { + j = arrEquiv[arrSort[i]]; + add_option(this.select, arrSort[i] + " - " + nodeMaterial[j].attributes.getNamedItem("name").nodeValue, arrSort[i], (this.idMaterial != "" && arrSort[i] == this.idMaterial)?true:false); + } + } else if (this.idMaterial != "") { + for (var i=0; i < this.select.options.length; i++) { + if (this.select.options[i].value == this.idMaterial) this.select.options[i].selected = true; + } + } + } + },//renderSelectMaterial + + + renderPositions: function(nodeMaterial, result) + { + var materialNode; + try { + var resultXPath = this.xmlDoc.evaluate("//a:Material[@id='" + this.idMaterial + "']", this.xmlDoc.documentElement, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null); + materialNode = resultXPath.singleNodeValue; + } catch (e) { + for (var i=0; i < nodeMaterial.length; i++) { + if (this.idMaterial == nodeMaterial[i].attributes.getNamedItem("id").nodeValue) { + materialNode = nodeMaterial[i]; + break; + } + } + } + if (this.table != null) { + var tbody = this.table.tBodies[0]; + if (tbody.rows.length > 0) + for (var i = tbody.rows.length - 1; i >= 1; i--) + tbody.deleteRow(i); + if (materialNode != undefined && materialNode != null && materialNode.nodeType == 1 && materialNode.hasChildNodes()) { + var nodePos = materialNode.firstChild; + var tr; + var td; + var title; + var pos; + var value; + var strInnerHTML = ""; + var selected; + var index; + var url; + while (nodePos != null) { + if (nodePos.nodeType == 1 && nodePos.nodeName == "Position") { + tr = tbody.insertRow(tbody.rows.length); + td = tr.insertCell(tr.cells.length); + pos = nodePos.attributes.getNamedItem("pos").nodeValue; + title = ((nodePos.getAttributeNode("description") || nodePos.hasAttribute("description")) && nodePos.getAttribute("description") != "")?nodePos.attributes.getNamedItem("description").nodeValue:nodePos.attributes.getNamedItem("name").nodeValue; + try { + url = ((nodePos.getAttributeNode("url") || nodePos.hasAttribute("url")) && nodePos.getAttribute("url") != "" && nodePos.getAttribute("urltext") != "")?" " + nodePos.attributes.getNamedItem("urltext").nodeValue + "":""; + } catch (e) { url = "";} + td.innerHTML = ""; + td = tr.insertCell(tr.cells.length); + value = returnValuePosFromResult(result, pos); + if ((index = pos.indexOf("-")) > 0) { + var ini = parseInt(pos.substring(0, index) ,10); + var end = parseInt(pos.substr(index + 1) ,10); + value = value.replace(/ /g, "#"); + strInnerHTML = ""; + } else { + strInnerHTML = ""; + } + //alert(strInnerHTML); + td.innerHTML = strInnerHTML; + } + nodePos = nodePos.nextSibling; + } + } + } + }//renderPositions + }; + +})(); + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref old mode 100644 new mode 100755 index d809022..0c3bd46 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -118,4 +118,10 @@ Cataloging: yes: Hide no: "Don't hide" - items marked as suppressed from OPAC search results. Note that you must have the Suppress index set up in Zebra and at least one suppressed item, or your searches will be broken. + - + - pref: TypeOfMaterialsView_006_008 + choices: + yes: "Don't hide" + no: Hide + - 006/008 plugins show Type of Materials and change fields form to view the allowed values for the different positions. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl old mode 100644 new mode 100755 index ab2a079..7240639 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl @@ -1,14 +1,67 @@ Koha › Cataloging › 006 builder + + + + + + - +onload="loadXmlValues()">

    006 Fixed-length data elements--Additional material characteristics--General information

    - + + +
    Item Type - &branch=">Delete + &branch=">Delete
    + + +
    +

    + + + - - - + +" /> +
    + + + + + + + + - - + + + - + - + - - + + + + - - - - + + + + - + +
    + +
    -
    01-04 Illustrations (auto-filled from 300)"/>
    @@ -119,7 +172,7 @@ - + @@ -175,7 +228,7 @@
    @@ -246,7 +299,7 @@ -
    15 Undefined
    15 Undefined
    Cancel
    @@ -510,24 +564,27 @@ function report() { var doc = opener.document; var field = doc.getElementById(""); - + + field.value = document.getElementById("h4_result").innerHTML; + field.value = - ''+ - document.f_pop.f0.value+ - document.f_pop.f014.value+ - document.f_pop.f5.value+ - document.f_pop.f6.value+ - document.f_pop.f710.value+ - document.f_pop.f11.value+ - document.f_pop.f12.value+ - document.f_pop.f13.value+ - document.f_pop.f14.value+ ' '+ - document.f_pop.f16.value+ - document.f_pop.f17.value; - self.close(); - return false; - } - //]]> + ''+ + document.f_pop.f0.value+ + document.f_pop.f014.value+ + document.f_pop.f5.value+ + document.f_pop.f6.value+ + document.f_pop.f710.value+ + document.f_pop.f11.value+ + document.f_pop.f12.value+ + document.f_pop.f13.value+ + document.f_pop.f14.value+ ' '+ + document.f_pop.f16.value+ + document.f_pop.f17.value; + + self.close(); + return false; + } + //]]> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml new file mode 100755 index 0000000..9ea0417 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml @@ -0,0 +1,795 @@ + + + + + a + t + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + o + p + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 2 + 5 + 6 + a + b + c + d + e + f + g + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + 0 + 1 + | + + + 0 + 1 + | + + + + 0 + 1 + d + e + f + h + i + j + m + p + s + u + | + + + # + a + b + c + d + | + + + + + m + + + + # + a + b + c + d + e + f + g + j + | + + + # + o + q + | + + + + a + b + c + d + e + f + g + h + i + j + m + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + + + + e + f + + + # + a + b + c + d + e + f + g + i + j + k + m + z + |||| + + + ## + aa + ab + ac + ad + ae + af + ag + am + an + ap + au + az + ba + bb + bc + bd + be + bf + bg + bh + bi + bj + bk + bl + bo + br + bs + bu + bz + ca + cb + cc + ce + cp + cu + cz + da + db + dc + dd + de + df + dg + dh + dl + zz + | + + + + a + b + c + d + e + f + g + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + 0 + 1 + | + + + + # + e + j + k + l + n + o + p + r + z + | + + + + + c + d + i + j + + + an + bd + bg + bl + bt + ca + cb + cc + cg + ch + cl + cn + co + cp + cr + cs + ct + cy + cz + df + dv + fg + fl + fm + ft + gm + hy + jz + mc + md + mi + mo + mp + mr + ms + mu + mz + nc + nn + op + or + ov + pg + pm + po + pp + pr + ps + pt + pv + rc + rd + rg + ri + rp + rq + sd + sg + sn + sp + st + su + sy + tc + tl + ts + uu + vi + vr + wz + za + zz + || + + + a + b + c + d + e + g + h + i + j + m + n + u + z + | + + + # + d + e + f + n + u + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + a + b + c + d + e + f + g + h + i + k + r + s + z + | + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + r + s + t + z + | + + + + # + a + b + c + n + u + | + + + + + + s + + + # + a + b + c + d + e + f + g + h + i + j + k + m + q + s + t + u + w + z + | + + + n + r + u + x + | + + + + # + d + l + m + n + p + w + | + + + # + a + b + c + d + e + f + o + q + s + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + z + ||| + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + + # + a + b + c + d + e + f + g + h + i + j + k + l + u + z + | + + + 0 + 1 + 2 + | + + + + + g + k + o + r + + + 000 + 001-999 + nnn + ||| + ??????????????????????? --- + + + + # + a + b + c + d + e + f + g + j + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + a + b + c + d + f + g + i + k + l + m + n + o + p + q + r + s + t + v + w + z + | + + + a + c + l + n + u + z + | + + + + + p + + + + # + a + b + c + d + f + o + q + r + s + | + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl old mode 100644 new mode 100755 index 9dddccb..b232466 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl @@ -1,282 +1,335 @@ Koha › Cataloging › 008 builder + + + + + + - +onload="loadXmlValues()">

    008 Fixed-length data elements--General information

    -
    + + + + + +
    +

    + + + - - - - - - - - - - + - - + + @@ -148,6 +154,7 @@ +
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tmpl index ad675d1..dcb57a2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tmpl @@ -24,7 +24,8 @@
    Cloning of issuing rules failed!
    -

    The rules have been cloned.

    +

    The rules have ">been cloned.

    + Return to Issuing rules diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl index 92a44ce..f7f76fe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl @@ -6,9 +6,145 @@ //tbody>tr>td.editable').click(function() { + if ( ! editor ) { + var td = $(this); + var tdvalue = td.text().trim(); + td.text(''); + + var type; + if ( $.inArray('boolean', td.attr('class').split(' ')) != -1 ) { // If the td is boolean, we display a checkbox + editor = $(''); + editor.attr('checked', tdvalue == 'Yes' ? 'checked' : ''); + type = 'boolean'; + } else if ( $.inArray('triple', td.attr('class').split(' ')) != -1 ) { // else if it is a triple, we display a listbox + var selectedn = tdvalue == '' ? 'selected="selected"' : ''; + var selected1 = tdvalue == 'Yes' ? 'selected="selected"' : ''; + var selected0 = tdvalue == 'No' ? 'selected="selected"' : ''; + var str = ''; + editor = $(str); + type = 'triple'; + } else { // else we display a textbox + editor = $(''); + editor.attr('value', tdvalue); + } + + editor.focus(); + + editor.keyup(function(e) { // on press + if ( e.keyCode == 13 ) { // enter + + // let's build the atomic rule + var branchcode = $('#branchcode').val(); + var categorycode = td.parent().children('td.categorycode').children('span').text(); + var itemtype = td.parent().children('td.itemtype').children('span').text(); + var varname = td.attr('class').split(' ')[0]; + var inputvalue; + switch ( type ) { + case 'boolean': + inputvalue = editor.attr('checked') ? 1 : 0; + break; + default: + inputvalue = editor.val(); + break; + } + + // post it to the server + $.ajax({ + url: '/cgi-bin/koha/admin/smart-rules-service.pl', + type: "POST", + async: false, + data: "branchcode="+branchcode+"&categorycode="+categorycode+"&itemtype="+itemtype+"&varname="+varname+"&inputvalue="+inputvalue, + success: function(result) { + + // repopulate the td with data + switch ( type ) { + case 'boolean': + td.text(result == '1' ? 'Yes' : 'No'); + break; + case 'triple': + switch ( result ) { + case '' : td.text(''); break; + case '1': td.text('Yes'); break; + case '0': td.text('No'); break; + } + break; + default: + td.text(result); + break; + } + + editor.remove(); + editor = false; + } + }); + } + }); + + td.append(editor); + } + }); }); //]]> @@ -32,25 +168,11 @@ $(document).ready(function() { Defining circulation and fine rules for all libraries -
    -

    The rules are applied from most specific to less specific, using the first found in this order:

    -
      -
    • same library, same patron type, same item type
    • -
    • same library, same patron type, all item types
    • -
    • same library, all patron types, same item type
    • -
    • same library, all patron types, all item types
    • -
    • all libraries, same patron type, same item type
    • -
    • all libraries, same patron type, all item types
    • -
    • all libraries, all patron types, same item type
    • -
    • all libraries, all patron types, all item types
    • -
    -

    To modify a rule, create a new one with the same patron type and item type.

    -
    -
    +
    Select a library : - + @@ -60,272 +182,223 @@ $(document).ready(function() { for="tobranch">Clone these rules to: " /> -
    - -
    1-5 Date entered on file (auto-filled)" />
    - - - +" /> + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - + + + + - - + + + + + "/> + - + + + - - + + + + - - - - + + + + + - + - + - + - - + +
    + +
    " />
    + + + -
    - "/> -
    - "/>
    See MARC Code List for Countries - "/> -
    "/>
    + "/> +
    + "/> +
    See MARC Code List for Countries + "/> +
    "/> +
    - + -
    - - + - - + + - + - + - + - + - + - + - -
    - "/>
    - - + @@ -288,7 +341,7 @@ - + @@ -309,67 +362,67 @@ - + - + - + - + - + - -
    - - + - -
    - - + @@ -381,7 +434,7 @@
    - @@ -400,13 +453,14 @@
    32 Undefined
    32 Undefined
    - @@ -417,12 +471,12 @@ - + - + @@ -436,32 +490,32 @@ - + - + - + - + - + @@ -479,7 +533,7 @@ - + @@ -487,14 +541,13 @@ -
    - @@ -514,7 +567,7 @@ - + @@ -523,60 +576,60 @@
    See MARC Code List for Languages - "/> + "/>
    - + +
    - @@ -588,20 +641,21 @@ - + - + - +
    Cancel
    @@ -611,49 +665,62 @@ // Pad the string with spaces so that it is 4 characters long. // Also, truncate strings that are longer than 4 characters. function pad4(s) { - var pad = ""; - if (s.length < 4) { - var padLength = 4 - s.length; - for (var i = 0; i < 4 - s.length; i++) { - pad += " "; - } - s += pad; - } else { - s = s.substring(0, 4); - } - return s; + var pad = ""; + if (s.length < 4) { + var padLength = 4 - s.length; + for (var i = 0; i < 4 - s.length; i++) { + pad += " "; + } + s += pad; + } else { + s = s.substring(0, 4); + } + return s; } + +function parseField() +{ + var result = ""; + result = document.f_pop.f1.value+ + document.f_pop.f6.value+ + // bug 2563 { + ( document.f_pop.f710.value.match(/^\s*$/) ? " " : pad4(document.f_pop.f710.value) )+ + ( document.f_pop.f1114.value.match(/^\s*$/) ? " " : pad4(document.f_pop.f1114.value) )+ + // } + //MR + (document.f_pop.f1517.value+" ").substr(0,3)+ + (document.f_pop.f1821.value+" ").substr(0,4)+ + document.f_pop.f22.value+ + document.f_pop.f23.value+ + (document.f_pop.f2427.value+" ").substr(0,4)+ + document.f_pop.f28.value+ + document.f_pop.f29.value+ + document.f_pop.f30.value+ + document.f_pop.f31.value+ ' '+ + document.f_pop.f33.value+ + document.f_pop.f34.value+ + //MR + (document.f_pop.f3537.value+" ").substr(0,3)+ + document.f_pop.f38.value+ + document.f_pop.f39.value; + return result; +}//parseField + + function report() { - var doc = opener.document; + var doc = opener.document; var field = doc.getElementById(""); - field.value = - document.f_pop.f1.value+ - document.f_pop.f6.value+ - // bug 2563 { - ( document.f_pop.f710.value.match(/^\s*$/) ? " " : pad4(document.f_pop.f710.value) )+ - ( document.f_pop.f1114.value.match(/^\s*$/) ? " " : pad4(document.f_pop.f1114.value) )+ - // } - //MR - (document.f_pop.f1517.value+" ").substr(0,3)+ - (document.f_pop.f1821.value+" ").substr(0,4)+ - document.f_pop.f22.value+ - document.f_pop.f23.value+ - (document.f_pop.f2427.value+" ").substr(0,4)+ - document.f_pop.f28.value+ - document.f_pop.f29.value+ - document.f_pop.f30.value+ - document.f_pop.f31.value+ ' '+ - document.f_pop.f33.value+ - document.f_pop.f34.value+ - //MR - (document.f_pop.f3537.value+" ").substr(0,3)+ - document.f_pop.f38.value+ - document.f_pop.f39.value; - self.close(); - return false; - } - //]]> + + field.value = document.getElementById("h4_result").innerHTML; + + field.value = parseField(); + + + self.close(); + return false; + } + //]]> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml new file mode 100755 index 0000000..c8c7295 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml @@ -0,0 +1,1298 @@ + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + o + p + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 2 + 5 + 6 + a + b + c + d + e + f + g + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + 0 + 1 + | + + + 0 + 1 + | + + + + 0 + 1 + d + e + f + h + i + j + m + p + s + u + | + + + # + a + b + c + d + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + + # + a + b + c + d + e + f + g + j + | + + + # + o + q + | + + + + a + b + c + d + e + f + g + h + i + j + m + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + # + a + b + c + d + e + f + g + i + j + k + m + z + |||| + + + ## + aa + ab + ac + ad + ae + af + ag + am + an + ap + au + az + ba + bb + bc + bd + be + bf + bg + bh + bi + bj + bk + bl + bo + br + bs + bu + bz + ca + cb + cc + ce + cp + cu + cz + da + db + dc + dd + de + df + dg + dh + dl + zz + | + + + + a + b + c + d + e + f + g + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + 0 + 1 + | + + + + # + e + j + k + l + n + o + p + r + z + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + an + bd + bg + bl + bt + ca + cb + cc + cg + ch + cl + cn + co + cp + cr + cs + ct + cy + cz + df + dv + fg + fl + fm + ft + gm + hy + jz + mc + md + mi + mo + mp + mr + ms + mu + mz + nc + nn + op + or + ov + pg + pm + po + pp + pr + ps + pt + pv + rc + rd + rg + ri + rp + rq + sd + sg + sn + sp + st + su + sy + tc + tl + ts + uu + vi + vr + wz + za + zz + || + + + a + b + c + d + e + g + h + i + j + m + n + u + z + | + + + # + d + e + f + n + u + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + a + b + c + d + e + f + g + h + i + k + r + s + z + | + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + r + s + t + z + | + + + + # + a + b + c + n + u + | + + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + # + a + b + c + d + e + f + g + h + i + j + k + m + q + s + t + u + w + z + | + + + n + r + u + x + | + + + + # + d + l + m + n + p + w + | + + + # + a + b + c + d + e + f + o + q + s + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + z + ||| + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + + # + a + b + c + d + e + f + g + h + i + j + k + l + u + z + | + + + 0 + 1 + 2 + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + 000 + 001-999 + nnn + ||| + ??????????????????????? --- + + + + # + a + b + c + d + e + f + g + j + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + a + b + c + d + f + g + i + k + l + m + n + o + p + q + r + s + t + v + w + z + | + + + a + c + l + n + u + z + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + + # + a + b + c + d + f + o + q + r + s + | + + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd new file mode 100755 index 0000000..7b0b27b --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd @@ -0,0 +1,83 @@ + + + + Control Field Plugin Type of Materials schema + + + + + + Element indicating the control field + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kohaversion.pl b/kohaversion.pl old mode 100644 new mode 100755 -- 1.5.6.5 From nengard at bywatersolutions.com Fri Mar 4 02:48:51 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 3 Mar 2011 20:48:51 -0500 Subject: [Koha-patches] =?utf-8?q?=5BPATCH_1/2=5D_=5BSIGNED-OFF=5D_Bug_301?= =?utf-8?q?3_-_006/008_Type_of_Material_Display_on_cataloguing_plug?= =?utf-8?q?in_for_MARC21?= Message-ID: <1299203331-4498-1-git-send-email-nengard@bywatersolutions.com> From: Salvador Zaragoza Rubio Modification of the intranet cataloguing plugin for 006/008 fields to allow select a type of material and change the positions available to enter the data. Data are hard stored in xml files to allow easy translation and processing through Javascript and AJAX. Follow-up fix for Bug 3013 - 006/008 Type of Material Display on cataloguing plugin for MARC21 Add url functionality in the xml and updatedatabase Signed-off-by: Salvador Zaragoza Rubio Signed-off-by: Nicole C. Engard --- cataloguing/value_builder/marc21_field_006.pl | 107 +- cataloguing/value_builder/marc21_field_008.pl | 141 ++- installer/data/mysql/de-DE/mandatory/sysprefs.sql | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 1 + .../1-Obligatoire/unimarc_standard_systemprefs.sql | 2 + 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 + .../intranet-tmpl/prog/en/js/xmlControlfield.js | 341 +++++ .../en/modules/admin/preferences/cataloguing.pref | 6 + .../value_builder/marc21_field_006.tmpl | 157 ++- .../cataloguing/value_builder/marc21_field_006.xml | 795 ++++++++++++ .../value_builder/marc21_field_008.tmpl | 533 +++++---- .../cataloguing/value_builder/marc21_field_008.xml | 1298 ++++++++++++++++++++ .../cataloguing/value_builder/marc21_field_CF.xsd | 83 ++ 17 files changed, 3097 insertions(+), 380 deletions(-) mode change 100644 => 100755 installer/data/mysql/de-DE/mandatory/sysprefs.sql mode change 100644 => 100755 installer/data/mysql/en/mandatory/sysprefs.sql mode change 100644 => 100755 installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql mode change 100644 => 100755 installer/data/mysql/it-IT/necessari/sysprefs.sql mode change 100644 => 100755 installer/data/mysql/pl-PL/mandatory/sysprefs.sql mode change 100644 => 100755 installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql mode change 100644 => 100755 installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql create mode 100755 koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js mode change 100644 => 100755 koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref mode change 100644 => 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl create mode 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml mode change 100644 => 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl create mode 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml create mode 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd mode change 100644 => 100755 kohaversion.pl diff --git a/cataloguing/value_builder/marc21_field_006.pl b/cataloguing/value_builder/marc21_field_006.pl index 6d84cb4..5f40e89 100755 --- a/cataloguing/value_builder/marc21_field_006.pl +++ b/cataloguing/value_builder/marc21_field_006.pl @@ -26,6 +26,8 @@ use C4::Context; use C4::Search; use C4::Output; +use XML::LibXML; + =head1 DESCRIPTION plugin_parameters : other parameters added when the plugin is called by the dopop function @@ -82,46 +84,71 @@ sub plugin { ); $result = "a|||||r|||| 00| 0 " unless $result; - # $result = "a r 00 0 " unless $result; - my $f0 = substr($result, 0, 1); - my $f014 = substr($result, 1, 4); - my $f5 = substr($result, 5, 1); - my $f6 = substr($result, 6, 1); - my $f710 = substr($result, 7, 4); - my $f11 = substr($result, 11, 1); - my $f12 = substr($result, 12, 1); - my $f13 = substr($result, 13, 1); - my $f14 = substr($result, 14, 1); - my $f15 = substr($result, 15, 1); - my $f16 = substr($result, 16, 1); - my $f17 = substr($result, 17, 1); - - $template->param( - index => $index, - f0 => $f0, - "f0$f0" => $f0, - f014 => $f014, - "f014$f014" => $f014, - f5 => $f5, - "f5$f5" => $f5, - f6 => $f6, - "f6$f6" => $f6, - f710 => $f710, - "f710$f710" => $f710, - f11 => $f11, - "f11$f11" => $f11, - f12 => $f12, - "f12$f12" => $f12, - f13 => $f13, - "f13$f13" => $f13, - f14 => $f14, - "f14$f14" => $f14, - f15 => $f15, - "f15$f15" => $f15, - f16 => $f16, - "f16$f16" => $f16, - f17 => $f17, - "f17$f17" => $f17, + # Check whether we want to use Type of Material display with xml + my $viewMaterialTypesMode = C4::Context->preference("TypeOfMaterialsView_006_008"); + # Check if the xml, xsd exists and is validated + if ($viewMaterialTypesMode) { + my $dir = C4::Context->config('intrahtdocs') . '/prog/' . $template->param('lang') . '/modules/cataloguing/value_builder/'; + if (-r $dir . 'marc21_field_006.xml') { + my $doc = XML::LibXML->new->parse_file($dir . 'marc21_field_006.xml'); + if (-r $dir . 'marc21_field_CF.xsd') { + my $xmlschema = XML::LibXML::Schema->new(location => $dir . 'marc21_field_CF.xsd'); + eval { + $xmlschema->validate( $doc ); + }; + $viewMaterialTypesMode = 0 if ($@); + } + } else { + $viewMaterialTypesMode = 0; + } + } + unless ($viewMaterialTypesMode) { + # $result = "a r 00 0 " unless $result; + my $f0 = substr($result, 0, 1); + my $f014 = substr($result, 1, 4); + my $f5 = substr($result, 5, 1); + my $f6 = substr($result, 6, 1); + my $f710 = substr($result, 7, 4); + my $f11 = substr($result, 11, 1); + my $f12 = substr($result, 12, 1); + my $f13 = substr($result, 13, 1); + my $f14 = substr($result, 14, 1); + my $f15 = substr($result, 15, 1); + my $f16 = substr($result, 16, 1); + my $f17 = substr($result, 17, 1); + + $template->param( + f0 => $f0, + "f0$f0" => $f0, + f014 => $f014, + "f014$f014" => $f014, + f5 => $f5, + "f5$f5" => $f5, + f6 => $f6, + "f6$f6" => $f6, + f710 => $f710, + "f710$f710" => $f710, + f11 => $f11, + "f11$f11" => $f11, + f12 => $f12, + "f12$f12" => $f12, + f13 => $f13, + "f13$f13" => $f13, + f14 => $f14, + "f14$f14" => $f14, + f15 => $f15, + "f15$f15" => $f15, + f16 => $f16, + "f16$f16" => $f16, + f17 => $f17, + "f17$f17" => $f17, + ); + } else { + $template->param(tagfield => '006'); + } + $template->param(index => $index, + result => $result, + viewMaterialTypesMode => $viewMaterialTypesMode, ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/cataloguing/value_builder/marc21_field_008.pl b/cataloguing/value_builder/marc21_field_008.pl index 57e0690..c63cda5 100755 --- a/cataloguing/value_builder/marc21_field_008.pl +++ b/cataloguing/value_builder/marc21_field_008.pl @@ -26,6 +26,8 @@ use C4::Context; use C4::Search; use C4::Output; +use XML::LibXML; + =head1 DESCRIPTION plugin_parameters : other parameters added when the plugin is called by the dopop function @@ -96,65 +98,90 @@ sub plugin { # $result = " t xxu 00 0 eng d" unless $result; $result = "$dateentered" . "t xxu||||| |||| 00| 0 eng d" unless $result; - my $f1 = substr($result, 0, 6); - my $f6 = substr($result, 6, 1); - my $f710 = substr($result, 7, 4); - my $f1114 = substr($result, 11, 4); - my $f1517 = substr($result, 15, 3); - my $f1821 = substr($result, 18, 4); - my $f22 = substr($result, 22, 1); - my $f23 = substr($result, 23, 1); - my $f2427 = substr($result, 24, 4); - my $f28 = substr($result, 28, 1); - my $f29 = substr($result, 29, 1); - my $f30 = substr($result, 30, 1); - my $f31 = substr($result, 31, 1); - my $f33 = substr($result, 33, 1); - my $f34 = substr($result, 34, 1); - my $f3537 = substr($result, 35, 3); - my $f38 = substr($result, 38, 1); - my $f39 = substr($result, 39, 1); - - # bug 2563 - $f710 = "" if ($f710 =~ /^\s*$/); - $f1114 = "" if ($f1114 =~ /^\s*$/); - - if ((!$f1) || ($f1 =~ m/ /)) { - $f1 = $dateentered; + # Check whether we want to use Type of Material display with xml + my $viewMaterialTypesMode = C4::Context->preference("TypeOfMaterialsView_006_008"); + # Check if the xml, xsd exists and is validated + if ($viewMaterialTypesMode) { + my $dir = C4::Context->config('intrahtdocs') . '/prog/' . $template->param('lang') . '/modules/cataloguing/value_builder/'; + if (-r $dir . 'marc21_field_008.xml') { + my $doc = XML::LibXML->new->parse_file($dir . 'marc21_field_008.xml'); + if (-r $dir . 'marc21_field_CF.xsd') { + my $xmlschema = XML::LibXML::Schema->new(location => $dir . 'marc21_field_CF.xsd'); + eval { + $xmlschema->validate( $doc ); + }; + $viewMaterialTypesMode = 0 if ($@); + } + } else { + $viewMaterialTypesMode = 0; + } } + unless ($viewMaterialTypesMode) { + my $f1 = substr($result, 0, 6); + my $f6 = substr($result, 6, 1); + my $f710 = substr($result, 7, 4); + my $f1114 = substr($result, 11, 4); + my $f1517 = substr($result, 15, 3); + my $f1821 = substr($result, 18, 4); + my $f22 = substr($result, 22, 1); + my $f23 = substr($result, 23, 1); + my $f2427 = substr($result, 24, 4); + my $f28 = substr($result, 28, 1); + my $f29 = substr($result, 29, 1); + my $f30 = substr($result, 30, 1); + my $f31 = substr($result, 31, 1); + my $f33 = substr($result, 33, 1); + my $f34 = substr($result, 34, 1); + my $f3537 = substr($result, 35, 3); + my $f38 = substr($result, 38, 1); + my $f39 = substr($result, 39, 1); + + # bug 2563 + $f710 = "" if ($f710 =~ /^\s*$/); + $f1114 = "" if ($f1114 =~ /^\s*$/); + + if ((!$f1) || ($f1 =~ m/ /)) { + $f1 = $dateentered; + } - $template->param( - index => $index, - f1 => $f1, - f6 => $f6, - "f6$f6" => $f6, - f710 => $f710, - f1114 => $f1114, - f1517 => $f1517, - f1821 => $f1821, - f22 => $f22, - "f22$f22" => $f22, - f23 => $f23, - "f23$f23" => $f23, - f2427 => $f2427, - "f24$f2427" => $f2427, - f28 => $f28, - "f28$f28" => $f28, - f29 => $f29, - "f29$f29" => $f29, - f30 => $f30, - "f30$f30" => $f30, - f31 => $f31, - "f31$f31" => $f31, - f33 => $f33, - "f33$f33" => $f33, - f34 => $f34, - "f34$f34" => $f34, - f3537 => $f3537, - f38 => $f38, - "f38$f38" => $f38, - f39 => $f39, - "f39$f39" => $f39, + $template->param( + f1 => $f1, + f6 => $f6, + "f6$f6" => $f6, + f710 => $f710, + f1114 => $f1114, + f1517 => $f1517, + f1821 => $f1821, + f22 => $f22, + "f22$f22" => $f22, + f23 => $f23, + "f23$f23" => $f23, + f2427 => $f2427, + "f24$f2427" => $f2427, + f28 => $f28, + "f28$f28" => $f28, + f29 => $f29, + "f29$f29" => $f29, + f30 => $f30, + "f30$f30" => $f30, + f31 => $f31, + "f31$f31" => $f31, + f33 => $f33, + "f33$f33" => $f33, + f34 => $f34, + "f34$f34" => $f34, + f3537 => $f3537, + f38 => $f38, + "f38$f38" => $f38, + f39 => $f39, + "f39$f39" => $f39, + ); + } else { + $template->param(tagfield => '008'); + } + $template->param(index => $index, + result => $result, + viewMaterialTypesMode => $viewMaterialTypesMode, ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql old mode 100644 new mode 100755 index 221017a..eb7184a --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -287,3 +287,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','YesNo'); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql old mode 100644 new mode 100755 index 363774d..514ea94 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -287,3 +287,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','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 old mode 100644 new mode 100755 index 9386fee..7a1d90e --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -287,5 +287,7 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +<<<<<<< HEAD:installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','YesNo'); diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql old mode 100644 new mode 100755 index 49da6ce..53f4e64 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -274,3 +274,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','YesNo'); diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql old mode 100644 new mode 100755 index 5715de1..0867b83 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -286,3 +286,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','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 old mode 100644 new mode 100755 index 2b38cfa..1f06a1d --- 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 @@ -341,3 +341,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','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 old mode 100644 new mode 100755 index 874a6e4..33e0073 --- 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 @@ -366,3 +366,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index b4c51c0..b784c3d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4022,6 +4022,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); }; +$DBversion = '3.03.00.XXX'; #FIXME +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + # 006/008 plugins show Type of Materials and change fields form to view the allowed values for the different positions + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','YesNo')"); + print "Upgrade to $DBversion done (006/008 plugins show Type of Materials positions selection)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js b/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js new file mode 100755 index 0000000..67b0bf5 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js @@ -0,0 +1,341 @@ + + +// Add an option to a select form field +function add_option(select, text, value, selected) +{ + var option = document.createElement('option'); + option.text = text; + option.value = value; + if (selected) option.selected = true; + try { + select.add(option, null); + } + catch(ex) { + select.add(option); + } +}//add_option + + +// Return the value of a parameter from the url +function returnValueParam(param) +{ + var params = location.search.substr(1); + var arr = params.split("&"); + var pattern = param + "="; + for (var i=0; i < arr.length; i++) { + if (arr[i].indexOf(pattern) == 0) { + return unescape(arr[i].substr(pattern.length)); + } + } + return ""; +}//returnValueParam + + +// Return a value from a position on the result string +function returnValuePosFromResult(result, pos) +{ + var index; + if ((index = pos.indexOf("-")) > 0) { + var ini = parseInt(pos.substring(0, index) ,10); + var end = parseInt(pos.substr(index + 1) ,10); + return result.substring(ini, end + 1); + } else { + return result.substr(pos, 1); + } +}//returnValuePosFromResult + + +// Build string from form fields +function returnResultFromValues(form) +{ + var resultStr = form.result.value; + var pos; + var value; + for (var i=0; i < form.elements.length; i++) { + var pattern = new RegExp("f[0-9]+(?:[0-9]+)?"); + if (pattern.test(form.elements[i].name)) { + pos = form.elements[i].name.substr(1); + value = (pos.indexOf("-") > 0)?form.elements[i].value:form.elements[i].options[form.elements[i].selectedIndex].value; + resultStr = changePosResult(pos, value, resultStr); + } + } + return resultStr; +}//returnResultFromValues + + +// Build/modify result string for a position and a value +function changePosResult(pos, value, resultStr) +{ + var index; + var result = ""; + if ((index = pos.indexOf("-")) > 0) { + var ini = parseInt(pos.substring(0, index) ,10); + var end = parseInt(pos.substr(index + 1) ,10); + var roffset = (1 + end - ini)- value.length; + if (roffset > 0) for (var i=0; i < roffset; i++) value += " "; + if (ini == 0) + result = value + resultStr.substr(end + 1); + else { + result = resultStr.substring(0, ini) + value; + if (end < resultStr.length) + result += resultStr.substr(end + 1); + } + } else { + var ini = parseInt(pos, 10); + if (ini == 0) + result = value + resultStr.substr(1); + else { + result = resultStr.substring(0, ini) + value; + if (ini < resultStr.length) + result += resultStr.substr(ini + 1); + } + } + result = result.replace(/#/g, " "); + return result; +}//changePosResult + + +// Display the result string on a table indicating positions and coloring them if wrong or selected +function renderResult(tr_result, result) +{ + if (tr_result) { + var td; + if (tr_result.cells.length != result.length) { + for (var i = tr_result.cells.length - 1; i >= 0; i--) + tr_result.deleteCell(i); + for (var i=0; i < result.length; i++) { + value = result.charAt(i); + td = tr_result.insertCell(tr_result.cells.length); + } + } + var value; + var ini = -1; + var end = -1; + var args = renderResult.arguments; + if (args.length > 2) { + var index; + if ((index = args[2].indexOf("-")) > 0) { + ini = parseInt(args[2].substring(0, index) ,10); + end = parseInt(args[2].substr(index + 1) ,10); + } else ini = parseInt(args[2], 10); + } + for (var i=0; i < result.length; i++) { + value = result.charAt(i); + td = tr_result.cells[i]; + if (td.style.backgroundColor != "yellow") td.style.backgroundColor = "white"; + td.innerHTML = (value == " ")?" ":value; + td.title = "Pos " + i + ". Value: \"" + value + "\""; + if (ini >= 0) { + if (end > 0) { + if (ini <= i && i <= end) td.style.backgroundColor = "#cccccc"; + } else if (i == ini) td.style.backgroundColor = "#cccccc"; + } else { + var pos = (i < 10)?'0' + i:i + ''; + var obj; + if ((obj = document.getElementById('f' + pos)) != null) { + var found = false; + for (var j=0; j < obj.options.length && !found; j++) + if (obj.options[j].value == value) found = true; + if (!found) { + td.style.backgroundColor = "yellow"; + td.title = "Pos " + i + ". Bad Value: \"" + value + "\""; + } + } + } + }//for + } +}//renderResult + + +// Change displaying of result in the page +function changeH4Result(form, h4_result, tr_result, pos, value) +{ + var resultStr = form.result.value; + var result = changePosResult(pos, value, resultStr); + renderResult(tr_result, result, pos); + h4_result.innerHTML = result; + form.result.value = result; +}//changeH4Result + + + +// Class to read the xml and render the type of material +(function() +{ + + xmlControlField = function(tagfield, form_id, select, table, h4_result, tr_result, idMaterial) + { + this.tagfield = tagfield; + this.idMaterial = idMaterial; + this.form_id = form_id; + this.form = document.getElementById(form_id); + this.select = select; + this.table = table; + this.h4_result = h4_result; + this.tr_result = tr_result; + };//xmlControlField + + + xmlControlField.prototype = + { + tagfield: "", + idMaterial: "", + root: null, + form_id: "", + form: null, + select: null, + table: null, + h4_result: "", + tr_result: "", + + + setIdMaterial: function(idMaterial) + { + this.idMaterial = idMaterial; + },//setIdMaterial + + loadXmlValues: function() + { + var xmlhttp; + try { + if (window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + if (xmlhttp.overrideMimeType) { + xmlhttp.overrideMimeType('text/xml'); + } + } else if (window.ActiveXObject) { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP") || new ActiveXObject("Msxml2.XMLHTTP"); + } + xmlhttp.open("GET", "/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_" + this.tagfield + ".xml", false); + xmlhttp.send(null); + this.xmlDoc = xmlhttp.responseXML; + if (this.xmlDoc) this.renderTemplate(); + } catch (e) { + //alert(e); + } + },//loadXmlValues + + + renderTemplate: function() + { + this.root = this.xmlDoc.documentElement; + if (this.root.nodeName == "Tagfield" && this.root.nodeType == 1 && this.root.hasChildNodes()) { + var tag = this.root.attributes.getNamedItem("tag").nodeValue; + var nodeMaterial = this.root.getElementsByTagName('Material'); + if (nodeMaterial != null && nodeMaterial.length > 0) { + if (this.idMaterial == "") this.idMaterial = nodeMaterial[0].attributes.getNamedItem("id").nodeValue; + this.renderSelectMaterial(nodeMaterial); + this.renderPositions(nodeMaterial, (this.form.result.value != "")?this.form.result.value:returnValueParam("result")); + } + } + },//renderTemplate + + + renderSelectMaterial: function(nodeMaterial) + { + if (this.select != null && nodeMaterial != null && nodeMaterial.length > 0) { + if (this.select.options.length <= 1) { + var id; + var name; + var arrSort = new Array(); + var arrEquiv = new Array(); + for (var i=0; i < nodeMaterial.length; i++) { + id = nodeMaterial[i].attributes.getNamedItem("id").nodeValue; + name = nodeMaterial[i].attributes.getNamedItem("name").nodeValue; + arrEquiv[id] = i; + arrSort.push(id); + } + arrSort.sort(); + var j; + for (var i=0; i < arrSort.length; i++) { + j = arrEquiv[arrSort[i]]; + add_option(this.select, arrSort[i] + " - " + nodeMaterial[j].attributes.getNamedItem("name").nodeValue, arrSort[i], (this.idMaterial != "" && arrSort[i] == this.idMaterial)?true:false); + } + } else if (this.idMaterial != "") { + for (var i=0; i < this.select.options.length; i++) { + if (this.select.options[i].value == this.idMaterial) this.select.options[i].selected = true; + } + } + } + },//renderSelectMaterial + + + renderPositions: function(nodeMaterial, result) + { + var materialNode; + try { + var resultXPath = this.xmlDoc.evaluate("//a:Material[@id='" + this.idMaterial + "']", this.xmlDoc.documentElement, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null); + materialNode = resultXPath.singleNodeValue; + } catch (e) { + for (var i=0; i < nodeMaterial.length; i++) { + if (this.idMaterial == nodeMaterial[i].attributes.getNamedItem("id").nodeValue) { + materialNode = nodeMaterial[i]; + break; + } + } + } + if (this.table != null) { + var tbody = this.table.tBodies[0]; + if (tbody.rows.length > 0) + for (var i = tbody.rows.length - 1; i >= 1; i--) + tbody.deleteRow(i); + if (materialNode != undefined && materialNode != null && materialNode.nodeType == 1 && materialNode.hasChildNodes()) { + var nodePos = materialNode.firstChild; + var tr; + var td; + var title; + var pos; + var value; + var strInnerHTML = ""; + var selected; + var index; + var url; + while (nodePos != null) { + if (nodePos.nodeType == 1 && nodePos.nodeName == "Position") { + tr = tbody.insertRow(tbody.rows.length); + td = tr.insertCell(tr.cells.length); + pos = nodePos.attributes.getNamedItem("pos").nodeValue; + title = ((nodePos.getAttributeNode("description") || nodePos.hasAttribute("description")) && nodePos.getAttribute("description") != "")?nodePos.attributes.getNamedItem("description").nodeValue:nodePos.attributes.getNamedItem("name").nodeValue; + try { + url = ((nodePos.getAttributeNode("url") || nodePos.hasAttribute("url")) && nodePos.getAttribute("url") != "" && nodePos.getAttribute("urltext") != "")?" " + nodePos.attributes.getNamedItem("urltext").nodeValue + "":""; + } catch (e) { url = "";} + td.innerHTML = ""; + td = tr.insertCell(tr.cells.length); + value = returnValuePosFromResult(result, pos); + if ((index = pos.indexOf("-")) > 0) { + var ini = parseInt(pos.substring(0, index) ,10); + var end = parseInt(pos.substr(index + 1) ,10); + value = value.replace(/ /g, "#"); + strInnerHTML = ""; + } else { + strInnerHTML = ""; + } + //alert(strInnerHTML); + td.innerHTML = strInnerHTML; + } + nodePos = nodePos.nextSibling; + } + } + } + }//renderPositions + }; + +})(); + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref old mode 100644 new mode 100755 index d809022..0c3bd46 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -118,4 +118,10 @@ Cataloging: yes: Hide no: "Don't hide" - items marked as suppressed from OPAC search results. Note that you must have the Suppress index set up in Zebra and at least one suppressed item, or your searches will be broken. + - + - pref: TypeOfMaterialsView_006_008 + choices: + yes: "Don't hide" + no: Hide + - 006/008 plugins show Type of Materials and change fields form to view the allowed values for the different positions. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl old mode 100644 new mode 100755 index ab2a079..7240639 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl @@ -1,14 +1,67 @@ Koha › Cataloging › 006 builder + + + + + + - +onload="loadXmlValues()">

    006 Fixed-length data elements--Additional material characteristics--General information

    - + + + + + +
    +

    + + + - - - + +" /> +
    + + + + + + + + - - + + + - + - + - - + + + + - - - - + + + + - + +
    + +
    -
    01-04 Illustrations (auto-filled from 300)"/>
    @@ -119,7 +172,7 @@ - + @@ -175,7 +228,7 @@
    @@ -246,7 +299,7 @@ -
    15 Undefined
    15 Undefined
    Cancel
    @@ -510,24 +564,27 @@ function report() { var doc = opener.document; var field = doc.getElementById(""); - + + field.value = document.getElementById("h4_result").innerHTML; + field.value = - ''+ - document.f_pop.f0.value+ - document.f_pop.f014.value+ - document.f_pop.f5.value+ - document.f_pop.f6.value+ - document.f_pop.f710.value+ - document.f_pop.f11.value+ - document.f_pop.f12.value+ - document.f_pop.f13.value+ - document.f_pop.f14.value+ ' '+ - document.f_pop.f16.value+ - document.f_pop.f17.value; - self.close(); - return false; - } - //]]> + ''+ + document.f_pop.f0.value+ + document.f_pop.f014.value+ + document.f_pop.f5.value+ + document.f_pop.f6.value+ + document.f_pop.f710.value+ + document.f_pop.f11.value+ + document.f_pop.f12.value+ + document.f_pop.f13.value+ + document.f_pop.f14.value+ ' '+ + document.f_pop.f16.value+ + document.f_pop.f17.value; + + self.close(); + return false; + } + //]]> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml new file mode 100755 index 0000000..9ea0417 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml @@ -0,0 +1,795 @@ + + + + + a + t + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + o + p + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 2 + 5 + 6 + a + b + c + d + e + f + g + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + 0 + 1 + | + + + 0 + 1 + | + + + + 0 + 1 + d + e + f + h + i + j + m + p + s + u + | + + + # + a + b + c + d + | + + + + + m + + + + # + a + b + c + d + e + f + g + j + | + + + # + o + q + | + + + + a + b + c + d + e + f + g + h + i + j + m + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + + + + e + f + + + # + a + b + c + d + e + f + g + i + j + k + m + z + |||| + + + ## + aa + ab + ac + ad + ae + af + ag + am + an + ap + au + az + ba + bb + bc + bd + be + bf + bg + bh + bi + bj + bk + bl + bo + br + bs + bu + bz + ca + cb + cc + ce + cp + cu + cz + da + db + dc + dd + de + df + dg + dh + dl + zz + | + + + + a + b + c + d + e + f + g + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + 0 + 1 + | + + + + # + e + j + k + l + n + o + p + r + z + | + + + + + c + d + i + j + + + an + bd + bg + bl + bt + ca + cb + cc + cg + ch + cl + cn + co + cp + cr + cs + ct + cy + cz + df + dv + fg + fl + fm + ft + gm + hy + jz + mc + md + mi + mo + mp + mr + ms + mu + mz + nc + nn + op + or + ov + pg + pm + po + pp + pr + ps + pt + pv + rc + rd + rg + ri + rp + rq + sd + sg + sn + sp + st + su + sy + tc + tl + ts + uu + vi + vr + wz + za + zz + || + + + a + b + c + d + e + g + h + i + j + m + n + u + z + | + + + # + d + e + f + n + u + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + a + b + c + d + e + f + g + h + i + k + r + s + z + | + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + r + s + t + z + | + + + + # + a + b + c + n + u + | + + + + + + s + + + # + a + b + c + d + e + f + g + h + i + j + k + m + q + s + t + u + w + z + | + + + n + r + u + x + | + + + + # + d + l + m + n + p + w + | + + + # + a + b + c + d + e + f + o + q + s + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + z + ||| + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + + # + a + b + c + d + e + f + g + h + i + j + k + l + u + z + | + + + 0 + 1 + 2 + | + + + + + g + k + o + r + + + 000 + 001-999 + nnn + ||| + ??????????????????????? --- + + + + # + a + b + c + d + e + f + g + j + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + a + b + c + d + f + g + i + k + l + m + n + o + p + q + r + s + t + v + w + z + | + + + a + c + l + n + u + z + | + + + + + p + + + + # + a + b + c + d + f + o + q + r + s + | + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl old mode 100644 new mode 100755 index 9dddccb..b232466 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl @@ -1,282 +1,335 @@ Koha › Cataloging › 008 builder + + + + + + - +onload="loadXmlValues()">

    008 Fixed-length data elements--General information

    -
    + + + + + +
    +

    + + + - - - - - - - - - - + - - + + @@ -148,6 +154,7 @@ +
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tmpl index ad675d1..dcb57a2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tmpl @@ -24,7 +24,8 @@
    Cloning of issuing rules failed!
    -

    The rules have been cloned.

    +

    The rules have ">been cloned.

    + Return to Issuing rules diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl index 92a44ce..f7f76fe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl @@ -6,9 +6,145 @@ //tbody>tr>td.editable').click(function() { + if ( ! editor ) { + var td = $(this); + var tdvalue = td.text().trim(); + td.text(''); + + var type; + if ( $.inArray('boolean', td.attr('class').split(' ')) != -1 ) { // If the td is boolean, we display a checkbox + editor = $(''); + editor.attr('checked', tdvalue == 'Yes' ? 'checked' : ''); + type = 'boolean'; + } else if ( $.inArray('triple', td.attr('class').split(' ')) != -1 ) { // else if it is a triple, we display a listbox + var selectedn = tdvalue == '' ? 'selected="selected"' : ''; + var selected1 = tdvalue == 'Yes' ? 'selected="selected"' : ''; + var selected0 = tdvalue == 'No' ? 'selected="selected"' : ''; + var str = ''; + editor = $(str); + type = 'triple'; + } else { // else we display a textbox + editor = $(''); + editor.attr('value', tdvalue); + } + + editor.focus(); + + editor.keyup(function(e) { // on press + if ( e.keyCode == 13 ) { // enter + + // let's build the atomic rule + var branchcode = $('#branchcode').val(); + var categorycode = td.parent().children('td.categorycode').children('span').text(); + var itemtype = td.parent().children('td.itemtype').children('span').text(); + var varname = td.attr('class').split(' ')[0]; + var inputvalue; + switch ( type ) { + case 'boolean': + inputvalue = editor.attr('checked') ? 1 : 0; + break; + default: + inputvalue = editor.val(); + break; + } + + // post it to the server + $.ajax({ + url: '/cgi-bin/koha/admin/smart-rules-service.pl', + type: "POST", + async: false, + data: "branchcode="+branchcode+"&categorycode="+categorycode+"&itemtype="+itemtype+"&varname="+varname+"&inputvalue="+inputvalue, + success: function(result) { + + // repopulate the td with data + switch ( type ) { + case 'boolean': + td.text(result == '1' ? 'Yes' : 'No'); + break; + case 'triple': + switch ( result ) { + case '' : td.text(''); break; + case '1': td.text('Yes'); break; + case '0': td.text('No'); break; + } + break; + default: + td.text(result); + break; + } + + editor.remove(); + editor = false; + } + }); + } + }); + + td.append(editor); + } + }); }); //]]> @@ -32,25 +168,11 @@ $(document).ready(function() { Defining circulation and fine rules for all libraries -
    -

    The rules are applied from most specific to less specific, using the first found in this order:

    -
      -
    • same library, same patron type, same item type
    • -
    • same library, same patron type, all item types
    • -
    • same library, all patron types, same item type
    • -
    • same library, all patron types, all item types
    • -
    • all libraries, same patron type, same item type
    • -
    • all libraries, same patron type, all item types
    • -
    • all libraries, all patron types, same item type
    • -
    • all libraries, all patron types, all item types
    • -
    -

    To modify a rule, create a new one with the same patron type and item type.

    -
    -
    +
    Select a library : - + @@ -60,272 +182,223 @@ $(document).ready(function() { for="tobranch">Clone these rules to: " /> -
    - -
    1-5 Date entered on file (auto-filled)" />
    - - - +" /> + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - + + + + - - + + + + + "/> + - + + + - - + + + + - - - - + + + + + - + - + - + - - + +
    + +
    " />
    + + + -
    - "/> -
    - "/>
    See MARC Code List for Countries - "/> -
    "/>
    + "/> +
    + "/> +
    See MARC Code List for Countries + "/> +
    "/> +
    - + -
    - - + - - + + - + - + - + - + - + - + - -
    - "/>
    - - + @@ -288,7 +341,7 @@ - + @@ -309,67 +362,67 @@ - + - + - + - + - + - -
    - - + - -
    - - + @@ -381,7 +434,7 @@
    - @@ -400,13 +453,14 @@
    32 Undefined
    32 Undefined
    - @@ -417,12 +471,12 @@ - + - + @@ -436,32 +490,32 @@ - + - + - + - + - + @@ -479,7 +533,7 @@ - + @@ -487,14 +541,13 @@ -
    - @@ -514,7 +567,7 @@ - + @@ -523,60 +576,60 @@
    See MARC Code List for Languages - "/> + "/>
    - + +
    - @@ -588,20 +641,21 @@ - + - + - +
    Cancel
    @@ -611,49 +665,62 @@ // Pad the string with spaces so that it is 4 characters long. // Also, truncate strings that are longer than 4 characters. function pad4(s) { - var pad = ""; - if (s.length < 4) { - var padLength = 4 - s.length; - for (var i = 0; i < 4 - s.length; i++) { - pad += " "; - } - s += pad; - } else { - s = s.substring(0, 4); - } - return s; + var pad = ""; + if (s.length < 4) { + var padLength = 4 - s.length; + for (var i = 0; i < 4 - s.length; i++) { + pad += " "; + } + s += pad; + } else { + s = s.substring(0, 4); + } + return s; } + +function parseField() +{ + var result = ""; + result = document.f_pop.f1.value+ + document.f_pop.f6.value+ + // bug 2563 { + ( document.f_pop.f710.value.match(/^\s*$/) ? " " : pad4(document.f_pop.f710.value) )+ + ( document.f_pop.f1114.value.match(/^\s*$/) ? " " : pad4(document.f_pop.f1114.value) )+ + // } + //MR + (document.f_pop.f1517.value+" ").substr(0,3)+ + (document.f_pop.f1821.value+" ").substr(0,4)+ + document.f_pop.f22.value+ + document.f_pop.f23.value+ + (document.f_pop.f2427.value+" ").substr(0,4)+ + document.f_pop.f28.value+ + document.f_pop.f29.value+ + document.f_pop.f30.value+ + document.f_pop.f31.value+ ' '+ + document.f_pop.f33.value+ + document.f_pop.f34.value+ + //MR + (document.f_pop.f3537.value+" ").substr(0,3)+ + document.f_pop.f38.value+ + document.f_pop.f39.value; + return result; +}//parseField + + function report() { - var doc = opener.document; + var doc = opener.document; var field = doc.getElementById(""); - field.value = - document.f_pop.f1.value+ - document.f_pop.f6.value+ - // bug 2563 { - ( document.f_pop.f710.value.match(/^\s*$/) ? " " : pad4(document.f_pop.f710.value) )+ - ( document.f_pop.f1114.value.match(/^\s*$/) ? " " : pad4(document.f_pop.f1114.value) )+ - // } - //MR - (document.f_pop.f1517.value+" ").substr(0,3)+ - (document.f_pop.f1821.value+" ").substr(0,4)+ - document.f_pop.f22.value+ - document.f_pop.f23.value+ - (document.f_pop.f2427.value+" ").substr(0,4)+ - document.f_pop.f28.value+ - document.f_pop.f29.value+ - document.f_pop.f30.value+ - document.f_pop.f31.value+ ' '+ - document.f_pop.f33.value+ - document.f_pop.f34.value+ - //MR - (document.f_pop.f3537.value+" ").substr(0,3)+ - document.f_pop.f38.value+ - document.f_pop.f39.value; - self.close(); - return false; - } - //]]> + + field.value = document.getElementById("h4_result").innerHTML; + + field.value = parseField(); + + + self.close(); + return false; + } + //]]> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml new file mode 100755 index 0000000..c8c7295 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml @@ -0,0 +1,1298 @@ + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + o + p + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 2 + 5 + 6 + a + b + c + d + e + f + g + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + 0 + 1 + | + + + 0 + 1 + | + + + + 0 + 1 + d + e + f + h + i + j + m + p + s + u + | + + + # + a + b + c + d + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + + # + a + b + c + d + e + f + g + j + | + + + # + o + q + | + + + + a + b + c + d + e + f + g + h + i + j + m + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + # + a + b + c + d + e + f + g + i + j + k + m + z + |||| + + + ## + aa + ab + ac + ad + ae + af + ag + am + an + ap + au + az + ba + bb + bc + bd + be + bf + bg + bh + bi + bj + bk + bl + bo + br + bs + bu + bz + ca + cb + cc + ce + cp + cu + cz + da + db + dc + dd + de + df + dg + dh + dl + zz + | + + + + a + b + c + d + e + f + g + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + 0 + 1 + | + + + + # + e + j + k + l + n + o + p + r + z + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + an + bd + bg + bl + bt + ca + cb + cc + cg + ch + cl + cn + co + cp + cr + cs + ct + cy + cz + df + dv + fg + fl + fm + ft + gm + hy + jz + mc + md + mi + mo + mp + mr + ms + mu + mz + nc + nn + op + or + ov + pg + pm + po + pp + pr + ps + pt + pv + rc + rd + rg + ri + rp + rq + sd + sg + sn + sp + st + su + sy + tc + tl + ts + uu + vi + vr + wz + za + zz + || + + + a + b + c + d + e + g + h + i + j + m + n + u + z + | + + + # + d + e + f + n + u + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + a + b + c + d + e + f + g + h + i + k + r + s + z + | + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + r + s + t + z + | + + + + # + a + b + c + n + u + | + + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + # + a + b + c + d + e + f + g + h + i + j + k + m + q + s + t + u + w + z + | + + + n + r + u + x + | + + + + # + d + l + m + n + p + w + | + + + # + a + b + c + d + e + f + o + q + s + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + z + ||| + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + + # + a + b + c + d + e + f + g + h + i + j + k + l + u + z + | + + + 0 + 1 + 2 + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + 000 + 001-999 + nnn + ||| + ??????????????????????? --- + + + + # + a + b + c + d + e + f + g + j + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + a + b + c + d + f + g + i + k + l + m + n + o + p + q + r + s + t + v + w + z + | + + + a + c + l + n + u + z + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + + # + a + b + c + d + f + o + q + r + s + | + + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd new file mode 100755 index 0000000..7b0b27b --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd @@ -0,0 +1,83 @@ + + + + Control Field Plugin Type of Materials schema + + + + + + Element indicating the control field + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kohaversion.pl b/kohaversion.pl old mode 100644 new mode 100755 -- 1.7.2.3 From nengard at bywatersolutions.com Fri Mar 4 02:49:12 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 3 Mar 2011 20:49:12 -0500 Subject: [Koha-patches] [PATCH 2/2] Follow up to Bug 3013: fix preference language Message-ID: <1299203352-4534-1-git-send-email-nengard@bywatersolutions.com> In the English preferences I have updated the language so that it makes more sense. Signed-off-by: Nicole C. Engard --- .../en/modules/admin/preferences/cataloguing.pref | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index 0c3bd46..c913aac 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -31,7 +31,7 @@ Cataloging: yes: Display no: "Don't display" - buttons on the bib details page to print item spine labels. - - + Record Structure: - - Interpret and store MARC records in the @@ -119,9 +119,9 @@ Cataloging: no: "Don't hide" - items marked as suppressed from OPAC search results. Note that you must have the Suppress index set up in Zebra and at least one suppressed item, or your searches will be broken. - + - The plugins for the 006 and 008 fields should - pref: TypeOfMaterialsView_006_008 choices: - yes: "Don't hide" - no: Hide - - 006/008 plugins show Type of Materials and change fields form to view the allowed values for the different positions. - + yes: show + no: not show + - advanced plugins to allow for proper selection of values based on material type. \ No newline at end of file -- 1.7.2.3 From nengard at bywatersolutions.com Fri Mar 4 05:13:00 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 3 Mar 2011 23:13:00 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] bug 5693 - mc-ccode parens fix Message-ID: <1299211980-5107-1-git-send-email-nengard@bywatersolutions.com> From: Reed Wade Signed-off-by: Nicole C. Engard --- C4/Search.pm | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 45ebb24..26dc67f 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1276,7 +1276,14 @@ sub buildQuery { # group_OR_limits, prefixed by mc- # OR every member of the group elsif ( $this_limit =~ /mc/ ) { -# if ( $this_limit =~ /mc/ ) { + + if ( $this_limit =~ /mc-ccode:/ ) { + # in case the mc-ccode value has complicating chars like ()'s inside it we wrap in quotes + $this_limit =~ tr/"//d; + my ($k,$v) = split(/:/, $this_limit,2); + $this_limit = $k.":\"".$v."\""; + } + $group_OR_limits .= " or " if $group_OR_limits; $limit_desc .= " or " if $group_OR_limits; $group_OR_limits .= "$this_limit"; -- 1.7.2.3 From mdhafen at tech.washk12.org Fri Mar 4 17:19:33 2011 From: mdhafen at tech.washk12.org (Mike Hafen) Date: Fri, 4 Mar 2011 09:19:33 -0700 Subject: [Koha-patches] [PATCH] Bug 3013 - 006/008 Type of Material Display on cataloguing plugin for MARC21 In-Reply-To: <1299241029-10651-1-git-send-email-salvazm@masmedios.com> References: <1299241029-10651-1-git-send-email-salvazm@masmedios.com> Message-ID: You probably don't want that merge conflict marker in there. On Fri, Mar 4, 2011 at 5:17 AM, Salvador Zaragoza Rubio < salvazm at masmedios.com> wrote: > Modification of the intranet cataloguing plugin for 006/008 fields to allow > select a type of material and change the positions available to enter the > data. > Data are hard stored in xml files to allow easy translation and processing > through > Javascript and AJAX. > > Follow-up fix for Bug 3013 - 006/008 Type of Material Display on > cataloguing plugin for MARC21 > > Add url functionality in the xml and updatedatabase > > Signed-off-by: Salvador Zaragoza Rubio > --- > > --- > a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql > +++ > b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql > @@ -287,5 +287,7 @@ INSERT INTO systempreferences > (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding > items for the shelf browser.','1','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when > finding items for the shelf browser.','1','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when > finding items for the shelf browser.','0','YesNo'); > +<<<<<<< > HEAD:installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to > patrons with fines greater than noissuescharge.','0','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override > every fine, even if it is below noissuescharge.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for > plugin of fields 006 and 008 when cataloguing','','YesNo'); > diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql > b/installer/data/mysql/it-IT/necessari/sysprefs.sql > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gmcharlt at gmail.com Fri Mar 4 17:29:05 2011 From: gmcharlt at gmail.com (Galen Charlton) Date: Fri, 4 Mar 2011 11:29:05 -0500 Subject: [Koha-patches] [PATCH] Bug 3013 - 006/008 Type of Material Display on cataloguing plugin for MARC21 In-Reply-To: <1299241029-10651-1-git-send-email-salvazm@masmedios.com> References: <1299241029-10651-1-git-send-email-salvazm@masmedios.com> Message-ID: Hi, On Fri, Mar 4, 2011 at 7:17 AM, Salvador Zaragoza Rubio wrote: > Modification of the intranet cataloguing plugin for 006/008 fields to allow > select a type of material and change the positions available to enter the data. > Data are hard stored in xml files to allow easy translation and processing through > Javascript and AJAX. Good idea. However, I think that there is no need for yet another system preference; IMO the user would gain nothing by leaving TypeOfMaterialsView_006_008 off. I do have have a serious concern with one aspect of the implementation -- new JavaScript code should not be invoking XMLHttpRequest directly. Please use jQuery. Regards, Galen -- Galen Charlton gmcharlt at gmail.com From f.demians at tamil.fr Fri Mar 4 18:20:05 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Fri, 4 Mar 2011 18:20:05 +0100 Subject: [Koha-patches] [PATCH] Bug 5830 Using XSLT on OPAC Lists page Message-ID: <1299259205-17878-1-git-send-email-f.demians@tamil.fr> On OPAC Lists page (opac-shelves.pl), biblio records are now displayed accordingly to OPACXSLTResultsDisplay system preference. --- C4/VirtualShelves/Page.pm | 7 ++++++- .../opac-tmpl/prog/en/modules/opac-shelves.tmpl | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 66c614d..3614c24 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -35,6 +35,7 @@ use C4::Tags qw(get_tags); use Exporter; use Data::Dumper; use C4::Csv; +use C4::XSLT; use vars qw($debug @EXPORT @ISA $VERSION); @@ -201,7 +202,11 @@ sub shelfpage ($$$$$) { } ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset ); for my $this_item (@$items) { - my $record = GetMarcBiblio( $this_item->{'biblionumber'} ); + my $biblionumber = $this_item->{'biblionumber'}; + my $record = GetMarcBiblio($biblionumber); + $this_item->{XSLTBloc} = + XSLTParse4Display($biblionumber, $record, 'Results', 'opac') + if C4::Context->preference("OPACXSLTResultsDisplay"); # the virtualshelfcontents table does not store these columns nor are they retrieved from the items # and itemtypes tables, so I'm commenting them out for now to quiet the log -crn diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl index 1e1d2d5..4646365 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl @@ -249,6 +249,10 @@ $(function() {
    + + + + " title="View details for this title"> " title="View details for this title"> @@ -272,7 +276,7 @@ $(function() { ()., This record has no items. - + -- 1.7.4 From f.demians at tamil.fr Fri Mar 4 20:05:24 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Fri, 4 Mar 2011 20:05:24 +0100 Subject: [Koha-patches] [PATCH] Bug 5830 Using XSLT on OPAC Lists page Message-ID: <1299265524-6924-1-git-send-email-f.demians@tamil.fr> On OPAC Lists page (opac-shelves.pl), biblio records are now displayed accordingly to OPACXSLTResultsDisplay system preference. --- C4/VirtualShelves/Page.pm | 9 ++- .../opac-tmpl/prog/en/includes/biblioresult.inc | 61 +++++++++++++++++++ .../opac-tmpl/prog/en/modules/opac-results.tmpl | 64 +------------------- .../opac-tmpl/prog/en/modules/opac-shelves.tmpl | 24 +------- 4 files changed, 71 insertions(+), 87 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/prog/en/includes/biblioresult.inc diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 66c614d..4d9ccb6 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -35,6 +35,7 @@ use C4::Tags qw(get_tags); use Exporter; use Data::Dumper; use C4::Csv; +use C4::XSLT; use vars qw($debug @EXPORT @ISA $VERSION); @@ -201,7 +202,11 @@ sub shelfpage ($$$$$) { } ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset ); for my $this_item (@$items) { - my $record = GetMarcBiblio( $this_item->{'biblionumber'} ); + my $biblionumber = $this_item->{'biblionumber'}; + my $record = GetMarcBiblio($biblionumber); + $this_item->{XSLTResultsRecord} = + XSLTParse4Display($biblionumber, $record, 'Results', 'opac') + if C4::Context->preference("OPACXSLTResultsDisplay"); # the virtualshelfcontents table does not store these columns nor are they retrieved from the items # and itemtypes tables, so I'm commenting them out for now to quiet the log -crn @@ -218,7 +223,7 @@ sub shelfpage ($$$$$) { # Getting items infos for location display my @items_infos = &GetItemsInfo( $this_item->{'biblionumber'}, $type ); $this_item->{'itemsissued'} = CountItemsIssued( $this_item->{'biblionumber'} ); - $this_item->{'ITEM_RESULTS'} = \@items_infos; + $this_item->{available_items_loop} = \@items_infos; if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnList')) { $this_item->{'TagLoop'} = get_tags({ diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/biblioresult.inc b/koha-tmpl/opac-tmpl/prog/en/includes/biblioresult.inc new file mode 100644 index 0000000..ab404f5 --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/includes/biblioresult.inc @@ -0,0 +1,61 @@ + + + +" title="View details for this title"> + +" title="View details for this title"> +" title="View details for this title"> + + + No title +by " title="Search for works by this author" class="author"> +  + + Publication: + + +. +, + + (modified on ) + + + + + + +Date: + + +Availability: + +Copies available: + + + + + + + + + + +[">] + +(), + + + +No items available: + + + Checked out (), + Withdrawn (), + Lost (), + Damaged (), + On order (), + On hold (), + In transit (), + + + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl index d7aff2e..9a646ad 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl @@ -398,68 +398,8 @@ $(document).ready(function(){ "> - - - - " title="View details for this title"> - - " title="View details for this title"> - " title="View details for this title"> - - - No title - by " title="Search for works by this author" class="author"> -   - - Publication: - - - . - , - - (modified on ) - - - - - - - Date: - - - Availability: - - Copies available: - - - - - - - - - - - [">] - - (), - - - - No items available: - - - Checked out (), - Withdrawn (), - Lost (), - Damaged (), - On order (), - On hold (), - In transit (), - - + -
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl index 1e1d2d5..b882cd7 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl @@ -249,29 +249,7 @@ $(function() {
    - " title="View details for this title"> - - " title="View details for this title"> - " title="View details for this title"> - - - No title - by " title="Search for works by this author" class="author"> -   - - Publication: - - - . - , - - - Holdings: - , - - ()., - - This record has no items. + -- 1.7.4 From lrea at nekls.org Fri Mar 4 20:04:43 2011 From: lrea at nekls.org (Liz Rea) Date: Fri, 4 Mar 2011 13:04:43 -0600 Subject: [Koha-patches] [PATCH] [SIGNED OFF] Bug 3595 (partial): Items seen at checkin are not filling holds well Message-ID: <1299265483-19375-1-git-send-email-lrea@nekls.org> From: ruth at bywatersolutions.com In Liz's second comment on this bug, she points out that local-only holds (and also no-holds) items are being used to fill the first hold in the queue, no matter where located, transitting if necessary. If all the items on a biblio are set to no-holds types, this problem would never arise, as no holds could be *placed*. But if you have one or more unlimitedor local-hold items, then holds are getting filled by the first item to cross a scanner, no matter what. This patch will check during C4::Reserves::CheckReserves to make sure that the hold being handed back to AddReturn is actually fillable by the item just scanned. One caveat: If CircControl is set to "the library you are logged in at", this will cause items checked in at other-than-their-home-library to fill local holds at the library where scanned. This is, however, an edge case! Signed-off-by: Liz Rea --- C4/Reserves.pm | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 2dd2688..ca8f2fb 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -804,6 +804,12 @@ sub CheckReserves { } else { # See if this item is more important than what we've got so far if ( $res->{'priority'} && $res->{'priority'} < $priority ) { + my $borrowerinfo=C4::Members::GetMemberDetails($res->{'borrowernumber'}); + my $iteminfo=C4::Items::GetItem($itemnumber); + my $branch=C4::Circulation::_GetCircControlBranch($iteminfo,$borrowerinfo); + my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$iteminfo->{'itype'}); + next if ($branchitemrule->{'holdallowed'} == 0); + next if (($branchitemrule->{'holdallowed'} == 1) && ($branch ne $borrowerinfo->{'branchcode'})); $priority = $res->{'priority'}; $highest = $res; } -- 1.5.6.5 From ruth at bywatersolutions.com Fri Mar 4 21:08:22 2011 From: ruth at bywatersolutions.com (ruth at bywatersolutions.com) Date: Fri, 4 Mar 2011 15:08:22 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5831: rebuild_zebra.pl doesn't respect -r Message-ID: <1299269302-2399-1-git-send-email-ruth@bywatersolutions.com> From: Ian Walls Reimplements support for -r, as well for -reset Signed-off-by: D Ruth Bavousett --- misc/migration_tools/rebuild_zebra.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index bd11494..682c280 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/misc/migration_tools/rebuild_zebra.pl @@ -37,7 +37,7 @@ my $verbose_logging; my $zebraidx_log_opt = " -v none,fatal,warn "; my $result = GetOptions( 'd:s' => \$directory, - 'reset' => \$reset, + 'r|reset' => \$reset, 's' => \$skip_export, 'k' => \$keep_export, 'nosanitize' => \$nosanitize, -- 1.7.2.3 From salvazm at masmedios.com Fri Mar 4 21:11:53 2011 From: salvazm at masmedios.com (Salvador Zaragoza Rubio) Date: Fri, 4 Mar 2011 21:11:53 +0100 Subject: [Koha-patches] [PATCH] Follow up to Bug 3013: fix merge conflict marker and replace XMLHttpRequest with jQuery In-Reply-To: References: Message-ID: <1299269513-17629-1-git-send-email-salvazm@masmedios.com> Erase merge conflict marker left on unimarc_standard_systemprefs.sql. Replace XMLHttpRequest call for xml with jQuery Ajax interface. Delete alert. --- .../1-Obligatoire/unimarc_standard_systemprefs.sql | 1 - .../intranet-tmpl/prog/en/js/xmlControlfield.js | 50 ++++++++----------- 2 files changed, 21 insertions(+), 30 deletions(-) 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 7a1d90e..bdf7b27 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 @@ -287,7 +287,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); -<<<<<<< HEAD:installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TypeOfMaterialsView_006_008','0','Display Type of Materials for plugin of fields 006 and 008 when cataloguing','','YesNo'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js b/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js index 67b0bf5..47f014c 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js @@ -174,8 +174,8 @@ function changeH4Result(form, h4_result, tr_result, pos, value) this.h4_result = h4_result; this.tr_result = tr_result; };//xmlControlField - - + + xmlControlField.prototype = { tagfield: "", @@ -187,35 +187,28 @@ function changeH4Result(form, h4_result, tr_result, pos, value) table: null, h4_result: "", tr_result: "", - - + + setIdMaterial: function(idMaterial) { this.idMaterial = idMaterial; },//setIdMaterial - + loadXmlValues: function() { - var xmlhttp; - try { - if (window.XMLHttpRequest) { - xmlhttp = new XMLHttpRequest(); - if (xmlhttp.overrideMimeType) { - xmlhttp.overrideMimeType('text/xml'); - } - } else if (window.ActiveXObject) { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP") || new ActiveXObject("Msxml2.XMLHTTP"); - } - xmlhttp.open("GET", "/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_" + this.tagfield + ".xml", false); - xmlhttp.send(null); - this.xmlDoc = xmlhttp.responseXML; - if (this.xmlDoc) this.renderTemplate(); - } catch (e) { - //alert(e); - } + this.xmlDoc = $.ajax({ + type: "GET", + url: "/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_" + this.tagfield + ".xml", + dataType: "xml", + async: false + }).responseXML; + if (this.xmlDoc) this.renderTemplate(); + $("*").ajaxError(function(evt, request, settings){ + alert("AJAX error: failed data receiving"); + }); },//loadXmlValues - - + + renderTemplate: function() { this.root = this.xmlDoc.documentElement; @@ -229,8 +222,8 @@ function changeH4Result(form, h4_result, tr_result, pos, value) } } },//renderTemplate - - + + renderSelectMaterial: function(nodeMaterial) { if (this.select != null && nodeMaterial != null && nodeMaterial.length > 0) { @@ -258,8 +251,8 @@ function changeH4Result(form, h4_result, tr_result, pos, value) } } },//renderSelectMaterial - - + + renderPositions: function(nodeMaterial, result) { var materialNode; @@ -327,7 +320,6 @@ function changeH4Result(form, h4_result, tr_result, pos, value) } strInnerHTML += ""; } - //alert(strInnerHTML); td.innerHTML = strInnerHTML; } nodePos = nodePos.nextSibling; -- 1.5.6.5 From cnighswonger at foundations.edu Sat Mar 5 01:09:07 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Fri, 4 Mar 2011 19:09:07 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5811: Add sysprefs to control overriding fines In-Reply-To: <1298256903-25751-1-git-send-email-nengard@bywatersolutions.com> References: <1298256903-25751-1-git-send-email-nengard@bywatersolutions.com> Message-ID: This patch does not apply cleanly to 3.2.x. Please fixup and resubmit with [3.2.x] in the subject line. Kind Regards, Chris # On branch 3.2.x # Your branch is ahead of 'origin/3.2.x' by 3 commits. # # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # modified: C4/Circulation.pm # modified: C4/Members.pm # modified: koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref # # Unmerged paths: # (use "git reset HEAD ..." to unstage) # (use "git add/rm ..." as appropriate to mark resolution) # # both modified: installer/data/mysql/de-DE/mandatory/sysprefs.sql # both modified: installer/data/mysql/en/mandatory/sysprefs.sql # both modified: installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql # both modified: installer/data/mysql/it-IT/necessari/sysprefs.sql # both modified: installer/data/mysql/pl-PL/mandatory/sysprefs.sql # both modified: installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql # both modified: installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql # both modified: installer/data/mysql/updatedatabase.pl # On Sun, Feb 20, 2011 at 9:55 PM, Nicole C. Engard < nengard at bywatersolutions.com> wrote: > From: Jared Camins-Esakov > > This patch adds two sysprefs to allow libraries more fine-grained control > over > when fines can and can't be overridden. The two sysprefs are: > * AllFinesNeedOverride - when this syspref is set to "Require" (default) > any > fine will require a staffmember to override the fine in order to check > out a > book. When set to "Don't require," fines below noissuescharge will not > need > any override. > * AllowFineOverride - when this syspref is set to "Allow," staff will be > able to > override fines that are above noissuescharge. When set to "Don't allow" > (default), staff will not be able to check out items to patrons with > fines > greater than noissuescharge. > > Signed-off-by: Nicole C. Engard > --- > C4/Circulation.pm | 17 > ++++++++++++----- > C4/Members.pm | 2 +- > installer/data/mysql/de-DE/mandatory/sysprefs.sql | 2 ++ > installer/data/mysql/en/mandatory/sysprefs.sql | 2 ++ > .../1-Obligatoire/unimarc_standard_systemprefs.sql | 4 +++- > installer/data/mysql/it-IT/necessari/sysprefs.sql | 4 +++- > installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 4 +++- > ...m_preferences_full_optimal_for_install_only.sql | 4 +++- > ...m_preferences_full_optimal_for_install_only.sql | 4 +++- > installer/data/mysql/updatedatabase.pl | 8 ++++++++ > .../en/modules/admin/preferences/circulation.pref | 12 ++++++++++++ > 11 files changed, 52 insertions(+), 11 deletions(-) > > diff --git a/C4/Circulation.pm b/C4/Circulation.pm > index f7846ac..2b4e86c 100644 > --- a/C4/Circulation.pm > +++ b/C4/Circulation.pm > @@ -730,17 +730,24 @@ sub CanBookBeIssued { > # DEBTS > my ($amount) = > C4::Members::GetMemberAccountRecords( $borrower->{'borrowernumber'}, > '' && $duedate->output('iso') ); > + my $amountlimit = C4::Context->preference("noissuescharge"); > + my $allowfineoverride = C4::Context->preference("AllowFineOverride"); > + my $allfinesneedoverride = > C4::Context->preference("AllFinesNeedOverride"); > if ( C4::Context->preference("IssuingInProcess") ) { > - my $amountlimit = C4::Context->preference("noissuescharge"); > - if ( $amount > $amountlimit && !$inprocess ) { > + if ( $amount > $amountlimit && !$inprocess && !$allowfineoverride) > { > $issuingimpossible{DEBT} = sprintf( "%.2f", $amount ); > - } > - elsif ( $amount > 0 && $amount <= $amountlimit && !$inprocess ) { > + } elsif ( $amount > $amountlimit && !$inprocess && > $allowfineoverride) { > + $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); > + } elsif ( $allfinesneedoverride && $amount > 0 && $amount <= > $amountlimit && !$inprocess ) { > $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); > } > } > else { > - if ( $amount > 0 ) { > + if ( $amount > $amountlimit && $allowfineoverride ) { > + $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); > + } elsif ( $amount > $amountlimit && !$allowfineoverride) { > + $issuingimpossible{DEBT} = sprintf( "%.2f", $amount ); > + } elsif ( $amount > 0 && $allfinesneedoverride ) { > $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); > } > } > diff --git a/C4/Members.pm b/C4/Members.pm > index fafc99b..a292054 100644 > --- a/C4/Members.pm > +++ b/C4/Members.pm > @@ -444,7 +444,7 @@ sub patronflags { > my $noissuescharge = C4::Context->preference("noissuescharge") || > 5; > $flaginfo{'message'} = sprintf "Patron owes \$%.02f", $amount; > $flaginfo{'amount'} = sprintf "%.02f", $amount; > - if ( $amount > $noissuescharge ) { > + if ( $amount > $noissuescharge && > !C4::Context->preference("AllowFineOverride") ) { > $flaginfo{'noissues'} = 1; > } > $flags{'CHARGES'} = \%flaginfo; > diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql > b/installer/data/mysql/de-DE/mandatory/sysprefs.sql > index 02511d8..221017a 100644 > --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql > +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql > @@ -285,3 +285,5 @@ INSERT INTO systempreferences > (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding > items for the shelf browser.','1','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when > finding items for the shelf browser.','1','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when > finding items for the shelf browser.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to > patrons with fines greater than noissuescharge.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override > every fine, even if it is below noissuescharge.','0','YesNo'); > diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql > b/installer/data/mysql/en/mandatory/sysprefs.sql > index 0b75e98..363774d 100644 > --- a/installer/data/mysql/en/mandatory/sysprefs.sql > +++ b/installer/data/mysql/en/mandatory/sysprefs.sql > @@ -285,3 +285,5 @@ INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding > items for the shelf browser.','1','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when > finding items for the shelf browser.','1','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when > finding items for the shelf browser.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to > patrons with fines greater than noissuescharge.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override > every fine, even if it is below noissuescharge.','0','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 757f255..9386fee 100644 > --- > a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql > +++ > b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql > @@ -286,4 +286,6 @@ INSERT INTO systempreferences > (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding > items for the shelf browser.','1','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when > finding items for the shelf browser.','1','YesNo'); > -INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when > finding items for the shelf browser.','0','YesNo'); > \ No newline at end of file > +INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when > finding items for the shelf browser.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to > patrons with fines greater than noissuescharge.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override > every fine, even if it is below noissuescharge.','0','YesNo'); > diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql > b/installer/data/mysql/it-IT/necessari/sysprefs.sql > index 79c469c..49da6ce 100644 > --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql > +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql > @@ -271,4 +271,6 @@ INSERT INTO systempreferences > (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding > items for the shelf browser.','1','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when > finding items for the shelf browser.','1','YesNo'); > -INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when > finding items for the shelf browser.','0','YesNo'); > \ No newline at end of file > +INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when > finding items for the shelf browser.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to > patrons with fines greater than noissuescharge.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override > every fine, even if it is below noissuescharge.','0','YesNo'); > diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql > b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql > index 8689c4c..5715de1 100644 > --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql > +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql > @@ -283,4 +283,6 @@ INSERT INTO systempreferences > (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding > items for the shelf browser.','1','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when > finding items for the shelf browser.','1','YesNo'); > -INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when > finding items for the shelf browser.','0','YesNo'); > \ No newline at end of file > +INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when > finding items for the shelf browser.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to > patrons with fines greater than noissuescharge.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override > every fine, even if it is below noissuescharge.','0','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 c862e60..2b38cfa 100644 > --- > 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 > @@ -338,4 +338,6 @@ INSERT INTO systempreferences > (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding > items for the shelf browser.','1','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when > finding items for the shelf browser.','1','YesNo'); > -INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when > finding items for the shelf browser.','0','YesNo'); > \ No newline at end of file > +INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when > finding items for the shelf browser.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to > patrons with fines greater than noissuescharge.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override > every fine, even if it is below noissuescharge.','0','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 82e285b..874a6e4 100644 > --- > 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 > @@ -363,4 +363,6 @@ INSERT INTO systempreferences > (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding > items for the shelf browser.','1','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when > finding items for the shelf browser.','1','YesNo'); > -INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when > finding items for the shelf browser.','0','YesNo'); > \ No newline at end of file > +INSERT INTO systempreferences (variable,value,explanation,options,type) > VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when > finding items for the shelf browser.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to > patrons with fines greater than noissuescharge.','0','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override > every fine, even if it is below noissuescharge.','0','YesNo'); > diff --git a/installer/data/mysql/updatedatabase.plb/installer/data/mysql/ > updatedatabase.pl > index 31aa998..c297810 100755 > --- a/installer/data/mysql/updatedatabase.pl > +++ b/installer/data/mysql/updatedatabase.pl > @@ -4014,6 +4014,14 @@ if (C4::Context->preference("Version") < > TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > > +$DBversion = '3.03.00.XXX'; > +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > + $dbh->do("INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > ('AllowFineOverride','0','If on, staff will be able to issue books to > patrons with fines greater than noissuescharge.','0','YesNo')"); > + $dbh->do("INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > ('AllFinesNeedOverride','1','If on, staff will be asked to override every > fine, even if it is below noissuescharge.','0','YesNo')"); > + print "Upgrade to $DBversion done (Bug 5811: Add sysprefs controlling > overriding fines)\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 3742b23..87769b6 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 > @@ -86,6 +86,18 @@ Circulation: > no: "Don't allow" > - staff to manually override the renewal limit and renew a > checkout when it would go over the renewal limit. > - > + - pref: AllFinesNeedOverride > + choices: > + yes: Require > + no: "Don't require" > + - staff to manually override all fines, even fines less than > noissuescharge. > + - > + - pref: AllowFineOverride > + choices: > + yes: Allow > + no: "Don't allow" > + - staff to manually override and check out items to patrons > who have more than noissuescharge in fines. > + - > - pref: InProcessingToShelvingCart > choices: > yes: Move > -- > 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/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcamins at cpbibliography.com Sat Mar 5 05:22:21 2011 From: jcamins at cpbibliography.com (Jared Camins-Esakov) Date: Fri, 4 Mar 2011 23:22:21 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5811: Add sysprefs to control overriding fines In-Reply-To: References: <1298256903-25751-1-git-send-email-nengard@bywatersolutions.com> Message-ID: I'm not sure this should go in 3.2.x, but, if you think it should, I'll resubmit one that applies. On Fri, Mar 4, 2011 at 7:09 PM, Chris Nighswonger < cnighswonger at foundations.edu> wrote: > This patch does not apply cleanly to 3.2.x. Please fixup and resubmit with > [3.2.x] in the subject line. > > Kind Regards, > Chris > > # On branch 3.2.x > # Your branch is ahead of 'origin/3.2.x' by 3 commits. > # > # Changes to be committed: > # (use "git reset HEAD ..." to unstage) > # > # modified: C4/Circulation.pm > # modified: C4/Members.pm > # modified: > koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref > # > # Unmerged paths: > # (use "git reset HEAD ..." to unstage) > # (use "git add/rm ..." as appropriate to mark resolution) > # > # both modified: > installer/data/mysql/de-DE/mandatory/sysprefs.sql > # both modified: installer/data/mysql/en/mandatory/sysprefs.sql > # both modified: > installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql > # both modified: > installer/data/mysql/it-IT/necessari/sysprefs.sql > # both modified: > installer/data/mysql/pl-PL/mandatory/sysprefs.sql > # both modified: > installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql > # both modified: > installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql > # both modified: installer/data/mysql/updatedatabase.pl > # > > > > > On Sun, Feb 20, 2011 at 9:55 PM, Nicole C. Engard < > nengard at bywatersolutions.com> wrote: > >> From: Jared Camins-Esakov >> >> This patch adds two sysprefs to allow libraries more fine-grained control >> over >> when fines can and can't be overridden. The two sysprefs are: >> * AllFinesNeedOverride - when this syspref is set to "Require" (default) >> any >> fine will require a staffmember to override the fine in order to check >> out a >> book. When set to "Don't require," fines below noissuescharge will not >> need >> any override. >> * AllowFineOverride - when this syspref is set to "Allow," staff will be >> able to >> override fines that are above noissuescharge. When set to "Don't allow" >> (default), staff will not be able to check out items to patrons with >> fines >> greater than noissuescharge. >> >> Signed-off-by: Nicole C. Engard >> --- >> C4/Circulation.pm | 17 >> ++++++++++++----- >> C4/Members.pm | 2 +- >> installer/data/mysql/de-DE/mandatory/sysprefs.sql | 2 ++ >> installer/data/mysql/en/mandatory/sysprefs.sql | 2 ++ >> .../1-Obligatoire/unimarc_standard_systemprefs.sql | 4 +++- >> installer/data/mysql/it-IT/necessari/sysprefs.sql | 4 +++- >> installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 4 +++- >> ...m_preferences_full_optimal_for_install_only.sql | 4 +++- >> ...m_preferences_full_optimal_for_install_only.sql | 4 +++- >> installer/data/mysql/updatedatabase.pl | 8 ++++++++ >> .../en/modules/admin/preferences/circulation.pref | 12 ++++++++++++ >> 11 files changed, 52 insertions(+), 11 deletions(-) >> >> diff --git a/C4/Circulation.pm b/C4/Circulation.pm >> index f7846ac..2b4e86c 100644 >> --- a/C4/Circulation.pm >> +++ b/C4/Circulation.pm >> @@ -730,17 +730,24 @@ sub CanBookBeIssued { >> # DEBTS >> my ($amount) = >> C4::Members::GetMemberAccountRecords( $borrower->{'borrowernumber'}, >> '' && $duedate->output('iso') ); >> + my $amountlimit = C4::Context->preference("noissuescharge"); >> + my $allowfineoverride = C4::Context->preference("AllowFineOverride"); >> + my $allfinesneedoverride = >> C4::Context->preference("AllFinesNeedOverride"); >> if ( C4::Context->preference("IssuingInProcess") ) { >> - my $amountlimit = C4::Context->preference("noissuescharge"); >> - if ( $amount > $amountlimit && !$inprocess ) { >> + if ( $amount > $amountlimit && !$inprocess && >> !$allowfineoverride) { >> $issuingimpossible{DEBT} = sprintf( "%.2f", $amount ); >> - } >> - elsif ( $amount > 0 && $amount <= $amountlimit && !$inprocess ) { >> + } elsif ( $amount > $amountlimit && !$inprocess && >> $allowfineoverride) { >> + $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); >> + } elsif ( $allfinesneedoverride && $amount > 0 && $amount <= >> $amountlimit && !$inprocess ) { >> $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); >> } >> } >> else { >> - if ( $amount > 0 ) { >> + if ( $amount > $amountlimit && $allowfineoverride ) { >> + $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); >> + } elsif ( $amount > $amountlimit && !$allowfineoverride) { >> + $issuingimpossible{DEBT} = sprintf( "%.2f", $amount ); >> + } elsif ( $amount > 0 && $allfinesneedoverride ) { >> $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); >> } >> } >> diff --git a/C4/Members.pm b/C4/Members.pm >> index fafc99b..a292054 100644 >> --- a/C4/Members.pm >> +++ b/C4/Members.pm >> @@ -444,7 +444,7 @@ sub patronflags { >> my $noissuescharge = C4::Context->preference("noissuescharge") || >> 5; >> $flaginfo{'message'} = sprintf "Patron owes \$%.02f", $amount; >> $flaginfo{'amount'} = sprintf "%.02f", $amount; >> - if ( $amount > $noissuescharge ) { >> + if ( $amount > $noissuescharge && >> !C4::Context->preference("AllowFineOverride") ) { >> $flaginfo{'noissues'} = 1; >> } >> $flags{'CHARGES'} = \%flaginfo; >> diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql >> b/installer/data/mysql/de-DE/mandatory/sysprefs.sql >> index 02511d8..221017a 100644 >> --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql >> +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql >> @@ -285,3 +285,5 @@ INSERT INTO systempreferences >> (variable,value,explanation,options,type) VALUES(' >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding >> items for the shelf browser.','1','YesNo'); >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >> finding items for the shelf browser.','1','YesNo'); >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >> finding items for the shelf browser.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >> patrons with fines greater than noissuescharge.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >> every fine, even if it is below noissuescharge.','0','YesNo'); >> diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql >> b/installer/data/mysql/en/mandatory/sysprefs.sql >> index 0b75e98..363774d 100644 >> --- a/installer/data/mysql/en/mandatory/sysprefs.sql >> +++ b/installer/data/mysql/en/mandatory/sysprefs.sql >> @@ -285,3 +285,5 @@ INSERT INTO `systempreferences` >> (variable,value,explanation,options,type) VALUES >> INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding >> items for the shelf browser.','1','YesNo'); >> INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >> finding items for the shelf browser.','1','YesNo'); >> INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >> finding items for the shelf browser.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >> patrons with fines greater than noissuescharge.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >> every fine, even if it is below noissuescharge.','0','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 757f255..9386fee 100644 >> --- >> a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql >> +++ >> b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql >> @@ -286,4 +286,6 @@ INSERT INTO systempreferences >> (variable,value,explanation,options,type) VALUES(' >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding >> items for the shelf browser.','1','YesNo'); >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >> finding items for the shelf browser.','1','YesNo'); >> -INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >> finding items for the shelf browser.','0','YesNo'); >> \ No newline at end of file >> +INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >> finding items for the shelf browser.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >> patrons with fines greater than noissuescharge.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >> every fine, even if it is below noissuescharge.','0','YesNo'); >> diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql >> b/installer/data/mysql/it-IT/necessari/sysprefs.sql >> index 79c469c..49da6ce 100644 >> --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql >> +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql >> @@ -271,4 +271,6 @@ INSERT INTO systempreferences >> (variable,value,explanation,options,type) VALUES(' >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding >> items for the shelf browser.','1','YesNo'); >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >> finding items for the shelf browser.','1','YesNo'); >> -INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >> finding items for the shelf browser.','0','YesNo'); >> \ No newline at end of file >> +INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >> finding items for the shelf browser.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >> patrons with fines greater than noissuescharge.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >> every fine, even if it is below noissuescharge.','0','YesNo'); >> diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql >> b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql >> index 8689c4c..5715de1 100644 >> --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql >> +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql >> @@ -283,4 +283,6 @@ INSERT INTO systempreferences >> (variable,value,explanation,options,type) VALUES(' >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding >> items for the shelf browser.','1','YesNo'); >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >> finding items for the shelf browser.','1','YesNo'); >> -INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >> finding items for the shelf browser.','0','YesNo'); >> \ No newline at end of file >> +INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >> finding items for the shelf browser.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >> patrons with fines greater than noissuescharge.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >> every fine, even if it is below noissuescharge.','0','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 c862e60..2b38cfa 100644 >> --- >> 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 >> @@ -338,4 +338,6 @@ INSERT INTO systempreferences >> (variable,value,explanation,options,type) VALUES(' >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding >> items for the shelf browser.','1','YesNo'); >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >> finding items for the shelf browser.','1','YesNo'); >> -INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >> finding items for the shelf browser.','0','YesNo'); >> \ No newline at end of file >> +INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >> finding items for the shelf browser.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >> patrons with fines greater than noissuescharge.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >> every fine, even if it is below noissuescharge.','0','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 82e285b..874a6e4 100644 >> --- >> 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 >> @@ -363,4 +363,6 @@ INSERT INTO systempreferences >> (variable,value,explanation,options,type) VALUES(' >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding >> items for the shelf browser.','1','YesNo'); >> INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >> finding items for the shelf browser.','1','YesNo'); >> -INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >> finding items for the shelf browser.','0','YesNo'); >> \ No newline at end of file >> +INSERT INTO systempreferences (variable,value,explanation,options,type) >> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >> finding items for the shelf browser.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >> patrons with fines greater than noissuescharge.','0','YesNo'); >> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >> every fine, even if it is below noissuescharge.','0','YesNo'); >> diff --git a/installer/data/mysql/updatedatabase.plb/installer/data/mysql/ >> updatedatabase.pl >> index 31aa998..c297810 100755 >> --- a/installer/data/mysql/updatedatabase.pl >> +++ b/installer/data/mysql/updatedatabase.pl >> @@ -4014,6 +4014,14 @@ if (C4::Context->preference("Version") < >> TransformToNum($DBversion)) { >> SetVersion ($DBversion); >> } >> >> +$DBversion = '3.03.00.XXX'; >> +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >> + $dbh->do("INSERT INTO `systempreferences` >> (variable,value,explanation,options,type) VALUES >> ('AllowFineOverride','0','If on, staff will be able to issue books to >> patrons with fines greater than noissuescharge.','0','YesNo')"); >> + $dbh->do("INSERT INTO `systempreferences` >> (variable,value,explanation,options,type) VALUES >> ('AllFinesNeedOverride','1','If on, staff will be asked to override every >> fine, even if it is below noissuescharge.','0','YesNo')"); >> + print "Upgrade to $DBversion done (Bug 5811: Add sysprefs controlling >> overriding fines)\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 3742b23..87769b6 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 >> @@ -86,6 +86,18 @@ Circulation: >> no: "Don't allow" >> - staff to manually override the renewal limit and renew a >> checkout when it would go over the renewal limit. >> - >> + - pref: AllFinesNeedOverride >> + choices: >> + yes: Require >> + no: "Don't require" >> + - staff to manually override all fines, even fines less than >> noissuescharge. >> + - >> + - pref: AllowFineOverride >> + choices: >> + yes: Allow >> + no: "Don't allow" >> + - staff to manually override and check out items to patrons >> who have more than noissuescharge in fines. >> + - >> - pref: InProcessingToShelvingCart >> choices: >> yes: Move >> -- >> 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/ >> > > > _______________________________________________ > 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/ > -- Jared Camins-Esakov Freelance bibliographer, C & P Bibliography Services, LLC (phone) +1 (917) 727-3445 (e-mail) jcamins at cpbibliography.com (web) http://www.cpbibliography.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrisc at catalyst.net.nz Sat Mar 5 05:29:36 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Sat, 05 Mar 2011 17:29:36 +1300 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5811: Add sysprefs to control overriding fines Message-ID: Yeah doesn't look like a 3.2er to me, db changes to add a new feature. Jared Camins-Esakov wrote: >I'm not sure this should go in 3.2.x, but, if you think it should, I'll >resubmit one that applies. > >On Fri, Mar 4, 2011 at 7:09 PM, Chris Nighswonger < >cnighswonger at foundations.edu> wrote: > >> This patch does not apply cleanly to 3.2.x. Please fixup and resubmit with >> [3.2.x] in the subject line. >> >> Kind Regards, >> Chris >> >> # On branch 3.2.x >> # Your branch is ahead of 'origin/3.2.x' by 3 commits. >> # >> # Changes to be committed: >> # (use "git reset HEAD ..." to unstage) >> # >> # modified: C4/Circulation.pm >> # modified: C4/Members.pm >> # modified: >> koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >> # >> # Unmerged paths: >> # (use "git reset HEAD ..." to unstage) >> # (use "git add/rm ..." as appropriate to mark resolution) >> # >> # both modified: >> installer/data/mysql/de-DE/mandatory/sysprefs.sql >> # both modified: installer/data/mysql/en/mandatory/sysprefs.sql >> # both modified: >> installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql >> # both modified: >> installer/data/mysql/it-IT/necessari/sysprefs.sql >> # both modified: >> installer/data/mysql/pl-PL/mandatory/sysprefs.sql >> # both modified: >> installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql >> # both modified: >> installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql >> # both modified: installer/data/mysql/updatedatabase.pl >> # >> >> >> >> >> On Sun, Feb 20, 2011 at 9:55 PM, Nicole C. Engard < >> nengard at bywatersolutions.com> wrote: >> >>> From: Jared Camins-Esakov >>> >>> This patch adds two sysprefs to allow libraries more fine-grained control >>> over >>> when fines can and can't be overridden. The two sysprefs are: >>> * AllFinesNeedOverride - when this syspref is set to "Require" (default) >>> any >>> fine will require a staffmember to override the fine in order to check >>> out a >>> book. When set to "Don't require," fines below noissuescharge will not >>> need >>> any override. >>> * AllowFineOverride - when this syspref is set to "Allow," staff will be >>> able to >>> override fines that are above noissuescharge. When set to "Don't allow" >>> (default), staff will not be able to check out items to patrons with >>> fines >>> greater than noissuescharge. >>> >>> Signed-off-by: Nicole C. Engard >>> --- >>> C4/Circulation.pm | 17 >>> ++++++++++++----- >>> C4/Members.pm | 2 +- >>> installer/data/mysql/de-DE/mandatory/sysprefs.sql | 2 ++ >>> installer/data/mysql/en/mandatory/sysprefs.sql | 2 ++ >>> .../1-Obligatoire/unimarc_standard_systemprefs.sql | 4 +++- >>> installer/data/mysql/it-IT/necessari/sysprefs.sql | 4 +++- >>> installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 4 +++- >>> ...m_preferences_full_optimal_for_install_only.sql | 4 +++- >>> ...m_preferences_full_optimal_for_install_only.sql | 4 +++- >>> installer/data/mysql/updatedatabase.pl | 8 ++++++++ >>> .../en/modules/admin/preferences/circulation.pref | 12 ++++++++++++ >>> 11 files changed, 52 insertions(+), 11 deletions(-) >>> >>> diff --git a/C4/Circulation.pm b/C4/Circulation.pm >>> index f7846ac..2b4e86c 100644 >>> --- a/C4/Circulation.pm >>> +++ b/C4/Circulation.pm >>> @@ -730,17 +730,24 @@ sub CanBookBeIssued { >>> # DEBTS >>> my ($amount) = >>> C4::Members::GetMemberAccountRecords( $borrower->{'borrowernumber'}, >>> '' && $duedate->output('iso') ); >>> + my $amountlimit = C4::Context->preference("noissuescharge"); >>> + my $allowfineoverride = C4::Context->preference("AllowFineOverride"); >>> + my $allfinesneedoverride = >>> C4::Context->preference("AllFinesNeedOverride"); >>> if ( C4::Context->preference("IssuingInProcess") ) { >>> - my $amountlimit = C4::Context->preference("noissuescharge"); >>> - if ( $amount > $amountlimit && !$inprocess ) { >>> + if ( $amount > $amountlimit && !$inprocess && >>> !$allowfineoverride) { >>> $issuingimpossible{DEBT} = sprintf( "%.2f", $amount ); >>> - } >>> - elsif ( $amount > 0 && $amount <= $amountlimit && !$inprocess ) { >>> + } elsif ( $amount > $amountlimit && !$inprocess && >>> $allowfineoverride) { >>> + $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); >>> + } elsif ( $allfinesneedoverride && $amount > 0 && $amount <= >>> $amountlimit && !$inprocess ) { >>> $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); >>> } >>> } >>> else { >>> - if ( $amount > 0 ) { >>> + if ( $amount > $amountlimit && $allowfineoverride ) { >>> + $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); >>> + } elsif ( $amount > $amountlimit && !$allowfineoverride) { >>> + $issuingimpossible{DEBT} = sprintf( "%.2f", $amount ); >>> + } elsif ( $amount > 0 && $allfinesneedoverride ) { >>> $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); >>> } >>> } >>> diff --git a/C4/Members.pm b/C4/Members.pm >>> index fafc99b..a292054 100644 >>> --- a/C4/Members.pm >>> +++ b/C4/Members.pm >>> @@ -444,7 +444,7 @@ sub patronflags { >>> my $noissuescharge = C4::Context->preference("noissuescharge") || >>> 5; >>> $flaginfo{'message'} = sprintf "Patron owes \$%.02f", $amount; >>> $flaginfo{'amount'} = sprintf "%.02f", $amount; >>> - if ( $amount > $noissuescharge ) { >>> + if ( $amount > $noissuescharge && >>> !C4::Context->preference("AllowFineOverride") ) { >>> $flaginfo{'noissues'} = 1; >>> } >>> $flags{'CHARGES'} = \%flaginfo; >>> diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql >>> b/installer/data/mysql/de-DE/mandatory/sysprefs.sql >>> index 02511d8..221017a 100644 >>> --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql >>> +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql >>> @@ -285,3 +285,5 @@ INSERT INTO systempreferences >>> (variable,value,explanation,options,type) VALUES(' >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding >>> items for the shelf browser.','1','YesNo'); >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >>> finding items for the shelf browser.','1','YesNo'); >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >>> finding items for the shelf browser.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >>> patrons with fines greater than noissuescharge.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >>> every fine, even if it is below noissuescharge.','0','YesNo'); >>> diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql >>> b/installer/data/mysql/en/mandatory/sysprefs.sql >>> index 0b75e98..363774d 100644 >>> --- a/installer/data/mysql/en/mandatory/sysprefs.sql >>> +++ b/installer/data/mysql/en/mandatory/sysprefs.sql >>> @@ -285,3 +285,5 @@ INSERT INTO `systempreferences` >>> (variable,value,explanation,options,type) VALUES >>> INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding >>> items for the shelf browser.','1','YesNo'); >>> INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >>> finding items for the shelf browser.','1','YesNo'); >>> INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >>> finding items for the shelf browser.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >>> patrons with fines greater than noissuescharge.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >>> every fine, even if it is below noissuescharge.','0','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 757f255..9386fee 100644 >>> --- >>> a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql >>> +++ >>> b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql >>> @@ -286,4 +286,6 @@ INSERT INTO systempreferences >>> (variable,value,explanation,options,type) VALUES(' >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding >>> items for the shelf browser.','1','YesNo'); >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >>> finding items for the shelf browser.','1','YesNo'); >>> -INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >>> finding items for the shelf browser.','0','YesNo'); >>> \ No newline at end of file >>> +INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >>> finding items for the shelf browser.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >>> patrons with fines greater than noissuescharge.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >>> every fine, even if it is below noissuescharge.','0','YesNo'); >>> diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql >>> b/installer/data/mysql/it-IT/necessari/sysprefs.sql >>> index 79c469c..49da6ce 100644 >>> --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql >>> +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql >>> @@ -271,4 +271,6 @@ INSERT INTO systempreferences >>> (variable,value,explanation,options,type) VALUES(' >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding >>> items for the shelf browser.','1','YesNo'); >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >>> finding items for the shelf browser.','1','YesNo'); >>> -INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >>> finding items for the shelf browser.','0','YesNo'); >>> \ No newline at end of file >>> +INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >>> finding items for the shelf browser.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >>> patrons with fines greater than noissuescharge.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >>> every fine, even if it is below noissuescharge.','0','YesNo'); >>> diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql >>> b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql >>> index 8689c4c..5715de1 100644 >>> --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql >>> +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql >>> @@ -283,4 +283,6 @@ INSERT INTO systempreferences >>> (variable,value,explanation,options,type) VALUES(' >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding >>> items for the shelf browser.','1','YesNo'); >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >>> finding items for the shelf browser.','1','YesNo'); >>> -INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >>> finding items for the shelf browser.','0','YesNo'); >>> \ No newline at end of file >>> +INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >>> finding items for the shelf browser.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >>> patrons with fines greater than noissuescharge.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >>> every fine, even if it is below noissuescharge.','0','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 c862e60..2b38cfa 100644 >>> --- >>> 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 >>> @@ -338,4 +338,6 @@ INSERT INTO systempreferences >>> (variable,value,explanation,options,type) VALUES(' >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding >>> items for the shelf browser.','1','YesNo'); >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >>> finding items for the shelf browser.','1','YesNo'); >>> -INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >>> finding items for the shelf browser.','0','YesNo'); >>> \ No newline at end of file >>> +INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >>> finding items for the shelf browser.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >>> patrons with fines greater than noissuescharge.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >>> every fine, even if it is below noissuescharge.','0','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 82e285b..874a6e4 100644 >>> --- >>> 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 >>> @@ -363,4 +363,6 @@ INSERT INTO systempreferences >>> (variable,value,explanation,options,type) VALUES(' >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding >>> items for the shelf browser.','1','YesNo'); >>> INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when >>> finding items for the shelf browser.','1','YesNo'); >>> -INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >>> finding items for the shelf browser.','0','YesNo'); >>> \ No newline at end of file >>> +INSERT INTO systempreferences (variable,value,explanation,options,type) >>> VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when >>> finding items for the shelf browser.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to >>> patrons with fines greater than noissuescharge.','0','YesNo'); >>> +INSERT INTO `systempreferences` (variable,value,explanation,options,type) >>> VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override >>> every fine, even if it is below noissuescharge.','0','YesNo'); >>> diff --git a/installer/data/mysql/updatedatabase.plb/installer/data/mysql/ >>> updatedatabase.pl >>> index 31aa998..c297810 100755 >>> --- a/installer/data/mysql/updatedatabase.pl >>> +++ b/installer/data/mysql/updatedatabase.pl >>> @@ -4014,6 +4014,14 @@ if (C4::Context->preference("Version") < >>> TransformToNum($DBversion)) { >>> SetVersion ($DBversion); >>> } >>> >>> +$DBversion = '3.03.00.XXX'; >>> +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >>> + $dbh->do("INSERT INTO `systempreferences` >>> (variable,value,explanation,options,type) VALUES >>> ('AllowFineOverride','0','If on, staff will be able to issue books to >>> patrons with fines greater than noissuescharge.','0','YesNo')"); >>> + $dbh->do("INSERT INTO `systempreferences` >>> (variable,value,explanation,options,type) VALUES >>> ('AllFinesNeedOverride','1','If on, staff will be asked to override every >>> fine, even if it is below noissuescharge.','0','YesNo')"); >>> + print "Upgrade to $DBversion done (Bug 5811: Add sysprefs controlling >>> overriding fines)\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 3742b23..87769b6 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 >>> @@ -86,6 +86,18 @@ Circulation: >>> no: "Don't allow" >>> - staff to manually override the renewal limit and renew a >>> checkout when it would go over the renewal limit. >>> - >>> + - pref: AllFinesNeedOverride >>> + choices: >>> + yes: Require >>> + no: "Don't require" >>> + - staff to manually override all fines, even fines less than >>> noissuescharge. >>> + - >>> + - pref: AllowFineOverride >>> + choices: >>> + yes: Allow >>> + no: "Don't allow" >>> + - staff to manually override and check out items to patrons >>> who have more than noissuescharge in fines. >>> + - >>> - pref: InProcessingToShelvingCart >>> choices: >>> yes: Move >>> -- >>> 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/ >>> >> >> >> _______________________________________________ >> 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/ >> > > > >-- >Jared Camins-Esakov >Freelance bibliographer, C & P Bibliography Services, LLC >(phone) +1 (917) 727-3445 >(e-mail) jcamins at cpbibliography.com >(web) http://www.cpbibliography.com/ > >_______________________________________________ >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 Katrin.Fischer.83 at web.de Sun Mar 6 23:04:09 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Sun, 6 Mar 2011 23:04:09 +0100 Subject: [Koha-patches] [PATCH] Bug 1962: Follow-up: Add fine notification during check-in Message-ID: <1299449049-24101-1-git-send-email-Katrin.Fischer.83@web.de> Don't show message when patron has no fines. --- circ/returns.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index c05277c..40706a2 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -243,7 +243,7 @@ if ($barcode) { push( @inputloop, \%input ); my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrower->{'borrowernumber'} ); - if ($fines) { + if ($fines > 0) { $template->param( fines => sprintf("%.2f",$fines) ); $template->param( fineborrowernumber => $borrower->{'borrowernumber'} ); } -- 1.7.1 From Katrin.Fischer.83 at web.de Mon Mar 7 01:42:08 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Mon, 7 Mar 2011 01:42:08 +0100 Subject: [Koha-patches] [PATCH] Bug 5834: Holds link missing when 942$c is not for loan Message-ID: <1299458528-27380-1-git-send-email-Katrin.Fischer.83@web.de> Adds a check for item-level_itypes system preference. To test: 1) Set item-level_itypes to 'specific item' 2) Create record and set 942$c to an itype that is marked not for loan 3) Create item with itype not marked 'not for loan' Current behaviour: Holds link is not shown, sys pref setting doesn't matter After patch: Holds link is shown - when item-level_itype is 'specific item' - when item-level_itype is 'biblio record' and 942$c itype is for loan Holds link is not shown - when item-level_itype is 'biblio record' and 942$c is not for loan --- C4/Search.pm | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 26dc67f..1b8a211 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1690,9 +1690,12 @@ sub searchResults { $search_context); } - # last check for norequest : if itemtype is notforloan, it can't be reserved either, whatever the items - $can_place_holds = 0 - if $itemtypes{ $oldbiblio->{itemtype} }->{notforloan}; + # if biblio level itypes are used and itemtype is notforloan, it can't be reserved either + if (!C4::Context->preference("item-level_itypes")) { + if ($itemtypes{ $oldbiblio->{itemtype} }->{notforloan}) { + $can_place_holds = 0; + } + } $oldbiblio->{norequests} = 1 unless $can_place_holds; $oldbiblio->{itemsplural} = 1 if $items_count > 1; $oldbiblio->{items_count} = $items_count; -- 1.7.1 From Katrin.Fischer.83 at web.de Mon Mar 7 08:08:54 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Mon, 7 Mar 2011 08:08:54 +0100 Subject: [Koha-patches] [PATCH] Bug 5838: Don't show sql statement on guided reports result page Message-ID: <1299481734-4095-1-git-send-email-Katrin.Fischer.83@web.de> --- .../en/modules/reports/guided_reports_start.tmpl | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl index c5868a0..7839cb5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl @@ -449,7 +449,6 @@ NAME="name" -->">

    Total number of rows matching the (unlimited) query is .

    - -- 1.7.1 From nengard at bywatersolutions.com Mon Mar 7 17:37:45 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 7 Mar 2011 11:37:45 -0500 Subject: [Koha-patches] =?utf-8?q?=5BPATCH=5D_=5BSIGNED-OFF=5D_Bug_3013_-_?= =?utf-8?q?Value_builder_for_006_and_008_need_choices_for_all_forma?= =?utf-8?q?t_types?= Message-ID: <1299515865-1873-1-git-send-email-nengard@bywatersolutions.com> From: Salvador Zaragoza Rubio Modification of the intranet cataloguing plugin for 006/008 fields to allow select a type of material and change the positions available to enter the data. Data are hard stored in xml files to allow easy translation and processing through Javascript and JQuery-AJAX. Bug 3013 - Fix selection of combo and trailing whitespace Bug 3013 - Fix selection of combo Signed-off-by: Nicole C. Engard --- cataloguing/value_builder/marc21_field_006.pl | 61 +- cataloguing/value_builder/marc21_field_008.pl | 78 +- .../intranet-tmpl/prog/en/js/xmlControlfield.js | 340 +++++ .../value_builder/marc21_field_006.tmpl | 575 +-------- .../cataloguing/value_builder/marc21_field_006.xml | 795 ++++++++++++ .../value_builder/marc21_field_008.tmpl | 699 +---------- .../cataloguing/value_builder/marc21_field_008.xml | 1298 ++++++++++++++++++++ .../cataloguing/value_builder/marc21_field_CF.xsd | 83 ++ 8 files changed, 2671 insertions(+), 1258 deletions(-) create mode 100755 koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js mode change 100644 => 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl create mode 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml mode change 100644 => 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl create mode 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml create mode 100755 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd diff --git a/cataloguing/value_builder/marc21_field_006.pl b/cataloguing/value_builder/marc21_field_006.pl index 6d84cb4..6a4445a 100755 --- a/cataloguing/value_builder/marc21_field_006.pl +++ b/cataloguing/value_builder/marc21_field_006.pl @@ -26,6 +26,8 @@ use C4::Context; use C4::Search; use C4::Output; +use XML::LibXML; + =head1 DESCRIPTION plugin_parameters : other parameters added when the plugin is called by the dopop function @@ -82,46 +84,25 @@ sub plugin { ); $result = "a|||||r|||| 00| 0 " unless $result; - # $result = "a r 00 0 " unless $result; - my $f0 = substr($result, 0, 1); - my $f014 = substr($result, 1, 4); - my $f5 = substr($result, 5, 1); - my $f6 = substr($result, 6, 1); - my $f710 = substr($result, 7, 4); - my $f11 = substr($result, 11, 1); - my $f12 = substr($result, 12, 1); - my $f13 = substr($result, 13, 1); - my $f14 = substr($result, 14, 1); - my $f15 = substr($result, 15, 1); - my $f16 = substr($result, 16, 1); - my $f17 = substr($result, 17, 1); - - $template->param( - index => $index, - f0 => $f0, - "f0$f0" => $f0, - f014 => $f014, - "f014$f014" => $f014, - f5 => $f5, - "f5$f5" => $f5, - f6 => $f6, - "f6$f6" => $f6, - f710 => $f710, - "f710$f710" => $f710, - f11 => $f11, - "f11$f11" => $f11, - f12 => $f12, - "f12$f12" => $f12, - f13 => $f13, - "f13$f13" => $f13, - f14 => $f14, - "f14$f14" => $f14, - f15 => $f15, - "f15$f15" => $f15, - f16 => $f16, - "f16$f16" => $f16, - f17 => $f17, - "f17$f17" => $f17, + my $errorXml = ''; + # Check if the xml, xsd exists and is validated + my $dir = C4::Context->config('intrahtdocs') . '/prog/' . $template->param('lang') . '/modules/cataloguing/value_builder/'; + if (-r $dir . 'marc21_field_006.xml') { + my $doc = XML::LibXML->new->parse_file($dir . 'marc21_field_006.xml'); + if (-r $dir . 'marc21_field_CF.xsd') { + my $xmlschema = XML::LibXML::Schema->new(location => $dir . 'marc21_field_CF.xsd'); + eval { + $xmlschema->validate( $doc ); + }; + $errorXml = 'Can\'t validate the xml data from ' . $dir . 'marc21_field_006.xml' if ($@); + } + } else { + $errorXml = 'Can\'t read the xml file ' . $dir . 'marc21_field_006.xml'; + } + $template->param(tagfield => '006', + index => $index, + result => $result, + errorXml => $errorXml, ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/cataloguing/value_builder/marc21_field_008.pl b/cataloguing/value_builder/marc21_field_008.pl index 57e0690..8b5db26 100755 --- a/cataloguing/value_builder/marc21_field_008.pl +++ b/cataloguing/value_builder/marc21_field_008.pl @@ -26,6 +26,8 @@ use C4::Context; use C4::Search; use C4::Output; +use XML::LibXML; + =head1 DESCRIPTION plugin_parameters : other parameters added when the plugin is called by the dopop function @@ -96,65 +98,25 @@ sub plugin { # $result = " t xxu 00 0 eng d" unless $result; $result = "$dateentered" . "t xxu||||| |||| 00| 0 eng d" unless $result; - my $f1 = substr($result, 0, 6); - my $f6 = substr($result, 6, 1); - my $f710 = substr($result, 7, 4); - my $f1114 = substr($result, 11, 4); - my $f1517 = substr($result, 15, 3); - my $f1821 = substr($result, 18, 4); - my $f22 = substr($result, 22, 1); - my $f23 = substr($result, 23, 1); - my $f2427 = substr($result, 24, 4); - my $f28 = substr($result, 28, 1); - my $f29 = substr($result, 29, 1); - my $f30 = substr($result, 30, 1); - my $f31 = substr($result, 31, 1); - my $f33 = substr($result, 33, 1); - my $f34 = substr($result, 34, 1); - my $f3537 = substr($result, 35, 3); - my $f38 = substr($result, 38, 1); - my $f39 = substr($result, 39, 1); - - # bug 2563 - $f710 = "" if ($f710 =~ /^\s*$/); - $f1114 = "" if ($f1114 =~ /^\s*$/); - - if ((!$f1) || ($f1 =~ m/ /)) { - $f1 = $dateentered; + my $errorXml = ''; + # Check if the xml, xsd exists and is validated + my $dir = C4::Context->config('intrahtdocs') . '/prog/' . $template->param('lang') . '/modules/cataloguing/value_builder/'; + if (-r $dir . 'marc21_field_008.xml') { + my $doc = XML::LibXML->new->parse_file($dir . 'marc21_field_008.xml'); + if (-r $dir . 'marc21_field_CF.xsd') { + my $xmlschema = XML::LibXML::Schema->new(location => $dir . 'marc21_field_CF.xsd'); + eval { + $xmlschema->validate( $doc ); + }; + $errorXml = 'Can\'t validate the xml data from ' . $dir . 'marc21_field_008.xml' if ($@); + } + } else { + $errorXml = 'Can\'t read the xml file ' . $dir . 'marc21_field_008.xml'; } - - $template->param( - index => $index, - f1 => $f1, - f6 => $f6, - "f6$f6" => $f6, - f710 => $f710, - f1114 => $f1114, - f1517 => $f1517, - f1821 => $f1821, - f22 => $f22, - "f22$f22" => $f22, - f23 => $f23, - "f23$f23" => $f23, - f2427 => $f2427, - "f24$f2427" => $f2427, - f28 => $f28, - "f28$f28" => $f28, - f29 => $f29, - "f29$f29" => $f29, - f30 => $f30, - "f30$f30" => $f30, - f31 => $f31, - "f31$f31" => $f31, - f33 => $f33, - "f33$f33" => $f33, - f34 => $f34, - "f34$f34" => $f34, - f3537 => $f3537, - f38 => $f38, - "f38$f38" => $f38, - f39 => $f39, - "f39$f39" => $f39, + $template->param(tagfield => '008', + index => $index, + result => $result, + errorXml => $errorXml, ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js b/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js new file mode 100755 index 0000000..dca6e75 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js @@ -0,0 +1,340 @@ + + +// Add an option to a select form field +function add_option(select, text, value, selected) +{ + var option = document.createElement('option'); + option.text = text; + option.value = value; + if (selected) option.selected = true; + try { + select.add(option, null); + } + catch(ex) { + select.add(option); + } +}//add_option + + +// Return the value of a parameter from the url +function returnValueParam(param) +{ + var params = location.search.substr(1); + var arr = params.split("&"); + var pattern = param + "="; + for (var i=0; i < arr.length; i++) { + if (arr[i].indexOf(pattern) == 0) { + return unescape(arr[i].substr(pattern.length)); + } + } + return ""; +}//returnValueParam + + +// Return a value from a position on the result string +function returnValuePosFromResult(result, pos) +{ + var index; + if ((index = pos.indexOf("-")) > 0) { + var ini = parseInt(pos.substring(0, index) ,10); + var end = parseInt(pos.substr(index + 1) ,10); + return result.substring(ini, end + 1); + } else { + return result.substr(pos, 1); + } +}//returnValuePosFromResult + + +// Build string from form fields +function returnResultFromValues(form) +{ + var resultStr = form.result.value; + var pos; + var value; + for (var i=0; i < form.elements.length; i++) { + var pattern = new RegExp("f[0-9]+(?:[0-9]+)?"); + if (pattern.test(form.elements[i].name)) { + pos = form.elements[i].name.substr(1); + value = (pos.indexOf("-") > 0)?form.elements[i].value:form.elements[i].options[form.elements[i].selectedIndex].value; + resultStr = changePosResult(pos, value, resultStr); + } + } + return resultStr; +}//returnResultFromValues + + +// Build/modify result string for a position and a value +function changePosResult(pos, value, resultStr) +{ + var index; + var result = ""; + if ((index = pos.indexOf("-")) > 0) { + var ini = parseInt(pos.substring(0, index) ,10); + var end = parseInt(pos.substr(index + 1) ,10); + var roffset = (1 + end - ini)- value.length; + if (roffset > 0) for (var i=0; i < roffset; i++) value += " "; + if (ini == 0) + result = value + resultStr.substr(end + 1); + else { + result = resultStr.substring(0, ini) + value; + if (end < resultStr.length) + result += resultStr.substr(end + 1); + } + } else { + var ini = parseInt(pos, 10); + if (ini == 0) + result = value + resultStr.substr(1); + else { + result = resultStr.substring(0, ini) + value; + if (ini < resultStr.length) + result += resultStr.substr(ini + 1); + } + } + result = result.replace(/#/g, " "); + return result; +}//changePosResult + + +// Display the result string on a row of a table indicating positions and coloring them if they are incorrect or they are selected +function renderResult(tr_result, result) +{ + if (tr_result) { + var td; + if (tr_result.cells.length != result.length) { + for (var i = tr_result.cells.length - 1; i >= 0; i--) + tr_result.deleteCell(i); + for (var i=0; i < result.length; i++) { + value = result.charAt(i); + td = tr_result.insertCell(tr_result.cells.length); + } + } + var value; + var ini = -1; + var end = -1; + var args = renderResult.arguments; + var whiteAllTD = false; + if (args.length > 2) { + if (typeof(args[2]) == "boolean") { + whiteAllTD = args[2]; + } else { + var index; + if ((index = args[2].indexOf("-")) > 0) { + ini = parseInt(args[2].substring(0, index) ,10); + end = parseInt(args[2].substr(index + 1) ,10); + } else ini = parseInt(args[2], 10); + } + } + for (var i=0; i < result.length; i++) { + value = result.charAt(i); + td = tr_result.cells[i]; + if (td.style.backgroundColor != "yellow" || whiteAllTD) td.style.backgroundColor = "white"; + td.innerHTML = (value == " ")?" ":value; + td.title = "Pos " + i + ". Value: \"" + value + "\""; + if (ini >= 0) { + if (end > 0) { + if (ini <= i && i <= end) td.style.backgroundColor = "#cccccc"; + } else if (i == ini) td.style.backgroundColor = "#cccccc"; + } else { + var pos = (i < 10)?'0' + i:i + ''; + var obj; + if ((obj = document.getElementById('f' + pos)) != null) { + var found = false; + for (var j=0; j < obj.options.length && !found; j++) + if (obj.options[j].value == value) found = true; + if (!found) { + td.style.backgroundColor = "yellow"; + td.title = "Pos " + i + ". Incorrect Value: \"" + value + "\""; + } + } + } + }//for + } +}//renderResult + + +// Change displaying of result in the page +function changeH4Result(form, h4_result, tr_result, pos, value) +{ + var resultStr = form.result.value; + var result = changePosResult(pos, value, resultStr); + renderResult(tr_result, result, pos); + h4_result.innerHTML = """ + result + """; + form.result.value = result; +}//changeH4Result + + + +// Class to read the xml and render the type of material +(function() +{ + + xmlControlField = function(tagfield, form_id, select, table, h4_result, tr_result, idMaterial) + { + this.tagfield = tagfield; + this.idMaterial = idMaterial; + this.form_id = form_id; + this.form = document.getElementById(form_id); + this.select = select; + this.table = table; + this.h4_result = h4_result; + this.tr_result = tr_result; + };//xmlControlField + + + xmlControlField.prototype = + { + tagfield: "", + idMaterial: "", + root: null, + form_id: "", + form: null, + select: null, + table: null, + h4_result: "", + tr_result: "", + + + setIdMaterial: function(idMaterial) + { + this.idMaterial = idMaterial; + },//setIdMaterial + + loadXmlValues: function() + { + this.xmlDoc = $.ajax({ + type: "GET", + url: "/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_" + this.tagfield + ".xml", + dataType: "xml", + async: false + }).responseXML; + if (this.xmlDoc) this.renderTemplate(); + $("*").ajaxError(function(evt, request, settings){ + alert("AJAX error: receiving data from " + settings.url); + }); + },//loadXmlValues + + + renderTemplate: function() + { + this.root = this.xmlDoc.documentElement; + if (this.root.nodeName == "Tagfield" && this.root.nodeType == 1 && this.root.hasChildNodes()) { + var tag = this.root.attributes.getNamedItem("tag").nodeValue; + var nodeMaterial = this.root.getElementsByTagName('Material'); + if (nodeMaterial != null && nodeMaterial.length > 0) { + if (this.idMaterial == "") this.idMaterial = nodeMaterial[0].attributes.getNamedItem("id").nodeValue; + this.renderSelectMaterial(nodeMaterial); + this.renderPositions(nodeMaterial, (this.form.result.value != "")?this.form.result.value:returnValueParam("result")); + } + } + },//renderTemplate + + + renderSelectMaterial: function(nodeMaterial) + { + if (this.select != null && nodeMaterial != null && nodeMaterial.length > 0) { + if (this.select.options.length <= 1) { + var id; + var name; + var arrSort = new Array(); + var arrEquiv = new Array(); + for (var i=0; i < nodeMaterial.length; i++) { + id = nodeMaterial[i].attributes.getNamedItem("id").nodeValue; + name = nodeMaterial[i].attributes.getNamedItem("name").nodeValue; + arrEquiv[id] = i; + arrSort.push(id); + } + arrSort.sort(); + var j; + for (var i=0; i < arrSort.length; i++) { + j = arrEquiv[arrSort[i]]; + add_option(this.select, arrSort[i] + " - " + nodeMaterial[j].attributes.getNamedItem("name").nodeValue, arrSort[i], (this.idMaterial != "" && arrSort[i] == this.idMaterial)?true:false); + } + } else if (this.idMaterial != "") { + for (var i=0; i < this.select.options.length; i++) { + if (this.select.options[i].value == this.idMaterial) this.select.options[i].selected = true; + } + } + } + },//renderSelectMaterial + + + renderPositions: function(nodeMaterial, result) + { + var materialNode; + try { + var resultXPath = this.xmlDoc.evaluate("//a:Material[@id='" + this.idMaterial + "']", this.xmlDoc.documentElement, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null); + materialNode = resultXPath.singleNodeValue; + } catch (e) { + for (var i=0; i < nodeMaterial.length; i++) { + if (this.idMaterial == nodeMaterial[i].attributes.getNamedItem("id").nodeValue) { + materialNode = nodeMaterial[i]; + break; + } + } + } + if (this.table != null) { // Render table + var tbody = this.table.tBodies[0]; + // Clean up table + if (tbody.rows.length > 0) + for (var i = tbody.rows.length - 1; i >= 1; i--) + tbody.deleteRow(i); + // Parse Material node + if (materialNode != undefined && materialNode != null && materialNode.nodeType == 1 && materialNode.hasChildNodes()) { + var nodePos = materialNode.firstChild; + var tr; + var td; + var title; + var pos; + var value; + var strInnerHTML = ""; + var selected; + var index; + var url; + while (nodePos != null) { + if (nodePos.nodeType == 1 && nodePos.nodeName == "Position") { + tr = tbody.insertRow(tbody.rows.length); + td = tr.insertCell(tr.cells.length); + pos = nodePos.attributes.getNamedItem("pos").nodeValue; + title = ((nodePos.getAttributeNode("description") || nodePos.hasAttribute("description")) && nodePos.getAttribute("description") != "")?nodePos.attributes.getNamedItem("description").nodeValue:nodePos.attributes.getNamedItem("name").nodeValue; + try { + url = ((nodePos.getAttributeNode("url") || nodePos.hasAttribute("url")) && nodePos.getAttribute("url") != "" && nodePos.getAttribute("urltext") != "")?" " + nodePos.attributes.getNamedItem("urltext").nodeValue + "":""; + } catch (e) { url = "";} + td.innerHTML = ""; + td = tr.insertCell(tr.cells.length); + value = returnValuePosFromResult(result, pos); + if ((index = pos.indexOf("-")) > 0) { // Position interval + var ini = parseInt(pos.substring(0, index) ,10); + var end = parseInt(pos.substr(index + 1) ,10); + value = value.replace(/ /g, "#"); + strInnerHTML = ""; + } else { + strInnerHTML = ""; + } + td.innerHTML = strInnerHTML; + } + nodePos = nodePos.nextSibling; + } + } + } + }//renderPositions + }; + +})(); + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl old mode 100644 new mode 100755 index ab2a079..2b90f48 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl @@ -1,533 +1,72 @@ Koha › Cataloging › 006 builder - - -

    006 Fixed-length data elements--Additional material characteristics--General information

    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    - -
    01-04 Illustrations (auto-filled from 300)"/>
    - -
    - -
    7-10 Nature of contents (Derived value) - "/>
    - -
    - -
    - -
    - -
    15 Undefined
    - -
    - -
    + + +
    +

    ""

    + + + +" /> + + + + +
    + +
    Cancel
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml new file mode 100755 index 0000000..c7a9e3b --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml @@ -0,0 +1,795 @@ + + + + + a + t + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + o + p + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 2 + 5 + 6 + a + b + c + d + e + f + g + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + 0 + 1 + | + + + 0 + 1 + | + + + + 0 + 1 + d + e + f + h + i + j + m + p + s + u + | + + + # + a + b + c + d + | + + + + + m + + + + # + a + b + c + d + e + f + g + j + | + + + # + o + q + | + + + + a + b + c + d + e + f + g + h + i + j + m + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + + + + e + f + + + # + a + b + c + d + e + f + g + i + j + k + m + z + |||| + + + ## + aa + ab + ac + ad + ae + af + ag + am + an + ap + au + az + ba + bb + bc + bd + be + bf + bg + bh + bi + bj + bk + bl + bo + br + bs + bu + bz + ca + cb + cc + ce + cp + cu + cz + da + db + dc + dd + de + df + dg + dh + dl + zz + | + + + + a + b + c + d + e + f + g + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + 0 + 1 + | + + + + # + e + j + k + l + n + o + p + r + z + | + + + + + c + d + i + j + + + an + bd + bg + bl + bt + ca + cb + cc + cg + ch + cl + cn + co + cp + cr + cs + ct + cy + cz + df + dv + fg + fl + fm + ft + gm + hy + jz + mc + md + mi + mo + mp + mr + ms + mu + mz + nc + nn + op + or + ov + pg + pm + po + pp + pr + ps + pt + pv + rc + rd + rg + ri + rp + rq + sd + sg + sn + sp + st + su + sy + tc + tl + ts + uu + vi + vr + wz + za + zz + || + + + a + b + c + d + e + g + h + i + j + m + n + u + z + | + + + # + d + e + f + n + u + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + a + b + c + d + e + f + g + h + i + k + r + s + z + | + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + r + s + t + z + | + + + + # + a + b + c + n + u + | + + + + + + s + + + # + a + b + c + d + e + f + g + h + i + j + k + m + q + s + t + u + w + z + | + + + n + r + u + x + | + + + + # + d + l + m + n + p + w + | + + + # + a + b + c + d + e + f + o + q + s + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + z + ||| + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + + # + a + b + c + d + e + f + g + h + i + j + k + l + u + z + | + + + 0 + 1 + 2 + | + + + + + g + k + o + r + + + 000 + 001-999 + nnn + ||| + ??????????????????????? --- + + + + # + a + b + c + d + e + f + g + j + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + a + b + c + d + f + g + i + k + l + m + n + o + p + q + r + s + t + v + w + z + | + + + a + c + l + n + u + z + | + + + + + p + + + + # + a + b + c + d + f + o + q + r + s + | + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl old mode 100644 new mode 100755 index 9dddccb..9638287 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl @@ -1,659 +1,74 @@ Koha › Cataloging › 008 builder - - -

    008 Fixed-length data elements--General information

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +" /> +
    1-5 Date entered on file (auto-filled)" />
    - - - -
    - "/> -
    - "/>
    See MARC Code List for Countries - "/> -
    "/>
    - -
    - -
    - "/>
    - -
    - -
    - -
    - -
    32 Undefined
    - -
    - -
    See MARC Code List for Languages - "/> -
    - + + -
    - + + +
    +

    ""

    - - - - - - -
    + + + +
    + +
    Cancel
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml new file mode 100755 index 0000000..e4f4869 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml @@ -0,0 +1,1298 @@ + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + o + p + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 2 + 5 + 6 + a + b + c + d + e + f + g + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + 0 + 1 + | + + + 0 + 1 + | + + + + 0 + 1 + d + e + f + h + i + j + m + p + s + u + | + + + # + a + b + c + d + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + + # + a + b + c + d + e + f + g + j + | + + + # + o + q + | + + + + a + b + c + d + e + f + g + h + i + j + m + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + # + a + b + c + d + e + f + g + i + j + k + m + z + |||| + + + ## + aa + ab + ac + ad + ae + af + ag + am + an + ap + au + az + ba + bb + bc + bd + be + bf + bg + bh + bi + bj + bk + bl + bo + br + bs + bu + bz + ca + cb + cc + ce + cp + cu + cz + da + db + dc + dd + de + df + dg + dh + dl + zz + | + + + + a + b + c + d + e + f + g + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + 0 + 1 + | + + + + # + e + j + k + l + n + o + p + r + z + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + an + bd + bg + bl + bt + ca + cb + cc + cg + ch + cl + cn + co + cp + cr + cs + ct + cy + cz + df + dv + fg + fl + fm + ft + gm + hy + jz + mc + md + mi + mo + mp + mr + ms + mu + mz + nc + nn + op + or + ov + pg + pm + po + pp + pr + ps + pt + pv + rc + rd + rg + ri + rp + rq + sd + sg + sn + sp + st + su + sy + tc + tl + ts + uu + vi + vr + wz + za + zz + || + + + a + b + c + d + e + g + h + i + j + m + n + u + z + | + + + # + d + e + f + n + u + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + a + b + c + d + e + f + g + h + i + k + r + s + z + | + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + r + s + t + z + | + + + + # + a + b + c + n + u + | + + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + # + a + b + c + d + e + f + g + h + i + j + k + m + q + s + t + u + w + z + | + + + n + r + u + x + | + + + + # + d + l + m + n + p + w + | + + + # + a + b + c + d + e + f + o + q + s + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + z + ||| + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + + # + a + b + c + d + e + f + g + h + i + j + k + l + u + z + | + + + 0 + 1 + 2 + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + 000 + 001-999 + nnn + ||| + ??????????????????????? --- + + + + # + a + b + c + d + e + f + g + j + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + a + b + c + d + f + g + i + k + l + m + n + o + p + q + r + s + t + v + w + z + | + + + a + c + l + n + u + z + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + + # + a + b + c + d + f + o + q + r + s + | + + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd new file mode 100755 index 0000000..7b0b27b --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd @@ -0,0 +1,83 @@ + + + + Control Field Plugin Type of Materials schema + + + + + + Element indicating the control field + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 1.7.2.3 From nengard at bywatersolutions.com Mon Mar 7 17:44:03 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 7 Mar 2011 11:44:03 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5830 Using XSLT on OPAC Lists page Message-ID: <1299516243-2024-1-git-send-email-nengard@bywatersolutions.com> From: Fr?d?ric Demians On OPAC Lists page (opac-shelves.pl), biblio records are now displayed accordingly to OPACXSLTResultsDisplay system preference. Signed-off-by: Nicole C. Engard --- C4/VirtualShelves/Page.pm | 7 ++++++- .../opac-tmpl/prog/en/modules/opac-shelves.tmpl | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 66c614d..3614c24 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -35,6 +35,7 @@ use C4::Tags qw(get_tags); use Exporter; use Data::Dumper; use C4::Csv; +use C4::XSLT; use vars qw($debug @EXPORT @ISA $VERSION); @@ -201,7 +202,11 @@ sub shelfpage ($$$$$) { } ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset ); for my $this_item (@$items) { - my $record = GetMarcBiblio( $this_item->{'biblionumber'} ); + my $biblionumber = $this_item->{'biblionumber'}; + my $record = GetMarcBiblio($biblionumber); + $this_item->{XSLTBloc} = + XSLTParse4Display($biblionumber, $record, 'Results', 'opac') + if C4::Context->preference("OPACXSLTResultsDisplay"); # the virtualshelfcontents table does not store these columns nor are they retrieved from the items # and itemtypes tables, so I'm commenting them out for now to quiet the log -crn diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl index 1e1d2d5..4646365 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl @@ -249,6 +249,10 @@ $(function() {
    + + + + " title="View details for this title"> " title="View details for this title"> @@ -272,7 +276,7 @@ $(function() { ()., This record has no items. - + -- 1.7.2.3 From nengard at bywatersolutions.com Mon Mar 7 19:12:34 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 7 Mar 2011 13:12:34 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] BZ3624, proposed patch for kohastructure.sql rewritten Message-ID: <1299521554-2355-1-git-send-email-nengard@bywatersolutions.com> From: Paul Poulain Signed-off-by: Nicole C. Engard --- installer/data/mysql/kohastructure.sql | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index da1528c..a62e07c 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2352,6 +2352,9 @@ CREATE TABLE `aqbasketgroups` ( `name` varchar(50) default NULL, `closed` tinyint(1) default NULL, `booksellerid` int(11) NOT NULL, + `deliveryplace` varchar(10) default NULL, + `deliverycomment` varchar(255) default NULL, + `billingplace` varchar(10) default NULL, PRIMARY KEY (`id`), KEY `booksellerid` (`booksellerid`), CONSTRAINT `aqbasketgroups_ibfk_1` FOREIGN KEY (`booksellerid`) REFERENCES `aqbooksellers` (`id`) ON UPDATE CASCADE ON DELETE CASCADE -- 1.7.2.3 From nengard at bywatersolutions.com Mon Mar 7 19:12:44 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 7 Mar 2011 13:12:44 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] BZ3624, proposed patch for kohastructure.sql rewritten Message-ID: <1299521564-2390-1-git-send-email-nengard@bywatersolutions.com> From: Paul Poulain Signed-off-by: Nicole C. Engard --- installer/data/mysql/kohastructure.sql | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index da1528c..a62e07c 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2352,6 +2352,9 @@ CREATE TABLE `aqbasketgroups` ( `name` varchar(50) default NULL, `closed` tinyint(1) default NULL, `booksellerid` int(11) NOT NULL, + `deliveryplace` varchar(10) default NULL, + `deliverycomment` varchar(255) default NULL, + `billingplace` varchar(10) default NULL, PRIMARY KEY (`id`), KEY `booksellerid` (`booksellerid`), CONSTRAINT `aqbasketgroups_ibfk_1` FOREIGN KEY (`booksellerid`) REFERENCES `aqbooksellers` (`id`) ON UPDATE CASCADE ON DELETE CASCADE -- 1.7.2.3 From nengard at bywatersolutions.com Mon Mar 7 19:18:41 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 7 Mar 2011 13:18:41 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5703: Hide the $9 subfield (linked authid) when showing series for a MARC record in normal view. Message-ID: <1299521921-2508-1-git-send-email-nengard@bywatersolutions.com> From: Fr?d?rick Capovilla Signed-off-by: Nicole C. Engard --- C4/Biblio.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 8ea5da5..1daa70a 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1610,7 +1610,7 @@ sub GetMarcSeries { if ($volume_number) { push @subfields_loop, { volumenum => $value }; } else { - push @subfields_loop, { code => $code, value => $value, link_loop => \@link_loop, separator => $separator, volumenum => $volume_number }; + push @subfields_loop, { code => $code, value => $value, link_loop => \@link_loop, separator => $separator, volumenum => $volume_number } unless ( $series_subfield->[0] eq '9' ); } $counter++; } -- 1.7.2.3 From nengard at bywatersolutions.com Mon Mar 7 19:50:48 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 7 Mar 2011 13:50:48 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5527: Fix some problems in inactive borrowers report Message-ID: <1299523848-2899-1-git-send-email-nengard@bywatersolutions.com> From: Katrin Fischer - 'Not checked out since:' date was not added to query - borrowers with only checkouts and no returns since this date were considered inactive Signed-off-by: Nicole C. Engard --- reports/borrowers_out.pl | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/reports/borrowers_out.pl b/reports/borrowers_out.pl index 0502dc6..0a135e1 100755 --- a/reports/borrowers_out.pl +++ b/reports/borrowers_out.pl @@ -181,7 +181,7 @@ sub calculate { $colorder .= $column; my $strsth2; - $strsth2 .= "select distinctrow $colfield FROM borrowers LEFT JOIN `old_issues` USING(borrowernumber)"; + $strsth2 .= "select distinct $colfield FROM borrowers WHERE 1"; if ($colfilter[0]) { $colfilter[0] =~ s/\*/%/g; $strsth2 .= " and $column LIKE '$colfilter[0]' " ; @@ -229,10 +229,18 @@ sub calculate { $strcalc .= "WHERE 1 "; @$filters[0]=~ s/\*/%/g if (@$filters[0]); $strcalc .= " AND borrowers.categorycode like '" . @$filters[0] ."'" if ( @$filters[0] ); - my $strqueryfilter = "SELECT DISTINCT borrowernumber FROM old_issues WHERE borrowernumber IS NOT NULL "; - if (@$filters[1]){ - my $strqueryfilter .= "AND old_issues.timestamp> @$filters[1] "; + + my $strqueryfilter = "SELECT DISTINCT borrowernumber FROM "; + $strqueryfilter .= "(SELECT borrowernumber from old_issues WHERE borrowernumber IS NOT NULL "; + if ($filters->[1]){ + $strqueryfilter .= "AND old_issues.timestamp> '$filters->[1]' "; + } + $strqueryfilter .= "UNION SELECT borrowernumber FROM issues WHERE 1 "; + if ($filters->[1]){ + $strqueryfilter .= "AND issues.timestamp> '$filters->[1]' "; } + $strqueryfilter .= ") active_borrowers"; + $strcalc .= " AND borrowers.borrowernumber not in ($strqueryfilter)"; $strcalc .= " group by borrowers.borrowernumber"; $strcalc .= ", $colfield" if ($column); -- 1.7.2.3 From nengard at bywatersolutions.com Mon Mar 7 20:14:59 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 7 Mar 2011 14:14:59 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 1962: Follow-up: Add fine notification during check-in Message-ID: <1299525299-3087-1-git-send-email-nengard@bywatersolutions.com> From: Katrin Fischer Don't show message when patron has no fines. Signed-off-by: Nicole C. Engard --- circ/returns.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index c05277c..40706a2 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -243,7 +243,7 @@ if ($barcode) { push( @inputloop, \%input ); my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrower->{'borrowernumber'} ); - if ($fines) { + if ($fines > 0) { $template->param( fines => sprintf("%.2f",$fines) ); $template->param( fineborrowernumber => $borrower->{'borrowernumber'} ); } -- 1.7.2.3 From lrea at nekls.org Mon Mar 7 22:30:21 2011 From: lrea at nekls.org (Liz Rea) Date: Mon, 7 Mar 2011 15:30:21 -0600 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 1962: Follow-up: Add fine notification during check-in Message-ID: <1299533421-19728-1-git-send-email-lrea@nekls.org> From: Katrin Fischer Don't show message when patron has no fines. Signed-off-by: Liz Rea --- circ/returns.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index c05277c..40706a2 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -243,7 +243,7 @@ if ($barcode) { push( @inputloop, \%input ); my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrower->{'borrowernumber'} ); - if ($fines) { + if ($fines > 0) { $template->param( fines => sprintf("%.2f",$fines) ); $template->param( fineborrowernumber => $borrower->{'borrowernumber'} ); } -- 1.5.6.5 From nengard at bywatersolutions.com Mon Mar 7 22:41:03 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 7 Mar 2011 16:41:03 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5838: Don't show sql statement on guided reports result page Message-ID: <1299534063-3784-1-git-send-email-nengard@bywatersolutions.com> From: Katrin Fischer Signed-off-by: Nicole C. Engard --- .../en/modules/reports/guided_reports_start.tmpl | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl index c5868a0..7839cb5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl @@ -449,7 +449,6 @@ NAME="name" -->">

    Total number of rows matching the (unlimited) query is .

    - -- 1.7.2.3 From reed at catalyst.net.nz Tue Mar 8 01:11:08 2011 From: reed at catalyst.net.nz (Reed Wade) Date: Tue, 8 Mar 2011 13:11:08 +1300 Subject: [Koha-patches] [PATCH] Bug 5841 - routing slip not showing publication date Message-ID: <20110308001615.1757916C0290@reedwade> --- .../en/modules/serials/serials-collection.tmpl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tmpl index b5c9d84..da93dfe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tmpl @@ -226,7 +226,7 @@ $(document).ready(function() { - +
    - , ''); return false" >Print list + , '' ()); return false" >Print list -- 1.7.1 From nengard at bywatersolutions.com Tue Mar 8 03:30:25 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 7 Mar 2011 21:30:25 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug5063: C4::Bookseller Changes Message-ID: <1299551425-5124-1-git-send-email-nengard@bywatersolutions.com> From: Colin Campbell Merge unfao changes to C4::Bookseller Enable warnings in Bookseller.pm Some cleanups in Bookseller code Do not export everything by default Display vendors more rationally Was displaying by id make it name as the searchstring is for all embedded substrings Have removed "if mysql" logic as we want to deal with this by abstracting the DB interaction and it makes cleaner code until then Sponsered by UN FAO, Rome Signed-off-by: Nicole C. Engard --- C4/Bookseller.pm | 172 ++++++++++++++++------------------------ acqui/basket.pl | 2 +- acqui/booksellers.pl | 2 +- acqui/lateorders.pl | 4 +- acqui/neworderbiblio.pl | 2 +- acqui/neworderempty.pl | 2 +- acqui/newordersuggestion.pl | 2 +- acqui/orderreceive.pl | 2 +- acqui/parcel.pl | 2 +- acqui/parcels.pl | 2 +- acqui/supplier.pl | 2 +- acqui/updatesupplier.pl | 3 +- serials/acqui-search-result.pl | 2 +- serials/claims.pl | 2 +- t/db_dependent/Acquisition.t | 2 +- t/db_dependent/lib/KohaTest.pm | 2 +- 16 files changed, 84 insertions(+), 121 deletions(-) diff --git a/C4/Bookseller.pm b/C4/Bookseller.pm index 21ad348..4ad42cb 100644 --- a/C4/Bookseller.pm +++ b/C4/Bookseller.pm @@ -1,6 +1,7 @@ package C4::Bookseller; # Copyright 2000-2002 Katipo Communications +# Copyright 2010 PTFS Europe # # This file is part of Koha. # @@ -18,23 +19,18 @@ package C4::Bookseller; # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use strict; -#use warnings; FIXME - Bug 2505 - -use vars qw($VERSION @ISA @EXPORT); - -BEGIN { - # set the version for version checking - $VERSION = 3.01; - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - &GetBookSeller &GetBooksellersWithLateOrders &GetBookSellerFromId - &ModBookseller - &DelBookseller - &AddBookseller - ); -} +use warnings; + +use base qw( Exporter ); +# set the version for version checking +our $VERSION = 4.01; +our @EXPORT_OK = qw( + GetBookSeller GetBooksellersWithLateOrders GetBookSellerFromId + ModBookseller + DelBookseller + AddBookseller +); =head1 NAME @@ -54,92 +50,67 @@ a bookseller. =head2 GetBookSeller - at results = &GetBookSeller($searchstring); + at results = GetBookSeller($searchstring); Looks up a book seller. C<$searchstring> may be either a book seller ID, or a string to look for in the book seller's name. -C<@results> is an array of references-to-hash, whose keys are the fields of of the +C<@results> is an array of hash_refs whose keys are the fields of of the aqbooksellers table in the Koha database. =cut -# FIXME: This function is badly named. It should be something like -# SearchBookSellersByName. It is NOT a singular return value. +sub GetBookSeller { + my $searchstring = shift; + $searchstring = q{%} . $searchstring . q{%}; + my $query = +'select aqbooksellers.*, count(*) as basketcount from aqbooksellers left join aqbasket ' + . 'on aqbasket.booksellerid = aqbooksellers.id where name lIke ? group by aqbooksellers.id order by name'; + + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare($query); + $sth->execute($searchstring); + my $resultset_ref = $sth->fetchall_arrayref( {} ); + return @{$resultset_ref}; +} -sub GetBookSeller($) { - my ($searchstring) = @_; +sub GetBookSellerFromId { + my $id = shift or return; my $dbh = C4::Context->dbh; - my $query = "SELECT * FROM aqbooksellers WHERE name LIKE ?"; - my $sth =$dbh->prepare($query); - $sth->execute( "%$searchstring%" ); - my @results; - # count how many baskets this bookseller has. - # if it has none, the bookseller can be deleted - my $sth2 = $dbh->prepare("SELECT count(*) FROM aqbasket WHERE booksellerid=?"); - while ( my $data = $sth->fetchrow_hashref ) { - $sth2->execute($data->{id}); - $data->{basketcount} = $sth2->fetchrow(); - push( @results, $data ); + my $vendor = + $dbh->selectrow_hashref( 'SELECT * FROM aqbooksellers WHERE id = ?', + {}, $id ); + if ($vendor) { + ( $vendor->{basketcount} ) = $dbh->selectrow_array( + 'SELECT count(*) FROM aqbasket where booksellerid = ?', + {}, $id ); } - $sth->finish; - return @results ; + return $vendor; } - -sub GetBookSellerFromId($) { - my $id = shift or return; - my $dbh = C4::Context->dbh(); - my $query = "SELECT * FROM aqbooksellers WHERE id = ?"; - my $sth =$dbh->prepare($query); - $sth->execute( $id ); - if (my $data = $sth->fetchrow_hashref()){ - my $sth2 = $dbh->prepare("SELECT count(*) FROM aqbasket WHERE booksellerid=?"); - $sth2->execute($id); - $data->{basketcount}=$sth2->fetchrow(); - return $data; - } - return; -} #-----------------------------------------------------------------# =head2 GetBooksellersWithLateOrders -%results = &GetBooksellersWithLateOrders; +%results = GetBooksellersWithLateOrders($delay); Searches for suppliers with late orders. =cut sub GetBooksellersWithLateOrders { - my ($delay,$branch) = @_; # FIXME: Branch argument unused. + my $delay = shift; my $dbh = C4::Context->dbh; -# FIXME NOT quite sure that this operation is valid for DBMs different from Mysql, HOPING so -# should be tested with other DBMs - - my $strsth; - my $dbdriver = C4::Context->config("db_scheme") || "mysql"; - if ( $dbdriver eq "mysql" ) { - $strsth = " - SELECT DISTINCT aqbasket.booksellerid, aqbooksellers.name - FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno - LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id - WHERE (closedate < DATE_SUB(CURDATE( ),INTERVAL $delay DAY) - AND (datereceived = '' OR datereceived IS NULL)) - "; - } - else { - $strsth = " - SELECT DISTINCT aqbasket.booksellerid, aqbooksellers.name - FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno - LEFT JOIN aqbooksellers ON aqbasket.aqbooksellerid = aqbooksellers.id - WHERE (closedate < (CURDATE( )-(INTERVAL $delay DAY))) - AND (datereceived = '' OR datereceived IS NULL)) - "; - } + # TODO delay should be verified + my $query_string = + "SELECT DISTINCT aqbasket.booksellerid, aqbooksellers.name + FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno + LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id + WHERE (closedate < DATE_SUB(CURDATE( ),INTERVAL $delay DAY) + AND (datereceived = '' OR datereceived IS NULL))"; - my $sth = $dbh->prepare($strsth); + my $sth = $dbh->prepare($query_string); $sth->execute; my %supplierlist; while ( my ( $id, $name ) = $sth->fetchrow ) { @@ -165,8 +136,8 @@ Returns the ID of the newly-created bookseller. sub AddBookseller { my ($data) = @_; - my $dbh = C4::Context->dbh; - my $query = " + my $dbh = C4::Context->dbh; + my $query = q| INSERT INTO aqbooksellers ( name, address1, address2, address3, address4, @@ -176,8 +147,8 @@ sub AddBookseller { listincgst,invoiceincgst, gstrate, discount, notes ) - VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) - "; + VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) | + ; my $sth = $dbh->prepare($query); $sth->execute( $data->{'name'}, $data->{'address1'}, @@ -196,21 +167,14 @@ sub AddBookseller { ); # return the id of this new supplier - # FIXME: no protection against simultaneous addition: max(id) might be wrong! - $query = " - SELECT max(id) - FROM aqbooksellers - "; - $sth = $dbh->prepare($query); - $sth->execute; - return scalar($sth->fetchrow); + return $dbh->{'mysql_insertid'}; } #-----------------------------------------------------------------# =head2 ModBookseller -&ModBookseller($bookseller); +ModBookseller($bookseller); Updates the information for a given bookseller. C<$bookseller> is a reference-to-hash whose keys are the fields of the aqbooksellers table @@ -226,17 +190,15 @@ C<&ModBookseller> with the result. sub ModBookseller { my ($data) = @_; my $dbh = C4::Context->dbh; - my $query = " - UPDATE aqbooksellers + my $query = 'UPDATE aqbooksellers SET name=?,address1=?,address2=?,address3=?,address4=?, postal=?,phone=?,fax=?,url=?,contact=?,contpos=?, contphone=?,contfax=?,contaltphone=?,contemail=?, contnotes=?,active=?,listprice=?, invoiceprice=?, gstreg=?,listincgst=?,invoiceincgst=?, - discount=?, notes=?, gstrate=? - WHERE id=? - "; - my $sth = $dbh->prepare($query); + discount=?,notes=?,gstrate=? + WHERE id=?'; + my $sth = $dbh->prepare($query); $sth->execute( $data->{'name'}, $data->{'address1'}, $data->{'address2'}, $data->{'address3'}, @@ -249,27 +211,27 @@ sub ModBookseller { $data->{'active'}, $data->{'listprice'}, $data->{'invoiceprice'}, $data->{'gstreg'}, $data->{'listincgst'}, $data->{'invoiceincgst'}, - $data->{'discount'}, - $data->{'notes'}, $data->{'gstrate'}, - $data->{'id'} + $data->{'discount'}, $data->{'notes'}, + $data->{'gstrate'}, $data->{'id'} ); - $sth->finish; + return; } =head2 DelBookseller -&DelBookseller($booksellerid); +DelBookseller($booksellerid); -delete the supplier identified by $booksellerid -This sub can be called only if the supplier has no order. +delete the supplier record identified by $booksellerid +This sub assumes it is called only if the supplier has no order. =cut sub DelBookseller { - my ($id) = @_; - my $dbh=C4::Context->dbh; - my $sth=$dbh->prepare("DELETE FROM aqbooksellers WHERE id=?"); + my $id = shift; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare('DELETE FROM aqbooksellers WHERE id=?'); $sth->execute($id); + return; } 1; diff --git a/acqui/basket.pl b/acqui/basket.pl index 221a26b..8ea2929 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -29,7 +29,7 @@ use CGI; use C4::Acquisition; use C4::Budgets; -use C4::Bookseller; +use C4::Bookseller qw( GetBookSellerFromId); use C4::Dates qw/format_date/; use C4::Debug; diff --git a/acqui/booksellers.pl b/acqui/booksellers.pl index 7641e68..0918f5d 100755 --- a/acqui/booksellers.pl +++ b/acqui/booksellers.pl @@ -62,7 +62,7 @@ use CGI; use C4::Acquisition; use C4::Dates qw/format_date/; -use C4::Bookseller; +use C4::Bookseller qw/ GetBookSellerFromId GetBookSeller /; use C4::Members qw/GetMember/; my $query = new CGI; diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl index e948d2f..810f665 100755 --- a/acqui/lateorders.pl +++ b/acqui/lateorders.pl @@ -45,7 +45,7 @@ To know on which branch this script have to display late order. use strict; use warnings; use CGI; -use C4::Bookseller; +use C4::Bookseller qw( GetBooksellersWithLateOrders ); use C4::Auth; use C4::Koha; use C4::Output; @@ -76,7 +76,7 @@ unless ($delay =~ /^\d{1,3}$/) { $delay = 30; #default value for delay } -my %supplierlist = GetBooksellersWithLateOrders($delay,$branch); +my %supplierlist = GetBooksellersWithLateOrders($delay); my (@sloopy); # supplier loop foreach (keys %supplierlist){ push @sloopy, (($supplierid and $supplierid eq $_ ) ? diff --git a/acqui/neworderbiblio.pl b/acqui/neworderbiblio.pl index 2333f89..9e63492 100755 --- a/acqui/neworderbiblio.pl +++ b/acqui/neworderbiblio.pl @@ -60,7 +60,7 @@ use strict; use C4::Search; use CGI; -use C4::Bookseller; +use C4::Bookseller qw/ GetBookSellerFromId /; use C4::Biblio; use C4::Auth; use C4::Output; diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 6af057d..1cba13e 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -77,7 +77,7 @@ use C4::Budgets; use C4::Input; use C4::Dates; -use C4::Bookseller; # GetBookSellerFromId +use C4::Bookseller qw/ GetBookSellerFromId /; use C4::Acquisition; use C4::Suggestions; # GetSuggestion use C4::Biblio; # GetBiblioData diff --git a/acqui/newordersuggestion.pl b/acqui/newordersuggestion.pl index 156dab8..b65e4ea 100755 --- a/acqui/newordersuggestion.pl +++ b/acqui/newordersuggestion.pl @@ -93,7 +93,7 @@ use CGI; use C4::Auth; # get_template_and_user use C4::Output; use C4::Suggestions; -use C4::Bookseller; +use C4::Bookseller qw/ GetBookSellerFromId /; use C4::Biblio; my $input = new CGI; diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index 96e4556..98ba544 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -69,7 +69,7 @@ use C4::Acquisition; use C4::Auth; use C4::Output; use C4::Dates qw/format_date/; -use C4::Bookseller; +use C4::Bookseller qw/ GetBookSellerFromId /; use C4::Members; use C4::Branch; # GetBranches use C4::Items; diff --git a/acqui/parcel.pl b/acqui/parcel.pl index 6c8f5f0..ad95944 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -61,7 +61,7 @@ use strict; use C4::Auth; use C4::Acquisition; use C4::Budgets; -use C4::Bookseller; +use C4::Bookseller qw/ GetBookSellerFromId /; use C4::Biblio; use C4::Items; use CGI; diff --git a/acqui/parcels.pl b/acqui/parcels.pl index 33792b4..1e8d44e 100755 --- a/acqui/parcels.pl +++ b/acqui/parcels.pl @@ -74,7 +74,7 @@ use C4::Output; use C4::Dates qw/format_date/; use C4::Acquisition; -use C4::Bookseller; +use C4::Bookseller qw/ GetBookSellerFromId /; my $input = CGI->new; my $supplierid = $input->param('supplierid'); diff --git a/acqui/supplier.pl b/acqui/supplier.pl index 80660d9..52d940c 100755 --- a/acqui/supplier.pl +++ b/acqui/supplier.pl @@ -49,7 +49,7 @@ use C4::Output; use C4::Dates qw/format_date /; use CGI; -use C4::Bookseller; +use C4::Bookseller qw( GetBookSellerFromId DelBookseller ); use C4::Budgets; my $query = CGI->new; diff --git a/acqui/updatesupplier.pl b/acqui/updatesupplier.pl index 1d487cb..7c7aa2c 100755 --- a/acqui/updatesupplier.pl +++ b/acqui/updatesupplier.pl @@ -48,7 +48,8 @@ use strict; #use warnings; FIXME - Bug 2505 use C4::Context; use C4::Auth; -use C4::Bookseller; + +use C4::Bookseller qw( ModBookseller AddBookseller ); use C4::Biblio; use C4::Output; use CGI; diff --git a/serials/acqui-search-result.pl b/serials/acqui-search-result.pl index e671e96..5839cd4 100755 --- a/serials/acqui-search-result.pl +++ b/serials/acqui-search-result.pl @@ -47,7 +47,7 @@ use C4::Output; use CGI; use C4::Acquisition; use C4::Dates qw/format_date/; -use C4::Bookseller; +use C4::Bookseller qw( GetBookSeller ); my $query=new CGI; my ($template, $loggedinuser, $cookie) diff --git a/serials/claims.pl b/serials/claims.pl index 735d945..e51148c 100755 --- a/serials/claims.pl +++ b/serials/claims.pl @@ -24,7 +24,7 @@ use C4::Auth; use C4::Serials; use C4::Acquisition; use C4::Output; -use C4::Bookseller; +use C4::Bookseller qw( GetBookSeller ); use C4::Context; use C4::Letters; use C4::Branch; # GetBranches GetBranchesLoop diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t index 241f442..1d4f36a 100755 --- a/t/db_dependent/Acquisition.t +++ b/t/db_dependent/Acquisition.t @@ -7,7 +7,7 @@ use strict; use warnings; use Data::Dumper; -use C4::Bookseller; +use C4::Bookseller qw( GetBookSellerFromId ); use Test::More tests => 37; diff --git a/t/db_dependent/lib/KohaTest.pm b/t/db_dependent/lib/KohaTest.pm index 323b55a..1282e38 100644 --- a/t/db_dependent/lib/KohaTest.pm +++ b/t/db_dependent/lib/KohaTest.pm @@ -10,7 +10,7 @@ plan skip_all => "Test::Class required for performing database tests" if $@; use C4::Auth; use C4::Biblio; -use C4::Bookseller; +use C4::Bookseller qw( AddBookseller ); use C4::Context; use C4::Items; use C4::Members; -- 1.7.2.3 From nengard at bywatersolutions.com Tue Mar 8 03:41:13 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 7 Mar 2011 21:41:13 -0500 Subject: [Koha-patches] [PATCH 2/2] [SIGNED-OFF] bug_5064 Rework data retrieval in booksellers.pl Message-ID: <1299552073-5411-1-git-send-email-nengard@bywatersolutions.com> From: Colin Campbell loops were slightly illogical and db accesss was excessive and repetitive. caused it not to scale well on large datasets Routines in Acquisition.pm seem to have inconsistent views of the data. rework logic to utilize db and processing better Signed-off-by: Nicole C. Engard --- acqui/booksellers.pl | 124 ++++++++++++++++++++++++++++---------------------- 1 files changed, 70 insertions(+), 54 deletions(-) diff --git a/acqui/booksellers.pl b/acqui/booksellers.pl index 0918f5d..88dbaa9 100755 --- a/acqui/booksellers.pl +++ b/acqui/booksellers.pl @@ -4,6 +4,7 @@ # Copyright 2000-2002 Katipo Communications # Copyright 2008-2009 BibLibre SARL +# Copyright 2010 PTFS Europe # # This file is part of Koha. # @@ -20,14 +21,13 @@ # with Koha; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - =head1 NAME booksellers.pl =head1 DESCRIPTION -this script displays the list of suppliers & orders like C<$supplier> given on input arg. +this script displays the list of suppliers & baskets like C<$supplier> given on input arg. thus, this page brings differents features like to display supplier's details, to add an order for a specific supplier or to just add a new supplier. @@ -37,40 +37,34 @@ to add an order for a specific supplier or to just add a new supplier. =item supplier -C<$supplier> is the suplier we have to search order. -=back - -=item op +C<$supplier> is the string with which we search for a supplier -C can be equals to 'close' if we have to close a basket before building the page. +=back -=item basket +=item id or supplierid -the C we have to close if op is equal to 'close'. +The id of the supplier whose baskets we will display =back =cut use strict; -#use warnings; FIXME - Bug 2505 +use warnings; use C4::Auth; use C4::Biblio; use C4::Output; use CGI; - -use C4::Acquisition; use C4::Dates qw/format_date/; use C4::Bookseller qw/ GetBookSellerFromId GetBookSeller /; use C4::Members qw/GetMember/; -my $query = new CGI; +my $query = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { - template_name => "acqui/booksellers.tmpl", + { template_name => 'acqui/booksellers.tmpl', query => $query, - type => "intranet", + type => 'intranet', authnotrequired => 0, flagsrequired => { acquisition => 'vendors_manage' }, debug => 1, @@ -79,56 +73,78 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( #parameters my $supplier = $query->param('supplier'); -my $id = $query->param('id') || $query->param('supplierid'); +my $id = $query->param('id') || $query->param('supplierid'); my @suppliers; if ($id) { - push @suppliers, GetBookSellerFromId($id); + push @suppliers, GetBookSellerFromId($id); } else { - @suppliers = GetBookSeller($supplier); + @suppliers = GetBookSeller($supplier); +} + +my $supplier_count = @suppliers; +if ( $supplier_count == 1 ) { + $template->param( + supplier_name => $suppliers[0]->{'name'}, + id => $suppliers[0]->{'id'} + ); } -my $count = scalar @suppliers; -if ($count == 1){ - $template->param( supplier_name => $suppliers[0]->{'name'}, - id => $suppliers[0]->{'id'} - ); + +my $uid; +if ($loggedinuser) { + $uid = GetMember( borrowernumber => $loggedinuser )->{userid}; } #build result page -my @loop_suppliers; -for ( my $i = 0 ; $i < $count ; $i++ ) { - my $orders = GetBasketsByBookseller( $suppliers[$i]->{'id'}, {groupby => "aqbasket.basketno", orderby => "aqbasket.basketname"} ); - my $ordcount = scalar @$orders; - my %line; - - $line{supplierid} = $suppliers[$i]->{'id'}; - $line{name} = $suppliers[$i]->{'name'}; - $line{active} = $suppliers[$i]->{'active'}; - my @loop_basket; - my $uid = GetMember(borrowernumber => $loggedinuser)->{userid} if $loggedinuser; - for ( my $i2 = 0 ; $i2 < $ordcount ; $i2++ ) { - if ( $orders->[$i2]{'authorisedby'} eq $loggedinuser || haspermission($uid, { flagsrequired => { 'acquisition' => '*' } } ) ) { - my %inner_line; - $inner_line{basketno} = $orders->[$i2]{'basketno'}; - $inner_line{basketname} = $orders->[$i2]{'basketname'}; - $inner_line{total} = scalar GetOrders($orders->[$i2]{'basketno'}); - $inner_line{authorisedby} = $orders->[$i2]{'authorisedby'}; - my $authby = GetMember(borrowernumber => $orders->[$i2]{'authorisedby'}); - $inner_line{surname} = $authby->{'firstname'}; - $inner_line{firstname} = $authby->{'surname'}; - $inner_line{creationdate} = format_date( $orders->[$i2]{'creationdate'} ); - $inner_line{closedate} = format_date( $orders->[$i2]{'closedate'} ); - $inner_line{uncertainprice} = $orders->[$i2]{'uncertainprice'}; - push @loop_basket, \%inner_line; +my $loop_suppliers = []; + +for my $vendor (@suppliers) { + my $baskets = get_vendors_baskets( $vendor->{id} ); + + my $loop_basket = []; + for my $basket ( @{$baskets} ) { + if (( $basket->{authorisedby} + && $basket->{authorisedby} eq $loggedinuser + ) + || haspermission( $uid, { flagsrequired => { acquisition => q{*} } } ) + ) { + for my $date_field (qw( creationdate closedate)) { + if ( $basket->{$date_field} ) { + $basket->{$date_field} = + format_date( $basket->{$date_field} ); + } + } + push @{$loop_basket}, $basket; } } - $line{loop_basket} = \@loop_basket; - push @loop_suppliers, \%line; + + push @{$loop_suppliers}, + { loop_basket => $loop_basket, + supplierid => $vendor->{id}, + name => $vendor->{name}, + active => $vendor->{active}, + }; + } $template->param( - loop_suppliers => \@loop_suppliers, - supplier => ($id || $supplier), - count => $count, + loop_suppliers => $loop_suppliers, + supplier => ( $id || $supplier ), + count => $supplier_count, ); output_html_with_http_headers $query, $cookie, $template->output; + +sub get_vendors_baskets { + my $supplier_id = shift; + my $dbh = C4::Context->dbh; + my $sql = <<'ENDSQL'; +select aqbasket.*, count(*) as total, borrowers.firstname, borrowers.surname +from aqbasket left join aqorders on aqorders.basketno = aqbasket.basketno +left join borrowers on aqbasket.authorisedby = borrowers.borrowernumber +where booksellerid = ? +AND ( aqorders.quantity > aqorders.quantityreceived OR quantityreceived IS NULL) +AND datecancellationprinted IS NULL +group by basketno +ENDSQL + return $dbh->selectall_arrayref( $sql, { Slice => {} }, $supplier_id ); +} -- 1.7.2.3 From nengard at bywatersolutions.com Tue Mar 8 04:34:19 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 7 Mar 2011 22:34:19 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5595: (MT #5757)adding additional attributes support on patrons's search Message-ID: <1299555259-5676-1-git-send-email-nengard@bywatersolutions.com> From: St?phane Delaune Restores ability to search on extended borrower attributes that are configured to be searchable Signed-off-by: Ian Walls Signed-off-by: Nicole C. Engard --- C4/Members.pm | 38 +++++++++++++++++++++++--------------- C4/Members/Attributes.pm | 10 +++++----- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index a292054..2b733ed 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -278,22 +278,30 @@ C<&searchtype> is a string telling the type of search you want todo : start_with =cut sub Search { - my ($filter,$orderby, $limit, $columns_out, $search_on_fields,$searchtype) = @_; - my @filters; - if (ref($filter) eq "ARRAY"){ - push @filters,@$filter; - } - else { - push @filters,$filter; - } - if (C4::Context->preference('ExtendedPatronAttributes')) { - my $matching_records = C4::Members::Attributes::SearchIdMatchingAttribute($filter); - push @filters,@$matching_records; - } - $searchtype||="start_with"; - my $data=SearchInTable("borrowers",\@filters,$orderby,$limit,$columns_out,$search_on_fields,$searchtype); - - return ( $data ); + 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; + } + if ( C4::Context->preference('ExtendedPatronAttributes') ) { + my $matching_records = C4::Members::Attributes::SearchIdMatchingAttribute($filter); + if(scalar(@$matching_records)>0) { + foreach my $matching_record (@$matching_records) { + $filtersmatching_record{$$matching_record[0]}=1; + } + foreach my $k (keys(%filtersmatching_record)) { + push @filters, {"borrowernumber"=>$k}; + } + } + } + $searchtype ||= "start_with"; + push @finalfilter, \@filters; + my $data = SearchInTable( "borrowers", \@finalfilter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype ); + return ($data); } =head2 GetMemberDetails diff --git a/C4/Members/Attributes.pm b/C4/Members/Attributes.pm index 70c34b4..b89b03a 100644 --- a/C4/Members/Attributes.pm +++ b/C4/Members/Attributes.pm @@ -102,17 +102,17 @@ sub GetBorrowerAttributes { sub SearchIdMatchingAttribute{ my $filter = shift; - - my $dbh = C4::Context->dbh(); + my $finalfilter=$$filter[0]; + my $dbh = C4::Context->dbh(); my $query = qq{ SELECT borrowernumber FROM borrower_attributes JOIN borrower_attribute_types USING (code) WHERE staff_searchable = 1 -AND attribute like ?}; +AND attribute like "%$finalfilter%"}; my $sth = $dbh->prepare_cached($query); - $sth->execute($filter); - return $sth->fetchall_arrayref; + $sth->execute(); + return $sth->fetchall_arrayref; } =head2 CheckUniqueness -- 1.7.2.3 From tomascohen at gmail.com Wed Mar 9 13:42:31 2011 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Wed, 9 Mar 2011 09:42:31 -0300 Subject: [Koha-patches] [PATCH 2/2] [Bug 5791] Robust handling of deleted biblios/authorities Message-ID: <1299674551-14222-1-git-send-email-tomascohen@gmail.com> Replaces the original patch. Suggestions by Owen. --- .../prog/en/modules/authorities/detail.tmpl | 6 +++--- .../prog/en/modules/catalogue/detail.tmpl | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tmpl index c51e697..e675d34 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tmpl @@ -1,5 +1,5 @@ -Koha › Authorities › <!-- TMPL_IF NAME="unknownauthid" --> Unknown authority<!-- TMPL_ELSE -->Details for Authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)<!-- /TMPL_IF --> +Koha › Authorities › <!-- TMPL_IF NAME="unknownauthid" --> Unknown authority record<!-- TMPL_ELSE -->Details for Authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)<!-- /TMPL_IF --> + - - - - + + +

    006 Fixed-length data elements--Additional material characteristics--General information

    - - - - - - - - - - -
    + + +
    +

    ""

    +
    + + +" /> + + + + +
    + +
    Cancel
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml new file mode 100755 index 0000000..c7a9e3b --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml @@ -0,0 +1,795 @@ + + + + + a + t + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + o + p + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 2 + 5 + 6 + a + b + c + d + e + f + g + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + 0 + 1 + | + + + 0 + 1 + | + + + + 0 + 1 + d + e + f + h + i + j + m + p + s + u + | + + + # + a + b + c + d + | + + + + + m + + + + # + a + b + c + d + e + f + g + j + | + + + # + o + q + | + + + + a + b + c + d + e + f + g + h + i + j + m + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + + + + e + f + + + # + a + b + c + d + e + f + g + i + j + k + m + z + |||| + + + ## + aa + ab + ac + ad + ae + af + ag + am + an + ap + au + az + ba + bb + bc + bd + be + bf + bg + bh + bi + bj + bk + bl + bo + br + bs + bu + bz + ca + cb + cc + ce + cp + cu + cz + da + db + dc + dd + de + df + dg + dh + dl + zz + | + + + + a + b + c + d + e + f + g + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + 0 + 1 + | + + + + # + e + j + k + l + n + o + p + r + z + | + + + + + c + d + i + j + + + an + bd + bg + bl + bt + ca + cb + cc + cg + ch + cl + cn + co + cp + cr + cs + ct + cy + cz + df + dv + fg + fl + fm + ft + gm + hy + jz + mc + md + mi + mo + mp + mr + ms + mu + mz + nc + nn + op + or + ov + pg + pm + po + pp + pr + ps + pt + pv + rc + rd + rg + ri + rp + rq + sd + sg + sn + sp + st + su + sy + tc + tl + ts + uu + vi + vr + wz + za + zz + || + + + a + b + c + d + e + g + h + i + j + m + n + u + z + | + + + # + d + e + f + n + u + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + a + b + c + d + e + f + g + h + i + k + r + s + z + | + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + r + s + t + z + | + + + + # + a + b + c + n + u + | + + + + + + s + + + # + a + b + c + d + e + f + g + h + i + j + k + m + q + s + t + u + w + z + | + + + n + r + u + x + | + + + + # + d + l + m + n + p + w + | + + + # + a + b + c + d + e + f + o + q + s + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + z + ||| + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + + # + a + b + c + d + e + f + g + h + i + j + k + l + u + z + | + + + 0 + 1 + 2 + | + + + + + g + k + o + r + + + 000 + 001-999 + nnn + ||| + ??????????????????????? --- + + + + # + a + b + c + d + e + f + g + j + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + a + b + c + d + f + g + i + k + l + m + n + o + p + q + r + s + t + v + w + z + | + + + a + c + l + n + u + z + | + + + + + p + + + + # + a + b + c + d + f + o + q + r + s + | + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl old mode 100644 new mode 100755 index 9dddccb..9638287 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl @@ -1,659 +1,74 @@ Koha › Cataloging › 008 builder - - -

    008 Fixed-length data elements--General information

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +" /> +
    1-5 Date entered on file (auto-filled)" />
    - - - -
    - "/> -
    - "/>
    See MARC Code List for Countries - "/> -
    "/>
    - -
    - -
    - "/>
    - -
    - -
    - -
    - -
    32 Undefined
    - -
    - -
    See MARC Code List for Languages - "/> -
    - + + -
    - + + +
    +

    ""

    - - - - - - -
    + + + +
    + +
    Cancel
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml new file mode 100755 index 0000000..e4f4869 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml @@ -0,0 +1,1298 @@ + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + o + p + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 2 + 5 + 6 + a + b + c + d + e + f + g + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + 0 + 1 + | + + + 0 + 1 + | + + + + 0 + 1 + d + e + f + h + i + j + m + p + s + u + | + + + # + a + b + c + d + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + + # + a + b + c + d + e + f + g + j + | + + + # + o + q + | + + + + a + b + c + d + e + f + g + h + i + j + m + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + # + a + b + c + d + e + f + g + i + j + k + m + z + |||| + + + ## + aa + ab + ac + ad + ae + af + ag + am + an + ap + au + az + ba + bb + bc + bd + be + bf + bg + bh + bi + bj + bk + bl + bo + br + bs + bu + bz + ca + cb + cc + ce + cp + cu + cz + da + db + dc + dd + de + df + dg + dh + dl + zz + | + + + + a + b + c + d + e + f + g + u + z + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + 0 + 1 + | + + + + # + e + j + k + l + n + o + p + r + z + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + an + bd + bg + bl + bt + ca + cb + cc + cg + ch + cl + cn + co + cp + cr + cs + ct + cy + cz + df + dv + fg + fl + fm + ft + gm + hy + jz + mc + md + mi + mo + mp + mr + ms + mu + mz + nc + nn + op + or + ov + pg + pm + po + pp + pr + ps + pt + pv + rc + rd + rg + ri + rp + rq + sd + sg + sn + sp + st + su + sy + tc + tl + ts + uu + vi + vr + wz + za + zz + || + + + a + b + c + d + e + g + h + i + j + m + n + u + z + | + + + # + d + e + f + n + u + | + + + # + a + b + c + d + e + f + g + j + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + a + b + c + d + e + f + g + h + i + k + r + s + z + | + + + # + a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + r + s + t + z + | + + + + # + a + b + c + n + u + | + + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + # + a + b + c + d + e + f + g + h + i + j + k + m + q + s + t + u + w + z + | + + + n + r + u + x + | + + + + # + d + l + m + n + p + w + | + + + # + a + b + c + d + e + f + o + q + s + | + + + # + a + b + c + d + f + o + q + r + s + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + y + z + | + + + # + 5 + 6 + a + b + c + d + e + f + g + h + i + k + l + m + n + o + p + q + r + s + t + u + v + w + z + ||| + + + # + a + c + f + i + l + m + o + s + u + z + | + + + 0 + 1 + | + + + + # + a + b + c + d + e + f + g + h + i + j + k + l + u + z + | + + + 0 + 1 + 2 + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + 000 + 001-999 + nnn + ||| + ??????????????????????? --- + + + + # + a + b + c + d + e + f + g + j + | + + + + # + a + c + f + i + l + m + o + s + u + z + | + + + # + a + b + c + d + f + o + q + r + s + | + + + + a + b + c + d + f + g + i + k + l + m + n + o + p + q + r + s + t + v + w + z + | + + + a + c + l + n + u + z + | + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + + + + b + c + d + e + i + k + m + n + p + q + r + s + t + u + | + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + # + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + u + |||| + + + vp# + xx# + [aa#] + [aaa] + + + + # + a + b + c + d + f + o + q + r + s + | + + + + ### + mul + sgn + und + zxx + [aaa] + + + # + d + o + r + s + x + | + + + # + c + d + u + | + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd new file mode 100755 index 0000000..7b0b27b --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd @@ -0,0 +1,83 @@ + + + + Control Field Plugin Type of Materials schema + + + + + + Element indicating the control field + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 1.7.2.3 From jcamins at bywatersolutions.com Sat Mar 12 20:35:49 2011 From: jcamins at bywatersolutions.com (Jared Camins-Esakov) Date: Sat, 12 Mar 2011 14:35:49 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF 1/2] Bug 5810: Subject tracings search complete subfields Message-ID: <1299958550-3589-1-git-send-email-jcamins@bywatersolutions.com> This patch adds the syspref TraceCompleteSubfields. When TraceCompleteSubfields is set to "force," clicking on links in non-authority controlled subject tracings will only find other records where the entire subfields match. Leaving it at "don't force" keeps the current behavior of doing a keyword search of the subject indexes. This patch implements complete-subfield subject tracings in MARC21 XSLTs (OPAC and Staff) and all Normal mode interfaces. UNIMARC XSLTs have not been updated. This patch also adds the syspref UseAuthoritiesForTracings. When set to "Do not" tracings in the XSLT detail displays will never generate links using authority numbers, but rather use the heading strings (NB: the tracings currently use only subfield 'a' for generating links). Signed-off-by: Nicole C. Engard Signed-off-by: Jane Wagner Signed-off-by: Jared Camins-Esakov --- C4/Biblio.pm | 4 +++- C4/XSLT.pm | 3 ++- installer/data/mysql/de-DE/mandatory/sysprefs.sql | 2 ++ installer/data/mysql/en/mandatory/sysprefs.sql | 3 +++ .../1-Obligatoire/unimarc_standard_systemprefs.sql | 3 ++- installer/data/mysql/it-IT/necessari/sysprefs.sql | 4 +++- installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 4 +++- ...m_preferences_full_optimal_for_install_only.sql | 2 ++ ...m_preferences_full_optimal_for_install_only.sql | 2 ++ installer/data/mysql/updatedatabase.pl | 8 +++++++- .../en/modules/admin/preferences/authorities.pref | 7 +++++++ .../en/modules/admin/preferences/searching.pref | 7 +++++++ .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 11 +++++++---- .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 13 ++++++++----- 14 files changed, 58 insertions(+), 15 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 1daa70a..9cd3d05 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1390,6 +1390,8 @@ sub GetMarcSubjects { my $subfield = ""; my $marcsubject; + my $subject_limit = C4::Context->preference("TraceCompleteSubfields") ? 'su,complete-subfield' : 'su'; + foreach my $field ( $record->field('6..') ) { next unless $field->tag() >= $mintag && $field->tag() <= $maxtag; my @subfields_loop; @@ -1416,7 +1418,7 @@ sub GetMarcSubjects { @link_loop = ( { 'limit' => 'an', link => "$linkvalue" } ); } if ( not $found9 ) { - push @link_loop, { 'limit' => 'su', link => $linkvalue, operator => $operator }; + push @link_loop, { 'limit' => $subject_limit, link => $linkvalue, operator => $operator }; } my $separator = C4::Context->preference("authoritysep") unless $counter == 0; diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 4b6a99c..348930f 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -130,7 +130,8 @@ sub XSLTParse4Display { my $sysxml = "\n"; foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow DisplayOPACiconsXSLT URLLinkText viewISBD - OPACBaseURL / ) + OPACBaseURL TraceCompleteSubfields + UseAuthoritiesForTracings / ) { my $sp = C4::Context->preference( $syspref ); next unless defined($sp); diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index b752919..fe7684d 100644 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -288,4 +288,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 3e03cad..2833c80 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -289,3 +289,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','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 db61881..c13a673 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -290,4 +290,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); - +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql index 27bb72e..7b12cb9 100644 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -274,4 +274,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); \ No newline at end of file +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index 2743698..d231296 100644 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -286,4 +286,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); \ No newline at end of file +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','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 b00c1e7..11d9178 100644 --- 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 @@ -342,3 +342,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','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 b9e1ca8..2e53d4c 100644 --- 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 @@ -367,3 +367,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index e9da578..100edf1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4068,7 +4068,13 @@ 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 ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo')"); + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo')"); + print "Upgrade to $DBversion done (Add syspref to force whole-subfield matching on subject tracings)\n"; + SetVersion($DBversion); +}; =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref index f06d983..3d19af8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref @@ -14,3 +14,10 @@ Authorities: yes: "Don't" no: Do - automatically update attached biblios when changing an authority record. If this is off, please ask your administrator to enable the merge_authorities.pl cronjob. + - + - pref: UseAuthoritiesForTracings + default: yes + choices: + yes: Use + no: "Don't use" + - authority record numbers instead of text strings for searches from subject tracings. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index cd924dc..5ff267f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -55,6 +55,13 @@ Searching: yes: Use no: "Don't use" - PazPar2 to group similar results on the OPAC. This requires that PazPar2 is set up and running. + - + - pref: TraceCompleteSubfields + default: 0 + choices: + yes: Force + no: "Don't force" + - subject tracings in the OPAC and Staff Client to search only for complete-subfield matches. Search Form: - - Show checkboxes to search by diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index e3009d8..c96d82b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -19,6 +19,8 @@ + ,complete-subfield + @@ -121,8 +123,8 @@ - - + + Type: @@ -416,11 +418,11 @@ - + /cgi-bin/koha/catalogue/search.pl?q=an: - /cgi-bin/koha/catalogue/search.pl?q=su: + /cgi-bin/koha/catalogue/search.pl?q=su: @@ -791,6 +793,7 @@ +
    diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl index 5703059..01e88f6 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -22,6 +22,9 @@ + + ,complete-subfield + @@ -128,7 +131,7 @@ - + /cgi-bin/koha/opac-search.pl?q=an: @@ -143,7 +146,7 @@ - + /cgi-bin/koha/opac-search.pl?q=an: @@ -165,7 +168,7 @@ - + /cgi-bin/koha/opac-search.pl?q=an: @@ -479,11 +482,11 @@ - + /cgi-bin/koha/opac-search.pl?q=an: - /cgi-bin/koha/opac-search.pl?q=su: + /cgi-bin/koha/opac-search.pl?q=su: -- 1.7.2.3 From jcamins at bywatersolutions.com Sat Mar 12 20:35:50 2011 From: jcamins at bywatersolutions.com (Jared Camins-Esakov) Date: Sat, 12 Mar 2011 14:35:50 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF 2/2] Bug 5810 revision to fix author search link In-Reply-To: <1299958550-3589-1-git-send-email-jcamins@bywatersolutions.com> References: <1299958550-3589-1-git-send-email-jcamins@bywatersolutions.com> Message-ID: <1299958550-3589-2-git-send-email-jcamins@bywatersolutions.com> From: Jane Wagner Signed-off-by: Jane Wagner Signed-off-by: Jared Camins-Esakov --- .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 2 +- .../intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index c96d82b..2b6af2d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -804,7 +804,7 @@ - + /cgi-bin/koha/catalogue/search.pl?q=an: diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl index d101723..43f86b0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl @@ -127,7 +127,7 @@ - + /cgi-bin/koha/opac-search.pl?q=an: -- 1.7.2.3 From cnighswonger at foundations.edu Sat Mar 12 22:27:00 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Sat, 12 Mar 2011 16:27:00 -0500 Subject: [Koha-patches] [PATCH] Bug 1962: Follow-up: Add fine notification during check-in In-Reply-To: <1299449049-24101-1-git-send-email-Katrin.Fischer.83@web.de> References: <1299449049-24101-1-git-send-email-Katrin.Fischer.83@web.de> Message-ID: This patch does not apply cleanly to 3.2.x. If it should apply, fixup and resubmit with [3.2.x] in the subject line. Kind Regards, Chris # On branch 3.2.x # Your branch is ahead of 'origin/3.2.x' by 6 commits. # # Unmerged paths: # (use "git reset HEAD ..." to unstage) # (use "git add/rm ..." as appropriate to mark resolution) # # both modified: circ/returns.pl # On Sun, Mar 6, 2011 at 5:04 PM, Katrin Fischer wrote: > Don't show message when patron has no fines. > --- > circ/returns.pl | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/circ/returns.pl b/circ/returns.pl > index c05277c..40706a2 100755 > --- a/circ/returns.pl > +++ b/circ/returns.pl > @@ -243,7 +243,7 @@ if ($barcode) { > push( @inputloop, \%input ); > > my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( > $borrower->{'borrowernumber'} ); > - if ($fines) { > + if ($fines > 0) { > $template->param( fines => sprintf("%.2f",$fines) ); > $template->param( fineborrowernumber => > $borrower->{'borrowernumber'} ); > } > -- > 1.7.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 Katrin.Fischer.83 at web.de Sun Mar 13 19:36:35 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Sun, 13 Mar 2011 19:36:35 +0100 Subject: [Koha-patches] [PATCH] [3.2.x] Bug 1962: Add fine notification during check-in Message-ID: <1300041395-26957-1-git-send-email-Katrin.Fischer.83@web.de> Patch reformatted to work for 3.2.x. Original patch submitted by dswhite42 at yahoo.com Reformatted to apply cleanly. Changed alert message during check-in to message used on borrower account checkout page. --- circ/returns.pl | 7 +++++++ .../prog/en/modules/circ/returns.tmpl | 9 +++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index 2aac76a..40706a2 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -241,6 +241,13 @@ if ($barcode) { $input{duedate} = $duedate; $input{return_overdue} = 1 if ($duedate and $duedate lt $today->output('iso')); push( @inputloop, \%input ); + + my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrower->{'borrowernumber'} ); + if ($fines > 0) { + $template->param( fines => sprintf("%.2f",$fines) ); + $template->param( fineborrowernumber => $borrower->{'borrowernumber'} ); + } + } elsif ( !$messages->{'BadBarcode'} ) { $input{duedate} = 0; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl index ba8d117..724a3e9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl @@ -58,6 +58,15 @@ function Dopop(link) {
    This item is part of a Rotating Collection and needs to be Transferred to
    + + +
    + + +

    Cannot Check In

    This item must be checked in at its home library. NOT CHECKED IN

    -- 1.7.1 From Katrin.Fischer.83 at web.de Sun Mar 13 20:52:44 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Sun, 13 Mar 2011 20:52:44 +0100 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] bug4438/MT5496 budget Exceeds total allocation Message-ID: <1300045964-30628-1-git-send-email-Katrin.Fischer.83@web.de> From: Henri-Damien LAURENT This is a followup : When editing a budget, the check for the total allocation would take into account the budget itself. Showing an improper error message The problem was solved when adding a child budget but not when editing the same budget. Signed-off-by: Katrin Fischer --- admin/check_parent_total.pl | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/admin/check_parent_total.pl b/admin/check_parent_total.pl index d5b784d..f0f8c9b 100755 --- a/admin/check_parent_total.pl +++ b/admin/check_parent_total.pl @@ -62,7 +62,13 @@ my ($sub_unalloc , $period_sum, $budget_period_unalloc); if ($parent) { my $query = " SELECT SUM(budget_amount) as sum FROM aqbudgets where budget_parent_id = ? "; my $sth = $dbh->prepare($query); - $sth->execute( $parent->{'budget_id'} ); + my @sql_params; + push @sql_params, $parent->{'budget_id'} ; + if ($budget_id){ + $query.=qq| and budget_id <> ? |; + push @sql_params,$budget_id; + } + $sth->execute( @sql_params ); my $sum = $sth->fetchrow_hashref; $sth->finish; @@ -75,10 +81,16 @@ if ($parent) { # ELSE , IF NO PARENT PASSED, THEN CHECK UNALLOCATED FOR PERIOD, IF NOT THEN RETURN 2 else { my $query = qq| SELECT SUM(budget_amount) as sum - FROM aqbudgets WHERE budget_period_id = ? and budget_parent_id IS NULL|; + FROM aqbudgets WHERE budget_period_id = ? and budget_parent_id IS NULL |; + my @sql_params; + push @sql_params, $period_id; + if ($budget_id){ + $query.=qq| and budget_id <> ? |; + push @sql_params,$budget_id; + } - my $sth = $dbh->prepare($query); - $sth->execute( $period_id ); + my $sth = $dbh->prepare($query); + $sth->execute(@sql_params); $period_sum = $sth->fetchrow_hashref; $sth->finish; $budget_period_unalloc = $period->{'budget_period_total'} - $period_sum->{'sum'} if $period->{'budget_period_total'}; -- 1.7.1 From Katrin.Fischer.83 at web.de Sun Mar 13 21:13:01 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Sun, 13 Mar 2011 21:13:01 +0100 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5848: Same position for the tabs of Normal, MARC and ISBD view in opac detail Message-ID: <1300047181-16538-1-git-send-email-Katrin.Fischer.83@web.de> From: Marcel de Rooy Adjusts three opac detail templates. Moves few styles to css. Removes duplicate view info from XSLT file. Signed-off-by: Katrin Fischer --- koha-tmpl/opac-tmpl/prog/en/css/opac.css | 11 +++++++++++ .../opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl | 2 +- .../opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl | 5 ++--- .../opac-tmpl/prog/en/modules/opac-detail.tmpl | 6 +++--- .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 9 +-------- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 430dad8..83b54ea 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -1991,4 +1991,15 @@ div.ft { #plainmarc th { background-color : #FFF; border: 0; white-space: nowrap; text-align:left; vertical-align: top; padding: 2px; } #plainmarc td { border: 0; padding : 2px; vertical-align: top; } +#catalogue_detail_biblio h1 { float:left; margin:0 1em 1em 0; } +#catalogue_detail_biblio h1.title { float:none; margin-top:1em; } +#catalogue_detail_biblio h3 {clear:both; } + +#opac-detail #Normalview { font-weight:bold; } +#opac-marcdetail #Normalview { font-weight:normal; } +#opac-marcdetail #MARCview { font-weight:bold; } +#opac-isbddetail #Normalview { font-weight:normal; } +#opac-isbddetail #ISBDview { font-weight:bold; } +#opac-isbddetail #isbdcontents { margin-top: 2em; } + div.bibmessage { background-color : #ffffb0; border-radius : 5px; padding : 3px; margin : 2px; } diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl index b66870d..5e9a640 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl @@ -36,7 +36,7 @@
    -

    ISBD View

    +
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl index fad1371..5c50d64 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl @@ -66,16 +66,15 @@ $(document).ready(function(){
    -

    MARC View

    -

    (Record no. )

    +

    (Record no. )

    - +
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl index 5241d19..9ed2c98 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -81,13 +81,13 @@ YAHOO.util.Event.onContentReady("furtherm", function () { "> +
    Normal View ">MARC View ">ISBD View +
    -

    +

    by ">
    -
    Normal View ">MARC View ">ISBD View -
    [ diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl index 01e88f6..6a62616 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -88,7 +88,7 @@ -

    +

    a @@ -182,13 +182,6 @@

    -
    - Normal View - MARC View - - ISBD View - -
    -- 1.7.1 From Katrin.Fischer.83 at web.de Sun Mar 13 23:49:56 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Sun, 13 Mar 2011 23:49:56 +0100 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5860: Order cancelling improvement : delete attached items & biblio Message-ID: <1300056596-25924-1-git-send-email-Katrin.Fischer.83@web.de> From: Paul Poulain - all items attached to the order are deleted - if there is no more items, then the biblio is deleted as well Signed-off-by: Katrin Fischer Works as advertised. Tested: - Deleting from order with no remaining items and remaining items - Cancelling order from shipment with no remaining items and remaining items The biblio record was only deleted, when no other items were left. The bibio record remained and only the ordered items were deleted when there were other items attached to the record. --- C4/Acquisition.pm | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index c1b837b..5c80435 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -1219,6 +1219,9 @@ sub DelOrder { my $sth = $dbh->prepare($query); $sth->execute( $bibnum, $ordernumber ); $sth->finish; + my @itemnumbers = GetItemnumbersFromOrder( $ordernumber ); + C4::Items::DelItem( $dbh, $bibnum, $_ ) for @itemnumbers; + DelBiblio(($bibnum)) if C4::Items::GetItemsCount( $bibnum ) == 0; } =head2 FUNCTIONS ABOUT PARCELS -- 1.7.1 From Katrin.Fischer.83 at web.de Mon Mar 14 00:12:21 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Mon, 14 Mar 2011 00:12:21 +0100 Subject: [Koha-patches] [PATCH] Bug 5861: items.stocknumber not saved correctly Message-ID: <1300057941-11744-1-git-send-email-Katrin.Fischer.83@web.de> The field was missing in Items.pm. It will still act strangely if you enter a stocknumber that already exists in the database. (see Bug 5860) Adding/editing items with stocknumbers you have not used before should work as expected. --- C4/Items.pm | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 05df0c5..d293608 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1897,7 +1897,8 @@ sub _koha_new_item { uri = ?, enumchron = ?, more_subfields_xml = ?, - copynumber = ? + copynumber = ?, + stocknumber = ? "; my $sth = $dbh->prepare($query); $sth->execute( @@ -1934,6 +1935,7 @@ sub _koha_new_item { $item->{'enumchron'}, $item->{'more_subfields_xml'}, $item->{'copynumber'}, + $item->{'stocknumber'}, ); my $itemnumber = $dbh->{'mysql_insertid'}; if ( defined $sth->errstr ) { -- 1.7.1 From Katrin.Fischer.83 at web.de Mon Mar 14 01:27:32 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Mon, 14 Mar 2011 01:27:32 +0100 Subject: [Koha-patches] [PATCH] Bug 3495: Fast bib record add at circulation Message-ID: <1300062452-15343-1-git-send-email-Katrin.Fischer.83@web.de> The link to the Fast add framework was never shown. Now the link is shown if you have the right permissions (fast cataloging or superlibrarian). --- circ/circulation.pl | 6 ++++++ .../prog/en/modules/circ/circulation.tmpl | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 8a184d1..f145f5c 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -615,6 +615,11 @@ if($bor_messages_loop){ $template->param(flagged => 1 ); } my (undef, $roadttype_hashref) = &GetRoadTypes(); my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'}; +my $fast_cataloging = 0; + if (defined getframeworkinfo('FA')) { + $fast_cataloging = 1 + } + $template->param( lib_messages_loop => $lib_messages_loop, bor_messages_loop => $bor_messages_loop, @@ -658,6 +663,7 @@ $template->param( is_child => ($borrower->{'category_type'} eq 'C'), circview => 1, soundon => C4::Context->preference("SoundOn"), + fast_cataloging => $fast_cataloging, ); # save stickyduedate to session diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index df78c54..4791f31 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -303,7 +303,7 @@ function refocus(calendar) {
  • The barcode was not found
  • -
  • Fast cataloging
  • + Fast cataloging @@ -853,4 +853,4 @@ No patron matched - \ No newline at end of file + -- 1.7.1 From f.demians at tamil.fr Mon Mar 14 06:55:09 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Mon, 14 Mar 2011 06:55:09 +0100 Subject: [Koha-patches] [PATCH] Bug 4374 Improve biblio data entry form regarding hidden/mandatory fields Message-ID: <1300082109-22588-1-git-send-email-f.demians@tamil.fr> Biblio framework has 3 entry points controlling if input box are displayed by default in data entry form: - 'mandatory' flag at field level - 'mandatory' flag at subfield level - 'hidden' flag at subfield level It doesn't work as it should (?): - All subfields are expanded (shown) if their field is mandatory - A subfield containing anything is always expanded whatever it contains - A mandatory subfield is always expanded - An hidden subfield isn't expanded. Default framework having 0 in all marc_subfield_structure.hidden, by default all subfields will be expanded. TO BE INTEGRATED IN RELEASE NOTES: Koha sysadmin should have to edit its frameworks to add hidden=1 in appropriate subfields. --- cataloguing/addbiblio.pl | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index da58166..0463b7d 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -341,14 +341,14 @@ sub create_input { if(exists $mandatory_z3950->{$tag.$subfield}){ $subfield_data{z3950_mandatory} = $mandatory_z3950->{$tag.$subfield}; } - # decide if the subfield must be expanded (visible) by default or not - # if it is mandatory, then expand. If it is hidden explicitly by the hidden flag, hidden anyway + # Subfield is hidden depending of hidden and mandatory flag, and is always + # shown if it contains anything or if its field is mandatory. + my $tdef = $tagslib->{$tag}; $subfield_data{visibility} = "display:none;" - if ( ($tagslib->{$tag}->{$subfield}->{hidden} % 2 == 1) and $value ne '' - or ($value eq '' and !$tagslib->{$tag}->{$subfield}->{mandatory}) - ); - # always expand all subfields of a mandatory field - $subfield_data{visibility} = "" if $tagslib->{$tag}->{mandatory}; + if $tdef->{$subfield}->{hidden} % 2 == 1 && + $value eq '' && + !$tdef->{$subfield}->{mandatory} && + !$tdef->{mandatory}; # it's an authorised field if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) { $subfield_data{marc_value} = -- 1.7.4 From Katrin.Fischer.83 at web.de Mon Mar 14 07:13:03 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Mon, 14 Mar 2011 07:13:03 +0100 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5750: (MT #4095) add exact matching filter for categorycode and branchcode fields in search members's result Message-ID: <1300083183-28426-1-git-send-email-Katrin.Fischer.83@web.de> From: St?phane Delaune Signed-off-by: Katrin Fischer No searching borrowers by categorycode or branchcode will only bring up exact matches. Before searches for Staff (S) would also bring up Students and Schools (SC, ST). Same for branchcodes. --- members/member.pl | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/members/member.pl b/members/member.pl index df688d1..a2a79fa 100755 --- a/members/member.pl +++ b/members/member.pl @@ -99,14 +99,20 @@ my ($count,$results); my @searchpatron; push @searchpatron, $member if ($member); -push @searchpatron, $patron if (keys %$patron); -my $from= ($startfrom-1)*$resultsperpage; -my $to=$from+$resultsperpage; - #($results)=Search(\@searchpatron,{surname=>1,firstname=>1},[$from,$to],undef,["firstname","surname","email","othernames"] ) if (@searchpatron); - my $search_scope=($quicksearch?"field_start_with":"contain"); - ($results)=Search(\@searchpatron,\@orderby,undef,undef,["firstname","surname","email","othernames","cardnumber","userid"],$search_scope ) if (@searchpatron); -if ($results){ - $count =scalar(@$results); +push @searchpatron, $patron if ( keys %$patron ); +my $from = ( $startfrom - 1 ) * $resultsperpage; +my $to = $from + $resultsperpage; + +#($results)=Search(\@searchpatron,{surname=>1,firstname=>1},[$from,$to],undef,["firstname","surname","email","othernames"] ) if (@searchpatron); +my $search_scope = ( $quicksearch ? "field_start_with" : "start_with" ); +($results) = Search( \@searchpatron, \@orderby, undef, undef, [ "firstname", "surname", "othernames", "cardnumber", "userid" ], $search_scope ) if (@searchpatron); + +if ($results) { + for my $field ('categorycode','branchcode'){ + next unless ($patron->{$field}); + @$results = grep { $_->{$field} eq $patron->{$field} } @$results; + } + $count = scalar(@$results); } my @resultsdata; $to=($count>$to?$to:$count); -- 1.7.1 From Katrin.Fischer.83 at web.de Mon Mar 14 07:21:47 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Mon, 14 Mar 2011 07:21:47 +0100 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] No toolbar in record view when quotes present in title - fix Message-ID: <1300083707-3662-1-git-send-email-Katrin.Fischer.83@web.de> From: Janusz Kaczmarek Signed-off-by: Katrin Fischer Was able to reproduce problem by surrounding 245$a with "". Patch fixed the problem. --- .../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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 8d4e02e..1c5b20f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -15,7 +15,7 @@ function GetZ3950Terms(){ var strQuery="&frameworkcode="; - strQuery += "&" + "" + "=" + ""; + strQuery += "&" + "" + "=" + ""; return strQuery; } -- 1.7.1 From M.de.Rooy at rijksmuseum.nl Mon Mar 14 11:34:26 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Mon, 14 Mar 2011 10:34:26 +0000 Subject: [Koha-patches] [PATCH] Bug 5863: Add to Your Cart disappeared if login disabled on opac detail Message-ID: <809BE39CD64BFD4EB9036172EBCCFA3121EDC7@S-MAIL-1B.rijksmuseum.intra> Resolving an error in ready function by additional conditionals. Moving a line from ready to html just as in other view templates, correcting the order of menu options at the same time. --- .../opac-tmpl/prog/en/modules/opac-detail.tmpl | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl index 9ed2c98..468e90f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -22,10 +22,10 @@ widgets : ['zebra'], sortList: [[0,0]] }); - KOHA.Google.GetCoverFromIsbn(); - $(".tagbutton").click(KOHA.Tags.add_tag_button); - $("a.print").parent().after("
  • "+_("Add to Your Cart")+"<\/a><\/li>"); -}); + KOHA.Google.GetCoverFromIsbn(); + $(".tagbutton").click(KOHA.Tags.add_tag_button); + +}); YAHOO.util.Event.onContentReady("furtherm", function () { $("#furtherm").css("display","block").css("visibility","hidden"); @@ -805,6 +805,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
  • +
  • '); return false;">Add to Your Cart
  • More searches
  • -- 1.6.0.6 From nengard at bywatersolutions.com Sun Mar 13 21:12:57 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sun, 13 Mar 2011 16:12:57 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 3495: Fast bib record add at circulation Message-ID: <1300047177-9519-1-git-send-email-nengard@bywatersolutions.com> From: Katrin Fischer The link to the Fast add framework was never shown. Now the link is shown if you have the right permissions (fast cataloging or superlibrarian). Signed-off-by: Nicole C. Engard --- circ/circulation.pl | 6 ++++++ .../prog/en/modules/circ/circulation.tmpl | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 8a184d1..f145f5c 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -615,6 +615,11 @@ if($bor_messages_loop){ $template->param(flagged => 1 ); } my (undef, $roadttype_hashref) = &GetRoadTypes(); my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'}; +my $fast_cataloging = 0; + if (defined getframeworkinfo('FA')) { + $fast_cataloging = 1 + } + $template->param( lib_messages_loop => $lib_messages_loop, bor_messages_loop => $bor_messages_loop, @@ -658,6 +663,7 @@ $template->param( is_child => ($borrower->{'category_type'} eq 'C'), circview => 1, soundon => C4::Context->preference("SoundOn"), + fast_cataloging => $fast_cataloging, ); # save stickyduedate to session diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index df78c54..4791f31 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -303,7 +303,7 @@ function refocus(calendar) {
  • The barcode was not found
  • -
  • Fast cataloging
  • + Fast cataloging @@ -853,4 +853,4 @@ No patron matched - \ No newline at end of file + -- 1.7.2.3 From cnighswonger at foundations.edu Mon Mar 14 21:01:14 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Mon, 14 Mar 2011 16:01:14 -0400 Subject: [Koha-patches] [PATCH] Bug 5865 - Labels wrap incorrectly when paper width is greater than height Message-ID: <1300132874-28722-1-git-send-email-cnighswonger@foundations.edu> This is due to the incorrect use of string comparators to compare numeric values. This patch corrects that. Note: This should be backported to 3.2.x --- labels/label-create-pdf.pl | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/labels/label-create-pdf.pl b/labels/label-create-pdf.pl index 1108726..608be04 100755 --- a/labels/label-create-pdf.pl +++ b/labels/label-create-pdf.pl @@ -33,13 +33,13 @@ my $layout = C4::Labels::Layout->retrieve(layout_id => $layout_id); sub _calc_next_label_pos { my ($row_count, $col_count, $llx, $lly) = @_; - if ($col_count lt $template->get_attr('cols')) { + if ($col_count < $template->get_attr('cols')) { $llx = ($llx + $template->get_attr('label_width') + $template->get_attr('col_gap')); $col_count++; } else { $llx = $template->get_attr('left_margin'); - if ($row_count eq $template->get_attr('rows')) { + if ($row_count == $template->get_attr('rows')) { $pdf->Page(); $lly = ($template->get_attr('page_height') - $template->get_attr('top_margin') - $template->get_attr('label_height')); $row_count = 1; -- 1.7.0.4 From jcamins at bywatersolutions.com Mon Mar 14 21:27:17 2011 From: jcamins at bywatersolutions.com (Jared Camins-Esakov) Date: Mon, 14 Mar 2011 16:27:17 -0400 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5865 - Labels wrap incorrectly when paper width is greater than height Message-ID: <1300134437-3454-1-git-send-email-jcamins@bywatersolutions.com> From: Chris Nighswonger This is due to the incorrect use of string comparators to compare numeric values. This patch corrects that. Note: This should be backported to 3.2.x Signed-off-by: Jared Camins-Esakov --- labels/label-create-pdf.pl | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/labels/label-create-pdf.pl b/labels/label-create-pdf.pl index 1108726..608be04 100755 --- a/labels/label-create-pdf.pl +++ b/labels/label-create-pdf.pl @@ -33,13 +33,13 @@ my $layout = C4::Labels::Layout->retrieve(layout_id => $layout_id); sub _calc_next_label_pos { my ($row_count, $col_count, $llx, $lly) = @_; - if ($col_count lt $template->get_attr('cols')) { + if ($col_count < $template->get_attr('cols')) { $llx = ($llx + $template->get_attr('label_width') + $template->get_attr('col_gap')); $col_count++; } else { $llx = $template->get_attr('left_margin'); - if ($row_count eq $template->get_attr('rows')) { + if ($row_count == $template->get_attr('rows')) { $pdf->Page(); $lly = ($template->get_attr('page_height') - $template->get_attr('top_margin') - $template->get_attr('label_height')); $row_count = 1; -- 1.7.2.3 From chrisc at catalyst.net.nz Mon Mar 14 21:41:09 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Tue, 15 Mar 2011 09:41:09 +1300 Subject: [Koha-patches] [PATCH] Bug 5693 : Follow up patch, escaping HTML in limit_cgi so "" dont break hrefs Message-ID: <1300135269-25958-1-git-send-email-chrisc@catalyst.net.nz> --- .../intranet-tmpl/prog/en/includes/facets.inc | 6 +++--- .../prog/en/includes/page-numbers.inc | 6 +++--- .../prog/en/modules/catalogue/results.tmpl | 2 +- .../opac-tmpl/prog/en/includes/opac-facets.inc | 6 +++--- .../opac-tmpl/prog/en/includes/page-numbers.inc | 6 +++--- .../prog/en/modules/opac-results-grouped.tmpl | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc index 95d912d..b53bfb7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc @@ -3,7 +3,7 @@

    Refine your search

      -
    • Availability +
    • Availability
    • (related searches: )
    • @@ -17,8 +17,8 @@ Series Libraries diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc index a9b8575..4c1ca90 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc @@ -1,7 +1,7 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl index df09c4f..aa9ac3e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl @@ -539,7 +539,7 @@ function GetZ3950Terms(){ - + 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 85719f3..cc6d235 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc @@ -3,7 +3,7 @@

      Refine your search

        -
      • Availability +
      • Availability
      • (related searches: )
      • @@ -18,8 +18,8 @@ Libraries diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/page-numbers.inc b/koha-tmpl/opac-tmpl/prog/en/includes/page-numbers.inc index 570ba96..013a3c7 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/page-numbers.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/page-numbers.inc @@ -1,7 +1,7 @@ diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tmpl index 4920acb..8f87b1b 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tmpl @@ -7,7 +7,7 @@ " /> +href="/cgi-bin/koha/opac-rss.pl?" /> + diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index 98c6d07..c079cb9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -34,11 +34,8 @@ function update_child() { // prepare DOM for YUI Toolbar $(document).ready(function() { - $("#printslip").parent().remove(); - $("#patronflags").parent().remove(); - $("#deletepatron").parent().remove(); - $("#moremenuc").empty(); - $("#printmenuc").empty(); + $("#printslip,#patronflags,#deletepatron").parent().remove(); + $("#moremenuc,#printmenuc,#searchtoholdc").empty(); yuiToolbar(); }); @@ -47,7 +44,12 @@ function update_child() { window.open("/cgi-bin/koha/members/moremember.pl?borrowernumber=&print=" + print_type, "printwindow"); return false; } - + function searchToHold(){ + var date = new Date(); + date.setTime(date.getTime() + (10 * 60 * 1000)); + $.cookie("holdfor", "", { path: "/", expires: date }); + location.href="/cgi-bin/koha/catalogue/search.pl"; + } function yuiToolbar() { var printmenu = [ { text: _("Print Page"), onclick: {fn: function(){printx_window("page")}} }, @@ -71,6 +73,14 @@ function update_child() { }); new YAHOO.widget.Button({ + id: "searchtohold", + type: "button", + label: _("Search to hold"), + container: "searchtoholdc", + onclick: {fn: searchToHold } + }); + + new YAHOO.widget.Button({ type: "menu", label: _("More"), name: "moremenubutton", @@ -109,10 +119,10 @@ function update_child() {
      • &category_type=C">Add child
      • -">Add Note -->
      • ">Change Password
      • &category_type=">Duplicate
      • &print=page">Print Page
      • &print=slip">Print Slip
      • +
      • Search to hold
      • ">Renew Account
      • ">Set Permissions
      • Delete
      diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.min.js new file mode 100644 index 0000000..eb129db --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.min.js @@ -0,0 +1 @@ +jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h // // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html function verify_images() { @@ -21,7 +22,6 @@ function verify_images() { } }); } -var q_array = new Array(); // will hold search terms, if present $(window).load(function() { verify_images(); @@ -30,13 +30,33 @@ $(window).load(function() { function Dopop(link) { newin=window.open(link,'popup','width=500,height=500,toolbar=false,scrollbars=yes,resizeable=yes'); } +function cartList(){ + if($("#addto").find("option:selected").attr("value") == "addtolist"){ + var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s",""); + if (vShelfAdd()) { + Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vShelfAdd()); + } + return false; + } else if($("#addto").find("option:selected").attr("value") == "newlist"){ + if (vShelfAdd()) { + Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vShelfAdd()); + } + return false; + } + if($("#addto").find("option:selected").attr("value") == "addtocart"){ + addMultiple(); + return false; + } +} +$(window).load(function() { + new YAHOO.widget.Button("cartsubmit", { onclick: { fn: cartList }}); +}); $(document).ready(function() { +$("#placeholdc").empty(); $('#sortbyform').find("input:submit").hide(); $('#sort_by').change(function() { $('#sortbyform').submit(); }); - - $(".addtocart").show(); var param1 = "

    Ignored the following common words: ""

    @@ -451,6 +487,7 @@ function GetZ3950Terms(){ No holds allowed " href="/cgi-bin/koha/reserve/request.pl?biblionumber=">Holds + | &findborrower=">Hold for () | ">Edit record @@ -551,6 +588,7 @@ function GetZ3950Terms(){
    + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index df78c54..fdda319 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -9,6 +9,7 @@ + + /lib/calendar/cal.gif" alt="Show Calendar" id="openreservedateTo" style="cursor: pointer;" border="0" /> + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    notification date + /lib/calendar/cal.gif" alt="Show Calendar" border="0" id="opennotificationdateFrom" style="cursor: pointer;" /> + + + /lib/calendar/cal.gif" alt="Show Calendar" id="opennotificationdateTo" style="cursor: pointer;" border="0" /> + +
    Reminder date + /lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openreminderdateFrom" style="cursor: pointer;" /> + + + /lib/calendar/cal.gif" alt="Show Calendar" id="openreminderdateTo" style="cursor: pointer;" border="0" /> + +
    Waiting date + /lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openwaitingdateFrom" style="cursor: pointer;" /> + + + /lib/calendar/cal.gif" alt="Show Calendar" id="openwaitingdateTo" style="cursor: pointer;" border="0" /> + +
    cancellation date + /lib/calendar/cal.gif" alt="Show Calendar" border="0" id="opencancellationdateFrom" style="cursor: pointer;" /> + + + /lib/calendar/cal.gif" alt="Show Calendar" id="opencancellationdateTo" style="cursor: pointer;" border="0" /> + +
    Patron Category +
    Item Type +
    Pickup Library +
    Holding Library +
    Home Library +
    Collection +
    Shelving Location +
    Item Call NumberFrom (inclusive) to (exclusive)
    Patron sort1 +
    Patron sort2 +

    + +
    Cell value
    1. +
    + +
    + Output +
    1. +
    2. +
    +
    + +
    + + " /> + +
    + + + +
    +
    +
    + +
    +
    + diff --git a/reports/reserves_stats.pl b/reports/reserves_stats.pl new file mode 100755 index 0000000..93f2818 --- /dev/null +++ b/reports/reserves_stats.pl @@ -0,0 +1,382 @@ +#!/usr/bin/perl + + +# Copyright 2000-2002 Katipo Communications +# +# 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 + +use strict; + +use CGI; + +use C4::Auth; +use C4::Debug; +use C4::Context; +use C4::Branch; # GetBranches +use C4::Koha; +use C4::Output; +use C4::Reports; +use C4::Members; +use C4::Dates qw/format_date format_date_in_iso/; +use C4::Category; +use List::MoreUtils qw/any/; +use YAML; + +=head1 NAME + +plugin that shows circulation stats + +=head1 DESCRIPTION + +=over 2 + +=cut + +# my $debug = 1; # override for now. +my $input = new CGI; +my $fullreportname = "reports/reserves_stats.tmpl"; +my $do_it = $input->param('do_it'); +my $line = $input->param("Line"); +my $column = $input->param("Column"); +my $podsp = $input->param("DisplayBy"); +my $type = $input->param("PeriodTypeSel"); +my $daysel = $input->param("PeriodDaySel"); +my $monthsel = $input->param("PeriodMonthSel"); +my $calc = $input->param("Cellvalue"); +my $output = $input->param("output"); +my $basename = $input->param("basename"); +my $mime = $input->param("MIME"); +my $hash_params = $input->Vars; +my $filter_hashref; +foreach my $filter (grep {$_ =~/^filter/} keys %$hash_params){ + my $filterstring=$filter; + $filterstring=~s/^filter_//g; + $$filter_hashref{$filterstring}=$$hash_params{$filter} if (defined $$hash_params{$filter} && $$hash_params{$filter} ne ""); +} +my ($template, $borrowernumber, $cookie) = get_template_and_user({ + template_name => $fullreportname, + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {reports => '*'}, + debug => 0, +}); +our $sep = $input->param("sep"); +$sep = "\t" if ($sep eq 'tabulation'); +$template->param(do_it => $do_it, + DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), +); + +my $itemtypes = GetItemTypes(); +my $categoryloop = GetBorrowercategoryList; + +my $ccodes = GetKohaAuthorisedValues("items.ccode"); +my $locations = GetKohaAuthorisedValues("items.location"); +my $authvalue = GetKohaAuthorisedValues("items.authvalue"); + +my $Bsort1 = GetAuthorisedValues("Bsort1"); +my $Bsort2 = GetAuthorisedValues("Bsort2"); +my ($hassort1,$hassort2); +$hassort1=1 if $Bsort1; +$hassort2=1 if $Bsort2; + + +if ($do_it) { +# Displaying results + my $results = calculate($line, $column, $calc, $filter_hashref); + if ($output eq "screen"){ +# Printing results to screen + $template->param(mainloop => $results); + output_html_with_http_headers $input, $cookie, $template->output; + } else { +# Printing to a csv file + print $input->header(-type => 'application/vnd.sun.xml.calc', + -encoding => 'utf-8', + -attachment=>"$basename.csv", + -filename=>"$basename.csv" ); + my $cols = @$results[0]->{loopcol}; + my $lines = @$results[0]->{looprow}; +# header top-right + print @$results[0]->{line} ."/". @$results[0]->{column} .$sep; +# Other header + foreach my $col ( @$cols ) { + print $col->{coltitle}.$sep; + } + print "Total\n"; +# Table + foreach my $line ( @$lines ) { + my $x = $line->{loopcell}; + print $line->{rowtitle}.$sep; + print map {$_->{value}.$sep} @$x; + print $line->{totalrow}, "\n"; + } +# footer + print "TOTAL"; + $cols = @$results[0]->{loopfooter}; + print map {$sep.$_->{totalcol}} @$cols; + print $sep.@$results[0]->{total}; + } + exit(1); # exit either way after $do_it +} + +my $dbh = C4::Context->dbh; +my @values; +my %labels; +my %select; + +# create itemtype arrayref for - - - +
  • @@ -178,8 +179,8 @@ h4.collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { di
  • "/>
  • - -
    " /> ">Cancel Cancel +
    noone"/> +
    " /> /cgi-bin/koha/members/moremember.pl?borrowernumber=#suggestionssuggestion.pl?suggestionid=">Cancel Cancel
    @@ -250,7 +251,7 @@ h4.collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { di @@ -259,9 +260,10 @@ h4.collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { di
    "> " />
  • Suggestion information

    -
    1. + + + +
    2. + + + + + - +

      Check the boxes for the libraries you accept to checkin items from.

      For all s: Check All | Uncheck All
      @@ -126,11 +132,11 @@
    - + - - + + @@ -148,6 +154,7 @@ +
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tmpl index ad675d1..dcb57a2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tmpl @@ -24,7 +24,8 @@
    Cloning of issuing rules failed!
    -

    The rules have been cloned.

    +

    The rules have ">been cloned.

    + Return to Issuing rules diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl index 92a44ce..f7f76fe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl @@ -6,9 +6,145 @@ //tbody>tr>td.editable').click(function() { + if ( ! editor ) { + var td = $(this); + var tdvalue = td.text().trim(); + td.text(''); + + var type; + if ( $.inArray('boolean', td.attr('class').split(' ')) != -1 ) { // If the td is boolean, we display a checkbox + editor = $(''); + editor.attr('checked', tdvalue == 'Yes' ? 'checked' : ''); + type = 'boolean'; + } else if ( $.inArray('triple', td.attr('class').split(' ')) != -1 ) { // else if it is a triple, we display a listbox + var selectedn = tdvalue == '' ? 'selected="selected"' : ''; + var selected1 = tdvalue == 'Yes' ? 'selected="selected"' : ''; + var selected0 = tdvalue == 'No' ? 'selected="selected"' : ''; + var str = ''; + editor = $(str); + type = 'triple'; + } else { // else we display a textbox + editor = $(''); + editor.attr('value', tdvalue); + } + + editor.focus(); + + editor.keyup(function(e) { // on press + if ( e.keyCode == 13 ) { // enter + + // let's build the atomic rule + var branchcode = $('#branchcode').val(); + var categorycode = td.parent().children('td.categorycode').children('span').text(); + var itemtype = td.parent().children('td.itemtype').children('span').text(); + var varname = td.attr('class').split(' ')[0]; + var inputvalue; + switch ( type ) { + case 'boolean': + inputvalue = editor.attr('checked') ? 1 : 0; + break; + default: + inputvalue = editor.val(); + break; + } + + // post it to the server + $.ajax({ + url: '/cgi-bin/koha/admin/smart-rules-service.pl', + type: "POST", + async: false, + data: "branchcode="+branchcode+"&categorycode="+categorycode+"&itemtype="+itemtype+"&varname="+varname+"&inputvalue="+inputvalue, + success: function(result) { + + // repopulate the td with data + switch ( type ) { + case 'boolean': + td.text(result == '1' ? 'Yes' : 'No'); + break; + case 'triple': + switch ( result ) { + case '' : td.text(''); break; + case '1': td.text('Yes'); break; + case '0': td.text('No'); break; + } + break; + default: + td.text(result); + break; + } + + editor.remove(); + editor = false; + } + }); + } + }); + + td.append(editor); + } + }); }); //]]> @@ -32,25 +168,11 @@ $(document).ready(function() { Defining circulation and fine rules for all libraries -
    -

    The rules are applied from most specific to less specific, using the first found in this order:

    -
      -
    • same library, same patron type, same item type
    • -
    • same library, same patron type, all item types
    • -
    • same library, all patron types, same item type
    • -
    • same library, all patron types, all item types
    • -
    • all libraries, same patron type, same item type
    • -
    • all libraries, same patron type, all item types
    • -
    • all libraries, all patron types, same item type
    • -
    • all libraries, all patron types, all item types
    • -
    -

    To modify a rule, create a new one with the same patron type and item type.

    -
    -
    +
    Select a library : - + @@ -60,272 +182,223 @@ $(document).ready(function() { for="tobranch">Clone these rules to: " /> -
    - -
     DateBy
    - Requested Accepted Ordered Rejected Checked
    () + Asked Accepted Ordered Rejected Checked
    ()
    row" name="_" checked="checked" />row" name="_" checked="checked" />
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Patron CategoryItem TypeCurrent Checkouts AllowedLoan Period (day)Fine AmountFine Charging IntervalFine Grace period (day)Suspension in Days (day)Renewals Allowed (count)Holds Allowed (count)Rental Discount (%) 
    - All - - - - - All - - - - - Unlimited - - - - - &categorycode=&branch=">Delete -
    - - - - "/>
    - -
  • -
    -

    Default checkout and hold policy for all libraries

    -

    You can set a default maximum number of checkouts and hold policy that will be used if none is defined below for a particular item type or category.

    -
    - - "/> - - - - - - - - - - - - - - - -
     Total Current Checkouts AllowedHold Policy  
    Defaults (not set)"/> - - - ">Unset -
    -
    -
    - -
    -

    Checkout limit by patron category for all libraries

    -

    For this library, you can specify the maximum number of loans that - a patron of a given category can make, regardless of the item type. -

    -

    If the total amount loanable for a given patron category is left blank, - no limit applies, except possibly for a limit you define for a specific item type. -

    -
    - - "/> - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Patron CategoryTotal Current Checkouts Allowed 
    - Default +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - -
    Patron categoryItem typeCurrent checkouts allowedLoan period (day)Fine amountFine charging intervalGrace period (day)Suspension duration (day)Renewals allowed (count)Renewals period (days)Holds allowed (count)Holds pickup delay (day)Allow on shelf holdsHolds restricted to libraryRental Discount (%) 
    - Unlimited - - - - - &branch=">Delete -
    - -
    - -
    - -
    -

    Holds policy by item type for all libraries

    -

    - For this library, you can edit rules for given itemtypes, regardless - of the patron's category. -

    -

    - Currently, this means hold policies. - The various policies have the following effects: -

    -
      -
    • From Any Library: Patrons from any library may put this item on hold. (default if none is defined)
    • -
    • From Home Library: Only patrons from the item's home library may put this book on hold.
    • -
    • No Holds Allowed: No patron may put this book on hold.
    • -
    -

    - Note that if the system preference - AllowHoldPolicyOverride is enabled, these policies can - be overridden by your circulation staff. Also, these policies are - based on the patron's home library, not the library where the hold is being placed.. -

    - -
    - - "/> - - - - - - - - - - - - - - - - - - - - - - -
    Item TypeHold Policy 
    - Default - - - - - From Any Library - - From Home Library - - No Holds Allowed - - - &branch=">Delete -
    - - - -
    -
    +
    + + + Default + + + + + + + Default + + + + + + + + + Unlimited + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Yes + + No + + + + + + + Yes + + No + + + + + + + + &categorycode=&branchcode=">Delete +
    + + + + "/>"/> "/>"/>"/> "/> "/>"/>"/>"/> + + "/>
    +
    +
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index dc7ed5f..dbb43d0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -10,6 +10,12 @@ - - - - - - +

    + + + + + + + +

    + - - " /> " /> " /> @@ -491,9 +547,8 @@ No patron matched
    -

    - Cannot check out! - Attention:

    +

    Cannot Check Out! + Attention:

      @@ -517,16 +572,21 @@ No patron matched -
    • Address: Patron's address in doubt
    • +
    • Address: Patron's address is in doubt ()
    • -
    • Lost: Patron's card is lost
    • +
    • Lost: Patron's card is lost ()
    • -
    • - Restricted: Patron's account is restricted &cardnumber=&destination=circ&status=0">Lift restriction -
    • +
    • + Restricted: Patron's account is restricted until () +
      + " /> + + +
      +
    • Overdues: Patron has ITEMS OVERDUE. See highlighted items below
    • @@ -556,7 +616,7 @@ No patron matched

      Holds waiting:

        -
      • "> (), by Hold placed on . +
      • "> (), by Hold placed on waiting until
        Waiting at @@ -632,20 +692,58 @@ No patron matched " /> " /> - + + + - + - + - - - + + + + + + + + + + @@ -653,121 +751,95 @@ No patron matched - + - - + + + - - - - - + - - - - - - - + - + - + - - - - - + - - - @@ -777,20 +849,81 @@ No patron matched
        Due date Title Item TypeBranch Checked out onCall noBorrower ChargePriceMaterial Renew

        select all | none

        Check in

        select all | none

        65" style="text-align: right; font-weight:bold;">Totals: +

        + Renewal due date: " /> + /lib/calendar/cal.gif" id="newduedate_button" alt="Show Calendar" /> + +

        +

        + +

        + + +

        + + +

        + + +
        - - + &type=intra">, by - &itemnumber=#item"> " alt="" /> + () Renewal Failed0 - - " checked="checked" style="display: none;" /> - - " checked="checked" /> - - " /> - - - - - - - On Hold - - - Not Renewable - - + + + / + + + + + + +
        + + On Hold + Overdue + Not Renewable + -
        Checkin Failed " /> - " checked="checked" style="display: none;" /> + " name="barcodes[]" value="" /> +
        ')">On Hold
        Previous checkouts
        Previous checkouts
        109">Previous checkouts
        + &type=intra">, by - &itemnumber=#item"> + () Renewal Failed0 - - " checked="checked" style="display: none;" /> - - " checked="checked" /> - - " /> - - - - - - - On Hold - - - Not Renewable - - - + + + / + + + + + + +
        + + On Hold + Overdue + Not Renewable + -
        Checkin Failed" /> - " checked="checked" style="display: none;" /> + + " name="barcodes[]" value="" onclick="uncheck_sibling(this);" /> +
        ')">On Hold
        - - - - - - -

        Patron has nothing checked out.

        + + + +

        Relatives issues

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Due dateTitleItem TypeBranchChecked out onChargeBorrowerMaterial
        + &type=intra">, by - &itemnumber=#item"> " alt="" /> + ()">
        Previous checkouts
        + + &type=intra">, by - &itemnumber=#item"> + + + ()">
        + + +
    @@ -814,7 +947,7 @@ No patron matched
    ">, by Item - waiting at + waiting at until in transit from since diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl index 724a3e9..d39f4a5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl @@ -1,6 +1,9 @@ Koha › Circulation › Check In <!-- TMPL_VAR Name="title" escape="html" --> + @@ -70,13 +71,18 @@
    - +

    Check the boxes for the libraries you accept to checkin items from.

    For all s: Check All | Uncheck All
    @@ -126,11 +132,11 @@
    row" name="_" checked="checked" />row" name="_" checked="checked" />
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Patron CategoryItem TypeCurrent Checkouts AllowedLoan Period (day)Fine AmountFine Charging IntervalFine Grace period (day)Suspension in Days (day)Renewals Allowed (count)Holds Allowed (count)Rental Discount (%) 
    - All - - - - - All - - - - - Unlimited - - - - - &categorycode=&branch=">Delete -
    - - - - "/>
    - - -
    -

    Default checkout and hold policy for all libraries

    -

    You can set a default maximum number of checkouts and hold policy that will be used if none is defined below for a particular item type or category.

    -
    - - "/> - - - - - - - - - - - - - - - -
     Total Current Checkouts AllowedHold Policy  
    Defaults (not set)"/> - - - ">Unset -
    -
    -
    - -
    -

    Checkout limit by patron category for all libraries

    -

    For this library, you can specify the maximum number of loans that - a patron of a given category can make, regardless of the item type. -

    -

    If the total amount loanable for a given patron category is left blank, - no limit applies, except possibly for a limit you define for a specific item type. -

    -
    - - "/> - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Patron CategoryTotal Current Checkouts Allowed 
    - Default +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - -
    Patron categoryItem typeCurrent checkouts allowedLoan period (day)Fine amountFine charging intervalGrace period (day)Suspension duration (day)Renewals allowed (count)Renewals period (days)Holds allowed (count)Holds pickup delay (day)Allow on shelf holdsHolds restricted to libraryRental Discount (%) 
    - Unlimited - - - - - &branch=">Delete -
    - -
    - -
    - -
    -

    Holds policy by item type for all libraries

    -

    - For this library, you can edit rules for given itemtypes, regardless - of the patron's category. -

    -

    - Currently, this means hold policies. - The various policies have the following effects: -

    -
      -
    • From Any Library: Patrons from any library may put this item on hold. (default if none is defined)
    • -
    • From Home Library: Only patrons from the item's home library may put this book on hold.
    • -
    • No Holds Allowed: No patron may put this book on hold.
    • -
    -

    - Note that if the system preference - AllowHoldPolicyOverride is enabled, these policies can - be overridden by your circulation staff. Also, these policies are - based on the patron's home library, not the library where the hold is being placed.. -

    - -
    - - "/> - - - - - - - - - - - - - - - - - - - - - - -
    Item TypeHold Policy 
    - Default - - - - - From Any Library - - From Home Library - - No Holds Allowed - - - &branch=">Delete -
    - - - -
    -
    +
    + + + Default + + + + + + + Default + + + + + + + + + Unlimited + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Yes + + No + + + + + + + Yes + + No + + + + + + + + &categorycode=&branchcode=">Delete +
    + + + + "/>"/> "/>"/>"/> "/> "/>"/>"/>"/> + + "/>
    +
    + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index dc7ed5f..dbb43d0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -10,6 +10,12 @@ - - - - - - +

    + + + + + + + +

    + - - " /> " /> " /> @@ -491,9 +547,8 @@ No patron matched
    -

    - Cannot check out! - Attention:

    +

    Cannot Check Out! + Attention:

      @@ -517,16 +572,21 @@ No patron matched -
    • Address: Patron's address in doubt
    • +
    • Address: Patron's address is in doubt ()
    • -
    • Lost: Patron's card is lost
    • +
    • Lost: Patron's card is lost ()
    • -
    • - Restricted: Patron's account is restricted &cardnumber=&destination=circ&status=0">Lift restriction -
    • +
    • + Restricted: Patron's account is restricted until () +
      + " /> + + +
      +
    • Overdues: Patron has ITEMS OVERDUE. See highlighted items below
    • @@ -556,7 +616,7 @@ No patron matched

      Holds waiting:

        -
      • "> (), by Hold placed on . +
      • "> (), by Hold placed on waiting until
        Waiting at @@ -632,20 +692,58 @@ No patron matched " /> " /> - + + + - + - + - - - + + + + + + + + + + @@ -653,121 +751,95 @@ No patron matched - + - - + + + - - - - - + - - - - - - - + - + - + - - - - - + - - - @@ -777,20 +849,81 @@ No patron matched
        Due date Title Item TypeBranch Checked out onCall noBorrower ChargePriceMaterial Renew

        select all | none

        Check in

        select all | none

        65" style="text-align: right; font-weight:bold;">Totals: +

        + Renewal due date: " /> + /lib/calendar/cal.gif" id="newduedate_button" alt="Show Calendar" /> + +

        +

        + +

        + + +

        + + +

        + + +
        - - + &type=intra">, by - &itemnumber=#item"> " alt="" /> + () Renewal Failed0 - - " checked="checked" style="display: none;" /> - - " checked="checked" /> - - " /> - - - - - - - On Hold - - - Not Renewable - - + + + / + + + + + + +
        + + On Hold + Overdue + Not Renewable + -
        Checkin Failed " /> - " checked="checked" style="display: none;" /> + " name="barcodes[]" value="" /> +
        ')">On Hold
        Previous checkouts
        Previous checkouts
        109">Previous checkouts
        + &type=intra">, by - &itemnumber=#item"> + () Renewal Failed0 - - " checked="checked" style="display: none;" /> - - " checked="checked" /> - - " /> - - - - - - - On Hold - - - Not Renewable - - - + + + / + + + + + + +
        + + On Hold + Overdue + Not Renewable + -
        Checkin Failed" /> - " checked="checked" style="display: none;" /> + + " name="barcodes[]" value="" onclick="uncheck_sibling(this);" /> +
        ')">On Hold
        - - - - - - -

        Patron has nothing checked out.

        + + + +

        Relatives issues

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Due dateTitleItem TypeBranchChecked out onChargeBorrowerMaterial
        + &type=intra">, by - &itemnumber=#item"> " alt="" /> + ()">
        Previous checkouts
        + + &type=intra">, by - &itemnumber=#item"> + + + ()">
        + + +
    @@ -814,7 +947,7 @@ No patron matched
    ">, by Item - waiting at + waiting at until in transit from since diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl index 724a3e9..d39f4a5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl @@ -1,6 +1,9 @@ Koha › Circulation › Check In <!-- TMPL_VAR Name="title" escape="html" --> + + + + " /> + +
  • " />
  • + + -- 1.7.1 From chrisc at catalyst.net.nz Wed Mar 16 03:01:12 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Wed, 16 Mar 2011 15:01:12 +1300 Subject: [Koha-patches] [PATCH] Bug 5875 : waitingreserves highlighting now depends on maxpickupdate Message-ID: <1300240872-7502-1-git-send-email-chrisc@catalyst.net.nz> From: Paul Poulain --- circ/waitingreserves.pl | 32 ++++++++------- .../prog/en/includes/reserves_waiting.inc | 44 ++++++++++++++++++++ 2 files changed, 61 insertions(+), 15 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/reserves_waiting.inc diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index 0183f19..c1843db 100755 --- a/circ/waitingreserves.pl +++ b/circ/waitingreserves.pl @@ -26,6 +26,7 @@ use C4::Branch; # GetBranchName use C4::Auth; use C4::Dates qw/format_date/; use C4::Circulation; +use C4::Reserves; # qw/GetMaxPickUpDelay/; use C4::Members; use C4::Biblio; use C4::Items; @@ -112,14 +113,23 @@ foreach my $num (@getreserves) { $gettitle->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $gettitle->{'itype'} : $gettitle->{'itemtype'}; my $getborrower = GetMemberDetails( $num->{'borrowernumber'} ); my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} ); # using the fixed up itype/itemtype - $getreserv{'waitingdate'} = format_date( $num->{'waitingdate'} ); + if ($num->{waitingdate}){ + my @maxpickupdate=GetMaxPickupDate($num->{'waitingdate'},$borrowernumber, $num); + $getreserv{'waitingdate'} = format_date( $num->{'waitingdate'} ); - my ( $waiting_year, $waiting_month, $waiting_day ) = split (/-/, $num->{'waitingdate'}); - ( $waiting_year, $waiting_month, $waiting_day ) = - Add_Delta_Days( $waiting_year, $waiting_month, $waiting_day, - C4::Context->preference('ReservesMaxPickUpDelay')); - my $calcDate = Date_to_Days( $waiting_year, $waiting_month, $waiting_day ); + $getreserv{'maxpickupdate'} = sprintf("%d-%02d-%02d", @maxpickupdate); + my $calcDate = Date_to_Days( @maxpickupdate ); + + if ( $today > $calcDate ) { + $getreserv{'messcompa'} = 1; + push @overloop, \%getreserv; + $overcount++; + } else { + push @reservloop, \%getreserv; + $reservcount++; + } + } $getreserv{'itemtype'} = $itemtypeinfo->{'description'}; $getreserv{'title'} = $gettitle->{'title'}; $getreserv{'itemnumber'} = $gettitle->{'itemnumber'}; @@ -128,6 +138,7 @@ foreach my $num (@getreserves) { $getreserv{'homebranch'} = GetBranchName($gettitle->{'homebranch'}); $getreserv{'holdingbranch'} = $gettitle->{'holdingbranch'}; $getreserv{'itemcallnumber'} = $gettitle->{'itemcallnumber'}; + if ( $gettitle->{'homebranch'} ne $gettitle->{'holdingbranch'} ) { $getreserv{'dotransfer'} = 1; } @@ -138,15 +149,6 @@ foreach my $num (@getreserves) { if ( $getborrower->{'emailaddress'} ) { $getreserv{'borrowermail'} = $getborrower->{'emailaddress'}; } - - if ($today > $calcDate) { - push @overloop, \%getreserv; - $overcount++; - }else{ - push @reservloop, \%getreserv; - $reservcount++; - } - } $template->param( diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/reserves_waiting.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/reserves_waiting.inc new file mode 100644 index 0000000..f3cf244 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reserves_waiting.inc @@ -0,0 +1,44 @@ + + +
    "> +

    Hold Found: ">

    +

    Notes:

    +
    Hold for:
    +
      +
    • "> + , + ()
    • +

    • +
      +
    • +
    • +
    • ">
    • +
    • Patron is RESTRICTED
    • +
    • Patron's address is in doubt
    • +
    + +

    Transfer to:

    + +

    Hold at

    + +
    " class="confirm"> + + + &biblionumber=&op=slip'); $('#reserve').hide(); return false;" /> + + + &biblionumber=&op=slip'); $('#reserve').hide(); return false;" /> + + " /> + " /> + " /> + " /> + " /> + " /> + " /> +
    +
    + + + + -- 1.7.1 From chrisc at catalyst.net.nz Wed Mar 16 03:33:10 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Wed, 16 Mar 2011 15:33:10 +1300 Subject: [Koha-patches] [PATCH] Bug 5876 : circulation-home : new Offline Circ Link and overdue.pl has a new permission Message-ID: <1300242790-8731-1-git-send-email-chrisc@catalyst.net.nz> From: Paul Poulain - overdue.pl is now accessible with reports_execute_reports permission - the offline circ has been improved a lot (patch later) --- .../prog/en/modules/circ/circulation-home.tmpl | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tmpl index 54f6d57..113a666 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tmpl @@ -38,9 +38,9 @@
  • Holds awaiting pickup
  • Hold ratios
  • Transfers to receive
  • -
  • Overdues +
  • Overdues - Warning: This report is very resource intensive on - systems with large numbers of overdue items.
  • + systems with large numbers of overdue items.
  • Overdues with fines - Limited to your library. See report help for other details.
  • @@ -52,7 +52,7 @@ -- 1.7.1 From chrisc at catalyst.net.nz Wed Mar 16 03:40:20 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Wed, 16 Mar 2011 15:40:20 +1300 Subject: [Koha-patches] [PATCH] Bug 5877 : Offline circulation improvements : upload all files, apply at once Message-ID: <1300243220-9072-1-git-send-email-chrisc@catalyst.net.nz> From: Paul Poulain Offline circ : You now can upload all offline files from the Firefox extension. Once all circ desks have uploaded the file, the librarian can apply all of them, sorted by date. This avoid the problem of someone issuing an item on desk A, returning it on desk B. Before this improvement, if desk B uploaded the file before A, the return was applied before the issue, resulting in the items reamining issued. --- .../prog/en/modules/offline_circ/list.tmpl | 97 ++++++++++++++++++++ offline_circ/list.pl | 57 ++++++++++++ offline_circ/process.pl | 48 ++++++++++ offline_circ/service.pl | 60 ++++++++++++ 4 files changed, 262 insertions(+), 0 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/list.tmpl create mode 100755 offline_circ/list.pl create mode 100755 offline_circ/process.pl create mode 100755 offline_circ/service.pl diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/list.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/list.tmpl new file mode 100644 index 0000000..50fe065 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/list.tmpl @@ -0,0 +1,97 @@ + + Koha › Circulation › Offline Circulation + + + + + + + + + + +
    + +
    + +

    Offline Circulation

    + + + +
    + + + + + + + + + + + + + + "> + + + + + + + + +
    DateActionBarcodeCardnumber
    " /> + + " title=""> + + + + + + + " title=""> + + + + +
    + +

    For the selected operations: + +

    + +
    + + + +

    There is no pending offline operations.

    + + + +
    + + diff --git a/offline_circ/list.pl b/offline_circ/list.pl new file mode 100755 index 0000000..e95411a --- /dev/null +++ b/offline_circ/list.pl @@ -0,0 +1,57 @@ +#!/usr/bin/perl + +# 2009 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., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA +# + +use CGI; +use C4::Output; +use C4::Auth; +use C4::Koha; +use C4::Context; +use C4::Circulation; +use C4::Branch; +use C4::Members; +use C4::Biblio; + +my $query = CGI->new; + +my ($template, $loggedinuser, $cookie) = get_template_and_user({ + template_name => "offline_circ/list.tmpl", + query => $query, + type => "intranet", + authnotrequired => 0, + flagsrequired => { circulate => "circulate_remaining_permissions" }, +}); + +my $operations = GetOfflineOperations; + +for (@$operations) { + my $biblio = GetBiblioFromItemNumber(undef, $_->{'barcode'}); + $_->{'bibliotitle'} = $biblio->{'title'}; + $_->{'biblionumber'} = $biblio->{'biblionumber'}; + my $borrower = GetMemberDetails(undef,$_->{'cardnumber'}); + $_->{'borrowernumber'} = $borrower->{'borrowernumber'}; + $_->{'borrower'} = join(' ', $borrower->{'firstname'}, $borrower->{'surname'}); + $_->{'actionissue'} = $_->{'action'} eq 'issue'; + $_->{'actionreturn'} = $_->{'action'} eq 'return'; +} + +$template->param(operations => $operations); + +output_html_with_http_headers $query, $cookie, $template->output; + diff --git a/offline_circ/process.pl b/offline_circ/process.pl new file mode 100755 index 0000000..e1d1acd --- /dev/null +++ b/offline_circ/process.pl @@ -0,0 +1,48 @@ +#!/usr/bin/perl + +# 2009 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., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA +# + +use CGI; +use C4::Auth; +use C4::Circulation; + +my $query = CGI->new; + +my ($template, $loggedinuser, $cookie) = get_template_and_user({ + template_name => "offline_circ/list.tmpl", + query => $query, + type => "intranet", + authnotrequired => 0, + flagsrequired => { circulate => "circulate_remaining_permissions" }, +}); + +my $operationid = $query->param('operationid'); +my $action = $query->param('action'); +my $result; + +if ( $action eq 'process' ) { + my $operation = GetOfflineOperation( $operationid ); + $result = ProcessOfflineOperation( $operation ); +} elsif ( $action eq 'delete' ) { + $result = DeleteOfflineOperation( $operationid ); +} + +print CGI::header('-type'=>'text/plain', '-charset'=>'utf-8'); +print $result; + diff --git a/offline_circ/service.pl b/offline_circ/service.pl new file mode 100755 index 0000000..40bd4c7 --- /dev/null +++ b/offline_circ/service.pl @@ -0,0 +1,60 @@ +#!/usr/bin/perl + +# 2009 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., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA +# + +use CGI; +use C4::Auth; +use C4::Circulation; + +my $cgi = CGI->new; + +# get the status of the user, this will check his credentials and rights +my ($status, $cookie, $sessionId) = C4::Auth::check_api_auth($cgi, undef); + +my $result; + +if ($status eq 'ok') { # if authentication is ok + if ( $cgi->param('pending') eq 'true' ) { # if the 'pending' flag is true, we store the operation in the db instead of directly processing them + $result = AddOfflineOperation( + $cgi->param('userid') || '', + $cgi->param('branchcode') || '', + $cgi->param('timestamp') || '', + $cgi->param('action') || '', + $cgi->param('barcode') || '', + $cgi->param('cardnumber') || '', + ); + } else { + $result = ProcessOfflineOperation( + { + 'userid' => $cgi->param('userid'), + 'branchcode' => $cgi->param('branchcode'), + 'timestamp' => $cgi->param('timestamp'), + 'action' => $cgi->param('action'), + 'barcode' => $cgi->param('barcode'), + 'cardnumber' => $cgi->param('cardnumber'), + } + ); + } +} else { + $result = "Authentication failed." +} + +print CGI::header('-type'=>'text/plain', '-charset'=>'utf-8'); +print $result; + -- 1.7.1 From chrisc at catalyst.net.nz Wed Mar 16 03:50:04 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Wed, 16 Mar 2011 15:50:04 +1300 Subject: [Koha-patches] [PATCH] Bug 5878 : overdue printing fixes and improvements Message-ID: <1300243804-9407-1-git-send-email-chrisc@catalyst.net.nz> From: Paul Poulain * misc/cronjob/printoverdues deals with utf-8 correctly * misc/cronjob/overdue_notices - display the due_date - deals with a branchcode parameter limit - deals with the various emails a patron has to select the 1st valid one (function in C4/Members) --- misc/cronjobs/overdue_notices.pl | 134 ++++++++++++++++++++++++-------------- misc/cronjobs/printoverdues.sh | 9 ++- 2 files changed, 90 insertions(+), 53 deletions(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 671368e..a86cb11 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl # Copyright 2008 Liblime +# Parts Copyright Biblibre 2010 # # This file is part of Koha. # @@ -39,6 +40,9 @@ use C4::Dates qw/format_date/; use C4::Debug; use C4::Letters; use C4::Overdues qw(GetFine); +use C4::Reports::Guided; #_get_column_defs +use open qw(:std :utf8); +use YAML; =head1 NAME @@ -255,7 +259,7 @@ my $csvfilename; my $htmlfilename; my $triggered = 0; my $listall = 0; -my $itemscontent = join( ',', qw( date_due title barcode author itemnumber ) ); +my $itemscontent = join( ',', qw( issuedate title barcode author biblionumber date_due) ); my @myborcat; my @myborcatout; @@ -266,17 +270,25 @@ GetOptions( 'n' => \$nomail, 'max=s' => \$MAX, 'library=s' => \@branchcodes, - 'csv:s' => \$csvfilename, # this optional argument gets '' if not supplied. - 'html:s' => \$htmlfilename, # this optional argument gets '' if not supplied. + 'csv:s' => \$csvfilename, # this optional argument gets '' if not supplied. + 'html:s' => \$htmlfilename, # this optional argument gets '' if not supplied. 'itemscontent=s' => \$itemscontent, - 'list-all' => \$listall, - 't|triggered' => \$triggered, - 'borcat=s' => \@myborcat, - 'borcatout=s' => \@myborcatout, + 'list-all' => \$listall, + 't|triggered' => \$triggered, + 'borcat=s' => \@myborcat, + 'borcatout=s' => \@myborcatout, ) or pod2usage(2); pod2usage(1) if $help; pod2usage( -verbose => 2 ) if $man; +my $columns_def_hashref = C4::Reports::Guided::_get_column_defs(); + +foreach my $key ( keys %$columns_def_hashref ) { + my $initkey = $key; + $key =~ s/[^\.]*\.//; + $columns_def_hashref->{$key} = $columns_def_hashref->{$initkey}; +} +print Dump($columns_def_hashref); if ( defined $csvfilename && $csvfilename =~ /^-/ ) { warn qq(using "$csvfilename" as filename, that seems odd); } @@ -312,7 +324,7 @@ if (@branchcodes) { } else { $verbose and warn "No active overduerules for $branchcodes_word '@branchcodes'\n"; - ( scalar grep { '' eq $_ } @branches ) + ( scalar grep { $_ eq ""} @overduebranches ) or die "No active overduerules for DEFAULT either!"; $verbose and warn "Falling back on default rules for @branchcodes\n"; @branches = (''); @@ -352,22 +364,26 @@ if ( defined $htmlfilename ) { open $html_fh, ">",File::Spec->catdir ($htmlfilename,"notices-".$today->output('iso').".html"); } - print $html_fh "\n"; - print $html_fh "\n"; - print $html_fh "\n"; - print $html_fh "\n"; - print $html_fh "\n"; + print $html_fh < + + + + + + +HEAD } foreach my $branchcode (@branches) { - my $branch_details = C4::Branch::GetBranchDetail($branchcode); + my $branch_details = C4::Branch::GetBranchDetail($branchcode) unless ($branchcode eq ""); my $admin_email_address = $branch_details->{'branchemail'} || C4::Context->preference('KohaAdminEmailAddress'); my @output_chunks; # may be sent to mail or stdout or csv file. @@ -429,7 +445,7 @@ WHERE issues.borrowernumber=borrowers.borrowernumber AND borrowers.categorycode=categories.categorycode END_SQL my @borrower_parameters; - if ($branchcode) { + if ($branchcode && $branchcode ne "") { $borrower_sql .= ' AND issues.branchcode=? '; push @borrower_parameters, $branchcode; } @@ -456,6 +472,7 @@ END_SQL $address1, $address2, $city, $postcode, $country, $email, $longest_issue ) = $sth->fetchrow ) { + $email=C4::Members::GetFirstValidEmailAddress($borrowernumber); $verbose and warn "borrower $firstname, $lastname ($borrowernumber) has $itemcount items triggering level $i."; my $letter = C4::Letters::getletter( 'circulation', $overdue_rules->{"letter$i"} ); @@ -471,29 +488,43 @@ END_SQL if ( $overdue_rules->{"debarred$i"} ) { #action taken is debarring - C4::Members::DebarMember($borrowernumber); + C4::Members::DebarMember($borrowernumber, '9999-12-31'); $verbose and warn "debarring $borrowernumber $firstname $lastname\n"; } my @params = ($listall ? ( $borrowernumber , 1 , $MAX ) : ( $borrowernumber, $mindays, $maxdays )); $verbose and warn "STH2 PARAMS: borrowernumber = $borrowernumber, mindays = $mindays, maxdays = $maxdays"; $sth2->execute(@params); my $itemcount = 0; - my $titles = ""; + + my $titles; + if ($htmlfilename) { + $titles = ""; + $titles .= ""; + } my @items = (); - - my $i = 0; + + my $i = 0; my $exceededPrintNoticesMaxLines = 0; while ( my $item_info = $sth2->fetchrow_hashref() ) { if ( ( !$email || $nomail ) && $PrintNoticesMaxLines && $i >= $PrintNoticesMaxLines ) { - $exceededPrintNoticesMaxLines = 1; - last; + $exceededPrintNoticesMaxLines = 1; + last; } $i++; my @item_info = map { $_ =~ /^date|date$/ ? format_date( $item_info->{$_} ) : $item_info->{$_} || '' } @item_content_fields; - $titles .= join("\t", @item_info) . "\n"; + if ($htmlfilename) { + $titles .= ""; + } else { + $titles .= join( "\t", @item_info ) . "\n"; + } $itemcount++; push @items, { itemnumber => $item_info->{'itemnumber'}, biblionumber => $item_info->{'biblionumber'} }; } + $titles .= "
    " . join( "", @$columns_def_hashref{@item_content_fields} ); + warn @item_content_fields; + warn map { "$columns_def_hashref->{$_};" } @item_content_fields; + $titles .= "
    " . join( "", @item_info ) . "
    " if ($htmlfilename); + $debug && warn $titles; $sth2->finish; $letter = parse_letter( { letter => $letter, @@ -506,20 +537,21 @@ END_SQL } } ); - - if ( $exceededPrintNoticesMaxLines ) { - $letter->{'content'} .= "List too long for form; please check your account online for a complete list of your overdue items."; + + if ($exceededPrintNoticesMaxLines) { + $letter->{'content'} .= "List too long for form; please check your account online for a complete list of your overdue items."; } - my @misses = grep { /./ } map { /^([^>]*)[>]+/; ( $1 || '' ); } split /\{'content'}; + my @misses = grep { /./ } map { /^([^>]*)[>]{2,}/; ( $1 || '' ); } split /\<\{'content'}; if (@misses) { $verbose and warn "The following terms were not matched and replaced: \n\t" . join "\n\t", @misses; } - $letter->{'content'} =~ s/\<[^<>]*?\>//g; # Now that we've warned about them, remove them. - $letter->{'content'} =~ s/\<[^<>]*?\>//g; # 2nd pass for the double nesting. - + $letter->{'content'} =~ s/\<\<[^<>]*?\>\>//g; # Now that we've warned about them, remove them. + + # $letter->{'content'} =~ s/\<[^<>]*?\>//g; # 2nd pass for the double nesting. + if ($nomail) { - + push @output_chunks, prepare_letter_for_printing( { letter => $letter, @@ -529,6 +561,7 @@ END_SQL address1 => $address1, address2 => $address2, city => $city, + country => $country, postcode => $postcode, email => $email, itemcount => $itemcount, @@ -546,7 +579,7 @@ END_SQL } ); } else { - + # If we don't have an email address for this patron, send it to the admin to deal with. push @output_chunks, prepare_letter_for_printing( @@ -557,6 +590,7 @@ END_SQL address1 => $address1, address2 => $address2, city => $city, + country => $country, postcode => $postcode, email => $email, itemcount => $itemcount, @@ -573,15 +607,16 @@ END_SQL if (@output_chunks) { if ( defined $csvfilename ) { - print $csv_fh @output_chunks; - } - elsif ( defined $htmlfilename ) { - print $html_fh @output_chunks; - } - elsif ($nomail){ - local $, = "\f"; # pagebreak - print @output_chunks; + print $csv_fh @output_chunks; + } elsif ( defined $htmlfilename ) { + print $html_fh @output_chunks; + } elsif ($nomail) { + local $, = "\f"; # pagebreak + print @output_chunks; } + my $content = join(";", qw(title name surname address1 address2 zipcode city email itemcount itemsinfo due_date issue_date)) . "\n"; + $content .= join( "\n", @output_chunks ); + my $attachment = { filename => defined $csvfilename ? 'attachment.csv' : 'attachment.txt', type => 'text/plain', @@ -610,9 +645,9 @@ if ($csvfilename) { } if ( defined $htmlfilename ) { - print $html_fh "\n"; - print $html_fh "\n"; - close $html_fh; + print $html_fh "\n"; + print $html_fh "\n"; + close $html_fh; } =head1 INTERNAL METHODS @@ -711,7 +746,7 @@ sub prepare_letter_for_printing { if ( exists $params->{'outputformat'} && $params->{'outputformat'} eq 'csv' ) { if ($csv->combine( $params->{'firstname'}, $params->{'lastname'}, $params->{'address1'}, $params->{'address2'}, $params->{'postcode'}, - $params->{'city'}, $params->{'email'}, $params->{'itemcount'}, $params->{'titles'} + $params->{'city'}, $params->{'country'}, $params->{'email'}, $params->{'itemcount'}, $params->{'titles'} ) ) { return $csv->string, "\n"; @@ -720,6 +755,7 @@ sub prepare_letter_for_printing { } } elsif ( exists $params->{'outputformat'} && $params->{'outputformat'} eq 'html' ) { $return = "
    \n";
    +      $params->{'letter'}->{'content'}=~s#
    #
    #g; $return .= "$params->{'letter'}->{'content'}\n"; $return .= "\n
    \n"; } else { diff --git a/misc/cronjobs/printoverdues.sh b/misc/cronjobs/printoverdues.sh index 99bb878..6c7e2dc 100755 --- a/misc/cronjobs/printoverdues.sh +++ b/misc/cronjobs/printoverdues.sh @@ -39,8 +39,9 @@ then fi for i in $1/*.html do - xhtml2pdf $optpisa $i + xhtml2pdf --encoding utf-8 $optpisa $i done -lp $optprinter $1/*.pdf -tar cvfz $directory`date "+%Y%m%d"`.tar.gz $directory -rm -rf $directory + +#lp $optprinter $1/*.pdf +#tar cvfz $directory`date "+%Y%m%d"`.tar.gz $directory +#rm -rf $directory -- 1.7.1 From chrisc at catalyst.net.nz Wed Mar 16 04:03:20 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Wed, 16 Mar 2011 16:03:20 +1300 Subject: [Koha-patches] [PATCH] Bug 5879 : Biblio.pm : fix isbd syspref and default location Message-ID: <1300244600-9926-1-git-send-email-chrisc@catalyst.net.nz> From: Paul Poulain - the systempreference is isbd, not ISBD - when preparing the ItemRecord (for acq or serials recieving), there was no default value calculated for location. Fixing that --- C4/Biblio.pm | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 9cd3d05..0905b8f 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -755,7 +755,7 @@ sub GetISBDView { my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype ); my $tagslib = &GetMarcStructure( 1, $itemtype ); - my $ISBD = C4::Context->preference('ISBD'); + my $ISBD = C4::Context->preference('isbd'); my $bloc = $ISBD; my $res; my $blocres; @@ -2289,6 +2289,14 @@ sub PrepareItemrecordDisplay { $defaultvalue = $defaultvalues->{branchcode} if $defaultvalues; } } + if ( ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.location' ) + && $defaultvalues + && $defaultvalues->{'location'} ) { + my $temp = $itemrecord->field($subfield) if ($itemrecord); + unless ($temp) { + $defaultvalue = $defaultvalues->{location} if $defaultvalues; + } + } if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) { my @authorised_values; my %authorised_lib; -- 1.7.1 From chrisc at catalyst.net.nz Wed Mar 16 04:06:45 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Wed, 16 Mar 2011 16:06:45 +1300 Subject: [Koha-patches] [PATCH] Bug 5880 : C4/Koha.pm : adding two functions GetAutorisedValueByCode and GetKohaImageurlFromAuthorisedValues Message-ID: <1300244805-10081-1-git-send-email-chrisc@catalyst.net.nz> From: Paul Poulain just for convenience --- C4/Koha.pm | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 2bdcc28..2f94aa0 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -57,6 +57,8 @@ BEGIN { &GetKohaAuthorisedValues &GetKohaAuthorisedValuesFromField &GetKohaAuthorisedValueLib + &GetAuthorisedValueByCode + &GetKohaImageurlFromAuthorisedValues &GetAuthValCode &GetNormalizedUPC &GetNormalizedISBN @@ -941,6 +943,25 @@ sub displayServers { return \@primaryserverloop; } + +=head2 GetKohaImageurlFromAuthorisedValues + +$authhorised_value = GetKohaImageurlFromAuthorisedValues( $category, $authvalcode ); + +Return the first url of the authorised value image represented by $lib. + +=cut + +sub GetKohaImageurlFromAuthorisedValues { + my ( $category, $lib ) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare("SELECT imageurl FROM authorised_values WHERE category=? AND lib =?"); + $sth->execute( $category, $lib ); + while ( my $data = $sth->fetchrow_hashref ) { + return $data->{'imageurl'}; + } +} + =head2 GetAuthValCode $authvalcode = GetAuthValCode($kohafield,$frameworkcode); @@ -1035,6 +1056,25 @@ sub GetAuthorisedValueCategories { return \@results; } +=head2 GetAuthorisedValueByCode + +$authhorised_value = GetAuthorisedValueByCode( $category, $authvalcode ); + +Return an hashref of the authorised value represented by $authvalcode. + +=cut + +sub GetAuthorisedValueByCode { + my ( $category, $authvalcode ) = @_; + + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare("SELECT lib FROM authorised_values WHERE category=? AND authorised_value =?"); + $sth->execute( $category, $authvalcode ); + while ( my $data = $sth->fetchrow_hashref ) { + return $data->{'lib'}; + } +} + =head2 GetKohaAuthorisedValues Takes $kohafield, $fwcode as parameters. -- 1.7.1 From chrisc at catalyst.net.nz Wed Mar 16 04:11:20 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Wed, 16 Mar 2011 16:11:20 +1300 Subject: [Koha-patches] [PATCH] Bug 5881 : CSV export : deal with control fields to avoid an error (C4/Record.pm) Message-ID: <1300245080-10374-1-git-send-email-chrisc@catalyst.net.nz> From: Paul Poulain --- C4/Record.pm | 49 ++++++++++++++++++++++++++++++------------------- 1 files changed, 30 insertions(+), 19 deletions(-) diff --git a/C4/Record.pm b/C4/Record.pm index 497c03d..4c8eb8e 100644 --- a/C4/Record.pm +++ b/C4/Record.pm @@ -460,26 +460,37 @@ sub marcrecord2csv { } } push (@fieldstab, join($subfieldseparator, @tmpfields)); - # Or a field - } else { - my @fields = ($record->field($marcfield)); - my $authvalues = GetKohaAuthorisedValuesFromField($marcfield, undef, $frameworkcode, undef); - - my @valuesarray; - foreach (@fields) { - my $value; - - # Getting authorised value - $value = defined $authvalues->{$_->as_string} ? $authvalues->{$_->as_string} : $_->as_string; - - # Field processing - eval $fieldprocessing if ($fieldprocessing); + # Or a field - push @valuesarray, $value; - } - push (@fieldstab, join($fieldseparator, @valuesarray)); - } - }; + } else { + my @fields = ( $record->field($marcfield) ); + my $authvalues = GetKohaAuthorisedValuesFromField( $marcfield, undef, $frameworkcode, undef ); + + my @valuesarray; + foreach (@fields) { + my $value; + + # If it is a control field + if ($_->is_control_field) { + $value = defined $authvalues->{$_->as_string} ? $authvalues->{$_->as_string} : $_->as_string; + } else { + # If it is a field, we gather all subfields, joined by the subfield separator + my @subvaluesarray; + my @subfields = $_->subfields; + foreach my $subfield (@subfields) { + push (@subvaluesarray, defined $authvalues->{$subfield->[1]} ? $authvalues->{$subfield->[1]} : $subfield->[1]); + } + $value = join ($subfieldseparator, @subvaluesarray); + } + + # Field processing + eval $fieldprocessing if ($fieldprocessing); + + push @valuesarray, $value; + } + push( @fieldstab, join( $fieldseparator, @valuesarray ) ); + } + } $csv->combine(@fieldstab); $output .= $csv->string() . "\n"; -- 1.7.1 From chrisc at catalyst.net.nz Wed Mar 16 04:19:07 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Wed, 16 Mar 2011 16:19:07 +1300 Subject: [Koha-patches] [PATCH] Bug 5882 : catalogue/moredetails (minor) changes Message-ID: <1300245547-10663-1-git-send-email-chrisc@catalyst.net.nz> From: Paul Poulain MT3288 moredetail.tmpl Lost and Damaged first choice is empty First choice was the first value of the authorised value list This is not handy for users. Rather than showing the first value, inserting a new empty value for users to see what to do Term "Total Renewals" misleading, change to "Current Renewals" In koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl under History, there's a Total Renewals entry: seems to indicate a cumulative count of renewals on the item, which it is not, contrary to "Total Issues" just below. Moved the line up outside "history", and renamed it "Current Renewals". --- .../prog/en/modules/catalogue/moredetail.tmpl | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl index 87741d7..e67a864 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl @@ -67,6 +67,7 @@
    1. Current Location:  
    2. Checkout Status: Checked out to ">, Due back on Not Checked out
    3. +
    4. Current Renewals:  
    5. Lost Status: @@ -75,6 +76,7 @@ " /> " /> " /> " /> " /> " /> " /> " /> " /> + + + + " /> + +
    6. " />
    7. + + -- 1.7.1 From oleonard at myacpl.org Wed Mar 16 16:36:41 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Wed, 16 Mar 2011 11:36:41 -0400 Subject: [Koha-patches] [PATCH] Follow-up fix for Bug 4218 - Staff client detail page doesn't show hold status Message-ID: <1300289801-5200-1-git-send-email-oleonard@myacpl.org> --- .../prog/en/modules/catalogue/detail.tmpl | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl index 8f53e80..e3b0a8f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl @@ -82,6 +82,7 @@ function verify_images() { + Holds: ">
    /gp/reader//ref=sib_dp_pt/002-7879865-0184864#reader-link">.01.MZZZZZZZ.jpg" alt="" /> -- 1.7.3 From lrea at nekls.org Wed Mar 16 16:40:41 2011 From: lrea at nekls.org (Liz Rea) Date: Wed, 16 Mar 2011 10:40:41 -0500 Subject: [Koha-patches] [PATCH] [SIGNED OFF] Follow-up fix for Bug 4218 - Staff client detail page doesn't show hold status Message-ID: <1300290041-14527-1-git-send-email-lrea@nekls.org> From: Owen Leonard Signed-off-by: Liz Rea --- .../prog/en/modules/catalogue/detail.tmpl | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl index 8f53e80..e3b0a8f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl @@ -82,6 +82,7 @@ function verify_images() { + Holds: ">
    /gp/reader//ref=sib_dp_pt/002-7879865-0184864#reader-link">.01.MZZZZZZZ.jpg" alt="" /> -- 1.5.6.5 From nengard at bywatersolutions.com Tue Mar 15 18:00:17 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Tue, 15 Mar 2011 13:00:17 -0400 Subject: [Koha-patches] [PATCH 1/3] [SIGNED-OFF] Bug 5869 : Adding a reserve report Message-ID: <1300208417-5676-1-git-send-email-nengard@bywatersolutions.com> From: Paul Poulain Signed-off-by: Nicole C. Engard --- .../prog/en/modules/reports/reports-home.tmpl | 1 + .../prog/en/modules/reports/reserves_stats.tmpl | 549 ++++++++++++++++++++ reports/reserves_stats.pl | 382 ++++++++++++++ 3 files changed, 932 insertions(+), 0 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tmpl create mode 100755 reports/reserves_stats.pl diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tmpl index b2d8487..7c6efae 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tmpl @@ -34,6 +34,7 @@
  • Catalog
  • Circulation
  • Serials
  • +
  • Reserves
  • Top Lists

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tmpl new file mode 100644 index 0000000..2b78133 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tmpl @@ -0,0 +1,549 @@ + +Koha › Reports › Checkout statistics <!-- TMPL_IF NAME="do_it" -->› Results<!-- /TMPL_IF --> + + + + + + + + + + +
    + +
    +
    +
    + + + +

    Reserves statistics

    + +

    Filtered on

    +
      + +
    • Error: +
    • +
    • + + +
    • + +
    + + + + + + + + + + + + + + class="highlight"> + + + + + + + + + + + + + + +
    / TOTAL
    + "> +
    TOTAL
    + + + + +
    +
    + Reserve statistics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TitleRowColumnFilter
    Reserve status + Asked + Processing + Waiting + Satisfied + cancelled +
    reserve date + /lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openreservedateFrom" style="cursor: pointer;" /> + + + /lib/calendar/cal.gif" alt="Show Calendar" id="openreservedateTo" style="cursor: pointer;" border="0" /> + +
    notification date + /lib/calendar/cal.gif" alt="Show Calendar" border="0" id="opennotificationdateFrom" style="cursor: pointer;" /> + + + /lib/calendar/cal.gif" alt="Show Calendar" id="opennotificationdateTo" style="cursor: pointer;" border="0" /> + +
    Reminder date + /lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openreminderdateFrom" style="cursor: pointer;" /> + + + /lib/calendar/cal.gif" alt="Show Calendar" id="openreminderdateTo" style="cursor: pointer;" border="0" /> + +
    Waiting date + /lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openwaitingdateFrom" style="cursor: pointer;" /> + + + /lib/calendar/cal.gif" alt="Show Calendar" id="openwaitingdateTo" style="cursor: pointer;" border="0" /> + +
    cancellation date + /lib/calendar/cal.gif" alt="Show Calendar" border="0" id="opencancellationdateFrom" style="cursor: pointer;" /> + + + /lib/calendar/cal.gif" alt="Show Calendar" id="opencancellationdateTo" style="cursor: pointer;" border="0" /> + +
    Patron Category +
    Item Type +
    Pickup Library +
    Holding Library +
    Home Library +
    Collection +
    Shelving Location +
    Item Call NumberFrom (inclusive) to (exclusive)
    Patron sort1 +
    Patron sort2 +

    + +
    Cell value
    1. +
    + +
    + Output +
    1. +
    2. +
    +
    + +
    + + " /> + +
    +
    + + +
    +
    +
    + +
    +
    + diff --git a/reports/reserves_stats.pl b/reports/reserves_stats.pl new file mode 100755 index 0000000..93f2818 --- /dev/null +++ b/reports/reserves_stats.pl @@ -0,0 +1,382 @@ +#!/usr/bin/perl + + +# Copyright 2000-2002 Katipo Communications +# +# 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 + +use strict; + +use CGI; + +use C4::Auth; +use C4::Debug; +use C4::Context; +use C4::Branch; # GetBranches +use C4::Koha; +use C4::Output; +use C4::Reports; +use C4::Members; +use C4::Dates qw/format_date format_date_in_iso/; +use C4::Category; +use List::MoreUtils qw/any/; +use YAML; + +=head1 NAME + +plugin that shows circulation stats + +=head1 DESCRIPTION + +=over 2 + +=cut + +# my $debug = 1; # override for now. +my $input = new CGI; +my $fullreportname = "reports/reserves_stats.tmpl"; +my $do_it = $input->param('do_it'); +my $line = $input->param("Line"); +my $column = $input->param("Column"); +my $podsp = $input->param("DisplayBy"); +my $type = $input->param("PeriodTypeSel"); +my $daysel = $input->param("PeriodDaySel"); +my $monthsel = $input->param("PeriodMonthSel"); +my $calc = $input->param("Cellvalue"); +my $output = $input->param("output"); +my $basename = $input->param("basename"); +my $mime = $input->param("MIME"); +my $hash_params = $input->Vars; +my $filter_hashref; +foreach my $filter (grep {$_ =~/^filter/} keys %$hash_params){ + my $filterstring=$filter; + $filterstring=~s/^filter_//g; + $$filter_hashref{$filterstring}=$$hash_params{$filter} if (defined $$hash_params{$filter} && $$hash_params{$filter} ne ""); +} +my ($template, $borrowernumber, $cookie) = get_template_and_user({ + template_name => $fullreportname, + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {reports => '*'}, + debug => 0, +}); +our $sep = $input->param("sep"); +$sep = "\t" if ($sep eq 'tabulation'); +$template->param(do_it => $do_it, + DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), +); + +my $itemtypes = GetItemTypes(); +my $categoryloop = GetBorrowercategoryList; + +my $ccodes = GetKohaAuthorisedValues("items.ccode"); +my $locations = GetKohaAuthorisedValues("items.location"); +my $authvalue = GetKohaAuthorisedValues("items.authvalue"); + +my $Bsort1 = GetAuthorisedValues("Bsort1"); +my $Bsort2 = GetAuthorisedValues("Bsort2"); +my ($hassort1,$hassort2); +$hassort1=1 if $Bsort1; +$hassort2=1 if $Bsort2; + + +if ($do_it) { +# Displaying results + my $results = calculate($line, $column, $calc, $filter_hashref); + if ($output eq "screen"){ +# Printing results to screen + $template->param(mainloop => $results); + output_html_with_http_headers $input, $cookie, $template->output; + } else { +# Printing to a csv file + print $input->header(-type => 'application/vnd.sun.xml.calc', + -encoding => 'utf-8', + -attachment=>"$basename.csv", + -filename=>"$basename.csv" ); + my $cols = @$results[0]->{loopcol}; + my $lines = @$results[0]->{looprow}; +# header top-right + print @$results[0]->{line} ."/". @$results[0]->{column} .$sep; +# Other header + foreach my $col ( @$cols ) { + print $col->{coltitle}.$sep; + } + print "Total\n"; +# Table + foreach my $line ( @$lines ) { + my $x = $line->{loopcell}; + print $line->{rowtitle}.$sep; + print map {$_->{value}.$sep} @$x; + print $line->{totalrow}, "\n"; + } +# footer + print "TOTAL"; + $cols = @$results[0]->{loopfooter}; + print map {$sep.$_->{totalcol}} @$cols; + print $sep.@$results[0]->{total}; + } + exit(1); # exit either way after $do_it +} + +my $dbh = C4::Context->dbh; +my @values; +my %labels; +my %select; + +# create itemtype arrayref for + Holds statistics
    @@ -81,19 +81,19 @@ - + - + - + - + - + - +
    Title
    Reserve status Hold Status - Asked + Asked Processing - Waiting - Satisfied - cancelled + Waiting + Satisfied + Cancelled
    reserve dateHold Date @@ -155,7 +155,7 @@
    notification dateNotification Date @@ -217,7 +217,7 @@
    Reminder dateReminder Date @@ -279,7 +279,7 @@
    Waiting dateWaiting Date @@ -341,7 +341,7 @@
    cancellation dateCancellation Date @@ -521,7 +521,7 @@

    -
    Cell value
    1. +
      Cell value
      -- 1.7.2.3 From nengard at bywatersolutions.com Tue Mar 15 18:05:09 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Tue, 15 Mar 2011 13:05:09 -0400 Subject: [Koha-patches] [PATCH 4/4] Follow Up Bug 5869 Update Report Page Title Message-ID: <1300208709-5837-1-git-send-email-nengard@bywatersolutions.com> The title said Checkout Stats - updated to say Holds Stats Signed-off-by: Nicole C. Engard --- .../prog/en/modules/reports/reserves_stats.tmpl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tmpl index 3c2195f..246b248 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tmpl @@ -1,5 +1,5 @@ -Koha › Reports › Checkout statistics <!-- TMPL_IF NAME="do_it" -->› Results<!-- /TMPL_IF --> +Koha › Reports › Holds statistics <!-- TMPL_IF NAME="do_it" -->› Results<!-- /TMPL_IF --> @@ -70,13 +71,18 @@
      - +

      Check the boxes for the libraries you accept to checkin items from.

      For all s: Check All | Uncheck All
      @@ -126,11 +132,11 @@
    row" name="_" checked="checked" />row" name="_" checked="checked" />
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Patron CategoryItem TypeCurrent Checkouts AllowedLoan Period (day)Fine AmountFine Charging IntervalFine Grace period (day)Suspension in Days (day)Renewals Allowed (count)Holds Allowed (count)Rental Discount (%) 
    - All - - - - - All - - - - - Unlimited - - - - - &categorycode=&branch=">Delete -
    - - - - "/>
    - -
    -
    -

    Default checkout and hold policy for all libraries

    -

    You can set a default maximum number of checkouts and hold policy that will be used if none is defined below for a particular item type or category.

    -
    - - "/> - - - - - - - - - - - - - - - -
     Total Current Checkouts AllowedHold Policy  
    Defaults (not set)"/> - - - ">Unset -
    -
    -
    - -
    -

    Checkout limit by patron category for all libraries

    -

    For this library, you can specify the maximum number of loans that - a patron of a given category can make, regardless of the item type. -

    -

    If the total amount loanable for a given patron category is left blank, - no limit applies, except possibly for a limit you define for a specific item type. -

    -
    - - "/> - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Patron CategoryTotal Current Checkouts Allowed 
    - Default +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - -
    Patron categoryItem typeCurrent checkouts allowedLoan period (day)Fine amountFine charging intervalGrace period (day)Suspension duration (day)Renewals allowed (count)Renewals period (days)Holds allowed (count)Holds pickup delay (day)Allow on shelf holdsHolds restricted to libraryRental Discount (%) 
    - Unlimited - - - - - &branch=">Delete -
    - -
    - -
    - -
    -

    Holds policy by item type for all libraries

    -

    - For this library, you can edit rules for given itemtypes, regardless - of the patron's category. -

    -

    - Currently, this means hold policies. - The various policies have the following effects: -

    -
      -
    • From Any Library: Patrons from any library may put this item on hold. (default if none is defined)
    • -
    • From Home Library: Only patrons from the item's home library may put this book on hold.
    • -
    • No Holds Allowed: No patron may put this book on hold.
    • -
    -

    - Note that if the system preference - AllowHoldPolicyOverride is enabled, these policies can - be overridden by your circulation staff. Also, these policies are - based on the patron's home library, not the library where the hold is being placed.. -

    - -
    - - "/> - - - - - - - - - - - - - - - - - - - - - - -
    Item TypeHold Policy 
    - Default - - - - - From Any Library - - From Home Library - - No Holds Allowed - - - &branch=">Delete -
    - - - -
    -
    +
    + + + Default + + + + + + + Default + + + + + + + + + Unlimited + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Yes + + No + + + + + + + Yes + + No + + + + + + + + &categorycode=&branchcode=">Delete +
    + + + + "/>"/> "/>"/>"/> "/> "/>"/>"/>"/> + + "/>
    +
    +
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index dc7ed5f..dbb43d0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -10,6 +10,12 @@ - - - - - - +

    + + + + + + + +

    + - - " /> " /> " /> @@ -491,9 +547,8 @@ No patron matched
    -

    - Cannot check out! - Attention:

    +

    Cannot Check Out! + Attention:

      @@ -517,16 +572,21 @@ No patron matched -
    • Address: Patron's address in doubt
    • +
    • Address: Patron's address is in doubt ()
    • -
    • Lost: Patron's card is lost
    • +
    • Lost: Patron's card is lost ()
    • -
    • - Restricted: Patron's account is restricted &cardnumber=&destination=circ&status=0">Lift restriction -
    • +
    • + Restricted: Patron's account is restricted until () +
      + " /> + + +
      +
    • Overdues: Patron has ITEMS OVERDUE. See highlighted items below
    • @@ -556,7 +616,7 @@ No patron matched

      Holds waiting:

        -
      • "> (), by Hold placed on . +
      • "> (), by Hold placed on waiting until
        Waiting at @@ -632,20 +692,58 @@ No patron matched " /> " /> - + + + - + - + - - - + + + + + + + + + + @@ -653,121 +751,95 @@ No patron matched - + - - + + + - - - - - + - - - - - - - + - + - + - - - - - + - - - @@ -777,20 +849,81 @@ No patron matched
        Due date Title Item TypeBranch Checked out onCall noBorrower ChargePriceMaterial Renew

        select all | none

        Check in

        select all | none

        65" style="text-align: right; font-weight:bold;">Totals: +

        + Renewal due date: " /> + /lib/calendar/cal.gif" id="newduedate_button" alt="Show Calendar" /> + +

        +

        + +

        + + +

        + + +

        + + +
        - - + &type=intra">, by - &itemnumber=#item"> " alt="" /> + () Renewal Failed0 - - " checked="checked" style="display: none;" /> - - " checked="checked" /> - - " /> - - - - - - - On Hold - - - Not Renewable - - + + + / + + + + + + +
        + + On Hold + Overdue + Not Renewable + -
        Checkin Failed " /> - " checked="checked" style="display: none;" /> + " name="barcodes[]" value="" /> +
        ')">On Hold
        Previous checkouts
        Previous checkouts
        109">Previous checkouts
        + &type=intra">, by - &itemnumber=#item"> + () Renewal Failed0 - - " checked="checked" style="display: none;" /> - - " checked="checked" /> - - " /> - - - - - - - On Hold - - - Not Renewable - - - + + + / + + + + + + +
        + + On Hold + Overdue + Not Renewable + -
        Checkin Failed" /> - " checked="checked" style="display: none;" /> + + " name="barcodes[]" value="" onclick="uncheck_sibling(this);" /> +
        ')">On Hold
        - - - - - - -

        Patron has nothing checked out.

        + + + +

        Relatives issues

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Due dateTitleItem TypeBranchChecked out onChargeBorrowerMaterial
        + &type=intra">, by - &itemnumber=#item"> " alt="" /> + ()">
        Previous checkouts
        + + &type=intra">, by - &itemnumber=#item"> + + + ()">
        + + +
    @@ -814,7 +947,7 @@ No patron matched ">, by Item - waiting at + waiting at until in transit from since diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl index 724a3e9..d39f4a5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl @@ -1,6 +1,9 @@ Koha › Circulation › Check In <!-- TMPL_VAR Name="title" escape="html" --> + + @@ -101,12 +190,26 @@ YAHOO.util.Event.onContentReady("furtherm", function () { - Authors: - - :"> - | - + + Authors: +
    + Select the item(s) to search : +
      +
    • all
    • + +
    • an:au,wrdl:+au,wrdl:+">
    • + +
    + Cancel | Search +
    + + /cgi-bin/koha/opac-authoritiesdetail.pl?authid=" > + + + an:au,wrdl:+au,wrdl:+')">  |  + +
    @@ -160,12 +263,30 @@ YAHOO.util.Event.onContentReady("furtherm", function () { - Subject(s): + Subject(s): +
    + Select the item(s) to search : +
      +
    • all
    • + + +
    • " value="an:su,wrdl:">
    • + +

    • + +
    + Cancel | Search +
    - " href="/cgi-bin/koha/opac-search.pl?q=:"> - | -
    + + + "> + + an:su,wrdl:', '')"> + | + +
    Subject(s): "> | diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 93edc15..60d2f77 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -205,6 +205,38 @@ my $marcseriesarray = GetMarcSeries ($record,$marcflavour); my $marcurlsarray = GetMarcUrls ($record,$marcflavour); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); +#search rebound parameter +my $searchByauthority = 0; +if ( C4::Context->preference("OPACSearchReboundBy") eq "authority" ) { + $searchByauthority = 1; +} + +#search rebound on author +my @reboundmarcauthorsarray; +foreach my $author (@$marcauthorsarray) { + my ( $a, $b, $authoritylink, @term ); + foreach my $subfield ( @{ $author->{'MARCAUTHOR_SUBFIELDS_LOOP'} } ) { + if ( $subfield->{'code'} eq "a" && @{ $subfield->{'link_loop'} }[0]->{"limit"} eq "an" ) { + $authoritylink = @{ $subfield->{'link_loop'} }[0]->{"link"}; + } + unless ( $subfield->{'code'} eq "3" || $subfield->{'code'} eq "4" ) { push( @term, { value => $subfield->{'value'} } ); } + } + push( + @reboundmarcauthorsarray, + { term => \@term, + authoritylink => $authoritylink, + searchbyauthority => $searchByauthority, + } + ); +} + +#search rebound on subject +foreach my $subject (@$marcsubjctsarray) { + foreach my $subfield ( @{ $subject->{'MARCSUBJECT_SUBFIELDS_LOOP'} } ) { + $subfield->{'searchbyauthority'} = $searchByauthority; + } +} + $template->param( MARCNOTES => $marcnotesarray, MARCSUBJCTS => $marcsubjctsarray, @@ -220,6 +252,7 @@ my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib itemdata_itemnotes => $itemfields{itemnotes}, authorised_value_images => $biblio_authorised_value_images, subtitle => $subtitle, + bouncemarcauthorsarray => \@reboundmarcauthorsarray, ); foreach ( keys %{$dat} ) { -- 1.7.4.1 From colin.campbell at ptfs-europe.com Thu Mar 17 17:59:18 2011 From: colin.campbell at ptfs-europe.com (Colin Campbell) Date: Thu, 17 Mar 2011 16:59:18 +0000 Subject: [Koha-patches] [PATCH] Bug 5783 Followup remove duplicate AuthoritiesLog from en syspref Message-ID: <1300381158-28095-1-git-send-email-colin.campbell@ptfs-europe.com> Same line added by two earlier patches --- installer/data/mysql/en/mandatory/sysprefs.sql | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 6d382c7..4a7ce9b 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -288,7 +288,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','0','YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); -- 1.7.4 From chrisc at catalyst.net.nz Fri Mar 18 02:53:43 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Fri, 18 Mar 2011 14:53:43 +1300 Subject: [Koha-patches] [PATCH] Bug 5892 : opac-user: minor spelling/html changes Message-ID: <1300413223-28327-1-git-send-email-chrisc@catalyst.net.nz> From: Paul Poulain --- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl | 5 +++-- .../opac-tmpl/prog/en/modules/opac-userupdate.tmpl | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl index 08aac17..4f8ae07 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl @@ -388,7 +388,7 @@ $.tablesorter.addParser({ - Item waiting at + Item waiting at until " /> Item waiting to be pulled from @@ -409,7 +409,8 @@ $.tablesorter.addParser({
    " /> -
    + " /> +   diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl index 477e0d6..024442e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl @@ -37,8 +37,8 @@
  • " name="mobile" />
  • " name="phonepro" />
  • " name="fax" />
  • -
  • " name="email" />
  • -
  • " name="emailpro" />
  • +
  • " name="emailaddress" />
  • +
  • " name="emailpro" />
  • @@ -114,8 +114,8 @@
  • Mobile Phone:
  • Work phone:
  • Fax:
  • -
  • Email:
  • -
  • Work Email:
  • +
  • Primary Email:
  • +
  • Secondary Email:
  • -- 1.7.1 From f.demians at tamil.fr Fri Mar 18 07:40:34 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Fri, 18 Mar 2011 07:40:34 +0100 Subject: [Koha-patches] =?utf-8?q?=5BPATCH_1/2=5D_Bug_5755=3A_Syspref_to_c?= =?utf-8?q?ontrol_facets_truncation?= Message-ID: <1300430435-18746-1-git-send-email-f.demians@tamil.fr> On OPAC/staff result page facets are truncated to 20 characters. On some OPAC layout, it's not enough. A new syspref FacetLabelTruncationLength defines the length to cut facets if necessary. This patch add the syspref to searching.pref and add it to syspref various language default values loaded into DB during installation process. It's not necessary to update DB since length is fixed to 20 (as before) when this syspref isn't defined in systemprefercences table. Rebased to last HEAD: 2011.03.18 [Documentation] FacetLabelTruncationLength syspref in Searching tab [3.2] It doesn't apply. --- C4/Search.pm | 6 ++++-- installer/data/mysql/de-DE/mandatory/sysprefs.sql | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 1 + installer/data/mysql/it-IT/necessari/sysprefs.sql | 2 +- installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 2 +- ...m_preferences_full_optimal_for_install_only.sql | 1 + ...m_preferences_full_optimal_for_install_only.sql | 1 + .../en/modules/admin/preferences/searching.pref | 5 +++++ 8 files changed, 15 insertions(+), 4 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 52939bd..1750735 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -511,9 +511,11 @@ sub getRecords { # fix the length that will display in the label, my $facet_label_value = $one_facet; + my $facet_max_length = + C4::Context->preference('FacetLabelTruncationLength') || 20; $facet_label_value = - substr( $one_facet, 0, 20 ) . "..." - unless length($facet_label_value) <= 20; + substr( $one_facet, 0, $facet_max_length ) . "..." + if length($facet_label_value) > $facet_max_length; # if it's a branch, label by the name, not the code, if ( $link_value =~ /branch/ ) { diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index a2018ed..9a1d653 100644 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -142,6 +142,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortOrder',NULL,'Specify the default sort order','asc|dsc|za|az','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FacetLabelTruncationLength',20,'Specify the facet max length in OPAC',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('staffClientBaseURL','','Specify the base URL of the staff client',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('minPasswordLength',3,'Specify the minimum length of a patron/staff password',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noItemTypeImages',0,'If ON, disables item-type images',NULL,'YesNo'); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 6d382c7..090d333 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -143,6 +143,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortOrder',NULL,'Specify the default sort order','asc|dsc|za|az','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FacetLabelTruncationLength',20,'Specify the facet max length in OPAC',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('staffClientBaseURL','','Specify the base URL of the staff client',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('minPasswordLength',3,'Specify the minimum length of a patron/staff password',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noItemTypeImages',0,'If ON, disables item-type images',NULL,'YesNo'); diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql index 08abec5..8a0e168 100644 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -118,6 +118,7 @@ insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('opaccredits','','70|10','Per impostare i credits HTML in fondo alla pagina dell\'OPAC','Textarea'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACdefaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specifica il campo usato di default per l\'ordinamento','Choice'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACdefaultSortOrder','asc','asc|dsc|za|az','Specifica l\'ordine di default ','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FacetLabelTruncationLength',20,'Specify the facet max length in OPAC',NULL,'Integer'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACFRBRizeEditions','1','','Se ON, Koha far? delle richieste a uno o pi? ISBN web services per trovare gli ISBN associabili e li visualizzar? in un tab \'Edizioni\' nella visualizzazione dettagliata','YesNo'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('opacheader','','70|10','Inserire qui HTML da includere come header nell\'OPAC','Textarea'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OpacHighlightedWords','1','','Se impostato, le parole cercate nell\'OPAC vengono poi evidenziate ','YesNo'); @@ -278,4 +279,3 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); - diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index cfbca16..e1995a3 100644 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -141,6 +141,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortOrder',NULL,'Specify the default sort order','asc|dsc|za|az','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FacetLabelTruncationLength',20,'Specify the facet max length in OPAC',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('staffClientBaseURL','','Specify the base URL of the staff client',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('minPasswordLength',3,'Specify the minimum length of a patron/staff password',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noItemTypeImages',0,'If ON, disables item-type images',NULL,'YesNo'); @@ -290,4 +291,3 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','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 5ffcd7b..6472649 100644 --- 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 @@ -170,6 +170,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortOrder',NULL,'Specify the default sort order','asc|dsc|za|az','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FacetLabelTruncationLength',20,'Specify the facet max length in OPAC',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('staffClientBaseURL','','Specify the base URL of the staff client',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('minPasswordLength',3,'Specify the minimum length of a patron/staff password',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noItemTypeImages',0,'If ON, disables item-type images',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 bceb62b..83ab870 100644 --- 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 @@ -169,6 +169,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortOrder',NULL,'Specify the default sort order','asc|dsc|za|az','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FacetLabelTruncationLength',20,'Specify the facet max length in OPAC',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('staffClientBaseURL','','Specify the base URL of the staff client',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('minPasswordLength',3,'Specify the minimum length of a patron/staff password',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noItemTypeImages',0,'If ON, disables item-type images',NULL,'YesNo'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index 5ff267f..d880af3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -140,3 +140,8 @@ Searching: yes: Show no: "Don't show" - "an item's branch, location and call number in OPAC search results." + - + - Truncate facets length to + - pref: FacetLabelTruncationLength + class: integer + - characters, in OPAC/staff interface. -- 1.7.4 From f.demians at tamil.fr Fri Mar 18 07:40:35 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Fri, 18 Mar 2011 07:40:35 +0100 Subject: [Koha-patches] [PATCH 2/2] Bug 5755: DB Update, add new syspref In-Reply-To: <1300430435-18746-1-git-send-email-f.demians@tamil.fr> References: <1300430435-18746-1-git-send-email-f.demians@tamil.fr> Message-ID: <1300430435-18746-2-git-send-email-f.demians@tamil.fr> --- installer/data/mysql/updatedatabase.pl | 7 +++++++ kohaversion.pl | 2 +- 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 66e9828..81055ab 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4090,6 +4090,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.03.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('FacetLabelTruncationLength', 20, 'Truncate facets length to','','free')"); + print "Upgrade to $DBversion done (Add FacetLabelTruncationLength syspref to control facets displayed length)\n"; + SetVersion ($DBversion); + + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/kohaversion.pl b/kohaversion.pl index e3b9ad1..8330459 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.03.00.026'; + our $VERSION = '3.03.00.XXX'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 1.7.4 From magnus at enger.priv.no Fri Mar 18 11:15:08 2011 From: magnus at enger.priv.no (Magnus Enger) Date: Fri, 18 Mar 2011 10:15:08 +0000 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5864: link biblio => serials subscription is wrong Message-ID: <1300443308-19307-1-git-send-email-magnus@enger.priv.no> From: Julian Maurice The GetSubscription function can be called with 3 parameters : title, issn, biblionumber. In biblio view (both opac & staff interface), the link to jump from the biblio to the subscription(s) was done using title. The result was that for a title like "Science", all subscriptions containing "science" in the title were linked. That's too much and that's false. This commit fixes this problem by calling GetSubscription with biblionumber only where applicable. Signed-off-by: Magnus Enger --- .../prog/en/includes/biblio-view-menu.inc | 2 +- opac/opac-ISBDdetail.pl | 4 ++-- opac/opac-detail.pl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc index 97b642f..123e71c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc @@ -24,7 +24,7 @@
  • ">Holds
  • -
  • ">Subscription(s)
  • +
  • ">Subscription(s)
  • - - + +
     page(s) : + /prog/img/first.png" class="first"/> + /prog/img/prev.png" class="prev"/> + + /prog/img/next.png" class="next"/> + /prog/img/last.png" class="last"/> + , entries/page : + + +
    +
    + + + + - - + + - - + + + + + - - - + +
    Daten??Means of payment Description of charges Amount OutstandingManager   Print
     &itemnumber=">View item  - &accountno=">Reverse + &accountno=&accountlineid=">Reverse   - - &accountno=">Print - - &accountno=">Print - + + + &accountno=">Print + + &accountno=">Print +
    Total dueTotal due
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl index 1177ba2..ecdcd81 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl @@ -1,6 +1,37 @@ Koha › Patrons › Pay Fines for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --> + + + + @@ -31,7 +62,10 @@ + + + @@ -42,12 +76,14 @@ - + + + @@ -70,14 +128,13 @@ - - + - +
    Fines & ChargesMeans of payment DescriptionNotePart payment Account Type Notify id Level
    + " value="" /> + - " onChange="payfinechange(this.value,)"> + " value="" /> @@ -60,7 +96,29 @@ " value="" /> " value="" /> + + + + + + " value="" /> + + + " name="partpaymentamount" value="" onKeyUp="partpaymentchange(this.value,,)" /> +
    Sub TotalSub Total
    Total DueTotal Due
    diff --git a/members/boraccount.pl b/members/boraccount.pl index 5509f3d..e672084 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -1,10 +1,8 @@ #!/usr/bin/perl - #writen 11/1/2000 by chris at katipo.oc.nz #script to display borrowers account details - # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -33,46 +31,46 @@ use C4::Members; use C4::Branch; use C4::Accounts; -my $input=new CGI; +my $input = new CGI; +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { template_name => "members/boraccount.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { borrowers => 1, updatecharges => 1 }, + debug => 1, + } +); -my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "members/boraccount.tmpl", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => {borrowers => 1, updatecharges => 1}, - debug => 1, - }); - -my $borrowernumber=$input->param('borrowernumber'); +my $borrowernumber = $input->param('borrowernumber'); my $action = $input->param('action') || ''; #get borrower details -my $data=GetMember('borrowernumber' => $borrowernumber); +my $data = GetMember( 'borrowernumber' => $borrowernumber ); if ( $action eq 'reverse' ) { - ReversePayment( $borrowernumber, $input->param('accountno') ); + ReversePayment( $input->param('accountlineid') ); } -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; +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; } #get account details -my ($total,$accts,undef)=GetMemberAccountRecords($borrowernumber); +my ( $total, $accts, undef ) = GetMemberAccountRecords($borrowernumber); my $totalcredit; -if($total <= 0){ - $totalcredit = 1; +if ( $total <= 0 ) { + $totalcredit = 1; } -my $reverse_col = 0; # Flag whether we need to show the reverse column -foreach my $accountline ( @{$accts}) { +my $reverse_col = 0; # Flag whether we need to show the reverse column +foreach my $accountline ( @{$accts} ) { $accountline->{amount} += 0.00; - if ($accountline->{amount} <= 0 ) { + if ( $accountline->{amount} <= 0 ) { $accountline->{amountcredit} = 1; } $accountline->{amountoutstanding} += 0.00; @@ -80,45 +78,54 @@ foreach my $accountline ( @{$accts}) { $accountline->{amountoutstandingcredit} = 1; } - $accountline->{date} = format_date($accountline->{date}); - $accountline->{amount} = sprintf '%.2f', $accountline->{amount}; + $accountline->{date} = format_date( $accountline->{date} ); + $accountline->{amount} = sprintf '%.2f', $accountline->{amount}; $accountline->{amountoutstanding} = sprintf '%.2f', $accountline->{amountoutstanding}; - if ($accountline->{accounttype} eq 'Pay') { + if ( $accountline->{accounttype} eq 'Pay' ) { $accountline->{payment} = 1; $reverse_col = 1; } - if ($accountline->{accounttype} ne 'F' && $accountline->{accounttype} ne 'FU'){ + if ( $accountline->{accounttype} ne 'F' && $accountline->{accounttype} ne 'FU' ) { $accountline->{printtitle} = 1; } + + if ( $accountline->{accounttype} ne 'F' && $accountline->{accounttype} ne 'FU' ) { + $accountline->{printtitle} = 1; + } + if ( $accountline->{manager_id} ne '' ) { + my $datamanager = GetMember( 'borrowernumber' => $accountline->{manager_id} ); + $accountline->{manager_details}=$datamanager->{'firstname'}." ".$datamanager->{'surname'}; + } } $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); -my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); +my ( $picture, $dberror ) = GetPatronImage( $data->{'cardnumber'} ); $template->param( picture => 1 ) if $picture; $template->param( - finesview => 1, - 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'}, - zipcode => $data->{'zipcode'}, - country => $data->{'country'}, - phone => $data->{'phone'}, - email => $data->{'email'}, - branchcode => $data->{'branchcode'}, - branchname => GetBranchName($data->{'branchcode'}), - total => sprintf("%.2f",$total), - totalcredit => $totalcredit, - is_child => ($data->{'category_type'} eq 'C'), - reverse_col => $reverse_col, - accounts => $accts ); + finesview => 1, + 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'}, + zipcode => $data->{'zipcode'}, + country => $data->{'country'}, + phone => $data->{'phone'}, + email => $data->{'email'}, + branchcode => $data->{'branchcode'}, + branchname => GetBranchName( $data->{'branchcode'} ), + total => sprintf( "%.2f", $total ), + totalcredit => $totalcredit, + is_child => ( $data->{'category_type'} eq 'C' ), + reverse_col => $reverse_col, + accounts => $accts +); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/pay.pl b/members/pay.pl index 5a36bd7..9ed2f09 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -17,10 +17,8 @@ # 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 part of the koha library system, script to facilitate paying off fines =cut @@ -33,17 +31,18 @@ use C4::Auth; use C4::Output; use CGI; use C4::Members; +use C4::Context; use C4::Accounts; use C4::Stats; use C4::Koha; use C4::Overdues; -use C4::Branch; # GetBranches +use C4::Branch; # GetBranches my $input = new CGI; - +my $lastinsertid = 0; +#warn Data::Dumper::Dumper $input; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { - template_name => "members/pay.tmpl", + { template_name => "members/pay.tmpl", query => $input, type => "intranet", authnotrequired => 0, @@ -52,6 +51,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +my $manager_id = C4::Context->userenv->{'number'}; my $borrowernumber = $input->param('borrowernumber'); if ( $borrowernumber eq '' ) { $borrowernumber = $input->param('borrowernumber0'); @@ -63,34 +63,57 @@ my $user = $input->remote_user; # 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(defined($input->param( $names[ $i + 1 ] )) && $names[ $i + 1 ] =~ /^accountlineid/) + { + if(defined($input->param( "payfine".$input->param( $names[ $i + 1 ] ) ))) + { + my $accountlineid = $input->param( $names[ $i + 1 ] );#7 + my $temp = $input->param( "payfine".$accountlineid ); + if ( $temp eq 'wo' ) { + $inp{ $names[$i] } = $temp; + $check = 1; + } + if ( $temp eq 'yes' ) { + #my $accountlineid = $input->param( $names[ $i + 1 ] );#7 + # FIXME : using array +4, +5, +6 is dirty. Should use arrays for each accountline + my $amount = $input->param( "amount".$accountlineid );#4 + my $borrowernumber = $input->param( "borrowernumber".$accountlineid );#5 + my $accountno = $input->param( "accountno".$accountlineid );#6 + my $note = $input->param( "note".$accountlineid );#12 + my $meansofpayment = $input->param( "meansofpayment".$accountlineid );#11 + #$accountnoupdated = getnextacctno($borrowernumber); + $lastinsertid = makepayment( $accountlineid, $borrowernumber, $accountno, $amount, $user, $branch, $note, $meansofpayment, $manager_id, 0 ); + $check = 2; + } + elsif($temp eq 'pp') + { + #my $accountlineid = $input->param( $names[ $i +1 ] );#7 + my $amount = $input->param( "amount".$accountlineid );#4 + my $borrowernumber = $input->param( "borrowernumber".$accountlineid );#5 + my $accountno = $input->param( "accountno".$accountlineid );#6 + my $note = $input->param( "note".$accountlineid );#12 + my $meansofpayment = $input->param( "meansofpayment".$accountlineid );#11 + my $partpaymentamount = $input->param( "partpaymentamount".$accountlineid );#13 + $lastinsertid = makepayment( $accountlineid, $borrowernumber, $accountno, $amount, $user, $branch, $note, $meansofpayment, $manager_id, $partpaymentamount); + $check = 2; + } + } + } } + my $total = $input->param('total') || ''; if ( $check == 0 ) { if ( $total ne '' ) { recordpayment( $borrowernumber, $total ); } - my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); + my ( $total, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber); my @allfile; my @notify = NumberNotifyId($borrowernumber); @@ -98,77 +121,77 @@ if ( $check == 0 ) { my $numberofnotify = scalar(@notify); for ( my $j = 0 ; $j < scalar(@notify) ; $j++ ) { my @loop_pay; - my ( $total , $accts, $numaccts) = - GetBorNotifyAcctRecord( $borrowernumber, $notify[$j] ); + 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{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. + $line{i} = $accts->[$i]{'id'}; + $line{accountlineid} = $accts->[$i]{'id'}; + $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{meansofpaymentoptions}=getMeansOfPaymentList($accts->[$i]{'meansofpayment'}); + $line{meansofpayment} = $accts->[$i]{'meansofpayment'}; + $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 ); } } my $totalnotify = AmountNotify( $notify[$j], $borrowernumber ); ( $totalnotify = '0' ) if ( $totalnotify =~ /^0.00/ ); - push @allfile, - { + push @allfile, { 'loop_pay' => \@loop_pay, 'notify' => $notify[$j], - 'total' => sprintf( "%.2f",$totalnotify), - - }; + '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; -} - -$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); -my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); -$template->param( picture => 1 ) if $picture; - + + 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; + } + + $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); + my ( $picture, $dberror ) = GetPatronImage( $data->{'cardnumber'} ); + $template->param( picture => 1 ) if $picture; + $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'}, - 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'), + cardnumber => $data->{'cardnumber'}, + categorycode => $data->{'categorycode'}, + category_type => $data->{'category_type'}, + categoryname => $data->{'description'}, + address => $data->{'address'}, + address2 => $data->{'address2'}, + city => $data->{'city'}, + 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 ) ); output_html_with_http_headers $input, $cookie, $template->output; -} -else { +} else { my %inp; my @name = $input->param; @@ -188,23 +211,20 @@ else { my $itemno = $input->param("itemnumber$value"); my $amount = $input->param("amount$value"); my $accountno = $input->param("accountno$value"); - writeoff( $borrowernumber, $accountno, $itemno, $accounttype, $amount ); + my $accountlineid = $input->param("accountlineid$value"); + writeoff( $borrowernumber, $accountno, $itemno, $accounttype, $amount, $accountlineid ); } $borrowernumber = $input->param('borrowernumber'); - print $input->redirect( - "/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber"); + print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber"); } sub writeoff { - my ( $borrowernumber, $accountnum, $itemnum, $accounttype, $amount ) = @_; + my ( $borrowernumber, $accountnum, $itemnum, $accounttype, $amount, $accountlineid ) = @_; 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 ); + 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 id=?" ); + $sth->execute( $accountlineid ); $sth->finish; $sth = $dbh->prepare("select max(accountno) from accountlines"); $sth->execute; @@ -212,12 +232,10 @@ sub writeoff { $sth->finish; $account->{'max(accountno)'}++; $sth = $dbh->prepare( -"insert into accountlines (borrowernumber,accountno,itemnumber,date,amount,description,accounttype) - values (?,?,?,now(),?,'Writeoff','W')" + "insert into accountlines (borrowernumber,accountno,itemnumber,date,time,amount,description,accounttype,manager_id) + values (?,?,?,now(),CURRENT_TIME,?,?,'W', ?)" ); - $sth->execute( $borrowernumber, $account->{'max(accountno)'}, - $itemnum, $amount ); + $sth->execute( $borrowernumber, $account->{'max(accountno)'}, $itemnum, $amount,"Writeoff for account n??".$accountnum, $manager_id); $sth->finish; - UpdateStats( $branch, 'writeoff', $amount, '', '', '', - $borrowernumber ); + UpdateStats( $branch, 'writeoff', $amount, '', '', '', $borrowernumber ); } -- 1.7.1 From chrisc at catalyst.net.nz Sun Mar 20 23:36:01 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Mon, 21 Mar 2011 11:36:01 +1300 Subject: [Koha-patches] [PATCH] Bug 5907 : MT 2538 : Using default authtypecode for authority display Message-ID: <1300660561-1414-1-git-send-email-chrisc@catalyst.net.nz> From: Matthias Meusburger --- authorities/detail.pl | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/authorities/detail.pl b/authorities/detail.pl index f92e04b..59273c1 100755 --- a/authorities/detail.pl +++ b/authorities/detail.pl @@ -174,7 +174,8 @@ my $authid = $query->param('authid'); -my $authtypecode = &GetAuthTypeCode($authid); +# Using default authtypecode, so all fields are seen +my $authtypecode = ''; $tagslib = &GetTagsLabels(1,$authtypecode); my $record; -- 1.7.1 From chrisc at catalyst.net.nz Sun Mar 20 23:40:43 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Mon, 21 Mar 2011 11:40:43 +1300 Subject: [Koha-patches] [PATCH] Bug 5909 : SetUTF8Flag on any incoming data Message-ID: <1300660843-1737-1-git-send-email-chrisc@catalyst.net.nz> From: Henri-Damien LAURENT This prompts NFC normalization on adding record Therefore, any saved record will be NFC normalized --- C4/AuthoritiesMarc.pm | 3 ++- C4/Biblio.pm | 2 ++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index f3cc948..3e6ca18 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -624,6 +624,7 @@ sub AddAuthority { $f5->update($time.".0"); } + SetUTF8Flag($record); if ($format eq "MARC21") { if (!$record->leader) { $record->leader($leader); @@ -650,7 +651,7 @@ sub AddAuthority { } if (($format eq "UNIMARCAUTH") && (!$record->subfield('100','a'))){ - $record->leader(" nx j22 "); + $record->leader(" nx j22 ") unless ($record->leader()); my $date=POSIX::strftime("%Y%m%d",localtime); if ($record->field('100')){ $record->field('100')->update('a'=>$date."afrey50 ba0"); diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 0914d35..8143ee1 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -250,6 +250,7 @@ sub AddBiblio { my $dbh = C4::Context->dbh; # transform the data into koha-table style data + SetUTF8Flag($record); my $olddata = TransformMarcToKoha( $dbh, $record, $frameworkcode ); ( $biblionumber, $error ) = _koha_add_biblio( $dbh, $olddata, $frameworkcode ); $olddata->{'biblionumber'} = $biblionumber; @@ -294,6 +295,7 @@ sub ModBiblio { logaction( "CATALOGUING", "MODIFY", $biblionumber, "BEFORE=>" . $newrecord->as_formatted ); } + SetUTF8Flag($record); my $dbh = C4::Context->dbh; $frameworkcode = "" unless $frameworkcode; -- 1.7.1 From chrisc at catalyst.net.nz Sun Mar 20 23:46:40 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Mon, 21 Mar 2011 11:46:40 +1300 Subject: [Koha-patches] [PATCH] Bug 5910 : (MT #2543) allow users to search on all auth types Message-ID: <1300661200-2021-1-git-send-email-chrisc@catalyst.net.nz> From: Nahuel ANGELINETTI Signed-off-by: Henri-Damien LAURENT --- .../prog/en/includes/authorities-search.inc | 1 + .../prog/en/modules/opac-authorities-home.tmpl | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc index 0a1548f..fd777bb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc @@ -7,6 +7,7 @@ + -- 1.7.1 From chrisc at catalyst.net.nz Mon Mar 21 03:32:29 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Mon, 21 Mar 2011 15:32:29 +1300 Subject: [Koha-patches] [PATCH] Bug 5913 : MT2949: Remove broken link from authorities search results Message-ID: <1300674749-8607-1-git-send-email-chrisc@catalyst.net.nz> From: Matthias Meusburger Signed-off-by: Henri-Damien LAURENT --- C4/AuthoritiesMarc.pm | 2 +- .../modules/opac-authoritiessearchresultlist.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index f3cc948..dfe6a89 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -1042,7 +1042,7 @@ sub BuildSummary{ $narrowerterms =~s/-- \n$//; $seealso =~s/-- \n$//; $see =~s/-- \n$//; - $summary = "".$heading."
    ".($notes?"$notes
    ":""); + $summary = "".$heading."
    ".($notes?"$notes
    ":""); $summary.= '

    TG : '.$broaderterms.'

    ' if ($broaderterms); $summary.= '

    TS : '.$narrowerterms.'

    ' if ($narrowerterms); $summary.= '

    TA : '.$seealso.'

    ' if ($seealso); diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tmpl index e0c7564..05ca2e5 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tmpl @@ -48,7 +48,7 @@ - "> + -- 1.7.1 From chrisc at catalyst.net.nz Mon Mar 21 03:52:59 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Mon, 21 Mar 2011 15:52:59 +1300 Subject: [Koha-patches] [PATCH] Bug 5914 : BuildUnimarcHierarchies : Fixing infinite loop Message-ID: <1300675979-9462-1-git-send-email-chrisc@catalyst.net.nz> From: Henri-Damien LAURENT When referenced authority in 5XX$3 would be the same as the current authid, the script would get into infinite loop --- C4/AuthoritiesMarc.pm | 45 +++++++++++++++++++++++---------------------- 1 files changed, 23 insertions(+), 22 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index f3cc948..c23196c 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -1128,28 +1128,29 @@ sub BuildUnimarcHierarchies{ } else { my $record = GetAuthority($authid); my $found; - if ($record){ - foreach my $field ($record->field('550')){ - if ($field->subfield('5') && $field->subfield('5') eq 'g'){ - my $parentrecord = GetAuthority($field->subfield('3')); - my $localresult=$hierarchies; - my $trees; - $trees = BuildUnimarcHierarchies($field->subfield('3')); - my @trees; - if ($trees=~/;/){ - @trees = split(/;/,$trees); - } else { - push @trees, $trees; - } - foreach (@trees){ - $_.= ",$authid"; - } - @globalresult = (@globalresult, at trees); - $found=1; - } - $hierarchies=join(";", at globalresult); - } - } + return unless $record; + foreach my $field ($record->field('5..')){ + if ($field->subfield('5') && $field->subfield('5') eq 'g'){ + my $subfauthid=_get_authid_subfield($field); + next if ($subfauthid eq $authid); + my $parentrecord = GetAuthority($subfauthid); + my $localresult=$hierarchies; + my $trees; + $trees = BuildUnimarcHierarchies($subfauthid); + my @trees; + if ($trees=~/;/){ + @trees = split(/;/,$trees); + } else { + push @trees, $trees; + } + foreach (@trees){ + $_.= ",$authid"; + } + @globalresult = (@globalresult, at trees); + $found=1; + } + $hierarchies=join(";", at globalresult); + } #Unless there is no ancestor, I am alone. $hierarchies="$authid" unless ($hierarchies); } -- 1.7.1 From chrisc at catalyst.net.nz Mon Mar 21 04:12:43 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Mon, 21 Mar 2011 16:12:43 +1300 Subject: [Koha-patches] [PATCH] Bug 5915 : C4::AuthoritiesMarc AddAuthority Message-ID: <1300677163-10370-1-git-send-email-chrisc@catalyst.net.nz> From: Paul Poulain Fixing 100$a simple error: Sometimes, language is encoded fre50 and not frey50. This patch adds check for that problem --- C4/AuthoritiesMarc.pm | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index f3cc948..3496c05 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -649,10 +649,14 @@ sub AddAuthority { } } - if (($format eq "UNIMARCAUTH") && (!$record->subfield('100','a'))){ - $record->leader(" nx j22 "); + if ($format eq "UNIMARCAUTH") { + $record->leader(" nx j22 ") unless ($record->leader()); my $date=POSIX::strftime("%Y%m%d",localtime); - if ($record->field('100')){ + if (my $string=$record->subfield('100',"a")){ + $string=~s/fre50/frey50/; + $record->field('100')->update('a'=>$string); + } + elsif ($record->field('100')){ $record->field('100')->update('a'=>$date."afrey50 ba0"); } else { $record->append_fields( -- 1.7.1 From sue.chanoca at gmail.com Mon Mar 21 04:21:34 2011 From: sue.chanoca at gmail.com (susana tonel) Date: Mon, 21 Mar 2011 03:21:34 +0000 Subject: [Koha-patches] How to apply bug fixes with git from the public repository or other patches Message-ID: *Hello Everyone; *Please could you help me how to apply patches/bug fixes individually or together Thank you, Susana tonel -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrisc at catalyst.net.nz Mon Mar 21 04:33:48 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Mon, 21 Mar 2011 16:33:48 +1300 Subject: [Koha-patches] [PATCH] Bug 5916 : (MT #2685) don't show authority edition menu Message-ID: <1300678428-11039-1-git-send-email-chrisc@catalyst.net.nz> From: Nahuel ANGELINETTI this patch add a check of rights to show the authority edition menu, if the user have no rights of authority edition, we hide the menu. --- .../prog/en/includes/authorities-toolbar.inc | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc index 425519e..3e0c527 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc @@ -18,7 +18,7 @@ { text: "", url: "/cgi-bin/koha/authorities/authorities.pl?authtypecode="}, ] - + new YAHOO.widget.Button({ type: "menu", label: _("New Authority"), @@ -36,6 +36,7 @@ container: "delAuthc", onclick: {fn: confirm_deletion } }); + } //]]> -- 1.7.1 From chrisc at catalyst.net.nz Mon Mar 21 07:45:28 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Mon, 21 Mar 2011 19:45:28 +1300 Subject: [Koha-patches] How to apply bug fixes with git from the public repository or other patches In-Reply-To: References: Message-ID: <20110321064528.GC3364@rorohiko> * susana tonel (sue.chanoca at gmail.com) wrote: > Hello Everyone; > > Please could you help me how to apply patches/bug fixes individually or > together Hi Susana Do you have a git checkout already? And are you wanting to help with signing off patches? If not, waiting for the patches to be signed off and applied to the repository is probably the safest thing. Then you can either run the stable 3.2.x branch or the unstable master branch if you are feeling brave. Chris > > Thank you, > Susana tonel > _______________________________________________ > 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 paul.poulain at biblibre.com Sat Mar 19 06:09:06 2011 From: paul.poulain at biblibre.com (paul.poulain at biblibre.com) Date: Sat, 19 Mar 2011 06:09:06 +0100 Subject: [Koha-patches] [PATCH 51/60] BZ5725 follow-up : another wrong permission Message-ID: <1300511346-12616-1-git-send-email-paul.poulain@biblibre.com> From: Paul Poulain missing permission, same thing as the previous patch, but for another call of batchedit --- tools/batchedit.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/batchedit.pl b/tools/batchedit.pl index d768fb9..39d48f7 100755 --- a/tools/batchedit.pl +++ b/tools/batchedit.pl @@ -141,7 +141,7 @@ if($input->param('field') and not defined $op){ query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => "batchedit", + flagsrequired => { tools =>"batchedit" }, }); $template->param( inputform => 1, ) unless @biblionumbers; -- 1.7.1 From paul.poulain at biblibre.com Sat Mar 19 05:56:36 2011 From: paul.poulain at biblibre.com (paul.poulain at biblibre.com) Date: Sat, 19 Mar 2011 05:56:36 +0100 Subject: [Koha-patches] [PATCH] Bug 5772 : MT3113 : Showing cards should use marcflavour Message-ID: <1300510596-5803-1-git-send-email-paul.poulain@biblibre.com> From: Paul Poulain filename for compact xsl is now based on marcflavour Signed-off-by: Paul Poulain --- catalogue/cardview.pl | 3 ++- catalogue/showmarc.pl | 3 ++- .../intranet-tmpl/prog/en/xslt/UNIMARC_compact.xsl | 19 ++++++------------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/catalogue/cardview.pl b/catalogue/cardview.pl index f93323f..d41d7c8 100755 --- a/catalogue/cardview.pl +++ b/catalogue/cardview.pl @@ -32,7 +32,8 @@ $template->param(biblionumber => $biblionumber); my $xmlrecord = GetXmlBiblio($biblionumber); #my $xslfile = "/home/kohacat/etc/xslt/MARC21slim2HTML.xsl"; #my $xslfile = "/home/kohacat/etc/xslt/MARC21slim2English.xsl"; -my $xslfile = C4::Context->config('intranetdir')."/koha-tmpl/intranet-tmpl/prog/en/xslt/compact.xsl"; +my $filename=(C4::Context->preference('marcflavour') ne "MARC21"?C4::Context->preference('marcflavour')."_":"").'compact.xsl'; +my $xslfile = C4::Context->config('intranetdir')."/koha-tmpl/intranet-tmpl/prog/en/xslt/$filename"; my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); my $source = $parser->parse_string($xmlrecord); diff --git a/catalogue/showmarc.pl b/catalogue/showmarc.pl index d316833..3822ab5 100755 --- a/catalogue/showmarc.pl +++ b/catalogue/showmarc.pl @@ -69,7 +69,8 @@ if($importid) { if($view eq 'card') { $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord; -my $xslfile = C4::Context->config('intrahtdocs')."/prog/en/xslt/compact.xsl"; +my $filename=(C4::Context->preference('marcflavour') ne "MARC21"?C4::Context->preference('marcflavour')."_":"").'compact.xsl'; +my $xslfile = C4::Context->config('intrahtdocs')."/prog/en/xslt/$filename"; my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); my $source = $parser->parse_string($xmlrecord); diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARC_compact.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARC_compact.xsl index 6e70ee7..32e92ca 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARC_compact.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARC_compact.xsl @@ -34,28 +34,21 @@ -

    +

    - -
    -

    - -

    -
    - - . - - - . + +

    + . +

    @@ -78,7 +71,7 @@
    - + -- -- 1.7.1 From julian.maurice at biblibre.com Mon Mar 21 12:18:57 2011 From: julian.maurice at biblibre.com (Julian Maurice) Date: Mon, 21 Mar 2011 12:18:57 +0100 Subject: [Koha-patches] [PATCH] Bug 5436: Extended patron attributes display improvements Message-ID: <1300706337-6881-1-git-send-email-julian.maurice@biblibre.com> From: Henri-Damien LAURENT (MT #2262) member search improving if only one member is found, go directly to his details. change borrower link in return.pl go to circulation.pl instead of moremembers.pl (MT #2262) Show extended attributes in borrower toolbar This made some modifications to be more generic, and to show extended attributes in borrower "toolbar". It hide by default the borrower address, and the user have a toggle link to show/hide the user address. (bug #MT2262) don't show all attributes this hide non-active extended attributes in circulation. (MT2262) Followup : Enhancement to extended attributes display View/Hide address improvement in moremember.pl --- C4/Members.pm | 46 ++++++++- C4/Members/AttributeTypes.pm | 31 +++++- C4/Members/Attributes.pm | 3 +- admin/patron-attr-types.pl | 9 ++- circ/circulation.pl | 13 +-- .../0009-patron-attr-display-checkout.pl | 7 ++ installer/data/mysql/kohastructure.sql | 1 + .../intranet-tmpl/prog/en/css/staff-global.css | 32 ++++++ .../intranet-tmpl/prog/en/includes/circ-menu.inc | 111 +++++++++++++------- .../prog/en/modules/admin/patron-attr-types.tmpl | 5 + .../prog/en/modules/circ/returns.tmpl | 2 +- .../prog/en/modules/members/moremember.tmpl | 2 +- .../intranet-tmpl/prog/img/more-right-arrow.gif | Bin 0 -> 81 bytes members/member.pl | 6 + members/moremember.pl | 3 +- 15 files changed, 211 insertions(+), 60 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/0009-patron-attr-display-checkout.pl create mode 100644 koha-tmpl/intranet-tmpl/prog/img/more-right-arrow.gif diff --git a/C4/Members.pm b/C4/Members.pm index ace939d..4f2fe0f 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -26,12 +26,13 @@ use C4::Dates qw(format_date_in_iso); use Digest::MD5 qw(md5_base64); use Date::Calc qw/Today Add_Delta_YM/; use C4::Log; # logaction +use C4::Branch; use C4::Overdues; use C4::Reserves; use C4::Accounts; use C4::Biblio; use C4::SQLHelper qw(InsertInTable UpdateInTable SearchInTable); -use C4::Members::Attributes qw(SearchIdMatchingAttribute); +use C4::Members::Attributes qw(SearchIdMatchingAttribute GetBorrowerAttributes); our ($VERSION, at ISA, at EXPORT, at EXPORT_OK,$debug); @@ -88,6 +89,8 @@ BEGIN { &DeleteMessage &GetMessages &GetMessagesCount + + &SetMemberInfosInTemplate ); #Modify data @@ -1651,6 +1654,47 @@ sub DelMember { return $sth->rows; } +=head2 SetMemberInfosInTemplate + &SetMemberInfosInTemplate($borrowernumber, $template) + + +Settings borrower informations for template user + +=cut + +sub SetMemberInfosInTemplate { + my ($borrowernumber, $template) = @_; + + my $borrower = GetMemberDetails( $borrowernumber, 0 ); + foreach my $key (keys %$borrower){ + $template->param($key => $borrower->{$key}); + } + + # Computes full borrower address + my (undef, $roadttype_hashref) = &GetRoadTypes(); + my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'}; + $template->param(is_child => ($borrower->{'category_type'} eq 'C'), + address => $address, + branchname => GetBranchName($borrower->{'branchcode'}), + ); + + foreach (qw(dateenrolled dateexpiry dateofbirth)) { + my $userdate = $borrower->{$_}; + unless ($userdate) { + $borrower->{$_} = ''; + next; + } + $userdate = C4::Dates->new($userdate,'iso')->output('syspref'); + $borrower->{$_} = $userdate || ''; + $template->param( $_ => $userdate ); + } + + my $attributes = GetBorrowerAttributes($borrowernumber); + $template->param( + extendedattributes => $attributes, + ); +} + =head2 ExtendMemberSubscriptionTo (OUEST-PROVENCE) $date = ExtendMemberSubscriptionTo($borrowerid, $date); diff --git a/C4/Members/AttributeTypes.pm b/C4/Members/AttributeTypes.pm index 21d17eb..37193fa 100644 --- a/C4/Members/AttributeTypes.pm +++ b/C4/Members/AttributeTypes.pm @@ -102,6 +102,7 @@ sub new { $self->{'opac_display'} = 0; $self->{'password_allowed'} = 0; $self->{'staff_searchable'} = 0; + $self->{'display_checkout'} = 0; $self->{'authorised_value_category'} = ''; bless $self, $class; @@ -136,6 +137,7 @@ sub fetch { $self->{'opac_display'} = $row->{'opac_display'}; $self->{'password_allowed'} = $row->{'password_allowed'}; $self->{'staff_searchable'} = $row->{'staff_searchable'}; + $self->{'display_checkout'} = $row->{'display_checkout'}; $self->{'authorised_value_category'} = $row->{'authorised_value_category'}; bless $self, $class; @@ -166,14 +168,15 @@ sub store { opac_display = ?, password_allowed = ?, staff_searchable = ?, - authorised_value_category = ? + authorised_value_category = ?, + display_checkout = ? WHERE code = ?"); } else { $sth = $dbh->prepare_cached("INSERT INTO borrower_attribute_types (description, repeatable, unique_id, opac_display, password_allowed, - staff_searchable, authorised_value_category, code) + staff_searchable, authorised_value_category, display_checkout, code) VALUES (?, ?, ?, ?, ?, - ?, ?, ?)"); + ?, ?, ?, ?)"); } $sth->bind_param(1, $self->{'description'}); $sth->bind_param(2, $self->{'repeatable'}); @@ -182,7 +185,8 @@ sub store { $sth->bind_param(5, $self->{'password_allowed'}); $sth->bind_param(6, $self->{'staff_searchable'}); $sth->bind_param(7, $self->{'authorised_value_category'}); - $sth->bind_param(8, $self->{'code'}); + $sth->bind_param(8, $self->{'display_checkout'}); + $sth->bind_param(9, $self->{'code'}); $sth->execute; } @@ -288,6 +292,25 @@ sub staff_searchable { @_ ? $self->{'staff_searchable'} = ((shift) ? 1 : 0) : $self->{'staff_searchable'}; } +=head2 display_checkout + +=over 4 + +my $display_checkout = $attr_type->display_checkout(); +$attr_type->display_checkout($display_checkout); + +=back + +Accessor. The C<$display_checkout> argument +is interpreted as a Perl boolean. + +=cut + +sub display_checkout { + my $self = shift; + @_ ? $self->{'display_checkout'} = ((shift) ? 1 : 0) : $self->{'display_checkout'}; +} + =head2 authorised_value_category my $authorised_value_category = $attr_type->authorised_value_category(); diff --git a/C4/Members/Attributes.pm b/C4/Members/Attributes.pm index 1db9424..4976d76 100644 --- a/C4/Members/Attributes.pm +++ b/C4/Members/Attributes.pm @@ -72,7 +72,7 @@ sub GetBorrowerAttributes { my $opac_only = @_ ? shift : 0; my $dbh = C4::Context->dbh(); - my $query = "SELECT code, description, attribute, lib, password + my $query = "SELECT code, description, attribute, lib, password, display_checkout FROM borrower_attributes JOIN borrower_attribute_types USING (code) LEFT JOIN authorised_values ON (category = authorised_value_category AND attribute = authorised_value) @@ -89,6 +89,7 @@ sub GetBorrowerAttributes { value => $row->{'attribute'}, value_description => $row->{'lib'}, password => $row->{'password'}, + display_checkout => $row->{'display_checkout'}, } } return \@results; diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl index 1dfe442..c32b6c2 100755 --- a/admin/patron-attr-types.pl +++ b/admin/patron-attr-types.pl @@ -106,6 +106,9 @@ sub error_add_attribute_type_form { if ($input->param('staff_searchable')) { $template->param(staff_searchable_checked => 'checked="checked"'); } + if ($input->param('display_checkout')) { + $template->param(display_checkout_checked => 'checked="checked"'); + } $template->param( attribute_type_form => 1, @@ -147,6 +150,8 @@ sub add_update_attribute_type { $attr_type->authorised_value_category($authorised_value_category); my $password_allowed = $input->param('password_allowed'); $attr_type->password_allowed($password_allowed); + my $display_checkout = $input->param('display_checkout'); + $attr_type->display_checkout($display_checkout); if ($op eq 'edit') { $template->param(edited_attribute_type => $attr_type->code()); @@ -222,7 +227,9 @@ sub edit_attribute_type_form { if ($attr_type->staff_searchable()) { $template->param(staff_searchable_checked => 'checked="checked"'); } - + if ($attr_type->display_checkout()) { + $template->param(display_checkout_checked => 'checked="checked"'); + } authorised_value_category_list($template, $attr_type->authorised_value_category()); $template->param( diff --git a/circ/circulation.pl b/circ/circulation.pl index 1ed4afd..8ae2f32 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -231,8 +231,8 @@ if ($borrowernumber) { # Warningdate is the date that the warning starts appearing my ( $today_year, $today_month, $today_day) = Today(); - my ($warning_year, $warning_month, $warning_day) = split /-/, $borrower->{'dateexpiry'}; - my ( $enrol_year, $enrol_month, $enrol_day) = split /-/, $borrower->{'dateenrolled'}; + my ($warning_year, $warning_month, $warning_day) = split (/-/, $borrower->{'dateexpiry'}); + my ( $enrol_year, $enrol_month, $enrol_day) = split (/-/, $borrower->{'dateenrolled'}); # Renew day is calculated by adding the enrolment period to today my ( $renew_year, $renew_month, $renew_day); if ($enrol_year*$enrol_month*$enrol_day>0) { @@ -611,10 +611,6 @@ if($lib_messages_loop){ $template->param(flagged => 1 ); } my $bor_messages_loop = GetMessages( $borrowernumber, 'B', $branch ); if($bor_messages_loop){ $template->param(flagged => 1 ); } -# Computes full borrower address -my (undef, $roadttype_hashref) = &GetRoadTypes(); -my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'}; - my $fast_cataloging = 0; if (defined getframeworkinfo('FA')) { $fast_cataloging = 1 @@ -635,9 +631,7 @@ $template->param( surname => $borrower->{'surname'}, dateexpiry => format_date($newexpiry), expiry => format_date($borrower->{'dateexpiry'}), - categorycode => $borrower->{'categorycode'}, categoryname => $borrower->{description}, - address => $address, address2 => $borrower->{'address2'}, email => $borrower->{'email'}, emailpro => $borrower->{'emailpro'}, @@ -646,7 +640,6 @@ $template->param( zipcode => $borrower->{'zipcode'}, country => $borrower->{'country'}, phone => $borrower->{'phone'} || $borrower->{'mobile'}, - cardnumber => $borrower->{'cardnumber'}, amountold => $amountold, barcode => $barcode, stickyduedate => $stickyduedate, @@ -666,6 +659,8 @@ $template->param( fast_cataloging => $fast_cataloging, ); +SetMemberInfosInTemplate($borrowernumber, $template); + # save stickyduedate to session if ($stickyduedate) { $session->param( 'stickyduedate', $duedatespec ); diff --git a/installer/data/mysql/atomicupdate/0009-patron-attr-display-checkout.pl b/installer/data/mysql/atomicupdate/0009-patron-attr-display-checkout.pl new file mode 100644 index 0000000..44cfcfa --- /dev/null +++ b/installer/data/mysql/atomicupdate/0009-patron-attr-display-checkout.pl @@ -0,0 +1,7 @@ +#! /usr/bin/perl +use strict; +use warnings; +use C4::Context; +my $dbh=C4::Context->dbh; +$dbh->do("ALTER TABLE borrower_attribute_types ADD COLUMN `display_checkout` TINYINT(1) NOT NULL DEFAULT '0';"); +print "Upgrade done (Added a display_checkout field in borrower_attribute_types table)\n"; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index a62e07c..ec0b587 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -281,6 +281,7 @@ CREATE TABLE `borrower_attribute_types` ( `password_allowed` tinyint(1) NOT NULL default 0, `staff_searchable` tinyint(1) NOT NULL default 0, `authorised_value_category` varchar(10) default NULL, + `display_checkout` tinyint(1) NOT NULL default 0, PRIMARY KEY (`code`), KEY `auth_val_cat_idx` (`authorised_value_category`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 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 49ed8c3..98066cd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -1924,6 +1924,38 @@ ul.budget_hierarchy li:last-child:after { ul.budget_hierarchy li:first-child:after { content: ""; } +#cartmenulink img { + background-image : none; + display : inline; + padding : 3px 6px 0 0; +} + +* html #cartmenulink { + border : 1px solid #336600; +} + +* html #listsmenulink { + border : 1px solid #006699; +} + +#collapsedaddress { + border: solid 1px #eee; + margin-right: 10px; + overflow: hidden; +} +#toggleaddress { + display: block; + padding: 2px 2px 2px 12px; + margin-right: 10px; + cursor: pointer; +} +.toggleaddress { + background: #eee url(../../img/more-right-arrow.gif) 0 50% no-repeat; +} +.toggleaddress2 { + 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 56dd2f2..28c0841 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -4,6 +4,19 @@ +
      @@ -12,46 +25,64 @@
    • <!-- TMPL_VAR name= ()" border="0" style="margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC;" />
    • -
    • - - - No address stored. -
    • - -
    • -
    • - - - - , - - No city stored. -
    • -
    • - - - - - - - - - No phone stored. - - -
    • - - - - - - -
    • No email stored.
    • - - -
    • Category: ()
    • -
    • Home Library:
    • -
    +
  • ()
  • +
  • + + + + : + + + +
  • +
    +

    + + + + No address stored. + + + + + + + + , + + No city stored. + +

    +

    + + + + + + + + + + No phone stored. + + + +

    + + " title=""> + + + " title=""> + + No email stored. + + +

    +
    + View/Hide address +
  • + +