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

(-)a/C4/Suggestions.pm (+7 lines)
Lines 27-32 use C4::Letters; Link Here
27
use C4::Biblio qw( GetMarcFromKohaField );
27
use C4::Biblio qw( GetMarcFromKohaField );
28
use Koha::DateUtils qw( dt_from_string );
28
use Koha::DateUtils qw( dt_from_string );
29
use Koha::Suggestions;
29
use Koha::Suggestions;
30
use C4::Log qw(logaction);
30
31
31
use base qw(Exporter);
32
use base qw(Exporter);
32
33
Lines 290-295 sub ModSuggestion { Link Here
290
            ) or warn "can't enqueue letter $letter";
291
            ) or warn "can't enqueue letter $letter";
291
        }
292
        }
292
    }
293
    }
294
    if (C4::Context->preference("SuggestionsLog")) {
295
        logaction('SUGGESTION', 'MODIFY', $suggestion->{suggestionid}, $suggestion_object );
296
    }
293
    return 1; # No useful if the exception is raised earlier
297
    return 1; # No useful if the exception is raised earlier
294
}
298
}
295
299
Lines 343-348 sub DelSuggestion { Link Here
343
        };
347
        };
344
        $sth = $dbh->prepare($queryDelete);
348
        $sth = $dbh->prepare($queryDelete);
345
        my $suggestiondeleted = $sth->execute($suggestionid);
349
        my $suggestiondeleted = $sth->execute($suggestionid);
350
        if (C4::Context->preference("SuggestionsLog")) {
351
            logaction('SUGGESTION', 'DELETE', $suggestionid, '' );
352
        }
346
        return $suggestiondeleted;
353
        return $suggestiondeleted;
347
    }
354
    }
348
}
355
}
(-)a/Koha/Suggestion.pm (-1 / +4 lines)
Lines 28-33 use Koha::DateUtils qw( dt_from_string ); Link Here
28
use Koha::Patrons;
28
use Koha::Patrons;
29
use Koha::AuthorisedValues;
29
use Koha::AuthorisedValues;
30
use Koha::Exceptions::Suggestion;
30
use Koha::Exceptions::Suggestion;
31
use C4::Log qw(logaction);
31
32
32
use base qw(Koha::Object);
33
use base qw(Koha::Object);
33
34
Lines 112-118 sub store { Link Here
112
            ) or warn "can't enqueue letter $letter";
113
            ) or warn "can't enqueue letter $letter";
113
        }
114
        }
114
    }
115
    }
115
116
    if (C4::Context->preference("NewsLog")) {
117
        logaction('SUGGESTION', 'CREATE', $result->suggestionid, '' );
118
    }
116
    return $result;
119
    return $result;
117
}
120
}
118
121
(-)a/installer/data/mysql/atomicupdate/bug_35597.pl (+19 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "35597",
5
    description => "Add SuggestionsLog system preference ",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # sysprefs
11
        $dbh->do(
12
            q{
13
            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
14
            VALUES ('SuggestionsLog', '0', 'If enabled, log purchase suggestion changes', '' , 'YesNo')
15
        }
16
        );
17
        say $out "Added new system preference 'SuggestionsLog'";
18
    },
19
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 742-747 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
742
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
742
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
743
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
743
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
744
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
744
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
745
('SuggestionsLog','0',NULL,'If ON, log pirchase suggestion changes','YesNo'),
745
('suggestionPatronCategoryExceptions', '', '', 'List the patron categories not affected by suggestion system preference if on', 'Free'),
746
('suggestionPatronCategoryExceptions', '', '', 'List the patron categories not affected by suggestion system preference if on', 'Free'),
746
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
747
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
747
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
748
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref (+6 lines)
Lines 114-119 Logging: Link Here
114
                  1: Log
114
                  1: Log
115
                  0: "Don't log"
115
                  0: "Don't log"
116
            - any actions on recalls (create, cancel, expire, fulfill).
116
            - any actions on recalls (create, cancel, expire, fulfill).
117
        -
118
            - pref: SuggestionsLog
119
              choices:
120
                  1: Log
121
                  0: "Don't log"
122
            - any changes to purchase suggestions (create, modify, delete ).
117
123
118
    Debugging:
124
    Debugging:
119
        -
125
        -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (-2 / +4 lines)
Lines 101-106 Link Here
101
[%        CASE 'NOTICES'      %]<span>Notices</span>[% UNLESS Koha.Preference('NoticesLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %]
101
[%        CASE 'NOTICES'      %]<span>Notices</span>[% UNLESS Koha.Preference('NoticesLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %]
102
[%        CASE 'NEWS'      %]<span>News</span>[% UNLESS Koha.Preference('NewsLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %]
102
[%        CASE 'NEWS'      %]<span>News</span>[% UNLESS Koha.Preference('NewsLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %]
103
[%        CASE 'RECALLS'      %]<span>Recalls</span>[% UNLESS Koha.Preference('RecallsLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %]
103
[%        CASE 'RECALLS'      %]<span>Recalls</span>[% UNLESS Koha.Preference('RecallsLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %]
104
[%        CASE 'SUGGESTION'      %]<span>Suggestions</span>[% UNLESS Koha.Preference('SuggestionsLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %]
104
105
105
[%        CASE %][% module | html %]
106
[%        CASE %][% module | html %]
106
[%    END %]
107
[%    END %]
Lines 218-224 Link Here
218
                                        [% ELSE %]
219
                                        [% ELSE %]
219
                                            <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value=""> All</label>
220
                                            <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value=""> All</label>
220
                                        [% END %]
221
                                        [% END %]
221
                                        [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'CLAIMS' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE', 'NOTICES', 'NEWS', 'RECALLS' ] %]
222
                                        [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'CLAIMS' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE', 'NOTICES', 'NEWS', 'RECALLS', 'SUGGESTION' ] %]
222
                                            [% IF modules.grep(modx).size %]
223
                                            [% IF modules.grep(modx).size %]
223
                                                <label for="module[% modx | html %]" class="viewlog"><input type="checkbox" id="module[% modx | html %]" name="modules" value="[% modx | html %]" checked="checked"> [% PROCESS translate_log_module module=modx %]</label>
224
                                                <label for="module[% modx | html %]" class="viewlog"><input type="checkbox" id="module[% modx | html %]" name="modules" value="[% modx | html %]" checked="checked"> [% PROCESS translate_log_module module=modx %]</label>
224
                                            [% ELSE %]
225
                                            [% ELSE %]
Lines 384-389 Link Here
384
                                                [% ELSE %]
385
                                                [% ELSE %]
385
                                                    Basket [% loopro.object | html %]
386
                                                    Basket [% loopro.object | html %]
386
                                                [% END %]
387
                                                [% END %]
388
                                            [% ELSIF ( loopro.module == "SUGGESTION" ) %]
389
                                                <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loopro.object | uri %]&op=show">[% loopro.object | html %]</a>
387
                                            [% ELSE %]
390
                                            [% ELSE %]
388
                                                [% loopro.object | html %]
391
                                                [% loopro.object | html %]
389
                                            [% END %]
392
                                            [% END %]
390
- 

Return to bug 35597