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

(-)a/Koha/Patron.pm (+4 lines)
Lines 2519-2524 sub to_api { Link Here
2519
                                    ? Mojo::JSON->true
2519
                                    ? Mojo::JSON->true
2520
                                    : Mojo::JSON->false;
2520
                                    : Mojo::JSON->false;
2521
2521
2522
    $json_patron->{expired} = ( $self->is_expired )
2523
                                    ? Mojo::JSON->true
2524
                                    : Mojo::JSON->false;
2525
2522
    return $json_patron;
2526
    return $json_patron;
2523
}
2527
}
2524
2528
(-)a/api/v1/swagger/definitions/patron.yaml (+4 lines)
Lines 209-214 properties: Link Here
209
      - boolean
209
      - boolean
210
      - "null"
210
      - "null"
211
    description: set to 1 if library marked this patron as having lost his card
211
    description: set to 1 if library marked this patron as having lost his card
212
  expired:
213
    type: boolean
214
    readOnly: true
215
    description: If patron is expired
212
  restricted:
216
  restricted:
213
    type: boolean
217
    type: boolean
214
    readOnly: true
218
    readOnly: true
(-)a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js (-8 / +1 lines)
Lines 695-706 function patron_autocomplete(node, options) { Link Here
695
        } else {
695
        } else {
696
            loggedInClass = "";
696
            loggedInClass = "";
697
        }
697
        }
698
        let new_date = new Date();
699
        let today = Date.parse($date_to_rfc3339($date(new_date.toString())));
700
        let expiration = Date.parse(
701
            $date_to_rfc3339($date(item.expiry_date.toString()))
702
        );
703
        let expired = today > expiration;
704
        return $("<li></li>")
698
        return $("<li></li>")
705
            .addClass(loggedInClass)
699
            .addClass(loggedInClass)
706
            .data("ui-autocomplete-item", item)
700
            .data("ui-autocomplete-item", item)
Lines 735-741 function patron_autocomplete(node, options) { Link Here
735
                          item.library.name.escapeHtml() +
729
                          item.library.name.escapeHtml() +
736
                          "</span>"
730
                          "</span>"
737
                        : "") +
731
                        : "") +
738
                    (expired
732
                    (item.expired
739
                        ? '<span class="badge text-bg-warning">' +
733
                        ? '<span class="badge text-bg-warning">' +
740
                          __("Expired") +
734
                          __("Expired") +
741
                          "</span>"
735
                          "</span>"
742
- 

Return to bug 36454