forked from extern/egroupware
When viewing accessories of a resource
- Add button adds an accessory - Allow context menu -> add accessory = add accessory to resource, _not_ selected accessory
This commit is contained in:
parent
e765fda60e
commit
59c35020e7
@ -165,7 +165,9 @@ class resources_bo
|
|||||||
$readonlys["delete[$resource[res_id]]"] = true;
|
$readonlys["delete[$resource[res_id]]"] = true;
|
||||||
$resource['class'] .= 'no_delete ';
|
$resource['class'] .= 'no_delete ';
|
||||||
}
|
}
|
||||||
if ((!$this->acl->is_permitted($resource['cat_id'],EGW_ACL_ADD)) || $resource['accessory_of'] != -1)
|
if ((!$this->acl->is_permitted($resource['cat_id'],EGW_ACL_ADD)) ||
|
||||||
|
// Allow new accessory action when viewing accessories of a certain resource
|
||||||
|
$query['filter2'] <= 0 && $resource['accessory_of'] != -1)
|
||||||
{
|
{
|
||||||
$readonlys["new_acc[$resource[res_id]]"] = true;
|
$readonlys["new_acc[$resource[res_id]]"] = true;
|
||||||
$resource['class'] .= 'no_new_accessory ';
|
$resource['class'] .= 'no_new_accessory ';
|
||||||
|
@ -436,8 +436,10 @@ class resources_ui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$nm_session_data = $GLOBALS['egw']->session->appsession('session_data','resources_index_nm');
|
||||||
$res_id = is_numeric($content) ? (int)$content : $content['res_id'];
|
$res_id = is_numeric($content) ? (int)$content : $content['res_id'];
|
||||||
if (isset($_GET['res_id'])) $res_id = $_GET['res_id'];
|
if (isset($_GET['res_id'])) $res_id = $_GET['res_id'];
|
||||||
|
if (isset($nm_session_data['filter2']) && $nm_session_data['filter2'] > 0) $accessory_of = $nm_session_data['filter2'];
|
||||||
if (isset($_GET['accessory_of'])) $accessory_of = $_GET['accessory_of'];
|
if (isset($_GET['accessory_of'])) $accessory_of = $_GET['accessory_of'];
|
||||||
$content = array('res_id' => $res_id);
|
$content = array('res_id' => $res_id);
|
||||||
|
|
||||||
@ -453,11 +455,16 @@ class resources_ui
|
|||||||
} elseif ($accessory_of > 0) {
|
} elseif ($accessory_of > 0) {
|
||||||
// Pre-set according to parent
|
// Pre-set according to parent
|
||||||
$owner = $this->bo->read($accessory_of);
|
$owner = $this->bo->read($accessory_of);
|
||||||
|
if($owner['accessory_of'] > 0)
|
||||||
|
{
|
||||||
|
// Accessory of accessory not allowed, grab parent resource
|
||||||
|
$accessory_of = $owner['accessory_of'];
|
||||||
|
$owner = $this->bo->read($accessory_of);
|
||||||
|
}
|
||||||
$content['cat_id'] = $owner['cat_id'];
|
$content['cat_id'] = $owner['cat_id'];
|
||||||
$content['bookable'] = true;
|
$content['bookable'] = true;
|
||||||
} else {
|
} else {
|
||||||
// New resource
|
// New resource
|
||||||
$nm_session_data = $GLOBALS['egw']->session->appsession('session_data','resources_index_nm');
|
|
||||||
$content['cat_id'] = $nm_session_data['filter'];
|
$content['cat_id'] = $nm_session_data['filter'];
|
||||||
$content['bookable'] = true;
|
$content['bookable'] = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user