@@ -, +, @@ - Changed syspref from RecordIssuer to RecordStaffUserOnCheckout - Changed terminology from "issue" to "check out" and variations - Fixed name display to use patron-title.inc - Made issuer column DEFAULT NULL consistently between issues and --- C4/Circulation.pm | 2 +- .../bug_23916_add_RecordIssuer_syspref.perl | 4 ++-- .../atomicupdate/bug_23916_add_issues_issuer.perl | 4 ++-- installer/data/mysql/kohastructure.sql | 2 +- installer/data/mysql/mandatory/sysprefs.sql | 2 +- .../en/modules/admin/preferences/circulation.pref | 6 +++--- .../prog/en/modules/catalogue/issuehistory.tt | 6 +++--- .../prog/en/modules/members/readingrec.tt | 4 ++-- t/db_dependent/Circulation.t | 12 ++++++------ 9 files changed, 21 insertions(+), 21 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -1515,7 +1515,7 @@ sub AddIssue { # Get ID of logged in user. if called from a batch job, # no user session exists and C4::Context->userenv() returns # the scalar '0'. Only do this is the syspref says so - if ( C4::Context->preference('RecordIssuer') ) { + if ( C4::Context->preference('RecordStaffUserOnCheckout') ) { my $userenv = C4::Context->userenv(); my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : undef; if ($usernumber) { --- a/installer/data/mysql/atomicupdate/bug_23916_add_RecordIssuer_syspref.perl +++ a/installer/data/mysql/atomicupdate/bug_23916_add_RecordIssuer_syspref.perl @@ -1,8 +1,8 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { - $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('RecordIssuer', '0', 'If enabled, when an item is issued, the user who issued the item is recorded', '', 'YesNo'); | ); + $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('RecordStaffUserOnCheckout', '0', 'If enabled, when an item is checked out, the user who checked out the item is recorded', '', 'YesNo'); | ); SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 23916 - Add RecordIssuer syspref)\n"; + print "Upgrade to $DBversion done (Bug 23916 - Add RecordStaffUserOnCheckout syspref)\n"; } --- a/installer/data/mysql/atomicupdate/bug_23916_add_issues_issuer.perl +++ a/installer/data/mysql/atomicupdate/bug_23916_add_issues_issuer.perl @@ -1,13 +1,13 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { if( !column_exists( 'issues', 'issuer' ) ) { - $dbh->do( q| ALTER TABLE issues ADD issuer INT(11) AFTER borrowernumber | ); + $dbh->do( q| ALTER TABLE issues ADD issuer INT(11) DEFAULT NULL AFTER borrowernumber | ); } if (!foreign_key_exists( 'issues', 'issues_ibfk_borrowers_borrowernumber' )) { $dbh->do( q| ALTER TABLE issues ADD CONSTRAINT `issues_ibfk_borrowers_borrowernumber` FOREIGN KEY (`issuer`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE | ); } if( !column_exists( 'old_issues', 'issuer' ) ) { - $dbh->do( q| ALTER TABLE old_issues ADD issuer INT(11) AFTER borrowernumber | ); + $dbh->do( q| ALTER TABLE old_issues ADD issuer INT(11) DEFAULT NULL AFTER borrowernumber | ); } if (!foreign_key_exists( 'old_issues', 'old_issues_ibfk_borrowers_borrowernumber' )) { $dbh->do( q| ALTER TABLE old_issues ADD CONSTRAINT `old_issues_ibfk_borrowers_borrowernumber` FOREIGN KEY (`issuer`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE | ); --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -1617,7 +1617,7 @@ DROP TABLE IF EXISTS `issues`; CREATE TABLE `issues` ( -- information related to check outs or issues `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table `borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to - `issuer` int(11), -- foreign key, linking this to the borrowers table for the user who checked out this item + `issuer` int(11) default NULL, -- foreign key, linking this to the borrowers table for the user who checked out this item `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss) `branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/installer/data/mysql/mandatory/sysprefs.sql @@ -534,7 +534,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('QueryWeightFields','1',NULL,'If ON, enables field weighting','YesNo'), ('QuoteOfTheDay','','intranet,opac','Enable or disable display of Quote of the Day on the OPAC and staff interface home page','multiple'), ('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'), -('RecordIssuer','0',NULL,'If ON, when an item is issued, the user who issued the item is recorded','YesNo'), +('RecordStaffUserOnCheckout','0',NULL,'If ON, when an item is checked out, the user who checked out the item is recorded','YesNo'), ('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'), ('RefundLostOnReturnControl','CheckinLibrary','CheckinLibrary|ItemHomeBranch|ItemHoldingBranch','If a lost item is returned, choose which branch to pick rules for refunding.','Choice'), ('RenewAccruingItemWhenPaid','0','','If enabled, when the fines on an item accruing is paid off, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue','YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -446,12 +446,12 @@ Circulation: nothing : "do nothing" - . - - - "When issuing an item, " - - pref: RecordIssuer + - "When checking out an item, " + - pref: RecordStaffUserOnCheckout choices: yes: "record" no: "don't record" - - "the user who issued the item." + - "the user who checked out the item." - - "Mark items as returned when flagged as lost " - pref: MarkLostItemsAsReturned --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt @@ -37,7 +37,7 @@ [% END %] Barcode Checked out from - [% IF Koha.Preference('RecordIssuer') %] + [% IF Koha.Preference('RecordStaffUserOnCheckout') %] Checked out by [% END %] Renewed @@ -66,10 +66,10 @@ [% ELSE %]   [% END %] - [% IF Koha.Preference('RecordIssuer') %] + [% IF Koha.Preference('RecordStaffUserOnCheckout') %] [% IF checkout.issuer %] - [% checkout.issued_by.firstname | html %] [% checkout.issued_by.surname | html %] + [% INCLUDE 'patron-title.inc' patron=checkout.issued_by %] [% END %] [% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt @@ -58,7 +58,7 @@ Number of renewals Checked out on Checked out from - [% IF Koha.Preference('RecordIssuer') %] + [% IF Koha.Preference('RecordStaffUserOnCheckout') %] Checked out by [% END %] Date due @@ -97,7 +97,7 @@ [% issue.issuedate |$KohaDates with_hours => 1 %] [% Branches.GetName( issue.branchcode ) | html %] - [% IF Koha.Preference('RecordIssuer') %] + [% IF Koha.Preference('RecordStaffUserOnCheckout') %] [% issue.firstname | html %] [% issue.surname | html %] [% END %] --- a/t/db_dependent/Circulation.t +++ a/t/db_dependent/Circulation.t @@ -121,8 +121,8 @@ for my $branch ( $branches->next ) { $dbh->do('DELETE FROM issues'); $dbh->do('DELETE FROM borrowers'); -# Disable recording of issuer until we're ready for it -t::lib::Mocks::mock_preference('RecordIssuer', 0); +# Disable recording of the staff who checked out an item until we're ready for it +t::lib::Mocks::mock_preference('RecordStaffUserOnCheckout', 0); my $module = new Test::MockModule('C4::Context'); @@ -4121,7 +4121,7 @@ subtest 'Checkout should correctly terminate a transfer' => sub { is( $hold->priority, 1, ); } -subtest 'AddIssue records issuer if appropriate' => sub { +subtest 'AddIssue records staff who checked out item if appropriate' => sub { plan tests => 2; $module->mock( 'userenv', sub { { branch => $library->{id} } } ); @@ -4154,14 +4154,14 @@ subtest 'AddIssue records issuer if appropriate' => sub { my $issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); - is( $issue->issuer, undef, "Issuer not recorded when RecordIssuer turned off" ); + is( $issue->issuer, undef, "Staff who checked out the item not recorded when RecordStaffUserOnCheckout turned off" ); - t::lib::Mocks::mock_preference('RecordIssuer', 1); + t::lib::Mocks::mock_preference('RecordStaffUserOnCheckout', 1); my $issue2 = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); - is( $issue->issuer, $issuer->{borrowernumber}, "Issuer recorded when RecordIssuer turned on" ); + is( $issue->issuer, $issuer->{borrowernumber}, "Staff who checked out the item recorded when RecordStaffUserOnCheckout turned on" ); }; $schema->storage->txn_rollback; --