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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-5 / +12 lines)
Lines 2-7 Link Here
2
[% USE Koha %]
2
[% USE Koha %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% USE AuthorisedValues %]
4
[% USE AuthorisedValues %]
5
[% USE ItemTypes %]
5
[% USE raw %]
6
[% USE raw %]
6
7
7
[% BLOCK build_table %]
8
[% BLOCK build_table %]
Lines 171-176 Link Here
171
                e["_str"] = e["branchname"];
172
                e["_str"] = e["branchname"];
172
                return e;
173
                return e;
173
            });
174
            });
175
    const all_item_types = [% To.json(ItemTypes.Get) | $raw %];
176
    const item_types_filters = all_item_types.map(e => {
177
                e["_id"] = e["itemtype"];
178
                e["_str"] = e["translated_description"];
179
                return e;
180
            });
181
    const item_types_notforloan = new Map(all_item_types.map( it => [it.itemtype, it.notforloan] ));
174
182
175
    const can_edit_items_from = [% To.json(can_edit_items_from || {}) | $raw %];
183
    const can_edit_items_from = [% To.json(can_edit_items_from || {}) | $raw %];
176
    const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %];
184
    const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %];
Lines 192-198 Link Here
192
    [%# In case or SeparateHoldings we may need to display the number of biblios in each tab %]
200
    [%# In case or SeparateHoldings we may need to display the number of biblios in each tab %]
193
    [%# Do we need separate/new endpoints or do we hack the somewhere client-side? %]
201
    [%# Do we need separate/new endpoints or do we hack the somewhere client-side? %]
194
    let item_table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?";
202
    let item_table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?";
195
    let embed = ["+strings,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk,item_type"];
203
    let embed = ["+strings,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk"];
196
    [% IF Koha.Preference('LocalCoverImages') %]
204
    [% IF Koha.Preference('LocalCoverImages') %]
197
        embed.push('cover_image_ids');
205
        embed.push('cover_image_ids');
198
    [% END %]
206
    [% END %]
Lines 257-262 Link Here
257
        }
265
        }
258
266
259
        let filters_options = {
267
        let filters_options = {
268
            2: () => all_item_types,
260
            3: () => all_libraries,
269
            3: () => all_libraries,
261
            4: () => all_libraries,
270
            4: () => all_libraries,
262
        };
271
        };
Lines 313-319 Link Here
313
            [% IF ( item_level_itypes ) %]
322
            [% IF ( item_level_itypes ) %]
314
            {
323
            {
315
                data: "me.item_type_id", // FIXME Cannot filter by biblioitem.itemtype
324
                data: "me.item_type_id", // FIXME Cannot filter by biblioitem.itemtype
316
                                         // FIXME Cannot filter on item type description
317
                className: "itype",
325
                className: "itype",
318
                searchable: true,
326
                searchable: true,
319
                orderable: true,
327
                orderable: true,
Lines 464-470 Link Here
464
                        nodes += '<span class="dmg">%s</span>'.format(escape_str(damaged_lib));
472
                        nodes += '<span class="dmg">%s</span>'.format(escape_str(damaged_lib));
465
                    }
473
                    }
466
474
467
                    if ( row.not_for_loan_status || row.item_type.notforloan ) {
475
                    if ( row.not_for_loan_status || item_types_notforloan[row.item_type_id] ) {
468
                        let not_for_loan_lib = av_not_for_loan.get(row.not_for_loan_status.toString());
476
                        let not_for_loan_lib = av_not_for_loan.get(row.not_for_loan_status.toString());
469
                        nodes += '<span class="notforloan">%s'.format(_("Not for loan")) + ( not_for_loan_lib ? '<span class="reason"> (%s)</span>'.format(escape_str(not_for_loan_lib)) : '' ) + '</span>';
477
                        nodes += '<span class="notforloan">%s'.format(_("Not for loan")) + ( not_for_loan_lib ? '<span class="reason"> (%s)</span>'.format(escape_str(not_for_loan_lib)) : '' ) + '</span>';
470
                    }
478
                    }
Lines 498-504 Link Here
498
                        }
506
                        }
499
                    [% END %]
507
                    [% END %]
500
508
501
                    if ( ! ( row.not_for_loan_status || row.item_type.notforloan || row.checked_out_date || row.lost_status || row.withdrawn || row.damaged || row.transfer || row.first_hold || row.recall ) ) {
509
                    if ( ! ( row.not_for_loan_status || item_types_notforloan[row.item_type_id] || row.checked_out_date || row.lost_status || row.withdrawn || row.damaged || row.transfer || row.first_hold || row.recall ) ) {
502
                        nodes += ' <span>%s</span>'.format(_("Available"))
510
                        nodes += ' <span>%s</span>'.format(_("Available"))
503
                    }
511
                    }
504
512
505
- 

Return to bug 33568