Bug 21497: Correctly format dates for ILL requests in OPAC

This patch updates the opac ILL template to use the $KohaDates plugin
for displaying dates. Also updated:

- Added "title-string" sorting to allow for correct sorting of dates in
  the table of requests.
- Corrected capitalization as per our capitalization rules.
- Added self-closing / to inputs as per coding guidelines.

To test, apply the patch and log in to the OPAC as a user who has
multiple outstanding ILL requests.

 - In the table of ILL requests, the "Request placed" and "Last updated"
   dates should be formatted according to your system's dateformat
   preference.
 - Sorting of those columns should work correctly.
 - View a request and confirm that "Request placed" and "Last updated"
   dates in this view are also formatted correctly.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a2418f743c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Owen Leonard 2018-10-05 12:50:26 +00:00 committed by Martin Renvoize
parent 882e18500c
commit e68d3d9884
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 16 additions and 15 deletions

View File

@ -1,7 +1,8 @@
[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your Interlibrary loan requests</title>[% INCLUDE 'doc-head-close.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your interlibrary loan requests</title>[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %][% END %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='opac-illrequests' bodyclass='scrollto' %]
@ -23,9 +24,9 @@
[% IF method != 'list' %]
<li><a href="/cgi-bin/koha/opac-illrequests.pl">Interlibrary loan requests</a> <span class="divider">&rsaquo;</span></li>
[% IF method == 'create' %]
<li>New Interlibrary loan request</li>
<li>New interlibrary loan request</li>
[% ELSIF method == 'view' %]
<li>View Interlibrary loan request</li>
<li>View interlibrary loan request</li>
[% END %]
[% ELSE %]
<li>Interlibrary loan requests</li>
@ -53,7 +54,7 @@
[% ELSE %]
<div id="illrequests" class="maincontent">
[% IF method == 'create' %]
<h2>New Interlibrary loan request</h2>
<h2>New interlibrary loan request</h2>
[% IF stage == 'copyrightclearance' %]
[% INCLUDE messages %]
<div>
@ -78,8 +79,8 @@
</select>
</fieldset>
<fieldset class="action">
<input type="hidden" name="method" value="create">
<input type="submit" name="create_select_backend" value="Next">
<input type="hidden" name="method" value="create" />
<input type="submit" name="create_select_backend" value="Next" />
</fieldset>
</form>
[% ELSE %]
@ -115,8 +116,8 @@
<th>Requested from</th>
<th>Request type</th>
<th>Status</th>
<th>Request placed</th>
<th>Last updated</th>
<th class="title-string">Request placed</th>
<th class="title-string">Last updated</th>
<th></th>
</tr>
</thead>
@ -129,8 +130,8 @@
<td>[% request.backend %]</td>
<td>[% request.medium %]</td>
<td>[% request.capabilities.$status.name %]</td>
<td>[% request.placed %]</td>
<td>[% request.updated %]</td>
<td>[% request.placed | $KohaDates %]</td>
<td>[% request.updated | $KohaDates %]</td>
<td>
<a href="/cgi-bin/koha/opac-illrequests.pl?method=view&amp;illrequest_id=[% request.id %]" class="btn btn-default btn-small pull-right">View</a>
</td>
@ -139,7 +140,7 @@
</tbody>
</table>
[% ELSIF method == 'view' %]
<h2>View Interlibrary loan request</h2>
<h2>View interlibrary loan request</h2>
[% INCLUDE messages %]
[% status = request.status %]
<form method="post" action="?method=update" id="illrequestupdate-form" novalidate="novalidate">
@ -170,11 +171,11 @@
</li>
<li>
<label for="placed">Request placed:</label>
[% request.placed %]
[% request.placed | $KohaDates %]
</li>
<li>
<label for="updated">Last updated:</label>
[% request.updated %]
[% request.updated | $KohaDates %]
</li>
<li>
<label for="notesopac">Notes:</label>
@ -196,13 +197,13 @@
[% END %]
</div>
<fieldset class="action illrequest-actions">
<input type="hidden" name="illrequest_id" value="[% request.illrequest_id %]">
<input type="hidden" name="illrequest_id" value="[% request.illrequest_id | html %]">
<input type="hidden" name="method" value="update">
[% IF !request.completed %]
[% IF request.status == "NEW" %]
<a class="cancel-illrequest btn btn-danger" href="/cgi-bin/koha/opac-illrequests.pl?method=cancreq&amp;illrequest_id=[% request.illrequest_id %]">Request cancellation</a>
[% END %]
<input type="submit" class="update-illrequest btn btn-default" value="Submit modifications">
<input type="submit" class="update-illrequest btn btn-default" value="Submit modifications" />
[% END %]
<span class="cancel"><a href="/cgi-bin/koha/opac-illrequests.pl">Cancel</a></span>
</fieldset>