From ae8aeebd96b4d67e5bed2d8cbdf9c0e4ddc2b391 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Fri, 5 Mar 2021 16:44:09 -0500 Subject: [PATCH] Get rid of CGI params that start with "copy" because a preceding ampersand causes browsers to see a copyright symbol Signed-off-by: Mike Rylander --- .../perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm | 12 ++++----- .../perlmods/lib/OpenILS/WWW/EGCatLoader/SMS.pm | 4 +-- .../templates-bootstrap/opac/parts/record/body.tt2 | 2 +- .../opac/parts/record/copy_counts.tt2 | 6 ++--- .../opac/parts/record/copy_table.tt2 | 30 +++++++++++----------- .../opac/parts/record/summary.tt2 | 2 +- Open-ILS/src/templates-bootstrap/opac/sms_cn.tt2 | 2 +- Open-ILS/src/templates/kpac/parts/breadcrumb.tt2 | 2 +- Open-ILS/src/templates/kpac/parts/copy_table.tt2 | 22 ++++++++-------- Open-ILS/src/templates/opac/parts/record/body.tt2 | 2 +- .../templates/opac/parts/record/copy_counts.tt2 | 6 ++--- .../src/templates/opac/parts/record/copy_table.tt2 | 28 ++++++++++---------- .../src/templates/opac/parts/record/summary.tt2 | 2 +- Open-ILS/src/templates/opac/sms_cn.tt2 | 2 +- 14 files changed, 61 insertions(+), 61 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm index f5fada4808..a98380322d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm @@ -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; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/SMS.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/SMS.pm index 63c0503f35..c33c6dc465 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/SMS.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/SMS.pm @@ -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]; diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/record/body.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/record/body.tt2 index 081e1034b1..512aba8200 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/record/body.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/record/body.tt2 @@ -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(''); %] diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_counts.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_counts.tt2 index ab2aa74df6..104dfea2ff 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_counts.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_counts.tt2 @@ -22,8 +22,8 @@
  • [% 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 %] - 0 && this_depth != ctx.cp_depth %] + [%- l('(Show)'); %] [%- END; %] @@ -43,7 +43,7 @@ attrs.plib_copy_counts.$depth.available, attrs.plib_copy_counts.$depth.count, ou_name) | html - %] [% l('(Show preferred library)'); %]
  • diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2 index 034760c302..762c32c029 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2 @@ -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; %] @@ -111,7 +111,7 @@ END; # FOREACH bib [% END %] + {cp_id => copy_info.id}) %];rec=[%- ctx.bre_id -%]" rel="nofollow" vocab="">Text)[% END %] [%- IF has_parts == 'true' %] [%- END %] @@ -133,7 +133,7 @@ END; # FOREACH bib OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %] | + onclick="xulG.volume_item_creator({cp_id : [% copy_info.id %]})"> [% l(' edit') %] [% 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 %] - [%- 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 %] [%- 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) %] [%- END %] @@ -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 %] - [%- ELSIF ctx.copy_limit == more_copies_limit %] + [%- ELSIF ctx.cp_limit == more_copies_limit %] diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 index 8d4d810831..670334e8fa 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 @@ -425,7 +425,7 @@ ctx.metalinks.push(' [%- END %] [% IF !ctx.is_staff %] - [% l('Permalink') %] diff --git a/Open-ILS/src/templates-bootstrap/opac/sms_cn.tt2 b/Open-ILS/src/templates-bootstrap/opac/sms_cn.tt2 index 7c958d1939..d57f37a6e9 100755 --- a/Open-ILS/src/templates-bootstrap/opac/sms_cn.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/sms_cn.tt2 @@ -28,7 +28,7 @@ [% l('Return to record') %]
    [% ctx.event.template_output.data %]
    - + [% INCLUDE "opac/parts/sms_carrier_selector.tt2" sms_carrier_hide_warning="true" %]
    [% INCLUDE "opac/parts/sms_number_textbox.tt2" %]
    diff --git a/Open-ILS/src/templates/kpac/parts/breadcrumb.tt2 b/Open-ILS/src/templates/kpac/parts/breadcrumb.tt2 index d89f819b25..25fa76c84f 100644 --- a/Open-ILS/src/templates/kpac/parts/breadcrumb.tt2 +++ b/Open-ILS/src/templates/kpac/parts/breadcrumb.tt2 @@ -1,5 +1,5 @@ [%- more_copies_limit = 50 %] [%# TODO: config %] diff --git a/Open-ILS/src/templates/opac/parts/record/body.tt2 b/Open-ILS/src/templates/opac/parts/record/body.tt2 index 2801670de8..e1fe0df5a9 100644 --- a/Open-ILS/src/templates/opac/parts/record/body.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/body.tt2 @@ -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(''); %] diff --git a/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 index e6e783f244..e5a420fc4f 100644 --- a/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 @@ -21,8 +21,8 @@
  • [% 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 %] - 0 && this_depth != ctx.cp_depth %] + [%- l('(Show)'); %] [%- END; %] @@ -42,7 +42,7 @@ attrs.plib_copy_counts.$depth.available, attrs.plib_copy_counts.$depth.count, ou_name) | html - %] [% l('(Show preferred library)'); %]
  • diff --git a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 index 8d8693d260..61f654b54f 100644 --- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 @@ -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 [% END %] + {cp_id => copy_info.id}) %];rec=[%- ctx.bre_id -%]" rel="nofollow" vocab="">Text)[% END %] [%- IF has_parts == 'true' %] [%- END %] @@ -137,7 +137,7 @@ END; # FOREACH bib OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %] | + onclick="xulG.volume_item_creator({cp_id : [% copy_info.id %]})"> [% l(' edit') %] [% END %] @@ -294,18 +294,18 @@ END; # FOREACH bib [%- END; # FOR copy_info %] - [%- 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 %] [%- 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) %] [%- END %] @@ -313,15 +313,15 @@ END; # FOREACH bib diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2 index be248abe38..89656bbdf1 100644 --- a/Open-ILS/src/templates/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2 @@ -147,7 +147,7 @@ [%- END %] [% IF !ctx.is_staff %]
    [% callnum | html %] [% IF ctx.get_org_setting(CGI.param('loc') OR ctx.aou_tree.id, 'sms.enable') == 1 %](Text)[% END %][% copy_info.part_label | html %]
    - « [% - l('Previous [_1]', ctx.copy_offset - new_offset) %] + « [% + l('Previous [_1]', ctx.cp_offset - new_offset) %] - [% - l('Next [_1]', ctx.copy_limit) %] » + [% + l('Next [_1]', ctx.cp_limit) %] »
    - [%- 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 %] - « [% - l('Previous [_1]', ctx.copy_offset - new_offset) %] + « [% + l('Previous [_1]', ctx.cp_offset - new_offset) %] [%- END %] - [%- IF ctx.copies.size >= ctx.copy_limit %] - [% - l('Next [_1]', ctx.copy_limit) %] » + [%- IF ctx.copies.size >= ctx.cp_limit %] + [% + l('Next [_1]', ctx.cp_limit) %] » [%- END %] - [%- IF ctx.copy_limit != more_copies_limit AND ctx.copies.size >= ctx.copy_limit %] - [% l('Show more copies') %] - [%- ELSIF ctx.copy_limit == more_copies_limit %] - [% l('Show fewer copies') %] + [%- IF ctx.cp_limit != more_copies_limit AND ctx.copies.size >= ctx.cp_limit %] + [% l('Show more copies') %] + [%- ELSIF ctx.cp_limit == more_copies_limit %] + [% l('Show fewer copies') %] [%- END %]
    [% callnum | html %] [% IF ctx.get_org_setting(CGI.param('loc') OR ctx.aou_tree.id, 'sms.enable') == 1 %](Text)[% END %][% copy_info.part_label | html %]
    - « [% - l('Previous [_1]', ctx.copy_offset - new_offset) %] + « [% + l('Previous [_1]', ctx.cp_offset - new_offset) %] - [% - l('Next [_1]', ctx.copy_limit) %] » + [% + l('Next [_1]', ctx.cp_limit) %] »
    [%- 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 %] - [%- ELSIF ctx.copy_limit == more_copies_limit %] + [%- ELSIF ctx.cp_limit == more_copies_limit %] [%- END %]