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

(-)a/Koha/Illrequest.pm (-71 / +280 lines)
Lines 27-32 use Mail::Sendmail; Link Here
27
use Try::Tiny;
27
use Try::Tiny;
28
use DateTime;
28
use DateTime;
29
29
30
use C4::Letters;
31
use C4::Members;
30
use Koha::Database;
32
use Koha::Database;
31
use Koha::Email;
33
use Koha::Email;
32
use Koha::Exceptions::Ill;
34
use Koha::Exceptions::Ill;
Lines 243-248 sub status_alias { Link Here
243
245
244
Overloaded getter/setter for request status,
246
Overloaded getter/setter for request status,
245
also nullifies status_alias and records the fact that the status has changed
247
also nullifies status_alias and records the fact that the status has changed
248
and sends a notice if appropriate
246
249
247
=cut
250
=cut
248
251
Lines 276-281 sub status { Link Here
276
            });
279
            });
277
        }
280
        }
278
        delete $self->{previous_status};
281
        delete $self->{previous_status};
282
        # If status has changed to cancellation requested, send a notice
283
        if ($new_status eq 'CANCREQ') {
284
            $self->send_staff_notice('ILL_REQUEST_CANCEL');
285
        }
279
        return $ret;
286
        return $ret;
280
    } else {
287
    } else {
281
        return $current_status;
288
        return $current_status;
Lines 1039-1076 sub generic_confirm { Link Here
1039
    my $branch = Koha::Libraries->find($params->{current_branchcode})
1046
    my $branch = Koha::Libraries->find($params->{current_branchcode})
1040
        || die "Invalid current branchcode. Are you logged in as the database user?";
1047
        || die "Invalid current branchcode. Are you logged in as the database user?";
1041
    if ( !$params->{stage}|| $params->{stage} eq 'init' ) {
1048
    if ( !$params->{stage}|| $params->{stage} eq 'init' ) {
1042
        my $draft->{subject} = "ILL Request";
1043
        $draft->{body} = <<EOF;
1044
Dear Sir/Madam,
1045
1046
    We would like to request an interlibrary loan for a title matching the
1047
following description:
1048
1049
EOF
1050
1051
        my $details = $self->metadata;
1052
        while (my ($title, $value) = each %{$details}) {
1053
            $draft->{body} .= "  - " . $title . ": " . $value . "\n"
1054
                if $value;
1055
        }
1056
        $draft->{body} .= <<EOF;
1057
1058
Please let us know if you are able to supply this to us.
1059
1060
Kind Regards
1061
1062
EOF
1063
1049
1064
        my @address = map { $branch->$_ }
1050
        # Get the message body from the notice definition
1065
            qw/ branchname branchaddress1 branchaddress2 branchaddress3
1051
        my $letter = $self->get_notice({
1066
                branchzip branchcity branchstate branchcountry branchphone
1052
            notice_code => 'ILL_PARTNER_REQ',
1067
                branchillemail branchemail /;
1053
            transport   => 'email'
1068
        my $address = "";
1054
        });
1069
        foreach my $line ( @address ) {
1070
            $address .= $line . "\n" if $line;
1071
        }
1072
1073
        $draft->{body} .= $address;
1074
1055
1075
        my $partners = Koha::Patrons->search({
1056
        my $partners = Koha::Patrons->search({
1076
            categorycode => $self->_config->partner_code
1057
            categorycode => $self->_config->partner_code
Lines 1082-1088 EOF Link Here
1082
            method  => 'generic_confirm',
1063
            method  => 'generic_confirm',
1083
            stage   => 'draft',
1064
            stage   => 'draft',
1084
            value   => {
1065
            value   => {
1085
                draft    => $draft,
1066
                draft => {
1067
                    subject => $letter->{title},
1068
                    body    => $letter->{content}
1069
                },
1086
                partners => $partners,
1070
                partners => $partners,
1087
            }
1071
            }
1088
        };
1072
        };
Lines 1098-1154 EOF Link Here
1098
            "No target email addresses found. Either select at least one partner or check your ILL partner library records.")
1082
            "No target email addresses found. Either select at least one partner or check your ILL partner library records.")
1099
          if ( !$to );
1083
          if ( !$to );
1100
        # Create the from, replyto and sender headers
1084
        # Create the from, replyto and sender headers
1101
        my $from = $branch->branchemail;
1085
        my $from = $branch->branchillemail || $branch->branchemail;
1102
        my $replyto = $branch->branchreplyto || $from;
1086
        my $replyto = $branch->branchreplyto || $from;
1103
        Koha::Exceptions::Ill::NoLibraryEmail->throw(
1087
        Koha::Exceptions::Ill::NoLibraryEmail->throw(
1104
            "Your library has no usable email address. Please set it.")
1088
            "Your library has no usable email address. Please set it.")
1105
          if ( !$from );
1089
          if ( !$from );
1106
1090
1107
        # Create the email
1091
        # So we get a notice hashref, then substitute the possibly
1108
        my $message = Koha::Email->new;
1092
        # modified title and body from the draft stage
1109
        my %mail = $message->create_message_headers(
1093
        my $letter = $self->get_notice({
1110
            {
1094
            notice_code => 'ILL_PARTNER_REQ',
1111
                to          => $to,
1095
            transport   => 'email'
1112
                from        => $from,
1096
        });
1113
                replyto     => $replyto,
1097
        $letter->{title} = $params->{subject};
1114
                subject     => Encode::encode( "utf8", $params->{subject} ),
1098
        $letter->{content} = $params->{body};
1115
                message     => Encode::encode( "utf8", $params->{body} ),
1099
1116
                contenttype => 'text/plain',
1100
        # Send the email
1101
        my $params = {
1102
            letter                 => $letter,
1103
            borrowernumber         => $self->borrowernumber,
1104
            message_transport_type => 'email',
1105
            to_address             => $to,
1106
            from_address           => $from
1107
        };
1108
1109
        if ($letter) {
1110
            my $result = C4::Letters::EnqueueLetter($params);
1111
            if ( $result ) {
1112
                $self->status("GENREQ")->store;
1113
                $self->_backend_capability(
1114
                    'set_requested_partners',
1115
                    {
1116
                        request => $self,
1117
                        to => $to
1118
                    }
1119
                );
1120
                return {
1121
                    error   => 0,
1122
                    status  => '',
1123
                    message => '',
1124
                    method  => 'generic_confirm',
1125
                    stage   => 'commit',
1126
                    next    => 'illview',
1127
                };
1117
            }
1128
            }
1118
        );
1119
        # Send it
1120
        my $result = sendmail(%mail);
1121
        if ( $result ) {
1122
            $self->status("GENREQ")->store;
1123
            $self->_backend_capability(
1124
                'set_requested_partners',
1125
                {
1126
                    request => $self,
1127
                    to => $to
1128
                }
1129
            );
1130
            return {
1131
                error   => 0,
1132
                status  => '',
1133
                message => '',
1134
                method  => 'generic_confirm',
1135
                stage   => 'commit',
1136
                next    => 'illview',
1137
            };
1138
        } else {
1139
            return {
1140
                error   => 1,
1141
                status  => 'email_failed',
1142
                message => $Mail::Sendmail::error,
1143
                method  => 'generic_confirm',
1144
                stage   => 'draft',
1145
            };
1146
        }
1129
        }
1130
        return {
1131
            error   => 1,
1132
            status  => 'email_failed',
1133
            message => 'Email queueing failed',
1134
            method  => 'generic_confirm',
1135
            stage   => 'draft',
1136
        };
1147
    } else {
1137
    } else {
1148
        die "Unknown stage, should not have happened."
1138
        die "Unknown stage, should not have happened."
1149
    }
1139
    }
1150
}
1140
}
1151
1141
1142
=head3 get_staff_to_address
1143
1144
    my $email = $request->get_staff_to_address();
1145
1146
Get the email address to which staff notices should be sent
1147
1148
=cut
1149
1150
sub get_staff_to_address {
1151
    my ( $self ) = @_;
1152
1153
    # The various places we can get an ILL staff email address from
1154
    # (In order of preference)
1155
    #
1156
    # Dedicated branch address
1157
    my $library = Koha::Libraries->find( $self->branchcode );
1158
    my $branch_ill_to = $library->branchillemail;
1159
    # General purpose ILL address from syspref
1160
    my $syspref = C4::Context->preference("ILLDefaultStaffEmail");
1161
    # Branch general email address
1162
    my $branch_to = $library->branchemail;
1163
    # Last resort
1164
    my $koha_admin = C4::Context->preference('KohaAdminEmailAddress');
1165
1166
    my $to;
1167
    if ($branch_ill_to) {
1168
        $to = $branch_ill_to;
1169
    } elsif ($syspref) {
1170
        $to = $syspref;
1171
    } elsif ($branch_to) {
1172
        $to = $branch_to;
1173
    } elsif ($koha_admin) {
1174
        $to = $koha_admin;
1175
    }
1176
1177
    # $to will not be defined if we didn't find a usable address
1178
    return $to;
1179
}
1180
1181
=head3 send_patron_notice
1182
1183
    my $result = $request->send_patron_notice($notice_code);
1184
1185
Send a specified notice regarding this request to a patron
1186
1187
=cut
1188
1189
sub send_patron_notice {
1190
    my ( $self, $notice_code ) = @_;
1191
1192
    # We need a notice code
1193
    if (!$notice_code) {
1194
        return {
1195
            error => 'notice_no_type'
1196
        };
1197
    }
1198
1199
    # Map from the notice code to the messaging preference
1200
    my %message_name = (
1201
        ILL_PICKUP_READY   => 'Ill_ready',
1202
        ILL_REQUEST_UNAVAIL => 'Ill_unavailable'
1203
    );
1204
1205
    # Get the patron's messaging preferences
1206
    my $borrower_preferences = C4::Members::Messaging::GetMessagingPreferences({
1207
        borrowernumber => $self->borrowernumber,
1208
        message_name   => $message_name{$notice_code}
1209
    });
1210
    my @transports = keys %{ $borrower_preferences->{transports} };
1211
1212
    # Send the notice to the patron via the chosen transport methods
1213
    # and record the results
1214
    my @success = ();
1215
    my @fail = ();
1216
    for my $transport (@transports) {
1217
        my $letter = $self->get_notice({
1218
            notice_code => $notice_code,
1219
            transport   => $transport
1220
        });
1221
        if ($letter) {
1222
            my $result = C4::Letters::EnqueueLetter({
1223
                letter                 => $letter,
1224
                borrowernumber         => $self->borrowernumber,
1225
                message_transport_type => $transport,
1226
            });
1227
            if ($result) {
1228
                push @success, $transport;
1229
            } else {
1230
                push @fail, $transport;
1231
            }
1232
        } else {
1233
            push @fail, $transport;
1234
        }
1235
    }
1236
    if (scalar @success > 0) {
1237
        my $logger = Koha::Illrequest::Logger->new;
1238
        $logger->log_patron_notice({
1239
            request => $self,
1240
            notice_code => $notice_code
1241
        });
1242
    }
1243
    return {
1244
        result => {
1245
            success => \@success,
1246
            fail    => \@fail
1247
        }
1248
    };
1249
}
1250
1251
=head3 send_staff_notice
1252
1253
    my $result = $request->send_staff_notice($notice_code);
1254
1255
Send a specified notice regarding this request to staff
1256
1257
=cut
1258
1259
sub send_staff_notice {
1260
    my ( $self, $notice_code ) = @_;
1261
1262
    # We need a notice code
1263
    if (!$notice_code) {
1264
        return {
1265
            error => 'notice_no_type'
1266
        };
1267
    }
1268
1269
    # Get the staff notices that have been assigned for sending in
1270
    # the syspref
1271
    my $staff_to_send = C4::Context->preference('ILLSendStaffNotices');
1272
1273
    # If it hasn't been enabled in the syspref, we don't want to send it
1274
    if ($staff_to_send !~ /\b$notice_code\b/) {
1275
        return {
1276
            error => 'notice_not_enabled'
1277
        };
1278
    }
1279
1280
    my $letter = $self->get_notice({
1281
        notice_code => $notice_code,
1282
        transport   => 'email'
1283
    });
1284
1285
    # Try and get an address to which to send staff notices
1286
    my $to_address = scalar $self->get_staff_to_address;
1287
1288
    my $params = {
1289
        letter                 => $letter,
1290
        borrowernumber         => $self->borrowernumber,
1291
        message_transport_type => 'email',
1292
    };
1293
1294
    if ($to_address) {
1295
        $params->{to_address} = $to_address;
1296
        $params->{from_address} = $to_address;
1297
    } else {
1298
        return {
1299
            error => 'notice_no_create'
1300
        };
1301
    }
1302
1303
    if ($letter) {
1304
        C4::Letters::EnqueueLetter($params)
1305
            or warn "can't enqueue letter $letter";
1306
        return {
1307
            success => 'notice_queued'
1308
        };
1309
    } else {
1310
        return {
1311
            error => 'notice_no_create'
1312
        };
1313
    }
1314
}
1315
1316
=head3 get_notice
1317
1318
    my $notice = $request->get_notice($params);
1319
1320
Return a compiled notice hashref for the passed notice code
1321
and transport type
1322
1323
=cut
1324
1325
sub get_notice {
1326
    my ( $self, $params ) = @_;
1327
1328
    my $title = $self->illrequestattributes->find(
1329
        { type => 'title' }
1330
    );
1331
    my $author = $self->illrequestattributes->find(
1332
        { type => 'author' }
1333
    );
1334
    my $metahash = $self->metadata;
1335
    my @metaarray = ();
1336
    while (my($key, $value) = each %{$metahash}) {
1337
        push @metaarray, "- $key: $value" if $value;
1338
    }
1339
    my $metastring = join("\n", @metaarray);
1340
    my $letter = C4::Letters::GetPreparedLetter(
1341
        module                 => 'ill',
1342
        letter_code            => $params->{notice_code},
1343
        message_transport_type => $params->{transport},
1344
        lang                   => $self->patron->lang,
1345
        tables                 => {
1346
            illrequests => $self->illrequest_id,
1347
            borrowers   => $self->borrowernumber,
1348
            biblio      => $self->biblio_id,
1349
            branches    => $self->branchcode,
1350
        },
1351
        substitute  => {
1352
            ill_bib_title      => $title ? $title->value : 'N/A',
1353
            ill_bib_author     => $author ? $author->value : 'N/A',
1354
            ill_full_metadata  => $metastring
1355
        }
1356
    );
1357
1358
    return $letter;
1359
}
1360
1152
=head3 id_prefix
1361
=head3 id_prefix
1153
1362
1154
    my $prefix = $record->id_prefix;
1363
    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 69-75 sub new { Link Here
69
        C4::Templates::_get_template_file('ill/log/', 'intranet');
73
        C4::Templates::_get_template_file('ill/log/', 'intranet');
70
74
71
    $self->{templates} = {
75
    $self->{templates} = {
72
        STATUS_CHANGE => $base . 'status_change.tt'
76
        STATUS_CHANGE => $base . 'status_change.tt',
77
        PATRON_NOTICE => $base . 'patron_notice.tt'
73
    };
78
    };
74
79
75
    bless $self, $class;
80
    bless $self, $class;
Lines 102-107 sub log_maybe { Link Here
102
    }
107
    }
103
}
108
}
104
109
110
=head3 log_patron_notice
111
112
    Koha::IllRequest::Logger->log_patron_notice($params);
113
114
Receive a hashref containing a request object and params to log,
115
and log it
116
117
=cut
118
119
sub log_patron_notice {
120
    my ( $self, $params ) = @_;
121
122
    if (defined $params->{request} && defined $params->{notice_code}) {
123
        $self->log_something({
124
            modulename   => 'ILL',
125
            actionname   => 'PATRON_NOTICE',
126
            objectnumber => $params->{request}->id,
127
            infos        => to_json({
128
                log_origin    => 'core',
129
                notice_code => $params->{notice_code}
130
            })
131
        });
132
    }
133
}
134
105
=head3 log_status_change
135
=head3 log_status_change
106
136
107
    Koha::IllRequest::Logger->log_status_change($params);
137
    Koha::IllRequest::Logger->log_status_change($params);
Lines 209-214 sub get_request_logs { Link Here
209
        { order_by => { -desc => "timestamp" } }
239
        { order_by => { -desc => "timestamp" } }
210
    )->unblessed;
240
    )->unblessed;
211
241
242
    # Populate a lookup table for all ILL notice types
243
    my $notice_types = Koha::Notice::Templates->search({
244
        module => 'ill'
245
    })->unblessed;
246
    my $notice_hash;
247
    foreach my $notice(@{$notice_types}) {
248
        $notice_hash->{$notice->{code}} = $notice;
249
    }
212
    # Populate a lookup table for status aliases
250
    # Populate a lookup table for status aliases
213
    my $aliases = GetAuthorisedValues('ILLSTATUS');
251
    my $aliases = GetAuthorisedValues('ILLSTATUS');
214
    my $alias_hash;
252
    my $alias_hash;
Lines 216-221 sub get_request_logs { Link Here
216
        $alias_hash->{$alias->{authorised_value}} = $alias;
254
        $alias_hash->{$alias->{authorised_value}} = $alias;
217
    }
255
    }
218
    foreach my $log(@{$logs}) {
256
    foreach my $log(@{$logs}) {
257
        $log->{notice_types} = $notice_hash;
219
        $log->{aliases} = $alias_hash;
258
        $log->{aliases} = $alias_hash;
220
        $log->{info} = from_json($log->{info});
259
        $log->{info} = from_json($log->{info});
221
        $log->{template} = $self->get_log_template({
260
        $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 70-81 if ( $backends_available ) { Link Here
70
        # View the details of an ILL
71
        # View the details of an ILL
71
        my $request = Koha::Illrequests->find($params->{illrequest_id});
72
        my $request = Koha::Illrequests->find($params->{illrequest_id});
72
73
74
        # Get the details for notices that can be sent from here
75
        my $notices = Koha::Notice::Templates->search(
76
            {
77
                module => 'ill',
78
                code => { -in => [ 'ILL_PICKUP_READY' ,'ILL_REQUEST_UNAVAIL' ] },
79
            },
80
            {
81
                columns => [ qw/code name/ ],
82
                distinct => 1
83
            }
84
        )->unblessed;
85
73
        $template->param(
86
        $template->param(
87
            notices    => $notices,
74
            request    => $request,
88
            request    => $request,
75
            csrf_token => Koha::Token->new->generate_csrf({
89
            csrf_token => Koha::Token->new->generate_csrf({
76
                session_id => scalar $cgi->cookie('CGISESSID'),
90
                session_id => scalar $cgi->cookie('CGISESSID'),
77
            }),
91
            }),
78
            ( $params->{error} ? ( error => $params->{error} ) : () ),
92
            ( $params->{tran_error} ?
93
                ( tran_error => $params->{tran_error} ) : () ),
94
            ( $params->{tran_success} ?
95
                ( tran_success => $params->{tran_success} ) : () ),
79
        );
96
        );
80
97
81
    } elsif ( $op eq 'create' ) {
98
    } elsif ( $op eq 'create' ) {
Lines 306-311 if ( $backends_available ) { Link Here
306
        );
323
        );
307
        exit;
324
        exit;
308
325
326
    } elsif ( $op eq "send_notice" ) {
327
        my $illrequest_id = $params->{illrequest_id};
328
        my $request = Koha::Illrequests->find($illrequest_id);
329
        my $ret = $request->send_patron_notice($params->{notice_code});
330
        my $append = '';
331
        if ($ret->{result} && scalar @{$ret->{result}->{success}} > 0) {
332
            $append .= '&tran_success=' . join(',', @{$ret->{result}->{success}});
333
        }
334
        if ($ret->{result} && scalar @{$ret->{result}->{fail}} > 0) {
335
            $append .= '&tran_fail=' . join(',', @{$ret->{result}->{fail}}.join(','));
336
        }
337
        # Redirect to view the whole request
338
        print $cgi->redirect(
339
            "/cgi-bin/koha/ill/ill-requests.pl?method=illview&illrequest_id=".
340
            scalar $params->{illrequest_id} . $append
341
        );
342
        exit;
309
    } else {
343
    } else {
310
        my $request = Koha::Illrequests->find($params->{illrequest_id});
344
        my $request = Koha::Illrequests->find($params->{illrequest_id});
311
        my $backend_result = $request->custom_capability($op, $params);
345
        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 286-291 Link Here
286
                      [% END %]
290
                      [% END %]
287
                    [% END %]
291
                    [% END %]
288
292
293
                    [% IF tran_success %]
294
                        [% succ_methods = [] %]
295
                        [% IF tran_success.match('email') %]
296
                            [% succ_methods.push('email') %]
297
                        [% END %]
298
                        [% IF tran_success.match('sms') %]
299
                            [% succ_methods.push('SMS') %]
300
                        [% END %]
301
                        <div class="alert">
302
                            The requested notice was queued for delivery by [% succ_methods.join(', ') | html %]
303
                        </div>
304
                    [% END %]
305
                    [% IF tran_fail %]
306
                        [% fail_methods = [] %]
307
                        [% IF tran_fail.match('email') %]
308
                            [% fail_methods.push('email') %]
309
                        [% END %]
310
                        [% IF tran_fail.match('sms') %]
311
                            [% fail_methods.push('SMS') %]
312
                        [% END %]
313
                        <div class="alert">
314
                            The requested notice was NOT queued for delivery by [% fail_methods.join(', ') | html %]
315
                        </div>
316
                    [% END %]
317
289
                    <h1>Manage ILL request</h1>
318
                    <h1>Manage ILL request</h1>
290
                    <div id="request-toolbar" class="btn-toolbar">
319
                    <div id="request-toolbar" class="btn-toolbar">
291
                        <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 %]">
320
                        <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 324-329 Link Here
324
                                </a>
353
                                </a>
325
                            [% END %]
354
                            [% END %]
326
                        [% END %]
355
                        [% END %]
356
                        <div class="dropdown btn-group">
357
                            <button class="btn btn-default dropdown-toggle" type="button" id="ill-notice-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
358
                                <i class="fa fa-envelope"></i> Send notice to patron <span class="caret"></span>
359
                            </button>
360
                            <ul class="dropdown-menu" aria-labelledby="ill-notice-dropdown">
361
                                [% FOREACH notice IN notices %]
362
                                    <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>
363
                                [% END %]
364
                            </ul>
365
                        </div>
327
                        <a title="Display supplier metadata" id="ill-request-display-metadata" class="btn btn-default pull-right" href="#">
366
                        <a title="Display supplier metadata" id="ill-request-display-metadata" class="btn btn-default pull-right" href="#">
328
                            <span class="fa fa-eye"></span>
367
                            <span class="fa fa-eye"></span>
329
                            Display supplier metadata
368
                            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 83-88 if ( $op eq 'list' ) { Link Here
83
        illrequest_id  => $params->{illrequest_id}
83
        illrequest_id  => $params->{illrequest_id}
84
    });
84
    });
85
    $request->notesopac($params->{notesopac})->store;
85
    $request->notesopac($params->{notesopac})->store;
86
    # Send a notice to staff alerting them of the update
87
    $request->send_staff_notice('ILL_REQUEST_MODIFIED');
86
    print $query->redirect(
88
    print $query->redirect(
87
        '/cgi-bin/koha/opac-illrequests.pl?method=view&illrequest_id=' .
89
        '/cgi-bin/koha/opac-illrequests.pl?method=view&illrequest_id=' .
88
        $params->{illrequest_id} .
90
        $params->{illrequest_id} .
89
- 

Return to bug 22818