mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 09:28:29 +01:00
"make cat selection identical to etemplate stock one"
This commit is contained in:
parent
c9e2127325
commit
97514cd296
@ -16,10 +16,10 @@
|
|||||||
class bo_acl
|
class bo_acl
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var $permissions Holds alls permissions for resources of user
|
* @var $permissions Holds alls permissions for resources of user
|
||||||
*/
|
*/
|
||||||
var $permissions;
|
var $permissions;
|
||||||
|
|
||||||
var $acl;
|
var $acl;
|
||||||
var $start = 0;
|
var $start = 0;
|
||||||
var $query = '';
|
var $query = '';
|
||||||
@ -39,7 +39,7 @@ class bo_acl
|
|||||||
$this->permissions = $GLOBALS['egw']->acl->get_all_location_rights($GLOBALS['egw_info']['user']['account_id'],'resources',true);
|
$this->permissions = $GLOBALS['egw']->acl->get_all_location_rights($GLOBALS['egw_info']['user']['account_id'],'resources',true);
|
||||||
$this->egw_cats =& CreateObject('phpgwapi.categories','','resources');
|
$this->egw_cats =& CreateObject('phpgwapi.categories','','resources');
|
||||||
$this->debug = False;
|
$this->debug = False;
|
||||||
|
|
||||||
//all this is only needed when called from uiacl.
|
//all this is only needed when called from uiacl.
|
||||||
if($session)
|
if($session)
|
||||||
{
|
{
|
||||||
@ -79,28 +79,20 @@ class bo_acl
|
|||||||
#_debug_array($cat)."hier<br>";
|
#_debug_array($cat)."hier<br>";
|
||||||
if($this->is_permitted($cat['id'],$perm_type))
|
if($this->is_permitted($cat['id'],$perm_type))
|
||||||
{
|
{
|
||||||
for ($j=0,$s=''; $j < $cat['level']; $j++)
|
$s = str_repeat(' ',$cat['level']) . stripslashes($cat['name']);
|
||||||
|
if ($cat['app_name'] == 'phpgw' || $cat['owner'] == '-1')
|
||||||
{
|
{
|
||||||
$s .= ' ';
|
$s .= ' ♦';
|
||||||
}
|
|
||||||
$s .= $GLOBALS['egw']->strip_html($cat['name']);
|
|
||||||
if ($cat['app_name'] == 'phpgw')
|
|
||||||
{
|
|
||||||
$s .= ' <' . lang('Global') . '>';
|
|
||||||
}
|
|
||||||
if ($cat['owner'] == '-1')
|
|
||||||
{
|
|
||||||
$s .= ' <' . lang('Global') . ' ' . lang($cat['app_name']) . '>';
|
|
||||||
}
|
}
|
||||||
$perm_cats[$cat['id']] = $s;
|
$perm_cats[$cat['id']] = $s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $perm_cats;
|
return $perm_cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gets name of category
|
* gets name of category
|
||||||
*
|
*
|
||||||
* @author Lukas Weiss <wnz.gh05t@users.sourceforge.net>
|
* @author Lukas Weiss <wnz.gh05t@users.sourceforge.net>
|
||||||
* @param int $cat_id
|
* @param int $cat_id
|
||||||
@ -110,7 +102,7 @@ class bo_acl
|
|||||||
{
|
{
|
||||||
return $this->egw_cats->id2name($cat_id);
|
return $this->egw_cats->id2name($cat_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gets userid of admin for given category
|
* gets userid of admin for given category
|
||||||
*
|
*
|
||||||
@ -130,7 +122,7 @@ class bo_acl
|
|||||||
}
|
}
|
||||||
return lang('none');
|
return lang('none');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cheks one of the following rights for current user:
|
* cheks one of the following rights for current user:
|
||||||
*
|
*
|
||||||
@ -144,7 +136,7 @@ class bo_acl
|
|||||||
{
|
{
|
||||||
return $this->permissions['L'.$cat_id] & $right;
|
return $this->permissions['L'.$cat_id] & $right;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gets all rights from all user for given cat
|
* gets all rights from all user for given cat
|
||||||
*
|
*
|
||||||
@ -203,7 +195,7 @@ class bo_acl
|
|||||||
$rights = in_array($account_id,$calbookcat) ? ($rights | EGW_ACL_DIRECT_BOOKING | EGW_ACL_CALREAD) : $rights;
|
$rights = in_array($account_id,$calbookcat) ? ($rights | EGW_ACL_DIRECT_BOOKING | EGW_ACL_CALREAD) : $rights;
|
||||||
$rights = in_array($account_id,$admincat) ? ($rights = 511) : $rights;
|
$rights = in_array($account_id,$admincat) ? ($rights = 511) : $rights;
|
||||||
if ($rights)
|
if ($rights)
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->acl->add_repository('resources','L'.$cat_id,$account_id,$rights);
|
$GLOBALS['egw']->acl->add_repository('resources','L'.$cat_id,$account_id,$rights);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user