Koha/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt
Owen Leonard 93866a2320
Bug 34913: DataTables upgrade: Update CSS and option names
This patch makes two categories of changes:

1. CSS changes to accommodate changes in DataTables default CSS and
   markup structure. I've tried to make sure all of our Koha-specific
   styles are still applying.

   This change necessitates a rebuild of staff interface CSS.

2. DataTables option names: In this version of DataTables you can't
   override a default which uses CamelCase (e.g. "pagingType") with one
   in "Hungarian" notation, e.g. "sPaginationType." Since we define many
   default options in prog/js/datatables.js in camel case, any template
   which previously used a Hungarian notation option to override the
   default has now been updated to use the CamelCase version.

   See https://datatables.net/upgrade/1.10-convert#Options for a summary
   of the different option name changes.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-01-26 15:13:40 +01:00

120 lines
5.3 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE KohaDates %]
[% USE Branches %]
[% USE Koha %]
[% USE HtmlTags %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %]
[% tx("Club enrollments for {club_name}", { club_name = club.name }) | html %] &rsaquo;
[% t("Patron clubs") | html %] &rsaquo;
[% t("Tools") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="club_enrollments" class="clubs">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
[% END %]
[% WRAPPER breadcrumb_item %]
<a href="clubs.pl">Patron clubs</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Club enrollments for [% club.name | html | $HtmlTags tag="em" %]</span>
[% END %]
[% END #/ WRAPPER breadcrumbs %]
[% END #/ WRAPPER sub-header.inc %]
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
[% IF !club %]
<div class="dialog message">The club you requested does not exist.</div>
[% ELSE %]
<h1>Club enrollments for [% club.name | html | $HtmlTags tag="em" %]</h1>
<div class="page-section">
<table id="enrollments-table">
<thead>
<tr>
<th>Name</th>
<th>Card number</th>
[% FOREACH club_template_enrollment_field IN club.club_template.club_template_enrollment_fields %]
<th>[% club_template_enrollment_field.name | html %] </th>
[% END %]
</tr>
</thead>
<tbody>
[% FOREACH e IN club.club_enrollments %]
[% SET p = e.patron %]
<tr>
<td>
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% p.id | uri %]">[% p.surname | html %], [% p.firstname | html %]</a>
</td>
<td>
[% p.cardnumber | html %]
</td>
[% IF club_enrollment_fields %]
[% FOREACH club_enrollment_field IN club_enrollment_fields %]
[% IF e.id == club_enrollment_field.club_enrollment_id %]
[% FOREACH club_template_enrollment_field IN club.club_template.club_template_enrollment_fields %]
[% IF club_enrollment_field.club_template_enrollment_field_id == club_template_enrollment_field.id %]
[% IF club_template_enrollment_field.authorised_value_category %]
[% FOREACH a IN AuthorisedValues.Get( club_template_enrollment_field.authorised_value_category ) %]
[% IF a.authorised_value == club_enrollment_field.value %]
[% SET club_enrollment_field.value = a.lib %]
[% END %]
[% END %]
[% END %]
<td>[% club_enrollment_field.value | html %]</td>
[% END %]
[% END %]
[% END %]
[% END %]
[% END %]
</tr>
[% END %]
</tbody>
</table>
</div> <!-- /.page-section -->
[% END %]
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'tools-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("js/tools-menu.js") | $raw %]
<script>
$(document).ready(function() {
eTable = $('#enrollments-table').dataTable($.extend(true, {}, dataTablesDefaults, {
"pagingType": "full",
"dom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>',
"columnDefs": [
{ "targets": [ -1, -2 ], "orderable": false, "searchable": false },
]
} ));
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]