Bugzilla – Attachment 192861 Details for
Bug 35972
Add a 'Research tables' feature, that builds upon Course reserves
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35972: Add course_type support to staff interface
a525359.patch (text/plain), 6.85 KB, created by
Martin Renvoize (ashimema)
on 2026-02-10 11:29:24 UTC
(
hide
)
Description:
Bug 35972: Add course_type support to staff interface
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-02-10 11:29:24 UTC
Size:
6.85 KB
patch
obsolete
>From a52535991eb7491e952dd140c63707e7a1a656b8 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >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 @@ > <div class="rows"> > <ol> > <li><span class="label">Course name: </span> [% course.course_name | html %]</li> >+ [% IF ( course.course_type ) %] >+ <li> >+ <span class="label">Type: </span> >+ [% AuthorisedValues.GetByCode( 'CR_TYPE', course.course_type ) | html %] >+ </li> >+ [% END %] > [% IF ( course.term ) %] > <li> > <span class="label">[% tp('Semester', 'Term') | html %]: </span> >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 @@ > <thead> > <tr> > <th>Name</th> >+ <th>Type</th> > <th>Dept.</th> > <th>Course #</th> > <th>Section</th> >@@ -65,6 +66,7 @@ > [% FOREACH c IN courses %] > <tr> > <td><a href="course-details.pl?course_id=[% c.course_id | uri %]">[% c.course_name | html %][%- IF c.section -%]- [% c.section | html %][%- END -%]</a></td> >+ <td>[% AuthorisedValues.GetByCode( 'CR_TYPE', c.course_type ) | html %]</td> > <td>[% AuthorisedValues.GetByCode( 'DEPARTMENT', c.department ) | html %]</td> > <td>[% c.course_number | html %]</td> > <td>[% c.section | html %]</td> >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 @@ > <fieldset class="rows"> > <legend>[% IF course_id %]Edit course[% ELSE %]Create course[% END %]</legend> > <ol> >+ <li> >+ <label class="required" for="course_type">Type:</label> >+ <select id="course_type" name="course_type" required="required" class="required"> >+ <option value="">Select a type</option> >+ >+ [% FOREACH ct IN course_types %] >+ [% IF ct.authorised_value == course_type %] >+ <option value="[% ct.authorised_value | html %]" selected="selected">[% ct.lib | html %]</option> >+ [% ELSE %] >+ <option value="[% ct.authorised_value | html %]">[% ct.lib | html %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ <span class="required">Required</span> >+ </li> >+ > <li> > <label class="required" for="department">Department:</label> > <select id="department" name="department" required="required" class="required"> >-- >2.53.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35972
:
161714
|
161802
|
161803
|
192856
|
192857
|
192858
|
192859
|
192860
| 192861