Bug 9916 - Use DataTables in the OPAC
authorOwen Leonard <oleonard@myacpl.org>
Fri, 22 Mar 2013 20:11:09 +0000 (16:11 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 19 Aug 2013 14:19:02 +0000 (14:19 +0000)
commitba470954fd4b4bb0cd50f47769ecd2f957dcc3f1
tree89936b776377c4a5f05a6810d3f499ebf5c3e1d1
parent7d0aea7c39e22f42760c3ecbba4c0cd0818785a7
Bug 9916 - Use DataTables in the OPAC

The OPAC still uses the old tablesorter plugin which isn't being
actively maintained. We use DataTables in the staff client and should in
the OPAC too. The plugin was added a while ago but never implemented on
any pages. This patch upgrades the plugin to the latest version and
places it in opac-tmpl/lib for cross-theme access. The patch implements
DataTables on all pages which previously used the tablesorter plugin.

The old tablesorter plugin is removed.

The customized DataTable configuration script, datatables.js, has been
trimmed-down from the staff client version in order to limit it to only
that functionality required in the OPAC.

Sorting based on date is done based on the data's enclosing <span> title
attribute as it is in the staff client:

<span title=" [% iso date %]">[% date | $KohaDates %]</span>

Slight modifications to Serials.pm and opac-search-history.pl have been
made to accommodate this change.

To test, view each page in the OPAC which uses JS-based table sorting:

- The bibliographic detail page
- The cart
- The search history page
- The suggestions page
- The tags page (logged in as a user who has entered tags)
- The "most popular" page (opac-topissues.pl)
- The logged in user summary page (opac-user.pl)
- The subscription "full history" page (opac-serial-issues.pl?selectview=full)
- The self-checkout main page (with existing checkouts)

Table sorting should work correctly on all pages in both the prog and
ccsr themes. Sorting should work for dates whatever your dateformat
system preference setting. Tables listing titles should exclude articles
("a," "an," and "the" in English) when sorting.

Also test the serial collection page in the staff client, which is
affected by the change to Serials.pm. Confirm that dates are displayed
and sorted correctly.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised!

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works really nicely on all pages.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
25 files changed:
C4/Serials.pm
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
koha-tmpl/opac-tmpl/ccsr/en/css/opac.css
koha-tmpl/opac-tmpl/ccsr/en/css/sco.css
koha-tmpl/opac-tmpl/ccsr/en/js/datatables.js
koha-tmpl/opac-tmpl/ccsr/en/lib/jquery/plugins/jquery.tablesorter.min.js [deleted file]
koha-tmpl/opac-tmpl/lib/jquery/plugins/jquery.dataTables.min.js [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/css/opac.css
koha-tmpl/opac-tmpl/prog/en/css/sco.css
koha-tmpl/opac-tmpl/prog/en/includes/datatables-strings.inc [deleted file]
koha-tmpl/opac-tmpl/prog/en/includes/datatables.inc [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/js/datatables.js
koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js [deleted file]
koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.tablesorter.min.js [deleted file]
koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-full-serial-issues.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-topissues.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt
opac/opac-search-history.pl