Active/Primary Editing for Patron Cards
authorThomas Berezansky <tsbere@mvlc.org>
Tue, 1 Nov 2011 13:18:47 +0000 (09:18 -0400)
committerThomas Berezansky <tsbere@mvlc.org>
Tue, 1 Nov 2011 13:18:47 +0000 (09:18 -0400)
commitb0db0cf7d6f49a404b1071fb9c356fb026b375a7
tree2d2f7467dada6761eb9171d2c1ca9dfe221abda9
parent0c29090151e896568214eef2ed2ae69b49c16974
Active/Primary Editing for Patron Cards

Changes "See All" into an editing interface, allowing for changing of the
active and primary state of each card.

Each requires a specific permission:

UPDATE_PATRON_ACTIVE_CARD
UPDATE_PATRON_PRIMARY_CARD

Without the appropriate permission the interface will show the green check
or red x instead of the editing elements. If you don't have either
permission then the Apply Changes button is hidden.

As the editing interface exists, also show the "See All" button when there
is only one card, but not when registering a new patron. This allows for
toggling the lone card's active flag, as well as replacing a card but
leaving the old one active.

To ensure that you can do the above, and to avoid some other errors, the
new card on a patron is saved to the editCard variable, rather than using
patron.card(). This both allows for "Replacing" a new non-primary card into
place as well as avoiding issues with editing the primary and active states
at the same time (the interface would try and update the new primary card
with the old primary card's barcode). Also, when checking for duplicate
barcodes, update the editCard with the barcode so the See All interface can
show the new card's barcode in the list properly.

Finally, included is localization for the All Cards interface headers and
buttons.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/src/templates/actor/user/register.tt2
Open-ILS/src/templates/actor/user/register_table.tt2
Open-ILS/web/js/dojo/openils/actor/nls/register.js
Open-ILS/web/js/ui/default/actor/user/register.js