- Add YAOUS to allow/disallow browsing by Instructor.
- Minor code cleanup
Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
Changes to be committed:
modified: Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Course.pm
modified: Open-ILS/src/sql/Pg/upgrade/XXXX.schema.course-materials-module.sql
modified: Open-ILS/src/templates/opac/course_browse.tt2
modified: Open-ILS/src/templates/opac/parts/course_search/qtype_selector.tt2
'usr',
'is_public'
]},
- # We need to support the chosen library as well...
+ # TODO: We need to support the chosen library as well...
"where" => {'+acmcu' => 'is_public'}
});
$results = $e->json_query({
'is_archived',
'owning_lib'
]},
- # "limit" => $limit,
"order_by" => {"acmc" => [$qtype]},
- # We need to support the chosen library as well...
+ # TODO: We need to support the chosen library as well...
"where" => {'-not' => {'+acmc' => 'is_archived'}}
});
}
'coust',
'description'
)
+), (
+ 'circ',
+ 'circ.course_materials_browse_by_instructor', 'bool',
+ oils_i18n_gettext(
+ 'circ.course_materials_browse_by_instructor',
+ 'Allow users to browse Courses by Instructor',
+ 'coust',
+ 'label'
+ ),
+ oils_i18n_gettext(
+ 'circ.course_materials_browse_by_instructor',
+ 'If enabled, the Org Unit will allow OPAC users to browse Courses by instructor name.'
+ 'coust',
+ 'description'
+ )
);
COMMIT;
lower_limit = 0;
depart_list = ['blimit', 'bterm', 'bpivot'];
ctx.metalinks.push('<meta name="robots" content="noindex,follow">');
-
%]
<h2 class="sr-only">[% l('Course Browse') %]</h2>
-[% query_types = [
+[% query_types = [
{value => "name", label => l("Title"), plural_label => l("Titles"), browse => 1},
- {value => "instructor", label => l("Instructor"), plural_label => l('Instructors'), browse => 1},
{value => "course_number", label => l("Course Number"), plural_label => l('Course Numbers'), browse => 1}
];
+
+IF ctx.get_org_setting(
+ CGI.param('locg'), 'circ.course_materials_browse_by_instructor');
+query_types.push({
+ value => "instructor",
+ label => l("Instructor"),
+ plural_label => l('Instructors'),
+ browse => 1},
+);
+END;
-%]
<select name="[% name || 'qtype' %]"[% IF id; ' id="'; id ; '"' ; END -%]
title="[% l('Select query type:') %]">