Bugzilla – Attachment 169276 Details for
Bug 28762
Item status shows incorrectly on course-details.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28762: Use Koha::Course in course-details controller
Bug-28762-Use-KohaCourse-in-course-details-control.patch (text/plain), 1.90 KB, created by
Martin Renvoize
on 2024-07-22 12:30:41 UTC
(
hide
)
Description:
Bug 28762: Use Koha::Course in course-details controller
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2024-07-22 12:30:41 UTC
Size:
1.90 KB
patch
obsolete
>From ce8b145bfcd0013e615a16e2593a551a0e0a64c4 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 23 Sep 2021 19:06:43 +0100 >Subject: [PATCH] Bug 28762: Use Koha::Course in course-details controller > >This patch updates Koha::Course to include the 'instructors' relation >accessor and then update the course-details controller to use the >Koha::Course object and pass it to the template instead of building a >hash using GetCourse. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Course.pm | 22 ++++++++++++++++++++-- > course_reserves/course-details.pl | 2 +- > 2 files changed, 21 insertions(+), 3 deletions(-) > >diff --git a/Koha/Course.pm b/Koha/Course.pm >index 9ede81bd3ce..6b67a2b5928 100644 >--- a/Koha/Course.pm >+++ b/Koha/Course.pm >@@ -17,14 +17,32 @@ package Koha::Course; > > use Modern::Perl; > >- > use base qw(Koha::Object); > > =head1 NAME > > Koha::Course - Koha Course Object class > >-=head1 API >+=head2 Relations >+ >+=head3 instructors >+ >+ my $instructors = $course->instructors(); >+ >+Returns the related Koha::Patrons object containing the instructors for this course >+ >+=cut >+ >+sub instructors { >+ my ($self) = @_; >+ >+ my $instructors = Koha::Patrons->search( >+ { 'course_instructors.course_id' => $self->course_id }, >+ { join => 'course_instructors' } >+ ); >+ >+ return $instructors; >+} > > =head2 Internal methods > >diff --git a/course_reserves/course-details.pl b/course_reserves/course-details.pl >index b2ca9e8c878..e5c0c3c5b8d 100755 >--- a/course_reserves/course-details.pl >+++ b/course_reserves/course-details.pl >@@ -56,7 +56,7 @@ if ( $op eq 'cud-del_reserve' ) { > } > } > >-my $course = GetCourse($course_id); >+my $course = Koha::Courses->find($course_id); > my $course_reserves = GetCourseReserves( > course_id => $course_id, > include_items => 1, >-- >2.45.2
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 28762
:
123233
|
123234
|
123236
|
123237
|
124661
|
124666
|
124667
|
124668
|
124744
|
125220
|
125228
|
125229
|
125233
|
161563
|
161564
|
161565
|
161566
|
161567
|
161568
|
161569
|
161570
|
161571
|
161572
|
161573
|
161574
|
161584
|
161585
|
161586
|
161587
|
161588
|
161589
|
161590
|
161591
|
163310
|
163311
|
163312
|
163313
|
163314
|
163315
|
163316
|
163317
|
165843
|
165844
|
165845
|
165846
|
165847
|
165848
|
165849
|
165850
|
169172
|
169273
|
169274
|
169275
|
169276
|
169277
|
169278
|
169279
|
169280
|
169281
|
169311
|
169312
|
169313
|
169314
|
169354
|
169355
|
169356
|
169357
|
169358
|
169359
|
169360
|
169361
|
169362
|
169363
|
169364
|
169365
|
169366
|
169367
|
169393