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

(-)a/Koha/Illrequest.pm (-1 / +26 lines)
Lines 1-6 Link Here
1
package Koha::Illrequest;
1
package Koha::Illrequest;
2
2
3
# Copyright PTFS Europe 2016
3
# Copyright PTFS Europe 2016,2018
4
#
4
#
5
# This file is part of Koha.
5
# This file is part of Koha.
6
#
6
#
Lines 1081-1086 EOF Link Here
1081
        my $result = sendmail(%mail);
1081
        my $result = sendmail(%mail);
1082
        if ( $result ) {
1082
        if ( $result ) {
1083
            $self->status("GENREQ")->store;
1083
            $self->status("GENREQ")->store;
1084
            $self->_backend_capability(
1085
                'set_requested_partners',
1086
                {
1087
                    request => $self,
1088
                    to => $to
1089
                }
1090
            );
1084
            return {
1091
            return {
1085
                error   => 0,
1092
                error   => 0,
1086
                status  => '',
1093
                status  => '',
Lines 1164-1169 sub store { Link Here
1164
    return $ret;
1171
    return $ret;
1165
}
1172
}
1166
1173
1174
=head3 requested_partners
1175
1176
    my $partners_string = $illRequest->requested_partners;
1177
1178
Return the string representing the email addresses of the partners to
1179
whom a request has been sent
1180
1181
=cut
1182
1183
sub requested_partners {
1184
    my ( $self ) = @_;
1185
    return $self->_backend_capability(
1186
        'get_requested_partners',
1187
        { request => $self }
1188
    );
1189
}
1190
1167
=head3 TO_JSON
1191
=head3 TO_JSON
1168
1192
1169
    $json = $illrequest->TO_JSON
1193
    $json = $illrequest->TO_JSON
Lines 1198-1203 sub _type { Link Here
1198
=head1 AUTHOR
1222
=head1 AUTHOR
1199
1223
1200
Alex Sassmannshausen <alex.sassmannshausen@ptfs-europe.com>
1224
Alex Sassmannshausen <alex.sassmannshausen@ptfs-europe.com>
1225
Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
1201
1226
1202
=cut
1227
=cut
1203
1228
(-)a/Koha/REST/V1/Illrequests.pm (+3 lines)
Lines 159-164 sub list { Link Here
159
        if ($embed{status_alias}) {
159
        if ($embed{status_alias}) {
160
            $to_push->{status_alias} = $req->statusalias;
160
            $to_push->{status_alias} = $req->statusalias;
161
        }
161
        }
162
        if ($embed{requested_partners}) {
163
            $to_push->{requested_partners} = $req->requested_partners;
164
        }
162
        push @output, $to_push;
165
        push @output, $to_push;
163
    }
166
    }
164
167
(-)a/api/v1/swagger/paths/illrequests.json (-1 / +2 lines)
Lines 17-23 Link Here
17
                        "patron",
17
                        "patron",
18
                        "library",
18
                        "library",
19
                        "capabilities",
19
                        "capabilities",
20
                        "metadata"
20
                        "metadata",
21
                        "requested_partners"
21
                    ]
22
                    ]
22
                }
23
                }
23
            }, {
24
            }, {
(-)a/ill/ill-requests.pl (-2 / +2 lines)
Lines 247-256 if ( $backends_available ) { Link Here
247
        }
247
        }
248
        catch {
248
        catch {
249
            my $error;
249
            my $error;
250
            if ( $_->isa( 'Koha::Exceptions::Ill::NoTargetEmail' ) ) {
250
            if ( ref($_) eq 'Koha::Exceptions::Ill::NoTargetEmail' ) {}
251
                $error = 'no_target_email';
251
                $error = 'no_target_email';
252
            }
252
            }
253
            elsif ( $_->isa( 'Koha::Exceptions::Ill::NoLibraryEmail' ) ) {
253
            elsif ( ref($_) eq 'Koha::Exceptions::Ill::NoLibraryEmail' ) {}
254
                $error = 'no_library_email';
254
                $error = 'no_library_email';
255
            }
255
            }
256
            else {
256
            else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (-4 / +14 lines)
Lines 364-369 Link Here
364
                                            [% request.statusalias.lib | html %]
364
                                            [% request.statusalias.lib | html %]
365
                                        [% ELSE %]
365
                                        [% ELSE %]
366
                                            [% request.capabilities.$req_status.name | html%]
366
                                            [% request.capabilities.$req_status.name | html%]
367
                                            [% IF request.requested_partners.length > 0 %]
368
                                                ([% request.requested_partners | html %])
369
                                            [% END %]
367
                                        [% END %]
370
                                        [% END %]
368
                                    </li>
371
                                    </li>
369
                                    <li class="updated">
372
                                    <li class="updated">
Lines 781-801 Link Here
781
                        var status_name = meta.settings.oInit.originalData[0].capabilities[
784
                        var status_name = meta.settings.oInit.originalData[0].capabilities[
782
                            row.status
785
                            row.status
783
                        ].name;
786
                        ].name;
784
                        return getStatusName(status_name);
787
                        return getStatusName(status_name, row);
785
                    } else {
788
                    } else {
786
                        return '';
789
                        return '';
787
                    }
790
                    }
788
                }
791
                }
789
            };
792
            };
790
793
791
            var getStatusName = function(origName) {
794
            var getStatusName = function(origName, row) {
792
                switch( origName ) {
795
                switch( origName ) {
793
                    case "New request":
796
                    case "New request":
794
                        return _("New request");
797
                        return _("New request");
795
                    case "Requested":
798
                    case "Requested":
796
                        return _("Requested");
799
                        return _("Requested");
797
                    case "Requested from partners":
800
                    case "Requested from partners":
798
                        return _("Requested from partners");
801
                        var statStr = _("Requested from partners");
802
                        if (
803
                            row.hasOwnProperty('requested_partners') &&
804
                            row.requested_partners &&
805
                            row.requested_partners.length > 0
806
                        ) {
807
                            statStr += ' (' + row.requested_partners + ')';
808
                        }
809
                        return statStr;
799
                    case "Request reverted":
810
                    case "Request reverted":
800
                        return _("Request reverted");
811
                        return _("Request reverted");
801
                    case "Queued request":
812
                    case "Queued request":
802
- 

Return to bug 20563