phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: projects/inc class.boprojects.inc.php,1.43,1.44


From: Bettina Gille <address@hidden>
Subject: [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
Date: Fri, 03 May 2002 18:13:33 -0400

Update of /cvsroot/phpgroupware/projects/inc
In directory subversions:/tmp/cvs-serv26915/inc

Modified Files:
        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.43
retrieving revision 1.44
diff -C2 -r1.43 -r1.44
*** class.boprojects.inc.php    14 Mar 2002 02:06:14 -0000      1.43
--- class.boprojects.inc.php    3 May 2002 22:13:31 -0000       1.44
***************
*** 627,631 ****
                function delete_pa($action, $pa_id, $subs)
                {
!                       $this->soprojects->delete_pa($action, $pa_id, $subs);
                }
  
--- 627,638 ----
                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.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** class.soprojects.inc.php    2 May 2002 14:01:27 -0000       1.37
--- class.soprojects.inc.php    3 May 2002 22:13:31 -0000       1.38
***************
*** 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.2
diff -C2 -r1.1 -r1.2
*** hook_deleteaccount.inc.php  3 Jan 2002 15:36:49 -0000       1.1
--- hook_deleteaccount.inc.php  3 May 2002 22:13:31 -0000       1.2
***************
*** 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]