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

(-)a/C4/Reports/Guided.pm (-1 / +5 lines)
Lines 32-37 use XML::Dumper; Link Here
32
use C4::Debug;
32
use C4::Debug;
33
# use Smart::Comments;
33
# use Smart::Comments;
34
# use Data::Dumper;
34
# use Data::Dumper;
35
use C4::Log;
35
36
36
BEGIN {
37
BEGIN {
37
    # set the version for version checking
38
    # set the version for version checking
Lines 639-644 sub format_results { Link Here
639
sub delete_report {
640
sub delete_report {
640
    my (@ids) = @_;
641
    my (@ids) = @_;
641
    return unless @ids;
642
    return unless @ids;
643
    foreach my $id (@ids) {
644
        my $data = get_saved_report($id);
645
        logaction( "REPORTS", "DELETE", $id, "Name: $data->{'report_name'} SQL: $data->{'savedsql'}  " ) if C4::Context->preference("ReportsLog");
646
    }
642
    my $dbh = C4::Context->dbh;
647
    my $dbh = C4::Context->dbh;
643
    my $query = 'DELETE FROM saved_sql WHERE id IN (' . join( ',', ('?') x @ids ) . ')';
648
    my $query = 'DELETE FROM saved_sql WHERE id IN (' . join( ',', ('?') x @ids ) . ')';
644
    my $sth = $dbh->prepare($query);
649
    my $sth = $dbh->prepare($query);
Lines 646-652 sub delete_report { Link Here
646
}
651
}
647
652
648
sub get_saved_reports_base_query {
653
sub get_saved_reports_base_query {
649
650
    my $area_name_sql_snippet = get_area_name_sql_snippet;
654
    my $area_name_sql_snippet = get_area_name_sql_snippet;
651
    return <<EOQ;
655
    return <<EOQ;
652
SELECT s.*, r.report, r.date_run, $area_name_sql_snippet, av_g.lib AS groupname, av_sg.lib AS subgroupname,
656
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 357-362 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
357
('RenewSerialAddsSuggestion','0',NULL,'If ON, adds a new suggestion at serial subscription renewal','YesNo'),
357
('RenewSerialAddsSuggestion','0',NULL,'If ON, adds a new suggestion at serial subscription renewal','YesNo'),
358
('RentalFeesCheckoutConfirmation', '0', NULL , 'Allow user to confirm when checking out an item with rental fees.', 'YesNo'),
358
('RentalFeesCheckoutConfirmation', '0', NULL , 'Allow user to confirm when checking out an item with rental fees.', 'YesNo'),
359
('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'),
359
('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'),
360
('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'),
360
('RequestOnOpac','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'),
361
('RequestOnOpac','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'),
361
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
362
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
362
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
363
('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 53-55 Logging: Link Here
53
              on: Log
53
              on: Log
54
              off: "Don't log"
54
              off: "Don't log"
55
        - information from cron jobs.
55
        - information from cron jobs.
56
    -
57
        - pref: ReportsLog
58
          choices:
59
              on: Log
60
              off: "Don't log"
61
        - when reports are added, deleted or changed.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (-1 / +2 lines)
Lines 27-32 Link Here
27
[%        CASE 'FINES'        %]Fines
27
[%        CASE 'FINES'        %]Fines
28
[%        CASE 'SYSTEMPREFERENCE' %]System prefs
28
[%        CASE 'SYSTEMPREFERENCE' %]System prefs
29
[%        CASE 'CRONJOBS' %]Cron jobs
29
[%        CASE 'CRONJOBS' %]Cron jobs
30
[%        CASE 'REPORTS'      %]Reports
30
[%        CASE %][% module %]
31
[%        CASE %][% module %]
31
[%    END %]
32
[%    END %]
32
[% END %]
33
[% END %]
Lines 77-83 Link Here
77
                                    [% ELSE %]
78
                                    [% ELSE %]
78
                                        <option value="">All</option>
79
                                        <option value="">All</option>
79
                                    [% END %]
80
                                    [% END %]
80
                                    [% FOREACH modx IN [ 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS' ] %]
81
                                    [% FOREACH modx IN [ 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS' ] %]
81
                                        [% IF modules.grep(modx).size %]
82
                                        [% IF modules.grep(modx).size %]
82
                                            <option value="[% modx %]" selected="selected">[% PROCESS translate_log_module module=modx %]</option>
83
                                            <option value="[% modx %]" selected="selected">[% PROCESS translate_log_module module=modx %]</option>
83
                                        [% ELSE %]
84
                                        [% 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 237-242 elsif ( $phase eq 'Update SQL'){ Link Here
237
                'reportname'            => $reportname,
239
                'reportname'            => $reportname,
238
                'id'                    => $id,
240
                'id'                    => $id,
239
            );
241
            );
242
            logaction( "REPORTS", "MODIFY", $id, "$reportname: SQL: $sql" ) if C4::Context->preference("ReportsLog");
240
        }
243
        }
241
        if ( $usecache ) {
244
        if ( $usecache ) {
242
            $template->param(
245
            $template->param(
Lines 594-599 elsif ( $phase eq 'Save Report' ) { Link Here
594
                    cache_expiry   => $cache_expiry,
597
                    cache_expiry   => $cache_expiry,
595
                    public         => $public,
598
                    public         => $public,
596
                } );
599
                } );
600
                logaction( "REPORTS", "ADD", 0, "Name: $name: SQL: $sql" ) if C4::Context->preference("ReportsLog");
597
            $template->param(
601
            $template->param(
598
                'save_successful' => 1,
602
                'save_successful' => 1,
599
                'reportname'      => $name,
603
                'reportname'      => $name,
600
- 

Return to bug 14024