Description
Chris Cormack
2010-05-21 01:11:51 UTC
I like the idea of sifting the required fields up to the top, with a submit button that becomes active when they are filled. Rephrasing bug description and changing version. There was a blog entry related to this bug using jQuery for a Patron quick add form. As far I remember it was declared as proof of concept. The link was: http://www.myacpl.org/koha/category/koha/customizations/ (Link not valid as of today) I tested the jQuery code in early 2012 and re-tested it today with current master by putting it into intranetuserjs system preference. It is not really a solution for this enhancement request, but it still works nice. That's why I put it here. $(document).ready(function(){ var list = "<fieldset class=\"rows\"><legend>Quick Add<ol>"; $("label.required").each(function(){ item = $(this).parent().html() item = "<li>"+item+"</li>"; list += item; }); list += "</ol></fieldset><fieldset class=\"action\"><input type=\"submit\" value=\"Save\" onclick=\"return check_form_borrowers();\" name=\"save\"/><a href=\"/cgi-bin/koha/members/member.pl\" class=\"cancel\">Cancel</a></fieldset>"; $("#entryform").prepend(list); }); We have received sponsorship for the following approach: a) Add a new system preference "PatronQuickAddFields" b) In this new preference we would list the fields to be in the quick add form ( similar to the list of required fields system preference ) c) When displaying the "new patron" form in quick add mode, all fields that are not mandatory or not listed in PatronQuickAddFields will be hidden Created attachment 50090 [details] [review] Bug 3534 - Patron quick add form This patch adds two new system preferences: PatronQuickAdd PatronQuickAddFields When enabled the pref will add a new form to memberentrygen composed of the fields in PatronQuickAddFields and BorrowerMandatoryField. There will be a button allowing a user to switch from the quickadd to the full form. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Enable quick add (do not add any fields) 5 - Only required fields should be displayed 6 - Ensure that values are populated when swtiching forms 7 - Ensure you can save patron 8 - Verify that subsequent edits use only full form 9 - Add fields to PatronQuickAddFields 10 - check that fields are present in quick add form 11 - Ensure that you can save patron 12 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Created attachment 50091 [details] [review] Bug 3534 - Patron quick add form This patch adds two new system preferences: PatronQuickAdd PatronQuickAddFields When enabled the pref will add a new form to memberentrygen composed of the fields in PatronQuickAddFields and BorrowerMandatoryField. There will be a button allowing a user to switch from the quickadd to the full form. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Enable quick add (do not add any fields) 5 - Only required fields should be displayed 6 - Ensure you can save patron 7 - Verify that subsequent edits use only full form 8 - Verify that data on form submitted is the data saved to patron 9 - Add fields to PatronQuickAddFields 10 - check that fields are present in quick add form 11 - Ensure that you can save patron 12 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Sponsored by: VOKAL (Vermont Organization of Koha Automated Libraries) Created attachment 50092 [details] [review] Bug 3534 - Patron quick add form This patch adds two new system preferences: PatronQuickAdd PatronQuickAddFields When enabled the pref will add a new form to memberentrygen composed of the fields in PatronQuickAddFields and BorrowerMandatoryField. There will be a button allowing a user to switch from the quickadd to the full form. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Enable quick add (do not add any fields) 5 - Only required fields should be displayed 6 - Ensure you can save patron 7 - Verify that subsequent edits use only full form 8 - Verify that data on form submitted is the data saved to patron 9 - Add fields to PatronQuickAddFields 10 - check that fields are present in quick add form 11 - Ensure that you can save patron 12 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Sponsored by: VOKAL (Vermont Organization of Koha Automated Libraries) Created attachment 50093 [details] [review] Bug 3534 - Patron quick add form This patch adds two new system preferences: PatronQuickAdd PatronQuickAddFields When enabled the pref will add a new form to memberentrygen composed of the fields in PatronQuickAddFields and BorrowerMandatoryField. There will be a button allowing a user to switch from the quickadd to the full form. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Enable quick add (do not add any fields) 5 - Only required fields should be displayed 6 - Ensure you can save patron 7 - Verify that subsequent edits use only full form 8 - Verify that data on form submitted is the data saved to patron 9 - Add fields to PatronQuickAddFields 10 - check that fields are present in quick add form 11 - Ensure that you can save patron 12 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Sponsored by: VOKAL (Vermont Organization of Koha Automated Libraries) Great feature! But I have a problem when toggling between Quick add and Full form: To reproduce: Madatory fields: surname|firstname|cardnumber PatronQuickAdd: Use PatronQuickAddFields (none) autoMemberNum: Do default the card number field on the patron addition screen to the next available card number Go to /cgi-bin/koha/members/members-home.pl Hit "New Patron" and choose Quick add form displays as expected Enter Surname AAA, First name BBB, Change card number from automatically generated value to other value, Change patron category e.g. from Child to Adult Toggle to Full form (Button "Quick-add/Full form) Result: Fields Surname and First name are empty, card number is set back to automatically generated value, patron category is reset to Child. Toggle back to quick form Result: Values entered in quick add form re-appear. Possible solution: - Replace toggling function "Quick-add/Full form" by: "Save and edit in full form" - In /cgi-bin/koha/members/members-home.pl, provide a choice to use "Quick add" or "Full form" Created attachment 50362 [details] [review] Bug 3534 - Patron quick add form This patch adds a new system preference: PatronQuickAddFields When either this pref or BorrowerMandatoryField is populated this will add a new dropdown to the bew patron toolbar. When a category is chosen from this dropdown the fields in PatronQuickAddFields and BorrowerMandatoryField will be displayed. There will be a button allowing a user to switch from the quickadd to the full form and fields will be copied between the forms when toggling. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Populate either PatronQuickAddFields or BorrowerMandatory fields and note the new button for adding a patron 5 - Click the Quick add and choose a type 6 - Only required or quick add fields should be displayed 7 - Verify toggling forms copies information 8 - Ensure you cannot save patron without filling required fields (quick add fields should be optional) 9 - Ensure you can save patron with fields filled out 10 - Ensure that a duplicate patron brings up the duplicate/add new buttons with full form displayed 11 - Verify that subsequent edits use only full form 12 - Verify that data on form submitted is the data saved to patron 13 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Sponsored by: VOKAL (Vermont Organization of Koha Automated Libraries) (In reply to Marc Véron from comment #9) > Great feature! > But I have a problem when toggling between Quick add and Full form: Fields should now populate when toggling between forms, quick add is now a choice from patron toolbar Works great now, However QA tools complain: FAIL koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt FAIL forbidden patterns forbidden pattern: tab char (line 277) forbidden pattern: tab char (line 840) forbidden pattern: tab char (line 272) forbidden pattern: tab char (line 831) Created attachment 50410 [details] [review] Bug 3534 - Fix tabs to spaces Created attachment 50413 [details] [review] Bug 3534 - Patron quick add form This patch adds a new system preference: PatronQuickAddFields When either this pref or BorrowerMandatoryField is populated this will add a new dropdown to the bew patron toolbar. When a category is chosen from this dropdown the fields in PatronQuickAddFields and BorrowerMandatoryField will be displayed. There will be a button allowing a user to switch from the quickadd to the full form and fields will be copied between the forms when toggling. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Populate either PatronQuickAddFields or BorrowerMandatory fields and note the new button for adding a patron 5 - Click the Quick add and choose a type 6 - Only required or quick add fields should be displayed 7 - Verify toggling forms copies information 8 - Ensure you cannot save patron without filling required fields (quick add fields should be optional) 9 - Ensure you can save patron with fields filled out 10 - Ensure that a duplicate patron brings up the duplicate/add new buttons with full form displayed 11 - Verify that subsequent edits use only full form 12 - Verify that data on form submitted is the data saved to patron 13 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Sponsored by: VOKAL (Vermont Organization of Koha Automated Libraries) Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 50414 [details] [review] Bug 3534 - Fix tabs to spaces Signed-off-by: Marc Véron <veron@veron.ch> (In reply to Marc Véron from comment #3) > There was a blog entry related to this bug using jQuery for a Patron quick > add form. As far I remember it was declared as proof of concept. > The link was: http://www.myacpl.org/koha/category/koha/customizations/ > (Link not valid as of today) https://www.myacpl.org/koha/quick-patron-add/ Owen, could we get your opinion on this patch? pplying: Bug 3534 - Fix tabs to spaces fatal: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt). I personally don't think that the new "Quick add New Patron" is well placed. Maybe it would be better not to have it but always add the switch button ("Quick-add/Full form") on the add patron form (and move it to the top). Also patch's author of the second patch is "Your Full Name <your_email>" A lot of patches in the queue (FQA or NSO) are modifying this file, not sure the second patch is necessary. I suggested on IRC the separate button menu for "Quick add" because the version of the patch I tested made the quick add action default if PatronQuickAddFields were defined. I thought it was important that staff be able to choose to do a full add if they chose to. The two buttons do look awkward, though. Maybe that wasn't a good idea. I'm not sure what the solution is. I'm going to The quick add button should at least be next to the "New patron" button. And the mixed case on the button label should be corrected. As for the second patch, it makes changes to far more than the 4 line required by the QA tools. We should correct whitespace on changed lines, not all lines. Created attachment 50665 [details] [review] Bug 3534 - Patron quick add form This patch adds a new system preference: PatronQuickAddFields When either this pref or BorrowerMandatoryField is populated this will add a new dropdown to the bew patron toolbar. When a category is chosen from this dropdown the fields in PatronQuickAddFields and BorrowerMandatoryField will be displayed. There will be a button allowing a user to switch from the quickadd to the full form and fields will be copied between the forms when toggling. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Populate either PatronQuickAddFields or BorrowerMandatory fields and note the new button for adding a patron 5 - Click the Quick add and choose a type 6 - Only required or quick add fields should be displayed 7 - Verify toggling forms copies information 8 - Ensure you cannot save patron without filling required fields (quick add fields should be optional) 9 - Ensure you can save patron with fields filled out 10 - Ensure that a duplicate patron brings up the duplicate/add new buttons with full form displayed 11 - Verify that subsequent edits use only full form 12 - Verify that data on form submitted is the data saved to patron 13 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Sponsored by: VOKAL (Vermont Organization of Koha Automated Libraries) Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 50666 [details] [review] Bug 3534 - (QA followup) whitespace fixes Moved button and fixed case Restricted whitespace to affected lines (and set my git user.name and user.email) (In reply to Jonathan Druart from comment #18) > Maybe it would be better not to have it but always add the switch button > ("Quick-add/Full form") on the add patron form (and move it to the top). Nick, what do you think about this suggestion? (In reply to Jonathan Druart from comment #24) > (In reply to Jonathan Druart from comment #18) > > Maybe it would be better not to have it but always add the switch button > > ("Quick-add/Full form") on the add patron form (and move it to the top). > > Nick, what do you think about this suggestion? I like moving it to the top, but I am unsure about always defaulting to full form. I would want to check with the sponsors, let me see if I can get an answer. Created attachment 50729 [details] [review] Bug 3534 [Follow-up] Patron quick add form This follow-up move the full/quick add toggle control to the top of the patron entry form, reformating it as a link with a Font Awesome icon The previous patch defined a new $(document).ready() block. This patch moves that code into the existing $(document).ready() to keep things organized. This patch also makes some minor corrections to the markup, converting some single quotes in HTML to double, and correcting capitalization. To test, apply the patch and follow the original test plan. Confirm that the toggle between full and brief form works correctly. (In reply to Owen Leonard from comment #26) > Created attachment 50729 [details] [review] [review] > Bug 3534 [Follow-up] Patron quick add form + [% IF quickadd && opadd %] + <a href="#" class="toggle_quick_add"><i class="fa fa-plus-square"></i> Show full form</a> + <a href="#" class="toggle_quick_add" style="display:none"><i class="fa fa-minus-square"></i> Show brief form</a> + [% ELSE %] + <a href="#" class="toggle_quick_add" style="display:none"><i class="fa fa-plus-square"></i> Show full form</a> + <a href="#" class="toggle_quick_add"><i class="fa fa-minus-square"></i> Show brief form</a> + [% END %] This makes the toggle button show up on edits and form checks, but the quick-add isn't built in those scenarios. Are you thinking the user should be able to toggle even when not coming from the 'Quick add new patron' button? (In reply to Nick Clemens from comment #27) > Are you thinking the user should > be able to toggle even when not coming from the 'Quick add new patron' > button? No, just sloppiness on my part. Nick, something I noticed while re-working my patch: If you start an add using the quick add form but there is a problem (for instance, a duplicate card number) the form is redisplayed in its full form. Shouldn't it show the brief form instead? Nick, could I get you to rebase your patches? After that I'll see about fixing up mine. Created attachment 51382 [details] [review] Bug 3534 - Patron quick add form This patch adds a new system preference: PatronQuickAddFields When either this pref or BorrowerMandatoryField is populated this will add a new dropdown to the bew patron toolbar. When a category is chosen from this dropdown the fields in PatronQuickAddFields and BorrowerMandatoryField will be displayed. There will be a button allowing a user to switch from the quickadd to the full form and fields will be copied between the forms when toggling. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Populate either PatronQuickAddFields or BorrowerMandatory fields and note the new button for adding a patron 5 - Click the Quick add and choose a type 6 - Only required or quick add fields should be displayed 7 - Verify toggling forms copies information 8 - Ensure you cannot save patron without filling required fields (quick add fields should be optional) 9 - Ensure you can save patron with fields filled out 10 - Ensure that a duplicate patron brings up the duplicate/add new buttons with full form displayed 11 - Verify that subsequent edits use only full form 12 - Verify that data on form submitted is the data saved to patron 13 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Sponsored by: VOKAL (Vermont Organization of Koha Automated Libraries) Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 51389 [details] [review] Bug 3534 - Patron quick add form This patch adds a new system preference: PatronQuickAddFields When either this pref or BorrowerMandatoryField is populated this will add a new dropdown to the bew patron toolbar. When a category is chosen from this dropdown the fields in PatronQuickAddFields and BorrowerMandatoryField will be displayed. There will be a button allowing a user to switch from the quickadd to the full form and fields will be copied between the forms when toggling. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Populate either PatronQuickAddFields or BorrowerMandatory fields and note the new button for adding a patron 5 - Click the Quick add and choose a type 6 - Only required or quick add fields should be displayed 7 - Verify toggling forms copies information 8 - Ensure you cannot save patron without filling required fields (quick add fields should be optional) 9 - Ensure you can save patron with fields filled out 10 - Ensure that a duplicate patron brings up the duplicate/add new buttons with full form displayed 11 - Verify that subsequent edits use only full form 12 - Verify that data on form submitted is the data saved to patron 13 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Sponsored by: VOKAL (Vermont Organization of Koha Automated Libraries) Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> I re-tested, it seems that the "Save" button in the quick add form no longer works. Created attachment 51445 [details] [review] Bug 3534 - Patron quick add form This patch adds a new system preference: PatronQuickAddFields When either this pref or BorrowerMandatoryField is populated this will add a new dropdown to the bew patron toolbar. When a category is chosen from this dropdown the fields in PatronQuickAddFields and BorrowerMandatoryField will be displayed. There will be a button allowing a user to switch from the quickadd to the full form and fields will be copied between the forms when toggling. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Populate either PatronQuickAddFields or BorrowerMandatory fields and note the new button for adding a patron 5 - Click the Quick add and choose a type 6 - Only required or quick add fields should be displayed 7 - Verify toggling forms copies information 8 - Ensure you cannot save patron without filling required fields (quick add fields should be optional) 9 - Ensure you can save patron with fields filled out 10 - Ensure that a duplicate patron brings up the duplicate/add new buttons with full form displayed 11 - Verify that subsequent edits use only full form 12 - Verify that data on form submitted is the data saved to patron 13 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Sponsored by: VOKAL (Vermont Organization of Koha Automated Libraries) Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 51446 [details] [review] Bug 3534 - QA Followup - use floating save I am not sure if this is desired, it makes sense for consistency but floats in a wierd place for a short form. (In reply to Marc Véron from comment #33) > I re-tested, it seems that the "Save" button in the quick add form no longer > works. Yeah, the quick add save 'clicks' the full form save button, fixed the selector and should work again Created attachment 51960 [details] [review] Bug 3534 - Patron quick add form This patch adds a new system preference: PatronQuickAddFields When either this pref or BorrowerMandatoryField is populated this will add a new dropdown to the bew patron toolbar. When a category is chosen from this dropdown the fields in PatronQuickAddFields and BorrowerMandatoryField will be displayed. There will be a button allowing a user to switch from the quickadd to the full form and fields will be copied between the forms when toggling. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Populate either PatronQuickAddFields or BorrowerMandatory fields and note the new button for adding a patron 5 - Click the Quick add and choose a type 6 - Only required or quick add fields should be displayed 7 - Verify toggling forms copies information 8 - Ensure you cannot save patron without filling required fields (quick add fields should be optional) 9 - Ensure you can save patron with fields filled out 10 - Ensure that a duplicate patron brings up the duplicate/add new buttons with full form displayed 11 - Verify that subsequent edits use only full form 12 - Verify that data on form submitted is the data saved to patron 13 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Sponsored by: VOKAL (Vermont Organization of Koha Automated Libraries) Followed test plan, works as expected. Re-tested together with followup, works as expected (2016-06-02) Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 51961 [details] [review] Bug 3534 - QA Followup - use floating save I am not sure if this is desired, it makes sense for consistency but floats in a wierd place for a short form. Signed-off-by: Marc Véron <veron@veron.ch> QA comments: 1/ If you put a nonexisting field in the pref (test with surname|sex|xxx), you will see "Expiry date (leave blank for auto calc):". Any ideas why? 2/ Please fix indentations in JS code 3/ It does not seem possible to display the guarantor form, is it expected? Created attachment 52192 [details] [review] Bug 3534 (QA Followup) Fix indentation, show guarantor form, ignore bad data in pref Fixed indents, made guarantor form mandatory (and skip those fields if added) and made sure bad data isn't processed The mandatory fields show up nicely, but I have problems using the new PatronQuickAddFields for adding additional fields. The fields are not showing up. I have tried: email email|sex email|B_address Created attachment 52584 [details] [review] Bug 3534 - Patron quick add form This patch adds a new system preference: PatronQuickAddFields When either this pref or BorrowerMandatoryField is populated this will add a new dropdown to the bew patron toolbar. When a category is chosen from this dropdown the fields in PatronQuickAddFields and BorrowerMandatoryField will be displayed. There will be a button allowing a user to switch from the quickadd to the full form and fields will be copied between the forms when toggling. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Populate either PatronQuickAddFields or BorrowerMandatory fields and note the new button for adding a patron 5 - Click the Quick add and choose a type 6 - Only required or quick add fields should be displayed 7 - Verify toggling forms copies information 8 - Ensure you cannot save patron without filling required fields (quick add fields should be optional) 9 - Ensure you can save patron with fields filled out 10 - Ensure that a duplicate patron brings up the duplicate/add new buttons with full form displayed 11 - Verify that subsequent edits use only full form 12 - Verify that data on form submitted is the data saved to patron 13 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Sponsored by: VOKAL (Vermont Organization of Koha Automated Libraries) Followed test plan, works as expected. Re-tested together with followup, works as expected (2016-06-02) Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 52585 [details] [review] Bug 3534 - QA Followup - use floating save I am not sure if this is desired, it makes sense for consistency but floats in a wierd place for a short form. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 52586 [details] [review] Bug 3534 (QA Followup) Fix indentation, show guarantor form, ignore bad data in pref Switch incorrect == to != when checking skipped fields (In reply to Katrin Fischer from comment #42) > The mandatory fields show up nicely, but I have problems using the new > PatronQuickAddFields for adding additional fields. The fields are not > showing up. I got my equalities mixed up, fixed! CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt Created attachment 52934 [details] [review] Bug 3534 - Patron quick add form This patch adds a new system preference: PatronQuickAddFields When either this pref or BorrowerMandatoryField is populated this will add a new dropdown to the bew patron toolbar. When a category is chosen from this dropdown the fields in PatronQuickAddFields and BorrowerMandatoryField will be displayed. There will be a button allowing a user to switch from the quickadd to the full form and fields will be copied between the forms when toggling. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Populate either PatronQuickAddFields or BorrowerMandatory fields and note the new button for adding a patron 5 - Click the Quick add and choose a type 6 - Only required or quick add fields should be displayed 7 - Verify toggling forms copies information 8 - Ensure you cannot save patron without filling required fields (quick add fields should be optional) 9 - Ensure you can save patron with fields filled out 10 - Ensure that a duplicate patron brings up the duplicate/add new buttons with full form displayed 11 - Verify that subsequent edits use only full form 12 - Verify that data on form submitted is the data saved to patron 13 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Sponsored by: VOKAL (Vermont Organization of Koha Automated Libraries) Followed test plan, works as expected. Re-tested together with followup, works as expected (2016-06-02) Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 52935 [details] [review] Bug 3534 - QA Followup - use floating save I am not sure if this is desired, it makes sense for consistency but floats in a wierd place for a short form. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 52936 [details] [review] Bug 3534 (QA Followup) Fix indentation, show guarantor form, ignore bad data in pref Switch incorrect == to != when checking skipped fields Created attachment 52937 [details] [review] Bug 3534 (QA Followup) Rebase and change floating save (In reply to Nick Clemens from comment #51) > Created attachment 52937 [details] [review] [review] > Bug 3534 (QA Followup) Rebase and change floating save Why do you use another id for the toolbar? You won't need to add this specific JS code if you just use "toolbar" as the id. Created attachment 53109 [details] [review] Bug 3534 (QA Followup) Move QA save toolbar and use same class as full form (In reply to Jonathan Druart from comment #52) > Why do you use another id for the toolbar? You won't need to add this > specific JS code if you just use "toolbar" as the id. It was just to keep the toolbar in the quick add form, it seemed cleaner. Moving it to the top of the page works as well and doesn't require the js Nick, with your last patches, there is a problem: If you are on the quick add form, then switch to the full form, the toolbar is not floating. If I remove the last patch, there is floating toolbar on the quick add form is not displayed correctly (there is a margin top). I think you should trick the code to have only 1 toolbar for the 2 forms. You will need to add a flag to check, to know which form we want to save. Created attachment 53152 [details] [review] Bug 3534 - (QA Followup) Use single toolbar for regular/quickadd forms (In reply to Jonathan Druart from comment #55) > I think you should trick the code to have only 1 toolbar for the 2 forms. > You will need to add a flag to check, to know which form we want to save. Indeed, combined to one toolbar, removed 'onclick' action from regular save and redirected to a js function Created attachment 53171 [details] [review] Bug 3534 - Patron quick add form This patch adds a new system preference: PatronQuickAddFields When either this pref or BorrowerMandatoryField is populated this will add a new dropdown to the bew patron toolbar. When a category is chosen from this dropdown the fields in PatronQuickAddFields and BorrowerMandatoryField will be displayed. There will be a button allowing a user to switch from the quickadd to the full form and fields will be copied between the forms when toggling. The Quick add will only be displayed on add of a new patron, future edits should display the full form. Test plan: 1 - Apply patch 2 - run updatedatabase.pl 3 - Add a new patron and ensure nothing has changed 4 - Populate either PatronQuickAddFields or BorrowerMandatory fields and note the new button for adding a patron 5 - Click the Quick add and choose a type 6 - Only required or quick add fields should be displayed 7 - Verify toggling forms copies information 8 - Ensure you cannot save patron without filling required fields (quick add fields should be optional) 9 - Ensure you can save patron with fields filled out 10 - Ensure that a duplicate patron brings up the duplicate/add new buttons with full form displayed 11 - Verify that subsequent edits use only full form 12 - Verify that data on form submitted is the data saved to patron 13 - Test with various values in both MandatoryBorrowerFields and PatronQuickAddFields Sponsored by: VOKAL (Vermont Organization of Koha Automated Libraries) Followed test plan, works as expected. Re-tested together with followup, works as expected (2016-06-02) Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 53172 [details] [review] Bug 3534 - QA Followup - use floating save I am not sure if this is desired, it makes sense for consistency but floats in a wierd place for a short form. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 53173 [details] [review] Bug 3534 (QA Followup) Fix indentation, show guarantor form, ignore bad data in pref Switch incorrect == to != when checking skipped fields Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 53174 [details] [review] Bug 3534 (QA Followup) Rebase and change floating save Bug 3534 - (QA Followup) Use single toolbar for regular/quickadd forms Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 53175 [details] [review] Bug 3534: Force margin-left: 0 for second button When quick adding a new patron, both button are in the DOM and the second button has a margin-left (from .btn-toolbar > .btn + .btn). This patch force the margin-left to 0 to avoid the button to move when toggling them. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> I have squashed 2 patches for the readability. Pushed to master for Koha 16.11, thanks Nick! New feature, skipping for 16.05.x Created attachment 84851 [details] [review] Bug 3534: (QA Follow-up) Fix the return value for the new format, it should be a hashref, not a string |