Bugzilla – Attachment 42272 Details for
Bug 10554
Add more options to 'AllowSelfCheckReturns' syspref
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10554: Add more options to 'AllowSelfCheckReturns' syspref
Bug-10554-Add-more-options-to-AllowSelfCheckReturn.patch (text/plain), 7.33 KB, created by
Mason James
on 2015-09-03 07:55:30 UTC
(
hide
)
Description:
Bug 10554: Add more options to 'AllowSelfCheckReturns' syspref
Filename:
MIME Type:
Creator:
Mason James
Created:
2015-09-03 07:55:30 UTC
Size:
7.33 KB
patch
obsolete
>From 35d75ca5e546ae639c5ae572117c0a185a834927 Mon Sep 17 00:00:00 2001 >From: Mason James <mtj@kohaaloha.com> >Date: Fri, 5 Jun 2015 00:14:32 +1200 >Subject: [PATCH] Bug 10554: Add more options to 'AllowSelfCheckReturns' > syspref >Content-Type: text/plain; charset="utf-8" > >--- > installer/data/mysql/atomicupdate/bug_10554.perl | 33 ++++++++++++++++++++++ > installer/data/mysql/sysprefs.sql | 2 +- > .../en/modules/admin/preferences/circulation.pref | 5 ++-- > .../opac-tmpl/bootstrap/en/modules/sco/sco-main.tt | 8 ++++-- > opac/sco/sco-main.pl | 7 +++-- > 5 files changed, 48 insertions(+), 7 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_10554.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_10554.perl b/installer/data/mysql/atomicupdate/bug_10554.perl >new file mode 100755 >index 0000000..339fa6b >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_10554.perl >@@ -0,0 +1,33 @@ >+#!/usr/bin/perl >+ >+use strict; >+use warnings; >+use C4::Context; >+ >+my $dbh = C4::Context->dbh; >+ >+my $DBversion = "XXX"; >+ >+#if ( CheckVersion($DBversion) ) { >+ >+#get current value >+my $newval = 0; >+my $oldval = $dbh->selectcol_arrayref( >+"SELECT value from systempreferences where variable = 'AllowSelfCheckReturns'" >+); >+ >+$newval = ($oldval->[0] =~ /1/ ? 'nonblocked' : 'none'); >+ >+# update syspref >+my $sth_update = $dbh->prepare( >+ "UPDATE systempreferences >+ SET value=?, options='all|nonblocked|none', type='Choice' WHERE variable='AllowSelfCheckReturns'" >+); >+$sth_update->execute($newval); >+ >+print >+"Upgrade to $DBversion done (BZ-10544 added 'nonblocked' to AllowSelfCheckReturns syspref)\n"; >+ >+# SetVersion($DBversion); >+#} >+ >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 6568967..1f0ba41 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -30,7 +30,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('AllowRenewalIfOtherItemsAvailable','0',NULL,'If enabled, allow a patron to renew an item with unfilled holds if other available items can fill that hold.','YesNo'), > ('AllowRenewalLimitOverride','0',NULL,'if ON, allows renewal limits to be overridden on the circulation screen','YesNo'), > ('AllowReturnToBranch','anywhere','anywhere|homebranch|holdingbranch|homeorholdingbranch','Where an item may be returned','Choice'), >-('AllowSelfCheckReturns','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'), >+('AllowSelfCheckReturns','none','If enabled, patrons may return items through the Web-based Self Checkout','all|nonblocked|none','Choice'); > ('AllowTooManyOverride','1','','If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts','YesNo'), > ('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z',NULL,'Alphabet than can be expanded into browse links, e.g. on Home > Patrons','free'), > ('AlternateHoldingsField','',NULL,'The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).','free'), >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 df72493..666e62d 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 >@@ -657,8 +657,9 @@ Circulation: > - > - pref: AllowSelfCheckReturns > choices: >- yes: Allow >- no: "Don't allow" >+ all: "Allow all" >+ nonblocked: "Allow non-blocked" >+ none: "Don't allow" > - patrons to return items through web-based self checkout system. > - > - "Include the following HTML in the Help page of the web-based self checkout system:" >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >index 3f0b1f3..ac01b53 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >@@ -75,7 +75,8 @@ > Please see a member of the library staff. > </p> > >- [% IF ( returnitem && AllowSelfCheckReturns ) %] >+ [% IF (AllowSelfCheckReturns == 'nonblocked' and returnitem ) or AllowSelfCheckReturns == 'all' %] >+ > <form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post"> > <input type="hidden" name="op" value="returnbook" /> > <input type="hidden" name="patronid" value="[% patronid %]" /> >@@ -99,7 +100,9 @@ > <p>This item is already checked out to you.</p> > [% END %] > >- [% IF ( renew && AllowSelfCheckReturns ) %] >+ [% IF ( renew ) %] >+ [% IF (AllowSelfCheckReturns == 'nonblocked' or AllowSelfCheckReturns == 'all') %] >+ > <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post"> > <input type="hidden" name="op" value="returnbook" /> > <input type="hidden" name="patronid" value="[% patronid %]" /> >@@ -107,6 +110,7 @@ > <input type="hidden" name="confirmed" value="" /> > <button type="submit" name="returnbook" class="btn"><i class="icon return"></i> Return this item</button> > </form> >+ [% END %] > [% END %] > > [% UNLESS ( renew ) %] >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index b214f54..9998db7 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -83,7 +83,8 @@ if (C4::Context->preference('SelfCheckTimeout')) { > $template->param(SelfCheckTimeout => $selfchecktimeout); > > # Checks policy laid out by AllowSelfCheckReturns, defaults to 'on' if preference is undefined >-my $allowselfcheckreturns = 1; >+my $allowselfcheckreturns = 'nonblocked'; >+ > if (defined C4::Context->preference('AllowSelfCheckReturns')) { > $allowselfcheckreturns = C4::Context->preference('AllowSelfCheckReturns'); > } >@@ -124,7 +125,8 @@ my $return_only = 0; > if ($op eq "logout") { > $query->param( patronid => undef, patronlogin => undef, patronpw => undef ); > } >-elsif ( $op eq "returnbook" && $allowselfcheckreturns ) { >+elsif ( $op eq "returnbook" && $allowselfcheckreturns =~ /nonblocked|all/) { >+ > my ($doreturn) = AddReturn( $barcode, $branch ); > #warn "returnbook: " . $doreturn; > $borrower = GetMemberDetails(undef,$patronid); >@@ -180,6 +182,7 @@ elsif ( $op eq "checkout" ) { > confirm => 1, > confirm_renew_issue => 1, > hide_main => 1, >+ barcode => $barcode, > ); > } > } elsif ( $confirm_required && !$confirmed ) { >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10554
:
19495
|
21109
|
21221
|
28618
|
42267
| 42272