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::Email;
32
use Koha::Email;
31
use Koha::Exceptions::Ill;
33
use Koha::Exceptions::Ill;
Lines 242-247 sub status_alias { Link Here
242
244
243
Overloaded getter/setter for request status,
245
Overloaded getter/setter for request status,
244
also nullifies status_alias and records the fact that the status has changed
246
also nullifies status_alias and records the fact that the status has changed
247
and sends a notice if appropriate
245
248
246
=cut
249
=cut
247
250
Lines 275-280 sub status { Link Here
275
            });
278
            });
276
        }
279
        }
277
        delete $self->{previous_status};
280
        delete $self->{previous_status};
281
        # If status has changed to cancellation requested, send a notice
282
        if ($new_status eq 'CANCREQ') {
283
            $self->send_staff_notice('ILL_REQUEST_CANCEL');
284
        }
278
        return $ret;
285
        return $ret;
279
    } else {
286
    } else {
280
        return $current_status;
287
        return $current_status;
Lines 1038-1075 sub generic_confirm { Link Here
1038
    my $branch = Koha::Libraries->find($params->{current_branchcode})
1045
    my $branch = Koha::Libraries->find($params->{current_branchcode})
1039
        || die "Invalid current branchcode. Are you logged in as the database user?";
1046
        || die "Invalid current branchcode. Are you logged in as the database user?";
1040
    if ( !$params->{stage}|| $params->{stage} eq 'init' ) {
1047
    if ( !$params->{stage}|| $params->{stage} eq 'init' ) {
1041
        my $draft->{subject} = "ILL Request";
1042
        $draft->{body} = <<EOF;
1043
Dear Sir/Madam,
1044
1045
    We would like to request an interlibrary loan for a title matching the
1046
following description:
1047
1048
EOF
1049
1050
        my $details = $self->metadata;
1051
        while (my ($title, $value) = each %{$details}) {
1052
            $draft->{body} .= "  - " . $title . ": " . $value . "\n"
1053
                if $value;
1054
        }
1055
        $draft->{body} .= <<EOF;
1056
1057
Please let us know if you are able to supply this to us.
1058
1059
Kind Regards
1060
1061
EOF
1062
1048
1063
        my @address = map { $branch->$_ }
1049
        # Get the message body from the notice definition
1064
            qw/ branchname branchaddress1 branchaddress2 branchaddress3
1050
        my $letter = $self->get_notice({
1065
                branchzip branchcity branchstate branchcountry branchphone
1051
            notice_code => 'ILL_PARTNER_REQ',
1066
                branchillemail branchemail /;
1052
            transport   => 'email'
1067
        my $address = "";
1053
        });
1068
        foreach my $line ( @address ) {
1069
            $address .= $line . "\n" if $line;
1070
        }
1071
1072
        $draft->{body} .= $address;
1073
1054
1074
        my $partners = Koha::Patrons->search({
1055
        my $partners = Koha::Patrons->search({
1075
            categorycode => $self->_config->partner_code
1056
            categorycode => $self->_config->partner_code
Lines 1081-1087 EOF Link Here
1081
            method  => 'generic_confirm',
1062
            method  => 'generic_confirm',
1082
            stage   => 'draft',
1063
            stage   => 'draft',
1083
            value   => {
1064
            value   => {
1084
                draft    => $draft,
1065
                draft => {
1066
                    subject => $letter->{title},
1067
                    body    => $letter->{content}
1068
                },
1085
                partners => $partners,
1069
                partners => $partners,
1086
            }
1070
            }
1087
        };
1071
        };
Lines 1097-1153 EOF Link Here
1097
            "No target email addresses found. Either select at least one partner or check your ILL partner library records.")
1081
            "No target email addresses found. Either select at least one partner or check your ILL partner library records.")
1098
          if ( !$to );
1082
          if ( !$to );
1099
        # Create the from, replyto and sender headers
1083
        # Create the from, replyto and sender headers
1100
        my $from = $branch->branchemail;
1084
        my $from = $branch->branchillemail || $branch->branchemail;
1101
        my $replyto = $branch->branchreplyto || $from;
1085
        my $replyto = $branch->branchreplyto || $from;
1102
        Koha::Exceptions::Ill::NoLibraryEmail->throw(
1086
        Koha::Exceptions::Ill::NoLibraryEmail->throw(
1103
            "Your library has no usable email address. Please set it.")
1087
            "Your library has no usable email address. Please set it.")
1104
          if ( !$from );
1088
          if ( !$from );
1105
1089
1106
        # Create the email
1090
        # So we get a notice hashref, then substitute the possibly
1107
        my $message = Koha::Email->new;
1091
        # modified title and body from the draft stage
1108
        my %mail = $message->create_message_headers(
1092
        my $letter = $self->get_notice({
1109
            {
1093
            notice_code => 'ILL_PARTNER_REQ',
1110
                to          => $to,
1094
            transport   => 'email'
1111
                from        => $from,
1095
        });
1112
                replyto     => $replyto,
1096
        $letter->{title} = $params->{subject};
1113
                subject     => Encode::encode( "utf8", $params->{subject} ),
1097
        $letter->{content} = $params->{body};
1114
                message     => Encode::encode( "utf8", $params->{body} ),
1098
1115
                contenttype => 'text/plain',
1099
        # Send the email
1100
        my $params = {
1101
            letter                 => $letter,
1102
            borrowernumber         => $self->borrowernumber,
1103
            message_transport_type => 'email',
1104
            to_address             => $to,
1105
            from_address           => $from
1106
        };
1107
1108
        if ($letter) {
1109
            my $result = C4::Letters::EnqueueLetter($params);
1110
            if ( $result ) {
1111
                $self->status("GENREQ")->store;
1112
                $self->_backend_capability(
1113
                    'set_requested_partners',
1114
                    {
1115
                        request => $self,
1116
                        to => $to
1117
                    }
1118
                );
1119
                return {
1120
                    error   => 0,
1121
                    status  => '',
1122
                    message => '',
1123
                    method  => 'generic_confirm',
1124
                    stage   => 'commit',
1125
                    next    => 'illview',
1126
                };
1116
            }
1127
            }
1117
        );
1118
        # Send it
1119
        my $result = sendmail(%mail);
1120
        if ( $result ) {
1121
            $self->status("GENREQ")->store;
1122
            $self->_backend_capability(
1123
                'set_requested_partners',
1124
                {
1125
                    request => $self,
1126
                    to => $to
1127
                }
1128
            );
1129
            return {
1130
                error   => 0,
1131
                status  => '',
1132
                message => '',
1133
                method  => 'generic_confirm',
1134
                stage   => 'commit',
1135
                next    => 'illview',
1136
            };
1137
        } else {
1138
            return {
1139
                error   => 1,
1140
                status  => 'email_failed',
1141
                message => $Mail::Sendmail::error,
1142
                method  => 'generic_confirm',
1143
                stage   => 'draft',
1144
            };
1145
        }
1128
        }
1129
        return {
1130
            error   => 1,
1131
            status  => 'email_failed',
1132
            message => 'Email queueing failed',
1133
            method  => 'generic_confirm',
1134
            stage   => 'draft',
1135
        };
1146
    } else {
1136
    } else {
1147
        die "Unknown stage, should not have happened."
1137
        die "Unknown stage, should not have happened."
1148
    }
1138
    }
1149
}
1139
}
1150
1140
1141
=head3 get_staff_to_address
1142
1143
    my $email = $request->get_staff_to_address();
1144
1145
Get the email address to which staff notices should be sent
1146
1147
=cut
1148
1149
sub get_staff_to_address {
1150
    my ( $self ) = @_;
1151
1152
    # The various places we can get an ILL staff email address from
1153
    # (In order of preference)
1154
    #
1155
    # Dedicated branch address
1156
    my $library = Koha::Libraries->find( $self->branchcode );
1157
    my $branch_ill_to = $library->branchillemail;
1158
    # General purpose ILL address from syspref
1159
    my $syspref = C4::Context->preference("ILLDefaultStaffEmail");
1160
    # Branch general email address
1161
    my $branch_to = $library->branchemail;
1162
    # Last resort
1163
    my $koha_admin = C4::Context->preference('KohaAdminEmailAddress');
1164
1165
    my $to;
1166
    if ($branch_ill_to) {
1167
        $to = $branch_ill_to;
1168
    } elsif ($syspref) {
1169
        $to = $syspref;
1170
    } elsif ($branch_to) {
1171
        $to = $branch_to;
1172
    } elsif ($koha_admin) {
1173
        $to = $koha_admin;
1174
    }
1175
1176
    # $to will not be defined if we didn't find a usable address
1177
    return $to;
1178
}
1179
1180
=head3 send_patron_notice
1181
1182
    my $result = $request->send_patron_notice($notice_code);
1183
1184
Send a specified notice regarding this request to a patron
1185
1186
=cut
1187
1188
sub send_patron_notice {
1189
    my ( $self, $notice_code ) = @_;
1190
1191
    # We need a notice code
1192
    if (!$notice_code) {
1193
        return {
1194
            error => 'notice_no_type'
1195
        };
1196
    }
1197
1198
    # Map from the notice code to the messaging preference
1199
    my %message_name = (
1200
        ILL_PICKUP_READY   => 'Ill_ready',
1201
        ILL_REQUEST_UNAVAIL => 'Ill_unavailable'
1202
    );
1203
1204
    # Get the patron's messaging preferences
1205
    my $borrower_preferences = C4::Members::Messaging::GetMessagingPreferences({
1206
        borrowernumber => $self->borrowernumber,
1207
        message_name   => $message_name{$notice_code}
1208
    });
1209
    my @transports = keys %{ $borrower_preferences->{transports} };
1210
1211
    # Send the notice to the patron via the chosen transport methods
1212
    # and record the results
1213
    my @success = ();
1214
    my @fail = ();
1215
    for my $transport (@transports) {
1216
        my $letter = $self->get_notice({
1217
            notice_code => $notice_code,
1218
            transport   => $transport
1219
        });
1220
        if ($letter) {
1221
            my $result = C4::Letters::EnqueueLetter({
1222
                letter                 => $letter,
1223
                borrowernumber         => $self->borrowernumber,
1224
                message_transport_type => $transport,
1225
            });
1226
            if ($result) {
1227
                push @success, $transport;
1228
            } else {
1229
                push @fail, $transport;
1230
            }
1231
        } else {
1232
            push @fail, $transport;
1233
        }
1234
    }
1235
    if (scalar @success > 0) {
1236
        my $logger = Koha::Illrequest::Logger->new;
1237
        $logger->log_patron_notice({
1238
            request => $self,
1239
            notice_code => $notice_code
1240
        });
1241
    }
1242
    return {
1243
        result => {
1244
            success => \@success,
1245
            fail    => \@fail
1246
        }
1247
    };
1248
}
1249
1250
=head3 send_staff_notice
1251
1252
    my $result = $request->send_staff_notice($notice_code);
1253
1254
Send a specified notice regarding this request to staff
1255
1256
=cut
1257
1258
sub send_staff_notice {
1259
    my ( $self, $notice_code ) = @_;
1260
1261
    # We need a notice code
1262
    if (!$notice_code) {
1263
        return {
1264
            error => 'notice_no_type'
1265
        };
1266
    }
1267
1268
    # Get the staff notices that have been assigned for sending in
1269
    # the syspref
1270
    my $staff_to_send = C4::Context->preference('ILLSendStaffNotices');
1271
1272
    # If it hasn't been enabled in the syspref, we don't want to send it
1273
    if ($staff_to_send !~ /\b$notice_code\b/) {
1274
        return {
1275
            error => 'notice_not_enabled'
1276
        };
1277
    }
1278
1279
    my $letter = $self->get_notice({
1280
        notice_code => $notice_code,
1281
        transport   => 'email'
1282
    });
1283
1284
    # Try and get an address to which to send staff notices
1285
    my $to_address = scalar $self->get_staff_to_address;
1286
1287
    my $params = {
1288
        letter                 => $letter,
1289
        borrowernumber         => $self->borrowernumber,
1290
        message_transport_type => 'email',
1291
    };
1292
1293
    if ($to_address) {
1294
        $params->{to_address} = $to_address;
1295
        $params->{from_address} = $to_address;
1296
    } else {
1297
        return {
1298
            error => 'notice_no_create'
1299
        };
1300
    }
1301
1302
    if ($letter) {
1303
        C4::Letters::EnqueueLetter($params)
1304
            or warn "can't enqueue letter $letter";
1305
        return {
1306
            success => 'notice_queued'
1307
        };
1308
    } else {
1309
        return {
1310
            error => 'notice_no_create'
1311
        };
1312
    }
1313
}
1314
1315
=head3 get_notice
1316
1317
    my $notice = $request->get_notice($params);
1318
1319
Return a compiled notice hashref for the passed notice code
1320
and transport type
1321
1322
=cut
1323
1324
sub get_notice {
1325
    my ( $self, $params ) = @_;
1326
1327
    my $title = $self->illrequestattributes->find(
1328
        { type => 'title' }
1329
    );
1330
    my $author = $self->illrequestattributes->find(
1331
        { type => 'author' }
1332
    );
1333
    my $metahash = $self->metadata;
1334
    my @metaarray = ();
1335
    while (my($key, $value) = each %{$metahash}) {
1336
        push @metaarray, "- $key: $value" if $value;
1337
    }
1338
    my $metastring = join("\n", @metaarray);
1339
    my $letter = C4::Letters::GetPreparedLetter(
1340
        module                 => 'ill',
1341
        letter_code            => $params->{notice_code},
1342
        message_transport_type => $params->{transport},
1343
        lang                   => $self->patron->lang,
1344
        tables                 => {
1345
            illrequests => $self->illrequest_id,
1346
            borrowers   => $self->borrowernumber,
1347
            biblio      => $self->biblio_id,
1348
            branches    => $self->branchcode,
1349
        },
1350
        substitute  => {
1351
            ill_bib_title      => $title ? $title->value : 'N/A',
1352
            ill_bib_author     => $author ? $author->value : 'N/A',
1353
            ill_full_metadata  => $metastring
1354
        }
1355
    );
1356
1357
    return $letter;
1358
}
1359
1151
=head3 id_prefix
1360
=head3 id_prefix
1152
1361
1153
    my $prefix = $record->id_prefix;
1362
    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 = GetAuthorisedValues('ILLSTATUS');
252
    my $aliases = 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 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