@@ -, +, @@ --- C4/Reserves.pm | 13 +---- installer/data/mysql/sysprefs.sql | 2 + installer/data/mysql/updatedatabase.pl | 39 ++++++++++++- .../prog/en/modules/admin/preferences/opac.pref | 7 ++ .../prog/en/modules/admin/preferences/patrons.pref | 6 ++ .../prog/en/modules/members/memberentrygen.tt | 29 +++++---- .../prog/en/modules/members/moremember.tt | 10 +++ .../bootstrap/en/modules/opac-memberentry.tt | 39 +++++++++++++ .../opac-tmpl/prog/en/modules/opac-memberentry.tt | 35 +++++++++++ koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 2 +- members/moremember.pl | 1 + opac/opac-user.pl | 15 +++-- opac/svc/patron/show_checkouts_to_relatives | 60 ++++++++++++++++++++ 13 files changed, 225 insertions(+), 33 deletions(-) create mode 100755 opac/svc/patron/show_checkouts_to_relatives --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -264,18 +264,7 @@ sub GetReserve { my $query = "SELECT * FROM reserves WHERE reserve_id = ?"; my $sth = $dbh->prepare( $query ); $sth->execute( $reserve_id ); - my $res = $sth->fetchrow_hashref(); - - unless ($res) { - $query = "SELECT * FROM old_reserves WHERE reserve_id = ?"; - $sth = $dbh->prepare($query); - $sth->execute($reserve_id); - $res = $sth->fetchrow_hashref(); - } - - carp("No hold for for reserve_id $reserve_id") unless $res; - - return $res; + return $sth->fetchrow_hashref(); } =head2 GetReservesFromBiblionumber --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -25,11 +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 guarantor from opac-memberentry.pl', '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'), ('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'), --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -37,6 +37,7 @@ use Getopt::Long; use C4::Context; use C4::Installer; use C4::Dates; +use Koha::Database; use MARC::Record; use MARC::File::XML ( BinaryEncoding => 'utf8' ); @@ -8569,14 +8570,48 @@ if(CheckVersion($DBversion)) { ALTER TABLE deletedborrowers ADD privacy_relative_checkouts BOOLEAN NOT NULL DEFAULT '0' }); $dbh->do(q{ - ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST + ALTER TABLE old_issues + DROP PRIMARY KEY, + ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST, + DROP INDEX itemnumber_idx, + ADD UNIQUE itemnumber_idx (itemnumber); }); $dbh->do(q{ - ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST; + ALTER TABLE issues + DROP PRIMARY KEY, + ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST, + DROP INDEX itemnumber_idx, + ADD UNIQUE itemnumber_idx (itemnumber); }); $dbh->do(qq{ UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC }); + + my $schema = Koha::Database->new()->schema(); + my $max_issue_id = $schema->resultset('Issue')->get_column('issue_id')->max(); + $max_issue_id ||= $schema->resultset('OldIssue')->get_column('issue_id')->max(); + $max_issue_id ||= 0; + $max_issue_id++; + $dbh->do(qq{ + ALTER TABLE issues AUTO_INCREMENT = $max_issue_id + }); + + $dbh->do(q{ + INSERT INTO systempreferences (variable, value, options, explanation, type ) + VALUES ( + 'AllowStaffToSetRelativesCheckoutsVisibility', '0', NULL, + 'If enabled, library staff can set a patron''s checkouts to be visible to linked patrons from the opac.', 'YesNo' + ) + }); + + $dbh->do(q{ + INSERT INTO systempreferences (variable, value, options, explanation, type ) + VALUES ( + 'AllowPatronToSetRelativesCheckoutsVisibility', '0', NULL, + 'If enabled, the patron can set checkouts to be visible to guarantor from opac-memberentry.pl', 'YesNo' + ) + }); + print "Upgrade to $DBversion done (Bug 9303 - relative's checkouts in the opac)\n"; SetVersion($DBversion); } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -588,6 +588,13 @@ OPAC: no: "Don't allow" - patrons to choose their own privacy settings for their reading history. This requires opacreadinghistory and AnonymousPatron - + - pref: AllowPatronToSetRelativesCheckoutsVisibility + default: 0 + choices: + yes: Allow + no: "Don't allow" + - patrons to choose their own privacy settings for showing checkouts to relatives from "your personal details" reguardless of the setting for OPACPrivacy. + - - 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: AllowStaffToSetRelativesCheckoutsVisibility + 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' %]