Bug 19215: Fixing typo in URL for patron clubs
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / clubs / clubs.tt
blob0c96f792cbf562c6e8b1f69f1d86a77652d2a4ef
1 [% USE KohaDates %]
2 [% USE Branches %]
3 [% USE Koha %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Tools &rsaquo; Patron clubs</title>
6 [% INCLUDE 'doc-head-close.inc' %]
8 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9 [% INCLUDE 'datatables.inc' %]
11 <script type="text/javascript">
12 //<![CDATA[
13     $(document).ready(function() {
14         tTable = $('#club-templates-table').dataTable($.extend(true, {}, dataTablesDefaults, {
15             "sPaginationType": "four_button",
16             "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
17             "aoColumnDefs": [
18                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
19             ]
20         } ));
22         cTable = $('#clubs-table').dataTable($.extend(true, {}, dataTablesDefaults, {
23             "sPaginationType": "four_button",
24             "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
25             "aoColumnDefs": [
26                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
27             ]
28         } ));
29     });
31     function ConfirmDeleteTemplate( id, name, a ) {
32         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) ) ) {
33             $.ajax({
34                 type: "POST",
35                 url: '/cgi-bin/koha/svc/club/template/delete',
36                 data: { id: id },
37                 success: function( data ) {
38                     if ( data.success ) {
39                         location.reload();
40                     } else {
41                         alert(_("Unable to delete template!"));
42                     }
43                 },
44                 dataType: 'json'
45             });
46         }
47     }
49     function ConfirmDeleteClub( id, name, a ) {
50         if ( confirm( _("Are you sure you want to delete the club %s? This will cancel all patron enrollments in this club." ).format(name) ) ) {
51             $.ajax({
52                 type: "POST",
53                 url: '/cgi-bin/koha/svc/club/delete',
54                 data: { id: id },
55                 success: function( data ) {
56                     if ( data.success ) {
57                         location.reload();
58                     } else {
59                         alert(_("Unable to delete club!"));
60                     }
61                 },
62                 dataType: 'json'
63             });
64         }
65     }
66 //]]>
67 </script>
69 </head>
71 <body id="clubs_clubs" class="clubs">
72 [% INCLUDE 'header.inc' %]
73 [% INCLUDE 'cat-search.inc' %]
74 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; Patron clubs</div>
76 <div id="doc3" class="yui-t2">
77    <div id="bd">
78         <div id="yui-main">
79             <div class="yui-b">
80                 <h1>Patron clubs</h1>
82                 [% IF club_template %]
83                     <div class="dialog message">
84                         [% IF stored == 'updated' %]
85                             <p>Club template <i>[% club_template.name %]</i> was updated.</p>
86                         [% ELSE %]
87                             <p>Club template <i>[% club_template.name %]</i> was saved.</p>
88                         [% END %]
89                     </div>
90                 [% ELSIF club %]
91                     <div class="dialog message">
92                         [% IF stored == 'updated' %]
93                             <p>Club <i>[% club.name %]</i> was updated.</p>
94                         [% ELSE %]
95                             <p>Club <i>[% club.name %]</i> was saved.</p>
96                         [% END %]
97                     </div>
98                 [% END %]
100                 <h3>Club templates</h3>
102                 [% IF CAN_user_clubs_edit_templates %]
103                     <div class="btn-toolbar">
104                         <div class="btn-group">
105                             <a class="btn btn-sm btn-default" href="templates-add-modify.pl"><i class="fa fa-plus"></i> New club template</a>
106                         </div>
107                     </div>
108                 [% END %]
110                 [% IF club_templates %]
111                     <table id="club-templates-table">
112                         <thead>
113                             <tr>
114                                 <th>Name</th>
115                                 <th>Description</th>
116                                 <th>Public enrollment</th>
117                                 <th>Email required</th>
118                                 <th>Library</th>
119                                 <th>Actions</th>
120                             </tr>
121                         </thead>
122                         <tbody>
123                             [% FOREACH t IN club_templates %]
124                                 <tr>
125                                     <td>[% t.name %]</td>
126                                     <td>[% t.description %]</td>
127                                     <td>
128                                         [% IF t.is_enrollable_from_opac %]
129                                             Yes
130                                         [% ELSE %]
131                                             No
132                                         [% END %]
133                                     </td>
134                                     <td>
135                                         [% IF t.is_email_required %]
136                                             Yes
137                                         [% ELSE %]
138                                             No
139                                         [% END %]
140                                     </td>
141                                     <td>[% Branches.GetName( t.branchcode ) %]</td>
142                                     <td class="actions">
143                                         [% IF CAN_user_clubs_edit_templates %]
144                                             <a class="btn btn-xs btn-default" style="white-space:nowrap"  href="/cgi-bin/koha/clubs/templates-add-modify.pl?id=[% t.id %]">
145                                                 <i class="fa fa-pencil"></i> Edit
146                                             </a>
147                                             <a class="btn btn-xs btn-default" href="#" onclick='ConfirmDeleteTemplate([% t.id %], "[% t.name | html %]", $(this) ); return false;'>
148                                                 <i class="fa fa-trash"></i> Delete
149                                             </a>
150                                         [% END %]
151                                     </td>
152                                 </tr>
153                             [% END %]
154                         </tbody>
155                     </table>
156                 [% ELSE %]
157                     <div class="dialog message">No club templates defined.</div>
158                 [% END %]
160                 <h3>Clubs</h3>
162                 [% IF CAN_user_clubs_edit_clubs %]
163                     <div class="btn-toolbar">
164                         <div class="btn-group">
165                             [% IF club_templates %]
166                                 <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>
167                             [% ELSE %]
168                                 <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>
169                             [% END %]
170                             <ul class="dropdown-menu">
171                                 [% FOREACH t IN club_templates %]
172                                     <li><a href="/cgi-bin/koha/clubs/clubs-add-modify.pl?club_template_id=[% t.id %]">[% t.name %]</a></li>
173                                 [% END %]
174                             </ul>
175                         </div>
176                     </div>
177                 [% END %]
179                 [% IF clubs %]
180                     <table id="clubs-table">
181                         <thead>
182                             <tr>
183                                 <th>Name</th>
184                                 <th>Template</th>
185                                 <th>Description</th>
186                                 <th>Public enrollment</th>
187                                 <th>Email required</th>
188                                 <th>Library</th>
189                                 <th>Start date</th>
190                                 <th>End date</th>
191                                 <th>Enrolled patrons</th>
192                                 <th>&nbsp;</th>
193                             </tr>
194                         </thead>
195                         <tbody>
196                             [% FOREACH c IN clubs %]
197                                 <tr>
198                                     <td>[% c.name %]</td>
199                                     <td>[% c.club_template.name %]</td>
200                                     <td>[% c.description %]</td>
201                                     <td>
202                                         [% IF c.club_template.is_enrollable_from_opac %]
203                                             Yes
204                                         [% ELSE %]
205                                             No
206                                         [% END %]
207                                     </td>
208                                     <td>
209                                         [% IF c.club_template.is_email_required %]
210                                             Yes
211                                         [% ELSE %]
212                                             No
213                                         [% END %]
214                                     </td>
215                                     <td>[% Branches.GetName( c.branchcode ) %]</td>
216                                     <td>
217                                         [% IF c.date_start %]
218                                             [% c.date_start | $KohaDates %]
219                                         [% END %]
220                                     </td>
221                                     <td>
222                                         [% IF c.date_end %]
223                                             [% c.date_end | $KohaDates %]
224                                         [% END %]
225                                     </td>
226                                     <td>
227                                         [% c.club_enrollments.count %]
228                                     </td>
229                                     <td class="actions">
230                                         <div class="dropdown">
231                                             <a class="btn btn-default btn-xs dropdown-toggle" id="clubactions[% c.id %]" role="button" data-toggle="dropdown" href="#">
232                                                 Actions <b class="caret"></b>
233                                             </a>
234                                             <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="clubactions[% c.id %]">
235                                                 [% IF ( c.club_enrollments.count ) %]
236                                                     <li>
237                                                         <a href="club-enrollments.pl?id=[% c.id %]">
238                                                             <i class="fa fa-list-ul"></i> Enrollments
239                                                         </a>
240                                                     </li>
241                                                 [% ELSE %]
242                                                     <li class="disabled">
243                                                         <a href="club-enrollments.pl?id=[% c.id %]">
244                                                             <i class="fa fa-list-ul"></i> Enrollments
245                                                         </a>
246                                                     </li>
247                                                 [% END %]
248                                                 [% IF CAN_user_clubs_edit_clubs %]
249                                                     <li>
250                                                         <a href="clubs-add-modify.pl?id=[% c.id %]">
251                                                             <i class="fa fa-pencil"></i> Edit
252                                                         </a>
253                                                     </li>
254                                                     <li>
255                                                         <a href="#" onclick='ConfirmDeleteClub([% c.id %], "[% c.name | html %]", $(this) ); return false;'>
256                                                             <i class="fa fa-trash"></i> Delete
257                                                         </a>
258                                                     </li>
259                                                 [% END %]
260                                             </ul>
261                                         </div>
262                                     </td>
263                                 </tr>
264                             [% END %]
265                         </tbody>
266                     </table> <!-- /.clubs-table -->
267                 [% ELSE %]
268                     [% IF club_templates %]
269                         <div class="dialog message">No clubs defined.</div>
270                     [% ELSE %]
271                         <div class="dialog message">No clubs defined. A club template must be defined before a club can be defined.</div>
272                     [% END %]
273                 [% END %]
274             </div> <!-- /.yui-b -->
275         </div> <!-- /.yui-main -->
276         <div class="yui-b noprint">
277             [% INCLUDE 'tools-menu.inc' %]
278         </div>
279     </div> <!-- /#bd -->
281 [% INCLUDE 'intranet-bottom.inc' %]