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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (-21 / +27 lines)
Lines 96-101 Link Here
96
96
97
[%        CASE 'SEARCHENGINE' %]Search engine
97
[%        CASE 'SEARCHENGINE' %]Search engine
98
98
99
[%        CASE 'NOTICES'      %]Notices[% UNLESS Koha.Preference('NoticesLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
99
[%        CASE %][% module | html %]
100
[%        CASE %][% module | html %]
100
[%    END %]
101
[%    END %]
101
[% END %]
102
[% END %]
Lines 190-196 Link Here
190
                                        [% ELSE %]
191
                                        [% ELSE %]
191
                                            <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value=""> All</label>
192
                                            <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value=""> All</label>
192
                                        [% END %]
193
                                        [% END %]
193
                                        [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE' ] %]
194
                                        [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE', 'NOTICES' ] %]
194
                                            [% IF modules.grep(modx).size %]
195
                                            [% IF modules.grep(modx).size %]
195
                                                <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>
196
                                                <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>
196
                                            [% ELSE %]
197
                                            [% ELSE %]
Lines 324-350 Link Here
324
                                            [% ELSE %]
325
                                            [% ELSE %]
325
                                                [% loopro.object | html %]
326
                                                [% loopro.object | html %]
326
                                            [% END %]
327
                                            [% END %]
328
                                        [% ELSIF ( loopro.module == 'CATALOGUING' ) %]
329
                                            [% IF ( loopro.info.substr(0, 4) == 'item' ) %]
330
                                                <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object | uri %]&amp;biblionumber=[% loopro.biblionumber | uri %]&amp;bi=[% loopro.biblioitemnumber | uri %]#item[% loopro.object | uri %]">Item [% loopro.object | html %]</a> from
331
                                                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.biblionumber | uri %]" title="Display detail for this biblio">Biblio [% loopro.biblionumber | html %]</a>
332
                                            [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %]
333
                                                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
334
                                            [% ELSE %]
335
                                                [% loopro.object | html %]
336
                                            [% END %]
337
                                        [% ELSIF ( loopro.module == 'SERIAL' ) %]
338
                                            <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% loopro.object | uri %]">Subscription [% loopro.object | html %] </a>
339
                                        [% ELSIF ( loopro.module == 'AUTHORITIES' ) %]
340
                                            <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% loopro.object | uri %]" title="Display detail for this authority">Authority [% loopro.object | html %]</a>
341
                                        [% ELSIF ( loopro.module == 'NOTICES' ) %]
342
                                            [% IF ( loopro.notice ) %]
343
                                                <a href="/cgi-bin/koha/tools/letter.pl?op=add_form&branchcode=[% loopro.notice.branchcode | uri %]&module=[% loopro.notice.module | uri %]&code=[% loopro.notice.code | uri %]&lang=[% loopro.notice.lang | uri %]">Notice [% loopro.notice.title | html %] ([% loopro.notice.code | html %])</a>
344
                                            [% ELSE %]
345
                                                [% loopro.object | html %]
346
                                            [% END %]
327
                                        [% ELSE %]
347
                                        [% ELSE %]
328
                                                [% IF ( loopro.module == 'CATALOGUING' ) %]
348
                                            [% loopro.object | html %]
329
                                                    [% IF ( loopro.info.substr(0, 4) == 'item' ) %]
330
                                                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object | uri %]&amp;biblionumber=[% loopro.biblionumber | uri %]&amp;bi=[% loopro.biblioitemnumber | uri %]#item[% loopro.object | uri %]">Item [% loopro.object | html %]</a> from
331
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.biblionumber | uri %]" title="Display detail for this biblio">Biblio [% loopro.biblionumber | html %]</a>
332
                                                    [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %]
333
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
334
                                                    [% ELSE %]
335
                                                        [% loopro.object | html %]
336
                                                    [% END %]
337
                                                [% ELSE %]
338
                                                    [% IF ( loopro.module == 'SERIAL' ) %]
339
                                                        <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% loopro.object | uri %]">Subscription [% loopro.object | html %] </a>
340
                                                    [% ELSE %]
341
                                                        [% IF ( loopro.module == 'AUTHORITIES' ) %]
342
                                                            <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% loopro.object | uri %]" title="Display detail for this authority">Authority [% loopro.object | html %]</a>
343
                                                        [% ELSE %]
344
                                                            [% loopro.object | html %]
345
                                                        [% END %]
346
                                                    [% END %]
347
                                                [% END %]
348
                                        [% END %]
349
                                        [% END %]
349
                                    </td>
350
                                    </td>
350
                                    <td>
351
                                    <td>
Lines 356-361 Link Here
356
                                                <div class="compare_info" id="compare_info[% loopro.action_id | html %]">
357
                                                <div class="compare_info" id="compare_info[% loopro.action_id | html %]">
357
                                                    <label><input type="checkbox" name="diff" id="action_id[% loopro.action_id | html %]" data-actionid="[% loopro.action_id | html %]" data-filter="[% FOREACH info IN loopro.info.split(' \| ') %][% IF loop.first %][% info | html %][% END %][% END %]" class="compare" /> Compare</label>
358
                                                    <label><input type="checkbox" name="diff" id="action_id[% loopro.action_id | html %]" data-actionid="[% loopro.action_id | html %]" data-filter="[% FOREACH info IN loopro.info.split(' \| ') %][% IF loop.first %][% info | html %][% END %][% END %]" class="compare" /> Compare</label>
358
                                                </div>
359
                                                </div>
360
                                            [% ELSIF loopro.module == "NOTICES" %]
361
                                                <div class="loginfo" id="loginfo[% loopro.action_id | html %]">[% loopro.info | trim | html %]</div>
362
                                                <div class="compare_info" id="compare_info[% loopro.action_id | html %]">
363
                                                    <label><input type="checkbox" name="diff" id="action_id[% loopro.action_id | html %]" data-actionid="[% loopro.action_id | html %]" data-filter="[% IF loopro.notice %][% loopro.notice.title | html %][% ELSE %][% loopro.object | html %][% END %]" class="compare" /> Compare</label>
364
                                                </div>
359
                                            [% ELSE %]
365
                                            [% ELSE %]
360
                                                <div class="loginfo" id="loginfo[% loopro.action_id | html %]">
366
                                                <div class="loginfo" id="loginfo[% loopro.action_id | html %]">
361
                                                    [% loopro.info | html %]
367
                                                    [% loopro.info | html %]
(-)a/tools/letter.pl (-9 / +32 lines)
Lines 46-51 use C4::Auth; Link Here
46
use C4::Context;
46
use C4::Context;
47
use C4::Output;
47
use C4::Output;
48
use C4::Letters;
48
use C4::Letters;
49
use C4::Log;
49
50
50
use Koha::Patron::Attribute::Types;
51
use Koha::Patron::Attribute::Types;
51
52
Lines 315-320 sub add_validate { Link Here
315
            next;
316
            next;
316
        }
317
        }
317
        elsif ( $letter and $letter->{message_transport_type} eq $mtt and $letter->{lang} eq $lang ) {
318
        elsif ( $letter and $letter->{message_transport_type} eq $mtt and $letter->{lang} eq $lang ) {
319
            logaction( 'NOTICES', 'MODIFY', $letter->{id}, $content,
320
                'Intranet' )
321
              if ( C4::Context->preference("NoticesLog")
322
                && $content ne $letter->{content} );
318
            $dbh->do(
323
            $dbh->do(
319
                q{
324
                q{
320
                    UPDATE letter
325
                    UPDATE letter
Lines 326-336 sub add_validate { Link Here
326
                $branchcode, $oldmodule, $code, $mtt, $lang
331
                $branchcode, $oldmodule, $code, $mtt, $lang
327
            );
332
            );
328
        } else {
333
        } else {
329
            $dbh->do(
334
            my $letter = Koha::Notice::Template->new(
330
                q{INSERT INTO letter (branchcode,module,code,name,is_html,title,content,message_transport_type, lang) VALUES (?,?,?,?,?,?,?,?,?)},
335
                {
331
                undef,
336
                    branchcode             => $branchcode,
332
                $branchcode || '', $module, $code, $name, $is_html || 0, $title, $content, $mtt, $lang
337
                    module                 => $module,
333
            );
338
                    code                   => $code,
339
                    name                   => $name,
340
                    is_html                => $is_html,
341
                    title                  => $title,
342
                    content                => $content,
343
                    message_transport_type => $mtt,
344
                    lang                   => $lang
345
                }
346
            )->store;
347
            logaction( 'NOTICES', 'CREATE', $letter->id, $letter->content,
348
                'Intranet' )
349
              if C4::Context->preference("NoticesLog");
334
        }
350
        }
335
    }
351
    }
336
    # set up default display
352
    # set up default display
Lines 350-365 sub delete_confirm { Link Here
350
}
366
}
351
367
352
sub delete_confirmed {
368
sub delete_confirmed {
353
    my ($branchcode, $module, $code, $mtt, $lang) = @_;
369
    my ( $branchcode, $module, $code, $mtt, $lang ) = @_;
354
    C4::Letters::DelLetter(
370
    my $letters = Koha::Notice::Templates->search(
355
        {
371
        {
356
            branchcode => $branchcode || '',
372
            branchcode => $branchcode || '',
357
            module     => $module,
373
            module     => $module,
358
            code       => $code,
374
            code       => $code,
359
            mtt        => $mtt,
375
            ( $mtt ? ( message_transport_type => $mtt ) : () ),
360
            lang       => $lang,
376
            ( $lang ? ( lang => $lang ) : () ),
361
        }
377
        }
362
    );
378
    );
379
    while ( my $letter = $letters->next ) {
380
        logaction( 'NOTICES', 'DELETE', $letter->id, $letter->content,
381
            'Intranet' )
382
          if C4::Context->preference("NoticesLog");
383
        $letter->delete;
384
    }
385
363
    # setup default display for screen
386
    # setup default display for screen
364
    default_display($branchcode);
387
    default_display($branchcode);
365
    return;
388
    return;
(-)a/tools/viewlog.pl (-1 / +10 lines)
Lines 186-191 if ($do_it) { Link Here
186
                }
186
                }
187
            }
187
            }
188
        }
188
        }
189
190
        if ( $log->module eq 'NOTICES' ) {
191
            if ( $log->object ) {
192
                my $notice = Koha::Notice::Templates->find( { id => $log->object } );
193
                if ($notice && $output eq 'screen') {
194
                    $result->{notice} = $notice->unblessed;
195
                }
196
            }
197
        }
198
189
        push @data, $result;
199
        push @data, $result;
190
    }
200
    }
191
    if ( $output eq "screen" ) {
201
    if ( $output eq "screen" ) {
192
- 

Return to bug 14233