Get rid of CGI params that start with "copy" because a preceding ampersand causes... user/miker/lp-1917951-rename-copy_blah-cgi-params
authorMike Rylander <mrylander@gmail.com>
Fri, 5 Mar 2021 21:44:09 +0000 (16:44 -0500)
committerMike Rylander <mrylander@gmail.com>
Fri, 5 Mar 2021 21:44:09 +0000 (16:44 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
14 files changed:
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/SMS.pm
Open-ILS/src/templates-bootstrap/opac/parts/record/body.tt2
Open-ILS/src/templates-bootstrap/opac/parts/record/copy_counts.tt2
Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2
Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2
Open-ILS/src/templates-bootstrap/opac/sms_cn.tt2
Open-ILS/src/templates/kpac/parts/breadcrumb.tt2
Open-ILS/src/templates/kpac/parts/copy_table.tt2
Open-ILS/src/templates/opac/parts/record/body.tt2
Open-ILS/src/templates/opac/parts/record/copy_counts.tt2
Open-ILS/src/templates/opac/parts/record/copy_table.tt2
Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/sms_cn.tt2

index f5fada4..a983803 100644 (file)
@@ -37,12 +37,12 @@ sub load_record {
     $depth = $ctx->{get_aou}->($org)->ou_type->depth 
         unless defined $depth; # can be 0
 
-    my $copy_depth = $self->cgi->param('copy_depth');
+    my $copy_depth = $self->cgi->param('cp_depth');
     $copy_depth = $depth unless defined $copy_depth; # can be 0
-    $self->ctx->{copy_depth} = $copy_depth;
+    $self->ctx->{cp_depth} = $copy_depth;
 
-    my $copy_limit = int($self->cgi->param('copy_limit') || 10);
-    my $copy_offset = int($self->cgi->param('copy_offset') || 0);
+    my $copy_limit = int($self->cgi->param('cp_limit') || 10);
+    my $copy_offset = int($self->cgi->param('cp_offset') || 0);
 
     $self->get_staff_search_settings;
     if ($ctx->{staff_saved_search_size}) {
@@ -173,8 +173,8 @@ sub load_record {
     }
 
     $self->timelog("past store copy retrieval call");
-    $ctx->{copy_limit} = $copy_limit;
-    $ctx->{copy_offset} = $copy_offset;
+    $ctx->{cp_limit} = $copy_limit;
+    $ctx->{cp_offset} = $copy_offset;
 
     $ctx->{have_holdings_to_show} = 0;
     $ctx->{have_mfhd_to_show} = 0;
index 63c0503..c33c6dc 100644 (file)
@@ -26,7 +26,7 @@ sub load_sms_cn {
     $ctx->{page} = 'sms_cn';
     $ctx->{sms_carrier} = $cgi->param('sms_carrier');
     $ctx->{sms_notify} = $cgi->param('sms_notify');
-    $ctx->{copy_id} = $cgi->param('copy_id');
+    $ctx->{cp_id} = $cgi->param('cp_id');
     $ctx->{query} = $cgi->param('query');
     $ctx->{origin} = $cgi->param('origin') || $cgi->referer;
 
@@ -35,7 +35,7 @@ sub load_sms_cn {
             acp => ['call_number']
         },
         from => 'acp',
-        where => {id => $ctx->{copy_id}}
+        where => {id => $ctx->{cp_id}}
     });
 
     my $acn_ids = [map { $_->{call_number} } @$acn_results];
index 081e103..512aba8 100755 (executable)
@@ -1,7 +1,7 @@
 [%-  attrs = {marc_xml => ctx.marc_xml};
     PROCESS "opac/parts/misc_util.tt2";
     PROCESS get_marc_attrs args=attrs;
-    stop_parms = ['expand','cnoffset','copy_offset','copy_limit'];
+    stop_parms = ['expand','cnoffset','cp_offset','cp_limit'];
     ctx.record_attrs = attrs; # capture for JS
     ctx.metalinks.push('<meta property="og:type" content="http://schema.org/' _ args.schema.itemtype _ '" />');
 %]
index ab2aa74..104dfea 100755 (executable)
@@ -22,8 +22,8 @@
     <li>
     [% l('[_1] of [quant,_2,copy,copies] available at [_3].', ou_avail, ou_count, ou_name) | html %]
     [%- this_depth = ctx.get_aou(ou_id).ou_type.depth;
-        IF ou_count > 0 && this_depth != ctx.copy_depth %]
-    <a href="[% mkurl('', {copy_depth => this_depth}, ['copy_offset']); %]"
+        IF ou_count > 0 && this_depth != ctx.cp_depth %]
+    <a href="[% mkurl('', {cp_depth => this_depth}, ['cp_offset']); %]"
        title="[% l('Show copies at [_1]', ou_name) | html; %]">
        [%- l('(Show)'); %]</a>
     [%- END; %]
@@ -43,7 +43,7 @@
             attrs.plib_copy_counts.$depth.available,
             attrs.plib_copy_counts.$depth.count,
             ou_name) | html
-    %] <a href="[% mkurl('', {locg => ou_id}, ['copy_offset']); %]"
+    %] <a href="[% mkurl('', {locg => ou_id}, ['cp_offset']); %]"
        title="[% l('Show copies at [_1]', ou_name) | html; %]">[%
        l('(Show preferred library)');
     %]</a></li>
index 034760c..762c32c 100755 (executable)
@@ -27,7 +27,7 @@ END;
 -%]
 [%-
 IF has_copies or ctx.foreign_copies;
-  depth = CGI.param('copy_depth').defined ? CGI.param('copy_depth') : CGI.param('depth').defined ? CGI.param('depth') : ctx.copy_summary.last.depth;
+  depth = CGI.param('cp_depth').defined ? CGI.param('cp_depth') : CGI.param('depth').defined ? CGI.param('depth') : ctx.copy_summary.last.depth;
   total_copies = ctx.copy_summary.$depth.count;
 %]
 <table class="container-fluid table table-hover mt-4 miniTable copyTable w-100" >
@@ -111,7 +111,7 @@ END; # FOREACH bib
             </td>[% END %]
             <td><span property="sku">[% callnum | html %]</span> [% IF ctx.get_org_setting(CGI.param('loc')
                 OR ctx.aou_tree.id, 'sms.enable') == 1 %](<a href="[% mkurl(ctx.opac_root _ '/sms_cn',
-               {copy_id => copy_info.id}) %];rec=[%- ctx.bre_id -%]" rel="nofollow" vocab="">Text</a>)[% END %]</td>
+               {cp_id => copy_info.id}) %];rec=[%- ctx.bre_id -%]" rel="nofollow" vocab="">Text</a>)[% END %]</td>
             [%- IF has_parts == 'true' %]
             <td>[% copy_info.part_label | html %]</td>
             [%- END %]
@@ -133,7 +133,7 @@ END; # FOREACH bib
                         OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %]
                         <span> | </span>
                         <a href="javascript:;"
-                            onclick="xulG.volume_item_creator({copy_id : [% copy_info.id %]})">
+                            onclick="xulG.volume_item_creator({cp_id : [% copy_info.id %]})">
                             [% l(' edit') %]
                         </a>
                     [% END %]
@@ -288,20 +288,20 @@ END; # FOREACH bib
 
 [%- END; # FOR copy_info
 %]
-        [% IF ctx.copy_limit < total_copies AND NOT serial_holdings %]
+        [% IF ctx.cp_limit < total_copies AND NOT serial_holdings %]
             <tr class="offset">
-            [%- IF ctx.copy_offset > 0;
-                new_offset = ctx.copy_offset - ctx.copy_limit;
+            [%- IF ctx.cp_offset > 0;
+                new_offset = ctx.cp_offset - ctx.cp_limit;
                 IF new_offset < 0; new_offset = 0; END %]
                 <td>
-                <a href="[% mkurl('', {copy_offset => new_offset, copy_limit => ctx.copy_limit}) %]">&laquo; [%
-                    l('Previous [_1]', ctx.copy_offset - new_offset) %]</a>
+                <a href="[% mkurl('', {cp_offset => new_offset, cp_limit => ctx.cp_limit}) %]">&laquo; [%
+                    l('Previous [_1]', ctx.cp_offset - new_offset) %]</a>
                 </td>
             [%- END %]
-            [%- IF copies.size >= ctx.copy_limit AND (ctx.copy_offset + ctx.copy_limit < total_copies) %]
+            [%- IF copies.size >= ctx.cp_limit AND (ctx.cp_offset + ctx.cp_limit < total_copies) %]
                 <td>
-                    <a href="[% mkurl('', {copy_offset => ctx.copy_offset + ctx.copy_limit, copy_limit => ctx.copy_limit}) %]">[%
-                    l('Next [_1]', ctx.copy_limit) %] &raquo;</a>
+                    <a href="[% mkurl('', {cp_offset => ctx.cp_offset + ctx.cp_limit, cp_limit => ctx.cp_limit}) %]">[%
+                    l('Next [_1]', ctx.cp_limit) %] &raquo;</a>
                 </td>
             [%- END %]
             </tr>
@@ -309,19 +309,19 @@ END; # FOREACH bib
 
         [% IF NOT serial_holdings -%]
             [%- more_copies_limit = 50 %] [%# TODO: config %]
-            [%- IF  ctx.copy_limit != more_copies_limit AND copies.size >= ctx.copy_limit AND ctx.copy_limit < total_copies %]
+            [%- IF  ctx.cp_limit != more_copies_limit AND copies.size >= ctx.cp_limit AND ctx.cp_limit < total_copies %]
                 <tr class="not_serial">
                     <td>
                         <div class="rdetail_show_copies">
-                            <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]"><i class="fas fa-plus-square"></i> [% l('Show more copies') %]</a>
+                            <a href="[% mkurl('', {cp_limit => more_copies_limit, cp_offset => 0}) %]"><i class="fas fa-plus-square"></i> [% l('Show more copies') %]</a>
                         </div>
                     </td>
                 </tr>
-            [%- ELSIF ctx.copy_limit == more_copies_limit %]
+            [%- ELSIF ctx.cp_limit == more_copies_limit %]
                 <tr class="not_serial">
                     <td>
                         <div  class="rdetail_show_copies">
-                            <a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]"><i class="fas fa-minus-square"></i> [% l('Show fewer copies') %]</a>
+                            <a href="[% mkurl('', {cp_limit => 0, cp_offset => 0}) %]"><i class="fas fa-minus-square"></i> [% l('Show fewer copies') %]</a>
                         </div>
                     </td>
                 </tr>
index 8d4d810..670334e 100755 (executable)
@@ -425,7 +425,7 @@ ctx.metalinks.push('
                 [%- END %]
                 [% IF !ctx.is_staff %]
                 
-                    <a href="[% mkurl('', {locg =>CGI.param('locg'), copy_depth =>CGI.param('copy_depth')}, 1) %]"
+                    <a href="[% mkurl('', {locg =>CGI.param('locg'), cp_depth =>CGI.param('cp_depth')}, 1) %]"
                         class="btn btn-action" role="button">
                         <i class="fas fa-link" aria-hidden="true"></i>
                         [% l('Permalink') %]
index 7c958d1..d57f37a 100755 (executable)
@@ -28,7 +28,7 @@
                     <a href="[% ctx.origin %]">[% l('Return to record') %]</a>
                     <div class="sms_text"><pre>[% ctx.event.template_output.data %]</pre></div>
                         <form method="post">
-                                <input type="hidden" name="copy_id" value="[% ctx.copy_id %]"/>
+                                <input type="hidden" name="cp_id" value="[% ctx.cp_id %]"/>
                                 <input type="hidden" name="origin" value="[% ctx.origin %]"/>
                                 [% INCLUDE "opac/parts/sms_carrier_selector.tt2" sms_carrier_hide_warning="true" %]<br/>
                                 [% INCLUDE "opac/parts/sms_number_textbox.tt2" %]<br/>
index d89f819..25fa76c 100644 (file)
@@ -1,5 +1,5 @@
 <div class="breadcrumb">
-    [% clear_params = ['action', 'hold', 'pickup_lib', 'ac', 'copy_limit', 'copy_offset', 'list'] %]
+    [% clear_params = ['action', 'hold', 'pickup_lib', 'ac', 'cp_limit', 'cp_offset', 'list'] %]
 
     <!-- home page -->
     <a href="[% mkurl(ctx.kpac_root _ '/home', {}, ['trail', 'page']) %]" 
index 7427220..227f46b 100644 (file)
@@ -54,27 +54,27 @@ END;
         <tr>
 
             <td>
-            [%- IF ctx.copy_offset > 0;
-                new_offset = ctx.copy_offset - ctx.copy_limit;
+            [%- IF ctx.cp_offset > 0;
+                new_offset = ctx.cp_offset - ctx.cp_limit;
                 IF new_offset < 0; new_offset = 0; END %]
-                    <a href="[% mkurl('', {copy_offset => new_offset, copy_limit => ctx.copy_limit}) %]">&laquo; [%
-                        l('Previous [_1]', ctx.copy_offset - new_offset) %]</a>
+                    <a href="[% mkurl('', {cp_offset => new_offset, cp_limit => ctx.cp_limit}) %]">&laquo; [%
+                        l('Previous [_1]', ctx.cp_offset - new_offset) %]</a>
             [%- END %]
             </td>
 
             <td>
-            [%- IF ctx.copies.size >= ctx.copy_limit %]
-                    <a href="[% mkurl('', {copy_offset => ctx.copy_offset + ctx.copy_limit, copy_limit => ctx.copy_limit}) %]">[%
-                        l('Next [_1]', ctx.copy_limit) %] &raquo;</a>
+            [%- IF ctx.copies.size >= ctx.cp_limit %]
+                    <a href="[% mkurl('', {cp_offset => ctx.cp_offset + ctx.cp_limit, cp_limit => ctx.cp_limit}) %]">[%
+                        l('Next [_1]', ctx.cp_limit) %] &raquo;</a>
             [%- END %]
             </td>
 
             [%- more_copies_limit = 50 %] [%# TODO: config %]
             <td>
-            [%- IF  ctx.copy_limit != more_copies_limit AND ctx.copies.size >= ctx.copy_limit %]
-                <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]">[% l('Show more copies') %]</a>
-            [%- ELSIF ctx.copy_limit == more_copies_limit %]
-                <a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]">[% l('Show fewer copies') %]</a>
+            [%- IF  ctx.cp_limit != more_copies_limit AND ctx.copies.size >= ctx.cp_limit %]
+                <a href="[% mkurl('', {cp_limit => more_copies_limit, cp_offset => 0}) %]">[% l('Show more copies') %]</a>
+            [%- ELSIF ctx.cp_limit == more_copies_limit %]
+                <a href="[% mkurl('', {cp_limit => 0, cp_offset => 0}) %]">[% l('Show fewer copies') %]</a>
             [%- END %]
             </td>
         </tr>
index 2801670..e1fe0df 100644 (file)
@@ -1,7 +1,7 @@
 [%-  attrs = {marc_xml => ctx.marc_xml};
     PROCESS "opac/parts/misc_util.tt2";
     PROCESS get_marc_attrs args=attrs;
-    stop_parms = ['expand','cnoffset','copy_offset','copy_limit'];
+    stop_parms = ['expand','cnoffset','cp_offset','cp_limit'];
     ctx.record_attrs = attrs; # capture for JS
     ctx.metalinks.push('<meta property="og:type" content="http://schema.org/' _ args.schema.itemtype _ '" />');
 %]
index e6e783f..e5a420f 100644 (file)
@@ -21,8 +21,8 @@
     <li>
     [% l('[_1] of [quant,_2,copy,copies] available at [_3].', ou_avail, ou_count, ou_name) | html %]
     [%- this_depth = ctx.get_aou(ou_id).ou_type.depth;
-        IF ou_count > 0 && this_depth != ctx.copy_depth %]
-    <a href="[% mkurl('', {copy_depth => this_depth}, ['copy_offset']); %]"
+        IF ou_count > 0 && this_depth != ctx.cp_depth %]
+    <a href="[% mkurl('', {cp_depth => this_depth}, ['cp_offset']); %]"
        title="[% l('Show copies at [_1]', ou_name) | html; %]">
        [%- l('(Show)'); %]</a>
     [%- END; %]
@@ -42,7 +42,7 @@
             attrs.plib_copy_counts.$depth.available,
             attrs.plib_copy_counts.$depth.count,
             ou_name) | html
-    %] <a href="[% mkurl('', {locg => ou_id}, ['copy_offset']); %]"
+    %] <a href="[% mkurl('', {locg => ou_id}, ['cp_offset']); %]"
        title="[% l('Show copies at [_1]', ou_name) | html; %]">[%
        l('(Show preferred library)');
     %]</a></li>
index 8d8693d..61f654b 100644 (file)
@@ -27,7 +27,7 @@ END;
 -%]
 [%-
 IF has_copies or ctx.foreign_copies;
-  depth = CGI.param('copy_depth').defined ? CGI.param('copy_depth') : CGI.param('depth').defined ? CGI.param('depth') : ctx.copy_summary.last.depth;
+  depth = CGI.param('cp_depth').defined ? CGI.param('cp_depth') : CGI.param('depth').defined ? CGI.param('depth') : ctx.copy_summary.last.depth;
   total_copies = ctx.copy_summary.$depth.count;
 %]
 [% use_courses = (ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1) ? 1 : 0 %]
@@ -115,7 +115,7 @@ END; # FOREACH bib
             </td>[% END %]
             <td><span property="sku">[% callnum | html %]</span> [% IF ctx.get_org_setting(CGI.param('loc') 
                 OR ctx.aou_tree.id, 'sms.enable') == 1 %](<a href="[% mkurl(ctx.opac_root _ '/sms_cn', 
-               {copy_id => copy_info.id}) %];rec=[%- ctx.bre_id -%]" rel="nofollow" vocab="">Text</a>)[% END %]</td>
+               {cp_id => copy_info.id}) %];rec=[%- ctx.bre_id -%]" rel="nofollow" vocab="">Text</a>)[% END %]</td>
             [%- IF has_parts == 'true' %]
             <td>[% copy_info.part_label | html %]</td>
             [%- END %]
@@ -137,7 +137,7 @@ END; # FOREACH bib
                         OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %]
                         <span> | </span>
                         <a href="javascript:;" 
-                            onclick="xulG.volume_item_creator({copy_id : [% copy_info.id %]})">
+                            onclick="xulG.volume_item_creator({cp_id : [% copy_info.id %]})">
                             [% l(' edit') %]
                         </a>
                     [% END %]
@@ -294,18 +294,18 @@ END; # FOREACH bib
 [%- END; # FOR copy_info
 %]
         <tr>
-        [%- IF ctx.copy_offset > 0 AND NOT serial_holdings;
-            new_offset = ctx.copy_offset - ctx.copy_limit;
+        [%- IF ctx.cp_offset > 0 AND NOT serial_holdings;
+            new_offset = ctx.cp_offset - ctx.cp_limit;
             IF new_offset < 0; new_offset = 0; END %]
             <td>
-                <a href="[% mkurl('', {copy_offset => new_offset, copy_limit => ctx.copy_limit}) %]">&laquo; [%
-                    l('Previous [_1]', ctx.copy_offset - new_offset) %]</a>
+                <a href="[% mkurl('', {cp_offset => new_offset, cp_limit => ctx.cp_limit}) %]">&laquo; [%
+                    l('Previous [_1]', ctx.cp_offset - new_offset) %]</a>
             </td>
         [%- END %]
-        [%- IF copies.size >= ctx.copy_limit AND NOT serial_holdings AND (ctx.copy_offset + ctx.copy_limit < total_copies) %]
+        [%- IF copies.size >= ctx.cp_limit AND NOT serial_holdings AND (ctx.cp_offset + ctx.cp_limit < total_copies) %]
             <td>
-                <a href="[% mkurl('', {copy_offset => ctx.copy_offset + ctx.copy_limit, copy_limit => ctx.copy_limit}) %]">[%
-                    l('Next [_1]', ctx.copy_limit) %] &raquo;</a>
+                <a href="[% mkurl('', {cp_offset => ctx.cp_offset + ctx.cp_limit, cp_limit => ctx.cp_limit}) %]">[%
+                    l('Next [_1]', ctx.cp_limit) %] &raquo;</a>
             </td>
         [%- END %]
         </tr>
@@ -313,15 +313,15 @@ END; # FOREACH bib
         <tr>
             <td>
                 [%- more_copies_limit = 50 %] [%# TODO: config %]
-                [%- IF  ctx.copy_limit != more_copies_limit AND copies.size >= ctx.copy_limit AND ctx.copy_limit < total_copies %]
+                [%- IF  ctx.cp_limit != more_copies_limit AND copies.size >= ctx.cp_limit AND ctx.cp_limit < total_copies %]
                     <div class="rdetail_show_copies">
                         <img src="[% ctx.media_prefix %]/images/plus_sign.png[% ctx.cache_key %]" alt="[% l('Show more copies icon') %]"/>
-                        <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]">[% l('Show more copies') %]</a>
+                        <a href="[% mkurl('', {cp_limit => more_copies_limit, cp_offset => 0}) %]">[% l('Show more copies') %]</a>
                     </div>
-                [%- ELSIF ctx.copy_limit == more_copies_limit %]
+                [%- ELSIF ctx.cp_limit == more_copies_limit %]
                     <div  class="rdetail_show_copies">
                         <img src="[% ctx.media_prefix %]/images/minus_sign.png[% ctx.cache_key %]" alt="[% l('Show fewer copies icon') %]"/>
-                        <a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]">[% l('Show fewer copies') %]</a>
+                        <a href="[% mkurl('', {cp_limit => 0, cp_offset => 0}) %]">[% l('Show fewer copies') %]</a>
                     </div>
                 [%- END %]
             </td>
index be248ab..89656bb 100644 (file)
                 [%- END %]
             [% IF !ctx.is_staff %]
                 <div class="rdetail_aux_utils share_record">
-                    <a href="[% mkurl('', {locg =>CGI.param('locg'), copy_depth =>CGI.param('copy_depth')}, 1) %]" class="no-dec">
+                    <a href="[% mkurl('', {locg =>CGI.param('locg'), cp_depth =>CGI.param('cp_depth')}, 1) %]" class="no-dec">
                          <img src="[% ctx.media_prefix %]/images/link.png[% ctx.cache_key %]" alt="[% l('Permalink') %]" />
                          [% l('Permalink') %]
                     </a>
index 7c958d1..d57f37a 100644 (file)
@@ -28,7 +28,7 @@
                     <a href="[% ctx.origin %]">[% l('Return to record') %]</a>
                     <div class="sms_text"><pre>[% ctx.event.template_output.data %]</pre></div>
                         <form method="post">
-                                <input type="hidden" name="copy_id" value="[% ctx.copy_id %]"/>
+                                <input type="hidden" name="cp_id" value="[% ctx.cp_id %]"/>
                                 <input type="hidden" name="origin" value="[% ctx.origin %]"/>
                                 [% INCLUDE "opac/parts/sms_carrier_selector.tt2" sms_carrier_hide_warning="true" %]<br/>
                                 [% INCLUDE "opac/parts/sms_number_textbox.tt2" %]<br/>