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

(-)a/ill/ill-requests.pl (-3 / +9 lines)
Lines 68-74 if ( $backends_available ) { Link Here
68
    if ( $op eq 'illview' ) {
68
    if ( $op eq 'illview' ) {
69
        # View the details of an ILL
69
        # View the details of an ILL
70
        my $request = Koha::Illrequests->find($params->{illrequest_id});
70
        my $request = Koha::Illrequests->find($params->{illrequest_id});
71
72
        $template->param(
71
        $template->param(
73
            request    => $request,
72
            request    => $request,
74
            csrf_token => Koha::Token->new->generate_csrf({
73
            csrf_token => Koha::Token->new->generate_csrf({
Lines 167-174 if ( $backends_available ) { Link Here
167
                value   => {}
166
                value   => {}
168
            };
167
            };
169
            $template->param(
168
            $template->param(
170
                whole   => $backend_result,
169
                whole          => $backend_result,
171
                request => $request
170
                request        => $request,
171
                status_aliases => scalar Koha::AuthorisedValues->search(
172
                    { category => 'ILLSTATUS' }
173
                )
172
            );
174
            );
173
        } else {
175
        } else {
174
            # Commit:
176
            # Commit:
Lines 179-184 if ( $backends_available ) { Link Here
179
            $request->price_paid($params->{price_paid});
181
            $request->price_paid($params->{price_paid});
180
            $request->notesopac($params->{notesopac});
182
            $request->notesopac($params->{notesopac});
181
            $request->notesstaff($params->{notesstaff});
183
            $request->notesstaff($params->{notesstaff});
184
            my $alias = ($params->{status_alias} =~ /\d/) ?
185
                $params->{status_alias} :
186
                undef;
187
            $request->status_alias($alias);
182
            $request->store;
188
            $request->store;
183
            my $backend_result = {
189
            my $backend_result = {
184
                error   => 0,
190
                error   => 0,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (-10 / +35 lines)
Lines 192-198 Link Here
192
                                <li class="status">
192
                                <li class="status">
193
                                    <label class="status">Status:</label>
193
                                    <label class="status">Status:</label>
194
                                    [% stat = request.status %]
194
                                    [% stat = request.status %]
195
                                    [% request.capabilities.$stat.name | html %]
195
                                    [% current_alias = request.status_alias %]
196
                                    <select id="status_alias" name="status_alias">
197
                                        [% IF !current_alias %]
198
                                        <option value="" selected>
199
                                        [% ELSE %]
200
                                        <option value="">
201
                                        [% END %]
202
                                            [% request.capabilities.$stat.name | html %]
203
                                        </option>
204
                                        [% FOREACH alias IN status_aliases %]
205
                                            [% IF alias.id == current_alias %]
206
                                            <option value="[% alias.id %]" selected>
207
                                            [% ELSE %]
208
                                            <option value="[% alias.id %]">
209
                                            [% END %]
210
                                                [% alias.authorised_value | html %]
211
                                            </option>
212
                                        [% END %]
213
                                    </select>
196
                                </li>
214
                                </li>
197
                                <li class="updated">
215
                                <li class="updated">
198
                                    <label class="updated">Last updated:</label>
216
                                    <label class="updated">Last updated:</label>
Lines 325-331 Link Here
325
                                </div>
343
                                </div>
326
                                <div class="status">
344
                                <div class="status">
327
                                    <span class="label status">Status:</span>
345
                                    <span class="label status">Status:</span>
328
                                    [% request.capabilities.$req_status.name | html %]
346
                                    [% IF request.statusalias %]
347
                                        [% request.statusalias.authorised_value | html %]
348
                                    [% ELSE %]
349
                                        [% request.capabilities.$req_status.name | html%]
350
                                    [% END %]
329
                                </div>
351
                                </div>
330
                                <div class="updated">
352
                                <div class="updated">
331
                                    <span class="label updated">Last updated:</span>
353
                                    <span class="label updated">Last updated:</span>
Lines 713-726 Link Here
713
735
714
            // Render function for request status
736
            // Render function for request status
715
            var createStatus = function(data, type, row, meta) {
737
            var createStatus = function(data, type, row, meta) {
716
                var origData = meta.settings.oInit.originalData;
738
                if (row.status_alias) {
717
                if (origData.length > 0) {
739
                    return row.status_alias.authorised_value;
718
                    var status_name = meta.settings.oInit.originalData[0].capabilities[
719
                        row.status
720
                    ].name;
721
                    return getStatusName(status_name);
722
                } else {
740
                } else {
723
                    return '';
741
                    var origData = meta.settings.oInit.originalData;
742
                    if (origData.length > 0) {
743
                        var status_name = meta.settings.oInit.originalData[0].capabilities[
744
                            row.status
745
                        ].name;
746
                        return getStatusName(status_name);
747
                    } else {
748
                        return '';
749
                    }
724
                }
750
                }
725
            };
751
            };
726
752
727
- 

Return to bug 20581