mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
Remove selected accessories from checked list when deleting resource. Deleting the resource deletes all accessories, and gives an error if we try to delete it after that
This commit is contained in:
parent
f00bee861f
commit
64c653f253
@ -368,6 +368,21 @@ class resources_ui
|
||||
if($checked_key !== false) unset($checked[$checked_key]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Remove checked accessories, deleting resource will remove them
|
||||
// We get an error if we try to delete them after they're gone
|
||||
$accessories = $this->bo->get_acc_list($id);
|
||||
foreach($accessories as $acc_id => $name)
|
||||
{
|
||||
$checked_key = array_search($acc_id, $checked);
|
||||
if($checked_key !== false)
|
||||
{
|
||||
$success++;
|
||||
unset($checked[$checked_key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$error = $this->bo->delete($id);
|
||||
if (!$error)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user