Bug 9773 - Replace YUI AJAX calls in cataloging plugins with jQuery
Summary: Replace YUI AJAX calls in cataloging plugins with jQuery
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Owen Leonard
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks: 9779
  Show dependency treegraph
 
Reported: 2013-03-08 17:13 UTC by Owen Leonard
Modified: 2014-12-07 20:02 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 9773 - Replace YUI AJAX calls in cataloging plugins with jQuery (6.50 KB, patch)
2013-03-08 17:35 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 9773 - Replace YUI AJAX calls in cataloging plugins with jQuery (6.61 KB, patch)
2013-05-28 21:41 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 9773 - Replace YUI AJAX calls in cataloging plugins with jQuery (6.67 KB, patch)
2013-05-29 09:37 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2013-03-08 17:13:52 UTC
There are calls in a few cataloging plugins to YUI AJAX functions. These can be replaced with jQuery code.

 cataloguing/value_builder/callnumber.pl
 cataloguing/value_builder/callnumber-KU.pl
 cataloguing/value_builder/stocknumberam123.pl
 cataloguing/value_builder/unimarc_field_010.pl
Comment 1 Owen Leonard 2013-03-08 17:35:42 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2013-05-09 19:18:00 UTC
Switching this from enhancement to bug since YUI JS dependencies need to go away.
Comment 3 Mirko Tietgen 2013-05-28 21:41:40 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2013-05-29 09:36:44 UTC
QA comment:

This patch replaces the YUI AJAX stuff with jQuery. It is a more readable and adds a new step to get rid of YUI.
There is no more occurrence of 'YAHOO' in the cataloguing/value_builder directory.
I tested the unimarc plugin and it works like as before.

Marked as Passed QA.
Comment 5 Jonathan Druart 2013-05-29 09:37:46 UTC
Created attachment 18453 [details] [review]
Bug 9773 - Replace YUI AJAX calls in cataloging plugins with jQuery

Several cataloging plugins make some simple AJAX GET calls via the YUI
AJAX feature. This code can be easily converted to jQuery.

To test, link each plugin to the relelvant field by editing your MARC
stucture. Confirm that functionality is unchanged.

For callnumber.pl and callnumber-KU.pl, test by linking to 952o.
callnumber.pl is triggered on blur of (when you focus on and click away
from) the 952o entry field. callnumber-KU.pl is triggered by clicking
the "..." link.

stocknumberam123.pl should be linked to 952i. If your data doesn't
already have information stored for inventory number, modify at least
one record to add one. The plugin is triggered on blur of the 952i
field. It should increment the highest value inventory number stored in
your system.

unimarc_field_010.pl is UNIMARC-specific, so I'm guessing about its
functionality. I tested it by linking the plugin to MARC21 field 020a.
The plugin is triggered on blur of the affected field (020a in my test).
You can confirm that the plugin returns valid data by using a tool like
Firebug to view the XHR response. Or if you're not using UNIMARC you can
hack the plugin to update a different field instead (line 57,
/^tag_210_subfield_c/ ). I tried "245_subfield_c" instead of
"210c_subfield_c." Nonsensical, but useful for testing.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Tried the 3 MARC21 plugins. Did not try the Unimarc one, but it's exactly the same code change.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 6 Galen Charlton 2013-05-29 15:43:58 UTC
Pushed to master.  Thanks, Owen!