C4::CourseReserves - Koha course reserves module
use C4::CourseReserves;
This module deals with course reserves.
$course = GetCourse( $course_id );
ModCourse( [ course_id => $id ] [, course_name => $course_name ] [etc...] );
@courses = GetCourses( [ fieldname => $value ] [, fieldname2 => $value2 ] [etc...] );
DelCourse( $course_id );
EnableOrDisableCourseItems( course_id => $course_id, enabled => $enabled ); For each item on reserve for this course, if the course item has no active course reserves, swap the fields for the item to make it 'normal' again. enabled => 'yes' to enable course items enabled => 'no' to disable course items
EnableOrDisableCourseItem( ci_id => $ci_id );
@$borrowers = GetCourseInstructors( $course_id );
ModCourseInstructors( mode => $mode, course_id => $course_id, [ cardnumbers => $cardnumbers ] OR [ borrowernumbers => $borrowernumbers ); $mode can be 'replace', 'add', or 'delete' $cardnumbers and $borrowernumbers are both references to arrays Use either cardnumbers or borrowernumber, but not both.
Given one of biblionumber, itenumber, or ci_id, returns hashref of the course_items values $course_item = GetCourseItem( itemnumber => $itemnumber [, ci_id => $ci_id ] ); $course_item = GetCourseItem( biblionumber => $biblionumber [, ci_id => $ci_id ]); $course_item = GetCourseItem( ci_id => $ci_id );
ModCourseItem( %params ); Creates or modifies an existing course item. Must be passed either an itemnumber or biblionumber parameter
my $ci_id = _AddCourseItem( %params );
_UpdateCourseItem( %params );
_RevertFields( ci_id => $ci_id, fields => \@fields_to_revert ); Copies fields from course item storage back to the actual item
_SwapAllFields( $ci_id );
$course_items = GetCourseItems( [course_id => $course_id] [, itemnumber => $itemnumber ] );
DelCourseItem( ci_id => $cr_id );
$course_item = GetCourseReserve( %params );
$id = ModCourseReserve( %params );
$course_reserves = GetCourseReserves( %params ); Required: course_id OR ci_id Optional: include_items => 1, include_count => 1, include_courses => 1,
DelCourseReserve( cr_id => $cr_id );
my $arrayref = GetItemCourseReservesInfo( itemnumber => $itemnumber ); my $arrayref = GetItemCourseReservesInfo( biblionumber => $biblionumber ); For a given itemnumber or biblionumber, returns an arrayref of reserves hashrefs, with a course hashref under the key 'course'
$bool = CountCourseReservesForItem( %params ); ci_id - course_item id OR itemnumber - course_item itemnumber OR biblionumber - course_item biblionumber enabled = 'yes' or 'no' Optional, if not supplied, counts reserves for both enabled and disabled courses
my $courses = SearchCourses( term => $search_term, enabled => 'yes' );
Kyle M Hall <kyle@bywatersolutions.com>