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