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 27-32 use Koha::DateUtils qw( dt_from_string ); Link Here
27
use Koha::Patrons;
27
use Koha::Patrons;
28
use Koha::AuthorisedValues;
28
use Koha::AuthorisedValues;
29
use Koha::Exceptions::Suggestion;
29
use Koha::Exceptions::Suggestion;
30
use C4::Log qw(logaction);
30
31
31
use base qw(Koha::Object);
32
use base qw(Koha::Object);
32
33
Lines 111-117 sub store { Link Here
111
            ) or warn "can't enqueue letter $letter";
112
            ) or warn "can't enqueue letter $letter";
112
        }
113
        }
113
    }
114
    }
114
115
    if (C4::Context->preference("NewsLog")) {
116
        logaction('SUGGESTION', 'CREATE', $result->suggestionid, '' );
117
    }
115
    return $result;
118
    return $result;
116
}
119
}
117
120
(-)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 724-729 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
724
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
724
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
725
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
725
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
726
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
726
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
727
('SuggestionsLog','0',NULL,'If ON, log pirchase suggestion changes','YesNo'),
727
('suggestionPatronCategoryExceptions', '', '', 'List the patron categories not affected by suggestion system preference if on', 'Free'),
728
('suggestionPatronCategoryExceptions', '', '', 'List the patron categories not affected by suggestion system preference if on', 'Free'),
728
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
729
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
729
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
730
('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 217-223 Link Here
217
                                        [% ELSE %]
218
                                        [% ELSE %]
218
                                            <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value=""> All</label>
219
                                            <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value=""> All</label>
219
                                        [% END %]
220
                                        [% END %]
220
                                        [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'CLAIMS' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE', 'NOTICES', 'NEWS', 'RECALLS' ] %]
221
                                        [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'CLAIMS' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE', 'NOTICES', 'NEWS', 'RECALLS', 'SUGGESTION' ] %]
221
                                            [% IF modules.grep(modx).size %]
222
                                            [% IF modules.grep(modx).size %]
222
                                                <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>
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>
223
                                            [% ELSE %]
224
                                            [% ELSE %]
Lines 383-388 Link Here
383
                                                [% ELSE %]
384
                                                [% ELSE %]
384
                                                    Basket [% loopro.object | html %]
385
                                                    Basket [% loopro.object | html %]
385
                                                [% END %]
386
                                                [% END %]
387
                                            [% ELSIF ( loopro.module == "SUGGESTION" ) %]
388
                                                <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loopro.object | uri %]&op=show">[% loopro.object | html %]</a>
386
                                            [% ELSE %]
389
                                            [% ELSE %]
387
                                                [% loopro.object | html %]
390
                                                [% loopro.object | html %]
388
                                            [% END %]
391
                                            [% END %]
389
- 

Return to bug 35597