phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.uidrawing.inc.php,1.20,1.21 c


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.uidrawing.inc.php,1.20,1.21 class.uidocument.inc.php,1.12,1.13 class.sodrawing.inc.php,1.7,1.8 class.sodocument.inc.php,1.7,1.8 class.boreport.inc.php,1.6,1.7 class.bolocation.inc.php,1.18,1.19 class.bodrawing.inc.php,1.5,1.6 class.bocommon.inc.php,1.60,1.61
Date: Fri, 27 Jun 2003 07:14:53 -0400

Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv4980/inc

Modified Files:
        class.uidrawing.inc.php class.uidocument.inc.php 
        class.sodrawing.inc.php class.sodocument.inc.php 
        class.boreport.inc.php class.bolocation.inc.php 
        class.bodrawing.inc.php class.bocommon.inc.php 
Log Message:
no message

Index: class.uidrawing.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uidrawing.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** class.uidrawing.inc.php     12 Jun 2003 20:51:13 -0000      1.20
--- class.uidrawing.inc.php     27 Jun 2003 11:14:51 -0000      1.21
***************
*** 35,42 ****
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->grants                           = 
$GLOBALS['phpgw']->acl->get_grants($this->currentapp);
-                       $this->grants[$this->account] = PHPGW_ACL_READ + 
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
                        $this->bo                                       = 
CreateObject($this->currentapp.'.bodrawing',True);
                        $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
                        $this->rootdir                          = 
$this->bo->basedir;
                        $this->fakebase                         = 
$this->bo->fakebase;
--- 35,49 ----
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                                       = 
CreateObject($this->currentapp.'.bodrawing',True);
                        $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
+                       $this->bolocation                       = 
CreateObject($this->currentapp.'.bolocation');
+                       $this->config                           = 
CreateObject('phpgwapi.config',$this->currentapp);
+ 
+                       $this->acl2                             = 
CreateObject($this->currentapp.'.acl2');
+                       $this->acl_read                         = 
$this->acl2->check('.drawing',1);
+                       $this->acl_add                          = 
$this->acl2->check('.drawing',2);
+                       $this->acl_edit                         = 
$this->acl2->check('.drawing',4);
+                       $this->acl_delete                       = 
$this->acl2->check('.drawing',8);
+ 
                        $this->rootdir                          = 
$this->bo->basedir;
                        $this->fakebase                         = 
$this->bo->fakebase;
***************
*** 71,75 ****
                {
  
!                       $GLOBALS['phpgw']->xslttpl->add_file(array('drawing',
                                                                                
'menu',
                                                                                
'nextmatchs',
--- 78,82 ----
                {
  
!                       
$GLOBALS['phpgw']->xslttpl->add_file(array('drawing','values','table_header',
                                                                                
'menu',
                                                                                
'nextmatchs',
***************
*** 78,166 ****
                        $links = $this->bocommon->menu();
  
                        $drawing_list = $this->bo->read();
  
! //_debug_array($drawing_list);
  
!                       while (is_array($drawing_list) && list(,$drawing) = 
each($drawing_list))
                        {
!                               $location       = split("-", 
$drawing['location_code']);
  
!                               $content[] = array
!                               (
!                                       'drawing_id'                            
=> $drawing['drawing_id'],
!                                       'drawing_name'                          
=> $drawing['drawing_name'],
!                                       'property_id'                           
=> $location[0],
!                                       'building_id'                           
=> $location[1],
!                                       'entrance_id'                           
=> $location[2],
!                                       'floor'                                 
        => $drawing['floor'],
!                                       'address'                               
        => $drawing['address'],
!                                       'link_view_file'                        
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidrawing.view_file&drawing_id='
 . $drawing['drawing_id']),
!                                       'link_view'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidrawing.view&drawing_id='
 . $drawing['drawing_id']),
!                                       'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidrawing.edit&drawing_id='
 . $drawing['drawing_id']),
!                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidrawing.delete&drawing_id='
 . $drawing['drawing_id']),
!                                       'lang_view_file_statustext'     => 
lang('view the drawing'),
!                                       'lang_view_statustext'          => 
lang('view information about the drawing'),
!                                       'lang_edit_statustext'          => 
lang('edit information about the drawing'),
!                                       'lang_delete_statustext'        => 
lang('delete this drawing'),
!                                       'text_view'                             
        => lang('view'),
!                                       'text_edit'                             
        => lang('edit'),
!                                       'text_delete'                           
=> lang('delete')
!                               );
!                       }
  
  
!                       $table_header[] = array
!                       (
!                               'sort_drawing'  => 
$this->nextmatchs->show_sort_order(array
                                                                                
(
                                                                                
        'sort'  => $this->sort,
!                                                                               
        'var'   =>      'drawing_name',
                                                                                
        'order' =>      $this->order,
!                                                                               
        'extra' => array('menuaction'           => 
$this->currentapp.'.uidrawing.index',
!                                                                               
                                                        'cat_id'                
=>$this->cat_id,
                                                                                
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'filter'                
=>$this->filter,
!                                                                               
                                                        'query'                 
=>$this->query)
!                                                                               
)),
!                               'lang_drawing'  => lang('drawing'),
!                               'sort_property' => 
$this->nextmatchs->show_sort_order(array
                                                                                
(
                                                                                
        'sort'  => $this->sort,
!                                                                               
        'var'   =>      'location_code',
                                                                                
        'order' =>      $this->order,
!                                                                               
        'extra'         => array('menuaction'           => 
$this->currentapp.'.uidrawing.index',
!                                                                               
                                                        'cat_id'                
=>$this->cat_id,
                                                                                
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'filter'                
=>$this->filter,
!                                                                               
                                                        'query'                 
=>$this->query)
!                                                                               
)),
!                               'lang_property'         => lang('Property'),
!                               'lang_building'         => lang('Building'),
!                               'lang_entrance'         => lang('Entrance'),
!                               'lang_floor'            => lang('Floor'),
!                               'sort_address'  => 
$this->nextmatchs->show_sort_order(array
                                                                                
(
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'address',
                                                                                
        'order' =>      $this->order,
!                                                                               
        'extra'         => array('menuaction'           => 
$this->currentapp.'.uidrawing.index',
!                                                                               
                                                        'cat_id'                
=>$this->cat_id,
                                                                                
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'filter'                
=>$this->filter,
!                                                                               
                                                        'query'                 
=>$this->query)
!                                                                               
)),
!                               'lang_address'  => lang('Address'),
!                               'lang_view'                     => lang('view'),
!                               'lang_edit'                     => lang('edit'),
!                               'lang_delete'           => lang('delete'),
!                               'lang_select'           => lang('Select')
                                );
  
-                       $table_add[] = array
-                       (
-                               'lang_add'                              => 
lang('add'),
-                               'lang_add_statustext'   => lang('add a 
drawing'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidrawing.edit')
-                       );
  
                        $link_data = array
--- 85,285 ----
                        $links = $this->bocommon->menu();
  
+ 
+                       $this->config->read_repository();
+                       $link_to_files = 
$this->config->config_data['files_url'];
+                       $directory      = 'home/drawing';
+ 
+ 
                        $drawing_list = $this->bo->read();
  
!                       $uicols = $this->bo->uicols;
  
!                       $j=0;
!                       while (is_array($drawing_list) && list(,$drawing_entry) 
= each($drawing_list))
                        {
!                               for ($k=0;$k<count($uicols['name']);$k++)
!                               {
!                                       if($uicols['input_type'][$k]!='hidden')
!                                       {
  
!                                               
if($uicols['name'][$k]=='drawing_name')
!                                               {
!                                                               
$content[$j]['row'][$k]['statustext']           = lang('view the drawing');
!                                                               
$content[$j]['row'][$k]['text']                         = 
$drawing_entry[$uicols['name'][$k]];
!                                                               
if($link_to_files)
!                                                               {
!                                                                       
$content[$j]['row'][$k]['link']                 = $link_to_files . SEP . 
$directory . SEP . $drawing_entry[$uicols['name'][$k]];
!                                                               }
!                                                               else
!                                                               {
!                                                                       
$content[$j]['row'][$k]['link']                 = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidrawing.view_file&drawing_id='
 . $drawing_entry['drawing_id']);
!                                                               }
! 
!                                               }
!                                               else
!                                               {
!                                                       
if($drawing_entry['query_location'][$uicols['name'][$k]])
!                                                       {
!                                                               
$content[$j]['row'][$k]['statustext']           = lang('search');
!                                                               
$content[$j]['row'][$k]['text']                         = 
$drawing_entry[$uicols['name'][$k]];
!                                                               
$content[$j]['row'][$k]['link']                         = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidrawing.index&query='
 . $drawing_entry['query_location'][$uicols['name'][$k]] . '&cat_id=' . 
$this->cat_id . '&status_id=' . $this->status_id);
!                                                       }
!                                                       else
!                                                       {
!                                                               
$content[$j]['row'][$k]['value']                        = 
$drawing_entry[$uicols['name'][$k]];
!                                                               
$content[$j]['row'][$k]['name']                         = $uicols['name'][$k];
!                                                       }
!                                               }
  
+                                       }
+                               }
  
!                               if(!$lookup)
!                               {
!                                       if($this->acl_read)
!                                       {
!                                               
$content[$j]['row'][$k]['statustext']                   = lang('view 
information about the drawing');
!                                               $content[$j]['row'][$k]['text'] 
                                = lang('view');
!                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidrawing.view&drawing_id='
 . $drawing_entry['drawing_id']);
!                                               $k++;
!                                       }
! 
!                                       if($this->acl_edit)
!                                       {
!                                               
$content[$j]['row'][$k]['statustext']                   = lang('edit 
information about the drawing');
!                                               $content[$j]['row'][$k]['text'] 
                                = lang('edit');
!                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidrawing.edit&drawing_id='
 . $drawing_entry['drawing_id']);
!                                               $k++;
!                                       }
! 
!                                       if($this->acl_delete)
!                                       {
!                                               
$content[$j]['row'][$k]['statustext']                   = lang('delete the 
drawing');
!                                               $content[$j]['row'][$k]['text'] 
                                = lang('delete');
!                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidrawing.delete&drawing_id='
 . $drawing_entry['drawing_id']);
!                                               $k++;
!                                       }
!                               }
! 
!                               $j++;
!                       }
! 
!                       for ($i=0;$i<count($uicols['descr']);$i++)
!                       {
!                               if($uicols['input_type'][$i]!='hidden')
!                               {
!                                       $table_header[$i]['header']     = 
$uicols['descr'][$i];
!                                       $table_header[$i]['width']              
= '5%';
!                                       $table_header[$i]['align']              
= 'center';
!                                       if($uicols['name'][$i]=='loc1')
!                                       {
!                                               $table_header[$i]['sort_link']  
=true;
!                                               $table_header[$i]['sort']       
        = $this->nextmatchs->show_sort_order(array
                                                                                
(
                                                                                
        'sort'  => $this->sort,
!                                                                               
        'var'   =>      'location_code',
                                                                                
        'order' =>      $this->order,
!                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uidrawing.index',
!                                                                               
                                                        'type_id'       
=>$type_id,
!                                                                               
                                                        'query'         
=>$this->query,
!                                                                               
                                                        'status_id'     
=>$this->status_id,
                                                                                
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id)
!                                                                               
));
!                                       }
!                                       if($uicols['name'][$i]=='category')
!                                       {
!                                               $table_header[$i]['sort_link']  
=true;
!                                               $table_header[$i]['sort']       
        = $this->nextmatchs->show_sort_order(array
                                                                                
(
                                                                                
        'sort'  => $this->sort,
!                                                                               
        'var'   =>      'category',
                                                                                
        'order' =>      $this->order,
!                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uidrawing.index',
!                                                                               
                                                        'type_id'       
=>$type_id,
!                                                                               
                                                        'query'         
=>$this->query,
!                                                                               
                                                        'status_id'     
=>$this->status_id,
                                                                                
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id)
!                                                                               
));
!                                       }
!                                       if($uicols['name'][$i]=='drawing_name')
!                                       {
!                                               $table_header[$i]['sort_link']  
=true;
!                                               $table_header[$i]['sort']       
        = $this->nextmatchs->show_sort_order(array
!                                                                               
(
!                                                                               
        'sort'  => $this->sort,
!                                                                               
        'var'   =>      'drawing_name',
!                                                                               
        'order' =>      $this->order,
!                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uidrawing.index',
!                                                                               
                                                        'type_id'       
=>$type_id,
!                                                                               
                                                        'query'         
=>$this->query,
!                                                                               
                                                        'status_id'     
=>$this->status_id,
!                                                                               
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id)
!                                                                               
));
!                                       }
!                                       if($uicols['name'][$i]=='address')
!                                       {
!                                               $table_header[$i]['sort_link']  
=true;
!                                               $table_header[$i]['sort']       
        = $this->nextmatchs->show_sort_order(array
                                                                                
(
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'address',
                                                                                
        'order' =>      $this->order,
!                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uidrawing.index',
!                                                                               
                                                        'type_id'       
=>$type_id,
!                                                                               
                                                        'query'         
=>$this->query,
!                                                                               
                                                        'status_id'     
=>$this->status_id,
                                                                                
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id)
!                                                                               
));
!                                       }
!                               }
!                       }
! 
!                       if(!$lookup)
!                       {
!                               if($this->acl_read)
!                               {
!                                       $table_header[$i]['width']              
        = '5%';
!                                       $table_header[$i]['align']              
        = 'center';
!                                       $table_header[$i]['header']             
        = lang('view');
!                                       $i++;
!                               }
!                               if($this->acl_edit)
!                               {
!                                       $table_header[$i]['width']              
        = '5%';
!                                       $table_header[$i]['align']              
        = 'center';
!                                       $table_header[$i]['header']             
        = lang('edit');
!                                       $i++;
!                               }
!                               if($this->acl_delete)
!                               {
!                                       $table_header[$i]['width']              
        = '5%';
!                                       $table_header[$i]['align']              
        = 'center';
!                                       $table_header[$i]['header']             
        = lang('delete');
!                                       $i++;
!                               }
!                       }
!                       else
!                       {
!                               $table_header[$i]['width']                      
= '5%';
!                               $table_header[$i]['align']                      
= 'center';
!                               $table_header[$i]['header']             = 
lang('select');
!                       }
! 
! //_debug_array($content);
!                       if($this->acl_add)
!                       {
!                               $table_add[] = array
!                               (
!                                       'lang_add'                              
=> lang('add'),
!                                       'lang_add_statustext'   => lang('add a 
drawing'),
!                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidrawing.edit')
! 
                                );
+                       }
  
  
                        $link_data = array
***************
*** 213,218 ****
                                'query'                                         
        => $this->query,
                                'lang_search'                                   
=> lang('search'),
!                               'table_header_drawing'                  => 
$table_header,
!                               'values_drawing'                                
=> $content,
                                'table_add'                                     
        => $table_add
                        );
--- 332,337 ----
                                'query'                                         
        => $this->query,
                                'lang_search'                                   
=> lang('search'),
!                               'table_header'                                  
=> $table_header,
!                               'values'                                        
        => $content,
                                'table_add'                                     
        => $table_add
                        );
***************
*** 229,232 ****
--- 348,356 ----
                function view_file($file_array='')
                {
+                       if(!$this->acl_read)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uidrawing.index');
+                       }
+ 
                        $GLOBALS['phpgw_info']['flags']['noframework'] = True;
                        $drawing_id             = 
get_var('drawing_id',array('POST','GET'));
***************
*** 267,272 ****
--- 391,402 ----
                function edit()
                {
+                       if(!$this->acl_add && !$this->acl_edit)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uidrawing.index');
+                       }
+ 
                        $drawing_id             = 
get_var('drawing_id',array('POST','GET'));
                        $values                         = 
get_var('values',array('POST'));
+                       $insert_record          = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
  
                        $GLOBALS['phpgw']->xslttpl->add_file(array('drawing'));
***************
*** 274,294 ****
                        $this->bo->create_home_dir();
  
-                       if($values)
-                       {
-                               $values = $values + 
$this->bocommon->get_location();
-                       }
-                       else
-                       {
-                               $location_code                          = 
get_var('location_code',array('POST','GET'));
-                               $values['equipment_id']         = 
get_var('equipment_id',array('POST','GET'));
-                               $values['descr']                        = 
get_var('descr',array('POST','GET'));
- 
-                               if($location_code)
-                               {
-                                       
$location_data=$this->bocommon->read_location_data($location_code);
- 
-                                       $values=$values + $location_data;
-                               }
-                       }
  
                        $values['drawing_date']         = 
get_var('drawing_date',array('POST'));
--- 404,407 ----
***************
*** 300,303 ****
--- 413,436 ----
                        {
  
+                               for ($i=0; 
$i<count($insert_record['location']); $i++)
+                               {
+                                       
if($_POST[$insert_record['location'][$i]])
+                                       {
+                                               
$values['location'][$insert_record['location'][$i]]= 
$_POST[$insert_record['location'][$i]];
+                                       }
+                               }
+ 
+                               while (is_array($insert_record['extra']) && 
list($key,) = each($insert_record['extra']))
+                               {
+                                       if($_POST[$key])
+                                       {
+                                               $values['extra'][$key]  = 
$_POST[$key];
+                                       }
+                               }
+ 
+                               $values['street_name']          = 
$_POST['street_name'];
+                               $values['street_number']        = 
$_POST['street_number'];
+                               $values['location_name']        = $_POST['loc' 
. (count($values['location'])).'_name']; // if not address - get the parent 
name as address
+ 
                                
$values['drawing_name']=$_FILES['drawing_file']['name'];
  
***************
*** 312,316 ****
                                        
$receipt['error'][]=array('msg'=>lang('Please select a status !'));
                                }
!                               if(!$values['property_id'])
                                {
                                        
$receipt['error'][]=array('msg'=>lang('Please select a location !'));
--- 445,449 ----
                                        
$receipt['error'][]=array('msg'=>lang('Please select a status !'));
                                }
!                               if(!$values['location'])
                                {
                                        
$receipt['error'][]=array('msg'=>lang('Please select a location !'));
***************
*** 330,339 ****
                                {
  
!                                       if(!$this->bo->vfs->cp (array (
!                                               'from'  => 
$_FILES['drawing_file']['tmp_name'],
!                                               'to'    => $this->fakebase. SEP 
. 'drawing' . SEP . $values['drawing_name'],
!                                               'relatives'     => array 
(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
                                        {
!                                               
$receipt['error'][]=array('msg'=>lang('Failed to upload file !'));
                                        }
  
--- 463,475 ----
                                {
  
!                                       if(!$drawing_name_orig && 
$values['drawing_name'])
                                        {
!                                               if(!$this->bo->vfs->cp (array (
!                                                       'from'  => 
$_FILES['drawing_file']['tmp_name'],
!                                                       'to'    => 
$this->fakebase. SEP . 'drawing' . SEP . $values['drawing_name'],
!                                                       'relatives'     => 
array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
!                                               {
!                                                       
$receipt['error'][]=array('msg'=>lang('Failed to upload file !'));
!                                               }
                                        }
  
***************
*** 347,350 ****
--- 483,491 ----
                                {
                                        $values['drawing_name']='';
+                                       if($values['location'])
+                                       {
+                                               $location_code=implode("-", 
$values['location']);
+                                               $values['location_data'] = 
$this->bolocation->read_single($location_code,$values['extra']);
+                                       }
                                }
                        }
***************
*** 375,393 ****
  
  
!                       
$location_data=$this->bocommon->initiate_ui_location(array(
!                                               'location_type' => 'form',
!                                               'equipment'             => true,
!                                               'entrance'              => true,
!                                               'address'               => true,
!                                               'equipment_id'  => 
$values['equipment_id'],
!                                               'property_id'   => 
$values['property_id'],
!                                               'property_name' => 
$values['property_name'],
!                                               'building_id'   => 
$values['building_id'],
!                                               'entrance_id'   => 
$values['entrance_id'],
!                                               'floor'                 => 
$values['floor'],
!                                               'street_name'   => 
$values['street_name'],
!                                               'street_number' => 
$values['street_number'],
!                                               'apartment_id'  => 
$values['apartment_id']));
! 
  
  
--- 516,527 ----
  
  
!                       
$location_data=$this->bolocation->initiate_ui_location(array(
!                                               'values'                => 
$values['location_data'],
!                                               'type_id'               => -1, 
// calculated from location_types
!                                               'no_link'               => 
False, // disable lookup links for location type less than type_id
!                                               'tenant'                => 
False,
!                                               'equipment'             => True,
!                                               'lookup_type'   => 'form'
!                                               ));
  
  
***************
*** 502,505 ****
--- 636,644 ----
                function delete()
                {
+                       if(!$this->acl_delete)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uidrawing.index');
+                       }
+ 
                        $drawing_id = get_var('drawing_id',array('POST','GET'));
                        $confirm        = get_var('confirm',array('POST'));
***************
*** 538,541 ****
--- 677,685 ----
                function view()
                {
+                       if(!$this->acl_read)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uidrawing.index');
+                       }
+ 
                        $drawing_id             = 
get_var('drawing_id',array('POST','GET'));
                        $values                         = 
get_var('values',array('POST'));
***************
*** 583,602 ****
                        }
  
  
!                       
$location_data=$this->bocommon->initiate_ui_location(array(
!                                               'location_type' => 'view',
!                                               'equipment'             => true,
!                                               'entrance'              => true,
!                                               'address'               => true,
!                                               'equipment_id'  => 
$values['equipment_id'],
!                                               'property_id'   => 
$values['property_id'],
!                                               'property_name' => 
$values['property_name'],
!                                               'building_id'   => 
$values['building_id'],
!                                               'entrance_id'   => 
$values['entrance_id'],
!                                               'floor'                 => 
$values['floor'],
!                                               'street_name'   => 
$values['street_name'],
!                                               'street_number' => 
$values['street_number'],
!                                               'apartment_id'  => 
$values['apartment_id']));
! 
  
  
--- 727,740 ----
                        }
  
+ //_debug_array($values);
  
!                       
$location_data=$this->bolocation->initiate_ui_location(array(
!                                               'values'                => 
$values['location_data'],
!                                               'type_id'               => 
count(explode('-',$values['location_data']['location_code'])),
!                                               'no_link'               => 
False, // disable lookup links for location type less than type_id
!                                               'tenant'                => 
False,
!                                               'equipment'             => 
$values['location_data']['equipment_id'],
!                                               'lookup_type'   => 'view'
!                                               ));
  
  

Index: class.uidocument.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uidocument.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.uidocument.inc.php    26 Jun 2003 12:23:05 -0000      1.12
--- class.uidocument.inc.php    27 Jun 2003 11:14:51 -0000      1.13
***************
*** 88,91 ****
--- 88,107 ----
                        $links = $this->bocommon->menu();
  
+                       $preserve               = 
get_var('preserve',array('POST','GET'));
+ 
+                       if($preserve)
+                       {
+                               $this->bo->read_sessiondata();
+ 
+                               $this->start                            = 
$this->bo->start;
+                               $this->query                            = 
$this->bo->query;
+                               $this->sort                                     
= $this->bo->sort;
+                               $this->order                            = 
$this->bo->order;
+                               $this->filter                           = 
$this->bo->filter;
+                               $this->cat_id                           = 
$this->bo->cat_id;
+                               $this->status_id                        = 
$this->bo->status_id;
+                               $this->equipment_type           = 
$this->bo->equipment_type;
+                       }
+ 
                        $document_list = $this->bo->read();
  
***************
*** 287,290 ****
--- 303,328 ----
                {
  
+                       if(!$this->acl_read)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uidocument.index');
+                       }
+ 
+                       $preserve               = 
get_var('preserve',array('POST','GET'));
+ 
+                       if($preserve)
+                       {
+                               $this->bo->read_sessiondata();
+ 
+                               $this->start                            = 
$this->bo->start;
+                               $this->query                            = 
$this->bo->query;
+                               $this->sort                                     
= $this->bo->sort;
+                               $this->order                            = 
$this->bo->order;
+                               $this->filter                           = 
$this->bo->filter;
+                               $this->cat_id                           = 
$this->bo->cat_id;
+                               $this->status_id                        = 
$this->bo->status_id;
+                               $this->equipment_type           = 
$this->bo->equipment_type;
+                       }
+ //_debug_array($this->cat_id);
+ 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('document',
                                                                                
'menu',
***************
*** 428,435 ****
                                'select_name'                                   
=> 'cat_id',
                                'cat_list'                                      
        => $this->bo->select_category_list('filter',$this->cat_id),
!                               'district_list'                                 
=> $this->bocommon->select_district_list('filter',$this->district_id),
!                               'lang_no_district'                              
=> lang('no district'),
!                               'lang_district_statustext'              => 
lang('Select the district the selection belongs to. To do not use a district 
select NO DISTRICT'),
!                               'select_district_name'                  => 
'district_id',
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
  
--- 466,475 ----
                                'select_name'                                   
=> 'cat_id',
                                'cat_list'                                      
        => $this->bo->select_category_list('filter',$this->cat_id),
! 
! //                            'district_list'                                 
=> $this->bocommon->select_district_list('filter',$this->district_id),
! //                            'lang_no_district'                              
=> lang('no district'),
! //                            'lang_district_statustext'              => 
lang('Select the district the selection belongs to. To do not use a district 
select NO DISTRICT'),
! //                            'select_district_name'                  => 
'district_id',
! 
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
  
***************
*** 455,459 ****
                                'values_document'                               
=> $content,
                                'table_add'                                     
        => $table_add,
!                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.index'),
                                'lang_done'                                     
        => lang('done'),
                                'lang_done_statustext'                  => 
lang('Back to the list')
--- 495,499 ----
                                'values_document'                               
=> $content,
                                'table_add'                                     
        => $table_add,
!                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.index&preserve=1'),
                                'lang_done'                                     
        => lang('done'),
                                'lang_done_statustext'                  => 
lang('Back to the list')
***************
*** 470,473 ****
--- 510,518 ----
                function view_file()
                {
+                       if(!$this->acl_read)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uidocument.index');
+                       }
+ 
                        $GLOBALS['phpgw_info']['flags']['noframework'] = True;
                        $document_id            = 
get_var('document_id',array('POST','GET'));
***************
*** 516,519 ****
--- 561,569 ----
                function edit()
                {
+                       if(!$this->acl_add && !$this->acl_edit)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uidocument.index');
+                       }
+ 
                        $from                           = 
get_var('from',array('POST','GET'));
                        $document_id            = 
get_var('document_id',array('POST','GET'));
***************
*** 723,727 ****
                                'lang_save_statustext'                  => 
lang('Save the document'),
  
!                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.'
 .$from . '&location_code=' . $values['location_code'] . '&equipment_id=' . 
$values['equipment_id']),
                                'lang_done'                                     
        => lang('done'),
                                'lang_done_statustext'                  => 
lang('Back to the list'),
--- 773,777 ----
                                'lang_save_statustext'                  => 
lang('Save the document'),
  
!                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.'
 .$from . '&location_code=' . $values['location_code'] . '&equipment_id=' . 
$values['equipment_id'] . '&preserve=1'),
                                'lang_done'                                     
        => lang('done'),
                                'lang_done_statustext'                  => 
lang('Back to the list'),
***************
*** 785,788 ****
--- 835,843 ----
                function delete()
                {
+                       if(!$this->acl_delete)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uidocument.index');
+                       }
+ 
                        $location_code = 
get_var('location_code',array('POST','GET'));
                        $equipment_id = 
get_var('equipment_id',array('POST','GET'));
***************
*** 825,828 ****
--- 880,888 ----
                function view()
                {
+ 
+                       if(!$this->acl_read)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uidocument.index');
+                       }
  
                        $from                           = 
get_var('from',array('POST','GET'));

Index: class.sodrawing.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sodrawing.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.sodrawing.inc.php     21 May 2003 20:09:51 -0000      1.7
--- class.sodrawing.inc.php     27 Jun 2003 11:14:51 -0000      1.8
***************
*** 103,106 ****
--- 103,135 ----
                        }
  
+                       $entity_table = 'fm_drawing';
+ 
+                       $cols .= $entity_table . '.location_code';
+                       $cols_return[] = 'location_code';
+ 
+                       $cols .= ",$entity_table.id as drawing_id";
+                       $cols_return[]                          = 'drawing_id';
+ 
+                       $cols .= ",$entity_table.drawing_name";
+                       $cols_return[]                          = 
'drawing_name';
+                       $uicols['input_type'][]         = 'text';
+                       $uicols['name'][]                       = 
'drawing_name';
+                       $uicols['descr'][]                      = lang('drawing 
name');
+                       $uicols['statustext'][]         = lang('drawing name');
+ 
+                       $cols .= ",fm_drawing_category.descr as category";
+                       $cols_return[]                          = 'category';
+                       $uicols['input_type'][]         = 'text';
+                       $uicols['name'][]                       = 'category';
+                       $uicols['descr'][]                      = 
lang('category');
+                       $uicols['statustext'][]         = lang('category');
+ 
+                       $joinmethod .= " $this->join  fm_drawing_category ON 
($entity_table.category = fm_drawing_category.id))";
+                       $paranthesis .='(';
+ 
+ 
+                       $sql    = 
$this->bocommon->generate_sql(array('entity_table'=>$entity_table,'cols'=>$cols,'cols_return'=>$cols_return,
+                                                                               
                                        
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query));
+ 
                        if ($order)
                        {
***************
*** 112,116 ****
                        }
  
!                       $filtermethod = ' ( fm_drawing.owner=' . $this->account;
                        if (is_array($this->grants))
                        {
--- 141,145 ----
                        }
  
!                       $filtermethod = ' ( fm_drawing.user_id=' . 
$this->account;
                        if (is_array($this->grants))
                        {
***************
*** 121,125 ****
                                }
                                reset($public_user_list);
!                               $filtermethod .= " OR 
(fm_drawing.access='public' OR fm_drawing.owner IN(" . 
implode(',',$public_user_list) . ")))";
                        }
                        else
--- 150,154 ----
                                }
                                reset($public_user_list);
!                               $filtermethod .= " OR 
(fm_drawing.access='public' OR fm_drawing.user_id IN(" . 
implode(',',$public_user_list) . ")))";
                        }
                        else
***************
*** 148,155 ****
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND fm_drawing.address LIKE 
'%$query%' or fm_drawing.location_code LIKE '%$query%'";
                        }
  
!                       $sql = "SELECT * FROM fm_drawing WHERE  $filtermethod 
$querymethod";
  
                        $this->db2->query($sql,__LINE__,__FILE__);
--- 177,190 ----
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND (fm_drawing.address LIKE 
'%$query%' or fm_drawing.location_code LIKE '%$query%')";
                        }
  
! 
!                       $sql .= " WHERE $filtermethod $querymethod";
! //echo $sql;
!                       $this->uicols           = $this->bocommon->uicols;
!                       $cols_return            = $this->bocommon->cols_return;
!                       $type_id                        = 
$this->bocommon->type_id;
!                       $this->cols_extra       = $this->bocommon->cols_extra;
  
                        $this->db2->query($sql,__LINE__,__FILE__);
***************
*** 157,176 ****
                        $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
  
                        while ($this->db->next_record())
                        {
!                               $ngrants = 
(int)$this->grants[$this->db->f('fm_drawing.owner')];
!                               $drawing_list[] = array
!                               (
!                                       'drawing_id'    => $this->db->f('id'),
!                                       'drawing_name'  => 
$this->db->f('drawing_name'),
!                                       'location_code' => 
$this->db->f('location_code'),
!                                       'floor'                 => 
$this->db->f('floor'),
!                                       'address'               => 
$this->db->f('address'),
!                                       'category'              => 
$this->db->f('category'),
!                                       'title'                 => 
$this->db->f('title'),
!                                       'grants'                => $ngrants
!                                       );
                        }
- //_debug_array($drawing_list);
                        return $drawing_list;
                }
--- 192,213 ----
                        $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
  
+                       $j=0;
                        while ($this->db->next_record())
                        {
!                               for ($i=0;$i<count($cols_return);$i++)
!                               {
!                                       $drawing_list[$j][$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
!                               }
! 
!                               $location_code= $this->db->f('location_code');
!                               $location = split('-',$location_code);
!                               for ($m=0;$m<count($location);$m++)
!                               {
!                                       $drawing_list[$j]['loc' . ($m+1)] = 
$location[$m];
!                                       
$drawing_list[$j]['query_location']['loc' . ($m+1)]=implode("-", 
array_slice($location, 0, ($m+1)));
!                               }
! 
!                               $j++;
                        }
                        return $drawing_list;
                }
***************
*** 197,201 ****
                                $drawing['status']                              
= $this->db->f('status');
                                $drawing['tenant_id']                   = 
$this->db->f('tenant_id');
!                               $drawing['owner']                               
= $this->db->f('owner');
                                $drawing['coordinator']                 = 
$this->db->f('coordinator');
                                $drawing['access']                              
= $this->db->f('access');
--- 234,238 ----
                                $drawing['status']                              
= $this->db->f('status');
                                $drawing['tenant_id']                   = 
$this->db->f('tenant_id');
!                               $drawing['user_id']                             
= $this->db->f('user_id');
                                $drawing['coordinator']                 = 
$this->db->f('coordinator');
                                $drawing['access']                              
= $this->db->f('access');
***************
*** 212,222 ****
                {
  
!                       if($drawing['street_number'])
                        {
!                               $address= $drawing['street_name'] . ' ' . 
$drawing['street_number'];
                        }
!                       else
                        {
!                               $address= $drawing['street_name'];
                        }
  
--- 249,286 ----
                {
  
!                       while (is_array($drawing['location']) && 
list($input_name,$value) = each($drawing['location']))
                        {
!                               if($value)
!                               {
!                                       $cols[] = $input_name;
!                                       $vals[] = $value;
!                               }
                        }
! 
!                       while (is_array($drawing['extra']) && 
list($input_name,$value) = each($drawing['extra']))
!                       {
!                               if($value)
!                               {
!                                       $cols[] = $input_name;
!                                       $vals[] = $value;
!                               }
!                       }
! 
!                       if($cols)
                        {
!                               $cols   = "," . implode(",", $cols);
!                               $vals   = ",'" . implode("','", $vals) . "'";
!                       }
! 
!                       if($drawing['street_name'])
!                       {
!                               $address[]= $drawing['street_name'];
!                               $address[]= $drawing['street_number'];
!                               $address        = implode(" ", $address);
!                       }
! 
!                       if(!$address)
!                       {
!                               $address = $drawing['location_name'];
                        }
  
***************
*** 225,234 ****
                        $drawing['title'] = 
$this->db->db_addslashes($drawing['title']);
  //_debug_array($drawing);
!                       $this->db->query("INSERT INTO fm_drawing 
(drawing_name,title,equipment_id,access,category,entry_date,drawing_date,version,coordinator,status,"
!                               . 
"descr,location_code,floor_id,address,branch_id,vendor_id,owner) "
                                . "VALUES ('"
                                . $drawing['drawing_name']. "','"
                                . $drawing['title']. "','"
-                               . $drawing['equipment_id']. "','"
                                . "public','"
                                . $drawing['cat_id']. "','"
--- 289,297 ----
                        $drawing['title'] = 
$this->db->db_addslashes($drawing['title']);
  //_debug_array($drawing);
!                       $this->db->query("INSERT INTO fm_drawing 
(drawing_name,title,access,category,entry_date,drawing_date,version,coordinator,status,"
!                               . 
"descr,location_code,floor_id,address,branch_id,vendor_id,user_id $cols) "
                                . "VALUES ('"
                                . $drawing['drawing_name']. "','"
                                . $drawing['title']. "','"
                                . "public','"
                                . $drawing['cat_id']. "','"
***************
*** 244,248 ****
                                . $drawing['branch_id']. "','"
                                . $drawing['vendor_id']. "','"
!                               . $this->account. "')",__LINE__,__FILE__);
  
                        $receipt['drawing_id'] = 
$this->db->get_last_insert_id('fm_drawing','id');
--- 307,311 ----
                                . $drawing['branch_id']. "','"
                                . $drawing['vendor_id']. "','"
!                               . $this->account. "' $vals)",__LINE__,__FILE__);
  
                        $receipt['drawing_id'] = 
$this->db->get_last_insert_id('fm_drawing','id');
***************
*** 258,261 ****
--- 321,351 ----
                function edit($drawing)
                {
+                       while (is_array($drawing['location']) && 
list($input_name,$value) = each($drawing['location']))
+                       {
+                               $vals[] = "$input_name = '$value'";
+                       }
+ 
+                       while (is_array($drawing['extra']) && 
list($input_name,$value) = each($drawing['extra']))
+                       {
+                               $vals[] = "$input_name = '$value'";
+                       }
+ 
+                       if($vals)
+                       {
+                               $vals   = "," . implode(",",$vals);
+                       }
+ 
+                       if($drawing['street_name'])
+                       {
+                               $address[]= $drawing['street_name'];
+                               $address[]= $drawing['street_number'];
+                               $address        = implode(" ", $address);
+                       }
+ 
+                       if(!$address)
+                       {
+                               $address = $drawing['location_name'];
+                       }
+ 
                        $this->db->query("SELECT status,category,coordinator 
FROM fm_drawing where id='" .$drawing['drawing_id']."'",__LINE__,__FILE__);
                        $this->db->next_record();
***************
*** 282,293 ****
                        }
  
-                       if($drawing['street_number'])
-                       {
-                               $address= $drawing['street_name'] . ' ' . 
$drawing['street_number'];
-                       }
-                       else
-                       {
-                               $address= $drawing['street_name'];
-                       }
  
                        $drawing['descr'] = 
$this->db->db_addslashes($drawing['descr']);
--- 372,375 ----
***************
*** 308,315 ****
                                location_code   ='" . $drawing['location_code'] 
. "',
                                floor_id                ='" . 
$drawing['floor_id'] . "',
-                               equipment_id    ='" . $drawing['equipment_id'] 
. "',
                                vendor_id               ='" . 
$drawing['vendor_id'] . "',
                                address                 ='" . $address
!                               . "' WHERE id= '" . $drawing['drawing_id'] 
."'",__LINE__,__FILE__);
  
                        $receipt['drawing_id'] = $drawing['drawing_id'];
--- 390,396 ----
                                location_code   ='" . $drawing['location_code'] 
. "',
                                floor_id                ='" . 
$drawing['floor_id'] . "',
                                vendor_id               ='" . 
$drawing['vendor_id'] . "',
                                address                 ='" . $address
!                               . "' $vals WHERE id= '" . 
$drawing['drawing_id'] ."'",__LINE__,__FILE__);
  
                        $receipt['drawing_id'] = $drawing['drawing_id'];

Index: class.sodocument.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sodocument.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.sodocument.inc.php    26 Jun 2003 12:23:05 -0000      1.7
--- class.sodocument.inc.php    27 Jun 2003 11:14:51 -0000      1.8
***************
*** 277,281 ****
                        if ($filter)
                        {
!                               $filtermethod .= " AND 
fm_document.owner='$filter' ";
                        }
  
--- 277,281 ----
                        if ($filter)
                        {
!                               $filtermethod .= " AND 
fm_document.user_id='$filter' ";
                        }
  
***************
*** 328,332 ****
                                $document['descr']                              
= $this->db->f('descr');
                                $document['status']                             
= $this->db->f('status');
!                               $document['owner']                              
= $this->db->f('owner');
                                $document['coordinator']                        
= $this->db->f('coordinator');
                                $document['access']                             
= $this->db->f('access');
--- 328,332 ----
                                $document['descr']                              
= $this->db->f('descr');
                                $document['status']                             
= $this->db->f('status');
!                               $document['user_id']                            
= $this->db->f('user_id');
                                $document['coordinator']                        
= $this->db->f('coordinator');
                                $document['access']                             
= $this->db->f('access');
***************
*** 351,355 ****
                        }
  
- 
                        while (is_array($document['extra']) && 
list($input_name,$value) = each($document['extra']))
                        {
--- 351,354 ----
***************
*** 366,370 ****
                                $vals   = ",'" . implode("','", $vals) . "'";
                        }
- 
  
                        if($document['street_name'])
--- 365,368 ----

Index: class.boreport.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boreport.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.boreport.inc.php      26 Jun 2003 09:02:06 -0000      1.6
--- class.boreport.inc.php      27 Jun 2003 11:14:51 -0000      1.7
***************
*** 53,57 ****
                        $this->rootdir                  = $this->vfs->basedir;
                        $this->fakebase                 = $this->vfs->fakebase;
!                       $this->solocation = 
CreateObject($this->currentapp.'.solocation');
  
                        if ($session)
--- 53,57 ----
                        $this->rootdir                  = $this->vfs->basedir;
                        $this->fakebase                 = $this->vfs->fakebase;
!                       $this->solocation               = 
CreateObject($this->currentapp.'.solocation');
  
                        if ($session)

Index: class.bolocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bolocation.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** class.bolocation.inc.php    24 Jun 2003 10:26:40 -0000      1.18
--- class.bolocation.inc.php    27 Jun 2003 11:14:51 -0000      1.19
***************
*** 521,524 ****
--- 521,525 ----
                function read_single($location_code='',$extra='')
                {
+ //_debug_array($extra);
                        $location_data = $this->so->read_single($location_code);
  

Index: class.bodrawing.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bodrawing.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.bodrawing.inc.php     23 May 2003 08:40:19 -0000      1.5
--- class.bodrawing.inc.php     27 Jun 2003 11:14:51 -0000      1.6
***************
*** 29,39 ****
                        $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so                       = 
CreateObject($this->currentapp.'.sodrawing');
-                       $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
                        $this->historylog       = 
CreateObject($this->currentapp.'.historylog','drawing');
                        $this->contacts         = 
CreateObject('phpgwapi.contacts');
!                       $this->vfs                              = 
CreateObject('phpgwapi.vfs');
!                       $this->rootdir                  = $this->vfs->basedir;
!                       $this->fakebase                 = $this->vfs->fakebase;
  
                        if ($session)
--- 29,39 ----
                        $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so                       = 
CreateObject($this->currentapp.'.sodrawing');
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
                        $this->historylog       = 
CreateObject($this->currentapp.'.historylog','drawing');
                        $this->contacts         = 
CreateObject('phpgwapi.contacts');
!                       $this->vfs                      = 
CreateObject('phpgwapi.vfs');
!                       $this->rootdir          = $this->vfs->basedir;
!                       $this->fakebase         = $this->vfs->fakebase;
!                       $this->solocation       = 
CreateObject($this->currentapp.'.solocation');
  
                        if ($session)
***************
*** 64,68 ****
                                $this->query = $query;
                        }
!                       if(!empty($filter))
                        {
                                $this->filter = $filter;
--- 64,68 ----
                                $this->query = $query;
                        }
!                       if(isset($filter))
                        {
                                $this->filter = $filter;
***************
*** 257,270 ****
                        $this->total_records = $this->so->total_records;
  
! /*                    $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
  
                        for ($i=0; $i<count($drawing); $i++)
                        {
!                               $drawing[$i]['coordinator'] = 
$GLOBALS['phpgw']->accounts->id2name($drawing[$i]['coordinator']);
!                               $drawing[$i]['drawing_date'] = 
$GLOBALS['phpgw']->common->show_date($drawing[$i]['start_date'],$dateformat);
!                               $drawing[$i]['entry_date'] = 
$GLOBALS['phpgw']->common->show_date($drawing[$i]['entry_date'],$dateformat);
                        }
  
- */
                        return $drawing;
                }
--- 257,277 ----
                        $this->total_records = $this->so->total_records;
  
!                       $this->uicols   = $this->so->uicols;
!                       $cols_extra             = $this->so->cols_extra;
! 
! //                    $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
  
                        for ($i=0; $i<count($drawing); $i++)
                        {
! //                            $drawing[$i]['user']            = 
$GLOBALS['phpgw']->accounts->id2name($drawing[$i]['user_id']);
! //                            $drawing[$i]['entry_date'] = 
$GLOBALS['phpgw']->common->show_date($drawing[$i]['entry_date'],$dateformat);
!                               
$location_data=$this->solocation->read_single($drawing[$i]['location_code']);
! 
!                               for ($j=0;$j<count($cols_extra);$j++)
!                               {
!                                       $drawing[$i][$cols_extra[$j]] = 
$location_data[$cols_extra[$j]];
!                               }
                        }
  
                        return $drawing;
                }
***************
*** 279,285 ****
                        $drawing['vendor_email']                = 
$vendor[0]['email'];
  
!                       
$location_data=$this->socommon->read_location_data($drawing['location_code']);
  
!                       $drawing=$drawing + $location_data;
  
                        return $drawing;
--- 286,299 ----
                        $drawing['vendor_email']                = 
$vendor[0]['email'];
  
!                       if($drawing['location_code'])
!                       {
!                               $drawing['location_data'] 
=$this->solocation->read_single($drawing['location_code']);
!                       }
  
!                       if($drawing['equipment_id'])
!                       {
!                               $drawing['location_data']['equipment_id']       
        = $drawing['equipment_id'];
!                               $drawing['location_data']['equipment_type']     
= $this->bocommon->get_equipment_type($drawing['equipment_id']);
!                       }
  
                        return $drawing;
***************
*** 360,364 ****
                        $values['drawing_date'] = mktime 
(2,0,0,$drawing_date['month'],$drawing_date['day'],$drawing_date['year']);
  
!                       
$values['location_code']=$this->bocommon->location_code($values['property_id'],$values['building_id'],$values['entrance_id'],$values['apartment_id']);
  
  //_debug_array($values);
--- 374,386 ----
                        $values['drawing_date'] = mktime 
(2,0,0,$drawing_date['month'],$drawing_date['day'],$drawing_date['year']);
  
!                       while (is_array($values['location']) && list(,$value) = 
each($values['location']))
!                       {
!                               if($value)
!                               {
!                                       $location[] = $value;
!                               }
!                       }
! 
!                       $values['location_code']=implode("-", $location);
  
  //_debug_array($values);

Index: class.bocommon.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -r1.60 -r1.61
*** class.bocommon.inc.php      24 Jun 2003 10:26:40 -0000      1.60
--- class.bocommon.inc.php      27 Jun 2003 11:14:51 -0000      1.61
***************
*** 574,578 ****
                        {
  
!                               $i++;
                                $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiproperty.index');
                                $menu['sub_menu'][$i]['lang']                   
=       lang('Property');
--- 574,578 ----
                        {
  
! /*                            $i++;
                                $menu['sub_menu'][$i]['link']                   
=       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiproperty.index');
                                $menu['sub_menu'][$i]['lang']                   
=       lang('Property');
***************
*** 599,602 ****
--- 599,603 ----
                                $menu['sub_menu'][$i]['statustext']             
=       lang('gabnr');
  
+ */
                                $location       = 
$this->soadmin_location->select_location_type();
                                for ($j=0; $j<count($location); $j++)





reply via email to

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