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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-17 / +16 lines)
Lines 477-483 Link Here
477
                        [%# Hacky for patron_to_html in case we simply want to display the patron's library name %]
477
                        [%# Hacky for patron_to_html in case we simply want to display the patron's library name %]
478
                        row.checkout.patron.library = { name: libraries_names.get(row.checkout.patron.library_id) };
478
                        row.checkout.patron.library = { name: libraries_names.get(row.checkout.patron.library_id) };
479
479
480
                        nodes += '<span>';
480
                        nodes += '<div>';
481
                        if ( row.checkout.onsite_checkout ) {
481
                        if ( row.checkout.onsite_checkout ) {
482
                            let patron_to_html = $patron_to_html(row.checkout.patron, { url: true, display_cardnumber: true, hide_patron_name });
482
                            let patron_to_html = $patron_to_html(row.checkout.patron, { url: true, display_cardnumber: true, hide_patron_name });
483
                            nodes += _("Currently in local use by %s").format(patron_to_html);
483
                            nodes += _("Currently in local use by %s").format(patron_to_html);
Lines 488-505 Link Here
488
                        }
488
                        }
489
                        nodes += ': ';
489
                        nodes += ': ';
490
                        nodes += _("due %s").format($date(row.checkout.due_date, { as_due_date: true }));
490
                        nodes += _("due %s").format($date(row.checkout.due_date, { as_due_date: true }));
491
                        nodes += "</span>"
491
                        nodes += "</div>"
492
                    } else if ( row.transfer ) {
492
                    } else if ( row.transfer ) {
493
                        if ( row.transfer.datesent ) {
493
                        if ( row.transfer.datesent ) {
494
                            nodes += '<span class="intransit">%s</span>'.format(_("In transit from %s to %s since %s").format(escape_str(row.transfer._strings.from_library.str), escape_str(row.transfer._strings.to_library.str), $date(row.transfer.datesent)));
494
                            nodes += '<div class="intransit">%s</div>'.format(_("In transit from %s to %s since %s").format(escape_str(row.transfer._strings.from_library.str), escape_str(row.transfer._strings.to_library.str), $date(row.transfer.datesent)));
495
                        } else {
495
                        } else {
496
                            nodes += '<span class="transitrequested">%s</span>'.format(_("Transit pending from %s to %s since %s").format(escape_str(row.transfer._strings.from_library.str), escape_str(row.transfer._strings.to_library.str), $date(row.transfer.daterequested)));
496
                            nodes += '<div class="transitrequested">%s</div>'.format(_("Transit pending from %s to %s since %s").format(escape_str(row.transfer._strings.from_library.str), escape_str(row.transfer._strings.to_library.str), $date(row.transfer.daterequested)));
497
                        }
497
                        }
498
                    }
498
                    }
499
499
500
                    if ( row.lost_status ) {
500
                    if ( row.lost_status ) {
501
                        let lost_lib = av_lost.get(row.lost_status.toString()) || _("Unavailable (lost or missing");
501
                        let lost_lib = av_lost.get(row.lost_status.toString()) || _("Unavailable (lost or missing");
502
                        nodes += '<span class="lost">%s</span>'.format(escape_str(lost_lib));
502
                        nodes += '<div class="lost">%s</div>'.format(escape_str(lost_lib));
503
                        [% IF Koha.Preference('ClaimReturnedLostValue') %]
503
                        [% IF Koha.Preference('ClaimReturnedLostValue') %]
504
                            const hasReturnClaims = row.return_claims.filter(rc => !rc.resolution).length > 0 ? true : false
504
                            const hasReturnClaims = row.return_claims.filter(rc => !rc.resolution).length > 0 ? true : false
505
                            if(hasReturnClaims) {
505
                            if(hasReturnClaims) {
Lines 510-534 Link Here
510
510
511
                    if ( row.withdrawn ) {
511
                    if ( row.withdrawn ) {
512
                        let withdrawn_lib = av_withdrawn.get(row.withdrawn.toString()) || _("Withdrawn");
512
                        let withdrawn_lib = av_withdrawn.get(row.withdrawn.toString()) || _("Withdrawn");
513
                        nodes += '<span class="wdn">%s</span>'.format(escape_str(withdrawn_lib));
513
                        nodes += '<div class="wdn">%s</div>'.format(escape_str(withdrawn_lib));
514
                    }
514
                    }
515
515
516
                    if ( row.damaged_status ) {
516
                    if ( row.damaged_status ) {
517
                        let damaged_lib = av_damaged.get(row.damaged_status.toString()) || _("Damaged");
517
                        let damaged_lib = av_damaged.get(row.damaged_status.toString()) || _("Damaged");
518
                        nodes += '<span class="dmg">%s</span>'.format(escape_str(damaged_lib));
518
                        nodes += '<div class="dmg">%s</div>'.format(escape_str(damaged_lib));
519
                    }
519
                    }
520
520
521
                    if ( row.not_for_loan_status || item_types_notforloan.get(row.item_type_id) ) {
521
                    if ( row.not_for_loan_status || item_types_notforloan.get(row.item_type_id) ) {
522
                        let not_for_loan_lib = av_not_for_loan.get(row.not_for_loan_status.toString());
522
                        let not_for_loan_lib = av_not_for_loan.get(row.not_for_loan_status.toString());
523
                        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>';
523
                        nodes += '<div class="notforloan">%s'.format(_("Not for loan")) + ( not_for_loan_lib ? '<span class="reason"> (%s)</span>'.format(escape_str(not_for_loan_lib)) : '' ) + '</div>';
524
                    }
524
                    }
525
525
526
                    if ( row.first_hold ) {
526
                    if ( row.first_hold ) {
527
                        if ( row.first_hold.waiting_date ) {
527
                        if ( row.first_hold.waiting_date ) {
528
                            if ( row.first_hold.desk ) {
528
                            if ( row.first_hold.desk ) {
529
                                nodes += '<span class="waitingat">%s</span>'.format(_("Waiting at %s, %s since %s.".format(row.first_hold._strings.pickup_library_id.str, row.first_hold.desk.desk_name, $date(row.first_hold.waiting_date))));
529
                                nodes += '<div class="waitingat">%s</div>'.format(_("Waiting at %s, %s since %s.".format(row.first_hold._strings.pickup_library_id.str, row.first_hold.desk.desk_name, $date(row.first_hold.waiting_date))));
530
                            } else {
530
                            } else {
531
                                nodes += '<span class="waitingat">%s</span>'.format(_("Waiting at %s since %s.".format(row.first_hold._strings.pickup_library_id.str, $date(row.first_hold.waiting_date))));
531
                                nodes += '<div class="waitingat">%s</div>'.format(_("Waiting at %s since %s.".format(row.first_hold._strings.pickup_library_id.str, $date(row.first_hold.waiting_date))));
532
                            }
532
                            }
533
                            [% IF Koha.Preference('canreservefromotherbranches') %]
533
                            [% IF Koha.Preference('canreservefromotherbranches') %]
534
                                if ( row.first_hold.waiting_date || row.first_hold.priority == 1 ) {
534
                                if ( row.first_hold.waiting_date || row.first_hold.priority == 1 ) {
Lines 536-546 Link Here
536
                                    row.first_hold.patron.library = { name: libraries_names.get(row.first_hold.patron.library_id) };
536
                                    row.first_hold.patron.library = { name: libraries_names.get(row.first_hold.patron.library_id) };
537
537
538
                                    let patron_to_html = $patron_to_html(row.first_hold.patron, { url: true, display_cardnumber: true, hide_patron_name });
538
                                    let patron_to_html = $patron_to_html(row.first_hold.patron, { url: true, display_cardnumber: true, hide_patron_name });
539
                                    nodes += ' <span class="heldfor">%s</span>'.format(_("Hold for: %s").format(patron_to_html));
539
                                    nodes += ' <div class="heldfor">%s</div>'.format(_("Hold for: %s").format(patron_to_html));
540
                                }
540
                                }
541
                            [% END %]
541
                            [% END %]
542
                        } else {
542
                        } else {
543
                            nodes += ' <span class="holdonitem">%s</span>'.format(_("There is an item level hold on this item (priority = %s).").format(row.first_hold.priority));
543
                            nodes += ' <div class="holdonitem">%s</div>'.format(_("There is an item level hold on this item (priority = %s).").format(row.first_hold.priority));
544
                        }
544
                        }
545
                    }
545
                    }
546
546
Lines 553-573 Link Here
553
                                row.recall.patron.library = { name: libraries_names.get(row.recall.patron.library_id) };
553
                                row.recall.patron.library = { name: libraries_names.get(row.recall.patron.library_id) };
554
554
555
                                let patron_to_html = $patron_to_html(row.recall.patron, {url: true, display_cardnumber: true, hide_patron_name });
555
                                let patron_to_html = $patron_to_html(row.recall.patron, {url: true, display_cardnumber: true, hide_patron_name });
556
                                nodes += '<span>%s</span>'.format(_("Recalled by %s on %s").format(patron_to_html, $date(row.recall.created_date)))
556
                                nodes += '<div>%s</div>'.format(_("Recalled by %s on %s").format(patron_to_html, $date(row.recall.created_date)))
557
                            }
557
                            }
558
                        }
558
                        }
559
                    [% END %]
559
                    [% END %]
560
560
561
                    if ( ! ( row.not_for_loan_status || item_types_notforloan.get(row.item_type_id) || row.checked_out_date || row.lost_status || row.withdrawn || row.damaged_status || row.transfer || row.first_hold || ( row.recall && ( row.item_id === row.recall.item_id ) ) )) {
561
                    if ( ! ( row.not_for_loan_status || item_types_notforloan.get(row.item_type_id) || row.checked_out_date || row.lost_status || row.withdrawn || row.damaged_status || row.transfer || row.first_hold || ( row.recall && ( row.item_id === row.recall.item_id ) ) )) {
562
                        nodes += ' <span>%s</span>'.format(_("Available"))
562
                        nodes += ' <div>%s</div>'.format(_("Available"))
563
                    }
563
                    }
564
564
565
                    if ( row.restricted_status ) {
565
                    if ( row.restricted_status ) {
566
                        nodes += '<span class="restricted">(%s)</span>'.format(escape_str(av_restricted.get(row.restricted_status.toString())));
566
                        nodes += '<div class="restricted">(%s)</div>'.format(escape_str(av_restricted.get(row.restricted_status.toString())));
567
                    }
567
                    }
568
568
569
                    if ( row.in_bundle ) {
569
                    if ( row.in_bundle ) {
570
                        nodes += '<span class="bundled">%s</span>'.format(_("In bundle: %s").format($biblio_to_html(row.bundle_host.biblio, { link: true })));
570
                        nodes += '<div class="bundled">%s</div>'.format(_("In bundle: %s").format($biblio_to_html(row.bundle_host.biblio, { link: true })));
571
                    }
571
                    }
572
                    return nodes;
572
                    return nodes;
573
                }
573
                }
574
- 

Return to bug 38767