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

(-)a/ill/ill-requests.pl (-3 / +9 lines)
Lines 61-67 if ( $backends_available ) { Link Here
61
    if ( $op eq 'illview' ) {
61
    if ( $op eq 'illview' ) {
62
        # View the details of an ILL
62
        # View the details of an ILL
63
        my $request = Koha::Illrequests->find($params->{illrequest_id});
63
        my $request = Koha::Illrequests->find($params->{illrequest_id});
64
65
        $template->param(
64
        $template->param(
66
            request => $request
65
            request => $request
67
        );
66
        );
Lines 119-126 if ( $backends_available ) { Link Here
119
                value   => {}
118
                value   => {}
120
            };
119
            };
121
            $template->param(
120
            $template->param(
122
                whole   => $backend_result,
121
                whole          => $backend_result,
123
                request => $request
122
                request        => $request,
123
                status_aliases => scalar Koha::AuthorisedValues->search(
124
                    { category => 'ILLSTATUS' }
125
                )
124
            );
126
            );
125
        } else {
127
        } else {
126
            # Commit:
128
            # Commit:
Lines 130-135 if ( $backends_available ) { Link Here
130
            $request->branchcode($params->{branchcode});
132
            $request->branchcode($params->{branchcode});
131
            $request->notesopac($params->{notesopac});
133
            $request->notesopac($params->{notesopac});
132
            $request->notesstaff($params->{notesstaff});
134
            $request->notesstaff($params->{notesstaff});
135
            my $alias = ($params->{status_alias} =~ /\d/) ?
136
                $params->{status_alias} :
137
                undef;
138
            $request->status_alias($alias);
133
            $request->store;
139
            $request->store;
134
            my $backend_result = {
140
            my $backend_result = {
135
                error   => 0,
141
                error   => 0,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (-29 / +53 lines)
Lines 127-159 Link Here
127
127
128
        // Render function for request status
128
        // Render function for request status
129
        var createStatus = function(data, type, row, meta) {
129
        var createStatus = function(data, type, row, meta) {
130
            var origData = meta.settings.oInit.originalData;
130
            if (row.status_alias) {
131
            if (origData.length > 0) {
131
                return row.status_alias.authorised_value;
132
                var status_name = meta.settings.oInit.originalData[0].capabilities[
133
                    row.status
134
                ].name;
135
                switch( status_name ) {
136
                    case "New request":
137
                        return _("New request");
138
                    case "Requested":
139
                        return _("Requested");
140
                    case "Requested from partners":
141
                        return _("Requested from partners");
142
                    case "Request reverted":
143
                        return _("Request reverted");
144
                    case "Queued request":
145
                        return _("Queued request");
146
                    case "Cancellation requested":
147
                        return _("Cancellation requested");
148
                    case "Completed":
149
                        return _("Completed");
150
                    case "Delete request":
151
                        return _("Delete request");
152
                    default:
153
                        return status_name;
154
                }
155
            } else {
132
            } else {
156
                return '';
133
                var origData = meta.settings.oInit.originalData;
134
                if (origData.length > 0) {
135
                    var status_name = meta.settings.oInit.originalData[0]
136
                        .capabilities[row.status].name;
137
                    switch( status_name ) {
138
                        case "New request":
139
                            return _("New request");
140
                        case "Requested":
141
                            return _("Requested");
142
                        case "Requested from partners":
143
                            return _("Requested from partners");
144
                        case "Request reverted":
145
                            return _("Request reverted");
146
                        case "Queued request":
147
                            return _("Queued request");
148
                        case "Cancellation requested":
149
                            return _("Cancellation requested");
150
                        case "Completed":
151
                            return _("Completed");
152
                        case "Delete request":
153
                            return _("Delete request");
154
                        default:
155
                            return status_name;
156
                    }
157
                } else {
158
                    return '';
159
                }
157
            }
160
            }
158
        };
161
        };
159
162
Lines 428-434 Link Here
428
                                <li class="status">
431
                                <li class="status">
429
                                    <label class="status">Status:</label>
432
                                    <label class="status">Status:</label>
430
                                    [% stat = request.status %]
433
                                    [% stat = request.status %]
431
                                    [% request.capabilities.$stat.name %]
434
                                    [% current_alias = request.status_alias %]
435
                                    <select id="status_alias" name="status_alias">
436
                                        [% IF !current_alias %]
437
                                        <option value="" selected>
438
                                        [% ELSE %]
439
                                        <option value="">
440
                                        [% END %]
441
                                            [% request.capabilities.$stat.name | html %]
442
                                        </option>
443
                                        [% FOREACH alias IN status_aliases %]
444
                                            [% IF alias.id == current_alias %]
445
                                            <option value="[% alias.id %]" selected>
446
                                            [% ELSE %]
447
                                            <option value="[% alias.id %]">
448
                                            [% END %]
449
                                                [% alias.authorised_value | html %]
450
                                            </option>
451
                                        [% END %]
452
                                    </select>
432
                                </li>
453
                                </li>
433
                                <li class="updated">
454
                                <li class="updated">
434
                                    <label class="updated">Last updated:</label>
455
                                    <label class="updated">Last updated:</label>
Lines 530-536 Link Here
530
                                </div>
551
                                </div>
531
                                <div class="status">
552
                                <div class="status">
532
                                    <span class="label status">Status:</span>
553
                                    <span class="label status">Status:</span>
533
                                    [% capabilities.$req_status.name %]
554
                                    [% IF request.statusalias %]
555
                                        [% request.statusalias.authorised_value %]
556
                                    [% ELSE %]
557
                                        [% capabilities.$req_status.name %]
558
                                    [% END %]
534
                                </div>
559
                                </div>
535
                                <div class="updated">
560
                                <div class="updated">
536
                                    <span class="label updated">Last updated:</span>
561
                                    <span class="label updated">Last updated:</span>
537
- 

Return to bug 20581