View | Details | Raw Unified | Return to bug 23971
Collapse All | Expand All

(-)a/C4/Acquisition.pm (-5 / +5 lines)
Lines 207-213 sub NewBasket { Link Here
207
        $basketcontractnumber, $booksellerid, $deliveryplace, $billingplace, $is_standing, $create_items );
207
        $basketcontractnumber, $booksellerid, $deliveryplace, $billingplace, $is_standing, $create_items );
208
208
209
    # Log the basket creation
209
    # Log the basket creation
210
    if (C4::Context->preference("AcqLog")) {
210
    if (C4::Context->preference("AcquisitionLog")) {
211
        my $created = Koha::Acquisition::Baskets->find( $basket );
211
        my $created = Koha::Acquisition::Baskets->find( $basket );
212
        logaction(
212
        logaction(
213
            'ACQUISITIONS',
213
            'ACQUISITIONS',
Lines 241-247 sub ReopenBasket { Link Here
241
        }, {}, $basketno);
241
        }, {}, $basketno);
242
242
243
    # Log the basket reopening
243
    # Log the basket reopening
244
    if (C4::Context->preference("AcqLog")) {
244
    if (C4::Context->preference("AcquisitionLog")) {
245
        my $reopened = Koha::Acquisition::Baskets->find( $basketno );
245
        my $reopened = Koha::Acquisition::Baskets->find( $basketno );
246
        logaction(
246
        logaction(
247
            'ACQUISITIONS',
247
            'ACQUISITIONS',
Lines 526-532 sub ModBasket { Link Here
526
    $sth->execute(@params);
526
    $sth->execute(@params);
527
527
528
    # Log the basket update
528
    # Log the basket update
529
    if (C4::Context->preference("AcqLog")) {
529
    if (C4::Context->preference("AcquisitionLog")) {
530
        my $modified = Koha::Acquisition::Baskets->find(
530
        my $modified = Koha::Acquisition::Baskets->find(
531
            $basketinfo->{basketno}
531
            $basketinfo->{basketno}
532
        );
532
        );
Lines 597-603 sub ModBasketHeader { Link Here
597
    }
597
    }
598
598
599
    # Log the basket update
599
    # Log the basket update
600
    if (C4::Context->preference("AcqLog")) {
600
    if (C4::Context->preference("AcquisitionLog")) {
601
        my $modified = Koha::Acquisition::Baskets->find(
601
        my $modified = Koha::Acquisition::Baskets->find(
602
            $basketno
602
            $basketno
603
        );
603
        );
Lines 791-797 sub ModBasketUsers { Link Here
791
    }
791
    }
792
792
793
    # Log the basket update
793
    # Log the basket update
794
    if (C4::Context->preference("AcqLog")) {
794
    if (C4::Context->preference("AcquisitionLog")) {
795
        logaction(
795
        logaction(
796
            'ACQUISITIONS',
796
            'ACQUISITIONS',
797
            'MODIFY_BASKET_USERS',
797
            'MODIFY_BASKET_USERS',
(-)a/C4/UsageStats.pm (-1 / +1 lines)
Lines 217-223 sub BuildReport { Link Here
217
        TagsEnabled
217
        TagsEnabled
218
        CalendarFirstDayOfWeek
218
        CalendarFirstDayOfWeek
219
        opaclanguagesdisplay
219
        opaclanguagesdisplay
220
        AcqLog
220
        AcquisitionLog
221
        AuthoritiesLog
221
        AuthoritiesLog
222
        BorrowersLog
222
        BorrowersLog
223
        CataloguingLog
223
        CataloguingLog
(-)a/Koha/Acquisition/Basket.pm (-1 / +1 lines)
Lines 203-209 sub close { Link Here
203
    );
203
    );
204
204
205
    # Log the closure
205
    # Log the closure
206
    if (C4::Context->preference("AcqLog")) {
206
    if (C4::Context->preference("AcquisitionLog")) {
207
        logaction(
207
        logaction(
208
            'ACQUISITIONS',
208
            'ACQUISITIONS',
209
            'CLOSE_BASKET',
209
            'CLOSE_BASKET',
(-)a/Koha/EDI.pm (-1 / +1 lines)
Lines 623-629 sub process_quote { Link Here
623
            );
623
            );
624
            Koha::Acquisition::Baskets->find($b)->close;
624
            Koha::Acquisition::Baskets->find($b)->close;
625
            # Log the approval
625
            # Log the approval
626
            if (C4::Context->preference("AcqLog")) {
626
            if (C4::Context->preference("AcquisitionLog")) {
627
                my $approved = Koha::Acquisition::Baskets->find( $b );
627
                my $approved = Koha::Acquisition::Baskets->find( $b );
628
                logaction(
628
                logaction(
629
                    'ACQUISITIONS',
629
                    'ACQUISITIONS',
(-)a/acqui/addorder.pl (-1 / +1 lines)
Lines 363-369 if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { Link Here
363
363
364
}
364
}
365
365
366
if (C4::Context->preference("AcqLog") && $basketno) {
366
if (C4::Context->preference("AcquisitionLog") && $basketno) {
367
    my $modified = Koha::Acquisition::Baskets->find( $basketno );
367
    my $modified = Koha::Acquisition::Baskets->find( $basketno );
368
    logaction(
368
    logaction(
369
        'ACQUISITIONS',
369
        'ACQUISITIONS',
(-)a/installer/data/mysql/atomicupdate/bug_23971_AcqLog_pref.perl (-2 / +2 lines)
Lines 1-6 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('AcqLog', '0', 'If enabled, log acquisition activity', '', 'YesNo'); | );
3
    $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('AcquisitionLog', '0', 'If enabled, log acquisition activity', '', 'YesNo'); | );
4
4
5
    NewVersion( $DBversion, 23971, "Add AcqLog syspref");
5
    NewVersion( $DBversion, 23971, "Add AcquisitionLog syspref");
6
}
6
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 5-11 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
5
('AcqEnableFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to invoice records.','YesNo'),
5
('AcqEnableFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to invoice records.','YesNo'),
6
('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'),
6
('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'),
7
('AcqItemSetSubfieldsWhenReceived','','','Upon receiving items, update their subfields if they were created when placing an order (e.g. o=5|a="foo bar")','Free'),
7
('AcqItemSetSubfieldsWhenReceived','','','Upon receiving items, update their subfields if they were created when placing an order (e.g. o=5|a="foo bar")','Free'),
8
('AcqLog','0',NULL,'If ON, log acquisitions activity','YesNo'),
8
('AcquisitionLog','0',NULL,'If ON, log acquisitions activity','YesNo'),
9
('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'),
9
('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'),
10
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: their own only, any within their branch, or all','Choice'),
10
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: their own only, any within their branch, or all','Choice'),
11
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
11
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref (-1 / +1 lines)
Lines 43-49 Logging: Link Here
43
                  0: "Don't log"
43
                  0: "Don't log"
44
            - when changes to ILL requests take place.
44
            - when changes to ILL requests take place.
45
        -
45
        -
46
            - pref: AcqLog
46
            - pref: AcquisitionLog
47
              choices:
47
              choices:
48
                  on: Log
48
                  on: Log
49
                  off: "Don't log"
49
                  off: "Don't log"
(-)a/t/db_dependent/Acquisition.t (-2 / +2 lines)
Lines 903-909 subtest 'Acquisition logging' => sub { Link Here
903
903
904
    plan tests => 5;
904
    plan tests => 5;
905
905
906
    t::lib::Mocks::mock_preference('AcqLog', 1);
906
    t::lib::Mocks::mock_preference('AcquisitionLog', 1);
907
907
908
    Koha::ActionLogs->delete;
908
    Koha::ActionLogs->delete;
909
    my $basketno = NewBasket( $booksellerid, 1 );
909
    my $basketno = NewBasket( $booksellerid, 1 );
Lines 933-939 subtest 'Acquisition logging' => sub { Link Here
933
    my @mod_users_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET_USERS', object => $basketno });
933
    my @mod_users_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET_USERS', object => $basketno });
934
    is (scalar @mod_users_logs, 1, 'Basket users modify is logged');
934
    is (scalar @mod_users_logs, 1, 'Basket users modify is logged');
935
935
936
    t::lib::Mocks::mock_preference('AcqLog', 0);
936
    t::lib::Mocks::mock_preference('AcquisitionLog', 0);
937
};
937
};
938
938
939
$schema->storage->txn_rollback();
939
$schema->storage->txn_rollback();
(-)a/t/db_dependent/Koha/Acquisition/Basket.t (-2 / +1 lines)
Lines 338-344 subtest 'close() tests' => sub { Link Here
338
    plan tests => 4;
338
    plan tests => 4;
339
339
340
    # Turn on acquisitions logging and ensure the logs are empty
340
    # Turn on acquisitions logging and ensure the logs are empty
341
    t::lib::Mocks::mock_preference('AcqLog', 1);
341
    t::lib::Mocks::mock_preference('AcquisitionLog', 1);
342
    Koha::ActionLogs->delete;
342
    Koha::ActionLogs->delete;
343
343
344
    $schema->storage->txn_begin;
344
    $schema->storage->txn_begin;
345
- 

Return to bug 23971