<<

NAME

C4::Suggestions - Some useful functions for dealings with suggestions.

SYNOPSIS

use C4::Suggestions;

DESCRIPTION

The functions in this module deal with the suggestions in OPAC and in librarian interface

A suggestion is done in the OPAC. It has the status "ASKED"

When a librarian manages the suggestion, he can set the status to "REJECTED" or "ACCEPTED".

When the book is ordered, the suggestion status becomes "ORDERED"

When a book is ordered and arrived in the library, the status becomes "AVAILABLE"

All suggestions of a borrower can be seen by the borrower itself. Suggestions done by other borrowers can be seen when not "AVAILABLE"

FUNCTIONS

SearchSuggestion

(\@array) = &SearchSuggestion($user,$author,$title,$publishercode,$status,$suggestedbyme,$branchcode)

searches for a suggestion

return : \@array : the suggestions found. Array of hash. Note the status is stored twice : * in the status field * as parameter ( for example ASKED => 1, or REJECTED => 1) . This is for template & translation purposes.

GetSuggestion

\%sth = &GetSuggestion($suggestionid)

this function get the detail of the suggestion $suggestionid (input arg)

return : the result of the SQL query as a hash : $sth->fetchrow_hashref.

GetSuggestionFromBiblionumber

$suggestionid = &GetSuggestionFromBiblionumber($dbh,$biblionumber)

Get a suggestion from it's biblionumber.

return : the id of the suggestion which is related to the biblionumber given on input args.

GetSuggestionByStatus

$suggestions = &GetSuggestionByStatus($status,[$branchcode])

Get a suggestion from it's status

return : all the suggestion with $status

CountSuggestion

&CountSuggestion($status)

Count the number of suggestions with the status given on input argument. the arg status can be :

return : the number of suggestion with this status.

NewSuggestion

&NewSuggestion($borrowernumber,$title,$author,$publishercode,$note,$copyrightdate,$volumedesc,$publicationyear,$place,$isbn,$biblionumber)

Insert a new suggestion on database with value given on input arg.

ModStatus

&ModStatus($suggestionid,$status,$managedby,$biblionumber)

Modify the status (status can be 'ASKED', 'ACCEPTED', 'REJECTED', 'ORDERED') and send a mail to notify the user that did the suggestion.

Note that there is no function to modify a suggestion : only the status can be modified, thus the name of the function.

ConnectSuggestionAndBiblio

&ConnectSuggestionAndBiblio($suggestionid,$biblionumber)

connect a suggestion to an existing biblio

DelSuggestion

&DelSuggestion($borrowernumber,$suggestionid)

Delete a suggestion. A borrower can delete a suggestion only if he is its owner.

AUTHOR

Koha Developement team <info@koha.org>

<<