mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
Fixed the problem where calendar items were not being deleted. Tracked it down to a ->db overwrite problem where todo was using ->db and the deleteaccount.php page was using the same.
This commit is contained in:
parent
be32e184c4
commit
18bf9da775
@ -20,12 +20,12 @@
|
||||
|
||||
$contacts = CreateObject('phpgwapi.contacts');
|
||||
|
||||
if($new_owner==0)
|
||||
if(intval($new_owner)==0)
|
||||
{
|
||||
$contacts->delete_all($account_id);
|
||||
$contacts->delete_all(intval($account_id));
|
||||
}
|
||||
else
|
||||
{
|
||||
$contacts->change_owner($account_id,$new_owner);
|
||||
$contacts->change_owner(intval($account_id),intval($new_owner));
|
||||
}
|
||||
?>
|
||||
|
@ -41,10 +41,10 @@
|
||||
$str = '<select name="new_owner" size="5">'."\n";
|
||||
$users = $phpgw->accounts->get_list('accounts');
|
||||
$c_users = count($users);
|
||||
$str .= '<option value="0">'.lang('Delete All Records').'</option>'."\n";
|
||||
$str .= '<option value=0>'.lang('Delete All Records').'</option>'."\n";
|
||||
for($i=0;$i<$c_users;$i++)
|
||||
{
|
||||
$str .= '<option value="'.$users[$i]['account_id'].'">'.$phpgw->common->display_fullname($users[$i]['account_lid'],$users[$i]['account_firstname'],$users[$i]['account_lastname']).'</option>'."\n";
|
||||
$str .= '<option value='.$users[$i]['account_id'].'>'.$phpgw->common->display_fullname($users[$i]['account_lid'],$users[$i]['account_firstname'],$users[$i]['account_lastname']).'</option>'."\n";
|
||||
}
|
||||
$str .= '</select>'."\n";
|
||||
$phpgw->template->set_var('lang_new_owner',lang('Who would you like to transfer ALL records owned by the deleted user to?'));
|
||||
@ -61,12 +61,14 @@
|
||||
settype($account_id,'integer');
|
||||
$account_id = get_account_id($accountid);
|
||||
$lid = $phpgw->accounts->id2name($account_id);
|
||||
$phpgw->db->query('SELECT app_name FROM phpgw_applications WHERE app_enabled=1',__LINE__,__FILE__);
|
||||
if($phpgw->db->num_rows())
|
||||
$db = $phpgw->db;
|
||||
$db->query('SELECT app_name,app_order FROM phpgw_applications WHERE app_enabled!=0 ORDER BY app_order',__LINE__,__FILE__);
|
||||
if($db->num_rows())
|
||||
{
|
||||
while($phpgw->db->next_record())
|
||||
while($db->next_record())
|
||||
{
|
||||
$appname = $phpgw->db->f('app_name');
|
||||
$appname = $db->f('app_name');
|
||||
|
||||
if($appname <> 'admin')
|
||||
{
|
||||
$phpgw->common->hook_single('deleteaccount', $appname);
|
||||
|
@ -20,12 +20,12 @@
|
||||
$calendar = CreateObject('calendar.calendar');
|
||||
$cal_stream = $calendar->open('INBOX',$account_id,'');
|
||||
|
||||
if($new_owner==0)
|
||||
if(intval($new_owner)==0)
|
||||
{
|
||||
$calendar->delete_calendar($cal_stream,$account_id);
|
||||
$calendar->delete_calendar($cal_stream,intval($account_id));
|
||||
}
|
||||
else
|
||||
{
|
||||
$calendar->change_owner($account_id,$new_owner);
|
||||
$calendar->change_owner(intval($account_id),intval($new_owner));
|
||||
}
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user