Koha/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc
Nick Clemens 71d1e1727c 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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-07 18:35:01 +00:00

26 lines
1.3 KiB
HTML

[% USE Categories %]
[% USE Koha %]
[% SET categories = Categories.all %]
[% UNLESS ( no_add ) %]
<div id="toolbar" class="btn-toolbar">
<div class="btn-group">
<button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New patron <span class="caret"></span></button>
<ul class="dropdown-menu">
[% FOREACH category IN categories %]<li><a href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;categorycode=[% category.categorycode %]">[% category.description %]</a></li>[% END %]
</ul>
</div>
[% IF Koha.Preference('PatronQuickAddFields') || Koha.Preference('BorrowerMandatoryField') %]
<div class="btn-group">
<button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> Quick add new patron <span class="caret"></span></button>
<ul class="dropdown-menu">
[% FOREACH category IN categories %]<li><a href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;categorycode=[% category.categorycode %]&amp;quickadd=true">[% category.description %]</a></li>[% END %]
</ul>
</div>
[% END %]
[% IF CAN_user_tools_manage_patron_lists %]
<a class="btn btn-small" href="/cgi-bin/koha/patron_lists/lists.pl"><i class="fa fa-edit"></i>Patron lists</a>
[% END %]
</div>
[% END %]