From b398935fd60c185cad2cc406313077975e543f92 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 3 Jun 2020 15:45:25 -0600 Subject: [PATCH] * Preferences: Fix delete personal category required admin permission --- admin/inc/class.admin_categories.inc.php | 7 +++++-- admin/templates/default/categories.edit.xet | 2 +- preferences/inc/class.preferences_categories_ui.inc.php | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/admin/inc/class.admin_categories.inc.php b/admin/inc/class.admin_categories.inc.php index 059e24717d..a52c05102f 100644 --- a/admin/inc/class.admin_categories.inc.php +++ b/admin/inc/class.admin_categories.inc.php @@ -42,6 +42,7 @@ class admin_categories protected $list_link = 'admin.admin_categories.index'; protected $add_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 ;-) @@ -322,6 +323,8 @@ class admin_categories $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 ($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 if (!is_array($content['owner'])) $content['owner'] = explode(',',$content['owner']); $tmpl = new Etemplate('admin.categories.edit'); @@ -662,7 +665,7 @@ class admin_categories } } $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) { @@ -706,7 +709,7 @@ class admin_categories 'group' => ++$group, 'disableClass' => 'rowNoDelete', 'popup' => '450x400', - 'url' => 'menuaction=admin.admin_categories.delete&cat_id=$id', + 'url' => 'menuaction='.$this->delete_link.'&cat_id=$id', ), ); diff --git a/admin/templates/default/categories.edit.xet b/admin/templates/default/categories.edit.xet index 85deaf1c4f..a1ed1c4538 100644 --- a/admin/templates/default/categories.edit.xet +++ b/admin/templates/default/categories.edit.xet @@ -80,7 +80,7 @@