mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:04 +01:00
If un-deleting an accessory but not the parent resource, un-parent and make it a resource
This commit is contained in:
parent
67e4e8a6cb
commit
b1484c2a1d
@ -360,6 +360,20 @@ class resources_ui
|
||||
if(!$id) continue;
|
||||
$resource = $this->bo->read($id);
|
||||
$resource['deleted'] = null;
|
||||
if($resource['accessory_of'] > 0)
|
||||
{
|
||||
/*
|
||||
If restoring an accessory, and parent is deleted, and not in
|
||||
the list of resources to be restored right now, un-parent
|
||||
*/
|
||||
$parent = $this->bo->read($resource['accessory_of']);
|
||||
$checked_key = array_search($parent['res_id'], $checked);
|
||||
if($checked_key === false && $parent['deleted'])
|
||||
{
|
||||
$resource['accessory_of'] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
$this->bo->save($resource);
|
||||
if($settings == 'accessories')
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user