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:
skeeter 2001-05-09 03:05:22 +00:00
parent be32e184c4
commit 18bf9da775
3 changed files with 15 additions and 13 deletions

View File

@ -20,12 +20,12 @@
$contacts = CreateObject('phpgwapi.contacts'); $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 else
{ {
$contacts->change_owner($account_id,$new_owner); $contacts->change_owner(intval($account_id),intval($new_owner));
} }
?> ?>

View File

@ -41,10 +41,10 @@
$str = '<select name="new_owner" size="5">'."\n"; $str = '<select name="new_owner" size="5">'."\n";
$users = $phpgw->accounts->get_list('accounts'); $users = $phpgw->accounts->get_list('accounts');
$c_users = count($users); $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++) 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"; $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?')); $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'); settype($account_id,'integer');
$account_id = get_account_id($accountid); $account_id = get_account_id($accountid);
$lid = $phpgw->accounts->id2name($account_id); $lid = $phpgw->accounts->id2name($account_id);
$phpgw->db->query('SELECT app_name FROM phpgw_applications WHERE app_enabled=1',__LINE__,__FILE__); $db = $phpgw->db;
if($phpgw->db->num_rows()) $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') if($appname <> 'admin')
{ {
$phpgw->common->hook_single('deleteaccount', $appname); $phpgw->common->hook_single('deleteaccount', $appname);

View File

@ -20,12 +20,12 @@
$calendar = CreateObject('calendar.calendar'); $calendar = CreateObject('calendar.calendar');
$cal_stream = $calendar->open('INBOX',$account_id,''); $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 else
{ {
$calendar->change_owner($account_id,$new_owner); $calendar->change_owner(intval($account_id),intval($new_owner));
} }
?> ?>