mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 12:39:25 +01:00
* Preferences: Fix delete personal category required admin permission
This commit is contained in:
parent
e613a561f6
commit
b398935fd6
@ -42,6 +42,7 @@ class admin_categories
|
|||||||
protected $list_link = 'admin.admin_categories.index';
|
protected $list_link = 'admin.admin_categories.index';
|
||||||
protected $add_link = 'admin.admin_categories.edit';
|
protected $add_link = 'admin.admin_categories.edit';
|
||||||
protected $edit_link = 'admin.admin_categories.edit';
|
protected $edit_link = 'admin.admin_categories.edit';
|
||||||
|
protected $delete_link = 'admin.admin_categories.delete';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stupid old admin ACL - dont think anybody uses or understands it ;-)
|
* Stupid old admin ACL - dont think anybody uses or understands it ;-)
|
||||||
@ -322,6 +323,8 @@ class admin_categories
|
|||||||
$readonlys['button[delete]'] = !$content['id'] || !self::$acl_delete || // cant delete not yet saved category
|
$readonlys['button[delete]'] = !$content['id'] || !self::$acl_delete || // cant delete not yet saved category
|
||||||
$appname != $content['appname'] || // Can't edit a category from a different app
|
$appname != $content['appname'] || // Can't edit a category from a different app
|
||||||
($this->appname != 'admin' && $content['owner'] != $GLOBALS['egw_info']['user']['account_id']);
|
($this->appname != 'admin' && $content['owner'] != $GLOBALS['egw_info']['user']['account_id']);
|
||||||
|
$content['delete_link'] = $this->delete_link;
|
||||||
|
|
||||||
// Make sure $content['owner'] is an array otherwise it wont show up values in the multiselectbox
|
// Make sure $content['owner'] is an array otherwise it wont show up values in the multiselectbox
|
||||||
if (!is_array($content['owner'])) $content['owner'] = explode(',',$content['owner']);
|
if (!is_array($content['owner'])) $content['owner'] = explode(',',$content['owner']);
|
||||||
$tmpl = new Etemplate('admin.categories.edit');
|
$tmpl = new Etemplate('admin.categories.edit');
|
||||||
@ -662,7 +665,7 @@ class admin_categories
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$tpl = new Etemplate('admin.categories.delete');
|
$tpl = new Etemplate('admin.categories.delete');
|
||||||
$tpl->exec('admin.admin_categories.delete', $content, array(), array(), $content, 2);
|
$tpl->exec($this->delete_link, $content, array(), array(), $content, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function get_actions($appname=Api\Categories::GLOBAL_APPNAME) {
|
protected function get_actions($appname=Api\Categories::GLOBAL_APPNAME) {
|
||||||
@ -706,7 +709,7 @@ class admin_categories
|
|||||||
'group' => ++$group,
|
'group' => ++$group,
|
||||||
'disableClass' => 'rowNoDelete',
|
'disableClass' => 'rowNoDelete',
|
||||||
'popup' => '450x400',
|
'popup' => '450x400',
|
||||||
'url' => 'menuaction=admin.admin_categories.delete&cat_id=$id',
|
'url' => 'menuaction='.$this->delete_link.'&cat_id=$id',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
<button label="Save" id="button[save]" onclick="return app.admin.check_owner(widget);" image="save" background_image="1"/>
|
<button label="Save" id="button[save]" onclick="return app.admin.check_owner(widget);" image="save" background_image="1"/>
|
||||||
<button label="Apply" id="button[apply]" onclick="return app.admin.check_owner(widget);" image="apply" background_image="1"/>
|
<button label="Apply" id="button[apply]" onclick="return app.admin.check_owner(widget);" image="apply" background_image="1"/>
|
||||||
<buttononly label="Cancel" id="button[cancel]" onclick="window.close();" image="cancel" background_image="1"/>
|
<buttononly label="Cancel" id="button[cancel]" onclick="window.close();" image="cancel" background_image="1"/>
|
||||||
<buttononly align="right" statustext="Delete this category" label="Delete" id="button[delete]" onclick="egw.open_link('admin.admin_categories.delete&cat_id='+widget.getRoot().getArrayMgr('content').getEntry('id'),'_browser','450x400');window.close();" image="delete" background_image="1"/>
|
<buttononly align="right" statustext="Delete this category" label="Delete" id="button[delete]" onclick="egw.open_link('$cont[delete_link]&cat_id='+widget.getRoot().getArrayMgr('content').getEntry('id'),'_browser','450x400');window.close();" image="delete" background_image="1"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
</row>
|
</row>
|
||||||
</rows>
|
</rows>
|
||||||
|
@ -23,6 +23,7 @@ class preferences_categories_ui extends admin_categories {
|
|||||||
protected $list_link = 'preferences.preferences_categories_ui.index';
|
protected $list_link = 'preferences.preferences_categories_ui.index';
|
||||||
protected $edit_link = 'preferences.preferences_categories_ui.edit';
|
protected $edit_link = 'preferences.preferences_categories_ui.edit';
|
||||||
protected $add_link = 'preferences.preferences_categories_ui.edit';
|
protected $add_link = 'preferences.preferences_categories_ui.edit';
|
||||||
|
protected $delete_link = 'preferences.preferences_categories_ui.delete';
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user