@@ -, +, @@ --- C4/Members.pm | 26 ---------- C4/Reserves.pm | 1 + Koha/Template/Plugin/Koha.pm | 15 ++++++ .../prog/en/modules/admin/preferences/opac.pref | 7 +++ .../prog/en/modules/admin/preferences/patrons.pref | 6 +++ .../prog/en/modules/members/memberentrygen.tt | 16 ++++++ .../prog/en/modules/members/moremember.tt | 10 ++++ .../bootstrap/en/modules/opac-memberentry.tt | 43 ++++++++++++++++ .../opac-tmpl/bootstrap/en/modules/opac-privacy.tt | 24 ++++++++- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 54 ++++++++++++++++++-- members/moremember.pl | 1 + opac/opac-privacy.pl | 38 +++++++++----- opac/opac-user.pl | 32 ++++++++---- 13 files changed, 219 insertions(+), 54 deletions(-) --- a/C4/Members.pm +++ a/C4/Members.pm @@ -110,7 +110,6 @@ BEGIN { push @EXPORT, qw( &ModMember &changepassword - &ModPrivacy ); #Delete data @@ -2180,31 +2179,6 @@ sub GetBorrowersNamesAndLatestIssue { return $results; } -=head2 ModPrivacy - -=over 4 - -my $success = ModPrivacy( $borrowernumber, $privacy ); - -Update the privacy of a patron. - -return : -true on success, false on failure - -=back - -=cut - -sub ModPrivacy { - my $borrowernumber = shift; - my $privacy = shift; - return unless defined $borrowernumber; - return unless $borrowernumber =~ /^\d+$/; - - return ModMember( borrowernumber => $borrowernumber, - privacy => $privacy ); -} - =head2 AddMessage AddMessage( $borrowernumber, $message_type, $message, $branchcode ); --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -260,6 +260,7 @@ sub GetReserve { my ($reserve_id) = @_; my $dbh = C4::Context->dbh; + my $query = "SELECT * FROM reserves WHERE reserve_id = ?"; my $sth = $dbh->prepare( $query ); $sth->execute( $reserve_id ); --- a/Koha/Template/Plugin/Koha.pm +++ a/Koha/Template/Plugin/Koha.pm @@ -22,6 +22,7 @@ use Modern::Perl; use base qw( Template::Plugin ); use C4::Context; +use Koha::Database; =pod @@ -44,4 +45,18 @@ sub Preference { return C4::Context->preference( $pref ); } +sub Find { + my ( $self, $rs, $id ) = @_; + + return unless ( $rs && $id ); + + my $resultset = Koha::Database->new()->schema()->resultset($rs); + + return unless $resultset; + + my $row = $resultset->find($id); + + return $row; +} + 1; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -583,6 +583,13 @@ OPAC: no: "Don't allow" - patrons to choose their own privacy settings for their reading history. This requires opacreadinghistory and AnonymousPatron - + - pref: AllowPatronToSetCheckoutsVisibilityForGuarantor + default: 0 + choices: + yes: Allow + no: "Don't allow" + - patrons to choose their own privacy settings for showing the patron's checkouts to the patron's guarantor". + - - Use borrowernumber - pref: AnonymousPatron class: integer --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -134,6 +134,12 @@ Patrons: no: "Don't" - enable the ability to upload and attach arbitrary files to a borrower record. - + - pref: AllowStaffToSetCheckoutsVisibilityForGuarantor + choices: + yes: Allow + no: "Don't allow" + - staff to set the ability for a patron's checkouts 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')." --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1,5 +1,6 @@ [% IF ( opduplicate ) %][% SET focusAction = "clearDupe" %][% END %] [% USE KohaDates %] +[% USE Koha %] [% INCLUDE 'doc-head-open.inc' %]