From 7e2679528e8f6bc6c8216df0ae03186fa1359164 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 21 Apr 2021 14:26:19 +0200 Subject: [PATCH] Bug 23971: Rename pref with AcquisitionLog Signed-off-by: Jonathan Druart --- C4/Acquisition.pm | 10 +++++----- C4/UsageStats.pm | 2 +- Koha/Acquisition/Basket.pm | 2 +- Koha/EDI.pm | 2 +- acqui/addorder.pl | 2 +- .../data/mysql/atomicupdate/bug_23971_AcqLog_pref.perl | 4 ++-- installer/data/mysql/mandatory/sysprefs.sql | 2 +- .../prog/en/modules/admin/preferences/logs.pref | 2 +- t/db_dependent/Acquisition.t | 4 ++-- t/db_dependent/Koha/Acquisition/Basket.t | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 5652f2b2f1..4ef7dd07c5 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -207,7 +207,7 @@ sub NewBasket { $basketcontractnumber, $booksellerid, $deliveryplace, $billingplace, $is_standing, $create_items ); # Log the basket creation - if (C4::Context->preference("AcqLog")) { + if (C4::Context->preference("AcquisitionLog")) { my $created = Koha::Acquisition::Baskets->find( $basket ); logaction( 'ACQUISITIONS', @@ -241,7 +241,7 @@ sub ReopenBasket { }, {}, $basketno); # Log the basket reopening - if (C4::Context->preference("AcqLog")) { + if (C4::Context->preference("AcquisitionLog")) { my $reopened = Koha::Acquisition::Baskets->find( $basketno ); logaction( 'ACQUISITIONS', @@ -526,7 +526,7 @@ sub ModBasket { $sth->execute(@params); # Log the basket update - if (C4::Context->preference("AcqLog")) { + if (C4::Context->preference("AcquisitionLog")) { my $modified = Koha::Acquisition::Baskets->find( $basketinfo->{basketno} ); @@ -597,7 +597,7 @@ sub ModBasketHeader { } # Log the basket update - if (C4::Context->preference("AcqLog")) { + if (C4::Context->preference("AcquisitionLog")) { my $modified = Koha::Acquisition::Baskets->find( $basketno ); @@ -791,7 +791,7 @@ sub ModBasketUsers { } # Log the basket update - if (C4::Context->preference("AcqLog")) { + if (C4::Context->preference("AcquisitionLog")) { logaction( 'ACQUISITIONS', 'MODIFY_BASKET_USERS', diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index b37c279b4d..a74dd1fac0 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -217,7 +217,7 @@ sub BuildReport { TagsEnabled CalendarFirstDayOfWeek opaclanguagesdisplay - AcqLog + AcquisitionLog AuthoritiesLog BorrowersLog CataloguingLog diff --git a/Koha/Acquisition/Basket.pm b/Koha/Acquisition/Basket.pm index b2e038a846..4f10557901 100644 --- a/Koha/Acquisition/Basket.pm +++ b/Koha/Acquisition/Basket.pm @@ -203,7 +203,7 @@ sub close { ); # Log the closure - if (C4::Context->preference("AcqLog")) { + if (C4::Context->preference("AcquisitionLog")) { logaction( 'ACQUISITIONS', 'CLOSE_BASKET', diff --git a/Koha/EDI.pm b/Koha/EDI.pm index 14f61c79ac..af31039772 100644 --- a/Koha/EDI.pm +++ b/Koha/EDI.pm @@ -623,7 +623,7 @@ sub process_quote { ); Koha::Acquisition::Baskets->find($b)->close; # Log the approval - if (C4::Context->preference("AcqLog")) { + if (C4::Context->preference("AcquisitionLog")) { my $approved = Koha::Acquisition::Baskets->find( $b ); logaction( 'ACQUISITIONS', diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 74da873128..417c57d261 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -363,7 +363,7 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { } -if (C4::Context->preference("AcqLog") && $basketno) { +if (C4::Context->preference("AcquisitionLog") && $basketno) { my $modified = Koha::Acquisition::Baskets->find( $basketno ); logaction( 'ACQUISITIONS', diff --git a/installer/data/mysql/atomicupdate/bug_23971_AcqLog_pref.perl b/installer/data/mysql/atomicupdate/bug_23971_AcqLog_pref.perl index ea23018b12..e612c0c298 100644 --- a/installer/data/mysql/atomicupdate/bug_23971_AcqLog_pref.perl +++ b/installer/data/mysql/atomicupdate/bug_23971_AcqLog_pref.perl @@ -1,6 +1,6 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { - $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('AcqLog', '0', 'If enabled, log acquisition activity', '', 'YesNo'); | ); + $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('AcquisitionLog', '0', 'If enabled, log acquisition activity', '', 'YesNo'); | ); - NewVersion( $DBversion, 23971, "Add AcqLog syspref"); + NewVersion( $DBversion, 23971, "Add AcquisitionLog syspref"); } diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 28c30c264e..f163912142 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -5,8 +5,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AcqEnableFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to invoice records.','YesNo'), ('AcqItemSetSubfieldsWhenReceiptIsCancelled','', '','Upon cancelling a receipt, update the items subfields if they were created when placing an order (e.g. o=5|a="bar foo")', 'Free'), ('AcqItemSetSubfieldsWhenReceived','','','Upon receiving items, update their subfields if they were created when placing an order (e.g. o=5|a="foo bar")','Free'), -('AcqLog','0',NULL,'If ON, log acquisitions activity','YesNo'), ('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'), +('AcquisitionLog','0',NULL,'If ON, log acquisitions activity','YesNo'), ('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: their own only, any within their branch, or all','Choice'), ('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'), ('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref index 0c33ba2185..843d47df6e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref @@ -43,7 +43,7 @@ Logging: 0: "Don't log" - when changes to ILL requests take place. - - - pref: AcqLog + - pref: AcquisitionLog choices: on: Log off: "Don't log" diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t index d39d70334e..6fe9ede74c 100755 --- a/t/db_dependent/Acquisition.t +++ b/t/db_dependent/Acquisition.t @@ -903,7 +903,7 @@ subtest 'Acquisition logging' => sub { plan tests => 5; - t::lib::Mocks::mock_preference('AcqLog', 1); + t::lib::Mocks::mock_preference('AcquisitionLog', 1); Koha::ActionLogs->delete; my $basketno = NewBasket( $booksellerid, 1 ); @@ -933,7 +933,7 @@ subtest 'Acquisition logging' => sub { my @mod_users_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET_USERS', object => $basketno }); is (scalar @mod_users_logs, 1, 'Basket users modify is logged'); - t::lib::Mocks::mock_preference('AcqLog', 0); + t::lib::Mocks::mock_preference('AcquisitionLog', 0); }; $schema->storage->txn_rollback(); diff --git a/t/db_dependent/Koha/Acquisition/Basket.t b/t/db_dependent/Koha/Acquisition/Basket.t index ca25462e13..7b6c17d552 100755 --- a/t/db_dependent/Koha/Acquisition/Basket.t +++ b/t/db_dependent/Koha/Acquisition/Basket.t @@ -338,7 +338,7 @@ subtest 'close() tests' => sub { plan tests => 4; # Turn on acquisitions logging and ensure the logs are empty - t::lib::Mocks::mock_preference('AcqLog', 1); + t::lib::Mocks::mock_preference('AcquisitionLog', 1); Koha::ActionLogs->delete; $schema->storage->txn_begin; -- 2.39.5