From 8d665cc4f84fdcf94bd631cb903c3fa979b64952 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 26 Jun 2014 12:56:03 -0400 Subject: [PATCH] Bug 9303 [6] [QA Followup 3] - Rename prefs and field * Change AllowStaffToSetRelativesCheckoutsVisibility to AllowStaffToSetCheckoutsVisibilityForGuarantor * Change AllowPatronToSetRelativesCheckoutsVisibility to AllowPatronToSetCheckoutsVisibilityForGuarantor * Change borrowers field privacy_relative_checkouts to privacy_guarantor_checkouts --- Koha/Schema/Result/Borrower.pm | 110 +++++++++++++++----- installer/data/mysql/kohastructure.sql | 4 +- installer/data/mysql/sysprefs.sql | 4 +- installer/data/mysql/updatedatabase.pl | 8 +- .../prog/en/modules/admin/preferences/opac.pref | 2 +- .../prog/en/modules/admin/preferences/patrons.pref | 2 +- .../prog/en/modules/members/memberentrygen.tt | 10 +- .../prog/en/modules/members/moremember.tt | 4 +- .../bootstrap/en/modules/opac-memberentry.tt | 18 ++-- .../opac-tmpl/bootstrap/en/modules/opac-privacy.tt | 8 +- .../opac-tmpl/prog/en/modules/opac-memberentry.tt | 14 ++-- .../opac-tmpl/prog/en/modules/opac-privacy.tt | 6 +- members/moremember.pl | 2 +- opac/opac-privacy.pl | 4 +- opac/opac-user.pl | 6 +- opac/svc/patron/show_checkouts_to_relatives | 8 +- 16 files changed, 136 insertions(+), 74 deletions(-) diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 6a3fb10..6824c37 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -1,17 +1,21 @@ +use utf8; package Koha::Schema::Result::Borrower; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE +=head1 NAME + +Koha::Schema::Result::Borrower + +=cut + use strict; use warnings; use base 'DBIx::Class::Core'; - -=head1 NAME - -Koha::Schema::Result::Borrower +=head1 TABLE: C =cut @@ -187,6 +191,7 @@ __PACKAGE__->table("borrowers"); =head2 dateofbirth data_type: 'date' + datetime_undef_if_invalid: 1 is_nullable: 1 =head2 branchcode @@ -208,11 +213,13 @@ __PACKAGE__->table("borrowers"); =head2 dateenrolled data_type: 'date' + datetime_undef_if_invalid: 1 is_nullable: 1 =head2 dateexpiry data_type: 'date' + datetime_undef_if_invalid: 1 is_nullable: 1 =head2 gonenoaddress @@ -228,6 +235,7 @@ __PACKAGE__->table("borrowers"); =head2 debarred data_type: 'date' + datetime_undef_if_invalid: 1 is_nullable: 1 =head2 debarredcomment @@ -389,7 +397,7 @@ __PACKAGE__->table("borrowers"); default_value: 1 is_nullable: 0 -=head2 privacy_relative_checkouts +=head2 privacy_guarantor_checkouts data_type: 'tinyint' default_value: 0 @@ -461,7 +469,7 @@ __PACKAGE__->add_columns( "b_phone", { data_type => "mediumtext", is_nullable => 1 }, "dateofbirth", - { data_type => "date", is_nullable => 1 }, + { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, "branchcode", { data_type => "varchar", @@ -479,15 +487,15 @@ __PACKAGE__->add_columns( size => 10, }, "dateenrolled", - { data_type => "date", is_nullable => 1 }, + { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, "dateexpiry", - { data_type => "date", is_nullable => 1 }, + { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, "gonenoaddress", { data_type => "tinyint", is_nullable => 1 }, "lost", { data_type => "tinyint", is_nullable => 1 }, "debarred", - { data_type => "date", is_nullable => 1 }, + { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, "debarredcomment", { data_type => "varchar", is_nullable => 1, size => 255 }, "contactname", @@ -544,10 +552,34 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 1, size => 50 }, "privacy", { data_type => "integer", default_value => 1, is_nullable => 0 }, - "privacy_relative_checkouts", + "privacy_guarantor_checkouts", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, ); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + __PACKAGE__->set_primary_key("borrowernumber"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=back + +=cut + __PACKAGE__->add_unique_constraint("cardnumber", ["cardnumber"]); =head1 RELATIONS @@ -672,34 +704,34 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 categorycode +=head2 branchcode Type: belongs_to -Related object: L +Related object: L =cut __PACKAGE__->belongs_to( - "categorycode", - "Koha::Schema::Result::Category", - { categorycode => "categorycode" }, - { on_delete => "CASCADE", on_update => "CASCADE" }, + "branchcode", + "Koha::Schema::Result::Branch", + { branchcode => "branchcode" }, + { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, ); -=head2 branchcode +=head2 categorycode Type: belongs_to -Related object: L +Related object: L =cut __PACKAGE__->belongs_to( - "branchcode", - "Koha::Schema::Result::Branch", - { branchcode => "branchcode" }, - { on_delete => "CASCADE", on_update => "CASCADE" }, + "categorycode", + "Koha::Schema::Result::Category", + { categorycode => "categorycode" }, + { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, ); =head2 course_instructors @@ -1017,9 +1049,39 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 basketnoes + +Type: many_to_many + +Composing rels: L -> basketno + +=cut + +__PACKAGE__->many_to_many("basketnoes", "aqbasketusers", "basketno"); + +=head2 budgets + +Type: many_to_many + +Composing rels: L -> budget + +=cut + +__PACKAGE__->many_to_many("budgets", "aqbudgetborrowers", "budget"); + +=head2 courses + +Type: many_to_many + +Composing rels: L -> course + +=cut + +__PACKAGE__->many_to_many("courses", "course_instructors", "course"); + -# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-11-07 08:15:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TQTGI0fDt+xCFs+8nOarfA +# Created by DBIx::Class::Schema::Loader v0.07040 @ 2014-06-26 13:01:03 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:W0T8L4w9Nr/mPXzoX0/Xjg __PACKAGE__->belongs_to( "guarantor", diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index f18ea4a..9d147c3 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -265,7 +265,7 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on) `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history - `privacy_relative_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts + `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts UNIQUE KEY `cardnumber` (`cardnumber`), PRIMARY KEY `borrowernumber` (`borrowernumber`), KEY `categorycode` (`categorycode`), @@ -869,7 +869,7 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on) `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history KEY `borrowernumber` (`borrowernumber`), - `privacy_relative_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts + `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts KEY borrowernumber (borrowernumber), KEY `cardnumber` (`cardnumber`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 08871ab..be01609 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -25,13 +25,13 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'), ('AllowOfflineCirculation','0','','If on, enables HTML5 offline circulation functionality.','YesNo'), ('AllowOnShelfHolds','0','','Allow hold requests to be placed on items that are not on loan','YesNo'), -('AllowPatronToSetRelativesCheckoutsVisibility', '0', NULL, 'If enabled, the patron can set checkouts to be visible to his or her guarantor', 'YesNo'), +('AllowPatronToSetCheckoutsVisibilityForGuarantor', '0', NULL, 'If enabled, the patron can set checkouts to be visible to his or her guarantor', 'YesNo'), ('AllowPKIAuth','None','None|Common Name|emailAddress','Use the field from a client-side SSL certificate to look a user in the Koha database','Choice'), ('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'), -('AllowStaffToSetRelativesCheckoutsVisibility','0',NULL,'If enabled, library staff can set a patron''s checkouts to be visible to linked patrons from the opac.', 'YesNo'), +('AllowStaffToSetCheckoutsVisibilityForGuarantor','0',NULL,'If enabled, library staff can set a patron''s checkouts to be visible to linked patrons from the opac.', 'YesNo'), ('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/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 8eee821..6c71e61 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8564,10 +8564,10 @@ if ( CheckVersion($DBversion) ) { $DBversion = "3.15.00.XXX"; if(CheckVersion($DBversion)) { $dbh->do(q{ - ALTER TABLE borrowers ADD privacy_relative_checkouts BOOLEAN NOT NULL DEFAULT '0' + ALTER TABLE borrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0' }); $dbh->do(q{ - ALTER TABLE deletedborrowers ADD privacy_relative_checkouts BOOLEAN NOT NULL DEFAULT '0' + ALTER TABLE deletedborrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0' }); $dbh->do(q{ ALTER TABLE old_issues DROP PRIMARY KEY @@ -8606,7 +8606,7 @@ if(CheckVersion($DBversion)) { $dbh->do(q{ INSERT INTO systempreferences (variable, value, options, explanation, type ) VALUES ( - 'AllowStaffToSetRelativesCheckoutsVisibility', '0', NULL, + 'AllowStaffToSetCheckoutsVisibilityForGuarantor', '0', NULL, 'If enabled, library staff can set a patron''s checkouts to be visible to linked patrons from the opac.', 'YesNo' ) }); @@ -8614,7 +8614,7 @@ if(CheckVersion($DBversion)) { $dbh->do(q{ INSERT INTO systempreferences (variable, value, options, explanation, type ) VALUES ( - 'AllowPatronToSetRelativesCheckoutsVisibility', '0', NULL, + 'AllowPatronToSetCheckoutsVisibilityForGuarantor', '0', NULL, 'If enabled, the patron can set checkouts to be visible to his or her guarantor', 'YesNo' ) }); 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 973d4fd..48302b6 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 @@ -588,7 +588,7 @@ OPAC: no: "Don't allow" - patrons to choose their own privacy settings for their reading history. This requires opacreadinghistory and AnonymousPatron - - - pref: AllowPatronToSetRelativesCheckoutsVisibility + - pref: AllowPatronToSetCheckoutsVisibilityForGuarantor default: 0 choices: yes: Allow 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 8364fe0..fef9a0f 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 @@ -134,7 +134,7 @@ Patrons: no: "Don't" - enable the ability to upload and attach arbitrary files to a borrower record. - - - pref: AllowStaffToSetRelativesCheckoutsVisibility + - pref: AllowStaffToSetCheckoutsVisibilityForGuarantor choices: yes: Allow no: "Don't allow" 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 10cb802..82cc913 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1171,11 +1171,11 @@ [% END %] [% IF ( mandatorypassword ) %]Required[% END %][% IF ( ERROR_password_mismatch ) %]Passwords do not match[% END %] - [% IF Koha.Preference('AllowStaffToSetRelativesCheckoutsVisibility') %] + [% IF guarantorid && Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %]
  • - - + [% IF privacy_guarantor_checkouts %] [% ELSE %] @@ -1183,7 +1183,7 @@ [% END %] -
    Allow linked patron accounts to view this patron's checkouts from the OPAC
    +
    Allow guarantor of this patron to view this patron's checkouts from the OPAC
  • [% 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 e72c281..c812eed 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -374,8 +374,8 @@ function validate1(date) { [% END %]
  • - Show checkouts to relatives - [% IF privacy_relative_checkouts %] + Show checkouts to guarantor + [% IF privacy_guarantor_checkouts %] 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 9051f28..67ce8ee 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -54,23 +54,23 @@
    You typed in the wrong characters in the box before submitting. Please try again.
    [% END %] - [% IF borrower.guarantorid && !Koha.Preference('OPACPrivacy') && Koha.Preference('AllowPatronToSetRelativesCheckoutsVisibility') %] + [% IF borrower.guarantorid && !Koha.Preference('OPACPrivacy') && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
    Privacy
    1. - - [% IF borrower.privacy_relative_checkouts %] + [% IF borrower.privacy_guarantor_checkouts %] [% ELSE %] [% END %] - Update - + Update + [% SET g = Koha.Find('Borrower',borrower.guarantorid) %] @@ -805,9 +805,9 @@ $( "#borrower_dateofbirth" ).datepicker({ yearRange: "c-120:c" }); [% END %] - [% IF borrower.guarantorid && !Koha.Preference('OPACPrivacy') && Koha.Preference('AllowPatronToSetRelativesCheckoutsVisibility') %] - $('#update_privacy_relative_checkouts').click( function() { - $.post( "/cgi-bin/koha/svc/patron/show_checkouts_to_relatives", { privacy_relative_checkouts: $('#privacy_relative_checkouts').val() }) + [% IF borrower.guarantorid && !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() }) .done(function( data ) { var message; if ( data.success ) { @@ -816,7 +816,7 @@ message = _("Unable to update your setting!"); } - $('#update_privacy_relative_checkouts_message').fadeIn("slow").text( message ).delay( 5000 ).fadeOut("slow"); + $('#update_privacy_guarantor_checkouts_message').fadeIn("slow").text( message ).delay( 5000 ).fadeOut("slow"); }); }); [% END %] 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 b56336f..4a678e6 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt @@ -69,11 +69,11 @@ [% SET b = Koha.Find('Borrower', borrower.borrowernumber) %] - [% IF b.guarantorid && Koha.Preference('AllowPatronToSetRelativesCheckoutsVisibility') %] + [% IF b.guarantorid && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
      - - + [% IF borrower.privacy_guarantor_checkouts %] [% ELSE %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt index d35706a..65fe743 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt @@ -21,8 +21,8 @@ $( "#borrower_dateofbirth" ).datepicker({ yearRange: "c-120:c" }); [% END %] - $('#update_privacy_relative_checkouts').click( function() { - $.post( "/cgi-bin/koha/svc/patron/show_checkouts_to_relatives", { privacy_relative_checkouts: $('#privacy_relative_checkouts').val() }) + $('#update_privacy_guarantor_checkouts').click( function() { + $.post( "/cgi-bin/koha/svc/patron/show_checkouts_to_relatives", { privacy_guarantor_checkouts: $('#privacy_guarantor_checkouts').val() }) .done(function( data ) { var message; if ( data.success ) { @@ -31,7 +31,7 @@ message = _("Unable to update your setting!"); } - $('#update_privacy_relative_checkouts_message').fadeIn("slow").text( message ).delay( 5000 ).fadeOut("slow"); + $('#update_privacy_guarantor_checkouts_message').fadeIn("slow").text( message ).delay( 5000 ).fadeOut("slow"); }); }); }); @@ -81,17 +81,17 @@
      1. - - [% IF borrower.privacy_relative_checkouts %] + [% IF borrower.privacy_guarantor_checkouts %] [% ELSE %] [% END %] - - + +
      diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt index 632c9c7..b45514b 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tt @@ -57,9 +57,9 @@

      - - + [% IF borrower.privacy_guarantor_checkouts %] [% ELSE %] diff --git a/members/moremember.pl b/members/moremember.pl index 9e81eb7..7a842d0 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -444,7 +444,7 @@ $template->param( # reserveloop => \@reservedata, samebranch => $samebranch, quickslip => $quickslip, - privacy_relative_checkouts => $data->{'privacy_relative_checkouts'}, + privacy_guarantor_checkouts => $data->{'privacy_guarantor_checkouts'}, activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'), SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'), diff --git a/opac/opac-privacy.pl b/opac/opac-privacy.pl index c41e394..10c44f9 100755 --- a/opac/opac-privacy.pl +++ b/opac/opac-privacy.pl @@ -42,13 +42,13 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( my $op = $query->param("op"); my $privacy = $query->param("privacy"); -my $privacy_relative_checkouts = $query->param("privacy_relative_checkouts"); +my $privacy_guarantor_checkouts = $query->param("privacy_guarantor_checkouts"); if ( $op eq "update_privacy" ) { ModMember( borrowernumber => $borrowernumber, privacy => $privacy, - privacy_relative_checkouts => $privacy_relative_checkouts, + privacy_guarantor_checkouts => $privacy_guarantor_checkouts, ); $template->param( 'privacy_updated' => 1 ); } diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 4d62632..4030260 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -374,13 +374,13 @@ if ( $borr->{'opacnote'} ) { ); } -if ( C4::Context->preference('AllowPatronToSetRelativesCheckoutsVisibility') - || C4::Context->preference('AllowStaffToSetRelativesCheckoutsVisibility') ) +if ( C4::Context->preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') + || C4::Context->preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') ) { my @relatives = Koha::Database->new()->schema()->resultset("Borrower")->search( { - privacy_relative_checkouts => 1, + privacy_guarantor_checkouts => 1, 'me.guarantorid' => $borrowernumber }, { prefetch => [ { 'issues' => { 'item' => 'biblio' } } ] } diff --git a/opac/svc/patron/show_checkouts_to_relatives b/opac/svc/patron/show_checkouts_to_relatives index 8e26c52..11ca835 100755 --- a/opac/svc/patron/show_checkouts_to_relatives +++ b/opac/svc/patron/show_checkouts_to_relatives @@ -29,7 +29,7 @@ use JSON qw( to_json ); my $cgi = CGI->new(); -my $privacy_relative_checkouts = $cgi->param('privacy_relative_checkouts'); +my $privacy_guarantor_checkouts = $cgi->param('privacy_guarantor_checkouts'); my ( $userid, $cookie, $sessionID, $flags ) = checkauth( $cgi, 1, {}, 'opac' ); @@ -37,13 +37,13 @@ my $borrowernumber = C4::Context->userenv ? C4::Context->userenv->{number} : undef; my $success = 0; -if ( $borrowernumber && defined($privacy_relative_checkouts) ) { +if ( $borrowernumber && defined($privacy_guarantor_checkouts) ) { my $patron = Koha::Database->new()->schema()->resultset('Borrower') ->find($borrowernumber); $success = $patron->update( - { privacy_relative_checkouts => $privacy_relative_checkouts } ); + { privacy_guarantor_checkouts => $privacy_guarantor_checkouts } ); } binmode STDOUT, ":encoding(UTF-8)"; @@ -55,6 +55,6 @@ print $cgi->header( print to_json( { success => $success ? 1 : 0, - privacy_relative_checkouts => $privacy_relative_checkouts, + privacy_guarantor_checkouts => $privacy_guarantor_checkouts, } ); -- 1.7.2.5