View | Details | Raw Unified | Return to bug 14544
Collapse All | Expand All

(-)a/C4/Members.pm (+34 lines)
Lines 1834-1839 sub DelMember { Link Here
1834
    return $sth->rows;
1834
    return $sth->rows;
1835
}
1835
}
1836
1836
1837
=head2 HandleDelBorrower
1838
1839
     HandleDelBorrower($borrower);
1840
1841
When a member is deleted (DelMember in Members.pm), you should call me first.
1842
This routine deletes/moves lists and entries for the deleted member/borrower.
1843
Lists owned by the borrower are deleted, but entries from the borrower to
1844
other lists are kept.
1845
1846
=cut
1847
1848
sub HandleDelBorrower {
1849
    my ($borrower)= @_;
1850
    my $query;
1851
    my $dbh = C4::Context->dbh;
1852
1853
    #Delete all lists and all shares of this borrower
1854
    #Consistent with the approach Koha uses on deleting individual lists
1855
    #Note that entries in virtualshelfcontents added by this borrower to
1856
    #lists of others will be handled by a table constraint: the borrower
1857
    #is set to NULL in those entries.
1858
    $query="DELETE FROM virtualshelves WHERE owner=?";
1859
    $dbh->do($query,undef,($borrower));
1860
1861
    #NOTE:
1862
    #We could handle the above deletes via a constraint too.
1863
    #But a new BZ report 11889 has been opened to discuss another approach.
1864
    #Instead of deleting we could also disown lists (based on a pref).
1865
    #In that way we could save shared and public lists.
1866
    #The current table constraints support that idea now.
1867
    #This pref should then govern the results of other routines/methods such as
1868
    #Koha::Virtualshelf->new->delete too.
1869
}
1870
1837
=head2 ExtendMemberSubscriptionTo (OUEST-PROVENCE)
1871
=head2 ExtendMemberSubscriptionTo (OUEST-PROVENCE)
1838
1872
1839
    $date = ExtendMemberSubscriptionTo($borrowerid, $date);
1873
    $date = ExtendMemberSubscriptionTo($borrowerid, $date);
(-)a/C4/VirtualShelves.pm (-35 lines)
Lines 83-122 sub ShelvesMax { Link Here
83
    return SHELVES_MASTHEAD_MAX;
83
    return SHELVES_MASTHEAD_MAX;
84
}
84
}
85
85
86
=head2 HandleDelBorrower
87
88
     HandleDelBorrower($borrower);
89
90
When a member is deleted (DelMember in Members.pm), you should call me first.
91
This routine deletes/moves lists and entries for the deleted member/borrower.
92
Lists owned by the borrower are deleted, but entries from the borrower to
93
other lists are kept.
94
95
=cut
96
97
sub HandleDelBorrower {
98
    my ($borrower)= @_;
99
    my $query;
100
    my $dbh = C4::Context->dbh;
101
102
    #Delete all lists and all shares of this borrower
103
    #Consistent with the approach Koha uses on deleting individual lists
104
    #Note that entries in virtualshelfcontents added by this borrower to
105
    #lists of others will be handled by a table constraint: the borrower
106
    #is set to NULL in those entries.
107
    $query="DELETE FROM virtualshelves WHERE owner=?";
108
    $dbh->do($query,undef,($borrower));
109
110
    #NOTE:
111
    #We could handle the above deletes via a constraint too.
112
    #But a new BZ report 11889 has been opened to discuss another approach.
113
    #Instead of deleting we could also disown lists (based on a pref).
114
    #In that way we could save shared and public lists.
115
    #The current table constraints support that idea now.
116
    #This pref should then govern the results of other routines/methods such as
117
    #Koha::Virtualshelf->new->delete too.
118
}
119
120
sub GetShelfCount {
86
sub GetShelfCount {
121
    my ($owner, $category) = @_;
87
    my ($owner, $category) = @_;
122
    my @params;
88
    my @params;
123
- 

Return to bug 14544