Bug 24958: Remember last selected tab in SQL reports
authorOwen Leonard <oleonard@myacpl.org>
Tue, 14 Apr 2020 18:49:35 +0000 (18:49 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 29 Sep 2020 12:28:18 +0000 (14:28 +0200)
commit7fb705696f9f5d40d4a8463548fb950aaf7b9b20
treea3cd6642f5e27aa357371f0fd345a52b8d5f8fb4
parent912d911db2eff822b3a964cc84f7d2653d696815
Bug 24958: Remember last selected tab in SQL reports

This patch modifies the saved reports page so that it remembers, for the
duration of the browser session, the last active tab.

To test you should have multiple reports in multiple report groups.
Apply the patch and go to Reports -> Saved reports.

- Select a tab to filter the table of saved reports to a particular
  report group.
- Navigate away from the page
- Return to the save reports page. The tab you previously selected
  should be selected again.
- Restart your browser and return to the saved reports page. The tab
  should no longer be preselected.

Update: The tabs filtering JavaScript has been moved to a separate
function so that the function can be triggered by both the "create"
event (when the tabs are initialized) and the "activate" event (when a
tab is selected).

Update II: Persistence is now enable through localStorage instead of
Cookies. The localStorage item is now cleared during the logOut
function.

Update III: The logOut() function in staff-global.js is now called by
auth.tt to ensure that tabs are not remembered across sessions.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
koha-tmpl/intranet-tmpl/prog/js/staff-global.js