|
Lines 53-60
BEGIN {
Link Here
|
| 53 |
|
53 |
|
| 54 |
GetItemsInCollection |
54 |
GetItemsInCollection |
| 55 |
|
55 |
|
| 56 |
GetCollections |
|
|
| 57 |
|
| 58 |
AddItemToCollection |
56 |
AddItemToCollection |
| 59 |
RemoveItemFromCollection |
57 |
RemoveItemFromCollection |
| 60 |
TransferCollection |
58 |
TransferCollection |
|
Lines 161-195
sub UpdateCollection {
Link Here
|
| 161 |
|
159 |
|
| 162 |
} |
160 |
} |
| 163 |
|
161 |
|
| 164 |
=head2 GetCollections |
|
|
| 165 |
|
| 166 |
$collections = GetCollections(); |
| 167 |
Returns data about all collections |
| 168 |
|
| 169 |
Output: |
| 170 |
On Success: |
| 171 |
$results: Reference to an array of associated arrays |
| 172 |
On Failure: |
| 173 |
$errorCode: Code for reason of failure, good for translating errors in templates |
| 174 |
$errorMessage: English description of error |
| 175 |
|
| 176 |
=cut |
| 177 |
|
| 178 |
sub GetCollections { |
| 179 |
|
| 180 |
my $dbh = C4::Context->dbh; |
| 181 |
|
| 182 |
my $sth = $dbh->prepare("SELECT * FROM collections"); |
| 183 |
$sth->execute() or return ( 1, $sth->errstr() ); |
| 184 |
|
| 185 |
my @results; |
| 186 |
while ( my $row = $sth->fetchrow_hashref ) { |
| 187 |
push( @results, $row ); |
| 188 |
} |
| 189 |
|
| 190 |
return \@results; |
| 191 |
} |
| 192 |
|
| 193 |
=head2 GetItemsInCollection |
162 |
=head2 GetItemsInCollection |
| 194 |
|
163 |
|
| 195 |
( $results, $success, $errorcode, $errormessage ) = GetItemsInCollection( $colId ); |
164 |
( $results, $success, $errorcode, $errormessage ) = GetItemsInCollection( $colId ); |