Lines 597-612
sub ShelvesMax {
Link Here
|
597 |
return SHELVES_MASTHEAD_MAX; |
597 |
return SHELVES_MASTHEAD_MAX; |
598 |
} |
598 |
} |
599 |
|
599 |
|
|
|
600 |
=head2 HandleDelBorrower |
601 |
|
602 |
HandleDelBorrower($borrower); |
603 |
|
604 |
When a member is deleted (DelMember in Members.pm), you should call me first. |
605 |
This routine deletes/moves lists and entries for the deleted member/borrower. |
606 |
You could just delete everything (and lose more than you want), but instead we |
607 |
now try to save all public/shared stuff and keep others happy. |
608 |
|
609 |
=cut |
610 |
|
600 |
sub HandleDelBorrower { |
611 |
sub HandleDelBorrower { |
601 |
#when a member is deleted (DelMember in Members.pm), you should call me first |
|
|
602 |
#this routine deletes/moves lists and entries for the deleted member/borrower |
603 |
#you could just delete everything (and lose more than you want) |
604 |
#instead we now try to save all public/shared stuff and keep others happy |
605 |
my ($borrower)= @_; |
612 |
my ($borrower)= @_; |
606 |
my $query; |
613 |
my $query; |
607 |
my $dbh = C4::Context->dbh; |
614 |
my $dbh = C4::Context->dbh; |
608 |
|
615 |
|
609 |
#Delete shares of this borrower (not lists !) |
616 |
#Delete shares of this borrower (not lists !) |
|
|
617 |
#Although this would be done later via the FK cascaded delete, we do it now. |
618 |
#Because it makes the following delete statement on shelves more meaningful. |
610 |
$query="DELETE FROM virtualshelfshares WHERE borrowernumber=?"; |
619 |
$query="DELETE FROM virtualshelfshares WHERE borrowernumber=?"; |
611 |
$dbh->do($query,undef,($borrower)); |
620 |
$dbh->do($query,undef,($borrower)); |
612 |
|
621 |
|
613 |
- |
|
|