Bugzilla – Attachment 21109 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-AllowSelfCheckRetu.patch (text/plain), 9.13 KB, created by
Mason James
on 2013-09-16 01:42:12 UTC
(
hide
)
Description:
Bug 10554 - Add more options to 'AllowSelfCheckReturns' syspref
Filename:
MIME Type:
Creator:
Mason James
Created:
2013-09-16 01:42:12 UTC
Size:
9.13 KB
patch
obsolete
>From edcc519d6b6a8bbb08a4a40e0ab88828e4ab8010 Mon Sep 17 00:00:00 2001 >From: Mason James <mtj@kohaaloha.com> >Date: Tue, 9 Jul 2013 13:48:08 +1200 >Subject: [PATCH] Bug 10554 - Add more options to 'AllowSelfCheckReturns' > syspref >Content-Type: text/plain; charset="utf-8" > >This patch modifies the options of AllowSelfCheckReturns syspref > >from a 2 option selection > - 'allow patrons', dont allow patrons' > >to a 3 option selection > - 'allow all patrons', 'allow non-blocked patrons' , allow no patrons' > >currently, a problem with the syspref behavior in Koha is that enabling the 'AllowSelfCheckReturns' syspref does *not* allow patrons with a 'block' to return items via the SCO. (this is apparently by design, and not a bug) > >however, some libraries do want to allow patrons to return items via the SCO even if they have a 'block' > >this patch adds this additional behavior, by adding a new option to the syspref, but also retaining the existing syspref behavior > >after the patch, there are 2 allow options > - 'Allow all' allows all patrons to return items (including blocked patrons) > - 'Allow non-blocked' allows only non-blocked patrons to return items > (note: this is the current 'allow' behavior) > >the patch correctly 'upgrades' existing 'allow' selection to the new 'Allow non-blocked' value. so, any existing 'allow' selection works as before > >---------- > >to test these 3 syspref options... > >1/ >- set syspref to 'dont allow' >- issue an item to a patron >- attempt to return item via SCO, return should FAIL > >2/ >- set syspref to 'allow all' >- issue an item to a patron >- attempt to return item via SCO, return should SUCCEED > >3/ >- set syspref to 'allow nonblocked' >- issue an item to a patron >- attempt to return item via SCO, return should SUCCEED > >- issue an item to a patron, with a returndate of '2001-01-01' >(important: this will create an overdue item, that will put a 'block' on this patron's account) >- attempt to return item via SCO, return should FAIL > >http://bugs.koha-community.org/show_bug.cgi?id=10544 >--- > installer/data/mysql/sysprefs.sql | 4 +++- > installer/data/mysql/updatedatabase.pl | 25 ++++++++++++++++++++ > .../en/modules/admin/preferences/circulation.pref | 5 ++-- > .../opac-tmpl/prog/en/modules/sco/sco-main.tt | 6 ++--- > opac/sco/sco-main.pl | 5 ++-- > 5 files changed, 36 insertions(+), 9 deletions(-) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index e8ca401..d1f64e7 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -22,7 +22,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('AllowPurchaseSuggestionBranchChoice','0','1','Allow user to choose branch when making a purchase suggestion','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'), >@@ -417,3 +417,5 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), > ('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') > ; >+ >+installer/data/mysql/sysprefs.sql >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index ddcc455..70ab617 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7104,6 +7104,31 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.13.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ >+ #get current value >+ my $sth = $dbh->prepare("SELECT * from systempreferences where variable = 'AllowSelfCheckReturns'"); >+ $sth->execute; >+ my $row = $sth->fetchrow_hashref; >+ my $val = $row->{value}; >+ my $newval; >+ >+ if ($val =~ /1/ ) { >+ $newval = 'nonblocked'; >+ } else { >+ $newval = '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 (added 'nonblocked' to AllowSelfCheckReturns syspref)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($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 026b7fa..525a50b 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 >@@ -544,8 +544,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/prog/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt >index 3803368..e374404 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt >@@ -140,8 +140,7 @@ $(document).ready(function() { > [% END %] > Please see a member of the library staff. > </p> >-[% IF ( returnitem ) %] >-[% IF ( 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 %]" /> >@@ -149,7 +148,6 @@ $(document).ready(function() { > <input type="submit" name="returnbook" value="Return this item" class="return" /> > </form> > [% END %] >-[% END %] > <form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post"> > <input type="hidden" name="op" value="" /> > <input type="hidden" name="patronid" value="[% patronid %]" /> >@@ -162,7 +160,7 @@ $(document).ready(function() { > <p>[% IF ( confirm_renew_issue ) %]This item is already checked out to you.[% END %]</p> > > [% IF ( renew ) %] >-[% IF ( AllowSelfCheckReturns ) %] >+[% 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 %]" /> >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index 0f16c8c..a897ea2 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -83,7 +83,7 @@ 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'); > } >@@ -120,7 +120,7 @@ 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); >@@ -152,6 +152,7 @@ elsif ( $op eq "checkout" ) { > "circ_error_$issue_error" => 1, > title => $item->{title}, > hide_main => 1, >+ barcode => $barcode, > ); > if ($issue_error eq 'DEBT') { > $template->param(amount => C4::Budgets->GetCurrency()->{symbol}.$impossible->{DEBT}); >-- >1.7.10.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