<<

NAME

C4::VirtualShelves - Functions for manipulating Koha virtual virtualshelves

SYNOPSIS

  use C4::VirtualShelves;

DESCRIPTION

This module provides functions for manipulating virtual virtualshelves, including creating and deleting virtualshelves, and adding and removing items to and from virtualshelves.

FUNCTIONS

GetShelves
  $shelflist = &GetShelves($owner, $mincategory);
  ($shelfnumber, $shelfhash) = each %{$shelflist};

Looks up the virtual virtualshelves, and returns a summary. $shelflist is a reference-to-hash. The keys are the virtualshelves numbers ($shelfnumber, above), and the values ($shelfhash, above) are themselves references-to-hash, with the following keys:

mincategory : 2 if the list is for "look". 3 if the list is for "Select virtualshelves for adding a virtual". virtualshelves of the owner are always selected, whatever the category

$shelfhash->{shelfname}

A string. The name of the shelf.

$shelfhash->{count}

The number of virtuals on that virtualshelves.

GetShelf
  (shelfnumber,shelfname,owner,category) = &GetShelf($shelfnumber);

Looks up information about the contents of virtual virtualshelves number $shelfnumber

Returns the database's information on 'virtualshelves' table.

GetShelfContents
  $itemlist = &GetShelfContents($shelfnumber);

Looks up information about the contents of virtual virtualshelves number $shelfnumber. Sorted by a field in the biblio table. copyrightdate gives a desc sort.

Returns a reference-to-array, whose elements are references-to-hash, as returned by C4::Biblio::GetBiblioFromItemNumber.

AddShelf
  $shelfnumber = &AddShelf( $shelfname, $owner, $category);

Creates a new virtual virtualshelves with name $shelfname, owner $owner and category $category.

Returns a code to know what's happen. * -1 : if this virtualshelves already exist. * $shelfnumber : if success.

AddToShelf
  &AddToShelf($biblionumber, $shelfnumber);

Adds item number $biblionumber to virtual virtualshelves number $shelfnumber, unless that item is already on that shelf.

AddToShelfFromBiblio
    &AddToShelfFromBiblio($biblionumber, $shelfnumber)

    this function allow to add a virtual into the shelf number $shelfnumber
    from biblionumber.
ModShelf

ModShelf($shelfnumber, $shelfname, $owner, $category )

Modify the value into virtualshelves table with values given on input arg.

DelShelf
  ($status) = &DelShelf($shelfnumber);

Deletes virtual virtualshelves number $shelfnumber. The virtualshelves must be empty.

Returns a two-element array, where $status is 0 if the operation was successful, or non-zero otherwise. $msg is "Done" in case of success, or an error message giving the reason for failure.

ShelfPossibleAction

ShelfPossibleAction($loggedinuser, $shelfnumber, $action);

$loggedinuser,$shelfnumber,$action

$action can be "view" or "manage".

Returns 1 if the user can do the $action in the $shelfnumber shelf. Returns 0 otherwise.

DelFromShelf
  &DelFromShelf( $biblionumber, $shelfnumber);

Removes item number $biblionumber from virtual virtualshelves number $shelfnumber. If the item wasn't on that virtualshelves to begin with, nothing happens.

DelShelf

  $Number = DelShelf($shelfnumber);

    this function delete the shelf number, and all of it's content

AUTHOR

Koha Developement team <info@koha.org>

SEE ALSO

C4::Circulation::Circ2(3)

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 378:

You forgot a '=back' before '=head2'

Around line 400:

=back without =over

<<