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 (-30 / +54 lines)
Lines 128-160 Link Here
128
128
129
        // Render function for request status
129
        // Render function for request status
130
        var createStatus = function(data, type, row, meta) {
130
        var createStatus = function(data, type, row, meta) {
131
            var origData = meta.settings.oInit.originalData;
131
            if (row.status_alias) {
132
            if (origData.length > 0) {
132
                return row.status_alias.authorised_value;
133
                var status_name = meta.settings.oInit.originalData[0].capabilities[
134
                    row.status
135
                ].name;
136
                switch( status_name ) {
137
                    case "New request":
138
                        return _("New request");
139
                    case "Requested":
140
                        return _("Requested");
141
                    case "Requested from partners":
142
                        return _("Requested from partners");
143
                    case "Request reverted":
144
                        return _("Request reverted");
145
                    case "Queued request":
146
                        return _("Queued request");
147
                    case "Cancellation requested":
148
                        return _("Cancellation requested");
149
                    case "Completed":
150
                        return _("Completed");
151
                    case "Delete request":
152
                        return _("Delete request");
153
                    default:
154
                        return status_name;
155
                }
156
            } else {
133
            } else {
157
                return '';
134
                var origData = meta.settings.oInit.originalData;
135
                if (origData.length > 0) {
136
                    var status_name = meta.settings.oInit.originalData[0]
137
                        .capabilities[row.status].name;
138
                    switch( status_name ) {
139
                        case "New request":
140
                            return _("New request");
141
                        case "Requested":
142
                            return _("Requested");
143
                        case "Requested from partners":
144
                            return _("Requested from partners");
145
                        case "Request reverted":
146
                            return _("Request reverted");
147
                        case "Queued request":
148
                            return _("Queued request");
149
                        case "Cancellation requested":
150
                            return _("Cancellation requested");
151
                        case "Completed":
152
                            return _("Completed");
153
                        case "Delete request":
154
                            return _("Delete request");
155
                        default:
156
                            return status_name;
157
                    }
158
                } else {
159
                    return '';
160
                }
158
            }
161
            }
159
        };
162
        };
160
163
Lines 428-435 Link Here
428
                                </li>
431
                                </li>
429
                                <li class="status">
432
                                <li class="status">
430
                                    <label class="status">Status:</label>
433
                                    <label class="status">Status:</label>
431
                                    [% stat = request.status | html %]
434
                                    [% stat = request.status %]
432
                                    [% request.capabilities.$stat.name | html %]
435
                                    [% current_alias = request.status_alias %]
436
                                    <select id="status_alias" name="status_alias">
437
                                        [% IF !current_alias %]
438
                                        <option value="" selected>
439
                                        [% ELSE %]
440
                                        <option value="">
441
                                        [% END %]
442
                                            [% request.capabilities.$stat.name | html %]
443
                                        </option>
444
                                        [% FOREACH alias IN status_aliases %]
445
                                            [% IF alias.id == current_alias %]
446
                                            <option value="[% alias.id %]" selected>
447
                                            [% ELSE %]
448
                                            <option value="[% alias.id %]">
449
                                            [% END %]
450
                                                [% alias.authorised_value | html %]
451
                                            </option>
452
                                        [% END %]
453
                                    </select>
433
                                </li>
454
                                </li>
434
                                <li class="updated">
455
                                <li class="updated">
435
                                    <label class="updated">Last updated:</label>
456
                                    <label class="updated">Last updated:</label>
Lines 529-535 Link Here
529
                                </div>
550
                                </div>
530
                                <div class="status">
551
                                <div class="status">
531
                                    <span class="label status">Status:</span>
552
                                    <span class="label status">Status:</span>
532
                                    [% request.capabilities.$req_status.name | html %]
553
                                    [% IF request.statusalias %]
554
                                        [% request.statusalias.authorised_value | html %]
555
                                    [% ELSE %]
556
                                        [% request.capabilities.$req_status.name | html%]
557
                                    [% END %]
533
                                </div>
558
                                </div>
534
                                <div class="updated">
559
                                <div class="updated">
535
                                    <span class="label updated">Last updated:</span>
560
                                    <span class="label updated">Last updated:</span>
536
- 

Return to bug 20581