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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt (-16 / +4 lines)
Lines 165-183 Link Here
165
              //Remove item type column settings
165
              //Remove item type column settings
166
              table_settings['columns'] = table_settings['columns'].filter(function(c){return c['columnname'] != 'itemtype';});
166
              table_settings['columns'] = table_settings['columns'].filter(function(c){return c['columnname'] != 'itemtype';});
167
            [% END %]
167
            [% END %]
168
            const hold_cancellation_reasons = {};
168
            let current_holds_table = build_holds_table("#table_holdshistory");
169
            $.getJSON("/api/v1/authorised_value_categories/HOLD_CANCELLATION/authorised_values?_per_page=-1")
169
            let old_holds_table = build_holds_table("#table_oldholdshistory", 1);
170
              .done(function(data) {
171
                // Convert the array into an associative array for ease of lookup
172
                data.forEach(function(item) {
173
                  if (item.value !== undefined) {
174
                    hold_cancellation_reasons[item.value] = item.description;
175
                  }
176
                });
177
178
                let current_holds_table = build_holds_table("#table_holdshistory");
179
                let old_holds_table = build_holds_table("#table_oldholdshistory", 1);
180
            });
181
            function build_holds_table(table_id, old){
170
            function build_holds_table(table_id, old){
182
                let additional_filters = {
171
                let additional_filters = {
183
                    "-and": function(){
172
                    "-and": function(){
Lines 214-220 Link Here
214
                };
203
                };
215
204
216
                let table_url = '/api/v1/patrons/[% patron.borrowernumber | uri %]/holds';
205
                let table_url = '/api/v1/patrons/[% patron.borrowernumber | uri %]/holds';
217
                let table_embeds = ['biblio', 'item', 'pickup_library', 'pickup_library.branchname'];
206
                let table_embeds = ['+strings', 'biblio', 'item', 'pickup_library', 'pickup_library.branchname'];
218
                if (old){
207
                if (old){
219
                    table_url += '?old=1';
208
                    table_url += '?old=1';
220
                    table_embeds.push('deleted_biblio');
209
                    table_embeds.push('deleted_biblio');
Lines 331-337 Link Here
331
                                } else if (row.cancellation_date) {
320
                                } else if (row.cancellation_date) {
332
                                    let r = _("Cancelled");
321
                                    let r = _("Cancelled");
333
                                    if (row.cancellation_reason){
322
                                    if (row.cancellation_reason){
334
                                        r += " (%s)".format(hold_cancellation_reasons[row.cancellation_reason]);
323
                                        r += " (%s)".format(row._strings.cancellation_reason.str);
335
                                    }
324
                                    }
336
                                    return r;
325
                                    return r;
337
                                } else if (row.status == 'W') {
326
                                } else if (row.status == 'W') {
338
- 

Return to bug 40530