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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt (-12 / +13 lines)
Lines 181-195 Link Here
181
            item_types: all_item_types,
181
            item_types: all_item_types,
182
            libraries: all_libraries,
182
            libraries: all_libraries,
183
        };
183
        };
184
185
        var table_settings = [% TablesSettings.GetTableSettings('members', 'holdshistory', 'holdshistory-table', 'json') | $raw %];
186
        [% UNLESS show_itemtype_column %]
187
          //Remove item type column settings
188
          table_settings['columns'] = table_settings['columns'].filter(function(c){return c['columnname'] != 'itemtype';});
189
        [% END %]
190
191
        const patron_id = "[% patron.borrowernumber | html %]";
192
        const show_itemtype_column = [% show_itemtype_column ? 1 : 0 | html %];
184
    </script>
193
    </script>
185
    <script>
194
    <script>
186
        $(document).ready(function() {
195
        $(document).ready(function() {
187
            var table_settings = [% TablesSettings.GetTableSettings('members', 'holdshistory', 'holdshistory-table', 'json') | $raw %];
188
            [% UNLESS show_itemtype_column %]
189
              //Remove item type column settings
190
              table_settings['columns'] = table_settings['columns'].filter(function(c){return c['columnname'] != 'itemtype';});
191
            [% END %]
192
193
            let current_holds_table = build_holds_table("#table_holdshistory");
196
            let current_holds_table = build_holds_table("#table_holdshistory");
194
            let old_holds_table = build_holds_table("#table_oldholdshistory", 1);
197
            let old_holds_table = build_holds_table("#table_oldholdshistory", 1);
195
            function build_holds_table(table_id, old){
198
            function build_holds_table(table_id, old){
Lines 227-233 Link Here
227
230
228
                };
231
                };
229
232
230
                let table_url = '/api/v1/patrons/[% patron.borrowernumber | uri %]/holds';
233
                let table_url = `/api/v1/patrons/${patron_id}/holds`;
231
                let table_embeds = ['+strings', 'biblio', 'item', 'pickup_library'];
234
                let table_embeds = ['+strings', 'biblio', 'item', 'pickup_library'];
232
                if (old){
235
                if (old){
233
                    table_url += '?old=1';
236
                    table_url += '?old=1';
Lines 323-330 Link Here
323
                                return $date(row.cancellation_date)
326
                                return $date(row.cancellation_date)
324
                            }
327
                            }
325
                        },
328
                        },
326
                        [% IF show_itemtype_column %]
329
                        ...(show_itemtype_column?
327
                        {
330
                        [{
328
                            data: "item_type_id",
331
                            data: "item_type_id",
329
                            datatype: "coded_value:item_type",
332
                            datatype: "coded_value:item_type",
330
                            dataFilter: "item_types",
333
                            dataFilter: "item_types",
Lines 337-344 Link Here
337
                                    return _("Any item type");
340
                                    return _("Any item type");
338
                                }
341
                                }
339
                            }
342
                            }
340
                        },
343
                        ]:[]),
341
                        [% END %]
342
                        {
344
                        {
343
                            data: "status",
345
                            data: "status",
344
                            searchable: false,
346
                            searchable: false,
345
- 

Return to bug 41572