Lines 1815-1820
sub DelMember {
Link Here
|
1815 |
return $sth->rows; |
1815 |
return $sth->rows; |
1816 |
} |
1816 |
} |
1817 |
|
1817 |
|
|
|
1818 |
=head2 HandleDelBorrower |
1819 |
|
1820 |
HandleDelBorrower($borrower); |
1821 |
|
1822 |
When a member is deleted (DelMember in Members.pm), you should call me first. |
1823 |
This routine deletes/moves lists and entries for the deleted member/borrower. |
1824 |
Lists owned by the borrower are deleted, but entries from the borrower to |
1825 |
other lists are kept. |
1826 |
|
1827 |
=cut |
1828 |
|
1829 |
sub HandleDelBorrower { |
1830 |
my ($borrower)= @_; |
1831 |
my $query; |
1832 |
my $dbh = C4::Context->dbh; |
1833 |
|
1834 |
#Delete all lists and all shares of this borrower |
1835 |
#Consistent with the approach Koha uses on deleting individual lists |
1836 |
#Note that entries in virtualshelfcontents added by this borrower to |
1837 |
#lists of others will be handled by a table constraint: the borrower |
1838 |
#is set to NULL in those entries. |
1839 |
$query="DELETE FROM virtualshelves WHERE owner=?"; |
1840 |
$dbh->do($query,undef,($borrower)); |
1841 |
|
1842 |
#NOTE: |
1843 |
#We could handle the above deletes via a constraint too. |
1844 |
#But a new BZ report 11889 has been opened to discuss another approach. |
1845 |
#Instead of deleting we could also disown lists (based on a pref). |
1846 |
#In that way we could save shared and public lists. |
1847 |
#The current table constraints support that idea now. |
1848 |
#This pref should then govern the results of other routines/methods such as |
1849 |
#Koha::Virtualshelf->new->delete too. |
1850 |
} |
1851 |
|
1818 |
=head2 ExtendMemberSubscriptionTo (OUEST-PROVENCE) |
1852 |
=head2 ExtendMemberSubscriptionTo (OUEST-PROVENCE) |
1819 |
|
1853 |
|
1820 |
$date = ExtendMemberSubscriptionTo($borrowerid, $date); |
1854 |
$date = ExtendMemberSubscriptionTo($borrowerid, $date); |