6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha › Tools › Patron clubs</title>
8 [% INCLUDE 'doc-head-close.inc' %]
10 [% Asset.css("css/datatables.css") %]
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 id="doc3" class="yui-t2">
24 [% IF club_template %]
25 <div class="dialog message">
26 [% IF stored == 'updated' %]
27 <p>Club template <i>[% club_template.name %]</i> was updated.</p>
29 <p>Club template <i>[% club_template.name %]</i> was saved.</p>
33 <div class="dialog message">
34 [% IF stored == 'updated' %]
35 <p>Club <i>[% club.name %]</i> was updated.</p>
37 <p>Club <i>[% club.name %]</i> was saved.</p>
42 <h3>Club templates</h3>
44 [% IF CAN_user_clubs_edit_templates %]
45 <div class="btn-toolbar">
46 <div class="btn-group">
47 <a class="btn btn-sm btn-default" href="templates-add-modify.pl"><i class="fa fa-plus"></i> New club template</a>
52 [% IF club_templates %]
53 <table id="club-templates-table">
58 <th>Public enrollment</th>
59 <th>Email required</th>
65 [% FOREACH t IN club_templates %]
68 <td>[% t.description %]</td>
70 [% IF t.is_enrollable_from_opac %]
77 [% IF t.is_email_required %]
83 <td>[% Branches.GetName( t.branchcode ) %]</td>
85 [% IF CAN_user_clubs_edit_templates %]
86 <a class="btn btn-xs btn-default" style="white-space:nowrap" href="/cgi-bin/koha/clubs/templates-add-modify.pl?id=[% t.id %]">
87 <i class="fa fa-pencil"></i> Edit
89 <a class="btn btn-xs btn-default" href="#" onclick='ConfirmDeleteTemplate([% t.id %], "[% t.name | html %]", $(this) ); return false;'>
90 <i class="fa fa-trash"></i> Delete
99 <div class="dialog message">No club templates defined.</div>
104 [% IF CAN_user_clubs_edit_clubs %]
105 <div class="btn-toolbar">
106 <div class="btn-group">
107 [% IF club_templates %]
108 <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>
110 <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>
112 <ul class="dropdown-menu">
113 [% FOREACH t IN club_templates %]
114 <li><a href="/cgi-bin/koha/clubs/clubs-add-modify.pl?club_template_id=[% t.id %]">[% t.name %]</a></li>
122 <table id="clubs-table">
128 <th>Public enrollment</th>
129 <th>Email required</th>
133 <th>Enrolled patrons</th>
138 [% FOREACH c IN clubs %]
140 <td>[% c.name %]</td>
141 <td>[% c.club_template.name %]</td>
142 <td>[% c.description %]</td>
144 [% IF c.club_template.is_enrollable_from_opac %]
151 [% IF c.club_template.is_email_required %]
157 <td>[% Branches.GetName( c.branchcode ) %]</td>
159 [% IF c.date_start %]
160 [% c.date_start | $KohaDates %]
165 [% c.date_end | $KohaDates %]
169 [% c.club_enrollments.count %]
172 <div class="dropdown">
173 <a class="btn btn-default btn-xs dropdown-toggle" id="clubactions[% c.id %]" role="button" data-toggle="dropdown" href="#">
174 Actions <b class="caret"></b>
176 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="clubactions[% c.id %]">
177 [% IF ( c.club_enrollments.count ) %]
179 <a href="club-enrollments.pl?id=[% c.id %]">
180 <i class="fa fa-list-ul"></i> Enrollments
184 <li class="disabled">
185 <a href="club-enrollments.pl?id=[% c.id %]">
186 <i class="fa fa-list-ul"></i> Enrollments
190 [% IF CAN_user_clubs_edit_clubs %]
192 <a href="clubs-add-modify.pl?id=[% c.id %]">
193 <i class="fa fa-pencil"></i> Edit
197 <a href="#" onclick='ConfirmDeleteClub([% c.id %], "[% c.name | html %]", $(this) ); return false;'>
198 <i class="fa fa-trash"></i> Delete
208 </table> <!-- /.clubs-table -->
210 [% IF club_templates %]
211 <div class="dialog message">No clubs defined.</div>
213 <div class="dialog message">No clubs defined. A club template must be defined before a club can be defined.</div>
216 </div> <!-- /.yui-b -->
217 </div> <!-- /.yui-main -->
218 <div class="yui-b noprint">
219 [% INCLUDE 'tools-menu.inc' %]
223 [% MACRO jsinclude BLOCK %]
224 [% INCLUDE 'datatables.inc' %]
225 [% Asset.js("js/tools-menu.js") %]
226 <script type="text/javascript">
227 $(document).ready(function() {
228 tTable = $('#club-templates-table').dataTable($.extend(true, {}, dataTablesDefaults, {
229 "sPaginationType": "four_button",
230 "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
232 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
236 cTable = $('#clubs-table').dataTable($.extend(true, {}, dataTablesDefaults, {
237 "sPaginationType": "four_button",
238 "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
240 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
245 function ConfirmDeleteTemplate( id, name, a ) {
246 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) ) ) {
249 url: '/cgi-bin/koha/svc/club/template/delete',
251 success: function( data ) {
252 if ( data.success ) {
255 alert(_("Unable to delete template!"));
263 function ConfirmDeleteClub( id, name, a ) {
264 if ( confirm( _("Are you sure you want to delete the club %s? This will cancel all patron enrollments in this club." ).format(name) ) ) {
267 url: '/cgi-bin/koha/svc/club/delete',
269 success: function( data ) {
270 if ( data.success ) {
273 alert(_("Unable to delete club!"));
283 [% INCLUDE 'intranet-bottom.inc' %]