[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: projects/inc class.boprojects.inc.php,1.42,1.42.
From: |
Bettina Gille <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: projects/inc class.boprojects.inc.php,1.42,1.42.2.1 class.soprojects.inc.php,1.34.2.3,1.34.2.4 hook_deleteaccount.inc.php,1.1,1.1.2.1 |
Date: |
Fri, 03 May 2002 18:13:53 -0400 |
Update of /cvsroot/phpgroupware/projects/inc
In directory subversions:/tmp/cvs-serv26939/inc
Modified Files:
Tag: Version-0_9_14-branch
class.boprojects.inc.php class.soprojects.inc.php
hook_deleteaccount.inc.php
Log Message:
update delete function
Index: class.boprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.boprojects.inc.php,v
retrieving revision 1.42
retrieving revision 1.42.2.1
diff -C2 -r1.42 -r1.42.2.1
*** class.boprojects.inc.php 9 Jan 2002 01:06:53 -0000 1.42
--- class.boprojects.inc.php 3 May 2002 22:13:50 -0000 1.42.2.1
***************
*** 636,640 ****
function delete_pa($action, $pa_id, $subs)
{
! $this->soprojects->delete_pa($action, $pa_id, $subs);
}
--- 636,647 ----
function delete_pa($action, $pa_id, $subs)
{
! if ($action == 'account')
! {
!
$this->soprojects->delete_account_project_data($pa_id);
! }
! else
! {
! $this->soprojects->delete_pa($action, $pa_id,
$subs);
! }
}
Index: class.soprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.soprojects.inc.php,v
retrieving revision 1.34.2.3
retrieving revision 1.34.2.4
diff -C2 -r1.34.2.3 -r1.34.2.4
*** class.soprojects.inc.php 2 May 2002 14:01:05 -0000 1.34.2.3
--- class.soprojects.inc.php 3 May 2002 22:13:50 -0000 1.34.2.4
***************
*** 899,963 ****
}
! function delete_pa($action, $pa_id, $subs = False)
{
! if ($action == 'co')
{
! $pro_id = $pa_id;
! $this->db->query("delete from phpgw_p_hours
where employee='" . $pro_id . "'",__LINE__,__FILE__);
! $this->db->query("select id from
phpgw_p_projects where coordinator='" . $pro_id . "'",__LINE__,__FILE__);
while ($this->db->next_record())
{
! $pa_id[] = array
! (
! 'id' => $this->db->f('id')
! );
}
! if (is_array($pa_id))
{
! $action = 'subs';
! }
! }
!
! switch ($action)
! {
! case 'mains': $p_table = ' phpgw_p_projects';
break;
! case 'subs' : $p_table = '
phpgw_p_projects'; break;
! case 'act' : $p_table = '
phpgw_p_activities '; break;
! }
- if (is_array($pa_id))
- {
- while (list($null,$drop) = each($pa_id))
- {
- $drop_list[] = $drop;
- }
- reset($drop_list);
- // _debug_array($drop_list);
- // exit;
-
- if ($subs)
- {
$subdelete = " OR parent in (" .
implode(',',$drop_list) . ")";
- }
! $this->db->query("DELETE from $p_table where id
in (" . implode(',',$drop_list) . ")" . $subdelete,__LINE__,__FILE__);
!
! if ($action == 'act')
! {
! $this->db->query("DELETE from
phpgw_p_projectactivities where activity_id in ("
! .
implode(',',$drop_list) . ")",__LINE__,__FILE__);
! }
!
! if ($action == 'mains' || $action == 'subs')
! {
! if ($subs)
! {
! $subdelete = " or pro_parent in
(" . implode(',',$drop_list) . ")";
! }
!
! $this->db->query("DELETE from
phpgw_p_hours where project_id in (" . implode(',',$drop_list) . ")"
! .
$subdelete,__LINE__,__FILE__);
$this->db->query("select id from
phpgw_p_delivery where project_id in (" . implode(',',$drop_list) .
")",__LINE__,__FILE__);
--- 899,924 ----
}
! function delete_account_project_data($account_id)
{
! if ($account_id && $account_id != 0)
{
! $this->db->query("delete from phpgw_p_hours
where employee='" . $account_id . "'",__LINE__,__FILE__);
! $this->db->query("select id from
phpgw_p_projects where coordinator='" . $account_id . "'",__LINE__,__FILE__);
while ($this->db->next_record())
{
! $drop_list[] = $this->db->f('id');
}
! if (is_array($drop_list))
{
! reset($drop_list);
! // _debug_array($drop_list);
! // exit;
$subdelete = " OR parent in (" .
implode(',',$drop_list) . ")";
! $this->db->query("DELETE from
phpgw_p_projects where id in (" . implode(',',$drop_list) . ")"
! .
$subdelete,__LINE__,__FILE__);
$this->db->query("select id from
phpgw_p_delivery where project_id in (" . implode(',',$drop_list) .
")",__LINE__,__FILE__);
***************
*** 982,986 ****
while ($this->db->next_record())
{
! $del[] = array
(
'id' =>
$this->db->f('id')
--- 943,947 ----
while ($this->db->next_record())
{
! $inv[] = array
(
'id' =>
$this->db->f('id')
***************
*** 988,994 ****
}
! for ($i=0;$i<=count($del);$i++)
{
! $this->db->query("Delete from
phpgw_p_invoicepos where invoice_id='" . $del[$i]['id'] .
"'",__LINE__,__FILE__);
}
--- 949,955 ----
}
! for ($i=0;$i<=count($inv);$i++)
{
! $this->db->query("Delete from
phpgw_p_invoicepos where invoice_id='" . $inv[$i]['id'] .
"'",__LINE__,__FILE__);
}
Index: hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C2 -r1.1 -r1.1.2.1
*** hook_deleteaccount.inc.php 3 Jan 2002 15:36:49 -0000 1.1
--- hook_deleteaccount.inc.php 3 May 2002 22:13:50 -0000 1.1.2.1
***************
*** 16,20 ****
if(intval($GLOBALS['HTTP_POST_VARS']['new_owner']) == 0)
{
!
$pro->delete_pa('co',intval($GLOBALS['HTTP_POST_VARS']['account_id']),True);
}
else
--- 16,20 ----
if(intval($GLOBALS['HTTP_POST_VARS']['new_owner']) == 0)
{
!
$pro->delete_pa('account',intval($GLOBALS['HTTP_POST_VARS']['account_id']),False);
}
else
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: projects/inc class.boprojects.inc.php,1.42,1.42.2.1 class.soprojects.inc.php,1.34.2.3,1.34.2.4 hook_deleteaccount.inc.php,1.1,1.1.2.1,
Bettina Gille <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: projects/inc class.boprojects.inc.php,1.43,1.44 class.soprojects.inc.php,1.37,1.38 hook_deleteaccount.inc.php,1.1,1.2
- Next by Date:
[Phpgroupware-cvs] CVS: phpgwapi/setup phpgw_de.lang,1.24.2.2,1.24.2.3
- Previous by thread:
[Phpgroupware-cvs] CVS: projects/inc class.boprojects.inc.php,1.43,1.44 class.soprojects.inc.php,1.37,1.38 hook_deleteaccount.inc.php,1.1,1.2
- Next by thread:
[Phpgroupware-cvs] CVS: phpgwapi/setup phpgw_de.lang,1.24.2.2,1.24.2.3
- Index(es):