From d57b8287110f4605369840a8ff656c98094d6844 Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Wed, 26 Aug 2020 11:22:22 -0700 Subject: [PATCH] LP1849212: Consult physical_loc to determine if an ou is using course materials module Signed-off-by: Jane Sandberg Signed-off-by: Michele Morgan Signed-off-by: Galen Charlton --- Open-ILS/src/templates/opac/advanced.tt2 | 2 +- Open-ILS/src/templates/opac/browse.tt2 | 2 +- Open-ILS/src/templates/opac/parts/record/copy_table.tt2 | 13 +++++++------ Open-ILS/src/templates/opac/parts/result/table.tt2 | 2 +- Open-ILS/src/templates/opac/parts/searchbar.tt2 | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Open-ILS/src/templates/opac/advanced.tt2 b/Open-ILS/src/templates/opac/advanced.tt2 index b4be00391b..c7e36b046f 100644 --- a/Open-ILS/src/templates/opac/advanced.tt2 +++ b/Open-ILS/src/templates/opac/advanced.tt2 @@ -16,7 +16,7 @@ [% l('Browse the Catalog')%] - [% IF ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %] + [% IF ctx.get_org_setting(ctx.physical_loc || ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %] [% l('Search for Courses') %] [% l('Browse for Courses') %] [% END %] diff --git a/Open-ILS/src/templates/opac/browse.tt2 b/Open-ILS/src/templates/opac/browse.tt2 index cb60e3f14d..92ac176fa6 100644 --- a/Open-ILS/src/templates/opac/browse.tt2 +++ b/Open-ILS/src/templates/opac/browse.tt2 @@ -37,7 +37,7 @@ id="home_adv_search_link">[%l('Advanced Search')%] [% l('Browse the Catalog') %] - [% IF ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %] + [% IF ctx.get_org_setting(ctx.physical_loc || ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %] [% l('Search for Courses') %] [% l('Browse for Courses') %] 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 48d9c0da0b..7db16c68f3 100644 --- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 @@ -30,6 +30,7 @@ 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; 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 %] @@ -44,7 +45,7 @@ IF has_copies or ctx.foreign_copies; [%- END %] - [% IF ctx.is_staff || ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %] + [% IF ctx.is_staff || use_courses %] [% END %] [% IF ctx.is_staff %] @@ -56,7 +57,7 @@ IF has_copies or ctx.foreign_copies; [%- END %] - [%- IF ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %] + [%- IF use_courses %] [%- END %] @@ -80,8 +81,8 @@ IF has_copies or ctx.foreign_copies; - [%- IF ctx.get_org_setting(CGI.param('loc') - OR ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %] + [%- IF ctx.get_org_setting(CGI.param('loc')) + OR use_courses %] [%- END %] @@ -150,7 +151,7 @@ END; # FOREACH bib [% IF copy_info.courses.size > 0 || ctx.is_staff %] - [% ELSIF ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %] + [% ELSIF use_courses %] [% END %] [% IF ctx.is_staff %] @@ -237,7 +238,7 @@ END; # FOREACH bib ELSE; '-'; END %] - [%- IF ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %] + [%- IF use_courses %] diff --git a/Open-ILS/src/templates/opac/parts/result/table.tt2 b/Open-ILS/src/templates/opac/parts/result/table.tt2 index 237b8d4bad..c9436f9bed 100644 --- a/Open-ILS/src/templates/opac/parts/result/table.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/table.tt2 @@ -405,7 +405,7 @@ END; [% UNLESS rec.mmr_id; PROCESS "opac/parts/result/copy_counts.tt2"; END; %] - [%- IF ctx.get_org_setting(ctx.search_ou, 'circ.course_materials_opt_in') == 1 %] + [%- IF ctx.get_org_setting(ctx.physical_loc || ctx.search_ou, 'circ.course_materials_opt_in') == 1 %] [%- courseStrings = [] %] [% FOREACH course IN rec.courses %] [% courseString = course.name _ ' (' _ course.course_number _ ')' %] diff --git a/Open-ILS/src/templates/opac/parts/searchbar.tt2 b/Open-ILS/src/templates/opac/parts/searchbar.tt2 index 35034f3279..f9fb92beac 100644 --- a/Open-ILS/src/templates/opac/parts/searchbar.tt2 +++ b/Open-ILS/src/templates/opac/parts/searchbar.tt2 @@ -44,7 +44,7 @@ END; [% l('Advanced Search') %][% l('Browse the Catalog') %] - [% IF ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %] + [% IF ctx.get_org_setting(ctx.physical_loc || ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %] [% l('Search for Courses') %][% l('Browse for Courses') %] [% END %] -- 2.11.0
[% l("Barcode") %] [% l("Shelving Location") %][% l("Circulation Modifier") %][% l("Status") %] [% l("Due Date") %][% l("Courses") %]
[% bib.target_copy.location.name | html %] [% bib.target_copy.status.name | html %] [% date.format(ctx.parse_datetime(copy_info.due_date, copy_info.circ_circ_lib),DATE_FORMAT) %]
[% copy_info.circ_modifier | html %][%- FOREACH course IN copy_info.courses %]
[% course.course_number %]
[% END %]