TPAC: Preserve loc, query, qtype, and sort params
authorDan Scott <dan@coffeecode.net>
Fri, 6 Jan 2012 03:51:00 +0000 (22:51 -0500)
committerDan Scott <dan@coffeecode.net>
Fri, 6 Jan 2012 03:51:00 +0000 (22:51 -0500)
commit4bff09ccac07bb82c7c1bded2713c55deda85cb1
tree89453f7e857a8c1c0fb3d031ab94c605a6d897b4
parent101d858d4bf1a0dbdfb99b572af0554808ea5377
TPAC: Preserve loc, query, qtype, and sort params

In some cases, mkurl() is not enough to preserve our desired CGI params
- such as when redirects are triggered from within a Perl module, or
forms are submitted. Accordingly, the following changes address these
cases where the chosen location / query / query type was being dropped:

* Switching between account preferences
* Creating / deleting / sharing / editing bookbags
* Moving items from temporary list to bookbags
* Adding notes to items in a bookbag
* Placing holds

The primary mechanism for forms is the "preserve_params.tt2" block that
can accept a "params" list of the CGI params that you want to preserve,
but which defaults to location/query/qtype/sort. Similarly, we add the
same preservation steps to the OpenILS::WWW::EGCatLoader::Account module
for most actions.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/templates/opac/myopac/lists.tt2
Open-ILS/src/templates/opac/parts/anon_list.tt2
Open-ILS/src/templates/opac/parts/myopac/prefs_base.tt2
Open-ILS/src/templates/opac/parts/preserve_params.tt2 [new file with mode: 0644]
Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/results.tt2