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

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