Many tables in the OPAC are sorted with the old tablesorter plugin. They should use DataTables instead. This implementation of DataTables should use a minimal configuration, compared to the staff client, because of the limited kinds of functionality required in the OPAC and the need for efficiency.
Created attachment 19951 [details] [review] 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.
On opac-serial-issues.pl?selectview=full I got "currentYear is not defined". Is that just my setup?
(In reply to Srdjan Jankovic from comment #2) > On opac-serial-issues.pl?selectview=full I got "currentYear is not defined". Thanks for testing Srdjan. Where did you see that error?
Oh I see: If you navigate directly to "/cgi-bin/koha/opac-serial-issues.pl?selectview=full" without coming to it from an existing subscription you do get that error. You have to search for a biblio with a subscription and click the "subscriptions" tab. Click "more details" at the bottom, then the "full history" tab. There should be a biblionumber parameter: /cgi-bin/koha/opac-serial-issues.pl?selectview=full&biblionumber=XXX
Created attachment 20030 [details] [review] 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>
Created attachment 20031 [details] [review] [SIGNED-OFF] 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>
I got fatal: /tmp/RDJ3G9: 657: patch contains a line longer than 998 characters warning: no patches were sent Something to worry about?
(In reply to Srdjan Jankovic from comment #7) > fatal: /tmp/RDJ3G9: 657: patch contains a line longer than 998 characters > warning: no patches were sent This is a common problem if you try to use git to send an patch that contains a minified JavaScript file. If it was something you needed to get to the patches mailing list you'd have to mail it by hand.
Ok, so you want me to email it separately? I mean how important it is?
Created attachment 20430 [details] [review] 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!
Created attachment 20435 [details] [review] [PASSED QA] 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.
Pushed to master, along with some follow-ups to set the default sort order on some pages back to where it was before this patch. Thanks, Owen!