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.
$course_item = GetCourseItem( itemnumber => $itemnumber [, ci_id => $ci_id );
ModCourseItem( %params ); Creates or modifies an existing course item.
my $ci_id = _AddCourseItem( %params );
_UpdateCourseItem( %params );
_ModStoredFields( %params ); Updates the values for the 'original' fields in course_items for a given ci_id
_RevertFields( ci_id => $ci_id, fields => \@fields_to_revert );
_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 ); For a given item, 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 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>