mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-28 10:53:39 +01:00
* Timesheet - only admins can select admin only statuses
This commit is contained in:
parent
459f55d556
commit
7ed5c42b3d
@ -277,6 +277,30 @@ class timesheet_bo extends Api\Storage
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get status labels with admin statuses (optionally) filtered out
|
||||
*
|
||||
* @param boolean $admin
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
protected function get_status_labels($admin = null)
|
||||
{
|
||||
if(is_null($admin))
|
||||
{
|
||||
$admin = isset($GLOBALS['egw_info']['user']['apps']['admin']);
|
||||
}
|
||||
$labels = array();
|
||||
foreach($this->status_labels as $status_id => $label)
|
||||
{
|
||||
if($admin || !$admin && !$this->status_labels_config[$status_id]['admin'])
|
||||
{
|
||||
$labels[$status_id] = $label;
|
||||
}
|
||||
}
|
||||
return $labels;
|
||||
}
|
||||
|
||||
/**
|
||||
* get list of specified grants as uid => Username pairs
|
||||
*
|
||||
|
@ -444,7 +444,7 @@ class timesheet_ui extends timesheet_bo
|
||||
$edit_grants[$content['ts_owner']] = Api\Accounts::username($content['ts_owner']);
|
||||
}
|
||||
$sel_options['ts_owner'] = $edit_grants;
|
||||
$sel_options['ts_status'] = $this->status_labels;
|
||||
$sel_options['ts_status'] = $this->get_status_labels($only_admin_edit);
|
||||
if($this->config_data['history'] && $content['ts_status'] == self::DELETED_STATUS)
|
||||
{
|
||||
$sel_options['ts_status'][self::DELETED_STATUS] = 'Deleted';
|
||||
@ -1051,9 +1051,9 @@ class timesheet_ui extends timesheet_bo
|
||||
'icon' => 'apply',
|
||||
'caption' => 'Modify status',
|
||||
'group' => $group,
|
||||
'children' => $this->status_labels,
|
||||
'children' => $this->get_status_labels(),
|
||||
'prefix' => 'to_status_',
|
||||
'enabled' => (boolean)$this->status_labels,
|
||||
'enabled' => (boolean)$this->get_status_labels(),
|
||||
),
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user