Fix calendar Category ACL does not apply changes

This commit is contained in:
Hadi Nategh 2014-07-15 15:18:06 +00:00
parent 6feb5fa30c
commit 17b0c758f8
2 changed files with 6 additions and 6 deletions

View File

@ -2313,7 +2313,7 @@ class calendar_uiforms extends calendar_ui
unset($content['button']); unset($content['button']);
if ($button != 'cancel') // store changed acl if ($button != 'cancel') // store changed acl
{ {
foreach($content['rows'] as $data) foreach($content as $data)
{ {
if (!($cat_id = $data['cat_id'])) continue; if (!($cat_id = $data['cat_id'])) continue;
foreach(array_merge((array)$data['add'],(array)$data['status'],array_keys((array)$data['old'])) as $account_id) foreach(array_merge((array)$data['add'],(array)$data['status'],array_keys((array)$data['old'])) as $account_id)
@ -2330,7 +2330,7 @@ class calendar_uiforms extends calendar_ui
egw::redirect_link('/admin/index.php', null, 'admin'); egw::redirect_link('/admin/index.php', null, 'admin');
} }
} }
$content['rows'] = $preserv['rows'] = array(); $content= $preserv = array();
$n = 1; $n = 1;
foreach($this->bo->get_cat_rights() as $Lcat_id => $data) foreach($this->bo->get_cat_rights() as $Lcat_id => $data)
{ {
@ -2345,8 +2345,8 @@ class calendar_uiforms extends calendar_ui
if ($rights & calendar_boupdate::CAT_ACL_ADD) $row['add'][] = $account_id; if ($rights & calendar_boupdate::CAT_ACL_ADD) $row['add'][] = $account_id;
if ($rights & calendar_boupdate::CAT_ACL_STATUS) $row['status'][] = $account_id; if ($rights & calendar_boupdate::CAT_ACL_STATUS) $row['status'][] = $account_id;
} }
$content['rows'][$n] = $row; $content[$n] = $row;
$preserv['rows'][$n] = array( $preserv[$n] = array(
'cat_id' => $cat_id, 'cat_id' => $cat_id,
'old' => $data, 'old' => $data,
); );
@ -2354,7 +2354,7 @@ class calendar_uiforms extends calendar_ui
++$n; ++$n;
} }
// add empty row for new entries // add empty row for new entries
$content['rows'][] = array('cat_id' => ''); $content[] = array('cat_id' => '');
$GLOBALS['egw_info']['flags']['app_header'] = lang('Calendar').' - '.lang('Category ACL'); $GLOBALS['egw_info']['flags']['app_header'] = lang('Calendar').' - '.lang('Category ACL');
$tmp = new etemplate_new('calendar.cat_acl'); $tmp = new etemplate_new('calendar.cat_acl');

View File

@ -6,7 +6,7 @@
<caption label="Category ACL"/> <caption label="Category ACL"/>
<description value="Category ACL only restrict adding a category to an event or changing status of a participant. It does NOT change the visibility of an event!"/> <description value="Category ACL only restrict adding a category to an event or changing status of a participant. It does NOT change the visibility of an event!"/>
</groupbox> </groupbox>
<grid id="rows"> <grid>
<columns> <columns>
<column/> <column/>
<column/> <column/>