|
Lines 45-53
just delete them if not possible.
Link Here
|
| 45 |
sub disown_or_delete { |
45 |
sub disown_or_delete { |
| 46 |
my ($self) = @_; |
46 |
my ($self) = @_; |
| 47 |
|
47 |
|
|
|
48 |
my $list_pref = C4::Context->preference('ListOwnershipUponPatronDeletion'); |
| 48 |
$self->_resultset->result_source->schema->txn_do( |
49 |
$self->_resultset->result_source->schema->txn_do( |
| 49 |
sub { |
50 |
sub { |
| 50 |
if ( C4::Context->preference('ListOwnershipUponPatronDeletion') eq 'transfer' ) { |
51 |
if ( $list_pref ne 'delete' ) { # transfer or transfer_public |
| 51 |
my $new_owner; |
52 |
my $new_owner; |
| 52 |
|
53 |
|
| 53 |
$new_owner = C4::Context->preference('ListOwnerDesignated') |
54 |
$new_owner = C4::Context->preference('ListOwnerDesignated') |
|
Lines 59-67
sub disown_or_delete {
Link Here
|
| 59 |
} |
60 |
} |
| 60 |
|
61 |
|
| 61 |
while ( my $list = $self->next ) { |
62 |
while ( my $list = $self->next ) { |
| 62 |
if ( $new_owner && ( $list->is_public or $list->is_shared ) ) { |
63 |
if ( $new_owner && $list->is_public ) { |
| 63 |
$list->transfer_ownership($new_owner); |
64 |
$list->transfer_ownership($new_owner); |
| 64 |
} else { |
65 |
} elsif ( $new_owner && $list->is_shared && $list_pref eq 'transfer' ) { |
|
|
66 |
$list->transfer_ownership($new_owner); |
| 67 |
} else { # private list, or shared list with transfer_public |
| 65 |
$list->delete; |
68 |
$list->delete; |
| 66 |
} |
69 |
} |
| 67 |
} |
70 |
} |
| 68 |
- |
|
|