[open-ils-commits] [GIT] Evergreen ILS branch master updated. c4c9f600cfecc8d65f860da92d1e5f899d5d0356

Evergreen Git git at git.evergreen-ils.org
Wed Jan 18 16:54:43 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  c4c9f600cfecc8d65f860da92d1e5f899d5d0356 (commit)
       via  a23bc8b1e3d884c275f28b158953b2d748952430 (commit)
       via  27b2037d72b8a1c5025a885d571b5329232ffa58 (commit)
      from  0d9bccad69ba6f186e2960530884e88a319aaf07 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c4c9f600cfecc8d65f860da92d1e5f899d5d0356
Author: Dan Scott <dan at coffeecode.net>
Date:   Sun Jan 8 21:43:58 2012 -0500

    Prevent expand and cnoffset params from propagating
    
    The expand and cnoffset params in record summary might result in
    unexpected behaviour if allowed to propagate by default, as mkurl()
    enables, so stop them in their tracks.
    
    Also, fix an overenthusiastic URI-encoding of subjects that led to a
    space getting doubly-encoded (and thereby breaking searches).
    
    Signed-off-by: Dan Scott <dan at coffeecode.net>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/templates/opac/parts/record/body.tt2 b/Open-ILS/src/templates/opac/parts/record/body.tt2
index bb2fbda..6a64e4e 100644
--- a/Open-ILS/src/templates/opac/parts/record/body.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/body.tt2
@@ -1,14 +1,14 @@
-<!-- ****************** page_rdetail.xml ***************************** -->
-[%  attrs = {marc_xml => ctx.marc_xml};
+[%-  attrs = {marc_xml => ctx.marc_xml};
     PROCESS "opac/parts/misc_util.tt2";
-    PROCESS get_marc_attrs args=attrs %]
-
+    PROCESS get_marc_attrs args=attrs;
+    stop_parms = ['expand','cnoffset'];
+%]
 <div id='canvas_main' class='canvas'>
 
     [% IF ctx.search_result_index >= 0 %]
     <div id="rdetail_header">
         <div style="float:left;">
-            <a href='[% mkurl(ctx.opac_root _ '/results') %]'>[% l('&#9668; Search Results') %]</a>
+            <a href='[% mkurl(ctx.opac_root _ '/results', {}, stop_parms); %]'>[% l('&#9668; Search Results') %]</a>
             <span id="rdetail_result_count">
                 [% l('Showing Item [_1] of [_2]', ctx.search_result_index + 1, ctx.hit_count) %]
             </span>
@@ -20,7 +20,7 @@
                     IF ctx.search_result_index % (ctx.page_size + 1) == 0; # first record in the page
                         prev_args.page = ctx.search_page - 1;
                     END;
-                    ctx.prev_rec_url = mkurl(ctx.prev_search_record, prev_args);
+                    ctx.prev_rec_url = mkurl(ctx.prev_search_record, prev_args, stop_parms);
             %]
             <a class='np_nav_link classic_link' title='[% l("Previous Record") %]'
                 href='[% ctx.prev_rec_url %]'><span class="nav_arrow_fix">&#9668; </span>[% l('Previous') %]</a>
@@ -34,7 +34,7 @@
                     IF ctx.page_size == ctx.search_result_index + 1;
                         next_args.page = ctx.search_page + 1;
                     END;
-                    ctx.next_rec_url = mkurl(ctx.next_search_record, next_args);
+                    ctx.next_rec_url = mkurl(ctx.next_search_record, next_args, stop_parms);
             %]
             <a class='np_nav_link classic_link' title='[% l("Next Record") %]'
                 href='[% ctx.next_rec_url %]'>[% l('Next') %]<span class="nav_arrow_fix"> &#9658;</span></a>
@@ -51,4 +51,3 @@
     </div>
     [% INCLUDE "opac/parts/record/summary.tt2" %]
 </div>
-<!-- ****************** end; page_rdetail.xml ***************************** -->
diff --git a/Open-ILS/src/templates/opac/parts/record/subjects.tt2 b/Open-ILS/src/templates/opac/parts/record/subjects.tt2
index 34f80b1..df06100 100644
--- a/Open-ILS/src/templates/opac/parts/record/subjects.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/subjects.tt2
@@ -40,9 +40,10 @@
                 # at this point, we actually have a partial term to use.
                 single_term = subfield.textContent | html;
                 all_terms.push(subfield.textContent);
-                total_term = all_terms.join(" ").replace('\s+$', '') | uri;
-                '<a href="' _ ctx.opac_root _ '/results?qtype=subject&amp;query=' _ total_term _ '&amp;loc=' _ loc _ '">' _ single_term _ '</a>';
-            END;
+                total_term = all_terms.join(" ").replace('\s+$', '');
+            %]
+<a href="[% mkurl(ctx.opac_root _ '/results', {qtype=>'subject', query=>total_term}, stop_parms); %]">[% single_term %]</a>
+            [%- END;
             IF all_terms.size; "<br/>"; END;
         END;
     END 
diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2
index 7867036..f62c531 100644
--- a/Open-ILS/src/templates/opac/parts/record/summary.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2
@@ -25,7 +25,7 @@
     <div id="rdetail_actions_div">
         <div class="rdetail_aux_utils place_hold">
             <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
-                {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}) %]" 
+                {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]" 
             class="no-dec"><img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('place hold') %]" /><span 
             class="place_hold">[% l('Place Hold') %]</span></a>
         </div>
@@ -34,7 +34,7 @@
             operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
             label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); 
         %]
-            <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => ctx.bre_id}) %]" class="no-dec">
+            <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => ctx.bre_id}, stop_parms) %]" class="no-dec">
                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
                 [% label %]
             </a>

commit a23bc8b1e3d884c275f28b158953b2d748952430
Author: Dan Scott <dan at coffeecode.net>
Date:   Thu Jan 5 22:51:00 2012 -0500

    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 at coffeecode.net>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
index 7f00cb6..7b0c1a1 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
@@ -536,6 +536,11 @@ sub handle_hold_update {
             $e->authtoken, undef, \@vals
         )->gather(1);   # LFW XXX test for failure
         $url = 'https://' . $self->apache->hostname . $self->ctx->{opac_root} . '/myopac/holds';
+        foreach my $param (('loc', 'qtype', 'query')) {
+            if ($self->cgi->param($param)) {
+                $url .= ";$param=" . uri_escape($self->cgi->param($param));
+            }
+        }
     }
 
     $circ->kill_me;
@@ -1574,9 +1579,10 @@ sub load_myopac_bookbags {
                 my $url = $self->ctx->{opac_root} . '/myopac/lists?id=' .
                     $bookbag->id;
 
-                # Keep it if we've got it
-                if ($self->cgi->param("sort")) {
-                    $url .= ";sort=" . $self->cgi->param("sort");
+                foreach my $param (('loc', 'qtype', 'query', 'sort')) {
+                    if ($self->cgi->param($param)) {
+                        $url .= ";$param=" . uri_escape($self->cgi->param($param));
+                    }
                 }
 
                 return $self->generic_redirect($url);
@@ -1636,7 +1642,11 @@ sub load_myopac_bookbag_update {
     my $url = "https://" . $self->apache->hostname .
         $self->ctx->{opac_root} . "/myopac/lists?";
 
-    $url .= 'sort=' . uri_escape($cgi->param("sort")) if $cgi->param("sort");
+    foreach my $param (('loc', 'qtype', 'query', 'sort')) {
+        if ($cgi->param($param)) {
+            $url .= "$param=" . uri_escape($cgi->param($param)) . ";";
+        }
+    }
 
     if ($action eq 'create') {
         $list = Fieldmapper::container::biblio_record_entry_bucket->new;
@@ -1663,6 +1673,11 @@ sub load_myopac_bookbag_update {
 
         my $url = $self->ctx->{opac_root} . '/place_hold?hold_type=T';
         $url .= ';hold_target=' . $_ for @hold_recs;
+        foreach my $param (('loc', 'qtype', 'query')) {
+            if ($cgi->param($param)) {
+                $url .= ";$param=" . uri_escape($cgi->param($param));
+            }
+        }
         return $self->generic_redirect($url);
 
     } else {
diff --git a/Open-ILS/src/templates/opac/myopac/lists.tt2 b/Open-ILS/src/templates/opac/myopac/lists.tt2
index 2a9b774..ffab0b3 100644
--- a/Open-ILS/src/templates/opac/myopac/lists.tt2
+++ b/Open-ILS/src/templates/opac/myopac/lists.tt2
@@ -13,6 +13,7 @@
                     <label for="list_create_name">[% l('Enter the name of the new list:') %]</label>
                 </td>
                 <td>
+                    [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
                     <input id="list_create_name" type="text" name="name" />
                     <input type="hidden" name="action" value="create" />
                 </td>
@@ -66,9 +67,10 @@
                 <h2 class="bookbag-name"><a title="[% ltitle %]" href="[% url %]">[% bbag.name | html %]</a></h2>
                 [% IF bbag.description %]<div class="bookbag-description">[% bbag.description | html %]</div>[% END %]
             </div>
-            <form action="[% ctx.opac_root %]/myopac/list/update" method="POST">
+            <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
                 <div class="bookbag-share">
                     <input type="hidden" name="list" value="[% bbag.id %]" />
+                    [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
                     [% IF bbag.pub != 't' %]
                     <input type="hidden" name="action" value="show" />
                     <input class="fixed" type="submit" value="[% l('Share') %]" />
@@ -78,17 +80,19 @@
                     [% END %]
                 </div>
             </form>
-            <form action="[% ctx.opac_root %]/myopac/list/update" method="POST">
+            <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
                 <div class="bookbag-controls">
                     <input type="hidden" name="list" value="[% bbag.id %]" />
                     <input type="hidden" name="action" value="delete" />
+                    [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
                     <input type="submit" value="[% l('Delete List') %]" />
                 </div>
             </form>
-            <form action="[% ctx.opac_root %]/myopac/list/print" method="POST">
+            <form action="[% mkurl(ctx.opac_root _ '/myopac/list/print') %]" method="POST">
                 <div class="bookbag-controls">
                     <input type="hidden" name="list" value="[% bbag.id %]" />
                     <input type="hidden" name="sort" value="[% CGI.param('sort') | html %]" />
+                    [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
                     <input type="submit" value="[% l('Download CSV') %]" />
                 </div>
             </form>
@@ -113,6 +117,7 @@
             <div class="sort">
                 <form method="GET">
                     <label for="opac.result.sort">[% l("Sort list items by: ") %]</label>
+                    [%- INCLUDE "opac/parts/preserve_params.tt2" params=['loc', 'query', 'qtype']; %]
                     [% INCLUDE "opac/parts/filtersort.tt2"
                         value=CGI.param('sort') mode='bookbag' %]
                     <input type="hidden" name="id"
@@ -124,7 +129,7 @@
                 <form method="POST">
                     <input type="hidden" name="id" value="[% bbag.id %]" />
                     <input type="hidden" name="action" value="editmeta" />
-                    <input type="hidden" name="sort" value="[% CGI.param('sort') | html %]" />
+                    [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
                     <table id="bbag-name-desc-form">
                         <tr>
                             <th>
@@ -152,7 +157,7 @@
             </div>
         </div>
         <br class="clear-both" />
-        <form action="[% ctx.opac_root %]/myopac/list/update" method="POST">
+        <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST">
         <input type="hidden" name="list" value="[% bbag.id %]" />
         <input type="hidden" name="sort" value="[% CGI.param('sort') | uri %]" />
         <table class="bookbag-specific" cellpadding='0' cellspacing='0' border='0'>
@@ -184,6 +189,7 @@
                             <option value="place_hold">[% l('Place hold') %]</option>
                             <option value="del_item">[% l('Remove from list') %]</option>
                         </select>
+                        [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
                         <input type="submit" value="[% l('Go') %]" />
                     </td>
                 </tr>
@@ -230,6 +236,7 @@
                 <tr>
                     <td colspan="3"><!-- All space left of notes column --></td>
                     <td class="save-notes">
+                        [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
                         <input type="hidden" name="id" value="[% CGI.param('id') | html %]" />
                         <input type="submit" name="save_notes" value="[% l('Save Notes') %]" />
                     </td>
diff --git a/Open-ILS/src/templates/opac/parts/anon_list.tt2 b/Open-ILS/src/templates/opac/parts/anon_list.tt2
index 4a96558..00a898d 100644
--- a/Open-ILS/src/templates/opac/parts/anon_list.tt2
+++ b/Open-ILS/src/templates/opac/parts/anon_list.tt2
@@ -6,13 +6,12 @@
                     id="anonsort" name="anonsort" value=CGI.param("anonsort") %]
                 <input type="hidden" name="id"
                     value="[% CGI.param('id') | html %]" />
-                <!-- just preserve this --><input type="hidden" name="sort"
-                    value="[% CGI.param('sort') | html %]" />
+                [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
                 <input type="submit" value="[% l('Sort') %]" />
             </form>
         </div>
 
-        <form action="[% ctx.opac_root %]/mylist/move" method="POST">
+        <form action="[% mkurl(ctx.opac_root _ '/mylist/move') %]" method="GET">
         <div>
             <p class="big-strong">[% l('Temporary List') %]</p>
             <table cellpadding='0' cellspacing='0' border='0'>
@@ -39,6 +38,7 @@
                                 </optgroup>
                                 [% END %]
                             </select>
+                            [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
                             <input type="submit" value="[% l('Go') %]" />
                         </td>
                     </tr>
diff --git a/Open-ILS/src/templates/opac/parts/myopac/prefs_base.tt2 b/Open-ILS/src/templates/opac/parts/myopac/prefs_base.tt2
index aeec099..b6a1194 100644
--- a/Open-ILS/src/templates/opac/parts/myopac/prefs_base.tt2
+++ b/Open-ILS/src/templates/opac/parts/myopac/prefs_base.tt2
@@ -10,27 +10,27 @@
                 <a href='#'>[% l("Personal Information") %]</a>
             </div>
             <div class="align">
-                <a href='prefs_notify'>[% l("Notification Preferences") %]</a>
+                <a href='[% mkurl('prefs_notify') %]'>[% l("Notification Preferences") %]</a>
             </div>
             <div class="align">
-                <a href='prefs_settings'>[% l("Search Preferences") %]</a>
+                <a href='[% mkurl('prefs_settings') %]'>[% l("Search Preferences") %]</a>
             </div>
         [% ELSIF prefs_page == 'notify' %]
             <div class="align">
-                <a href='prefs'>[% l("Personal Information") %]</a>
+                <a href='[% mkurl('prefs') %]'>[% l("Personal Information") %]</a>
             </div>
             <div class="align selected">
                 <a href='#'>[% l("Notification Preferences") %]</a>
             </div>
             <div class="align" >
-                <a href='prefs_settings'>[% l("Search Preferences") %]</a>
+                <a href='[% mkurl('prefs_settings') %]'>[% l("Search Preferences") %]</a>
             </div>
         [% ELSE %]
             <div class="align">
-                <a href='prefs'>[% l("Personal Information") %]</a>
+                <a href='[% mkurl('prefs') %]'>[% l("Personal Information") %]</a>
             </div>
             <div class="align">
-                <a href='prefs_notify'>[% l("Notification Preferences") %]</a>
+                <a href='[% mkurl('prefs_notify') %]'>[% l("Notification Preferences") %]</a>
             </div>
             <div class="align selected" >
                 <a href='#'>[% l("Search Preferences") %]</a>
diff --git a/Open-ILS/src/templates/opac/parts/preserve_params.tt2 b/Open-ILS/src/templates/opac/parts/preserve_params.tt2
new file mode 100644
index 0000000..14fe5be
--- /dev/null
+++ b/Open-ILS/src/templates/opac/parts/preserve_params.tt2
@@ -0,0 +1,9 @@
+[%- 
+UNLESS params;
+    params = ['loc', 'query', 'qtype', 'sort'];
+END;
+FOR param IN params;
+    IF CGI.param(param); %]
+    <input type="hidden" name="[% param %]" value="[% CGI.param(param) | html %]" />
+    [%- END;
+END; %]
diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2
index c67d0ef..7867036 100644
--- a/Open-ILS/src/templates/opac/parts/record/summary.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2
@@ -34,7 +34,7 @@
             operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
             label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); 
         %]
-            <a href="[% ctx.opac_root %]/mylist/[% operation %]?record=[% ctx.bre_id %]" class="no-dec">
+            <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => ctx.bre_id}) %]" class="no-dec">
                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
                 [% label %]
             </a>
diff --git a/Open-ILS/src/templates/opac/results.tt2 b/Open-ILS/src/templates/opac/results.tt2
index 17fddab..566936a 100644
--- a/Open-ILS/src/templates/opac/results.tt2
+++ b/Open-ILS/src/templates/opac/results.tt2
@@ -31,7 +31,11 @@
                 </div>
                 [% IF ctx.mylist.size %]
                 <div class="results_header_btns cached_list_div">
-                    <a href="[% ctx.opac_root; ctx.user ? '/myopac/lists' : '/mylist' %]">[% l('View My List') %]</a>
+                    [%- IF ctx.user; %]
+                    <a href="[% mkurl(ctx.opac_root _ '/myopac/lists') %]">[% l('View My List') %]</a>
+                    [%- ELSE %]
+                    <a href="[% mkurl(ctx.opac_root _ '/mylist') %]">[% l('View My List') %]</a>
+                    [%- END %]
                 </div>
                 [% END %]
                 <div class="results_header_div"></div>

commit 27b2037d72b8a1c5025a885d571b5329232ffa58
Author: Dan Scott <dan at coffeecode.net>
Date:   Thu Dec 29 00:11:25 2011 -0500

    TPAC: Propagate CGI params via mkurl()
    
    Fix many instances where params such as "loc" are dropped during a
    normal workflow, resulting in unexpected changes to the user's chosen
    search scope. mkurl() preserves the existing CGI params by default
    and passes them on to the created URL; for now we err on the side of
    caution (preserving all params) rather than filtering any out. Manual
    testing suggests this does not introduce any problems, and resolves
    many.
    
    Signed-off-by: Dan Scott <dan at coffeecode.net>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/templates/opac/advanced.tt2 b/Open-ILS/src/templates/opac/advanced.tt2
index 010e923..17cb74f 100644
--- a/Open-ILS/src/templates/opac/advanced.tt2
+++ b/Open-ILS/src/templates/opac/advanced.tt2
@@ -14,9 +14,15 @@
         </div>
         <div id="adv_search_parent">
             <div id="adv_search_tabs">
-                <a href="?pane=advanced[% IF loc %];loc=[% loc %][% END %]" [% IF pane == 'advanced' %]class="on" [% END %]id="adv_search">[% l('Advanced Search') %]</a>
-                <a href="?pane=numeric[% IF loc %];loc=[% loc %][% END %]" [% IF pane == 'numeric' %]class="on" [% END %]id="num_search">[% l('Numeric Search') %]</a>
-                <a href="?pane=expert[% IF loc %];loc=[% loc %][% END %]" [% IF pane == 'expert' %]class="on" [% END %]id="expert_search">[% l('Expert Search') %]</a>
+                <a href="[% mkurl('', {pane => 'advanced'}) %]"
+                    [% IF pane == 'advanced' %]class="on" [% END %]
+                    id="adv_search">[% l('Advanced Search') %]</a>
+                <a href="[% mkurl('', {pane => 'numeric'}) %]"
+                    [% IF pane == 'numeric' %]class="on" [% END %]
+                    id="num_search">[% l('Numeric Search') %]</a>
+                <a href="[% mkurl('', {pane => 'expert'}) %]"
+                    [% IF pane == 'expert' %]class="on" [% END %]
+                    id="expert_search">[% l('Expert Search') %]</a>
             </div>
         </div>
     </div>
diff --git a/Open-ILS/src/templates/opac/myopac/circ_history.tt2 b/Open-ILS/src/templates/opac/myopac/circ_history.tt2
index f983ad5..0728245 100644
--- a/Open-ILS/src/templates/opac/myopac/circ_history.tt2
+++ b/Open-ILS/src/templates/opac/myopac/circ_history.tt2
@@ -10,7 +10,7 @@
     
     <div id="acct_checked_tabs">
         <div class="align">
-            <a href='circs'>[% l("Current Items Checked Out") %]</a>
+            <a href='[% mkurl('circs') %]'>[% l("Current Items Checked Out") %]</a>
         </div>
         <div class="align selected">
             <a href="#">[% l("Check Out History") %]</a>
@@ -20,10 +20,10 @@
     <div class="header_middle">
         <span class="float-left">[% l('Previously Checked Out Items') %]</span>
         <span class='float-left' style='padding-left: 10px;'>
-            <a href='circ_history?limit=[% limit %]&amp;offset=[% offset - limit %]'
+            <a href='[% mkurl('circ_history', {limit => limit, offset => (offset - limit)}) %]'
                 [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
             [%# TODO: get total to prevent paging off then end of the list.. %]
-            <a href='circ_history?limit=[% limit %]&amp;offset=[% offset + limit %]'
+            <a href='[% mkurl('circ_history', {limit => limit, offset => (offset + limit)}) %]'
                [% IF ctx.circs.size < limit %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
         </span>
         <span class="float-right">
@@ -69,10 +69,12 @@
                     PROCESS get_marc_attrs args=attrs; %]
                     <tr>
                         <td style="padding-left:5px;padding-bottom:10px;">
-                            <a href="[% ctx.opac_root %]/record/[% circ.circ.target_copy.call_number.record.id %]" 
+                            <a href="[% mkurl(ctx.opac_root _ '/record/' _ circ.circ.target_copy.call_number.record.id) %]" 
                                 name="[% l('Catalog record') %]">[% attrs.title | html %]</a>
                             [% IF attrs.author %] /
-                            <a href="[% ctx.opac_root %]/results?qtype=author&amp;query=[% attrs.author | replace('[,\.:;]', '') | url %]">[% attrs.author | html %]</a>
+                            <a href="[% mkurl(ctx.opac_root _ '/results',
+                                {qtype => 'author', query => attrs.author.replace('[,\.:;]', '')}
+                            )%]">[% attrs.author | html %]</a>
                             [% END %]
                         </td>
                         <td style="padding-left:5px;">
diff --git a/Open-ILS/src/templates/opac/myopac/circs.tt2 b/Open-ILS/src/templates/opac/myopac/circs.tt2
index 6b94fb6..bf3ab0e 100644
--- a/Open-ILS/src/templates/opac/myopac/circs.tt2
+++ b/Open-ILS/src/templates/opac/myopac/circs.tt2
@@ -9,7 +9,7 @@
             <a href="#">[% l("Current Items Checked Out") %]</a>
         </div>
         <div class="align">
-            <a href="circ_history">[% l("Check Out History") %]</a>
+            <a href="[% mkurl('circ_history') %]">[% l("Check Out History") %]</a>
         </div>
     </div>
 
@@ -105,9 +105,13 @@
                         <td width="40%"
                             style="padding-left:5px;padding-bottom:10px;"
                             name="author">
-                            <a href="[% ctx.opac_root %]/record/[% circ.circ.target_copy.call_number.record.id %]" name="[% l('Catalog record') %]">[% attrs.title | html %]</a>
+                            <a href="[% mkurl(ctx.opac_root _ '/record/' _ 
+                                circ.circ.target_copy.call_number.record.id) %]"
+                                name="[% l('Catalog record') %]">[% attrs.title | html %]</a>
                             [% IF attrs.author %] /
-                            <a href="[% ctx.opac_root %]/results?qtype=author&amp;query=[% attrs.author | replace('[,\.:;]', '') | url %]">[% attrs.author | html %]</a>
+                            <a href="[% mkurl(ctx.opac_root _ '/results',
+                                {qtype => 'author', query => attrs.author.replace('[,\.:;]', '')}
+                            ) %]">[% attrs.author | html %]</a>
                             [% END %]
                         </td>
                         <td width="8%" name="renewals" align="center">
diff --git a/Open-ILS/src/templates/opac/myopac/hold_history.tt2 b/Open-ILS/src/templates/opac/myopac/hold_history.tt2
index af464f5..bc3cc6c 100644
--- a/Open-ILS/src/templates/opac/myopac/hold_history.tt2
+++ b/Open-ILS/src/templates/opac/myopac/hold_history.tt2
@@ -11,7 +11,7 @@
 
     <div id="acct_holds_tabs">
         <div class="align">
-            <a href='holds'>[% l("Items on Hold") %]</a>
+            <a href='[% mkurl('holds') %]'>[% l("Items on Hold") %]</a>
         </div>
         <div class="align selected">
             <a href="#">[% l("Holds History") %]</a>
@@ -21,10 +21,10 @@
     <div class="header_middle">
         <span style="float:left;">[% l("Previously Held Items") %]</span>
         <span class='float-left' style='padding-left: 10px;'>
-            <a href='hold_history?limit=[% limit %]&amp;offset=[% offset - limit %]'
+            <a href='[% mkurl(hold_history, {limit => limit,offset => (offset - limit)}) %]'
                 [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
             [%# TODO: get total to prevent paging off then end of the list.. %]
-            <a href='hold_history?limit=[% limit %]&amp;offset=[% offset + limit %]'
+            <a href='[% mkurl(hold_history, {limit => limit, offset => (offset + limit)}) %]'
                [% IF ctx.holds.size < limit %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
         </span>
         <span style="float:right;">
@@ -62,12 +62,14 @@
 
                     <td width="138">
                         <div style="margin-top:10px;margin-bottom:10px;">
-                            <a href="[% ctx.opac_root %]/record/[% hold.hold.bre_id %]">[% attrs.title | html %]</a>
+                            <a href="[% mkurl(ctx.opac_root _ '/record/' _ hold.hold.bre_id) %]">[% attrs.title | html %]</a>
                         </div>
                     </td>
                     <td width="123">
                         <div style="margin-top:10px;margin-bottom:10px;">
-                            <a href="[% ctx.opac_root %]/results?qtype=author&amp;query=[% attrs.author | replace('[,\.:;]', '') | url %]">[% attrs.author | html %]</a>
+                            <a href="[% mkurl(ctx.opac_root _ '/results',
+                                {qtype => author, query => attrs.author.replace('[,\.:;]', '')}
+                            ) %]">[% attrs.author | html %]</a>
                         </div>
                     </td>
                     <td width="64">
diff --git a/Open-ILS/src/templates/opac/myopac/holds.tt2 b/Open-ILS/src/templates/opac/myopac/holds.tt2
index bb0e228..5a5be5b 100644
--- a/Open-ILS/src/templates/opac/myopac/holds.tt2
+++ b/Open-ILS/src/templates/opac/myopac/holds.tt2
@@ -10,7 +10,7 @@
             <a href='#'>[% l("Items on Hold") %]</a>
         </div>
         <div class="align">
-            <a href='hold_history'>[% l("Holds History") %]</a>
+            <a href='[% mkurl('hold_history') %]'>[% l("Holds History") %]</a>
         </div>
     </div>
 
@@ -62,11 +62,11 @@
                 <td align="right">
                     [% l("Show") %] &nbsp; &nbsp;
                     [% IF CGI.param("available") %]
-                    <a href="holds">[% l('all') %]</a> |
+                    <a href="[% mkurl('holds') %]">[% l('all') %]</a> |
                     <strong>[% l("only available") %]</strong>
                     [% ELSE %]
                     <strong>[% l("all") %]</strong> |
-                    <a href="holds?available=1">[% l("only available") %]</a>
+                    <a href="[% mkurl('holds', {available => 1}) %]">[% l("only available") %]</a>
                     [% END %] &nbsp; &nbsp;
                     [% l("holds") %]
                     <select class="hide_me" id="holds_sort">
@@ -139,12 +139,14 @@
                                     title = l('[_1] ([_2])', title, hold.hold.part.label);
                                 END;
                             %]
-                            <a href="[% ctx.opac_root %]/record/[% hold.hold.bre_id %]">[% title | html %]</a>
+                            <a href="[% mkurl(ctx.opac_root _ '/record/' _ hold.hold.bre_id) %]">[% title | html %]</a>
                         </div>
                     </td>
                     <td width="123">
                         <div style="margin-top:10px;margin-bottom:10px;">
-                            <a href="[% ctx.opac_root %]/results?qtype=author&amp;query=[% attrs.author | replace('[,\.:;]', '') | url %]">[% attrs.author | html %]</a>
+                            <a href="[% mkurl(ctx.opac_root _ '/results',
+                                {qtype => 'author', query => attrs.author.replace('[,\.:;]', '')}
+                            ) %]">[% attrs.author | html %]</a>
                         </div>
                     </td>
                     <td width="64">
@@ -190,7 +192,7 @@
                         </div>
                     </td>
                     <td class="opac-auto-161">
-                        <a href="[% ctx.opac_root %]/myopac/holds/edit?id=[% ahr.id %]">Edit</a>
+                        <a href="[% mkurl(ctx.opac_root _ '/myopac/holds/edit', {id => ahr.id}) %]">Edit</a>
                     </td>
                 </tr>
                 [% END %]
diff --git a/Open-ILS/src/templates/opac/myopac/lists.tt2 b/Open-ILS/src/templates/opac/myopac/lists.tt2
index 45404e8..2a9b774 100644
--- a/Open-ILS/src/templates/opac/myopac/lists.tt2
+++ b/Open-ILS/src/templates/opac/myopac/lists.tt2
@@ -5,7 +5,7 @@
 <div id='myopac_bookbag_div' style="padding:5px;">
 
     <!-- new list creation -->
-    <form action="[% ctx.opac_root %]/myopac/list/update" method="POST" id="create_form">
+    <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="POST" id="create_form">
         <h1>[% l('Create new list') %]</h1><a name="createnewlist"></a>
         <table cellpadding="0" border="0" id="list_create_table">
             <tr>
diff --git a/Open-ILS/src/templates/opac/myopac/main.tt2 b/Open-ILS/src/templates/opac/myopac/main.tt2
index 2398b3c..793653b 100644
--- a/Open-ILS/src/templates/opac/myopac/main.tt2
+++ b/Open-ILS/src/templates/opac/myopac/main.tt2
@@ -47,13 +47,16 @@
                     <td>
                         [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;
                         IF recid; %]
-                        <a href="[% ctx.opac_root %]/record/[% recid %]">[% attrs.title | html %]</a>
+                        <a href="[% mkurl(ctx.opac_root _ '/record/' _ recid,
+                            {loc => ctx.search_ou}) %]">[% attrs.title | html %]</a>
                         [% ELSE %]
                         [% attrs.title | html %]
                         [% END %]
                     </td>
-                    <td>
-                        <a href="[% ctx.opac_root %]/results?qtype=author&amp;query=[% attrs.author | replace('[,\.:;]', '') | url %]">[% attrs.author | html %]</a>
+                    <td>[%- author_query = attrs.author.replace('[,\.:;]', ''); %]
+                        <a href="[% mkurl(ctx.opac_root _ '/results',
+                            {qtype => 'author', query => author_query,
+                            loc => ctx.search_ou}) %]">[% attrs.author | html %]</a>
                     </td>
                     <td name='myopac_circ_trans_start'>
                         [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0;
diff --git a/Open-ILS/src/templates/opac/parts/myopac/base.tt2 b/Open-ILS/src/templates/opac/parts/myopac/base.tt2
index a65cf2a..9c11f13 100644
--- a/Open-ILS/src/templates/opac/parts/myopac/base.tt2
+++ b/Open-ILS/src/templates/opac/parts/myopac/base.tt2
@@ -23,7 +23,7 @@
                     ELSE;
                         cls_which = "acct-tab-off";
                     END -%]
-                <a href="[% ctx.opac_root _ '/myopac/' _ page.url %]"
+                <a href="[% mkurl(ctx.opac_root _ '/myopac/' _ page.url) %]"
                     class="[% cls_which %]">[% page.name; %]</a>
                 [% END %]
             </div>
diff --git a/Open-ILS/src/templates/opac/parts/myopac/main_base.tt2 b/Open-ILS/src/templates/opac/parts/myopac/main_base.tt2
index c603ada..9607a9f 100644
--- a/Open-ILS/src/templates/opac/parts/myopac/main_base.tt2
+++ b/Open-ILS/src/templates/opac/parts/myopac/main_base.tt2
@@ -56,7 +56,7 @@
                     <tr>
                         <td>[% l("Items Currently Checked out ([_1])", ctx.user_stats.checkouts.total_out) %]</td>
                         <td align="right">
-                            <a href="[% ctx.opac_root %]/myopac/circs">[% l("View All") %]</a>
+                            <a href="[% mkurl(ctx.opac_root + '/myopac/circs') %]">[% l("View All") %]</a>
                         </td>
                     </tr>
                 </table>
@@ -66,7 +66,7 @@
                     <tr>
                         <td>[% l('Items Currently on Hold ([_1])', ctx.user_stats.holds.total) %]</td>
                         <td align="right">
-                            <a href="[% ctx.opac_root %]/myopac/holds">[% l('View All') %]</a>
+                            <a href="[% mkurl(ctx.opac_root _ '/myopac/holds') %]">[% l('View All') %]</a>
                         </td>
                     </tr>
                 </table>
@@ -76,7 +76,7 @@
                     <tr>
                         <td>[% l('Items ready for pickup ([_1])', ctx.user_stats.holds.ready) %]</td>
                         <td align="right">
-                            <a href="[% ctx.opac_root %]/myopac/holds?available=1">[% l('View All') %]</a>
+                            <a href="[% mkurl(ctx.opac_root _ '/myopac/holds', {available => 1}) %]">[% l('View All') %]</a>
                         </td>
                     </tr>
                 </table>
@@ -88,9 +88,9 @@
         <div id='acct_fines_tabs'>
             [% IF myopac_main_page == 'main' %]
             <a href='#' class="acct-tab-on">[% l("Fines") %]</a>
-            <a href='main_payments' class="acct-tab-off">[% l("Payments") %]</a>
+            <a href='[% mkurl(ctx.opac_root _ '/myopac/main_payments') %]' class="acct-tab-off">[% l("Payments") %]</a>
             [% ELSE %]
-            <a href='main' class="acct-tab-off">[% l("Fines") %]</a>
+            <a href='[% mkurl(ctx.opac_root _ '/myopac/main') %]' class="acct-tab-off">[% l("Fines") %]</a>
             <a href='#' class="acct-tab-on">[% l("Payments") %]</a>
             [% END %]
         </div>
diff --git a/Open-ILS/src/templates/opac/parts/topnav.tt2 b/Open-ILS/src/templates/opac/parts/topnav.tt2
index db1f2a4..8971723 100644
--- a/Open-ILS/src/templates/opac/parts/topnav.tt2
+++ b/Open-ILS/src/templates/opac/parts/topnav.tt2
@@ -7,7 +7,7 @@
     <div class="float-right">
         [% IF !ctx.user %]
         <div id="your-acct-login">
-            <a href="[% ctx.opac_root %]/myopac/main" 
+            <a href="[% mkurl(ctx.opac_root _ '/myopac/main') %]" 
                 class="opac-button" id="home_myopac_link">
                 [% l('Your Account Log in') %]
             </a>
@@ -19,27 +19,35 @@
                     [%  l('[_1] [_2]', ctx.user.first_given_name, ctx.user.family_name) | html %]
                 </span>
                 <span class="dash_divider">|</span>
-                <a href="[% ctx.opac_root %]/myopac/main" 
+                <a href="[% mkurl(ctx.opac_root _ '/myopac/main') %]" 
                     class="opac-button">[% l('My Account') %]</a>
 
-                <a href="[% ctx.opac_root %]/logout" class="opac-button"
-                    id="logout_link">[% l('Logout') %]</a>
+                <a href="[% mkurl(ctx.opac_root _ '/logout', {}, 1) %]"
+                    class="opac-button" id="logout_link">[% l('Logout') %]</a>
             </div>
             <div id="dashboard">
                 <span class="dash-align">
-                    <a class="dash-link" href="[% ctx.opac_root %]/myopac/circs"><span id="dash_checked">[% ctx.user_stats.checkouts.total_out %]</span> [% l("Checked Out") %]</a>
+                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/circs')
+                        %]"><span id="dash_checked">[% ctx.user_stats.checkouts.total_out
+                        %]</span> [% l("Checked Out") %]</a>
                 </span>
                 <span class="dash_divider">|</span>
                 <span class="dash-align">
-                    <a class="dash-link" href="[% ctx.opac_root %]/myopac/holds"><span id="dash_holds">[% ctx.user_stats.holds.total %]</span> [% l("On Hold") %]</a>
+                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/holds')
+                        %]"><span id="dash_holds">[% ctx.user_stats.holds.total
+                        %]</span> [% l("On Hold") %]</a>
                 </span>
                 <span class="dash_divider">|</span>
                 <span class="dash-align">
-                    <a class="dash-link" href="[% ctx.opac_root %]/myopac/holds?available=1"><span id="dash_pickup">[% ctx.user_stats.holds.ready %]</span> [% l("Ready for Pickup") %]</a>
+                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/holds',
+                        {available => 1}) %]"><span id="dash_pickup">[%
+                        ctx.user_stats.holds.ready %]</span> [% l("Ready for Pickup") %]</a>
                 </span>
                 <span class="dash_divider">|</span>
                 <span class="dash-align">
-                    <a class="dash-link" href="[% ctx.opac_root %]/myopac/main"><span id="dash_fines">[% money(ctx.user_stats.fines.balance_owed) %]</span> [% l("Fines") %]</a>
+                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/main')
+                        %]"><span id="dash_fines">[% money(ctx.user_stats.fines.balance_owed)
+                        %]</span> [% l("Fines") %]</a>
                 </span>
             </div>
         </div>

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/WWW/EGCatLoader/Account.pm         |   23 +++++++++++++++---
 Open-ILS/src/templates/opac/advanced.tt2           |   12 +++++++--
 .../src/templates/opac/myopac/circ_history.tt2     |   12 +++++----
 Open-ILS/src/templates/opac/myopac/circs.tt2       |   10 +++++--
 .../src/templates/opac/myopac/hold_history.tt2     |   12 +++++----
 Open-ILS/src/templates/opac/myopac/holds.tt2       |   14 ++++++-----
 Open-ILS/src/templates/opac/myopac/lists.tt2       |   19 ++++++++++-----
 Open-ILS/src/templates/opac/myopac/main.tt2        |    9 +++++--
 Open-ILS/src/templates/opac/parts/anon_list.tt2    |    6 ++--
 Open-ILS/src/templates/opac/parts/myopac/base.tt2  |    2 +-
 .../src/templates/opac/parts/myopac/main_base.tt2  |   10 ++++----
 .../src/templates/opac/parts/myopac/prefs_base.tt2 |   12 +++++-----
 .../src/templates/opac/parts/preserve_params.tt2   |    9 +++++++
 Open-ILS/src/templates/opac/parts/record/body.tt2  |   15 +++++------
 .../src/templates/opac/parts/record/subjects.tt2   |    7 +++--
 .../src/templates/opac/parts/record/summary.tt2    |    4 +-
 Open-ILS/src/templates/opac/parts/topnav.tt2       |   24 +++++++++++++------
 Open-ILS/src/templates/opac/results.tt2            |    6 ++++-
 18 files changed, 134 insertions(+), 72 deletions(-)
 create mode 100644 Open-ILS/src/templates/opac/parts/preserve_params.tt2


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list