From hector.hecaxmmx at gmail.com Mon Feb 2 22:44:38 2015 From: hector.hecaxmmx at gmail.com (Hector Castro) Date: Mon, 2 Feb 2015 15:44:38 -0600 Subject: [Koha-patches] Bug 13642 [ENH] Adding new features for Dublin Core metadata Message-ID: -- Atte, H?ctor Eduardo Castro Avalos -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0003-Bug-13642-ENH-Adding-new-features-for-Dublin-Core-me.patch Type: text/x-patch Size: 33997 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0004-Bug-13642-ENH-Adding-new-features-for-Dublin-Core-me.patch Type: text/x-patch Size: 5825 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0005-Bug-13642-ENH-Adding-new-features-for-Dublin-Core-me.patch Type: text/x-patch Size: 3249 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0006-Bug-13642-ENH-Adding-new-features-for-Dublin-Core-me.patch Type: text/x-patch Size: 4134 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0007-Bug-13642-ENH-Adding-new-features-for-Dublin-Core-me.patch Type: text/x-patch Size: 5616 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0008-Bug-13642-ENH-Adding-new-features-for-Dublin-Core-me.patch Type: text/x-patch Size: 2520 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0009-Bug-13642-ENH-Adding-new-features-for-Dublin-Core-me.patch Type: text/x-patch Size: 7863 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0010-Bug-13642-ENH-Adding-new-features-for-Dublin-Core-me.patch Type: text/x-patch Size: 1838 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0011-Bug-13642-ENH-Adding-new-features-for-Dublin-Core-me.patch Type: text/x-patch Size: 2849 bytes Desc: not available URL: From tomascohen at gmail.com Thu Feb 5 18:38:55 2015 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Thu, 5 Feb 2015 14:38:55 -0300 Subject: [Koha-patches] [PATCH] Bug 13486: Apache version empty in about page if Apache 2.4 Message-ID: <1423157935-13228-1-git-send-email-tomascohen@gmail.com> This patch makes about.pl query the running Apache version using the apache2ctl command. I tested it on Apache 2.2 and is backwards compatible (it is present in both). To test: ( On an Apache 2.4 setup ) - Go to the about page => FAIL: "Apache version:" is empty - Apply the patch - Reload the page => SUCCESS: "Apache version:" shows the correct version. - Sign off :-D If you have an Apache 2.2 setup to try it, verify that there are no regressions (trivial because you can run apache2ctl manually and verify the first result is the expecte). Regards PS. I even changed the order in which Apache version is tested because most people is using Debian/Ubuntu and it was the last option. --- about.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/about.pl b/about.pl index 9fd1545..57a6f53 100755 --- a/about.pl +++ b/about.pl @@ -55,9 +55,10 @@ if ($^O ne 'VMS') { } my $perlVersion = $]; my $mysqlVersion = `mysql -V`; -my $apacheVersion = `httpd -v 2> /dev/null`; -$apacheVersion = `httpd2 -v 2> /dev/null` unless $apacheVersion; -$apacheVersion = (`/usr/sbin/apache2 -V`)[0] unless $apacheVersion; +# Get Apache version +my $apacheVersion = (`/usr/sbin/apache2ctl -V`)[0]; +$apacheVersion = `httpd2 -v 2> /dev/null` unless $apacheVersion; +$apacheVersion = `httpd -v 2> /dev/null` unless $apacheVersion; my $zebraVersion = `zebraidx -V`; # Additional system information for warnings -- 1.9.1 From nengard at bywatersolutions.com Mon Feb 9 18:43:59 2015 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Mon, 9 Feb 2015 11:43:59 -0600 Subject: [Koha-patches] [PATCH 1/2] Bug 12543 - Add userid as matchpoint for "Import patrons" tool Message-ID: <1423503840-2235-1-git-send-email-nengard@bywatersolutions.com> From: Winona Salesky The a patron's userid should be a matchpoint in the same manner as cardnumber. Though not enforced as a unique key by the database yet ( pending bug 1861 ), this field is effectively unique as uniqueness is enforced by Koha itself. Test Plan: 1) Apply this patch 2) Browse to tools/import_borrowers.pl 3) Download the starter CSV file 4) Edit the csv file to include 1 or more patrons * Make sure to leave the borrowernumber field empty * Make sure the userid field matches the patrons you wish to overwrite 5) From import_borrowers.pl, upload your file * Set "Field to use for record matching" to "Username" * Set "If matching record is already in the borrowers table" to "Overwrite the existing one with this" 6) Click "Import" 7) Verify the patrons in your file have been updated in Koha Signed-off-by: Frederic Demians Do exactly what's announced. This may help. Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/tools/import_borrowers.tt | 1 + tools/import_borrowers.pl | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt index d3bcf5c..f8d9303 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt @@ -114,6 +114,7 @@
  • > > + > [% FOREACH matchpoint IN matchpoints %] > > [% END %] > diff --git a/tools/import_borrowers.pl b/tools/import_borrowers.pl > index 3b557f0..bad2475 100755 > --- a/tools/import_borrowers.pl > +++ b/tools/import_borrowers.pl > @@ -229,6 +229,11 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) { > if ($member) { > $borrowernumber = $member->{'borrowernumber'}; > } > + } elsif ( ($matchpoint eq 'userid') && ($borrower{'userid'}) ) { > + $member = GetMember( 'userid' => $borrower{'userid'} ); > + if ($member) { > + $borrowernumber = $member->{'borrowernumber'}; > + } > } elsif ($extended) { > if (defined($matchpoint_attr_type)) { > foreach my $attr (@$patron_attributes) { > -- > 1.7.2.3 > > _______________________________________________ > Koha-patches mailing list > Koha-patches at lists.koha-community.org > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > website : http://www.koha-community.org/ > git : http://git.koha-community.org/ > bugs : http://bugs.koha-community.org/ From tomascohen at gmail.com Wed Feb 11 00:46:30 2015 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Tue, 10 Feb 2015 20:46:30 -0300 Subject: [Koha-patches] [PATCH 1/3] Bug 13695: Add ISBD to OpacExportOptions Message-ID: <1423611992-17907-1-git-send-email-tomascohen@gmail.com> This patch adds 'isbd' as an export option on the system preferences. Note this patch doesn't add the feature. To test: - On master, search for the OpacExportOptions syspref => FAIL: There is no ISBD option. - Apply the patch - Search for the OpacExportOptions syspref => SUCCESS: There is a new ISBD option. Sponsored-by: Orex Digital --- installer/data/mysql/sysprefs.sql | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 9020b4b..1e50c94 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -252,7 +252,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACdefaultSortOrder','dsc','asc|dsc|za|az','Specify the default sort order','Choice'), ('OPACdidyoumean',NULL,NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'), ('OPACDisplay856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','Choice'), -('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris','','Define export options available on OPAC detail page.','multiple'), +('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd','','Define export options available on OPAC detail page.','multiple'), ('OPACFallback', 'prog', 'bootstrap|prog', 'Define the fallback theme for the OPAC interface.', 'Themes'), ('OpacFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','free'), ('OPACFineNoRenewals','100','','Fine limit above which user cannot renew books via OPAC','Integer'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index f0c0951..f04505f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -284,6 +284,7 @@ OPAC: marcstd: Unicode/UTF-8 encoded MARC without local use -9xx, x9x, xx9- fields and subfields mods: MODS ris: RIS + isbd: ISBD - - pref: OpacSeparateHoldings choices: -- 2.3.0 From tomascohen at gmail.com Wed Feb 11 00:46:31 2015 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Tue, 10 Feb 2015 20:46:31 -0300 Subject: [Koha-patches] [PATCH 2/3] Bug 13695: Add ISBD export option to OPAC (detail) In-Reply-To: <1423611992-17907-1-git-send-email-tomascohen@gmail.com> References: <1423611992-17907-1-git-send-email-tomascohen@gmail.com> Message-ID: <1423611992-17907-2-git-send-email-tomascohen@gmail.com> This patch adds the option to export a record (from within the OPAC record detail page) in the ISBD format. To test: - Enable ISBD on the OpacExportOptions syspref - Look for a record on your opac - On the detail page, notice there's a new ISBD option for 'Save record' - Choose ISBD => SUCCESS: a file containing the ISBD format for the record is downloaded Sponsored-by: Orex Digital --- .../opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc | 1 + opac/opac-export.pl | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc index 3efa10c..88640ac 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc @@ -54,6 +54,7 @@ [% CASE 'marcstd' %]MARC (Unicode/UTF-8, Standard) [% CASE 'mods' %]MODS (XML) [% CASE 'ris' %]RIS + [% CASE 'isbd' %]ISBD [% END %]
  • diff --git a/opac/opac-export.pl b/opac/opac-export.pl index 707392f..3d983f9 100755 --- a/opac/opac-export.pl +++ b/opac/opac-export.pl @@ -79,6 +79,10 @@ elsif ($format =~ /marcstd/) { ($error,$marc) = marc2marc($marc, 'marcstd', C4::Context->preference('marcflavour')); $format = 'marcstd'; } +elsif ( $format =~ /isbd/ ) { + $marc = GetISBDView($biblionumber, "opac"); + $format = 'isbd'; +} else { $error= "Format $format is not supported."; } @@ -96,6 +100,13 @@ else { -type => 'application/marc', -charset=>'ISO-2022', -attachment=>"bib-$biblionumber.$format"); + } + elsif ( $format eq 'isbd' ) { + print $query->header( + -type => 'text/plain', + -charset => 'utf-8', + -attachment => "bib-$biblionumber.txt" + ); }else{ print $query->header( -type => 'application/octet-stream', -- 2.3.0 From tomascohen at gmail.com Wed Feb 11 00:46:32 2015 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Tue, 10 Feb 2015 20:46:32 -0300 Subject: [Koha-patches] [PATCH 3/3] Bug 13695: Add ISBD export option for the OPAC cart and lists In-Reply-To: <1423611992-17907-1-git-send-email-tomascohen@gmail.com> References: <1423611992-17907-1-git-send-email-tomascohen@gmail.com> Message-ID: <1423611992-17907-3-git-send-email-tomascohen@gmail.com> This patch adds the option to download records from the cart, and lists in the ISBD format from the OPAC. To test (cart): - Apply the patch - Add several records to your OPAC cart. - Go to your cart, and choose 'Download' => SUCCESS: There's an ISBD option - Dowload and open the exported records => SUCCESS: The file contains the ISBD format for the records on the cart To test (lists): - Add several records to a list (i did it from the cart ;-)) - Open the list - Choose 'Download list' => SUCCESS: There's an ISBD option - Download and open the exported records => SUCCESS: The file contains the ISBD format for the records on the list. - Sign off :-D Sponsored-by: Orex Digital --- .../opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt | 1 + .../opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt | 1 + opac/opac-downloadcart.pl | 16 ++++++++++++---- opac/opac-downloadshelf.pl | 14 +++++++++++--- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt index 8536c46..9f1f65d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt @@ -14,6 +14,7 @@ + [% FOREACH csv_profile IN csv_profiles %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt index 128cec2..a9c53f9 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt @@ -53,6 +53,7 @@ + [% FOREACH csv_profile IN csv_profiles %] diff --git a/opac/opac-downloadcart.pl b/opac/opac-downloadcart.pl index 98a7f3c..5164c2e 100755 --- a/opac/opac-downloadcart.pl +++ b/opac/opac-downloadcart.pl @@ -52,8 +52,10 @@ if ($bib_list && $format) { my @bibs = split( /\//, $bib_list ); - my $marcflavour = C4::Context->preference('marcflavour'); + my $marcflavour = C4::Context->preference('marcflavour'); my $output; + my $extension; + my $type; # CSV if ($format =~ /^\d+$/) { @@ -76,6 +78,11 @@ if ($bib_list && $format) { elsif ($format eq 'bibtex') { $output .= marc2bibtex($record, $biblio); } + elsif ( $format eq 'isbd' ) { + $output .= GetISBDView($biblio, "opac"); + $extension = "txt"; + $type = "text/plain"; + } } } @@ -83,9 +90,10 @@ if ($bib_list && $format) { $format = "csv" if ($format =~ m/^\d+$/); print $query->header( - -type => 'application/octet-stream', - -'Content-Transfer-Encoding' => 'binary', - -attachment=>"cart.$format"); + -type => ($type) ? $type : 'application/octet-stream', + -'Content-Transfer-Encoding' => 'binary', + -attachment => ($extension) ? "cart.$format.$extension" : "cart.$format" + ); print $output; } else { diff --git a/opac/opac-downloadshelf.pl b/opac/opac-downloadshelf.pl index 7a6b1dd..0230eba 100755 --- a/opac/opac-downloadshelf.pl +++ b/opac/opac-downloadshelf.pl @@ -57,6 +57,8 @@ if ( ShelfPossibleAction( (defined($borrowernumber) ? $borrowernumber : -1), $sh my ($items, $totitems) = GetShelfContents($shelfid); my $marcflavour = C4::Context->preference('marcflavour'); my $output; + my $extension; + my $type; # CSV if ($format =~ /^\d+$/) { @@ -83,6 +85,11 @@ if ( ShelfPossibleAction( (defined($borrowernumber) ? $borrowernumber : -1), $sh elsif ($format eq 'bibtex') { $output .= marc2bibtex($record, $biblionumber); } + elsif ( $format eq 'isbd' ) { + $output .= GetISBDView($biblionumber, "opac"); + $extension = "txt"; + $type = "text/plain"; + } } } @@ -90,9 +97,10 @@ if ( ShelfPossibleAction( (defined($borrowernumber) ? $borrowernumber : -1), $sh $format = "csv" if ($format =~ m/^\d+$/); print $query->header( - -type => 'application/octet-stream', - -'Content-Transfer-Encoding' => 'binary', - -attachment=>"shelf.$format"); + -type => ($type) ? $type : 'application/octet-stream', + -'Content-Transfer-Encoding' => 'binary', + -attachment => ($extension) ? "shelf.$format.$extension" : "shelf.$format" + ); print $output; } else { -- 2.3.0 From christophe.croullebois at biblibre.com Wed Feb 11 14:50:40 2015 From: christophe.croullebois at biblibre.com (Christophe Croullebois) Date: Wed, 11 Feb 2015 14:50:40 +0100 Subject: [Koha-patches] [PATCH] Bug 13697 : Option to do not add a fee, if the patron changes to a category with enrolment fee Message-ID: <1423662640-6907-1-git-send-email-christophe.croullebois@biblibre.com> --- C4/Members.pm | 2 ++ installer/data/mysql/updatedatabase.pl | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/C4/Members.pm b/C4/Members.pm index 6f95b94..1cec21f 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -811,7 +811,9 @@ sub ModMember { # If the patron changes to a category with enrollment fee, we add a fee if ( $data{categorycode} and $data{categorycode} ne $old_categorycode ) { + if (C4::Context->preference('FeeOnChangePatronCategory') == 0){ AddEnrolmentFeeIfNeeded( $data{categorycode}, $data{borrowernumber} ); + } } # If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index dab1c62..654fad1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9759,6 +9759,13 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.19.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FeeOnChangePatronCategory','0','If set, when the patron changes to a category with enrolment fee, a fee is not added','','YesNo')"); + print "Upgrade to $DBversion done (Bug 13697 - Option to don't add a fee, if the patron changes to a category with enrolment fee)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) -- 1.7.9.5 From dpavlin at rot13.org Fri Feb 13 15:42:21 2015 From: dpavlin at rot13.org (Dobrica Pavlinusic) Date: Fri, 13 Feb 2015 15:42:21 +0100 Subject: [Koha-patches] [PATCH] Bug 13709 - Patron cards creator utf-8 encoding and ttf fonts broken Message-ID: <1423838541-24556-1-git-send-email-dpavlin@rot13.org> This change is similar to Bug 8375 which introduced ttf fonts for labels printing in order to support diacritics and utf-8 encoding, but this change was never implemented for patron cards. Test scenario: 1. make sure that you have font mapping in koha-conf.xml 2. define partron card layout, template, profile and batch (with utf-8 chars, probably in patron firstname or surname) 3. verify that without this patch pdf export file is error message Wide character in compress at /usr/share/perl5/PDF/Reuse.pm line 820 4. apply this patch and verify that generated pdf has correct encoding --- C4/Patroncards/Patroncard.pm | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/C4/Patroncards/Patroncard.pm b/C4/Patroncards/Patroncard.pm index 339b969..f130a04 100644 --- a/C4/Patroncards/Patroncard.pm +++ b/C4/Patroncards/Patroncard.pm @@ -173,13 +173,10 @@ sub draw_text { } box ($origin_llx, $box_lly, $self->{'width'} - $text_attribs->{'llx'}, $box_height, $pdf); } -# my $font_resource = $pdf->TTFont("/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf"); -# $pdf->FontSize($text_attribs->{'font_size'}); - my $font_resource = $pdf->Font($text_attribs->{'font'}); + $pdf->Font($text_attribs->{'font'}); + $pdf->FontSize($text_attribs->{'font_size'}); foreach my $line (@lines) { -# $pdf->Text($line->{'Tx'}, $line->{'Ty'}, $line->{'line'}); - my $text_line = "BT /$font_resource $text_attribs->{'font_size'} Tf $line->{'Tx'} $line->{'Ty'} Td $line->{'Tw'} Tw ($line->{'line'}) Tj ET"; - $pdf->Add($text_line); + $pdf->Text($line->{'Tx'}, $line->{'Ty'}, $line->{'line'}); } } } -- 1.7.2.5 From christophe.croullebois at biblibre.com Fri Feb 27 12:51:34 2015 From: christophe.croullebois at biblibre.com (Christophe Croullebois) Date: Fri, 27 Feb 2015 12:51:34 +0100 Subject: [Koha-patches] [PATCH 1/1] Bug 13697 : Syspref to not add a fee when a patron changes to a category with enrolment fee Message-ID: <1425037894-17547-1-git-send-email-christophe.croullebois@biblibre.com> By default this syspref is "Do" to keep the previous behaviour. Test plan : 1/ create 2 categories (A & B). B with enrolment fee 2/ create a patron in category A 3/ change the patron category from A to B 4/ check that the patron has an enrolment fee to pay Apply the patch 1/ create a new patron in category A 2/ change the patron category from A to B. 3/ check that the patron has an enrolment fee to pay 4/ change the system preference 'FeeOnChangePatronCategory' to 'Don't'; 5/ create a new patron in category A 6/ change the patron category from A to B 7/ check that the patron has no enrolment fee to pay --- C4/Members.pm | 4 +++- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 10 ++++++++++ .../prog/en/modules/admin/preferences/patrons.pref | 6 ++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/C4/Members.pm b/C4/Members.pm index 4fb845d..efbbff3 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -811,7 +811,9 @@ sub ModMember { # If the patron changes to a category with enrollment fee, we add a fee if ( $data{categorycode} and $data{categorycode} ne $old_categorycode ) { - AddEnrolmentFeeIfNeeded( $data{categorycode}, $data{borrowernumber} ); + if ( C4::Context->preference('FeeOnChangePatronCategory') ) { + AddEnrolmentFeeIfNeeded( $data{categorycode}, $data{borrowernumber} ); + } } # If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 9020b4b..be5d0e1 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -124,6 +124,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ExtendedPatronAttributes','0',NULL,'Use extended patron IDs and attributes','YesNo'), ('FacetLabelTruncationLength','20',NULL,'Specify the facet max length in OPAC','Integer'), ('FacetMaxCount','20',NULL,'Specify the max facet count for each category','Integer'), +('FeeOnChangePatronCategory','1','','If set, when a patron changes to a category with enrolment fee, a fee is added','YesNo') ('FilterBeforeOverdueReport','0','','Do not run overdue report until filter selected','YesNo'), ('FineNotifyAtCheckin','0',NULL,'If ON notify librarians of overdue fines on the items they are checking in.','YesNo'), ('finesCalendar','noFinesWhenClosed','ignoreCalendar|noFinesWhenClosed','Specify whether to use the Calendar in calculating duedates and fines','Choice'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 0ed56c6..6fbbb4e 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9793,6 +9793,16 @@ if(CheckVersion($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.19.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + INSERT INTO `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) + VALUES ('FeeOnChangePatronCategory','1','','If set, when a patron changes to a category with enrolment fee, a fee is added','YesNo') + }); + print "Upgrade to $DBversion done (Bug 13697 - Option to don't add a fee, if the patron changes to a category with enrolment fee)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index aa567c3..067df44 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -160,3 +160,9 @@ Patrons: yes: Do no: "Don't" - search the Norwegian national patron database after a local search result was found. + - + - pref: FeeOnChangePatronCategory + choices: + yes: Do + no: "Don't" + - add a fee when a patron changes to a category with enrolment fee. -- 1.7.9.5