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

(-)a/C4/Reports/Guided.pm (-1 / +5 lines)
Lines 33-38 use XML::Dumper; Link Here
33
use C4::Debug;
33
use C4::Debug;
34
# use Smart::Comments;
34
# use Smart::Comments;
35
# use Data::Dumper;
35
# use Data::Dumper;
36
use C4::Log;
36
37
37
BEGIN {
38
BEGIN {
38
    # set the version for version checking
39
    # set the version for version checking
Lines 632-637 sub format_results { Link Here
632
sub delete_report {
633
sub delete_report {
633
    my (@ids) = @_;
634
    my (@ids) = @_;
634
    return unless @ids;
635
    return unless @ids;
636
    foreach my $id (@ids) {
637
        my $data = get_saved_report($id);
638
        logaction( "REPORTS", "DELETE", $id, "Name: $data->{'report_name'} SQL: $data->{'savedsql'}  " ) if C4::Context->preference("ReportsLog");
639
    }
635
    my $dbh = C4::Context->dbh;
640
    my $dbh = C4::Context->dbh;
636
    my $query = 'DELETE FROM saved_sql WHERE id IN (' . join( ',', ('?') x @ids ) . ')';
641
    my $query = 'DELETE FROM saved_sql WHERE id IN (' . join( ',', ('?') x @ids ) . ')';
637
    my $sth = $dbh->prepare($query);
642
    my $sth = $dbh->prepare($query);
Lines 639-645 sub delete_report { Link Here
639
}
644
}
640
645
641
sub get_saved_reports_base_query {
646
sub get_saved_reports_base_query {
642
643
    my $area_name_sql_snippet = get_area_name_sql_snippet;
647
    my $area_name_sql_snippet = get_area_name_sql_snippet;
644
    return <<EOQ;
648
    return <<EOQ;
645
SELECT s.*, r.report, r.date_run, $area_name_sql_snippet, av_g.lib AS groupname, av_sg.lib AS subgroupname,
649
SELECT s.*, r.report, r.date_run, $area_name_sql_snippet, av_g.lib AS groupname, av_sg.lib AS subgroupname,
(-)a/installer/data/mysql/atomicupdate/bug_14024_add_reportslog_syspref.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 353-358 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
353
('RenewSerialAddsSuggestion','0',NULL,'If ON, adds a new suggestion at serial subscription renewal','YesNo'),
353
('RenewSerialAddsSuggestion','0',NULL,'If ON, adds a new suggestion at serial subscription renewal','YesNo'),
354
('RentalFeesCheckoutConfirmation', '0', NULL , 'Allow user to confirm when checking out an item with rental fees.', 'YesNo'),
354
('RentalFeesCheckoutConfirmation', '0', NULL , 'Allow user to confirm when checking out an item with rental fees.', 'YesNo'),
355
('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'),
355
('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'),
356
('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'),
356
('RequestOnOpac','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'),
357
('RequestOnOpac','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'),
357
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
358
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
358
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
359
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref (+6 lines)
Lines 47-49 Logging: Link Here
47
              on: Log
47
              on: Log
48
              off: "Don't log"
48
              off: "Don't log"
49
        - when serials are added, deleted or changed.
49
        - when serials are added, deleted or changed.
50
    -
51
        - pref: ReportsLog
52
          choices:
53
              on: Log
54
              off: "Don't log"
55
        - when reports are added, deleted or changed.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (-1 / +2 lines)
Lines 25-30 Link Here
25
[%        CASE 'LETTER'       %]Letter
25
[%        CASE 'LETTER'       %]Letter
26
[%        CASE 'FINES'        %]Fines
26
[%        CASE 'FINES'        %]Fines
27
[%        CASE 'SYSTEMPREFERENCE' %]System prefs
27
[%        CASE 'SYSTEMPREFERENCE' %]System prefs
28
[%        CASE 'REPORTS'      %]Reports
28
[%        CASE %][% module %]
29
[%        CASE %][% module %]
29
[%    END %]
30
[%    END %]
30
[% END %]
31
[% END %]
Lines 75-81 Link Here
75
                                    [% ELSE %]
76
                                    [% ELSE %]
76
                                        <option value="">All</option>
77
                                        <option value="">All</option>
77
                                    [% END %]
78
                                    [% END %]
78
                                    [% FOREACH modx IN [ 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' ] %]
79
                                    [% FOREACH modx IN [ 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'REPORTS' ] %]
79
                                        [% IF modules.grep(modx).size %]
80
                                        [% IF modules.grep(modx).size %]
80
                                            <option value="[% modx %]" selected="selected">[% PROCESS translate_log_module module=modx %]</option>
81
                                            <option value="[% modx %]" selected="selected">[% PROCESS translate_log_module module=modx %]</option>
81
                                        [% ELSE %]
82
                                        [% ELSE %]
(-)a/reports/guided_reports.pl (-1 / +4 lines)
Lines 31-36 use C4::Dates qw/format_date/; Link Here
31
use C4::Debug;
31
use C4::Debug;
32
use C4::Branch; # XXX subfield_is_koha_internal_p
32
use C4::Branch; # XXX subfield_is_koha_internal_p
33
use C4::Koha qw/IsAuthorisedValueCategory GetFrameworksLoop/;
33
use C4::Koha qw/IsAuthorisedValueCategory GetFrameworksLoop/;
34
use C4::Context;
35
use C4::Log;
34
36
35
=head1 NAME
37
=head1 NAME
36
38
Lines 236-241 elsif ( $phase eq 'Update SQL'){ Link Here
236
                'reportname'            => $reportname,
238
                'reportname'            => $reportname,
237
                'id'                    => $id,
239
                'id'                    => $id,
238
            );
240
            );
241
            logaction( "REPORTS", "MODIFY", $id, "$reportname: SQL: $sql" ) if C4::Context->preference("ReportsLog");
239
        }
242
        }
240
        if ( $usecache ) {
243
        if ( $usecache ) {
241
            $template->param(
244
            $template->param(
Lines 593-598 elsif ( $phase eq 'Save Report' ) { Link Here
593
                    cache_expiry   => $cache_expiry,
596
                    cache_expiry   => $cache_expiry,
594
                    public         => $public,
597
                    public         => $public,
595
                } );
598
                } );
599
                logaction( "REPORTS", "ADD", 0, "Name: $name: SQL: $sql" ) if C4::Context->preference("ReportsLog");
596
            $template->param(
600
            $template->param(
597
                'save_successful' => 1,
601
                'save_successful' => 1,
598
                'reportname'      => $name,
602
                'reportname'      => $name,
599
- 

Return to bug 14024