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

(-)a/C4/Members.pm (+34 lines)
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);
(-)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