Bug 12089 - Remove use of dt_add_type_uk_date()
Summary: Remove use of dt_add_type_uk_date()
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 11719 12088
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-15 18:03 UTC by Owen Leonard
Modified: 2014-12-07 20:07 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 12089 - Remove use of dt_add_type_uk_date() - Circulation (8.60 KB, patch)
2014-04-15 18:36 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 12089 - Remove use of dt_add_type_uk_date() - Members (3.86 KB, patch)
2014-04-15 19:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 12089 - Remove use of dt_add_type_uk_date() - Budgets (6.09 KB, patch)
2014-04-16 18:35 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 12089 [Revised] Remove use of dt_add_type_uk_date() - Circulation (8.88 KB, patch)
2014-04-16 18:38 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 12089 - Remove use of dt_add_type_uk_date() - Acquisitions (23.74 KB, patch)
2014-04-17 16:00 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 12089 - Remove use of dt_add_type_uk_date() - JavaScript (2.20 KB, patch)
2014-04-17 16:08 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 12089 - [SIGNED OFF] Remove use of dt_add_type_uk_date() - Members (3.89 KB, patch)
2014-04-24 02:09 UTC, David Cook
Details | Diff | Splinter Review
Bug 12089 - [SIGNED OFF] Remove use of dt_add_type_uk_date() - Members (3.89 KB, patch)
2014-04-24 02:09 UTC, David Cook
Details | Diff | Splinter Review
Bug 12089 - [SIGNED OFF] Remove use of dt_add_type_uk_date() - Budgets (6.12 KB, patch)
2014-04-24 02:10 UTC, David Cook
Details | Diff | Splinter Review
Bug 12089 [SIGNED OFF] [Revised] Remove use of dt_add_type_uk_date() - Circulation (8.90 KB, patch)
2014-04-24 02:10 UTC, David Cook
Details | Diff | Splinter Review
Bug 12089 - [SIGNED OFF] Remove use of dt_add_type_uk_date() - Acquisitions (23.83 KB, patch)
2014-04-24 02:10 UTC, David Cook
Details | Diff | Splinter Review
Bug 12089 - [SIGNED OFF] Remove use of dt_add_type_uk_date() - JavaScript (2.26 KB, patch)
2014-04-24 02:10 UTC, David Cook
Details | Diff | Splinter Review
[PASSED QA] Bug 12089 - [SIGNED OFF] Remove use of dt_add_type_uk_date() - Members (3.95 KB, patch)
2014-04-27 08:48 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 12089 - [SIGNED OFF] Remove use of dt_add_type_uk_date() - Budgets (6.18 KB, patch)
2014-04-27 08:48 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 12089 [SIGNED OFF] [Revised] Remove use of dt_add_type_uk_date() - Circulation (8.97 KB, patch)
2014-04-27 08:48 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 12089 - [SIGNED OFF] Remove use of dt_add_type_uk_date() - Acquisitions (23.89 KB, patch)
2014-04-27 08:48 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 12089 - [SIGNED OFF] Remove use of dt_add_type_uk_date() - JavaScript (2.45 KB, patch)
2014-04-27 08:48 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2014-04-15 18:03:31 UTC
Many templates call dt_add_type_uk_date() to handle sorting of date columns in tables when the dateformat system preference is set to "metric." Some of these templates already use the "title-string" method (http://wiki.koha-community.org/wiki/DataTables_HowTo#Sorting_dates_regardless_of_date_format_preference) for sorting, and the call can be removed.

Other templates should be updated to use the "title-string" method.

As I make corrections I also intend to update sorting configurations to use the newer guideline described here:

http://wiki.koha-community.org/wiki/DataTables_HowTo#Obsolete_configuration_methods
Comment 1 Owen Leonard 2014-04-15 18:36:40 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2014-04-15 19:13:39 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2014-04-16 18:35:13 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2014-04-16 18:38:07 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2014-04-17 16:00:46 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2014-04-17 16:08:02 UTC Comment hidden (obsolete)
Comment 7 David Cook 2014-04-24 01:24:04 UTC
I'm still seeing instances of "dt_add_type_uk_date" in 

circ/pendingreserves.tt
serials/claims.tt
serials/serials-search.tt
serials/serials-collection.tt

I think pendingreserves.tt has been taken care of by a different patch... bug 12088, I think. Should the rest be included here? 

When applying the Acquisitions patch, it did some auto-merging, so a rebase might be a good idea in any case.
Comment 8 David Cook 2014-04-24 01:25:29 UTC
(In reply to David Cook from comment #7)
> I'm still seeing instances of "dt_add_type_uk_date" in 
> 
> circ/pendingreserves.tt
> serials/claims.tt
> serials/serials-search.tt
> serials/serials-collection.tt
> 
> I think pendingreserves.tt has been taken care of by a different patch...
> bug 12088, I think. Should the rest be included here? 
> 
> When applying the Acquisitions patch, it did some auto-merging, so a rebase
> might be a good idea in any case.

Ah, bug 11719 has those other ones covered. I'll keep going with this one then...
Comment 9 David Cook 2014-04-24 01:41:50 UTC
Since this bug removes the dt_add_type_uk_date() function all together, I'm adding some dependencies. This patch should be pushed after those, since Koha will still rely on the dt_add_type_uk_date() function until all other instances of it have been removed. When those patches are pushed, this bug should clear out the remaining instances and remove the function.
Comment 10 David Cook 2014-04-24 02:09:23 UTC Comment hidden (obsolete)
Comment 11 David Cook 2014-04-24 02:09:59 UTC Comment hidden (obsolete)
Comment 12 David Cook 2014-04-24 02:10:14 UTC Comment hidden (obsolete)
Comment 13 David Cook 2014-04-24 02:10:23 UTC Comment hidden (obsolete)
Comment 14 David Cook 2014-04-24 02:10:33 UTC Comment hidden (obsolete)
Comment 15 David Cook 2014-04-24 02:10:43 UTC Comment hidden (obsolete)
Comment 16 Owen Leonard 2014-04-24 12:32:54 UTC
Thanks for testing David, and for adding the dependencies to the bug report where they belong (instead of just in my head).
Comment 17 Katrin Fischer 2014-04-27 08:33:17 UTC
The sort on the 'Order' column for the staged import record list could be removed, but this page will be changed a lot if 7180 gets pushed, not a blocker.
Comment 18 Katrin Fischer 2014-04-27 08:48:38 UTC
Created attachment 27676 [details] [review]
[PASSED QA] Bug 12089 - [SIGNED OFF] Remove use of dt_add_type_uk_date() - Members

This patch removes use of dt_add_type_uk_date() from the circulation
history page and updates the sorting configuration according to
current guidelines.

The patch also makes corrections for HTML validity.

To test, open the circulation history page for a patron with a history
of checkouts. Confirm that the date, title, checkout date, due date, and
return date columns sort correctly.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 19 Katrin Fischer 2014-04-27 08:48:41 UTC
Created attachment 27677 [details] [review]
[PASSED QA] Bug 12089 - [SIGNED OFF] Remove use of dt_add_type_uk_date() - Budgets

This patch removes use of dt_add_type_uk_date() from the budgets
administration page and updates the sorting configuration according to
current guidelines. Date sorting is converted to the title-string
method. Invalid <td> "align" attribute is replaced with a class.

Also corrected: Active tab selection based on class.

To test, go to Administration -> Budgets and confirm that sorting works
correctly on both the active and inactive budget tabs. Sorting by date
should work correctly regardless of dateformat system preference.

To test tab selection, append "?tab=2" to the page URL and confirm that
the inactive budget tab is selected.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 20 Katrin Fischer 2014-04-27 08:48:44 UTC
Created attachment 27678 [details] [review]
[PASSED QA] Bug 12089 [SIGNED OFF] [Revised] Remove use of dt_add_type_uk_date() - Circulation

This patch removes instances of dt_add_type_uk_date() from there
circulation templates and updates the sorting configuration according to
current guidelines.

To test, enable the UseTablesortForCirc system preference and open a
patron for circulation who has multiple items checked out. Confirm that
sorting by due date, title, and checkout date work correctly.

Locate a patron who is guarantor to another or is guaranteed by another.
One or both patrons should have checkouts. The "relatives checkouts" tab
on the checkout page should sort correctly on due date, title, and
checkout date.

On the transfers to receive report, confirm that sorting by date of
transfer and title work correctly for all tables.

On the holds awaiting pickup report the "available since" and title
columns should sort correctly for tables in both tabs (waiting and
over).

Revision: Missed an instance of dt_add_type_uk_date().
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 21 Katrin Fischer 2014-04-27 08:48:47 UTC
Created attachment 27679 [details] [review]
[PASSED QA] Bug 12089 - [SIGNED OFF] Remove use of dt_add_type_uk_date() - Acquisitions

This patch removes instances of dt_add_type_uk_date() from acquisitions
templates and updates sorting configurations according to current
guidelines.

In cases where a formatted date was passed from a Perl script, the
script has been modified to pass an unformatted date.

Several instances of the no longer valid align attribute have been
removed from <td> tags in favor of an existing "data" class which is
suitable for display of currency values.

To test, view the following pages in Acquisitions. Columns containing
dates should sort correctly regardless of dateformat system preference
setting. Columns containing bibliographic titles should ignore articles
when sorting.

- Add to an order from a staged file: The table of staged files should
  sort correctly. After clicking "add orders" for one of the staged
  files, the table of titles in that staged file should also be sorted
  correctly.

- Add to an order from a subscription. The table of subscription search
  results should sort correctly.

- Orders search results should sort correctly.

- Late orders should sort correctly.

- Search for a vendor. Click on the vendor name to view the vendor
  detail page. The table of contracts on this page should sort
  correctly.

- From the Acquisitions home page click a number in the "spent" column
  of the table of available funds. The table of orders should sort
  correctly.

- From the Acquisitions home page click a number in the "ordered" column
  of the table of available funds. The table of orders should sort
  correctly.

- From a vendor detail page, click the "Receive shipments" button. On
  the receive shipments page the table of shipments should be sorted
  correctly.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 22 Katrin Fischer 2014-04-27 08:48:50 UTC
Created attachment 27680 [details] [review]
[PASSED QA] Bug 12089 - [SIGNED OFF] Remove use of dt_add_type_uk_date() - JavaScript

This patch removes the now unused dt_add_type_uk_date function from
Koha's custom DataTables javascript file.

To test, be sure all other patches on Bug 12089 are applied. Apply this
patch and search for instances of dt_add_type_uk_date. There should be
none.

Signed-off-by: David Cook <dcook@prosentient.com.au>

Works as described.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script, works as described.
No regressions found, sorting and searching in all tables
touched by these patches works ok.
Comment 23 Galen Charlton 2014-04-28 18:45:23 UTC
Pushed to master.  Thanks, Owen!