From: Chanel W. <Cha...@ya...> - 2013-03-18 18:24:41
|
But won't this approach disallow me from using a lightbox for choosing a new pickup library or for entering a new expiration date? From: Demian Katz [mailto:dem...@vi...] Sent: Monday, March 18, 2013 9:37 AM To: Chanel Wheeler; vufind-tech (vuf...@li...) Subject: RE: [VuFind-Tech] recommended approach for adding change pickup library/expiration date It's probably pretty straightforward to simply add functionality to the existing cancel form - just becomes a matter of adding new named buttons and processing those button clicks in the holdsAction(). You can expand the controller plugin if you need to encapsulate complex functionality in a convenient place. All of this seems easier than reworking things, and as you say, you can always revisit this in the future when you have more time. As always, let me know if you need more specifics. - Demian From: Chanel Wheeler [mailto:Cha...@ya...] Sent: Monday, March 18, 2013 12:07 PM To: Demian Katz; vufind-tech (vuf...@li...<mailto:vuf...@li...>) Subject: RE: [VuFind-Tech] recommended approach for adding change pickup library/expiration date Because of the transient nature of a significant chunk of our community, I definitely want the functionality to be bulk oriented (at least in the first release ... I can always add more stuff down the road when I don't have a hard deadline looming over me). If I go down that path which approach do you recommend (adding functionality to existing cancel form or reworking cancel functionality to be like favorites)? chanel From: Demian Katz [mailto:dem...@vi...] Sent: Wednesday, March 13, 2013 5:54 AM To: Chanel Wheeler; vufind-tech (vuf...@li...<mailto:vuf...@li...>) Subject: RE: [VuFind-Tech] recommended approach for adding change pickup library/expiration date Perhaps your decision will be easier if I explain a little about how the current cancel holds functionality works, since there are a couple of non-obvious details, and understanding this will make more of Zend Framework make sense. Currently, the cancel holds feature makes very little use of Javascript (there are JS confirm dialogs, but the rest is a standard HTTP post). When the user clicks one of the cancel buttons, it posts to the holdsAction() method in the \VuFind\Controller\MyResearchController class. ZF2 has a "controller plug-in" mechanism which allows you to create support classes that get loaded on demand by your controllers - this is a useful way to simplify your controller code by grouping related functionality together in separate classes. For the purposes of holds processing, there is a holds controller plug-in found in the \VuFind\Controller\Plugin\Holds class and registered in the 'controller_plugins' section of the VuFind module's module.config.ini. Because the 'controller_plugins' setting registers the class under the name 'holds,' it can be accessed from any controller using $this->holds() - a bit of unintuitive magic (similar to the way view helpers work in the view templates), but useful once you know about it. So, getting back to MyResearchController::holdsAction(), you'll see that it makes a call to $this->holds()->cancelHolds(), and that is where cancel processing takes place and status messages are generated for the display. --- So you have a few options... 1.) You could build something similar to the current cancel holds mechanism for editing values... but this seems kind of awkward, since while I can see a possible need for bulk-changing a group of holds, this approach would be less convenient for editing things one-by-one, which also seems like a possible valid need. 2.) You could add an "edit" button next to each hold that takes you to a separate form for adjusting details - this may be easier to implement since you can just build a new action someplace without worrying about hooking into existing infrastructure, and it would also be fairly easy to make this new action lightbox-ready (so it can work nicely with or without Javascript). But the disadvantage to this is no convenient bulk control. 3.) You could put pickup library/expiration date controls directly into the list and use Javascript to submit changes automatically as the user makes edits - this might be slightly more complex to implement, but it might be the most convenient for users... though you'll also have to think about a non-JS fallback if you're worried about universal browser support (which you may or may not be). 4.) A hybrid approach of some of the above options. - Demian From: Chanel Wheeler [mailto:Cha...@ya...] Sent: Tuesday, March 12, 2013 2:14 PM To: vufind-tech (vuf...@li...<mailto:vuf...@li...>) Subject: [VuFind-Tech] recommended approach for adding change pickup library/expiration date VuFind 2.0ers, I'm plotting out how I'm going to add functionality to change the pickup library and the expiration date for items on the hold list. My early scouting leads me to one of two choices: 1. Redo the Cancel Holds functionality so that it works like Favorites (the /Cart/MyResearchBulk route) and then add in pickup library and expiration date functionality (which will also leverage the checkboxes) OR 2. Slip my pickup library/exp date functionality into wherever the cancel holds functionality is hiding. I don't like this choice so much because it's sloppy (my functionality has nothing to do with canceling holds) and I'm wanting to do a lightbox interaction (pick library/enter exp date) which doesn't dovetail with the existing cancel holds workflow. I'm wary that although #1 seems the more appropriate route, there may be roadblock down that development path that I'm not aware of. Does anyone have any insight on the best path to take (or another approach altogether)? Thanks, chanel Chanel Wheeler Library Network Programmer/Analyst Yavapai Library Network 1120 Commerce Dr. Prescott, AZ 86305 Phone: (928) 442-5741 cha...@ya...<mailto:cha...@ya...> Open a help desk ticket<mailto:he...@yl...> |