Bugzilla – Attachment 57300 Details for
Bug 17578
Replace GetMemberDetails with GetMember
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17578: GetMemberDetails - Remove BlockExpiredPatronOpacActions
Bug-17578-GetMemberDetails---Remove-BlockExpiredPa.patch (text/plain), 7.61 KB, created by
Jonathan Druart
on 2016-11-08 11:16:35 UTC
(
hide
)
Description:
Bug 17578: GetMemberDetails - Remove BlockExpiredPatronOpacActions
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-11-08 11:16:35 UTC
Size:
7.61 KB
patch
obsolete
>From aac8ff3387c8a4ceba1e10f474791c69bef54b9c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 7 Nov 2016 15:53:25 +0000 >Subject: [PATCH] Bug 17578: GetMemberDetails - Remove > BlockExpiredPatronOpacActions > >The correct way to get the value of BlockExpiredPatronOpacActions from a >patron object is to get the patron category then call the >effective_BlockExpiredPatronOpacActions: > $patron->category->effective_BlockExpiredPatronOpacActions > >So this patch applies this change and remove this value from the >GetMemberDetails subroutine. >--- > C4/Members.pm | 7 ------- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 10 +++++----- > opac/opac-renew.pl | 4 +++- > opac/opac-reserve.pl | 3 ++- > 4 files changed, 10 insertions(+), 14 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index eecb653..37d641d 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -167,7 +167,6 @@ sub GetMemberDetails { > SELECT borrowers.*, > category_type, > categories.description, >- categories.BlockExpiredPatronOpacActions, > reservefee, > enrolmentperiod > FROM borrowers >@@ -181,7 +180,6 @@ sub GetMemberDetails { > SELECT borrowers.*, > category_type, > categories.description, >- categories.BlockExpiredPatronOpacActions, > reservefee, > enrolmentperiod > FROM borrowers >@@ -211,11 +209,6 @@ sub GetMemberDetails { > $borrower->{'flags'} = $flags; > $borrower->{'authflags'} = $accessflagshash; > >- # Handle setting the true behavior for BlockExpiredPatronOpacActions >- $borrower->{'BlockExpiredPatronOpacActions'} = >- C4::Context->preference('BlockExpiredPatronOpacActions') >- if ( $borrower->{'BlockExpiredPatronOpacActions'} == -1 ); >- > $borrower->{'is_expired'} = 0; > $borrower->{'is_expired'} = 1 if > defined($borrower->{dateexpiry}) && >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index 5cb3239..47f3b4d6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -156,7 +156,7 @@ Using this account is not recommended because some parts of Koha will not functi > <th>Barcode</th> > [% END %] > <th>Call no.</th> >- [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %] >+ [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.category.effective_BlockExpiredPatronOpacActions ) ) %] > <th class="nosort">Renew</th> > [% END %] > [% IF ( OPACFinesTab ) %] >@@ -245,7 +245,7 @@ Using this account is not recommended because some parts of Koha will not functi > <span class="tdlabel">Call no.:</span> > [% ISSUE.itemcallnumber %] > </td> >- [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %] >+ [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.category.effective_BlockExpiredPatronOpacActions ) ) %] > <td class="renew"> > [% IF ISSUE.renewed %]<span class="blabel label-success">Renewed!</span><br />[% END %] > [% IF ( ISSUE.status ) %] >@@ -287,12 +287,12 @@ Using this account is not recommended because some parts of Koha will not functi > [% END # /FOREACH ISSUES %] > </tbody> > </table> >- [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %] >+ [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.category.effective_BlockExpiredPatronOpacActions ) ) %] > <input type="submit" class="btn" value="Renew selected" /> > [% END %] > </form> > >- [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %] >+ [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.category.effective_BlockExpiredPatronOpacActions ) ) %] > <form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post"> > <input type="hidden" name="from" value="opac_user" /> > <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >@@ -878,7 +878,7 @@ Using this account is not recommended because some parts of Koha will not functi > e.preventDefault(); > $("#renewall").submit(); > }); >- [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %] >+ [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.category.effective_BlockExpiredPatronOpacActions ) ) %] > $("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a> <a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a></div>"); > [% END %] > [% END %] >diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl >index 9da82e5..b1dcf57 100755 >--- a/opac/opac-renew.pl >+++ b/opac/opac-renew.pl >@@ -30,6 +30,7 @@ use C4::Auth; > use C4::Context; > use C4::Items; > use C4::Members; >+use Koha::Patrons; > use Date::Calc qw( Today Date_to_Days ); > my $query = new CGI; > >@@ -49,9 +50,10 @@ my $opacrenew = C4::Context->preference("OpacRenewalAllowed"); > my $errorstring = q{}; > my $renewed = q{}; > >+my $patron = Koha::Patrons->find( $borrowernumber ); > my $member_details = GetMemberDetails($borrowernumber); > >-if ( $member_details->{'BlockExpiredPatronOpacActions'} >+if ( $patron->category->effective_BlockExpiredPatronOpacActions > && $member_details->{'is_expired'} ) > { > $errorstring = 'card_expired'; >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index d02e96c..42ee598 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -71,9 +71,10 @@ sub get_out { > > # get borrower information .... > my ( $borr ) = GetMemberDetails( $borrowernumber ); >+my $patron = Koha::Patrons->find( $borrowernumber ); > > # check if this user can place a reserve, -1 means use sys pref, 0 means dont block, 1 means block >-if ( $borr->{'BlockExpiredPatronOpacActions'} ) { >+if ( $patron->category->effective_BlockExpiredPatronOpacActions ) { > > if ( $borr->{'is_expired'} ) { > >-- >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 17578
:
57299
|
57300
|
57301
|
57302
|
57303
|
57304
|
57305
|
57306
|
57307
|
57308
|
57322
|
57323
|
57324
|
57325
|
57326
|
57793
|
57794
|
57795
|
57796
|
57797
|
57798
|
57799
|
57800
|
57801
|
57808
|
57817
|
57818
|
57819
|
57820
|
57821
|
57822
|
57823
|
57824
|
57825
|
57826
|
57972
|
57973
|
57974
|
57975
|
57976
|
57977
|
57978
|
57979
|
57980
|
57981
|
57982
|
57983
|
57984