<<

NAME

C4::CourseReserves - Koha course reserves module

SYNOPSIS

use C4::CourseReserves;

DESCRIPTION

This module deals with course reserves.

FUNCTIONS

GetCourse

    $course = GetCourse( $course_id );

ModCourse

    ModCourse( [ course_id => $id ] [, course_name => $course_name ] [etc...] );

GetCourses

  @courses = GetCourses( [ fieldname => $value ] [, fieldname2 => $value2 ] [etc...] );

DelCourse

  DelCourse( $course_id );

EnableOrDisableCourseItems

  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

    EnableOrDisableCourseItem( ci_id => $ci_id );

GetCourseInstructors

    @$borrowers = GetCourseInstructors( $course_id );

ModCourseInstructors

    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.

GetCourseItem {

  $course_item = GetCourseItem( itemnumber => $itemnumber [, ci_id => $ci_id );

ModCourseItem {

  ModCourseItem( %params );

  Creates or modifies an existing course item.

_AddCourseItem

    my $ci_id = _AddCourseItem( %params );

_UpdateCourseItem

  _UpdateCourseItem( %params );

_ModStoredFields

    _ModStoredFields( %params );

    Updates the values for the 'original' fields in course_items
    for a given ci_id

_RevertFields

    _RevertFields( ci_id => $ci_id, fields => \@fields_to_revert );

_SwapAllFields

    _SwapAllFields( $ci_id );

GetCourseItems {

  $course_items = GetCourseItems(
      [course_id => $course_id]
      [, itemnumber => $itemnumber ]
  );

DelCourseItem {

  DelCourseItem( ci_id => $cr_id );

GetCourseReserve {

  $course_item = GetCourseReserve( %params );

ModCourseReserve

    $id = ModCourseReserve( %params );

GetCourseReserves {

  $course_reserves = GetCourseReserves( %params );

  Required:
      course_id OR ci_id
  Optional:
      include_items   => 1,
      include_count   => 1,
      include_courses => 1,

DelCourseReserve {

  DelCourseReserve( cr_id => $cr_id );

GetItemCourseReservesInfo

    my $arrayref = GetItemCourseReservesInfo( itemnumber => $itemnumber );

    For a given item, returns an arrayref of reserves hashrefs,
    with a course hashref under the key 'course'

CountCourseReservesForItem

    $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

SearchCourses

    my $courses = SearchCourses( term => $search_term, enabled => 'yes' );

AUTHOR

Kyle M Hall <kyle@bywatersolutions.com>

<<