Browse Source

Bug 23971: Rename pref with AcquisitionLog

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.05.x
Jonathan Druart 6 months ago
parent
commit
7e2679528e
  1. 10
      C4/Acquisition.pm
  2. 2
      C4/UsageStats.pm
  3. 2
      Koha/Acquisition/Basket.pm
  4. 2
      Koha/EDI.pm
  5. 2
      acqui/addorder.pl
  6. 4
      installer/data/mysql/atomicupdate/bug_23971_AcqLog_pref.perl
  7. 2
      installer/data/mysql/mandatory/sysprefs.sql
  8. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref
  9. 4
      t/db_dependent/Acquisition.t
  10. 2
      t/db_dependent/Koha/Acquisition/Basket.t

10
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',

2
C4/UsageStats.pm

@ -217,7 +217,7 @@ sub BuildReport {
TagsEnabled
CalendarFirstDayOfWeek
opaclanguagesdisplay
AcqLog
AcquisitionLog
AuthoritiesLog
BorrowersLog
CataloguingLog

2
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',

2
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',

2
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',

4
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");
}

2
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'),

2
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"

4
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();

2
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;

Loading…
Cancel
Save