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

(-)a/C4/Items.pm (-4 / +4 lines)
Lines 312-318 sub AddItem { Link Here
312
312
313
    ModZebra( $item->{biblionumber}, "specialUpdate", "biblioserver" );
313
    ModZebra( $item->{biblionumber}, "specialUpdate", "biblioserver" );
314
   
314
   
315
    logaction("CATALOGUING", "ADD", $itemnumber, "item") if C4::Context->preference("CataloguingLog");
315
    logaction("CATALOGUING", "ADD", $itemnumber, "item") if C4::Context->preference("CataloguingLogItems");
316
    
316
    
317
    return ($item->{biblionumber}, $item->{biblioitemnumber}, $itemnumber);
317
    return ($item->{biblionumber}, $item->{biblioitemnumber}, $itemnumber);
318
}
318
}
Lines 407-413 sub AddItemBatchFromMarc { Link Here
407
        push @itemnumbers, $itemnumber; # FIXME not checking error
407
        push @itemnumbers, $itemnumber; # FIXME not checking error
408
        $item->{'itemnumber'} = $itemnumber;
408
        $item->{'itemnumber'} = $itemnumber;
409
409
410
        logaction("CATALOGUING", "ADD", $itemnumber, "item") if C4::Context->preference("CataloguingLog"); 
410
        logaction("CATALOGUING", "ADD", $itemnumber, "item") if C4::Context->preference("CataloguingLogItems"); 
411
411
412
        my $new_item_marc = _marc_from_item_hash($item, $frameworkcode, $unlinked_item_subfields);
412
        my $new_item_marc = _marc_from_item_hash($item, $frameworkcode, $unlinked_item_subfields);
413
        $item_field->replace_with($new_item_marc->field($itemtag));
413
        $item_field->replace_with($new_item_marc->field($itemtag));
Lines 613-619 sub ModItem { Link Here
613
    # item status is possible
613
    # item status is possible
614
    ModZebra( $biblionumber, "specialUpdate", "biblioserver" );
614
    ModZebra( $biblionumber, "specialUpdate", "biblioserver" );
615
615
616
    logaction("CATALOGUING", "MODIFY", $itemnumber, "item ".Dumper($item)) if C4::Context->preference("CataloguingLog");
616
    logaction("CATALOGUING", "MODIFY", $itemnumber, "item ".Dumper($item)) if C4::Context->preference("CataloguingLogItems");
617
}
617
}
618
618
619
=head2 ModItemTransfer
619
=head2 ModItemTransfer
Lines 689-695 sub DelItem { Link Here
689
    ModZebra( $biblionumber, "specialUpdate", "biblioserver" );
689
    ModZebra( $biblionumber, "specialUpdate", "biblioserver" );
690
690
691
    #search item field code
691
    #search item field code
692
    logaction("CATALOGUING", "DELETE", $itemnumber, "item") if C4::Context->preference("CataloguingLog");
692
    logaction("CATALOGUING", "DELETE", $itemnumber, "item") if C4::Context->preference("CataloguingLogItems");
693
    return $deleted;
693
    return $deleted;
694
}
694
}
695
695
(-)a/C4/Log.pm (-8 / +9 lines)
Lines 138-151 C<$status> is a hasref like this example: Link Here
138
#'
138
#'
139
sub GetLogStatus {
139
sub GetLogStatus {
140
    my %hash;
140
    my %hash;
141
    $hash{BorrowersLog}    = C4::Context->preference("BorrowersLog");
141
    $hash{BorrowersLog}        = C4::Context->preference("BorrowersLog");
142
    $hash{CataloguingLog}  = C4::Context->preference("CataloguingLog");
142
    $hash{CataloguingLog}      = C4::Context->preference("CataloguingLog");
143
    $hash{HoldsLog}        = C4::Context->preference("HoldsLog");
143
    $hash{CataloguingLogItems} = C4::Context->preference("CataloguingLogItems");
144
    $hash{IssueLog}        = C4::Context->preference("IssueLog");
144
    $hash{HoldsLog}            = C4::Context->preference("HoldsLog");
145
    $hash{ReturnLog}       = C4::Context->preference("ReturnLog");
145
    $hash{IssueLog}            = C4::Context->preference("IssueLog");
146
    $hash{SubscriptionLog} = C4::Context->preference("SubscriptionLog");
146
    $hash{ReturnLog}           = C4::Context->preference("ReturnLog");
147
    $hash{LetterLog}       = C4::Context->preference("LetterLog");
147
    $hash{SubscriptionLog}     = C4::Context->preference("SubscriptionLog");
148
    $hash{FinesLog}        = C4::Context->preference("FinesLog");
148
    $hash{LetterLog}           = C4::Context->preference("LetterLog");
149
    $hash{FinesLog}            = C4::Context->preference("FinesLog");
149
    return \%hash;
150
    return \%hash;
150
}
151
}
151
152
(-)a/C4/UsageStats.pm (+1 lines)
Lines 212-217 sub BuildReport { Link Here
212
        AuthoritiesLog
212
        AuthoritiesLog
213
        BorrowersLog
213
        BorrowersLog
214
        CataloguingLog
214
        CataloguingLog
215
        CataloguingLogItems
215
        FinesLog
216
        FinesLog
216
        IssueLog
217
        IssueLog
217
        LetterLog
218
        LetterLog
(-)a/installer/data/mysql/atomicupdate/bug_17195.sql (+2 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
2
SELECT 'CataloguingLogItems', value, NULL,'If ON, log edit/create/delete actions on bibliographic item data. WARNING: this feature is very resource consuming.','YesNo'  FROM systempreferences WHERE variable = 'CataloguingLog';
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref (-1 / +7 lines)
Lines 17-23 Logging: Link Here
17
              choices:
17
              choices:
18
                  on: Log
18
                  on: Log
19
                  off: "Don't log"
19
                  off: "Don't log"
20
            - any changes to bibliographic or item records. Since this occurs whenever a book is checked in or out as well, it is not advisable to turn this on.
20
            - any changes to bibliographic records.
21
        -
22
            - pref: CataloguingLogItems
23
              choices:
24
                  on: Log
25
                  off: "Don't log"
26
            - any changes to item records. Since this occurs whenever a book is checked in or out as well, it is not advisable to turn this on.
21
        -
27
        -
22
            - pref: AuthoritiesLog
28
            - pref: AuthoritiesLog
23
              choices:
29
              choices:
(-)a/misc/batchRebuildItemsTables.pl (-4 / +4 lines)
Lines 49-58 my $dbh = C4::Context->dbh; Link Here
49
$dbh->{AutoCommit} = 0;
49
$dbh->{AutoCommit} = 0;
50
#sysprefs
50
#sysprefs
51
C4::Context->disable_syspref_cache() if ( defined( C4::Context->disable_syspref_cache() ) );
51
C4::Context->disable_syspref_cache() if ( defined( C4::Context->disable_syspref_cache() ) );
52
my $CataloguingLog = C4::Context->preference('CataloguingLog');
52
my $CataloguingLogItems = C4::Context->preference('CataloguingLogItems');
53
my $dontmerge = C4::Context->preference('dontmerge');
53
my $dontmerge = C4::Context->preference('dontmerge');
54
$dontmerge="0" unless defnonull($dontmerge);
54
$dontmerge="0" unless defnonull($dontmerge);
55
$dbh->do("UPDATE systempreferences SET value=0 WHERE variable='CataloguingLog'");
55
$dbh->do("UPDATE systempreferences SET value=0 WHERE variable='CataloguingLogItems'");
56
$dbh->do("UPDATE systempreferences SET value=1 where variable='dontmerge'");
56
$dbh->do("UPDATE systempreferences SET value=1 where variable='dontmerge'");
57
$dbh->commit() unless $test_parameter;
57
$dbh->commit() unless $test_parameter;
58
my ($itemfield,$itemnumbersubfield) = &GetMarcFromKohaField("items.itemnumber",'');
58
my ($itemfield,$itemnumbersubfield) = &GetMarcFromKohaField("items.itemnumber",'');
Lines 91-98 while ( my ( $biblionumber, $biblioitemnumber, $frameworkcode ) = $sth->fetchrow Link Here
91
    }
91
    }
92
}
92
}
93
93
94
my $sthCataloguingLog = $dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='CataloguingLog'");
94
my $sthCataloguingLogItems = $dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='CataloguingLogItems'");
95
$sthCataloguingLog->execute($CataloguingLog);
95
$sthCataloguingLogItems->execute($CataloguingLogItems);
96
my $sthdontmerge = $dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='dontmerge'");
96
my $sthdontmerge = $dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='dontmerge'");
97
$sthdontmerge->execute($dontmerge);
97
$sthdontmerge->execute($dontmerge);
98
$dbh->commit() unless $test_parameter;
98
$dbh->commit() unless $test_parameter;
(-)a/misc/migration_tools/bulkmarcimport.pl (+3 lines)
Lines 132-140 if ((not defined $sourcesubfield) && (not defined $sourcetag)){ Link Here
132
C4::Context->disable_syspref_cache();
132
C4::Context->disable_syspref_cache();
133
# Save current CataloguingLog and AuthoritiesLog sysprefs values
133
# Save current CataloguingLog and AuthoritiesLog sysprefs values
134
my $CataloguingLog = C4::Context->preference( 'CataloguingLog' );
134
my $CataloguingLog = C4::Context->preference( 'CataloguingLog' );
135
my $CataloguingLogItems = C4::Context->preference( 'CataloguingLogItems' );
135
my $AuthoritiesLog = C4::Context->preference( 'AuthoritiesLog' );
136
my $AuthoritiesLog = C4::Context->preference( 'AuthoritiesLog' );
136
# Disable logging for both
137
# Disable logging for both
137
C4::Context->set_preference( 'CataloguingLog', 0 );
138
C4::Context->set_preference( 'CataloguingLog', 0 );
139
C4::Context->set_preference( 'CataloguingLogItems', 0 );
138
C4::Context->set_preference( 'AuthoritiesLog', 0 );
140
C4::Context->set_preference( 'AuthoritiesLog', 0 );
139
141
140
if ($fk_off) {
142
if ($fk_off) {
Lines 523-528 if ($fk_off) { Link Here
523
525
524
# Restore CataloguingLog
526
# Restore CataloguingLog
525
C4::Context->set_preference( 'CataloguingLog', $CataloguingLog );
527
C4::Context->set_preference( 'CataloguingLog', $CataloguingLog );
528
C4::Context->set_preference( 'CataloguingLogItems', $CataloguingLogItems );
526
# Restore AuthoritiesLog
529
# Restore AuthoritiesLog
527
C4::Context->set_preference( 'AuthoritiesLog', $AuthoritiesLog );
530
C4::Context->set_preference( 'AuthoritiesLog', $AuthoritiesLog );
528
531
(-)a/t/Log.t (+1 lines)
Lines 15-20 BEGIN { Link Here
15
15
16
t::lib::Mocks::mock_preference('BorrowersLog', 1);
16
t::lib::Mocks::mock_preference('BorrowersLog', 1);
17
t::lib::Mocks::mock_preference('CataloguingLog', 1);
17
t::lib::Mocks::mock_preference('CataloguingLog', 1);
18
t::lib::Mocks::mock_preference('CataloguingLogItems', 1);
18
t::lib::Mocks::mock_preference('IssueLog', 1);
19
t::lib::Mocks::mock_preference('IssueLog', 1);
19
t::lib::Mocks::mock_preference('ReturnLog', 1);
20
t::lib::Mocks::mock_preference('ReturnLog', 1);
20
t::lib::Mocks::mock_preference('SubscriptionLog', 1);
21
t::lib::Mocks::mock_preference('SubscriptionLog', 1);
(-)a/t/db_dependent/UsageStats.t (-1 / +1 lines)
Lines 464-469 sub mocking_systempreferences_to_a_set_value { Link Here
464
        AuthoritiesLog
464
        AuthoritiesLog
465
        BorrowersLog
465
        BorrowersLog
466
        CataloguingLog
466
        CataloguingLog
467
        CataloguingLogItems
467
        FinesLog
468
        FinesLog
468
        IssueLog
469
        IssueLog
469
        LetterLog
470
        LetterLog
470
- 

Return to bug 17195