From ad832702c5e62e90045ec20edab307ce5b2aa923 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 24 May 2017 09:47:34 -0400 Subject: [PATCH] Bug 15494 - Add syspref Content-Type: text/plain; charset=utf-8 Signed-off-by: Marcel de Rooy --- installer/data/mysql/atomicupdate/bug_15494.perl | 16 ++++++++++++++++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/circulation.pref | 11 +++++++++++ 3 files changed, 28 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_15494.perl diff --git a/installer/data/mysql/atomicupdate/bug_15494.perl b/installer/data/mysql/atomicupdate/bug_15494.perl new file mode 100644 index 0000000..fbc7f3c --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_15494.perl @@ -0,0 +1,16 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + # you can use $dbh here like: + # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" ); + + $dbh->do( "INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('ItemsDeniedRenewal','','','This syspref allows to define custom rules for denying renewal of specific items.','Textarea')" ); + + # or perform some test and warn + # if( !column_exists( 'biblio', 'biblionumber' ) ) { + # warn "There is something wrong"; + # } + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 15494 - Block renewals by arbitrary item values)\n"; +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 68881d0..14f887e 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -236,6 +236,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('itemBarcodeFallbackSearch','',NULL,'If set, uses scanned item barcodes as a catalogue search if not found as barcodes','YesNo'), ('itemBarcodeInputFilter','','whitespace|T-prefix|cuecat|libsuite8|EAN13','If set, allows specification of a item barcode input filter','Choice'), ('itemcallnumber','082ab',NULL,'The MARC field/subfield that is used to calculate the itemcallnumber (Dewey would be 082ab or 092ab; LOC would be 050ab or 090ab) could be 852hi from an item record','free'), +('ItemsDeniedRenewal','','','This syspref allows to define custom rules for denying renewal of specific items.','Textarea'), ('KohaAdminEmailAddress','root@localhost','','Define the email address where patron modification requests are sent','free'), ('LabelMARCView','standard','standard|economical','Define how a MARC record will display','Choice'), ('language','en',NULL,'Set the default language in the staff client.','Languages'), 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 6589e3e..74f815a 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 @@ -465,6 +465,17 @@ Circulation: yes: Block no: Allow - his/her auto renewals. + - + - pref: ItemsDeniedRenewal + type: textarea + class: code + - Define custom rules to deny specific items from renewal. + - "
Can name any field in the items table followed by a colon then a space then" + - "a bracketed list of values separated by commas." + - "e.g." + - "
ccode: [NEWFIC,NULL,DVD]" + - "
itype: [NEWBK,\"\"]" + - "
Note: the word 'NULL' can be used to block renewal on undefined fields, while an empty string \"\" will block on an empty (but defined) field." Checkin Policy: - - pref: BlockReturnOfWithdrawnItems -- 2.1.4