Bugzilla – Attachment 90094 Details for
Bug 20691
Add ability for guarantors to view guarantee's fines in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20691: Add ability to turn feature on and off
Bug-20691-Add-ability-to-turn-feature-on-and-off.patch (text/plain), 26.21 KB, created by
Agustín Moyano
on 2019-05-24 23:42:38 UTC
(
hide
)
Description:
Bug 20691: Add ability to turn feature on and off
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2019-05-24 23:42:38 UTC
Size:
26.21 KB
patch
obsolete
>From c3e36ebd1c0aeb815b2892d89e1a80aaa86623a0 Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Wed, 22 May 2019 02:41:24 -0300 >Subject: [PATCH] Bug 20691: Add ability to turn feature on and off > >This patch adds two preferences >1. AllowPatronToSetFinesVisibilityForGuarantor: Allow/Don't allow patrons to choose their own privacy settings for showing the patron's fines to the patron's guarantor >2. AllowStaffToSetFinesVisibilityForGuarantor: Allow/Don't allow staff to set the ability for a patron's fines to be viewed by linked patrons in the OPAC > >Also adds a tinyint, non nullable, default to 0 column in borrower and deletedborrower named privacy_guarantor_fines. >1. privacy_guarantor_fines = 0 => don't allow guarantor to see guarantee's fines >2. privacy_guarantor_fines = 1 => allow guarantor to see guarantee's fines > >To test: >1) git reset --hard master >2) apply patches (including dependencies) >3) perl installer/data/mysql/updatedatabase.pl >4) dbic >5) restart_all >6) in intranet search for AllowPatronToSetFinesVisibilityForGuarantor and AllowStaffToSetFinesVisibilityForGuarantor preferences >SUCCESS => both preferences should be present >7) search for a patron with guarantor >SUCCESS => in details tab, in "Library use" section you should see a row labeled "Show fines to guarantor" >8) edit >CHECK => in Guarantor information there is no "Show fines to guarantor" select >9) set AllowStaffToSetFinesVisibilityForGuarantor preference to "Allow" >10) return to patron with guarantor and edit >SUCCESS => in Guarantor information section there is a "Show fines to guarantor" select >11) change "Show fines to guarantor" select to "Yes" and save >SUCCESS => Value is saved >12) go to details tab >SUCCESS => in "Library use" section you see a row labeled "Show fines to guarantor" with value "Yes" >13) set OPACPrivacy preference to "Allow" >14) open 2 opacs, one with a patron that has a guarantor and another that hasn't and go to "your privacy" tab. >CHECK => in both opacs you should not see a "Allow your guarantor to view your current fines?" select >15) in intranet set AllowPatronToSetFinesVisibilityForGuarantor to "Allow" >16) refresh both opacs >SUCCESS => in Patron that has guarantor you see a "Allow your guarantor to view your current fines?" select > => in Patron without guarantor you don't see a "Allow your guarantor to view your current fines?" select >17) in Patron with guarantor change value of select and save >SUCCESS => Value is saved >18) in intranet set OPACPrivacy preference to "Don't allow" and AllowPatronToSetFinesVisibilityForGuarantor to "Don't allow" >19) got to "your personal details" in both opacs >CHECK => in both opacs you should not see no Privacy section with a "Allow your guarantor to view your current fines?" select >20) in intranet set AllowPatronToSetFinesVisibilityForGuarantor to "Allow" >21) refresh both opacs >SUCCESS => in Patron that has guarantor you see a "Allow your guarantor to view your current fines?" select in a Privacy section > => in Patron without guarantor there is no Privacy section >22) in Patron with guarantor change value of select and update >SUCCESS => Value is saved >23) Sign off >--- > Koha/Schema/Result/Borrower.pm | 12 +++- > Koha/Schema/Result/Deletedborrower.pm | 12 +++- > api/v1/swagger/definitions/patron.json | 4 ++ > .../prog/en/modules/admin/preferences/opac.pref | 7 +++ > .../prog/en/modules/admin/preferences/patrons.pref | 6 ++ > .../prog/en/modules/members/memberentrygen.tt | 15 +++++ > .../prog/en/modules/members/moremember.tt | 11 +++- > .../bootstrap/en/modules/opac-memberentry.tt | 72 +++++++++++++++++----- > .../opac-tmpl/bootstrap/en/modules/opac-privacy.tt | 36 +++++++---- > opac/opac-memberentry.pl | 4 +- > opac/opac-privacy.pl | 5 +- > opac/svc/patron/show_fines_to_relatives | 59 ++++++++++++++++++ > 12 files changed, 210 insertions(+), 33 deletions(-) > create mode 100755 opac/svc/patron/show_fines_to_relatives > >diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm >index 8693d15ea9..335da4c7e9 100644 >--- a/Koha/Schema/Result/Borrower.pm >+++ b/Koha/Schema/Result/Borrower.pm >@@ -402,6 +402,12 @@ __PACKAGE__->table("borrowers"); > default_value: 1 > is_nullable: 0 > >+=head2 privacy_guarantor_fines >+ >+ data_type: 'tinyint' >+ default_value: 0 >+ is_nullable: 0 >+ > =head2 privacy_guarantor_checkouts > > data_type: 'tinyint' >@@ -619,6 +625,8 @@ __PACKAGE__->add_columns( > { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "privacy", > { data_type => "integer", default_value => 1, is_nullable => 0 }, >+ "privacy_guarantor_fines", >+ { data_type => "tinyint", default_value => 0, is_nullable => 0 }, > "privacy_guarantor_checkouts", > { data_type => "tinyint", default_value => 0, is_nullable => 0 }, > "checkprevcheckout", >@@ -1552,8 +1560,8 @@ Composing rels: L</aqorder_users> -> ordernumber > __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); > > >-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-05-17 12:11:31 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rb0wEXHaSvYum10aZjbAOA >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-05-22 04:33:29 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lbMdmIHlRt+zayG5+Rq4/w > > __PACKAGE__->add_columns( > '+anonymized' => { is_boolean => 1 }, >diff --git a/Koha/Schema/Result/Deletedborrower.pm b/Koha/Schema/Result/Deletedborrower.pm >index c03c406aac..df8877ff72 100644 >--- a/Koha/Schema/Result/Deletedborrower.pm >+++ b/Koha/Schema/Result/Deletedborrower.pm >@@ -399,6 +399,12 @@ __PACKAGE__->table("deletedborrowers"); > default_value: 1 > is_nullable: 0 > >+=head2 privacy_guarantor_fines >+ >+ data_type: 'tinyint' >+ default_value: 0 >+ is_nullable: 0 >+ > =head2 privacy_guarantor_checkouts > > data_type: 'tinyint' >@@ -604,6 +610,8 @@ __PACKAGE__->add_columns( > { data_type => "integer", is_nullable => 1 }, > "privacy", > { data_type => "integer", default_value => 1, is_nullable => 0 }, >+ "privacy_guarantor_fines", >+ { data_type => "tinyint", default_value => 0, is_nullable => 0 }, > "privacy_guarantor_checkouts", > { data_type => "tinyint", default_value => 0, is_nullable => 0 }, > "checkprevcheckout", >@@ -642,8 +650,8 @@ __PACKAGE__->add_columns( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-05-17 12:11:31 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:STNFbPgDGWmyrZUFj/n+MA >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-05-22 04:33:29 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zK1jC6Wawwj8B2ch9KFByw > > > # You can replace this text with custom code or comments, and it will be preserved on regeneration >diff --git a/api/v1/swagger/definitions/patron.json b/api/v1/swagger/definitions/patron.json >index 10675ac778..80933957a1 100644 >--- a/api/v1/swagger/definitions/patron.json >+++ b/api/v1/swagger/definitions/patron.json >@@ -243,6 +243,10 @@ > "type": "integer", > "description": "controls if relatives can see this patron's checkouts" > }, >+ "privacy_guarantor_fines": { >+ "type": "integer", >+ "description": "controls if relatives can see this patron's fines" >+ }, > "check_previous_checkout": { > "type": "string", > "description": "produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit'" >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 8300553aee..11d2cd5403 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 >@@ -707,6 +707,13 @@ OPAC: > no: "Don't allow" > - patrons to choose their own privacy settings for showing the patron's checkouts to the patron's guarantor". > - >+ - pref: AllowPatronToSetFinesVisibilityForGuarantor >+ default: 0 >+ choices: >+ yes: Allow >+ no: "Don't allow" >+ - patrons to choose their own privacy settings for showing the patron's fines to the patron's guarantor". >+ - > - Use borrowernumber > - pref: AnonymousPatron > class: integer >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 9007da96a4..14f1ef910c 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 >@@ -185,6 +185,12 @@ Patrons: > no: "Don't allow" > - staff to set the ability for a patron's checkouts to be viewed by linked patrons in the OPAC. > - >+ - pref: AllowStaffToSetFinesVisibilityForGuarantor >+ choices: >+ yes: Allow >+ no: "Don't allow" >+ - staff to set the ability for a patron's fines to be viewed by linked patrons in the OPAC. >+ - > - Card numbers for patrons must be > - pref: CardnumberLength > - "characters long. The length can be a single number to specify an exact length, a range separated by a comma (i.e., 'Min,Max'), or a maximum with no minimum (i.e., ',Max')." >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index bdb7bf89f2..8955d2c33f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -429,6 +429,21 @@ > <div class="hint">Allow guarantors of this patron to view this patron's checkouts from the OPAC</div> > </li> > [% END %] >+ [% IF relationships && Koha.Preference('AllowStaffToSetFinesVisibilityForGuarantor') %] >+ <li> >+ <label for="privacy_guarantor_fines">Show fines to guarantors</label> >+ <select name="privacy_guarantor_fines" id="privacy_guarantor_fines"> >+ [% IF privacy_guarantor_fines %] >+ <option value="0">No</option> >+ <option value="1" selected>Yes</option> >+ [% ELSE %] >+ <option value="0" selected>No</option> >+ <option value="1">Yes</option> >+ [% END %] >+ </select> >+ <div class="hint">Allow guarantors of this patron to view this patron's fines from the OPAC</div> >+ </li> >+ [% END %] > </ol> > </fieldset> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 96cf8bd550..4ef6e2efdd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -485,7 +485,16 @@ > > <li id="patron-privacyguarantor"> > <span class="label">Show checkouts to guarantor</span> >- [% IF privacy_guarantor_checkouts %] >+ [% IF patron.privacy_guarantor_checkouts %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </li> >+ >+ <li> >+ <span class="label">Show fines to guarantor</span> >+ [% IF patron.privacy_guarantor_fines %] > Yes > [% ELSE %] > No >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >index 80ea1358f0..6abb9fb19b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -100,10 +100,11 @@ > <div class="alert">You typed in the wrong characters in the box before submitting. Please try again.</div> > [% END %] > >- [% IF patron.guarantor_relationships && !Koha.Preference('OPACPrivacy') && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %] >+ [% IF has_guarantor_flag && !Koha.Preference('OPACPrivacy') && ( Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') || Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') ) %] > <fieldset class="rows" id="memberentry_privacy"> > <legend id="privacy_legend">Privacy</legend> > <ol> >+ [% IF Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %] > <li> > <label>Allow your guarantor to view your current checkouts?</label> > <select id="privacy_guarantor_checkouts"> >@@ -118,6 +119,28 @@ > <a id="update_privacy_guarantor_checkouts" href="#" class="btn">Update</a> > <span id="update_privacy_guarantor_checkouts_message" class="alert" style="display:none"></span> > </span> >+ </li> >+ [% END %] >+ >+ [% IF Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') %] >+ <li> >+ <label>Allow your guarantor to view your current fines?</label> >+ <select id="privacy_guarantor_fines"> >+ <option value="0">No</option> >+ [% IF borrower.privacy_guarantor_fines %] >+ <option value="1" selected="selected">Yes</option> >+ [% ELSE %] >+ <option value="1">Yes</option> >+ [% END %] >+ </select> >+ <span class="hint"> >+ <a id="update_privacy_guarantor_fines" href="#" class="btn">Update</a> >+ <span id="update_privacy_guarantor_fines_message" class="alert" style="display:none"></span> >+ </span> >+ </li> >+ [% END %] >+ >+ <li> > <span class="hint"> > Guaranteed by > [% FOREACH gr IN patron.guarantor_relationships %] >@@ -1019,20 +1042,39 @@ > } > }); > >- [% IF patron.guarantor_relationships && !Koha.Preference('OPACPrivacy') && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %] >- $('#update_privacy_guarantor_checkouts').click( function() { >- $.post( "/cgi-bin/koha/svc/patron/show_checkouts_to_relatives", { privacy_guarantor_checkouts: $('#privacy_guarantor_checkouts').val() }, null, 'json') >- .done(function( data ) { >- var message; >- if ( data.success ) { >- message = _("Your setting has been updated!"); >- } else { >- message = _("Unable to update your setting!"); >- } >- >- $('#update_privacy_guarantor_checkouts_message').fadeIn("slow").text( message ).delay( 5000 ).fadeOut("slow"); >- }); >- }); >+ [% IF patron.guarantor_relationships && !Koha.Preference('OPACPrivacy') %] >+ >+ [% IF Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %] >+ $('#update_privacy_guarantor_checkouts').click( function() { >+ $.post( "/cgi-bin/koha/svc/patron/show_checkouts_to_relatives", { privacy_guarantor_checkouts: $('#privacy_guarantor_checkouts').val() }, null, 'json') >+ .done(function( data ) { >+ var message; >+ if ( data.success ) { >+ message = _("Your setting has been updated!"); >+ } else { >+ message = _("Unable to update your setting!"); >+ } >+ >+ $('#update_privacy_guarantor_checkouts_message').fadeIn("slow").text( message ).delay( 5000 ).fadeOut("slow"); >+ }); >+ }); >+ [% END %] >+ >+ [% IF Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') %] >+ $('#update_privacy_guarantor_fines').click( function() { >+ $.post( "/cgi-bin/koha/svc/patron/show_fines_to_relatives", { privacy_guarantor_fines: $('#privacy_guarantor_fines').val() }, null, 'json') >+ .done(function( data ) { >+ var message; >+ if ( data.success ) { >+ message = _("Your setting has been updated!"); >+ } else { >+ message = _("Unable to update your setting!"); >+ } >+ >+ $('#update_privacy_guarantor_fines_message').fadeIn("slow").text( message ).delay( 5000 ).fadeOut("slow"); >+ }); >+ }); >+ [% END %] > [% END %] > > $(".patron-attributes").on( 'click', '.clear-attribute', function() { >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt >index 6583b7c040..789a23739a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt >@@ -71,18 +71,32 @@ > </select> > </div> > >- [% IF borrower.guarantor_relationships && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %] >+ [% IF has_guarantor_flag && (Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') || Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') ) %] > <div> >- <label for="privacy_guarantor_checkouts">Allow your guarantor to view your current checkouts?</label> >- <select name="privacy_guarantor_checkouts"> >- [% IF borrower.privacy_guarantor_checkouts %] >- <option value="0">No</option> >- <option value="1" selected>Yes</option> >- [% ELSE %] >- <option value="0" selected>No</option> >- <option value="1">Yes</option> >- [% END %] >- </select> >+ [% IF Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %] >+ <label for="privacy_guarantor_checkouts">Allow your guarantor to view your current checkouts?</label> >+ <select name="privacy_guarantor_checkouts"> >+ [% IF borrower.privacy_guarantor_checkouts %] >+ <option value="0">No</option> >+ <option value="1" selected>Yes</option> >+ [% ELSE %] >+ <option value="0" selected>No</option> >+ <option value="1">Yes</option> >+ [% END %] >+ </select> >+ [% END %] >+ [% IF Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') %] >+ <label for="privacy_guarantor_fines">Allow your guarantor to view your current fines?</label> >+ <select name="privacy_guarantor_fines"> >+ [% IF borrower.privacy_guarantor_fines %] >+ <option value="0">No</option> >+ <option value="1" selected>Yes</option> >+ [% ELSE %] >+ <option value="0" selected>No</option> >+ <option value="1">Yes</option> >+ [% END %] >+ </select> >+ [% END %] > <span class="hint"> > Guaranteed by > [% FOREACH gr IN borrower.guarantor_relationships %] >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 751f8db133..437b2df423 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -329,11 +329,13 @@ elsif ( $action eq 'edit' ) { #Display logged in borrower's data > } > > my $captcha = random_string("CCCCC"); >+my $patron_param = scalar Koha::Patrons->find( $borrowernumber ); > > $template->param( > captcha => $captcha, > captcha_digest => md5_base64($captcha), >- patron => Koha::Patrons->find( $borrowernumber ), >+ patron => $patron_param, >+ has_guarantor_flag => $patron_param->guarantor_relationships->guarantors->_resultset->count > ); > > output_html_with_http_headers $cgi, $cookie, $template->output, undef, { force_no_caching => 1 }; >diff --git a/opac/opac-privacy.pl b/opac/opac-privacy.pl >index a6f0e6df6d..7d7f445c39 100755 >--- a/opac/opac-privacy.pl >+++ b/opac/opac-privacy.pl >@@ -47,13 +47,15 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > my $op = $query->param("op"); > my $privacy = $query->param("privacy"); > my $privacy_guarantor_checkouts = $query->param("privacy_guarantor_checkouts"); >+my $privacy_guarantor_fines = $query->param("privacy_guarantor_fines"); > > if ( $op eq "update_privacy" ) { > my $patron = Koha::Patrons->find( $borrowernumber ); > if ( $patron ) { > $patron->set({ > privacy => $privacy, >- privacy_guarantor_checkouts => $privacy_guarantor_checkouts, >+ privacy_guarantor_checkouts => defined $privacy_guarantor_checkouts?$privacy_guarantor_checkouts:$patron->privacy_guarantor_checkouts, >+ privacy_guarantor_fines => defined $privacy_guarantor_fines?$privacy_guarantor_fines:$patron->privacy_guarantor_fines, > })->store; > $template->param( 'privacy_updated' => 1 ); > } >@@ -83,6 +85,7 @@ $template->param( > 'borrower' => $borrower, > 'surname' => $borrower->surname, > 'firstname' => $borrower->firstname, >+ 'has_guarantor_flag' => $borrower->guarantor_relationships->guarantors->_resultset->count > ); > > output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; >diff --git a/opac/svc/patron/show_fines_to_relatives b/opac/svc/patron/show_fines_to_relatives >new file mode 100755 >index 0000000000..223e5b9f3b >--- /dev/null >+++ b/opac/svc/patron/show_fines_to_relatives >@@ -0,0 +1,59 @@ >+#!/usr/bin/perl >+ >+# Copyright 2014 ByWater Solutions >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use CGI; >+use JSON qw( to_json ); >+ >+use C4::Auth; >+use C4::Context; >+ >+use Koha::Patrons; >+ >+my $cgi = CGI->new(); >+ >+my $privacy_guarantor_fines = $cgi->param('privacy_guarantor_fines'); >+ >+my ( $userid, $cookie, $sessionID, $flags ) = checkauth( $cgi, 1, {}, 'opac' ); >+ >+my $borrowernumber = C4::Context->userenv ? C4::Context->userenv->{number} : undef; >+ >+my $success = 0; >+if ( $borrowernumber && defined($privacy_guarantor_fines) ) { >+ my $patron = Koha::Patrons->find($borrowernumber); >+ >+ if ( $patron ) { >+ $patron->privacy_guarantor_fines($privacy_guarantor_fines); >+ $success = $patron->store(); >+ } >+} >+ >+binmode STDOUT, ":encoding(UTF-8)"; >+print $cgi->header( >+ -type => 'application/json', >+ -charset => 'UTF-8' >+); >+ >+print to_json( >+ { >+ success => $success ? 1 : 0, >+ privacy_guarantor_fines => $privacy_guarantor_fines, >+ } >+); >-- >2.11.0
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 20691
:
74968
|
74969
|
74970
|
74971
|
74972
|
74973
|
74974
|
74975
|
89951
|
89952
|
89953
|
89990
|
89991
|
89992
|
89993
|
90093
|
90094
|
90095
|
90096
|
91025
|
91026
|
91159
|
91160
|
91161
|
91162
|
92385
|
92386
|
92387
|
92388
|
92485
|
92700
|
92701
|
92702
|
92703
|
92704
|
92705
|
92897