This should fix the problem of changing from user to group to user using the header dropdown.

This commit is contained in:
skeeter 2002-01-10 02:01:07 +00:00
parent 476bec151f
commit 74248030b8
5 changed files with 49 additions and 9 deletions

View File

@ -164,7 +164,7 @@
} }
elseif(isset($this->owner) && $GLOBALS['phpgw']->accounts->get_type($this->owner) == 'g') elseif(isset($this->owner) && $GLOBALS['phpgw']->accounts->get_type($this->owner) == 'g')
{ {
$this->set_owner_to_group($this->owner); $this->set_owner_to_group(intval($this->owner));
} }
$this->prefs['common'] = $GLOBALS['phpgw_info']['user']['preferences']['common']; $this->prefs['common'] = $GLOBALS['phpgw_info']['user']['preferences']['common'];

View File

@ -171,20 +171,30 @@
$GLOBALS['phpgw']->accounts->get_account_name($grantor,$lid,$fname,$lname); $GLOBALS['phpgw']->accounts->get_account_name($grantor,$lid,$fname,$lname);
$drop_down[$lname.' '.$fname] = Array( $drop_down[$lname.' '.$fname] = Array(
'grantor' => $grantor, 'grantor' => $grantor,
'value' => $grantor, 'value' => ($GLOBALS['phpgw']->accounts->get_type($grantor)=='g'?'g_':'')
. $grantor,
'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname) 'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname)
); );
} }
$memberships = $GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']); $memberships = $GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']);
while($memberships != False && list($key,$group_info) = each($memberships)) while($memberships != False && list($key,$group_info) = each($memberships))
{ {
$GLOBALS['phpgw']->accounts->get_account_name($group_info['account_id'],$lid,$fname,$lname);
$drop_down[$lname.' '.$fname] = Array(
'grantor' => $group_info['account_id'],
'value' => ($GLOBALS['phpgw']->accounts->get_type($group_info['account_id'])=='g'?'g_':'')
.$group_info['account_id'],
'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname)
);
$account_perms = $GLOBALS['phpgw']->acl->get_ids_for_location($group_info['account_id'],PHPGW_ACL_READ,'calendar'); $account_perms = $GLOBALS['phpgw']->acl->get_ids_for_location($group_info['account_id'],PHPGW_ACL_READ,'calendar');
while($account_perms && list($key,$group_id) = each($account_perms)) while($account_perms && list($key,$group_id) = each($account_perms))
{ {
$GLOBALS['phpgw']->accounts->get_account_name($group_id,$lid,$fname,$lname); $GLOBALS['phpgw']->accounts->get_account_name($group_id,$lid,$fname,$lname);
$drop_down[$lname.' '.$fname] = Array( $drop_down[$lname.' '.$fname] = Array(
'grantor' => $group_id, 'grantor' => $group_id,
'value' => 'g_'.$group_id, 'value' => ($GLOBALS['phpgw']->accounts->get_type($group_id)=='g'?'g_':'')
.$group_id,
'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname) 'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname)
); );
} }

View File

@ -171,20 +171,30 @@
$GLOBALS['phpgw']->accounts->get_account_name($grantor,$lid,$fname,$lname); $GLOBALS['phpgw']->accounts->get_account_name($grantor,$lid,$fname,$lname);
$drop_down[$lname.' '.$fname] = Array( $drop_down[$lname.' '.$fname] = Array(
'grantor' => $grantor, 'grantor' => $grantor,
'value' => $grantor, 'value' => ($GLOBALS['phpgw']->accounts->get_type($grantor)=='g'?'g_':'')
. $grantor,
'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname) 'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname)
); );
} }
$memberships = $GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']); $memberships = $GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']);
while($memberships != False && list($key,$group_info) = each($memberships)) while($memberships != False && list($key,$group_info) = each($memberships))
{ {
$GLOBALS['phpgw']->accounts->get_account_name($group_info['account_id'],$lid,$fname,$lname);
$drop_down[$lname.' '.$fname] = Array(
'grantor' => $group_info['account_id'],
'value' => ($GLOBALS['phpgw']->accounts->get_type($group_info['account_id'])=='g'?'g_':'')
.$group_info['account_id'],
'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname)
);
$account_perms = $GLOBALS['phpgw']->acl->get_ids_for_location($group_info['account_id'],PHPGW_ACL_READ,'calendar'); $account_perms = $GLOBALS['phpgw']->acl->get_ids_for_location($group_info['account_id'],PHPGW_ACL_READ,'calendar');
while($account_perms && list($key,$group_id) = each($account_perms)) while($account_perms && list($key,$group_id) = each($account_perms))
{ {
$GLOBALS['phpgw']->accounts->get_account_name($group_id,$lid,$fname,$lname); $GLOBALS['phpgw']->accounts->get_account_name($group_id,$lid,$fname,$lname);
$drop_down[$lname.' '.$fname] = Array( $drop_down[$lname.' '.$fname] = Array(
'grantor' => $group_id, 'grantor' => $group_id,
'value' => 'g_'.$group_id, 'value' => ($GLOBALS['phpgw']->accounts->get_type($group_id)=='g'?'g_':'')
.$group_id,
'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname) 'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname)
); );
} }

View File

@ -171,20 +171,30 @@
$GLOBALS['phpgw']->accounts->get_account_name($grantor,$lid,$fname,$lname); $GLOBALS['phpgw']->accounts->get_account_name($grantor,$lid,$fname,$lname);
$drop_down[$lname.' '.$fname] = Array( $drop_down[$lname.' '.$fname] = Array(
'grantor' => $grantor, 'grantor' => $grantor,
'value' => $grantor, 'value' => ($GLOBALS['phpgw']->accounts->get_type($grantor)=='g'?'g_':'')
. $grantor,
'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname) 'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname)
); );
} }
$memberships = $GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']); $memberships = $GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']);
while($memberships != False && list($key,$group_info) = each($memberships)) while($memberships != False && list($key,$group_info) = each($memberships))
{ {
$GLOBALS['phpgw']->accounts->get_account_name($group_info['account_id'],$lid,$fname,$lname);
$drop_down[$lname.' '.$fname] = Array(
'grantor' => $group_info['account_id'],
'value' => ($GLOBALS['phpgw']->accounts->get_type($group_info['account_id'])=='g'?'g_':'')
.$group_info['account_id'],
'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname)
);
$account_perms = $GLOBALS['phpgw']->acl->get_ids_for_location($group_info['account_id'],PHPGW_ACL_READ,'calendar'); $account_perms = $GLOBALS['phpgw']->acl->get_ids_for_location($group_info['account_id'],PHPGW_ACL_READ,'calendar');
while($account_perms && list($key,$group_id) = each($account_perms)) while($account_perms && list($key,$group_id) = each($account_perms))
{ {
$GLOBALS['phpgw']->accounts->get_account_name($group_id,$lid,$fname,$lname); $GLOBALS['phpgw']->accounts->get_account_name($group_id,$lid,$fname,$lname);
$drop_down[$lname.' '.$fname] = Array( $drop_down[$lname.' '.$fname] = Array(
'grantor' => $group_id, 'grantor' => $group_id,
'value' => 'g_'.$group_id, 'value' => ($GLOBALS['phpgw']->accounts->get_type($group_id)=='g'?'g_':'')
.$group_id,
'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname) 'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname)
); );
} }

View File

@ -171,20 +171,30 @@
$GLOBALS['phpgw']->accounts->get_account_name($grantor,$lid,$fname,$lname); $GLOBALS['phpgw']->accounts->get_account_name($grantor,$lid,$fname,$lname);
$drop_down[$lname.' '.$fname] = Array( $drop_down[$lname.' '.$fname] = Array(
'grantor' => $grantor, 'grantor' => $grantor,
'value' => $grantor, 'value' => ($GLOBALS['phpgw']->accounts->get_type($grantor)=='g'?'g_':'')
. $grantor,
'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname) 'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname)
); );
} }
$memberships = $GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']); $memberships = $GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']);
while($memberships != False && list($key,$group_info) = each($memberships)) while($memberships != False && list($key,$group_info) = each($memberships))
{ {
$GLOBALS['phpgw']->accounts->get_account_name($group_info['account_id'],$lid,$fname,$lname);
$drop_down[$lname.' '.$fname] = Array(
'grantor' => $group_info['account_id'],
'value' => ($GLOBALS['phpgw']->accounts->get_type($group_info['account_id'])=='g'?'g_':'')
.$group_info['account_id'],
'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname)
);
$account_perms = $GLOBALS['phpgw']->acl->get_ids_for_location($group_info['account_id'],PHPGW_ACL_READ,'calendar'); $account_perms = $GLOBALS['phpgw']->acl->get_ids_for_location($group_info['account_id'],PHPGW_ACL_READ,'calendar');
while($account_perms && list($key,$group_id) = each($account_perms)) while($account_perms && list($key,$group_id) = each($account_perms))
{ {
$GLOBALS['phpgw']->accounts->get_account_name($group_id,$lid,$fname,$lname); $GLOBALS['phpgw']->accounts->get_account_name($group_id,$lid,$fname,$lname);
$drop_down[$lname.' '.$fname] = Array( $drop_down[$lname.' '.$fname] = Array(
'grantor' => $group_id, 'grantor' => $group_id,
'value' => 'g_'.$group_id, 'value' => ($GLOBALS['phpgw']->accounts->get_type($group_id)=='g'?'g_':'')
.$group_id,
'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname) 'name' => $GLOBALS['phpgw']->common->display_fullname($lid,$fname,$lname)
); );
} }