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 (-4 / +5 lines)
Lines 76-81 Link Here
76
[% BLOCK build_items_table_js %]
76
[% BLOCK build_items_table_js %]
77
<script>
77
<script>
78
78
79
    let hide_patron_name = [% !Koha.Preference('HidePatronName') ? 'false' : 'true' %];
79
    [% IF StaffDetailItemSelection %]
80
    [% IF StaffDetailItemSelection %]
80
81
81
        let items_selection = {};
82
        let items_selection = {};
Lines 454-464 Link Here
454
455
455
                        nodes += '<span>';
456
                        nodes += '<span>';
456
                        if ( row.checkout.onsite_checkout ) {
457
                        if ( row.checkout.onsite_checkout ) {
457
                            let patron_to_html = $patron_to_html(row.checkout.patron, { url: true });
458
                            let patron_to_html = $patron_to_html(row.checkout.patron, { url: true, display_cardnumber: true, hide_patron_name });
458
                            nodes += _("Currently in local use by %s").format(patron_to_html);
459
                            nodes += _("Currently in local use by %s").format(patron_to_html);
459
                        } else {
460
                        } else {
460
                            nodes += '<span class="datedue">';
461
                            nodes += '<span class="datedue">';
461
                            let patron_to_html = $patron_to_html(row.checkout.patron, { url: true });
462
                            let patron_to_html = $patron_to_html(row.checkout.patron, { url: true, display_cardnumber: true, hide_patron_name });
462
                            nodes += _("Checked out to %s").format(patron_to_html);
463
                            nodes += _("Checked out to %s").format(patron_to_html);
463
                        }
464
                        }
464
                        nodes += ': ';
465
                        nodes += ': ';
Lines 504-510 Link Here
504
                                    [%# Hacky for patron_to_html in case we simply want to display the patron's library name %]
505
                                    [%# Hacky for patron_to_html in case we simply want to display the patron's library name %]
505
                                    row.first_hold.patron.library = { name: libraries_names.get(row.first_hold.patron.library_id) };
506
                                    row.first_hold.patron.library = { name: libraries_names.get(row.first_hold.patron.library_id) };
506
507
507
                                    let patron_to_html = $patron_to_html(row.first_hold.patron, { url: true });
508
                                    let patron_to_html = $patron_to_html(row.first_hold.patron, { url: true, display_cardnumber: true, hide_patron_name });
508
                                    nodes += ' <span class="heldfor">%s</span>'.format(_("Hold for: %s").format(patron_to_html));
509
                                    nodes += ' <span class="heldfor">%s</span>'.format(_("Hold for: %s").format(patron_to_html));
509
                                }
510
                                }
510
                            [% END %]
511
                            [% END %]
Lines 521-527 Link Here
521
                                [%# Hacky for patron_to_html in case we simply want to display the patron's library name %]
522
                                [%# Hacky for patron_to_html in case we simply want to display the patron's library name %]
522
                                row.recall.patron.library = { name: libraries_names.get(row.recall.patron.library_id) };
523
                                row.recall.patron.library = { name: libraries_names.get(row.recall.patron.library_id) };
523
524
524
                                let patron_to_html = $patron_to_html(row.recall.patron, {url: true });
525
                                let patron_to_html = $patron_to_html(row.recall.patron, {url: true, display_cardnumber: true, hide_patron_name });
525
                                nodes += '<span>%s</span>'.format(_("recalled by %s on %s").format(patron_to_html, $date(row.recall.created_date)))
526
                                nodes += '<span>%s</span>'.format(_("recalled by %s on %s").format(patron_to_html, $date(row.recall.created_date)))
526
                            }
527
                            }
527
                        }
528
                        }
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc (-6 / +13 lines)
Lines 36-43 Link Here
36
                name = firstname + ' ' + surname;
36
                name = firstname + ' ' + surname;
37
            }
37
            }
38
38
39
            if ( name.replace(' ', '').length == 0 ) {
40
                return _("A patron from library %s".format(patron.library.name));
41
            }
42
43
            if ( config && config.hide_patron_name ) {
44
                name = '';
45
            }
46
39
            if ( config && config.display_cardnumber ) {
47
            if ( config && config.display_cardnumber ) {
40
                name = name + ' (' + escape_str(patron.cardnumber)  + ')';
48
                if ( name.length > 0 ) {
49
                    name = name + ' (' + escape_str(patron.cardnumber)  + ')';
50
                } else {
51
                    name = escape_str(patron.cardnumber);
52
                }
41
            }
53
            }
42
54
43
            if (config && config.url) {
55
            if (config && config.url) {
Lines 49-58 Link Here
49
                }
61
                }
50
            }
62
            }
51
63
52
            if ( name.replace(' ', '').length == 0 ) {
53
                name = _("A patron from library %s".format(patron.library.name));
54
            }
55
56
            return name;
64
            return name;
57
        };
65
        };
58
    })();
66
    })();
59
- 

Return to bug 33568