phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: infolog/inc class.boinfolog.inc.php,1.24,1.25 cl


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: infolog/inc class.boinfolog.inc.php,1.24,1.25 class.soinfolog.inc.php,1.15,1.16 class.uiinfolog.inc.php,1.49,1.50 hook_addressbook_view.inc.php,1.7,1.8
Date: Tue, 15 Oct 2002 20:23:41 -0400

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

Modified Files:
        class.boinfolog.inc.php class.soinfolog.inc.php 
        class.uiinfolog.inc.php hook_addressbook_view.inc.php 
Log Message:
got infolog working:
- referers are handled now correct
- hooks are working again (only addressbook::view ported so far)

Index: class.boinfolog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.boinfolog.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** class.boinfolog.inc.php     14 Oct 2002 00:39:47 -0000      1.24
--- class.boinfolog.inc.php     16 Oct 2002 00:23:39 -0000      1.25
***************
*** 26,30 ****
                        'readAddr'       => True,
                        'anzSubs'        => True,
!                       'readIdArray'    => True,
                        'get_rows'       => True,
                        'accountInfo'    => True,       // in class boinfolog 
(this class)
--- 26,30 ----
                        'readAddr'       => True,
                        'anzSubs'        => True,
!                       'search'         => True,
                        'get_rows'       => True,
                        'accountInfo'    => True,       // in class boinfolog 
(this class)
***************
*** 289,297 ****
                }
  
!               function 
readIdArray($order,$sort,$filter,$cat_id,$query,$action,$action_id,
!                                                                       
$ordermethod,&$start,&$total)
                {
!                       return 
$this->so->readIdArray($order,$sort,$filter,$cat_id,$query,
!                                                                               
                        $action,$action_id,$ordermethod,$start,$total);
                }
  
--- 289,297 ----
                }
  
!               function 
search($order,$sort,$filter,$cat_id,$query,$action,$action_id,
!                                                        
$ordermethod,&$start,&$total)
                {
!                       return 
$this->so->search($order,$sort,$filter,$cat_id,$query,
!                                                                               
         $action,$action_id,$ordermethod,$start,$total);
                }
  
***************
*** 479,485 ****
                {
                        $start = $total = 0;
!                       $ids = 
$this->readIdArray('','','','',$pattern,'','','',&$start,&$total);
                        $content = array();
!                       while (is_array($ids) && list( $id,$parent ) = each( 
$ids ))
                        {
                                $content[$id] = $this->link_title($id);
--- 479,485 ----
                {
                        $start = $total = 0;
!                       $ids = 
$this->search('','','','',$pattern,'','','',&$start,&$total);
                        $content = array();
!                       while (is_array($ids) && list( $id,$info ) = each( $ids 
))
                        {
                                $content[$id] = $this->link_title($id);

Index: class.soinfolog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.soinfolog.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** class.soinfolog.inc.php     14 Oct 2002 00:39:47 -0000      1.15
--- class.soinfolog.inc.php     16 Oct 2002 00:23:39 -0000      1.16
***************
*** 159,163 ****
                                                                                
'info_pri'    => 'normal' );
                }      
!                               
                function read($info_id)         // did _not_ ensure ACL
                {
--- 159,185 ----
                                                                                
'info_pri'    => 'normal' );
                }      
!               
!               function db2data(&$data)
!               {
!                       $data = $this->db->Record;
!                       reset($this->maybe_slashes);
!                       while (list($key) = each($this->maybe_slashes))
!                       {
!                               $data[$key] = stripslashes($data[$key]);
!                       }
! /*
!                       $links = 
$this->links->get_links('infolog',$this->data['info_id']);
!                       while (list($nul,$link) = each($links))
!                       {
!                               if ($link['app'] == 'addressbook')
!                                       $data['info_addr_id'] = $link['id'];
!                               if ($link['app'] == 'projects')
!                                       $data['info_proj_id'] = $link['id'];
!                               if ($link['app'] == 'calendar')
!                                       $data['info_event_id'] = $link['id'];
!                       }
! */
!               }
! 
                function read($info_id)         // did _not_ ensure ACL
                {
***************
*** 170,191 ****
                        if ($info_id != $this->data['info_id'])      // data 
yet read in
                        {
!                               $this->data = $this->db->Record;
!                               reset($this->maybe_slashes);
!                               while (list($key) = each($this->maybe_slashes))
!                               {
!                                       $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;         
                }
                
--- 192,198 ----
                        if ($info_id != $this->data['info_id'])      // data 
yet read in
                        {
!                               $this->db2data($this->data);
                        }
!                       return $this->data;
                }
                
***************
*** 253,256 ****
--- 260,267 ----
                function anzSubs( $info_id )
                {
+                       if ($info_id <= 0)
+                       {
+                               return 0;
+                       }
                        $this->db->query('select count(*) FROM phpgw_infolog 
where '.
                                                                  
"info_id_parent=$info_id",__LINE__,__FILE__);
***************
*** 261,295 ****
                }
  
!               function 
readIdArray($order,$sort,$filter,$cat_id,$query,$action,$action_id,
!                                                                       
$ordermethod,&$start,&$total)
                {
!                       //echo 
"<p>soinfolog.readIdArray(action='$action',action_id='$action_id')</p>\n";
                        $action2app = array(
                                'addr'        => 'addressbook',
-                               'addressbook' => 'addressbook',
                                'proj'        => 'projects',
!                               'projects'    => 'projects',
!                               'event'       => 'calendar',
!                               'calendar'    => 'calendar'
                        );
!                       if ($action != '' && isset($action2app[$action]))
                        {
!                               $links = 
$this->links->get_links($action2app[$action],$action_id);
!                               $total = count($links);
!                               if ($start > $total)
!                               {
!                                       $start = 0;
!                               }
!                               $ids = array();
!                               while (list($n,$link) = each($links) && 
!                                       $n < 
$start+$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'])
                                {
!                                       if ($n >= $start)
!                                       {
!                                               $ids[''.$link['id']] = 0;
!                                       }
                                }
-                               //echo 
"<p>soinfolog.readIdArray($action,$action_id) ids ="; _debug_array($ids);
-                               return $ids;
                        }
                        if ($order)
--- 272,296 ----
                }
  
!               function 
search($order,$sort,$filter,$cat_id,$query,$action,$action_id,
!                                                        
$ordermethod,&$start,&$total)
                {
!                       //echo 
"<p>soinfolog.search(action='$action/$action_id')</p>\n";
                        $action2app = array(
                                'addr'        => 'addressbook',
                                'proj'        => 'projects',
!                               'event'       => 'calendar'
                        );
!                       if (isset($action2app[$action]))
                        {
!                               $action = $action2app[$action];
!                       }
!                       if ($action != '')
!                       {
!                               $links = 
$this->links->get_links($action=='sp'?'infolog':$action,$action_id,'infolog');
!                       
!                               if (count($links))
                                {
!                                       $link_extra = ($action == 'sp' ? 'OR' : 
'AND').' info_id IN ('.implode(',',$links).')';
                                }
                        }
                        if ($order)
***************
*** 310,324 ****
                          $filtermethod .= " AND info_cat='$cat_id' ";
                        }
-                       /* not longer used
-                       switch ($action)
-                       {
-                               case 'addr':    $filtermethod .= " AND 
info_addr_id=$action_id ";
-                                                                       break;
-                               case 'proj':    $filtermethod .= " AND 
info_proj_id=$action_id ";
-                                                                       break;
-                               case 'event':   $filtermethod .= " AND 
info_event_id=$action_id ";
-                                                                       break;
-                       }
-                       */
                        if ($query)                       // we search in 
_from, _subject and _des for $query
                        {
--- 311,314 ----
***************
*** 333,351 ****
                                $pid = '';
                        }
!                       $this->db->query("SELECT COUNT(*) FROM phpgw_infolog 
WHERE $filtermethod $pid $sql_query",__LINE__,__FILE__);
  
!                       $this->db->next_record();
!                       $total = $this->db->f(0);
  
!                       if (!$start || $start > $total)
!                       {
!                               $start = 0;
                        }
!                       $this->db->limit_query($sql="SELECT 
info_id,info_id_parent FROM phpgw_infolog WHERE $filtermethod $pid $sql_query 
$ordermethod",$start,__LINE__,__FILE__);
!                       
!                       $ids = array( );
!                       while ($this->db->next_record())
                        {
!                               $ids[$this->db->f('info_id')] = 
$this->db->f('info_id_parent');
                        }
                        return $ids;
--- 323,349 ----
                                $pid = '';
                        }
!                       $ids = array( );
!                       if ($action == '' || $action == 'sp' || count($links))
!          {
!                               $this->db->query($sql="SELECT COUNT(*) FROM 
phpgw_infolog i WHERE ($filtermethod $pid $sql_query) 
$link_extra",__LINE__,__FILE__);
!                               
!                               $this->db->next_record();
!                               $total = $this->db->f(0);
  
!                               if (!$start || $start > $total)
!                               {
!                                       $start = 0;
!                               }
!                               $this->db->limit_query($sql="SELECT * FROM 
phpgw_infolog WHERE ($filtermethod $pid $sql_query) $link_extra 
$ordermethod",$start,__LINE__,__FILE__);
  
!                               while ($this->db->next_record())
!                               {
!                                       $this->db2data(&$info);
!                                       $ids[$info['info_id']] = $info;
!                               }
                        }
!                       else
                        {
!                               $start = $total = 0;
                        }
                        return $ids;

Index: class.uiinfolog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.uiinfolog.inc.php,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -r1.49 -r1.50
*** class.uiinfolog.inc.php     15 Oct 2002 13:30:23 -0000      1.49
--- class.uiinfolog.inc.php     16 Oct 2002 00:23:39 -0000      1.50
***************
*** 86,100 ****
                }
  
!               function get_info($id,&$readonlys,$action='',$action_id='')
                {
!                       $info = $this->bo->read($id);
!                       $info['anzSubs'] = $this->bo->anzSubs($id);
                        $info += $this->formatInfo($info,$action,$action_id);
                        $info['info_des'] = nl2br($info['info_des']);
  
                        $readonlys["edit[$id]"] = 
!$this->bo->check_access($id,PHPGW_ACL_EDIT);
                        $readonlys["delete[$id]"] = 
!$this->bo->check_access($id,PHPGW_ACL_DELETE);
                        $readonlys["sp[$id]"] = 
!$this->bo->check_access($id,PHPGW_ACL_ADD);
!                       $readonlys["view[$id]"] = $info['anzSubs'] < 1;
                        $readonlys['view[0]'] = True;   // no parent
  
--- 86,104 ----
                }
  
!               function get_info($info,&$readonlys,$action='',$action_id='')
                {
!                       if (!is_array($info))
!                       {
!                               $info = $this->bo->read($info);
!                       }
!                       $id = $info['info_id'];
                        $info += $this->formatInfo($info,$action,$action_id);
                        $info['info_des'] = nl2br($info['info_des']);
+                       $info['info_anz_subs'] = $this->bo->anzSubs($id);
  
                        $readonlys["edit[$id]"] = 
!$this->bo->check_access($id,PHPGW_ACL_EDIT);
                        $readonlys["delete[$id]"] = 
!$this->bo->check_access($id,PHPGW_ACL_DELETE);
                        $readonlys["sp[$id]"] = 
!$this->bo->check_access($id,PHPGW_ACL_ADD);
!                       $readonlys["view[$id]"] = $info['info_anz_subs'] < 1;
                        $readonlys['view[0]'] = True;   // no parent
  
***************
*** 106,113 ****
                        //echo 
"<p>uiinfolog.get_rows(start=$query[start],search='$query[search]',filter='$query[filter]',cat_id=$query[cat_id],action='$query[action]/$query[action_id]')</p>\n";
  
!                       $ids = 
$this->bo->readIdArray($query['order'],$query['sort'],$query['filter'],$query['cat_id'],
                                
$query['search'],$query['action'],$query['action_id'],$query['ordermethod'],
                                $query['start'],$total);
! 
                        if (!is_array($ids))
                        {
--- 110,117 ----
                        //echo 
"<p>uiinfolog.get_rows(start=$query[start],search='$query[search]',filter='$query[filter]',cat_id=$query[cat_id],action='$query[action]/$query[action_id]')</p>\n";
  
!                       $ids = 
$this->bo->search($query['order'],$query['sort'],$query['filter'],$query['cat_id'],
                                
$query['search'],$query['action'],$query['action_id'],$query['ordermethod'],
                                $query['start'],$total);
!                       
                        if (!is_array($ids))
                        {
***************
*** 116,122 ****
                        $rows = array( $total );
                        $readonlys = array();
!                       while (list($id,$parent) = each($ids))
                        {
!                               $rows[] = 
$this->get_info($id,$readonlys,$query['action'],$query['action_id']);
                        }
                        //echo "<p>readonlys = "; _debug_array($readonlys);
--- 120,126 ----
                        $rows = array( $total );
                        $readonlys = array();
!                       while (list($id,$info) = each($ids))
                        {
!                               $rows[] = 
$this->get_info($info,$readonlys,$query['action'],$query['action_id']);
                        }
                        //echo "<p>readonlys = "; _debug_array($readonlys);
***************
*** 126,191 ****
                }
  
-               function delete($values=0,$referer='')
-               {
-                       $info_id = is_array($values) ? $values['info_id'] : 
$values;
-                       $referer = is_array($values) ? $values['referer'] : 
$referer;
- 
-                       if (is_array($values) || $info_id <= 0)
-                       {
-                               if ($values['delete'] && $info_id > 0 && 
$this->bo->check_access($info_id,PHPGW_ACL_DELETE))
-                               {
-                                       $this->bo->delete($info_id);
-                               }
-                               return $referer ? $this->tmpl->header($referer) 
: $this->index();
-                       }
-                       $readonlys = $values = array();
-                       $values['main'][1] = 
$this->get_info($info_id,&$readonlys['main']);
-                       
-                       $this->tmpl->read('infolog.delete');
- 
-                       $values['main']['no_actions'] = True;
-                       $persist['info_id'] = $info_id;
-                       $persist['referer'] = $referer;
- 
-                       
$this->tmpl->exec('infolog.uiinfolog.delete',$values,'',$readonlys,$persist);
-               }
- 
                function index($values = 0,$action='',$action_id='',$referer=0)
                {
                        $referer = is_array($values) ? $values['referer'] : 
$referer;
                        if (!is_array($values))
                        {
                                $values = array('nm' => 
$GLOBALS['phpgw']->session->appsession('session_data','infolog'));
                        }
!                       $action = $action ? $action : $values['nm']['action'];
!                       $action_id = $action_id ? $action_id : 
$values['nm']['action_id'];
! 
!                       if ($values['add'] || $values['cancel'] || 
isset($values['nm']['rows']) || isset($values['main']))
                        {
                                $data = $values['nm'];
                                unset($data['rows']);
                                
$GLOBALS['phpgw']->session->appsession('session_data','infolog',$data);
  
                                if ($values['add'])
                                {
                                        list($type) = each($values['add']);
!                                       return 
$this->edit(0,$values['nm']['action'],$values['nm']['action_id'],$type,$referer);
                                }
                                else
                                {
!                                       list($action,$action_id) = 
isset($values['main']) ? each($values['main']) : @each($values['nm']['rows']);
!                                       list($action_id) = @each($action_id);
!                                       //echo "<p>infolog::index: 
action='$action', id='$action_id'</p>\n";
!                                       switch($action)
                                        {
                                                case 'edit':
!                                                       return 
$this->edit($action_id,'','','',$referer);
                                                case 'delete':
!                                                       return 
$this->delete($action_id,$referer);
                                                case 'sp':
!                                                       return 
$this->edit(0,$action,$action_id,'',$referer);
                                                case 'view':
                                                        $value = array();
                                                        $action = 'sp';
                                                        break;
                                                default:
--- 130,176 ----
                }
  
                function index($values = 0,$action='',$action_id='',$referer=0)
                {
                        $referer = is_array($values) ? $values['referer'] : 
$referer;
+                       //echo 
"<p>uiinfolog::index(action='$action/$action_id',referer='$referer/$values[referer]')</p>\n";
+                       
                        if (!is_array($values))
                        {
                                $values = array('nm' => 
$GLOBALS['phpgw']->session->appsession('session_data','infolog'));
                        }
!                       else
                        {
                                $data = $values['nm'];
                                unset($data['rows']);
                                
$GLOBALS['phpgw']->session->appsession('session_data','infolog',$data);
+                       }
+                       $action = $action ? $action : $values['action'];
+                       $action_id = $action_id ? $action_id : 
$values['action_id'];
+ 
+                       if ($values['add'] || $values['cancel'] || 
isset($values['nm']['rows']) || isset($values['main']))
+                       {
  
                                if ($values['add'])
                                {
                                        list($type) = each($values['add']);
!                                       return 
$this->edit(0,$action,$action_id,$type,$referer);
                                }
                                else
                                {
!                                       list($do,$do_id) = 
isset($values['main']) ? each($values['main']) : @each($values['nm']['rows']);
!                                       list($do_id) = @each($do_id);
!                                       //echo "<p>infolog::index: 
do='$do/$do_id', referer="; _debug_array($referer);
!                                       switch($do)
                                        {
                                                case 'edit':
!                                                       return 
$this->edit($do_id,$action,$action_id,'',$referer);
                                                case 'delete':
!                                                       return 
$this->delete($do_id,$referer);
                                                case 'sp':
!                                                       return 
$this->edit(0,'sp',$do_id,'',$referer);
                                                case 'view':
                                                        $value = array();
                                                        $action = 'sp';
+                                                       $action_id = $do_id;
                                                        break;
                                                default:
***************
*** 202,206 ****
                                        if (!$this->bo->read($action_id))
                                        {
!                                               $action = ''; 
                                                $action_id = 0;
                                                break;
--- 187,191 ----
                                        if (!$this->bo->read($action_id))
                                        {
!                                               $action = '';
                                                $action_id = 0;
                                                break;
***************
*** 217,229 ****
                        $values['nm']['get_rows'] = 
'infolog.uiinfolog.get_rows';
                        $values['nm']['no_filter2'] = True;
!                       $persist['nm']['action'] = $values['nm']['action'] = 
$action;
!                       $persist['nm']['action_id'] = 
$values['nm']['action_id'] = $action_id;
                        $persist['referer'] = $referer;
-                       
-                       
$GLOBALS['phpgw']->session->appsession('session_data','infolog',$values['nm']);
  
                        
$this->tmpl->exec('infolog.uiinfolog.index',$values,'',$readonlys,$persist);
                }
  
                /*!
                @function edit
--- 202,237 ----
                        $values['nm']['get_rows'] = 
'infolog.uiinfolog.get_rows';
                        $values['nm']['no_filter2'] = True;
!                       $persist['action'] = $values['nm']['action'] = $action;
!                       $persist['action_id'] = $values['nm']['action_id'] = 
$action_id;
                        $persist['referer'] = $referer;
  
                        
$this->tmpl->exec('infolog.uiinfolog.index',$values,'',$readonlys,$persist);
                }
  
+               function delete($values=0,$referer='')
+               {
+                       $info_id = is_array($values) ? $values['info_id'] : 
$values;
+                       $referer = is_array($values) ? $values['referer'] : 
$referer;
+ 
+                       if (is_array($values) || $info_id <= 0)
+                       {
+                               if ($values['delete'] && $info_id > 0 && 
$this->bo->check_access($info_id,PHPGW_ACL_DELETE))
+                               {
+                                       $this->bo->delete($info_id);
+                               }
+                               return $referer ? 
$this->tmpl->location($referer) : $this->index();
+                       }
+                       $readonlys = $values = array();
+                       $values['main'][1] = 
$this->get_info($info_id,&$readonlys['main']);
+ 
+                       $this->tmpl->read('infolog.delete');
+ 
+                       $values['main']['no_actions'] = True;
+                       $persist['info_id'] = $info_id;
+                       $persist['referer'] = $referer;
+ 
+                       
$this->tmpl->exec('infolog.uiinfolog.delete',$values,'',$readonlys,$persist);
+               }
+ 
                /*!
                @function edit
***************
*** 238,251 ****
                function edit($content = 0,$action = 
'',$action_id=0,$type='',$referer='')
                {
-                       $referer = is_array($content) ? $content['referer'] : 
$referer;
- 
-                       if (is_array($values) || $info_id < 0)
-                       {
-                               if ($values['delete'] && $info_id > 0 && 
$this->bo->check_access($info_id,PHPGW_ACL_DELETE))
-                               {
-                                       $this->bo->delete($info_id);
-                               }
-                               return $referer ? $this->tmpl->header($referer) 
: $this->index();
-                       }
                        if (is_array($content))
                        {
--- 246,249 ----
***************
*** 253,257 ****
                                $action    = $content['action'];
                                $action_id = $content['action_id'];
! 
                                if ($content['save'] || $content['delete'] || 
$content['cancel'])
                                {
--- 251,256 ----
                                $action    = $content['action'];
                                $action_id = $content['action_id'];
!                               $referer   = $content['referer'];
!                               
                                if ($content['save'] || $content['delete'] || 
$content['cancel'])
                                {
***************
*** 267,273 ****
                                        elseif ($content['delete'] && $info_id 
> 0)
                                        {
                                                return 
$this->delete($info_id,$referer);        // checks ACL first
                                        }
!                                       return $referer ? 
$this->tmpl->header($referer) : $this->index();
                                }
                        }
--- 266,277 ----
                                        elseif ($content['delete'] && $info_id 
> 0)
                                        {
+                                               if (!$referer && $action) 
$referer = array(
+                                                       'menuaction' => 
'infolog.uiinfolog.index',
+                                                       'action' => $action,
+                                                       'action_id' => 
$action_id
+                                               );
                                                return 
$this->delete($info_id,$referer);        // checks ACL first
                                        }
!                                       return $referer ? 
$this->tmpl->location($referer) : $this->index(0,$action,$action_id);
                                }
                        }
***************
*** 279,297 ****
                                $info_id   = $content   ? $content   : 
get_var('info_id',  array('POST','GET'));
                                $type      = $type      ? $type      : 
get_var('type',     array('POST','GET'));
!                               $referer   = ''.$referer != '' ? $referer : 
get_var('HTTP_REFERER','SERVER');
                                //echo "<p>uiinfolog::edit: info_id=$info_id,  
action='$action', action_id='$action_id', type='$type', 
referer='$referer'</p>\n";
! 
                                if (!isset($this->bo->enums['type'][$type]))
                                {
                                        $type = 'note';
                                }
!                               $this->bo->read( $action == 'sp' && $action_id 
> 0 ? $action_id : $info_id );
                                $content = $this->bo->so->data;
  
!                               if ($action_id && $action == 'sp')    // new 
SubProject
                                {
                                        if 
(!$this->bo->check_access($action_id,PHPGW_ACL_ADD))
                                        {
!                                               return $referer ? 
$this->tmpl->header($referer) : $this->index();
                                        }
                                        $parent = $this->bo->so->data;
--- 283,303 ----
                                $info_id   = $content   ? $content   : 
get_var('info_id',  array('POST','GET'));
                                $type      = $type      ? $type      : 
get_var('type',     array('POST','GET'));
!                               $referer   = $referer !== '' ? $referer : 
!                                       
ereg_replace('^.*'.$GLOBALS['phpgw_info']['server']['webserver_url'],'',
!                                       
get_var('HTTP_REFERER',Array('GLOBAL')));
                                //echo "<p>uiinfolog::edit: info_id=$info_id,  
action='$action', action_id='$action_id', type='$type', 
referer='$referer'</p>\n";
!                               
                                if (!isset($this->bo->enums['type'][$type]))
                                {
                                        $type = 'note';
                                }
!                               $this->bo->read( $info_id || $action != 'sp' ? 
$info_id : $action_id );
                                $content = $this->bo->so->data;
  
!                               if (!$info_id && $action_id && $action == 'sp') 
   // new SubProject
                                {
                                        if 
(!$this->bo->check_access($action_id,PHPGW_ACL_ADD))
                                        {
!                                               return $referer ? 
$this->tmpl->location($referer) : $this->index(0,$action,$action_id);
                                        }
                                        $parent = $this->bo->so->data;
***************
*** 316,320 ****
                                        if ($info_id && 
!$this->bo->check_access($info_id,PHPGW_ACL_EDIT))
                                        {
!                                               return $referer ? 
$this->tmpl->header($referer) : $this->index();
                                        }
                                }
--- 322,326 ----
                                        if ($info_id && 
!$this->bo->check_access($info_id,PHPGW_ACL_EDIT))
                                        {
!                                               return $referer ? 
$this->tmpl->location($referer) : $this->index(0,$action,$action_id);
                                        }
                                }
***************
*** 344,348 ****
                        }
                        $readonlys['delete'] = $action != '';
!                       $content['appheader'] = $this->messages[$action ? 
($action == 'sp' ? 'add_sub' : 'add') : 'edit'];
  
                        //echo "<p>uiinfolog.edit(info_id=$info_id,mode=$mode) 
content = "; _debug_array($content);
--- 350,354 ----
                        }
                        $readonlys['delete'] = $action != '';
!                       $content['appheader'] = $this->messages[$info_id ? 
'edit' : ($action == 'sp' ? 'add_sub' : 'add')];
  
                        //echo "<p>uiinfolog.edit(info_id=$info_id,mode=$mode) 
content = "; _debug_array($content);
***************
*** 358,362 ****
                                'action'    => $action,
                                'action_id' => $action_id,
!                               'referer'   => $referer
                        ));
                }
--- 364,369 ----
                                'action'    => $action,
                                'action_id' => $action_id,
!                               'referer'   => $referer,
!                               'link_to'   => array('to_id' => 
$content['link_to']['to_id'])   // in case tab gets not viewed
                        ));
                }
***************
*** 728,733 ****
                        // -------------- end header declaration 
-----------------
  
!                       $ids = 
$this->bo->readIdArray($order,$sort,$filter,$cat_id,$query,
!                                                                               
                        $action,$action_id,$ordermethod,$start,$total);
  
                        $maxmatchs = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
--- 735,740 ----
                        // -------------- end header declaration 
-----------------
  
!                       $ids = 
$this->bo->search($order,$sort,$filter,$cat_id,$query,
!                                                                               
         $action,$action_id,$ordermethod,$start,$total);
  
                        $maxmatchs = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
***************
*** 798,802 ****
                                
$GLOBALS['phpgw']->template->set_var('info_headers','');
                        }
!                       while (list($id,$parent) = each($ids))
                        {
                                $subproact = $this->bo->anzSubs($id);
--- 805,809 ----
                                
$GLOBALS['phpgw']->template->set_var('info_headers','');
                        }
!                       while (list($id,$info) = each($ids))
                        {
                                $subproact = $this->bo->anzSubs($id);
***************
*** 804,808 ****
                                
$this->nextmatchs->template_alternate_row_color($GLOBALS['phpgw']->template);
  
!                               $GLOBALS['phpgw']->template->set_var( 
$this->formatInfo( $id,$action,$action_id ));
  
                                if ($this->bo->check_access($id,PHPGW_ACL_EDIT))
--- 811,815 ----
                                
$this->nextmatchs->template_alternate_row_color($GLOBALS['phpgw']->template);
  
!                               $GLOBALS['phpgw']->template->set_var( 
$this->formatInfo( $info,$action,$action_id ));
  
                                if ($this->bo->check_access($id,PHPGW_ACL_EDIT))

Index: hook_addressbook_view.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/hook_addressbook_view.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** hook_addressbook_view.inc.php       29 Sep 2002 08:40:51 -0000      1.7
--- hook_addressbook_view.inc.php       16 Oct 2002 00:23:39 -0000      1.8
***************
*** 1,31 ****
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - Info Log administration                                
   *
!       * http://www.phpgroupware.org                                           
   *
!       * --------------------------------------------                          
   *
!       *  This program is free software; you can redistribute it and/or modify 
it *
!       *  under the terms of the GNU General Public License as published by 
the   *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
!       *  option) any later version.                                           
   *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       $save_app = $GLOBALS['phpgw_info']['flags']['currentapp']; 
!       $GLOBALS['phpgw_info']['flags']['currentapp'] = 'infolog'; 
! 
!       $GLOBALS['phpgw']->translation->add_app('infolog');
! 
!       /* echo "<p>hook_addressbook_view(ab_id=$ab_id)</p>"; */
! 
!       $link = CreateObject('infolog.uilink');
!       $out = 
'<table>'.$link->getEntry('entry','addressbook',$GLOBALS['ab_id'])."\n".
!                        
$link->showLinks('links','addressbook',$GLOBALS['ab_id'],'!infolog')."</table>\n";
!       $html = CreateObject('etemplate.html');
!       $out = 
$html->form($out,'','/index.php',array('menuaction'=>'addressbook.uiaddressbook.view','ab_id'=>$GLOBALS['ab_id']));
!       $GLOBALS['phpgw']->template->set_var('phpgw_body',$out,True);
! 
!       $infolog = CreateObject('infolog.uiinfolog');
!       $infolog->get_list(True,'addr',$GLOBALS['ab_id']);
! 
!       $GLOBALS['phpgw_info']['flags']['currentapp'] = $save_app;
--- 1,33 ----
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - Info Log administration                                
   *
!       * http://www.phpgroupware.org                                           
   *
!       * --------------------------------------------                          
   *
!       *  This program is free software; you can redistribute it and/or modify 
it *
!       *  under the terms of the GNU General Public License as published by 
the   *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
!       *  option) any later version.                                           
   *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       $save_app = $GLOBALS['phpgw_info']['flags']['currentapp']; 
!       $GLOBALS['phpgw_info']['flags']['currentapp'] = 'infolog'; 
! 
!       $GLOBALS['phpgw']->translation->add_app('infolog');
! 
!       //echo "<p>hook_addressbook_view(ab_id=$GLOBALS[ab_id])</p>\n";
! /*
!       $link = CreateObject('infolog.uilink');
!       $out = 
'<table>'.$link->getEntry('entry','addressbook',$GLOBALS['ab_id'])."\n".
!                        
$link->showLinks('links','addressbook',$GLOBALS['ab_id'],'!infolog')."</table>\n";
!       $html = CreateObject('etemplate.html');
!       $out = 
$html->form($out,'','/index.php',array('menuaction'=>'addressbook.uiaddressbook.view','ab_id'=>$GLOBALS['ab_id']));
!       $GLOBALS['phpgw']->template->set_var('phpgw_body',$out,True);
! */
!       $infolog = CreateObject('infolog.uiinfolog');
!       $infolog->index(0,'addressbook',$GLOBALS['ab_id'],array(
!               'menuaction' => 'addressbook.uiaddressbook.view',
!               'ab_id' => $GLOBALS['ab_id']
!       ));
!       $GLOBALS['phpgw_info']['flags']['currentapp'] = $save_app;





reply via email to

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