"make cat selection identical to etemplate stock one"

This commit is contained in:
Ralf Becker 2009-08-10 19:19:10 +00:00
parent c9e2127325
commit 97514cd296

View File

@ -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('&nbsp;',$cat['level']) . stripslashes($cat['name']);
if ($cat['app_name'] == 'phpgw' || $cat['owner'] == '-1')
{ {
$s .= '&nbsp;'; $s .= ' &#9830;';
}
$s .= $GLOBALS['egw']->strip_html($cat['name']);
if ($cat['app_name'] == 'phpgw')
{
$s .= '&nbsp;&lt;' . lang('Global') . '&gt;';
}
if ($cat['owner'] == '-1')
{
$s .= '&nbsp;&lt;' . lang('Global') . '&nbsp;' . lang($cat['app_name']) . '&gt;';
} }
$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);
} }
} }