Bugzilla – Attachment 59273 Details for
Bug 12461
Add patron clubs feature
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12461 [QA Followup] - Changes based on suggestions
Bug-12461-QA-Followup---Changes-based-on-suggestio.patch (text/plain), 25.17 KB, created by
Kyle M Hall (khall)
on 2017-01-19 17:14:42 UTC
(
hide
)
Description:
Bug 12461 [QA Followup] - Changes based on suggestions
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-01-19 17:14:42 UTC
Size:
25.17 KB
patch
obsolete
>From 0001329bd9d21fbf569f82e4a5c58c33fb6c5da4 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 19 Apr 2016 14:52:21 +0000 >Subject: [PATCH] Bug 12461 [QA Followup] - Changes based on suggestions > >--- > Koha/Patron.pm | 1 + > .../intranet-tmpl/prog/en/includes/permissions.inc | 4 + > .../intranet-tmpl/prog/en/includes/tools-menu.inc | 3 + > .../prog/en/modules/clubs/clubs-add-modify.tt | 34 +-- > .../intranet-tmpl/prog/en/modules/clubs/clubs.tt | 288 +++++++++++---------- > .../prog/en/modules/clubs/templates-add-modify.tt | 51 ++-- > .../opac-tmpl/bootstrap/en/modules/clubs/enroll.tt | 2 +- > 7 files changed, 199 insertions(+), 184 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index b657dac..3cc6311 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -35,6 +35,7 @@ use Koha::Patron::HouseboundRole; > use Koha::Patron::Images; > use Koha::Patrons; > use Koha::Virtualshelves; >+use Koha::Club::Enrollments; > > use base qw(Koha::Object); > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index bcff76b..7c6275a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -19,6 +19,7 @@ > [%- CASE 'coursereserves' -%]<span>Course reserves</span> > [%- CASE 'plugins' -%]<span>Koha plugins</span> > [%- CASE 'lists' -%]<span>Lists</span> >+ [%- CASE 'clubs' -%]<span>Patron clubs</span> > [%- END -%] > [%- END -%] > >@@ -103,5 +104,8 @@ > [%- CASE 'delete_public_lists' -%]<span>Delete public lists</span> > [%- CASE 'upload_general_files' -%]<span>Upload any file</span> > [%- CASE 'upload_manage' -%]<span>Manage uploaded files (<i>Useless without upload_general_files</i>)</span> >+ [%- CASE 'edit_clubs' -%]<span>Create and edit clubs</span> >+ [%- CASE 'edit_templates' -%]<span>Create and edit club templates</span> >+ [%- CASE 'enroll' -%]<span>Enroll patrons in clubs</span> > [%- END -%] > [%- END -%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >index a4bf84a..0b9c9f8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >@@ -23,6 +23,9 @@ > [% IF ( CAN_user_tools_manage_patron_lists ) %] > <li><a href="/cgi-bin/koha/patron_lists/lists.pl">Patron lists</a></li> > [% END %] >+ [% IF (CAN_user_clubs) %] >+ <li><a href="/cgi-bin/koha/clubs/clubs.pl">Patron clubs</a></li> >+ [% END %] > [% IF ( CAN_user_tools_moderate_comments ) %] > <li><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments</a></li> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt >index c5e7276..4bc5134 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt >@@ -6,22 +6,6 @@ > <title>Koha › Tools › Patron clubs › Club</title> > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] >- >-<script type="text/javascript"> >-//<![CDATA[ >- >-function CheckForm() { >- if ( !$("#club-name").val() ) { >- alert( _("Name is a required field!") ); >- return false; >- } >- >- return true; >-} >- >-//]]> >-</script> >- > </head> > > <body id="clubs_add_modify" class="clubs"> >@@ -33,12 +17,16 @@ function CheckForm() { > <div class="yui-main"> > [% IF stored %] > <div class="alert"> >- <p>Your club was [% IF stored == 'updated' %] updated [% ELSE %] saved [% END %]</p> >+ [% IF stored == 'updated' %] >+ <p>Your club was updated</p> >+ [% ELSE %] >+ <p>Your club was created</p> >+ [% END %] > <a href="clubs.pl">Return to patron clubs</a> > </div> > [% END %] > >- <form method="post" onsubmit="return CheckForm()"> >+ <form method="post" class="validated"> > <input type="hidden" name="id" value="[% club.id %]" /> > <input type="hidden" name="club_template_id" value="[% club_template.id %]" /> > >@@ -55,7 +43,8 @@ function CheckForm() { > <ol> > <li> > <label class="required" for="name">Name:</label> >- <input id="club-name" name="name" type="text" value="[% club.name %]" /> >+ <input id="club-name" name="name" type="text" value="[% club.name %]" required="required"/> >+ <span class="required">Required</span> > </li> > > <li> >@@ -132,9 +121,10 @@ function CheckForm() { > > </fieldset> > >- <input type="submit" class="btn" value="Save" /> >- >- <a href="clubs.pl" class="cancel">Cancel</a> >+ <fieldset class="action"> >+ <input type="submit" class="btn" value="Save" /> >+ <a href="clubs.pl" class="cancel">Cancel</a> >+ </fieldset> > </form> > </div> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >index 8c5472f..34fb75b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >@@ -11,20 +11,24 @@ > //<![CDATA[ > $(document).ready(function() { > tTable = $('#club-templates-table').dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sPaginationType": "four_button", >+ "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', > "aoColumnDefs": [ >- { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, >+ { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, > ] > } )); > > cTable = $('#clubs-table').dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sPaginationType": "four_button", >+ "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', > "aoColumnDefs": [ >- { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, >+ { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, > ] > } )); > }); > > function ConfirmDeleteTemplate( id, name, a ) { >- if ( confirm( _("Are you sure you want to delete the club template") + name + "?" ) ) { >+ if ( confirm( _("Are you sure you want to delete the club template %s?" ).format(name) ) ) { > $.ajax({ > type: "POST", > url: '/cgi-bin/koha/svc/club/template/delete', >@@ -42,7 +46,7 @@ > } > > function ConfirmDeleteClub( id, name, a ) { >- if ( confirm( _("Are you sure you want to delete the club ") + name + "?" ) ) { >+ if ( confirm( _("Are you sure you want to delete the club %s?" ).format(name) ) ) { > $.ajax({ > type: "POST", > url: '/cgi-bin/koha/svc/club/delete', >@@ -68,139 +72,163 @@ > [% INCLUDE 'cat-search.inc' %] > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › Patron clubs</div> > >-<div class="yui-t7"> >- <div class="yui-main"> >- <h1>Patron clubs</h1> >+<div id="doc3" class="yui-t2"> >+ <div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+ <h1>Patron clubs</h1> > >+ <h3>Club templates</h3> > >- <h3>Club templates</h3> >+ [% IF CAN_user_clubs_edit_templates %] >+ <div class="btn-toolbar"> >+ <div class="btn-group"> >+ <a class="btn" href="templates-add-modify.pl"><i class="fa fa-plus"></i> New club template</a> >+ </div> >+ </div> >+ [% END %] > >- [% IF CAN_user_clubs_edit_templates %] >- <div class="btn-group"> >- <a class="btn" href="templates-add-modify.pl"><i class="fa fa-plus"></i> New club template</a> >- </div> >- [% END %] >- >- <table id="club-templates-table"> >- <thead> >- <tr> >- <th>Name</th> >- <th>Description</th> >- <th>Public enrollment</th> >- <th>Email required</th> >- <th>Library</th> >- <th> </th> >- <th> </th> >- </tr> >- </thead> >- >- <tbody> >- [% FOREACH t IN club_templates %] >- <tr> >- <td>[% t.name %]</td> >- <td>[% t.description %]</td> >- <td> >- [% IF t.is_enrollable_from_opac %] >- Yes >- [% ELSE %] >- No >- [% END %] >- </td> >- <td> >- [% IF t.is_email_required %] >- Yes >- [% ELSE %] >- No >- [% END %] >- </td> >- <td>[% Branches.GetName( t.branchcode ) %]</td> >- <td> >- [% IF CAN_user_clubs_edit_templates %] >- <a class="btn" style="white-space:nowrap" href="templates-add-modify.pl?id=[% t.id %]"> >- <i class="fa fa-edit"></i> Edit >- </a> >+ <table id="club-templates-table"> >+ <thead> >+ <tr> >+ <th>Name</th> >+ <th>Description</th> >+ <th>Public enrollment</th> >+ <th>Email required</th> >+ <th>Library</th> >+ <th> </th> >+ <th> </th> >+ </tr> >+ </thead> >+ >+ <tbody> >+ [% IF club_templates %] >+ [% FOREACH t IN club_templates %] >+ <tr> >+ <td>[% t.name %]</td> >+ <td>[% t.description %]</td> >+ <td> >+ [% IF t.is_enrollable_from_opac %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </td> >+ <td> >+ [% IF t.is_email_required %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </td> >+ <td>[% Branches.GetName( t.branchcode ) %]</td> >+ <td> >+ [% IF CAN_user_clubs_edit_templates %] >+ <a class="btn" style="white-space:nowrap" href="templates-add-modify.pl?id=[% t.id %]"> >+ <i class="fa fa-edit"></i> Edit >+ </a> >+ [% END %] >+ </td> >+ <td> >+ [% IF CAN_user_clubs_edit_templates %] >+ <a class="btn" href="#" onclick='ConfirmDeleteTemplate([% t.id %], "[% t.name | html %]", $(this) ); return false;'> >+ <i class="fa fa-trash"></i> Delete >+ </a> >+ [% END %] >+ </td> >+ </tr> > [% END %] >- </td> >- <td> >- [% IF CAN_user_clubs_edit_templates %] >- <a class="btn" href="#" onclick='ConfirmDeleteTemplate([% t.id %], "[% t.name | html %]", $(this) ); return false;'> >- <i class="fa fa-trash"></i> Delete >- </a> >- [% END %] >- </td> >- </tr> >+ [% ELSE %] >+ <tr> >+ <td colspan="7"> >+ No club templates defined. >+ </td> >+ </td> >+ [% END %] >+ </tbody> >+ </table> >+ >+ <h3>Clubs</h3> >+ >+ [% IF CAN_user_clubs_edit_clubs %] >+ <div class="btn-toolbar"> >+ <div class="btn-group"> >+ <button class="btn dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New club <span class="caret"></span></button> >+ <ul class="dropdown-menu"> >+ [% FOREACH t IN club_templates %] >+ <li><a href="/cgi-bin/koha/clubs/clubs-add-modify.pl?club_template_id=[% t.id %]">[% t.name %]</a></li> >+ [% END %] >+ </ul> >+ </div> >+ </div> > [% END %] >- </tbody> >- </table> >- >- <h3>Clubs</h3> >- >- [% IF CAN_user_clubs_edit_clubs %] >- <div class="btn-group"> >- <div class="btn-group"> >- <button class="btn dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New club <span class="caret"></span></button> >- <ul class="dropdown-menu"> >- [% FOREACH t IN club_templates %] >- <li><a href="/cgi-bin/koha/clubs/clubs-add-modify.pl?club_template_id=[% t.id %]">[% t.name %]</a></li> >+ >+ <table id="clubs-table"> >+ <thead> >+ <tr> >+ <th>Name</th> >+ <th>Template</th> >+ <th>Description</th> >+ <th>Public enrollment</th> >+ <th>Email required</th> >+ <th>Library</th> >+ <th> </th> >+ <th> </th> >+ </tr> >+ </thead> >+ >+ <tbody> >+ [% IF clubs %] >+ [% FOREACH c IN clubs %] >+ <tr> >+ <td>[% c.name %]</td> >+ <td>[% c.club_template.name %]</td> >+ <td>[% c.description %]</td> >+ <td> >+ [% IF c.club_template.is_enrollable_from_opac %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </td> >+ <td> >+ [% IF c.club_template.is_email_required %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </td> >+ <td>[% Branches.GetName( c.branchcode ) %]</td> >+ <td> >+ [% IF CAN_user_clubs_edit_clubs %] >+ <a class="btn" style="white-space:nowrap" href="clubs-add-modify.pl?id=[% c.id %]"> >+ <i class="fa fa-edit"></i> Edit >+ </a> >+ [% END %] >+ </td> >+ <td> >+ [% IF CAN_user_clubs_edit_clubs %] >+ <a class="btn" href="#" onclick='ConfirmDeleteClub([% c.id %], "[% c.name | html %]", $(this) ); return false;'> >+ <i class="fa fa-trash"></i> Delete >+ </a> >+ [% END %] >+ </td> >+ </tr> >+ [% END %] >+ [% ELSE %] >+ <tr> >+ <td colspan="8"> >+ No club templates defined. >+ </td> >+ </td> > [% END %] >- </ul> >- </div> >+ </tbody> >+ </table> > </div> >- [% END %] >- >- <table id="clubs-table"> >- <thead> >- <tr> >- <th>Name</th> >- <th>Template</th> >- <th>Description</th> >- <th>Public enrollment</th> >- <th>Email required</th> >- <th>Library</th> >- <th> </th> >- <th> </th> >- </tr> >- </thead> >- >- <tbody> >- [% FOREACH c IN clubs %] >- <tr> >- <td>[% c.name %]</td> >- <td>[% c.club_template.name %]</td> >- <td>[% c.description %]</td> >- <td> >- [% IF c.club_template.is_enrollable_from_opac %] >- Yes >- [% ELSE %] >- No >- [% END %] >- </td> >- <td> >- [% IF c.club_template.is_email_required %] >- Yes >- [% ELSE %] >- No >- [% END %] >- </td> >- <td>[% Branches.GetName( c.branchcode ) %]</td> >- <td> >- [% IF CAN_user_clubs_edit_clubs %] >- <a class="btn" style="white-space:nowrap" href="clubs-add-modify.pl?id=[% c.id %]"> >- <i class="fa fa-edit"></i> Edit >- </a> >- [% END %] >- </td> >- <td> >- [% IF CAN_user_clubs_edit_clubs %] >- <a class="btn" href="#" onclick='ConfirmDeleteClub([% c.id %], "[% c.name | html %]", $(this) ); return false;'> >- <i class="fa fa-trash"></i> Delete >- </a> >- [% END %] >- </td> >- </tr> >- [% END %] >- </tbody> >- </table> >+ </div> >+ <div class="yui-b noprint"> >+ [% INCLUDE 'tools-menu.inc' %] >+ </div> > </div> > </div> > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt >index 2c7fa73..967c76e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt >@@ -4,22 +4,6 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Patron clubs › Club template</title> > [% INCLUDE 'doc-head-close.inc' %] >- >-<script type="text/javascript"> >-//<![CDATA[ >- >-function CheckForm() { >- if ( !$("#club-template-name").val() ) { >- alert( _("Name is a required field!") ); >- return false; >- } >- >- return true; >-} >- >-//]]> >-</script> >- > </head> > > <body id="clubs_templates_add_modify" class="clubs"> >@@ -36,7 +20,7 @@ function CheckForm() { > </div> > [% END %] > >- <form method="post" onsubmit="return CheckForm()"> >+ <form method="post" class="validated"> > <input type="hidden" name="id" value="[% club_template.id %]" /> > > <fieldset class="rows"> >@@ -52,7 +36,8 @@ function CheckForm() { > <ol> > <li> > <label class="required" for="name">Name:</label> >- <input id="club-template-name" name="name" type="text" value="[% club_template.name %]" /> >+ <input id="club-template-name" name="name" type="text" value="[% club_template.name %]" required="required"/> >+ <span class="required">Required</span> > </li> > > <li> >@@ -98,7 +83,7 @@ function CheckForm() { > </ol> > > <h2>Club fields:</h2> >- <span class="hint">These fields will be used in the creation of clubs based on this template</span> >+ <p><span class="hint">These fields will be used in the creation of clubs based on this template</span></p> > <span id="club-template-fields"> > [% FOREACH f IN club_template.club_template_fields %] > <ul> >@@ -136,12 +121,14 @@ function CheckForm() { > </ul> > [% END %] > </span> >- <a href="#" class="btn" onclick="$('#new-field-template').clone().attr('id','').show().appendTo('#club-template-fields'); return false;"> >- Add new field >- </a> >+ <div class="btn-toolbar"> >+ <a href="#" class="btn" onclick="$('#new-field-template').clone().attr('id','').show().appendTo('#club-template-fields'); return false;"> >+ <i class="fa fa-plus"></i> Add new field >+ </a> >+ </div> > > <h2>Enrollment fields:</h2> >- <span class="hint">These fields will be used when enrolling a patron in a club based on this template</span> >+ <p><span class="hint">These fields will be used when enrolling a patron in a club based on this template</span></p> > <span id="club-template-enrollment-fields"> > [% FOREACH f IN club_template.club_template_enrollment_fields %] > <ul> >@@ -179,17 +166,19 @@ function CheckForm() { > </ul> > [% END %] > </span> >- <a href="#" class="btn" onclick="$('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields'); return false;"> >- Add new field >- </a> >+ <div class="btn-toolbar"> >+ <a href="#" class="btn" onclick="$('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields'); return false;"> >+ <i class="fa fa-plus"></i> Add new field >+ </a> >+ </div> > > </fieldset> > >- <input type="hidden" name="id" value="[% club_template.id %]" /> >- >- <input type="submit" class="btn" value="Save" /> >- >- <a href="clubs.pl" class="cancel">Cancel</a> >+ <fieldset class="action"> >+ <input type="hidden" name="id" value="[% club_template.id %]" /> >+ <input type="submit" class="btn" value="Save" /> >+ <a href="clubs.pl" class="cancel">Cancel</a> >+ </fieldset> > </form> > </div> > </div> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt >index 7f9cf13..559abd8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt >@@ -28,7 +28,7 @@ > [% END %] > > <li> >- <a href="#" class="btn" onclick="addEnrollment(); return false;"><i class="icon-plus"></i> Enroll</a> >+ <a href="#" class="btn" onclick="addEnrollment(); return false;"><i class="fa fa-plus"></i> Enroll</a> > <a href="#" onclick="showClubs(); return false;">Cancel</a> > </li> > </ol> >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12461
:
29105
|
30456
|
31567
|
35104
|
36098
|
36099
|
36192
|
38748
|
39181
|
43428
|
47821
|
47824
|
47825
|
47856
|
49110
|
49121
|
50422
|
50423
|
50426
|
50427
|
58818
|
58819
|
58820
|
59272
|
59273
|
60519
|
60520
|
60521
|
60610
|
60611
|
60612
|
60613
|
60614
|
60615
|
60616
|
60617
|
60618
|
60624
|
62778
|
62779
|
62813
|
62814
|
62815