C4::Suggestions - Some useful functions for dealings with aqorders.
The functions in this module deal with the aqorders 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 aqorders of a borrower can be seen by the borrower itself. Suggestions done by other borrowers can be seen when not "AVAILABLE"
(\@array) = &SearchSuggestion($suggestionhashref_to_search)
searches for a suggestion
\@array : the aqorders 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.
\%sth = &GetSuggestion($ordernumber)
this function get the detail of the suggestion $ordernumber (input arg)
return : the result of the SQL query as a hash : $sth->fetchrow_hashref.
$ordernumber = &GetSuggestionFromBiblionumber($biblionumber)
Get a suggestion from it's biblionumber.
return : the id of the suggestion which is related to the biblionumber given on input args.
Get a suggestion and borrower's informations from it's biblionumber.
return : all informations (suggestion and borrower) of the suggestion which is related to the biblionumber given.
Get a suggestion and borrower's informations from it's suggestionid
return : all informations (suggestion and borrower) of the suggestion which is related to the suggestionid given.
$aqorders = &GetSuggestionByStatus($status,[$branchcode])
Get a suggestion from it's status
return : all the suggestion with
Count the number of aqorders with the status given on input argument. the arg status can be :
return : the number of suggestion with this status.
Insert a new suggestion on database with value given on input arg.
Modify the suggestion according to the hash passed by ref. The hash HAS to contain suggestionid Data not defined is not updated unless it is a note or sort1 Send a mail to notify the user that did the suggestion.
Note that there is no function to modify a suggestion.
connect a suggestion to an existing biblio
Delete a suggestion. A borrower can delete a suggestion only if he is its owner.
Delete all suggestions older than TODAY-$days , that have be accepted or rejected.
Koha Development Team <http://koha-community.org/>