Koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt
Owen Leonard 78d504eb06 Bug 28007: Replace obsolete title-string sorting: Tools templates
This patch modifies several tools templates to replace the use of
the "title-string" DataTables sorting method with the newer "data-order"
attribute.

To test, apply the patch and view the following pages to confirm that
columns containing dates sort correctly when using any setting of the
"dateformat" system preference:

- Tools -> Access files
  - You must modify koha-conf.xml to uncomment and populate the
    access_dirs section with a path to a directory containing some
    files.
- Tools -> Calendar
  - Test the date sorting in the "Exceptions," "Yearly - Repeating
    holidays," and "Unique holidays" tables.
- Tools -> Inventory (I wasn't able to test this because of Bug 28015).
- Tools -> News
- Tools -> Notices
- Tools -> Batch patron modification
- Tools -> OPAC problem reports
  - You must enable the "OPACReportProblem" system preference and submit
    some problem reports from the OPAC.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-06 15:56:31 +02:00

90 lines
2.7 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE KohaDates %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Access files</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="tools_access_files" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
<ol>
<li>
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
</li>
<li>
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
</li>
<li>
<a href="#" aria-current="page">
Access files
</a>
</li>
</ol>
</nav>
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
<h1>Access files</h1>
[% IF ( error_no_dir ) %]
<div class="dialog alert"><strong>Error: </strong>Files could not be found because the "access_dir" option was not set in "koha-conf.xml". Contact your system administrator to add this option.</div>
[% ELSE %]
[% IF ( files_loop ) %]
<table id="files">
<thead>
<tr>
<th>Name</th>
<th>Size (bytes)</th>
<th>Date last modified</th>
</tr>
</thead>
<tbody>
[% FOREACH file IN files_loop %]
<tr>
<td><a href="/cgi-bin/koha/tools/access_files.pl?id=[% file.id |url %]">[% file.name | html %]</a></td>
<td align="right">[% file.size | html %]</td>
<td data-order="[% file.date | html %]">[% file.date | $KohaDates %]</td>
</tr>
[% END %]
</tbody>
</table>
[% ELSE %]
<div class="dialog message">No files found.</div>
[% END %]
[% 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 %]
[% Asset.js("js/tools-menu.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
<script>
$(document).ready(function() {
$("#files").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ -1 ], "asSorting" : [ "desc", "asc" ], "bSearchable": false },
{ "sType": "title-string", "aTargets" : [ "title-string" ] }
],
"bPaginate": false
}));
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]