|
Lines 99-105
sub CreateCollection {
Link Here
|
| 99 |
$sth = $dbh->prepare("INSERT INTO collections ( colId, colTitle, colDesc ) |
99 |
$sth = $dbh->prepare("INSERT INTO collections ( colId, colTitle, colDesc ) |
| 100 |
VALUES ( NULL, ?, ? )"); |
100 |
VALUES ( NULL, ?, ? )"); |
| 101 |
$sth->execute( $title, $description ) or return ( 0, 3, $sth->errstr() ); |
101 |
$sth->execute( $title, $description ) or return ( 0, 3, $sth->errstr() ); |
| 102 |
$sth->finish; |
|
|
| 103 |
|
102 |
|
| 104 |
return 1; |
103 |
return 1; |
| 105 |
|
104 |
|
|
Lines 145-151
sub UpdateCollection {
Link Here
|
| 145 |
colTitle = ?, colDesc = ? |
144 |
colTitle = ?, colDesc = ? |
| 146 |
WHERE colId = ?"); |
145 |
WHERE colId = ?"); |
| 147 |
$sth->execute( $title, $description, $colId ) or return ( 0, 4, $sth->errstr() ); |
146 |
$sth->execute( $title, $description, $colId ) or return ( 0, 4, $sth->errstr() ); |
| 148 |
$sth->finish; |
|
|
| 149 |
|
147 |
|
| 150 |
return 1; |
148 |
return 1; |
| 151 |
|
149 |
|
|
Lines 180-186
sub DeleteCollection {
Link Here
|
| 180 |
|
178 |
|
| 181 |
$sth = $dbh->prepare("DELETE FROM collections WHERE colId = ?"); |
179 |
$sth = $dbh->prepare("DELETE FROM collections WHERE colId = ?"); |
| 182 |
$sth->execute( $colId ) or return ( 0, 4, $sth->errstr() ); |
180 |
$sth->execute( $colId ) or return ( 0, 4, $sth->errstr() ); |
| 183 |
$sth->finish; |
|
|
| 184 |
|
181 |
|
| 185 |
return 1; |
182 |
return 1; |
| 186 |
} |
183 |
} |
|
Lines 211-218
sub GetCollections {
Link Here
|
| 211 |
push( @results , $row ); |
208 |
push( @results , $row ); |
| 212 |
} |
209 |
} |
| 213 |
|
210 |
|
| 214 |
$sth->finish; |
|
|
| 215 |
|
| 216 |
return \@results; |
211 |
return \@results; |
| 217 |
} |
212 |
} |
| 218 |
|
213 |
|
|
Lines 259-266
sub GetItemsInCollection {
Link Here
|
| 259 |
push( @results , $row ); |
254 |
push( @results , $row ); |
| 260 |
} |
255 |
} |
| 261 |
|
256 |
|
| 262 |
$sth->finish; |
|
|
| 263 |
|
| 264 |
return \@results; |
257 |
return \@results; |
| 265 |
} |
258 |
} |
| 266 |
|
259 |
|
|
Lines 288-295
sub GetCollection {
Link Here
|
| 288 |
|
281 |
|
| 289 |
my $row = $sth->fetchrow_hashref; |
282 |
my $row = $sth->fetchrow_hashref; |
| 290 |
|
283 |
|
| 291 |
$sth->finish; |
|
|
| 292 |
|
| 293 |
return ( |
284 |
return ( |
| 294 |
$$row{'colId'}, |
285 |
$$row{'colId'}, |
| 295 |
$$row{'colTitle'}, |
286 |
$$row{'colTitle'}, |
|
Lines 338-344
sub AddItemToCollection {
Link Here
|
| 338 |
$sth = $dbh->prepare("INSERT INTO collections_tracking ( ctId, colId, itemnumber ) |
329 |
$sth = $dbh->prepare("INSERT INTO collections_tracking ( ctId, colId, itemnumber ) |
| 339 |
VALUES ( NULL, ?, ? )"); |
330 |
VALUES ( NULL, ?, ? )"); |
| 340 |
$sth->execute( $colId, $itemnumber ) or return ( 0, 3, $sth->errstr() ); |
331 |
$sth->execute( $colId, $itemnumber ) or return ( 0, 3, $sth->errstr() ); |
| 341 |
$sth->finish; |
|
|
| 342 |
|
332 |
|
| 343 |
return 1; |
333 |
return 1; |
| 344 |
|
334 |
|
|
Lines 379-385
sub RemoveItemFromCollection {
Link Here
|
| 379 |
$sth = $dbh->prepare("DELETE FROM collections_tracking |
369 |
$sth = $dbh->prepare("DELETE FROM collections_tracking |
| 380 |
WHERE itemnumber = ?"); |
370 |
WHERE itemnumber = ?"); |
| 381 |
$sth->execute( $itemnumber ) or return ( 0, 3, $sth->errstr() ); |
371 |
$sth->execute( $itemnumber ) or return ( 0, 3, $sth->errstr() ); |
| 382 |
$sth->finish; |
|
|
| 383 |
|
372 |
|
| 384 |
return 1; |
373 |
return 1; |
| 385 |
} |
374 |
} |
|
Lines 420-426
sub TransferCollection {
Link Here
|
| 420 |
colBranchcode = ? |
409 |
colBranchcode = ? |
| 421 |
WHERE colId = ?"); |
410 |
WHERE colId = ?"); |
| 422 |
$sth->execute( $colBranchcode, $colId ) or return ( 0, 4, $sth->errstr() ); |
411 |
$sth->execute( $colBranchcode, $colId ) or return ( 0, 4, $sth->errstr() ); |
| 423 |
$sth->finish; |
|
|
| 424 |
|
412 |
|
| 425 |
$sth = $dbh->prepare("SELECT barcode FROM items, collections_tracking |
413 |
$sth = $dbh->prepare("SELECT barcode FROM items, collections_tracking |
| 426 |
WHERE items.itemnumber = collections_tracking.itemnumber |
414 |
WHERE items.itemnumber = collections_tracking.itemnumber |
|
Lines 430-438
sub TransferCollection {
Link Here
|
| 430 |
while ( my $item = $sth->fetchrow_hashref ) { |
418 |
while ( my $item = $sth->fetchrow_hashref ) { |
| 431 |
my ( $dotransfer, $messages, $iteminformation ) = transferbook( $colBranchcode, $item->{'barcode'}, my $ignore_reserves = 1); |
419 |
my ( $dotransfer, $messages, $iteminformation ) = transferbook( $colBranchcode, $item->{'barcode'}, my $ignore_reserves = 1); |
| 432 |
} |
420 |
} |
| 433 |
|
|
|
| 434 |
|
421 |
|
| 435 |
|
|
|
| 436 |
return 1; |
422 |
return 1; |
| 437 |
|
423 |
|
| 438 |
} |
424 |
} |
|
Lines 461-468
sub GetCollectionItemBranches {
Link Here
|
| 461 |
|
447 |
|
| 462 |
my $row = $sth->fetchrow_hashref; |
448 |
my $row = $sth->fetchrow_hashref; |
| 463 |
|
449 |
|
| 464 |
$sth->finish; |
|
|
| 465 |
|
| 466 |
return ( |
450 |
return ( |
| 467 |
$$row{'holdingbranch'}, |
451 |
$$row{'holdingbranch'}, |
| 468 |
$$row{'colBranchcode'}, |
452 |
$$row{'colBranchcode'}, |
|
Lines 505-512
sub isItemInAnyCollection {
Link Here
|
| 505 |
my $row = $sth->fetchrow_hashref; |
489 |
my $row = $sth->fetchrow_hashref; |
| 506 |
|
490 |
|
| 507 |
$itemnumber = $row->{itemnumber}; |
491 |
$itemnumber = $row->{itemnumber}; |
| 508 |
$sth->finish; |
|
|
| 509 |
|
| 510 |
if ( $itemnumber ) { |
492 |
if ( $itemnumber ) { |
| 511 |
return 1; |
493 |
return 1; |
| 512 |
} else { |
494 |
} else { |
| 513 |
- |
|
|