]> git.evergreen-ils.org Git - Evergreen.git/commit
LP1282277 & LP1282286 MARC edit save warning & TCN search warning
authorLiam Whalen <liam.whalen@bc.libraries.coop>
Mon, 16 Sep 2013 02:26:16 +0000 (19:26 -0700)
committerBen Shum <bshum@biblio.org>
Tue, 11 Nov 2014 01:45:49 +0000 (20:45 -0500)
commite9de9d7e1944ff0b467f204ba898b5f52073cac0
tree1db05ad1e08038e153a3f02eba399534c1afa618
parent86a8e267bf7903765b1181682ded5543667bf498
LP1282277 & LP1282286 MARC edit save warning & TCN search warning

LP1282286 TCN search shortcut incorrectly prompts for lost data

When cataloguing in the Marc Edit view, users can hit Shift-F3 to bring
up the TCN search dialog box.  After entering a TCN and confirming their
entry, they will be taken to the record specified by the TCN entered.

However, if the user has edited some data on the current marc record,
then another dialog box should appear before the TCN search box that
gives them a warning that they will lose data if they go to a new
record.

Currently, whenver a user presses the Shift-F3 shortcut, they are given
a warning about losing data regardless of the current state of the marc
record being edited.

When a record is edited, a key press event is captured and the function
oils_lock_page is called to record the page as edited.  In the case of
this bug, the Shift key is not being ignored.  So, when the user
presses Shift-F3, the marc record is locked as if it were edited, then
the TCN search function is called.  After the user enters a TCN and
presses OK, the warning about lost data is displayed because the
pressing of Shift marked the record as edited.

This fix adds a check for the ev.shiftKey event in the
set_lock_on_keypress function call in marcedit.js.

Currently, if the user has edited a marc record and
pressed Shift-F3 to retrieve another record via TCN, then the prompt for
the TCN appears and after the user ok's that prompt they are prompted to
make sure they are ok with losing data.

This modification causes the prompt for lost data to appear before the
prompt for the TCN value.  It requires modifying
chrome/content/main/menu.js, which will require a staff client update.
This fix also ensures that if users confirm that it is ok to lose
data but then cancel their TCN searches that they will be prompted that
they might lose data again if they do more TCN retrieving.

LP1282277 Prompt for lost data in  Marc Edit

When using the MARC editor, if you modify a record and then use another
UI element to leave the MARC editor, you will be prompted that you might
lose data if you leave the MARC editor.  Currently, this prompt does not
happen if the user uses an Action for This Record drop down menu item.
As well, if the user then returns to the MARC editor, the changes are
still present, but leaving the MARC editor no longer prompts with  a
lost data warning.

This fix, adds checks to the Actions for This Record menu items, and it
adds some tab variables to keep track of the state of the MARC editor.
That way, if the user leaves then comes back and changes are still
present, the user will still get a lose data warning if they try to
leave again.

As well, when ever a key is pressed in MARC Edit that would result in
modifying a record, a counter is increased on a semamphor stored on
the XUL tab containing the Marc Edit UI.  Currently, when the record is
saved, this counter is decremented by 1.  However, the code checks to
see that the counter is 0 in order to determine if the tab is still
locked and data might be lost.

So, to fix this, we check in the unlock_tab code to see if we are in the
MARC Editor, and if we are, then we set the counter to 0.  The
unlock_tab code is used when saving via the Marc Editor.  It may be
used elsewhere in other parts of the Staff Client, so I have left the
original decrement by 1 logic in for all cases other than being in the
Marc Editor.

Conflicts:

Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Open-ILS/xul/staff_client/server/cat/marcedit.js
Open-ILS/xul/staff_client/server/cat/marcedit.xul

The fix was modified, because the previous fix was storing the flags that
indicated a change to a MARC record at the window level.
This new fix stores them at the tab level.  I am keeping this commit
message to indicate that there were more Conflicts when mergin Sitka's
code into the community code.  In case, I missed something and a record
of what was done needs to be consulted.

Conflicts:

Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/server/cat/marcedit.js

LP1282277 & LP1282286 MARC edit TCN search lose data prompts

This commit modifies my previous commits.  The code now uses the
previous versions code to mark a tab as locked and to record that data
is saved or not saved.  However, when a user returns to the MARC edit
screen, if there are changes still present, then the code now locks the
tab again and records that there is unsaved data.  This should allow all
previous functionality to remain while providing the proper warnings
when within the MARC editor.

LP1282277 & LP1282286 MARC Edit and TCN lose data prompt

This commit sets the tab.marc_edit_changed value to false when the tab
is set.  This means if an MARC record is edited in a tab then the tab is
set to another view, if the user then goes back to MARC edit, the tab
will not be locked because the flag will now be set to false.  This
results in no warning being shown when a user tries to leave a MARC edit
page when they have not edited the MARC.

Signed-off-by: Liam Whalen <liam.whalen@bc.libraries.coop>
Signed-off-by: Kyle Tomita <tomitakyle@gmail.com>
Signed-off-by: Jennifer Pringle <jpringle@sitka.bclibraries.ca>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/menu_frame.xul
Open-ILS/xul/staff_client/server/cat/marcedit.js
Open-ILS/xul/staff_client/server/cat/marcedit.xul