Created attachment 22011 [details] [review] Not possible to sort staged dates in metric format In 'Add order to basket' page, when importing from staged file, it was not possible to sort the dates if the metric format is used. The reason is that dt_add_type_uk_date function and call to it were missing. I set no default sorting in datatable parameters. Anyhow the sorting is made on staged date desc by perl and I suppose it's what users are expecting ? I suppressed a split of timestamp data in addorderiso2709.pl because it seems to me that it's useless (but not sure of it.) Olivier Crouzet
Created attachment 22012 [details] [review] Bug 11059 not possible to sort staged dates in metric format
Adding dateformat to template vars is not necessary in addorderiso2709.pl : $template->param(dateformat => C4::Context->preference('dateformat')); It is already done in C4/Auth.pm
Maybe that SHOULD work without this line, but it does not. I checked it.
Your patch needs a small rebase, because Bug 9108 has already added [% IF (dateformat == 'metric') %] dt_add_type_uk_date(); [% END %] into addorderiso2709.tt
(In reply to Koha Team Lyon 3 from comment #3) > Maybe that SHOULD work without this line, but it does not. I checked it. It works for me, in current master code. Tested it by added in addorderiso2709.tt : $(document).ready(function() { + alert('dateformat=[% dateformat %]'); The page displays an alert with "metric" (since I am in France).
Created attachment 22263 [details] [review] Bug 11059 Not possible to sort staged dates in metric format Ok Fridolyn, the point is that I opened that bug and tested my patch for 3.10. ( and in 3.10 we must change the condition in template for this : [% IF ( dateformat_metric ) %] to make without assignment of dateformat in addorderiso2709.pl ). I rebased and modified for master as you suggested. Olivier Crouzet
(In reply to Koha Team Lyon 3 from comment #6) > Created attachment 22263 [details] [review] [review] > Bug 11059 Not possible to sort staged dates in metric format > I rebased and modified for master as you suggested. Your patch adds : [% IF (dateformat == 'metric') %] dt_add_type_uk_date(); [% END %] This is not needed, it is done a few lines above.
I prefer the newer method where the DataTables plugin looks for an ISO-formatted date in a title attribute. This means that we don't need any logic around date format. See booksellers.tt for an example. In the DataTables initialization configuration: "aoColumns": [ null,null,null,null,null,null,{ "sType": "title-string" },{ "sType": "title-string" },null ], ...where "sType," the sorting type, is "title-string." This looks for a <span> with a title attribute containing the unformatted date: <td><span title="[% basket.creationdate %]">[% basket.creationdate | $KohaDates %]</span></td>
(In reply to Fridolyn SOMERS from comment #7) > (In reply to Koha Team Lyon 3 from comment #6) > > Created attachment 22263 [details] [review] [review] [review] > > Bug 11059 Not possible to sort staged dates in metric format > > I rebased and modified for master as you suggested. > Your patch adds : > [% IF (dateformat == 'metric') %] > dt_add_type_uk_date(); > [% END %] > This is not needed, it is done a few lines above. ?!! I deleted these lines, there are not any more in the last patch. Did you really test this one (id=2263) ?
(In reply to Koha Team Lyon 3 from comment #9) > ?!! I deleted these lines, there are not any more in the last patch. Did you > really test this one (id=2263) ? I still see those lines in actual patch. (In reply to Owen Leonard from comment #8) > I prefer the newer method where the DataTables plugin looks for an > ISO-formatted date in a title attribute Me too, it is more clear and alows to display the time.
Created attachment 22882 [details] [review] Bug 11059 Not possible to sort staged dates in metric format Here's a new patch using title-string type. Olivier Crouzet
Created attachment 22885 [details] [review] Bug 11059 - Not possible to sort staged dates in metric format Signed-off
Created attachment 22886 [details] [review] Bug 11059 - Restore time in staged dates in addorderiso2709.tt Follow-up patch to restore the display of time in acqui/addorderiso2709.tt in staged date. Simply uses an option of KohaDates TT plugin. This time may be usefull if there where several imports in the same day.
Follow-up needs signoff
Created attachment 22943 [details] [review] [SIGNED-OFF] Bug 11059 - Restore time in staged dates in addorderiso2709.tt Follow-up patch to restore the display of time in acqui/addorderiso2709.tt in staged date. Simply uses an option of KohaDates TT plugin. This time may be usefull if there where several imports in the same day. Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 23098 [details] [review] Bug 11059 - Not possible to sort staged dates in metric format Adds title-string sorting type to enable this. Signed-off-by: Fridolyn SOMERS <fridolyn.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 23099 [details] [review] Bug 11059 - Restore time in staged dates in addorderiso2709.tt Follow-up patch to restore the display of time in acqui/addorderiso2709.tt in staged date. Simply uses an option of KohaDates TT plugin. This time may be usefull if there where several imports in the same day. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master. Thanks, Oliver!
Those patches has been pushed to 3.14.x, will be in 3.14.1