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

(-)a/Koha/AuthorisedValue.pm (+14 lines)
Lines 19-24 package Koha::AuthorisedValue; Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use C4::Log qw(logaction);
23
22
use Koha::Caches;
24
use Koha::Caches;
23
use Koha::Database;
25
use Koha::Database;
24
use Koha::Exceptions;
26
use Koha::Exceptions;
Lines 53-58 sub store { Link Here
53
55
54
    my $flush = 0;
56
    my $flush = 0;
55
57
58
    my $new_authorized_value = !$self->in_storage;
59
56
    if ( !$self->in_storage ) {
60
    if ( !$self->in_storage ) {
57
        $flush = 1;
61
        $flush = 1;
58
    }
62
    }
Lines 70-75 sub store { Link Here
70
74
71
    $self = $self->SUPER::store;
75
    $self = $self->SUPER::store;
72
76
77
    if ( C4::Context->preference("AuthorizedValuesLog") ) {
78
        my $action = $new_authorized_value ? 'CREATE' : 'MODIFY';
79
        logaction( 'AUTHORIZEDVALUE', $action, $self->id, $self );
80
    }
81
73
    if ($flush) {
82
    if ($flush) {
74
        my $key = "AV_descriptions:".$self->category;
83
        my $key = "AV_descriptions:".$self->category;
75
        $cache->clear_from_cache($key);
84
        $cache->clear_from_cache($key);
Lines 86-91 AuthorisedValue specific C<delete> to clear relevant caches on delete. Link Here
86
95
87
sub delete {
96
sub delete {
88
    my $self = shift @_;
97
    my $self = shift @_;
98
99
    if ( C4::Context->preference("AuthorizedValuesLog") ) {
100
        logaction( 'AUTHORIZEDVALUE', "DELETE", $self->id, $self );
101
    }
102
89
    my $key = "AV_descriptions:".$self->category;
103
    my $key = "AV_descriptions:".$self->category;
90
    $cache->clear_from_cache($key);
104
    $cache->clear_from_cache($key);
91
    $self->SUPER::delete(@_);
105
    $self->SUPER::delete(@_);
(-)a/admin/authorised_values.pl (-1 / +1 lines)
Lines 138-144 if ( $op eq 'add_form' or $op eq 'edit_form' ) { Link Here
138
                    lib_opac         => scalar $input->param('lib_opac') || undef,
138
                    lib_opac         => scalar $input->param('lib_opac') || undef,
139
                    imageurl         => $imageurl,
139
                    imageurl         => $imageurl,
140
                }
140
                }
141
            )->store;
141
            );
142
            $av->replace_library_limits( \@branches );
142
            $av->replace_library_limits( \@branches );
143
            $av->store;
143
            $av->store;
144
        };
144
        };
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (-1 / +4 lines)
Lines 102-107 Link Here
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
[%        CASE 'SUGGESTION'      %]<span>Suggestions</span>[% UNLESS Koha.Preference('SuggestionsLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %]
105
[%        CASE 'AUTHORIZEDVALUE' %]<span>Authorized values</span>[% UNLESS Koha.Preference('AuthorizedValuesLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %]
105
106
106
[%        CASE %][% module | html %]
107
[%        CASE %][% module | html %]
107
[%    END %]
108
[%    END %]
Lines 222-228 Link Here
222
                                        [% ELSE %]
223
                                        [% ELSE %]
223
                                            <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value=""> All</label>
224
                                            <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value=""> All</label>
224
                                        [% END %]
225
                                        [% END %]
225
                                        [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'CLAIMS' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE', 'NOTICES', 'NEWS', 'RECALLS', 'SUGGESTION' ] %]
226
                                        [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'CLAIMS' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE', 'NOTICES', 'NEWS', 'RECALLS', 'SUGGESTION', 'AUTHORIZEDVALUE' ] %]
226
                                            [% IF modules.grep(modx).size %]
227
                                            [% IF modules.grep(modx).size %]
227
                                                <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>
228
                                                <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>
228
                                            [% ELSE %]
229
                                            [% ELSE %]
Lines 390-395 Link Here
390
                                                [% END %]
391
                                                [% END %]
391
                                            [% ELSIF ( loopro.module == "SUGGESTION" ) %]
392
                                            [% ELSIF ( loopro.module == "SUGGESTION" ) %]
392
                                                <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loopro.object | uri %]&op=show">[% loopro.object | html %]</a>
393
                                                <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loopro.object | uri %]&op=show">[% loopro.object | html %]</a>
394
                                            [% ELSIF ( loopro.module == "AUTHORIZEDVALUE" ) %]
395
                                                <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% loopro.av.category | uri %]">[% loopro.object| html %]</a>
393
                                            [% ELSE %]
396
                                            [% ELSE %]
394
                                                [% loopro.object | html %]
397
                                                [% loopro.object | html %]
395
                                            [% END %]
398
                                            [% END %]
(-)a/tools/viewlog.pl (-1 / +13 lines)
Lines 29-34 use C4::Serials qw( CountSubscriptionFromBiblionumber ); Link Here
29
use C4::Search qw( enabled_staff_search_views );
29
use C4::Search qw( enabled_staff_search_views );
30
30
31
use Koha::ActionLogs;
31
use Koha::ActionLogs;
32
use Koha::AuthorisedValues;
32
use Koha::Database;
33
use Koha::Database;
33
use Koha::DateUtils qw( dt_from_string );
34
use Koha::DateUtils qw( dt_from_string );
34
use Koha::Items;
35
use Koha::Items;
Lines 202-207 if ($do_it) { Link Here
202
                }
203
                }
203
            }
204
            }
204
        }
205
        }
206
207
        if ( $log->module eq "AUTHORIZEDVALUE" ) {
208
            if ( $log->object ) {
209
                my $av = Koha::AuthorisedValues->find( $log->object );
210
                if ( $av && $output eq 'screen' ) {
211
                    my $category = $av->category;
212
                    $result->{av} = {
213
                        category => $category,
214
                    };
215
                }
216
            }
217
        }
205
        push @data, $result;
218
        push @data, $result;
206
    }
219
    }
207
    if ( $output eq "screen" ) {
220
    if ( $output eq "screen" ) {
208
- 

Return to bug 35630