7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha › Tools › Patron clubs</title>
9 [% INCLUDE 'doc-head-close.inc' %]
13 <body id="clubs_clubs" class="clubs">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'cat-search.inc' %]
16 <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>
18 <div class="main container-fluid">
20 <div class="col-sm-10 col-sm-push-2">
25 [% IF club_template %]
26 <div class="dialog message">
27 [% IF stored == 'updated' %]
28 <p>Club template <i>[% club_template.name | html %]</i> was updated.</p>
30 <p>Club template <i>[% club_template.name | html %]</i> was saved.</p>
34 <div class="dialog message">
35 [% IF stored == 'updated' %]
36 <p>Club <i>[% club.name | html %]</i> was updated.</p>
38 <p>Club <i>[% club.name | html %]</i> was saved.</p>
43 <h3>Club templates</h3>
45 [% IF CAN_user_clubs_edit_templates %]
46 <div class="btn-toolbar">
47 <div class="btn-group">
48 <a class="btn btn-sm btn-default" href="templates-add-modify.pl"><i class="fa fa-plus"></i> New club template</a>
53 [% IF club_templates %]
54 <table id="club-templates-table">
59 <th>Public enrollment</th>
60 <th>Email required</th>
66 [% FOREACH t IN club_templates %]
68 <td>[% t.name | html %]</td>
69 <td>[% t.description | html %]</td>
71 [% IF t.is_enrollable_from_opac %]
78 [% IF t.is_email_required %]
84 <td>[% Branches.GetName( t.branchcode ) | html %]</td>
86 [% IF CAN_user_clubs_edit_templates %]
87 <a class="btn btn-xs btn-default" style="white-space:nowrap" href="/cgi-bin/koha/clubs/templates-add-modify.pl?id=[% t.id | html %]">
88 <i class="fa fa-pencil"></i> Edit
90 <a class="btn btn-xs btn-default" href="#" onclick='ConfirmDeleteTemplate([% t.id | html %], "[% t.name | html %]", $(this) ); return false;'>
91 <i class="fa fa-trash"></i> Delete
100 <div class="dialog message">No club templates defined.</div>
105 [% IF CAN_user_clubs_edit_clubs %]
106 <div class="btn-toolbar">
107 <div class="btn-group">
108 [% IF club_templates %]
109 <button class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New club <span class="caret"></span></button>
111 <button disabled="disabled" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New club <span class="caret"></span></button>
113 <ul class="dropdown-menu">
114 [% FOREACH t IN club_templates %]
115 <li><a href="/cgi-bin/koha/clubs/clubs-add-modify.pl?club_template_id=[% t.id | uri %]">[% t.name | html %]</a></li>
123 <table id="clubs-table">
129 <th>Public enrollment</th>
130 <th>Email required</th>
134 <th>Enrolled patrons</th>
139 [% FOREACH c IN clubs %]
141 <td>[% c.name | html %]</td>
142 <td>[% c.club_template.name | html %]</td>
143 <td>[% c.description | html %]</td>
145 [% IF c.club_template.is_enrollable_from_opac %]
152 [% IF c.club_template.is_email_required %]
158 <td>[% Branches.GetName( c.branchcode ) | html %]</td>
160 [% IF c.date_start %]
161 [% c.date_start | $KohaDates %]
166 [% c.date_end | $KohaDates %]
170 [% c.club_enrollments.count | html %]
173 <div class="dropdown">
174 <a class="btn btn-default btn-xs dropdown-toggle" id="clubactions[% c.id | html %]" role="button" data-toggle="dropdown" href="#">
175 Actions <b class="caret"></b>
177 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="clubactions[% c.id | html %]">
178 [% IF ( c.club_enrollments.count ) %]
180 <a href="club-enrollments.pl?id=[% c.id | uri %]">
181 <i class="fa fa-list-ul"></i> Enrollments
185 <li class="disabled">
186 <a href="club-enrollments.pl?id=[% c.id | uri %]">
187 <i class="fa fa-list-ul"></i> Enrollments
191 [% IF CAN_user_clubs_edit_clubs %]
193 <a href="clubs-add-modify.pl?id=[% c.id | uri %]">
194 <i class="fa fa-pencil"></i> Edit
198 <a href="#" onclick='ConfirmDeleteClub([% c.id | html %], "[% c.name | html %]", $(this) ); return false;'>
199 <i class="fa fa-trash"></i> Delete
209 </table> <!-- /.clubs-table -->
211 [% IF club_templates %]
212 <div class="dialog message">No clubs defined.</div>
214 <div class="dialog message">No clubs defined. A club template must be defined before a club can be defined.</div>
219 </div> <!-- /.col-sm-10.col-sm-push-2 -->
221 <div class="col-sm-2 col-sm-pull-10">
223 [% INCLUDE 'tools-menu.inc' %]
225 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
226 </div> <!-- /.row -->
228 [% MACRO jsinclude BLOCK %]
229 [% INCLUDE 'datatables.inc' %]
230 [% Asset.js("js/tools-menu.js") | $raw %]
232 $(document).ready(function() {
233 tTable = $('#club-templates-table').dataTable($.extend(true, {}, dataTablesDefaults, {
234 "sPaginationType": "four_button",
235 "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
237 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
241 cTable = $('#clubs-table').dataTable($.extend(true, {}, dataTablesDefaults, {
242 "sPaginationType": "four_button",
243 "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
245 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
250 function ConfirmDeleteTemplate( id, name, a ) {
251 if ( confirm( _("Are you sure you want to delete the club template %s? This will delete all clubs using this template and cancel patron enrollments" ).format(name) ) ) {
254 url: '/cgi-bin/koha/svc/club/template/delete',
256 success: function( data ) {
257 if ( data.success ) {
260 alert(_("Unable to delete template!"));
268 function ConfirmDeleteClub( id, name, a ) {
269 if ( confirm( _("Are you sure you want to delete the club %s? This will cancel all patron enrollments in this club." ).format(name) ) ) {
272 url: '/cgi-bin/koha/svc/club/delete',
274 success: function( data ) {
275 if ( data.success ) {
278 alert(_("Unable to delete club!"));
288 [% INCLUDE 'intranet-bottom.inc' %]