<<

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 {

  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 {

  ModCourseItem( %params );

  Creates or modifies an existing course item. Must be passed either an itemnumber or biblionumber parameter

_AddCourseItem

    my $ci_id = _AddCourseItem( %params );

_UpdateCourseItem

  _UpdateCourseItem( %params );

_RevertFields

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

    Copies fields from course item storage back to the actual item

_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 );
    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'

CountCourseReservesForItem

    $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

SearchCourses

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

AUTHOR

Kyle M Hall <kyle@bywatersolutions.com>

<<