phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: infolog/inc class.soinfolog.inc.php,1.12,1.13


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: infolog/inc class.soinfolog.inc.php,1.12,1.13
Date: Sun, 01 Sep 2002 16:41:16 -0400

Update of /cvsroot/phpgroupware/infolog/inc
In directory subversions:/tmp/cvs-serv17238

Modified Files:
        class.soinfolog.inc.php 
Log Message:
moved infolog links to addressbook,projects and calendar to new link-class and 
its table phpgw_links

Index: class.soinfolog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.soinfolog.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.soinfolog.inc.php     12 May 2002 07:13:09 -0000      1.12
--- class.soinfolog.inc.php     1 Sep 2002 20:41:14 -0000       1.13
***************
*** 30,33 ****
--- 30,35 ----
                        $this->user   = 
$GLOBALS['phpgw_info']['user']['account_id'];
  
+                       $this->links = CreateObject('infolog.solink');
+ 
                        $this->read( $info_id );
                }
***************
*** 174,177 ****
--- 176,189 ----
                                        $this->data[$key] = 
stripslashes($this->data[$key]);
                                }
+                               $links = 
$this->links->get_links('infolog',$this->data['info_id']);
+                               while (list($nul,$link) = each($links))
+                               {
+                                       if ($link['app'] == 'addressbook')
+                                               $this->data['info_addr_id'] = 
$link['id'];
+                                       if ($link['app'] == 'projects')
+                                               $this->data['info_proj_id'] = 
$link['id'];
+                                       if ($link['app'] == 'calendar')
+                                               $this->data['info_event_id'] = 
$link['id'];
+                               }
                        }
                        return $this->data;         
***************
*** 184,187 ****
--- 196,201 ----
                                . " or (info_owner='$this->user'))" 
,__LINE__,__FILE__);
                                
+                       $this->links->unlink(0,'infolog',$info_id);
+ 
                        if ($this->data['info_id'] == $info_id)
                        {
***************
*** 200,203 ****
--- 214,220 ----
                                        $this->data[$key] = $val;   // update 
internal data
  
+                                       if ($key == 'info_addr_id' || $key == 
'info_proj_id' || $key == 'info_event_id')
+                                               continue;       // not longer 
in infolog-table
+ 
                                        if ($this->maybe_slashes[$key])
                                        {
***************
*** 209,217 ****
                                }
                        }
!                       if ($values['info_id'])
                        {
                                $query = "UPDATE phpgw_infolog SET $query where 
info_id='".$values['info_id']."'";
!                               $this->db->query($query,__LINE__,__FILE__);     
    
!                               $this->data['info_id'] = $values['info_id'];
                        }
                        else
--- 226,235 ----
                                }
                        }
!                       if (($this->data['info_id'] = $values['info_id']) > 0)
                        {
                                $query = "UPDATE phpgw_infolog SET $query where 
info_id='".$values['info_id']."'";
!                               $this->db->query($query,__LINE__,__FILE__);
! 
!                               
$this->links->unlink(0,'infolog',$values['info_id']);
                        }
                        else
***************
*** 221,224 ****
--- 239,250 ----
                                
$this->data['info_id']=$this->db->get_last_insert_id('phpgw_infolog','info_id');
                        }
+                       // echo "<p>soinfolog.write values= "; 
_debug_array($values);
+                       // echo "<p>soinfolog.write this->data= "; 
_debug_array($this->data);
+                       if ($this->data['info_addr_id'])
+                               
$this->links->link('infolog',$this->data['info_id'],'addressbook',$this->data['info_addr_id']);
+                       if ($this->data['info_proj_id'])
+                               
$this->links->link('infolog',$this->data['info_id'],'projects',$this->data['info_proj_id']);
+                       if ($this->data['info_event_id'])
+                               
$this->links->link('infolog',$this->data['info_id'],'calendar',$this->data['info_event_id']);
                }
  
***************
*** 236,239 ****
--- 262,282 ----
                                                                        
$ordermethod,&$start,&$total)
                {
+                       //echo 
"<p>soinfolog.readIdArray(action='$action',action_id='$action_id')</p>\n";
+                       $action2app = array(
+                               'addr' => 'addressbook',
+                               'proj' => 'projects',
+                               'event' => 'calendar'
+                       );
+                       if ($action != '' && $action2app[$action] != '')
+                       {
+                               $links = 
$this->links->get_links($action2app[$action],$action_id);
+                               $ids = array();
+                               while (list($nul,$link) = each($links))
+                               {
+                                       $ids[''.$link['id']] = 0;
+                               }
+                               //echo 
"<p>soinfolog.readIdArray($action,$action_id) ids ="; _debug_array($ids);
+                               return $ids;
+                       }
                        if ($order)
                        {
***************
*** 251,255 ****
                        if ($cat_id)
                        {
!                         $filtermethod .= " AND info_cat='$cat_id' "; 
                        }
                        switch ($action)
--- 294,298 ----
                        if ($cat_id)
                        {
!                         $filtermethod .= " AND info_cat='$cat_id' ";
                        }
                        switch ($action)





reply via email to

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