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