From a52535991eb7491e952dd140c63707e7a1a656b8 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 10 Feb 2026 09:30:01 +0000 Subject: [PATCH] Bug 35972: Add course_type support to staff interface This patch adds course type selection and display to the staff interface for course reserves management. Changes to course scripts: 1. course.pl: - Pass course_types authorized values to template - Similar to existing departments and terms 2. mod_course.pl: - Capture course_type parameter from form submission - Default to 'COURSE' if not specified - Pass to ModCourse for database update Changes to staff templates: 1. course.tt (course creation/edit form): - Added course_type dropdown as first field (required) - Populates from CR_TYPE authorized values - Uses lib field for staff interface display text - Pre-selects current value when editing 2. course-reserves.tt (course listing): - Added "Type" column to course table - Displays course_type using AuthorisedValues.GetByCode - Positioned between "Name" and "Dept." columns 3. course-details.tt (course details view): - Added course type display in course information - Shows after course name, before term - Uses lib field from CR_TYPE authorized values Benefits for staff: - Clear indication of course type (regular, research table, on display) - Ability to filter/sort courses by type in listing - Easy selection when creating new courses - Consistent terminology via authorized values This completes the course_type implementation across both staff and OPAC interfaces, providing a unified flexible system for managing different types of course displays. --- course_reserves/course.pl | 5 +++-- course_reserves/mod_course.pl | 1 + .../en/modules/course_reserves/course-details.tt | 6 ++++++ .../modules/course_reserves/course-reserves.tt | 2 ++ .../prog/en/modules/course_reserves/course.tt | 16 ++++++++++++++++ 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/course_reserves/course.pl b/course_reserves/course.pl index 2ed9814a4e4..e884b4dbf55 100755 --- a/course_reserves/course.pl +++ b/course_reserves/course.pl @@ -47,8 +47,9 @@ if ($course_id) { } $template->param( - departments => GetAuthorisedValues('DEPARTMENT'), - terms => GetAuthorisedValues('TERM'), + departments => GetAuthorisedValues('DEPARTMENT'), + terms => GetAuthorisedValues('TERM'), + course_types => GetAuthorisedValues('CR_TYPE'), ); output_html_with_http_headers $cgi, $cookie, $template->output; diff --git a/course_reserves/mod_course.pl b/course_reserves/mod_course.pl index db54c72094c..4f4c229d410 100755 --- a/course_reserves/mod_course.pl +++ b/course_reserves/mod_course.pl @@ -41,6 +41,7 @@ if ( $op eq 'cud-del' ) { my %params; $params{'course_id'} = $course_id; + $params{'course_type'} = $cgi->param('course_type') || 'COURSE'; $params{'department'} = $cgi->param('department'); $params{'course_number'} = $cgi->param('course_number'); $params{'section'} = $cgi->param('section'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt index f0002c63139..417f27c5246 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt @@ -94,6 +94,12 @@
  1. Course name: [% course.course_name | html %]
  2. + [% IF ( course.course_type ) %] +
  3. + Type: + [% AuthorisedValues.GetByCode( 'CR_TYPE', course.course_type ) | html %] +
  4. + [% END %] [% IF ( course.term ) %]
  5. [% tp('Semester', 'Term') | html %]: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt index a13e0f73ca5..158de347e2d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt @@ -49,6 +49,7 @@ Name + Type Dept. Course # Section @@ -65,6 +66,7 @@ [% FOREACH c IN courses %] [% c.course_name | html %][%- IF c.section -%]- [% c.section | html %][%- END -%] + [% AuthorisedValues.GetByCode( 'CR_TYPE', c.course_type ) | html %] [% AuthorisedValues.GetByCode( 'DEPARTMENT', c.department ) | html %] [% c.course_number | html %] [% c.section | html %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt index ac3202e5cf3..46c14cc03d6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt @@ -69,6 +69,22 @@
    [% IF course_id %]Edit course[% ELSE %]Create course[% END %]
      +
    1. + + + Required +
    2. +