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

(-)a/Koha/Illrequest.pm (-71 / +280 lines)
Lines 26-31 use Mail::Sendmail; Link Here
26
use Try::Tiny;
26
use Try::Tiny;
27
use DateTime;
27
use DateTime;
28
28
29
use C4::Letters;
30
use C4::Members;
29
use Koha::Database;
31
use Koha::Database;
30
use Koha::DateUtils qw/ dt_from_string /;
32
use Koha::DateUtils qw/ dt_from_string /;
31
use Koha::Email;
33
use Koha::Email;
Lines 248-253 sub status_alias { Link Here
248
250
249
Overloaded getter/setter for request status,
251
Overloaded getter/setter for request status,
250
also nullifies status_alias and records the fact that the status has changed
252
also nullifies status_alias and records the fact that the status has changed
253
and sends a notice if appropriate
251
254
252
=cut
255
=cut
253
256
Lines 281-286 sub status { Link Here
281
            });
284
            });
282
        }
285
        }
283
        delete $self->{previous_status};
286
        delete $self->{previous_status};
287
        # If status has changed to cancellation requested, send a notice
288
        if ($new_status eq 'CANCREQ') {
289
            $self->send_staff_notice('ILL_REQUEST_CANCEL');
290
        }
284
        return $ret;
291
        return $ret;
285
    } else {
292
    } else {
286
        return $current_status;
293
        return $current_status;
Lines 1287-1324 sub generic_confirm { Link Here
1287
    my $branch = Koha::Libraries->find($params->{current_branchcode})
1294
    my $branch = Koha::Libraries->find($params->{current_branchcode})
1288
        || die "Invalid current branchcode. Are you logged in as the database user?";
1295
        || die "Invalid current branchcode. Are you logged in as the database user?";
1289
    if ( !$params->{stage}|| $params->{stage} eq 'init' ) {
1296
    if ( !$params->{stage}|| $params->{stage} eq 'init' ) {
1290
        my $draft->{subject} = "ILL Request";
1291
        $draft->{body} = <<EOF;
1292
Dear Sir/Madam,
1293
1294
    We would like to request an interlibrary loan for a title matching the
1295
following description:
1296
1297
EOF
1298
1299
        my $details = $self->metadata;
1300
        while (my ($title, $value) = each %{$details}) {
1301
            $draft->{body} .= "  - " . $title . ": " . $value . "\n"
1302
                if $value;
1303
        }
1304
        $draft->{body} .= <<EOF;
1305
1306
Please let us know if you are able to supply this to us.
1307
1308
Kind Regards
1309
1310
EOF
1311
1297
1312
        my @address = map { $branch->$_ }
1298
        # Get the message body from the notice definition
1313
            qw/ branchname branchaddress1 branchaddress2 branchaddress3
1299
        my $letter = $self->get_notice({
1314
                branchzip branchcity branchstate branchcountry branchphone
1300
            notice_code => 'ILL_PARTNER_REQ',
1315
                branchillemail branchemail /;
1301
            transport   => 'email'
1316
        my $address = "";
1302
        });
1317
        foreach my $line ( @address ) {
1318
            $address .= $line . "\n" if $line;
1319
        }
1320
1321
        $draft->{body} .= $address;
1322
1303
1323
        my $partners = Koha::Patrons->search({
1304
        my $partners = Koha::Patrons->search({
1324
            categorycode => $self->_config->partner_code
1305
            categorycode => $self->_config->partner_code
Lines 1330-1336 EOF Link Here
1330
            method  => 'generic_confirm',
1311
            method  => 'generic_confirm',
1331
            stage   => 'draft',
1312
            stage   => 'draft',
1332
            value   => {
1313
            value   => {
1333
                draft    => $draft,
1314
                draft => {
1315
                    subject => $letter->{title},
1316
                    body    => $letter->{content}
1317
                },
1334
                partners => $partners,
1318
                partners => $partners,
1335
            }
1319
            }
1336
        };
1320
        };
Lines 1346-1402 EOF Link Here
1346
            "No target email addresses found. Either select at least one partner or check your ILL partner library records.")
1330
            "No target email addresses found. Either select at least one partner or check your ILL partner library records.")
1347
          if ( !$to );
1331
          if ( !$to );
1348
        # Create the from, replyto and sender headers
1332
        # Create the from, replyto and sender headers
1349
        my $from = $branch->branchemail;
1333
        my $from = $branch->branchillemail || $branch->branchemail;
1350
        my $replyto = $branch->branchreplyto || $from;
1334
        my $replyto = $branch->branchreplyto || $from;
1351
        Koha::Exceptions::Ill::NoLibraryEmail->throw(
1335
        Koha::Exceptions::Ill::NoLibraryEmail->throw(
1352
            "Your library has no usable email address. Please set it.")
1336
            "Your library has no usable email address. Please set it.")
1353
          if ( !$from );
1337
          if ( !$from );
1354
1338
1355
        # Create the email
1339
        # So we get a notice hashref, then substitute the possibly
1356
        my $message = Koha::Email->new;
1340
        # modified title and body from the draft stage
1357
        my %mail = $message->create_message_headers(
1341
        my $letter = $self->get_notice({
1358
            {
1342
            notice_code => 'ILL_PARTNER_REQ',
1359
                to          => $to,
1343
            transport   => 'email'
1360
                from        => $from,
1344
        });
1361
                replyto     => $replyto,
1345
        $letter->{title} = $params->{subject};
1362
                subject     => Encode::encode( "utf8", $params->{subject} ),
1346
        $letter->{content} = $params->{body};
1363
                message     => Encode::encode( "utf8", $params->{body} ),
1347
1364
                contenttype => 'text/plain',
1348
        # Send the email
1349
        my $params = {
1350
            letter                 => $letter,
1351
            borrowernumber         => $self->borrowernumber,
1352
            message_transport_type => 'email',
1353
            to_address             => $to,
1354
            from_address           => $from
1355
        };
1356
1357
        if ($letter) {
1358
            my $result = C4::Letters::EnqueueLetter($params);
1359
            if ( $result ) {
1360
                $self->status("GENREQ")->store;
1361
                $self->_backend_capability(
1362
                    'set_requested_partners',
1363
                    {
1364
                        request => $self,
1365
                        to => $to
1366
                    }
1367
                );
1368
                return {
1369
                    error   => 0,
1370
                    status  => '',
1371
                    message => '',
1372
                    method  => 'generic_confirm',
1373
                    stage   => 'commit',
1374
                    next    => 'illview',
1375
                };
1365
            }
1376
            }
1366
        );
1367
        # Send it
1368
        my $result = sendmail(%mail);
1369
        if ( $result ) {
1370
            $self->status("GENREQ")->store;
1371
            $self->_backend_capability(
1372
                'set_requested_partners',
1373
                {
1374
                    request => $self,
1375
                    to => $to
1376
                }
1377
            );
1378
            return {
1379
                error   => 0,
1380
                status  => '',
1381
                message => '',
1382
                method  => 'generic_confirm',
1383
                stage   => 'commit',
1384
                next    => 'illview',
1385
            };
1386
        } else {
1387
            return {
1388
                error   => 1,
1389
                status  => 'email_failed',
1390
                message => $Mail::Sendmail::error,
1391
                method  => 'generic_confirm',
1392
                stage   => 'draft',
1393
            };
1394
        }
1377
        }
1378
        return {
1379
            error   => 1,
1380
            status  => 'email_failed',
1381
            message => 'Email queueing failed',
1382
            method  => 'generic_confirm',
1383
            stage   => 'draft',
1384
        };
1395
    } else {
1385
    } else {
1396
        die "Unknown stage, should not have happened."
1386
        die "Unknown stage, should not have happened."
1397
    }
1387
    }
1398
}
1388
}
1399
1389
1390
=head3 get_staff_to_address
1391
1392
    my $email = $request->get_staff_to_address();
1393
1394
Get the email address to which staff notices should be sent
1395
1396
=cut
1397
1398
sub get_staff_to_address {
1399
    my ( $self ) = @_;
1400
1401
    # The various places we can get an ILL staff email address from
1402
    # (In order of preference)
1403
    #
1404
    # Dedicated branch address
1405
    my $library = Koha::Libraries->find( $self->branchcode );
1406
    my $branch_ill_to = $library->branchillemail;
1407
    # General purpose ILL address from syspref
1408
    my $syspref = C4::Context->preference("ILLDefaultStaffEmail");
1409
    # Branch general email address
1410
    my $branch_to = $library->branchemail;
1411
    # Last resort
1412
    my $koha_admin = C4::Context->preference('KohaAdminEmailAddress');
1413
1414
    my $to;
1415
    if ($branch_ill_to) {
1416
        $to = $branch_ill_to;
1417
    } elsif ($syspref) {
1418
        $to = $syspref;
1419
    } elsif ($branch_to) {
1420
        $to = $branch_to;
1421
    } elsif ($koha_admin) {
1422
        $to = $koha_admin;
1423
    }
1424
1425
    # $to will not be defined if we didn't find a usable address
1426
    return $to;
1427
}
1428
1429
=head3 send_patron_notice
1430
1431
    my $result = $request->send_patron_notice($notice_code);
1432
1433
Send a specified notice regarding this request to a patron
1434
1435
=cut
1436
1437
sub send_patron_notice {
1438
    my ( $self, $notice_code ) = @_;
1439
1440
    # We need a notice code
1441
    if (!$notice_code) {
1442
        return {
1443
            error => 'notice_no_type'
1444
        };
1445
    }
1446
1447
    # Map from the notice code to the messaging preference
1448
    my %message_name = (
1449
        ILL_PICKUP_READY   => 'Ill_ready',
1450
        ILL_REQUEST_UNAVAIL => 'Ill_unavailable'
1451
    );
1452
1453
    # Get the patron's messaging preferences
1454
    my $borrower_preferences = C4::Members::Messaging::GetMessagingPreferences({
1455
        borrowernumber => $self->borrowernumber,
1456
        message_name   => $message_name{$notice_code}
1457
    });
1458
    my @transports = keys %{ $borrower_preferences->{transports} };
1459
1460
    # Send the notice to the patron via the chosen transport methods
1461
    # and record the results
1462
    my @success = ();
1463
    my @fail = ();
1464
    for my $transport (@transports) {
1465
        my $letter = $self->get_notice({
1466
            notice_code => $notice_code,
1467
            transport   => $transport
1468
        });
1469
        if ($letter) {
1470
            my $result = C4::Letters::EnqueueLetter({
1471
                letter                 => $letter,
1472
                borrowernumber         => $self->borrowernumber,
1473
                message_transport_type => $transport,
1474
            });
1475
            if ($result) {
1476
                push @success, $transport;
1477
            } else {
1478
                push @fail, $transport;
1479
            }
1480
        } else {
1481
            push @fail, $transport;
1482
        }
1483
    }
1484
    if (scalar @success > 0) {
1485
        my $logger = Koha::Illrequest::Logger->new;
1486
        $logger->log_patron_notice({
1487
            request => $self,
1488
            notice_code => $notice_code
1489
        });
1490
    }
1491
    return {
1492
        result => {
1493
            success => \@success,
1494
            fail    => \@fail
1495
        }
1496
    };
1497
}
1498
1499
=head3 send_staff_notice
1500
1501
    my $result = $request->send_staff_notice($notice_code);
1502
1503
Send a specified notice regarding this request to staff
1504
1505
=cut
1506
1507
sub send_staff_notice {
1508
    my ( $self, $notice_code ) = @_;
1509
1510
    # We need a notice code
1511
    if (!$notice_code) {
1512
        return {
1513
            error => 'notice_no_type'
1514
        };
1515
    }
1516
1517
    # Get the staff notices that have been assigned for sending in
1518
    # the syspref
1519
    my $staff_to_send = C4::Context->preference('ILLSendStaffNotices');
1520
1521
    # If it hasn't been enabled in the syspref, we don't want to send it
1522
    if ($staff_to_send !~ /\b$notice_code\b/) {
1523
        return {
1524
            error => 'notice_not_enabled'
1525
        };
1526
    }
1527
1528
    my $letter = $self->get_notice({
1529
        notice_code => $notice_code,
1530
        transport   => 'email'
1531
    });
1532
1533
    # Try and get an address to which to send staff notices
1534
    my $to_address = scalar $self->get_staff_to_address;
1535
1536
    my $params = {
1537
        letter                 => $letter,
1538
        borrowernumber         => $self->borrowernumber,
1539
        message_transport_type => 'email',
1540
    };
1541
1542
    if ($to_address) {
1543
        $params->{to_address} = $to_address;
1544
        $params->{from_address} = $to_address;
1545
    } else {
1546
        return {
1547
            error => 'notice_no_create'
1548
        };
1549
    }
1550
1551
    if ($letter) {
1552
        C4::Letters::EnqueueLetter($params)
1553
            or warn "can't enqueue letter $letter";
1554
        return {
1555
            success => 'notice_queued'
1556
        };
1557
    } else {
1558
        return {
1559
            error => 'notice_no_create'
1560
        };
1561
    }
1562
}
1563
1564
=head3 get_notice
1565
1566
    my $notice = $request->get_notice($params);
1567
1568
Return a compiled notice hashref for the passed notice code
1569
and transport type
1570
1571
=cut
1572
1573
sub get_notice {
1574
    my ( $self, $params ) = @_;
1575
1576
    my $title = $self->illrequestattributes->find(
1577
        { type => 'title' }
1578
    );
1579
    my $author = $self->illrequestattributes->find(
1580
        { type => 'author' }
1581
    );
1582
    my $metahash = $self->metadata;
1583
    my @metaarray = ();
1584
    while (my($key, $value) = each %{$metahash}) {
1585
        push @metaarray, "- $key: $value" if $value;
1586
    }
1587
    my $metastring = join("\n", @metaarray);
1588
    my $letter = C4::Letters::GetPreparedLetter(
1589
        module                 => 'ill',
1590
        letter_code            => $params->{notice_code},
1591
        message_transport_type => $params->{transport},
1592
        lang                   => $self->patron->lang,
1593
        tables                 => {
1594
            illrequests => $self->illrequest_id,
1595
            borrowers   => $self->borrowernumber,
1596
            biblio      => $self->biblio_id,
1597
            branches    => $self->branchcode,
1598
        },
1599
        substitute  => {
1600
            ill_bib_title      => $title ? $title->value : 'N/A',
1601
            ill_bib_author     => $author ? $author->value : 'N/A',
1602
            ill_full_metadata  => $metastring
1603
        }
1604
    );
1605
1606
    return $letter;
1607
}
1608
1400
=head3 id_prefix
1609
=head3 id_prefix
1401
1610
1402
    my $prefix = $record->id_prefix;
1611
    my $prefix = $record->id_prefix;
(-)a/Koha/Illrequest/Logger.pm (-1 / +40 lines)
Lines 26-31 use C4::Context; Link Here
26
use C4::Templates;
26
use C4::Templates;
27
use C4::Log qw( logaction );
27
use C4::Log qw( logaction );
28
use Koha::ActionLogs;
28
use Koha::ActionLogs;
29
use Koha::Notice::Template;
29
30
30
=head1 NAME
31
=head1 NAME
31
32
Lines 62-67 sub new { Link Here
62
    $self->{loggers} = {
63
    $self->{loggers} = {
63
        status => sub {
64
        status => sub {
64
            $self->log_status_change(@_);
65
            $self->log_status_change(@_);
66
        },
67
        patron_notice => sub {
68
            $self->log_patron_notice(@_);
65
        }
69
        }
66
    };
70
    };
67
71
Lines 70-76 sub new { Link Here
70
        C4::Templates::_get_template_file('ill/log/', 'intranet', $query);
74
        C4::Templates::_get_template_file('ill/log/', 'intranet', $query);
71
75
72
    $self->{templates} = {
76
    $self->{templates} = {
73
        STATUS_CHANGE => $base . 'status_change.tt'
77
        STATUS_CHANGE => $base . 'status_change.tt',
78
        PATRON_NOTICE => $base . 'patron_notice.tt'
74
    };
79
    };
75
80
76
    bless $self, $class;
81
    bless $self, $class;
Lines 103-108 sub log_maybe { Link Here
103
    }
108
    }
104
}
109
}
105
110
111
=head3 log_patron_notice
112
113
    Koha::IllRequest::Logger->log_patron_notice($params);
114
115
Receive a hashref containing a request object and params to log,
116
and log it
117
118
=cut
119
120
sub log_patron_notice {
121
    my ( $self, $params ) = @_;
122
123
    if (defined $params->{request} && defined $params->{notice_code}) {
124
        $self->log_something({
125
            modulename   => 'ILL',
126
            actionname   => 'PATRON_NOTICE',
127
            objectnumber => $params->{request}->id,
128
            infos        => to_json({
129
                log_origin    => 'core',
130
                notice_code => $params->{notice_code}
131
            })
132
        });
133
    }
134
}
135
106
=head3 log_status_change
136
=head3 log_status_change
107
137
108
    Koha::IllRequest::Logger->log_status_change($params);
138
    Koha::IllRequest::Logger->log_status_change($params);
Lines 210-215 sub get_request_logs { Link Here
210
        { order_by => { -desc => "timestamp" } }
240
        { order_by => { -desc => "timestamp" } }
211
    )->unblessed;
241
    )->unblessed;
212
242
243
    # Populate a lookup table for all ILL notice types
244
    my $notice_types = Koha::Notice::Templates->search({
245
        module => 'ill'
246
    })->unblessed;
247
    my $notice_hash;
248
    foreach my $notice(@{$notice_types}) {
249
        $notice_hash->{$notice->{code}} = $notice;
250
    }
213
    # Populate a lookup table for status aliases
251
    # Populate a lookup table for status aliases
214
    my $aliases = C4::Koha::GetAuthorisedValues('ILLSTATUS');
252
    my $aliases = C4::Koha::GetAuthorisedValues('ILLSTATUS');
215
    my $alias_hash;
253
    my $alias_hash;
Lines 217-222 sub get_request_logs { Link Here
217
        $alias_hash->{$alias->{authorised_value}} = $alias;
255
        $alias_hash->{$alias->{authorised_value}} = $alias;
218
    }
256
    }
219
    foreach my $log(@{$logs}) {
257
    foreach my $log(@{$logs}) {
258
        $log->{notice_types} = $notice_hash;
220
        $log->{aliases} = $alias_hash;
259
        $log->{aliases} = $alias_hash;
221
        $log->{info} = from_json($log->{info});
260
        $log->{info} = from_json($log->{info});
222
        $log->{template} = $self->get_log_template({
261
        $log->{template} = $self->get_log_template({
(-)a/ill/ill-requests.pl (-1 / +35 lines)
Lines 23-28 use CGI; Link Here
23
23
24
use C4::Auth;
24
use C4::Auth;
25
use C4::Output;
25
use C4::Output;
26
use Koha::Notice::Templates;
26
use Koha::AuthorisedValues;
27
use Koha::AuthorisedValues;
27
use Koha::Illcomment;
28
use Koha::Illcomment;
28
use Koha::Illrequests;
29
use Koha::Illrequests;
Lines 72-83 if ( $backends_available ) { Link Here
72
        # View the details of an ILL
73
        # View the details of an ILL
73
        my $request = Koha::Illrequests->find($params->{illrequest_id});
74
        my $request = Koha::Illrequests->find($params->{illrequest_id});
74
75
76
        # Get the details for notices that can be sent from here
77
        my $notices = Koha::Notice::Templates->search(
78
            {
79
                module => 'ill',
80
                code => { -in => [ 'ILL_PICKUP_READY' ,'ILL_REQUEST_UNAVAIL' ] },
81
            },
82
            {
83
                columns => [ qw/code name/ ],
84
                distinct => 1
85
            }
86
        )->unblessed;
87
75
        $template->param(
88
        $template->param(
89
            notices    => $notices,
76
            request    => $request,
90
            request    => $request,
77
            csrf_token => Koha::Token->new->generate_csrf({
91
            csrf_token => Koha::Token->new->generate_csrf({
78
                session_id => scalar $cgi->cookie('CGISESSID'),
92
                session_id => scalar $cgi->cookie('CGISESSID'),
79
            }),
93
            }),
80
            ( $params->{error} ? ( error => $params->{error} ) : () ),
94
            ( $params->{tran_error} ?
95
                ( tran_error => $params->{tran_error} ) : () ),
96
            ( $params->{tran_success} ?
97
                ( tran_success => $params->{tran_success} ) : () ),
81
        );
98
        );
82
99
83
    } elsif ( $op eq 'create' ) {
100
    } elsif ( $op eq 'create' ) {
Lines 380-385 if ( $backends_available ) { Link Here
380
        );
397
        );
381
        exit;
398
        exit;
382
399
400
    } elsif ( $op eq "send_notice" ) {
401
        my $illrequest_id = $params->{illrequest_id};
402
        my $request = Koha::Illrequests->find($illrequest_id);
403
        my $ret = $request->send_patron_notice($params->{notice_code});
404
        my $append = '';
405
        if ($ret->{result} && scalar @{$ret->{result}->{success}} > 0) {
406
            $append .= '&tran_success=' . join(',', @{$ret->{result}->{success}});
407
        }
408
        if ($ret->{result} && scalar @{$ret->{result}->{fail}} > 0) {
409
            $append .= '&tran_fail=' . join(',', @{$ret->{result}->{fail}}.join(','));
410
        }
411
        # Redirect to view the whole request
412
        print $cgi->redirect(
413
            "/cgi-bin/koha/ill/ill-requests.pl?method=illview&illrequest_id=".
414
            scalar $params->{illrequest_id} . $append
415
        );
416
        exit;
383
    } else {
417
    } else {
384
        my $request = Koha::Illrequests->find($params->{illrequest_id});
418
        my $request = Koha::Illrequests->find($params->{illrequest_id});
385
        my $backend_result = $request->custom_capability($op, $params);
419
        my $backend_result = $request->custom_capability($op, $params);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (+39 lines)
Lines 99-104 Link Here
99
                    </p>
99
                    </p>
100
                [% END %]
100
                [% END %]
101
101
102
                [% IF whole.success %]
103
                    <p>[% whole.success | html %]</p>
104
                [% END %]
105
102
                [% IF query_type == 'create' %]
106
                [% IF query_type == 'create' %]
103
                    <h1>New ILL request</h1>
107
                    <h1>New ILL request</h1>
104
                    [% PROCESS $whole.template %]
108
                    [% PROCESS $whole.template %]
Lines 462-467 Link Here
462
                      [% END %]
466
                      [% END %]
463
                    [% END %]
467
                    [% END %]
464
468
469
                    [% IF tran_success %]
470
                        [% succ_methods = [] %]
471
                        [% IF tran_success.match('email') %]
472
                            [% succ_methods.push('email') %]
473
                        [% END %]
474
                        [% IF tran_success.match('sms') %]
475
                            [% succ_methods.push('SMS') %]
476
                        [% END %]
477
                        <div class="alert">
478
                            The requested notice was queued for delivery by [% succ_methods.join(', ') | html %]
479
                        </div>
480
                    [% END %]
481
                    [% IF tran_fail %]
482
                        [% fail_methods = [] %]
483
                        [% IF tran_fail.match('email') %]
484
                            [% fail_methods.push('email') %]
485
                        [% END %]
486
                        [% IF tran_fail.match('sms') %]
487
                            [% fail_methods.push('SMS') %]
488
                        [% END %]
489
                        <div class="alert">
490
                            The requested notice was NOT queued for delivery by [% fail_methods.join(', ') | html %]
491
                        </div>
492
                    [% END %]
493
465
                    <h1>Manage ILL request</h1>
494
                    <h1>Manage ILL request</h1>
466
                    <div id="request-toolbar" class="btn-toolbar">
495
                    <div id="request-toolbar" class="btn-toolbar">
467
                        <a title="Edit request" id="ill-toolbar-btn-edit-action" class="btn btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=edit_action&amp;illrequest_id=[% request.illrequest_id | html %]">
496
                        <a title="Edit request" id="ill-toolbar-btn-edit-action" class="btn btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=edit_action&amp;illrequest_id=[% request.illrequest_id | html %]">
Lines 523-528 Link Here
523
                                </a>
552
                                </a>
524
                            [% END %]
553
                            [% END %]
525
                        [% END %]
554
                        [% END %]
555
                        <div class="dropdown btn-group">
556
                            <button class="btn btn-default dropdown-toggle" type="button" id="ill-notice-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
557
                                <i class="fa fa-envelope"></i> Send notice to patron <span class="caret"></span>
558
                            </button>
559
                            <ul class="dropdown-menu" aria-labelledby="ill-notice-dropdown">
560
                                [% FOREACH notice IN notices %]
561
                                    <li><a href="/cgi-bin/koha/ill/ill-requests.pl?method=send_notice&amp;illrequest_id=[% request.illrequest_id | uri %]&amp;notice_code=[% notice.code | uri %]">[% notice.name | html %]</a></li>
562
                                [% END %]
563
                            </ul>
564
                        </div>
526
                        <a title="Display supplier metadata" id="ill-request-display-metadata" class="btn btn-default pull-right" href="#">
565
                        <a title="Display supplier metadata" id="ill-request-display-metadata" class="btn btn-default pull-right" href="#">
527
                            <span class="fa fa-eye"></span>
566
                            <span class="fa fa-eye"></span>
528
                            Display supplier metadata
567
                            Display supplier metadata
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/log/patron_notice.tt (+6 lines)
Line 0 Link Here
1
[% USE KohaDates %]
2
<p>
3
[% log.timestamp | $KohaDates with_hours => 1 %] : <b>Patron notice sent: </b>
4
[% notice_code = log.info.notice_code %]
5
&quot;[% log.notice_types.$notice_code.name | html %]&quot;
6
</p>
(-)a/opac/opac-illrequests.pl (-1 / +2 lines)
Lines 86-91 if ( $op eq 'list' ) { Link Here
86
        illrequest_id  => $params->{illrequest_id}
86
        illrequest_id  => $params->{illrequest_id}
87
    });
87
    });
88
    $request->notesopac($params->{notesopac})->store;
88
    $request->notesopac($params->{notesopac})->store;
89
    # Send a notice to staff alerting them of the update
90
    $request->send_staff_notice('ILL_REQUEST_MODIFIED');
89
    print $query->redirect(
91
    print $query->redirect(
90
        '/cgi-bin/koha/opac-illrequests.pl?method=view&illrequest_id=' .
92
        '/cgi-bin/koha/opac-illrequests.pl?method=view&illrequest_id=' .
91
        $params->{illrequest_id} .
93
        $params->{illrequest_id} .
92
- 

Return to bug 22818