Disable kanban column if user does not have access to kanban

This commit is contained in:
nathan 2023-07-12 15:47:54 -06:00
parent e6f142c7a4
commit a61323f98c
10 changed files with 71 additions and 27 deletions

View File

@ -280,7 +280,17 @@ class addressbook_ui extends addressbook_bo
if ($_GET['search']) {
$content['nm']['search'] = $_GET['search'];
}
if (isset($typeselection)) $content['nm']['col_filter']['tid'] = $typeselection;
if(isset($typeselection))
{
$content['nm']['col_filter']['tid'] = $typeselection;
}
// disable kanban column if we have no kanban
if(empty($GLOBALS['egw_info']['user']['apps']['kanban']))
{
$content['nm']['no_kanban'] = true;
}
// save the tid for use in creating new addressbook entrys via UI. Current tid is to be used as type of new entrys
//error_log(__METHOD__.__LINE__.' '.$content['nm']['col_filter']['tid']);
Api\Cache::setSession('addressbook','active_tid',$content['nm']['col_filter']['tid']);

View File

@ -16,7 +16,7 @@
<column width="180"/>
<column width="40"/>
<column width="80" disabled="@no_customfields"/>
<column width="120"/>
<column width="120" disabled="@no_kanban"/>
<column width="60%" minWidth="100"/>
<column width="80" disabled="@no_distribution_list"/>
<column width="80"/>

View File

@ -410,17 +410,27 @@ class filemanager_ui
$content['nm']['actions'] = static::get_actions();
$content['nm']['home_dir'] = static::get_home_dir();
$content['nm']['view'] = $GLOBALS['egw_info']['user']['preferences']['filemanager']['nm_view'];
$content['nm']['placeholder_actions'] = array('mkdir','paste','share','file_drop_mail','file_drop_move','file_drop_copy','file_drop_symlink');
$content['nm']['placeholder_actions'] = array('mkdir', 'paste', 'share', 'file_drop_mail', 'file_drop_move',
'file_drop_copy', 'file_drop_symlink');
if (isset($_GET['msg'])) $msg = $_GET['msg'];
// disable kanban column if we have no kanban
if(empty($GLOBALS['egw_info']['user']['apps']['kanban']))
{
$content['nm']['no_kanban'] = true;
}
if(isset($_GET['msg']))
{
$msg = $_GET['msg'];
}
// Blank favorite set via GET needs special handling for path
if (isset($_GET['favorite']) && $_GET['favorite'] == 'blank')
if(isset($_GET['favorite']) && $_GET['favorite'] == 'blank')
{
$content['nm']['path'] = static::get_home_dir();
}
// switch to projectmanager folders
if (isset($_GET['pm_id']))
if(isset($_GET['pm_id']))
{
$_GET['path'] = '/apps/projectmanager'.((int)$_GET['pm_id'] ? '/'.(int)$_GET['pm_id'] : '');
}

View File

@ -15,7 +15,7 @@
<column width="100"/>
<column width="30%"/>
<column width="20%"/>
<column width="120"/>
<column width="120" disabled="@no_kanban"/>
</columns>
<rows>
<row class="th">

View File

@ -999,10 +999,18 @@ class infolog_ui
$this->tmpl->read('infolog.index');
$values['nm']['disable_autorefresh'] = true; // we have push
// disable kanban column if we have no kanban
if(empty($GLOBALS['egw_info']['user']['apps']['kanban']))
{
$values['nm']['no_kanban'] = true;
}
$values['nm']['options-filter'] = $this->filters;
$values['nm']['get_rows'] = 'infolog.infolog_ui.get_rows';
$values['nm']['add_on_top_sort_field'] = 'info_datemodified';
$values['nm']['options-filter2'] = (in_array($this->prefs['show_links'],array('all','no_describtion')) ? array() : array(
$values['nm']['options-filter2'] = (in_array($this->prefs['show_links'], array('all',
'no_describtion')) ? array() : array(
'' => 'default',
)) + array(
'no_describtion' => 'no details',
@ -1016,7 +1024,7 @@ class infolog_ui
$values['nm']['filter2_onchange'] = "return app.infolog.filter2_change(ev, widget)";
// disable favories dropdown button, if not running as infolog
if ($called_as && $called_as != 'infolog')
if($called_as && $called_as != 'infolog')
{
$values['nm']['favorites'] = false;
}

View File

@ -16,7 +16,7 @@
<column width="120"/>
<column width="45%"/>
<column width="15%" disabled="@no_customfields"/>
<column width="120"/>
<column width="120" disabled="@no_kanban"/>
<column/>
<column width="120"/>
<column/>

View File

@ -140,7 +140,8 @@ class resources_ui
$content['nm']['options-filter2'][resources_bo::DELETED] = lang('Deleted');
}
if($_GET['search']) {
if($_GET['search'])
{
$content['nm']['search'] = $_GET['search'];
}
if($_GET['view_accs_of'])
@ -150,6 +151,12 @@ class resources_ui
$content['nm']['actions'] = $this->get_actions();
$content['nm']['placeholder_actions'] = array('add');
// disable kanban column if we have no kanban
if(empty($GLOBALS['egw_info']['user']['apps']['kanban']))
{
$content['nm']['no_kanban'] = true;
}
// check if user is permitted to add resources
// If they can't read any categories, they won't be able to save it
if(!$this->bo->acl->get_cats(Acl::ADD) || !$this->bo->acl->get_cats(Acl::READ))
@ -159,7 +166,7 @@ class resources_ui
$no_button['back'] = true;
$GLOBALS['egw_info']['flags']['app_header'] = lang('resources');
Framework::includeJS('.','resources','resources');
Framework::includeJS('.', 'resources', 'resources');
if($content['nm']['filter2'] > 0)
{

View File

@ -12,7 +12,7 @@
<column width="15%"/>
<column width="15%"/>
<column width="15%" disabled="@no_customfields"/>
<column width="120"/>
<column width="120" disabled="@no_kanban"/>
</columns>
<rows>
<row class="th">

View File

@ -1018,14 +1018,23 @@ class timesheet_ui extends timesheet_bo
'id' => $_GET['link_id']
);
}
// disable kanban column if we have no kanban
if(empty($GLOBALS['egw_info']['user']['apps']['kanban']))
{
$content['nm']['no_kanban'] = true;
}
$read_grants = $this->grant_list(Acl::READ);
$content['nm']['no_owner_col'] = count($read_grants) == 1;
if ($GLOBALS['egw_info']['user']['preferences']['timesheet']['nextmatch-timesheet.index.rows']) $content['nm']['selectcols'] = $GLOBALS['egw_info']['user']['preferences']['timesheet']['nextmatch-timesheet.index.rows'];
if($GLOBALS['egw_info']['user']['preferences']['timesheet']['nextmatch-timesheet.index.rows'])
{
$content['nm']['selectcols'] = $GLOBALS['egw_info']['user']['preferences']['timesheet']['nextmatch-timesheet.index.rows'];
}
$sel_options = array(
'ts_owner' => $read_grants,
'pm_id' => array(lang('No project')),
'cat_id' => array(array('value' => '', 'label' => lang('all categories')), array('value' => 0, 'label'=>lang('None'))),
'ts_status' => $this->status_labels+array(lang('No status')),
'cat_id' => array(array('value' => '', 'label' => lang('all categories')),
array('value' => 0, 'label' => lang('None'))),
'ts_status' => $this->status_labels + array(lang('No status')),
);
if($this->config_data['history'])
{

View File

@ -27,7 +27,7 @@
<column width="50"/>
<column width="10%" disabled="@no_ts_status"/>
<column width="15%"/>
<column width="120"/>
<column width="120" disabled="@no_kanban"/>
</columns>
<rows>
<row class="th">