phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.soadmin_entity.inc.php, 1.17, 1.18


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] property/inc class.soadmin_entity.inc.php, 1.17, 1.18 class.uiadmin_entity.inc.php, 1.14, 1.15 class.menu.inc.php, 1.3, 1.4 class.boadmin_entity.inc.php, 1.10, 1.11 class.uidocument.inc.php, 1.20, 1.21 class.bodocument.inc.php, 1.11, 1.12 class.sodocument.inc.php, 1.15, 1.16
Date: Sun, 23 Nov 2003 17:41:37 +0000

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

Modified Files:
        class.soadmin_entity.inc.php class.uiadmin_entity.inc.php 
        class.menu.inc.php class.boadmin_entity.inc.php 
        class.uidocument.inc.php class.bodocument.inc.php 
        class.sodocument.inc.php 
Log Message:
no message

Index: class.sodocument.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sodocument.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** class.sodocument.inc.php    9 Nov 2003 20:25:11 -0000       1.15
--- class.sodocument.inc.php    23 Nov 2003 17:41:35 -0000      1.16
***************
*** 27,31 ****
                }
  
!               function select_category_list()
                {
                        $this->db->query("SELECT id, descr FROM 
fm_document_category  ORDER BY descr ");
--- 27,31 ----
                }
  
!               function select_doc_type_list()
                {
                        $this->db->query("SELECT id, descr FROM 
fm_document_category  ORDER BY descr ");
***************
*** 94,106 ****
                                $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:0);
                                $equipment_type = 
(isset($data['equipment_type'])?$data['equipment_type']:'');
                        }
  
  
!                       $entity_table = 'fm_document';
  
!                       $cols .= $entity_table . '.location_code';
                        $cols_return[] = 'location_code';
  
! //                    $cols .= ",$entity_table.id as document_id";
  //                    $cols_return[]                          = 'document_id';
  
--- 94,107 ----
                                $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:0);
                                $equipment_type = 
(isset($data['equipment_type'])?$data['equipment_type']:'');
+                               $entity_id = 
(isset($data['entity_id'])?$data['entity_id']:'');
                        }
  
  
!                       $document_table = 'fm_document';
  
!                       $cols .= $document_table . '.location_code';
                        $cols_return[] = 'location_code';
  
! //                    $cols .= ",$document_table.id as document_id";
  //                    $cols_return[]                          = 'document_id';
  
***************
*** 109,113 ****
                        if ($cat_id == 'equipment')
                        {
!                               $cols .= ",$entity_table.equipment_id";
                                $cols_return[]                          = 
'equipment_id';
                                $uicols['input_type'][]         = 'text';
--- 110,114 ----
                        if ($cat_id == 'equipment')
                        {
!                               $cols .= ",$document_table.equipment_id";
                                $cols_return[]                          = 
'equipment_id';
                                $uicols['input_type'][]         = 'text';
***************
*** 123,127 ****
                                $uicols['statustext'][]         = 
lang('Equipment Type');
  
!                               $joinmethod .= " $this->join  fm_equipment ON 
($entity_table.equipment_id = fm_equipment.equipment_id))";
                                $paranthesis .='(';
                                $joinmethod .= " $this->join  fm_equipment_type 
ON (fm_equipment.equipment_type_id = fm_equipment_type.id))";
--- 124,128 ----
                                $uicols['statustext'][]         = 
lang('Equipment Type');
  
!                               $joinmethod .= " $this->join  fm_equipment ON 
($document_table.equipment_id = fm_equipment.equipment_id))";
                                $paranthesis .='(';
                                $joinmethod .= " $this->join  fm_equipment_type 
ON (fm_equipment.equipment_type_id = fm_equipment_type.id))";
***************
*** 131,136 ****
                        }
  
  
!                       $sql    = 
$this->bocommon->generate_sql(array('entity_table'=>$entity_table,'cols'=>$cols,'cols_return'=>$cols_return,
                                                                                
                                        
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query));
  
--- 132,166 ----
                        }
  
+                       if ($entity_id)
+                       {
+                               $entity_table = 'fm_entity_' . $entity_id . '_' 
. $cat_id;
+ 
+                               $cols .= ",$document_table.p_num as p_num";
+                               $cols_return[]                          = 
'p_num';
+                               $uicols['input_type'][]         = 'text';
+                               $uicols['name'][]                       = 
'p_num';
+                               $uicols['descr'][]                      = 
lang('ID');
+                               $uicols['statustext'][]         = lang('ID');
  
!                               $cols .= ',fm_entity_category.name as category';
!                               $cols_return[]                          = 
'category';
!                               $uicols['input_type'][]         = 'text';
!                               $uicols['name'][]                       = 
'category';
!                               $uicols['descr'][]                      = 
lang('Type');
!                               $uicols['statustext'][]         = lang('Type');
! 
!                               $cols .= ",$document_table.p_entity_id";
!                               $cols_return[]                          = 
'p_entity_id';
!                               $cols .= ",$document_table.p_cat_id";
!                               $cols_return[]                          = 
'p_cat_id';
! 
!                               $joinmethod .= " $this->join  
fm_entity_category ON (fm_entity_category.entity_id 
=$document_table.p_entity_id AND fm_entity_category.id = 
$document_table.p_cat_id))";
!                               $paranthesis .='(';
! 
!                               $groupmethod.= " 
,fm_entity_category.name,$document_table.p_num ";
!                       }
! 
! 
!                       $sql    = 
$this->bocommon->generate_sql(array('entity_table'=>$document_table,'cols'=>$cols,'cols_return'=>$cols_return,
                                                                                
                                        
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query));
  
***************
*** 150,160 ****
                                $filtermethod .= " $where 
(fm_document.equipment_id is not NULL AND fm_document.equipment_id !='')";
                        }
!                       elseif ($cat_id == 'location'):
                        {
!                               $filtermethod .= " $where ( 
fm_document.equipment_id is NULL OR fm_document.equipment_id='') ";
                        }
                        else:
                        {
!                               $filtermethod .= " $where 
fm_document.location_code is NULL ";
                        }
                        endif;
--- 180,190 ----
                                $filtermethod .= " $where 
(fm_document.equipment_id is not NULL AND fm_document.equipment_id !='')";
                        }
!                       elseif (!$entity_id):
                        {
!                               $filtermethod .= " $where ( fm_document.p_num 
is NULL OR fm_document.p_num='') ";
                        }
                        else:
                        {
! //                            $filtermethod .= " $where 
fm_document.location_code is NULL ";
                        }
                        endif;
***************
*** 318,322 ****
                                $document['access']                             
= $this->db->f('access');
                                $document['document_date']              = 
$this->db->f('document_date');
!                               $document['cat_id']                             
= $this->db->f('category');
                                $document['p_num']                              
= $this->db->f('p_num');
                                $document['p_entity_id']                = 
$this->db->f('p_entity_id');
--- 348,352 ----
                                $document['access']                             
= $this->db->f('access');
                                $document['document_date']              = 
$this->db->f('document_date');
!                               $document['doc_type']                   = 
$this->db->f('category');
                                $document['p_num']                              
= $this->db->f('p_num');
                                $document['p_entity_id']                = 
$this->db->f('p_entity_id');
***************
*** 376,380 ****
                                $document['title'],
                                'public',
!                               $document['cat_id'],
                                time(),
                                $document['document_date'],
--- 406,410 ----
                                $document['title'],
                                'public',
!                               $document['doc_type'],
                                time(),
                                $document['document_date'],
***************
*** 516,520 ****
                                'branch_id'             
=>$document['branch_id'],
                                'status'                =>$document['status'],
!                               'category'              =>$document['cat_id'],
                                'document_date' =>$document['document_date'],
                                'coordinator'   =>$document['coordinator'],
--- 546,550 ----
                                'branch_id'             
=>$document['branch_id'],
                                'status'                =>$document['status'],
!                               'category'              =>$document['doc_type'],
                                'document_date' =>$document['document_date'],
                                'coordinator'   =>$document['coordinator'],

Index: class.soadmin_entity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soadmin_entity.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** class.soadmin_entity.inc.php        16 Nov 2003 17:51:44 -0000      1.17
--- class.soadmin_entity.inc.php        23 Nov 2003 17:41:34 -0000      1.18
***************
*** 87,98 ****
                        while ($this->db->next_record())
                        {
!                               $standard[] = array
                                (
                                        'id'    => $this->db->f('id'),
                                        'name'  => $this->db->f('name'),
!                                       'descr' => $this->db->f('descr')
                                );
                        }
!                       return $standard;
                }
  
--- 87,99 ----
                        while ($this->db->next_record())
                        {
!                               $entity[] = array
                                (
                                        'id'    => $this->db->f('id'),
                                        'name'  => $this->db->f('name'),
!                                       'descr' => $this->db->f('descr'),
!                                       'documentation' => 
$this->db->f('documentation')
                                );
                        }
!                       return $entity;
                }
  
***************
*** 243,247 ****
                                $entity['location_form']        = 
$this->db->f('location_form');
                                $entity['lookup_entity']        = 
unserialize($this->db->f('lookup_entity'));
! 
                        }
  
--- 244,248 ----
                                $entity['location_form']        = 
$this->db->f('location_form');
                                $entity['lookup_entity']        = 
unserialize($this->db->f('lookup_entity'));
!                               $entity['documentation']        = 
$this->db->f('documentation');
                        }
  
***************
*** 345,354 ****
                                $entity['name'],
                                $entity['descr'],
!                               $entity['location_form']
                                );
  
                        $values = $this->bocommon->validate_db_insert($values);
  
!                       $this->db->query("INSERT INTO fm_entity (id,name, 
descr,location_form) "
                                . "VALUES ($values)",__LINE__,__FILE__);
  
--- 346,356 ----
                                $entity['name'],
                                $entity['descr'],
!                               $entity['location_form'],
!                               $entity['documentation']
                                );
  
                        $values = $this->bocommon->validate_db_insert($values);
  
!                       $this->db->query("INSERT INTO fm_entity (id,name, 
descr,location_form,documentation) "
                                . "VALUES ($values)",__LINE__,__FILE__);
  
***************
*** 552,556 ****
                                'name'                  => $entity['name'],
                                'location_form' => $entity['location_form'],
!                               'lookup_entity' => 
serialize($entity['lookup_entity'])
                                );
  
--- 554,559 ----
                                'name'                  => $entity['name'],
                                'location_form' => $entity['location_form'],
!                               'lookup_entity' => 
serialize($entity['lookup_entity']),
!                               'documentation' => $entity['documentation']
                                );
  

Index: class.boadmin_entity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boadmin_entity.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** class.boadmin_entity.inc.php        9 Nov 2003 20:25:11 -0000       1.10
--- class.boadmin_entity.inc.php        23 Nov 2003 17:41:35 -0000      1.11
***************
*** 15,18 ****
--- 15,19 ----
                var $order;
                var $cat_id;
+               var $entity_id;
  
                var $public_functions = array
***************
*** 61,67 ****
                        $order  = get_var('order',array('POST','GET'));
                        $filter = get_var('filter',array('POST','GET'));
-                       $entity_id      = 
get_var('entity_id',array('POST','GET'));
                        $cat_id = get_var('cat_id',array('POST','GET'));
                        $allrows        = 
get_var('allrows',array('POST','GET'));
  
                        if ($start)
--- 62,68 ----
                        $order  = get_var('order',array('POST','GET'));
                        $filter = get_var('filter',array('POST','GET'));
                        $cat_id = get_var('cat_id',array('POST','GET'));
                        $allrows        = 
get_var('allrows',array('POST','GET'));
+                       $entity_id      = 
get_var('entity_id',array('POST','GET'));
  
                        if ($start)
***************
*** 102,106 ****
                                $this->allrows = $allrows;
                        }
- 
                }
  
--- 103,106 ----

Index: class.uiadmin_entity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiadmin_entity.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** class.uiadmin_entity.inc.php        16 Nov 2003 17:51:44 -0000      1.14
--- class.uiadmin_entity.inc.php        23 Nov 2003 17:41:35 -0000      1.15
***************
*** 551,554 ****
--- 551,557 ----
                                'lang_include_3_statustext'             => 
lang('Start this entity from'),
                                'lang_select'                                   
=> lang('select'),
+                               'lang_documentation'                    => 
lang('documentation'),
+                               'value_documentation'                   => 
$values['documentation'],
+                               'lang_documentation_statustext' => lang('If 
this entity type is to be linked to documents'),
                        );
  

Index: class.menu.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.menu.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** class.menu.inc.php  12 Nov 2003 18:00:52 -0000      1.3
--- class.menu.inc.php  23 Nov 2003 17:41:35 -0000      1.4
***************
*** 27,31 ****
                        $currentapp=$this->currentapp;
                        $sub = $this->sub;
!                       $menu = 
$GLOBALS['phpgw']->session->appsession('menu',$currentapp.$sub);
  
                        if(!$menu)
--- 27,31 ----
                        $currentapp=$this->currentapp;
                        $sub = $this->sub;
!               //      $menu = 
$GLOBALS['phpgw']->session->appsession('menu',$currentapp.$sub);
  
                        if(!$menu)
***************
*** 199,203 ****
                                {
                                        $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uidocument.index&cat_id=location');
                                        $menu['sub_menu'][$i]['name']           
        =       lang('location');
                                        $menu['sub_menu'][$i]['statustext']     
        =       lang('Documentation for locations');
--- 199,203 ----
                                {
                                        $i++;
!                                       $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uidocument.index');
                                        $menu['sub_menu'][$i]['name']           
        =       lang('location');
                                        $menu['sub_menu'][$i]['statustext']     
        =       lang('Documentation for locations');
***************
*** 206,209 ****
--- 206,224 ----
                                        $menu['sub_menu'][$i]['name']           
        =       lang('Equipment');
                                        $menu['sub_menu'][$i]['statustext']     
        =       lang('Documentation for equipment');
+ 
+                                       if (isset($entity_list) AND 
is_array($entity_list))
+                                       {
+                                               foreach($entity_list as $entry)
+                                               {
+                                                       
if($entry['documentation'])
+                                                       {
+                                                               $i++;
+                                                               
$menu['sub_menu'][$i]['link']                   =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uidocument.index&entity_id='
 .$entry['id']);
+                                                               
$menu['sub_menu'][$i]['name']                   =       $entry['name'];
+                                                               
$menu['sub_menu'][$i]['statustext']             =       $entry['descr'];
+                                                       }
+                                               }
+                                       }
+ 
                                }
  

Index: class.uidocument.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uidocument.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** class.uidocument.inc.php    9 Nov 2003 20:25:11 -0000       1.20
--- class.uidocument.inc.php    23 Nov 2003 17:41:35 -0000      1.21
***************
*** 41,44 ****
--- 41,45 ----
                        $this->bolocation                       = 
CreateObject($this->currentapp.'.bolocation');
                        $this->config                           = 
CreateObject('phpgwapi.config',$this->currentapp);
+                       $this->boadmin_entity           = 
CreateObject($this->currentapp.'.boadmin_entity');
  
                        $this->acl2                             = 
CreateObject($this->currentapp.'.acl2');
***************
*** 59,62 ****
--- 60,65 ----
                        $this->status_id                        = 
$this->bo->status_id;
                        $this->equipment_type           = 
$this->bo->equipment_type;
+                       $this->entity_id                        = 
$this->bo->entity_id;
+                       $this->doc_type                         = 
$this->bo->doc_type;
  
                        $this->menu->sub                        ='document';
***************
*** 74,78 ****
                                'cat_id'        => $this->cat_id,
                                'status_id'     => $this->status_id,
!                               'equipment_type'        => $this->equipment_type
                        );
                        $this->bo->save_sessiondata($data);
--- 77,83 ----
                                'cat_id'        => $this->cat_id,
                                'status_id'     => $this->status_id,
!                               'equipment_type'        => 
$this->equipment_type,
!                               'entity_id'     => $this->entity_id,
!                               'doc_type'      => $this->doc_type
                        );
                        $this->bo->save_sessiondata($data);
***************
*** 91,95 ****
                                                                                
'search_field'));
  
! //                    $lookup = get_var('lookup',array('POST','GET'));
                        $links = $this->menu->links();
  
--- 96,100 ----
                                                                                
'search_field'));
  
!                       $entity_id = get_var('entity_id',array('POST','GET'));
                        $links = $this->menu->links();
  
***************
*** 108,111 ****
--- 113,117 ----
                                $this->status_id                        = 
$this->bo->status_id;
                                $this->equipment_type           = 
$this->bo->equipment_type;
+                               $this->entity_id                        = 
$this->bo->entity_id;
                        }
  
***************
*** 146,151 ****
                                                
$content[$j]['row'][$k]['statustext']                   = lang('view documents 
for this location/equipment');
                                                $content[$j]['row'][$k]['text'] 
                                = lang('documents');
!                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.list_doc&location_code='
 . $document_entry['location_code'] . '&equipment_id=' . 
$document_entry['equipment_id']);
                                                $k++;
                                        }
                                }
--- 152,158 ----
                                                
$content[$j]['row'][$k]['statustext']                   = lang('view documents 
for this location/equipment');
                                                $content[$j]['row'][$k]['text'] 
                                = lang('documents');
!                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.list_doc&location_code='
 . $document_entry['location_code'] . '&p_num=' . $document_entry['p_num'] . 
'&entity_id=' . $document_entry['p_entity_id'] . '&cat_id=' . 
$document_entry['p_cat_id']);
                                                $k++;
+ 
                                        }
                                }
***************
*** 174,178 ****
                                                                                
                                                        'lookup'        
=>$lookup,
                                                                                
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id)
                                                                                
));
                                        }
--- 181,186 ----
                                                                                
                                                        'lookup'        
=>$lookup,
                                                                                
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id,
!                                                                               
                                                        'entity_id'             
=>$this->entity_id)
                                                                                
));
                                        }
***************
*** 190,194 ****
                                                                                
                                                        'lookup'        
=>$lookup,
                                                                                
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id)
                                                                                
));
                                        }
--- 198,203 ----
                                                                                
                                                        'lookup'        
=>$lookup,
                                                                                
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id,
!                                                                               
                                                        'entity_id'             
=>$this->entity_id)
                                                                                
));
                                        }
***************
*** 206,210 ****
                                                                                
                                                        'lookup'        
=>$lookup,
                                                                                
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id)
                                                                                
));
                                        }
--- 215,220 ----
                                                                                
                                                        'lookup'        
=>$lookup,
                                                                                
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id,
!                                                                               
                                                        'entity_id'             
=>$this->entity_id)
                                                                                
));
                                        }
***************
*** 226,230 ****
                                        'lang_add'                              
=> lang('add'),
                                        'lang_add_statustext'   => lang('add a 
document'),
!                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.edit')
  
                                );
--- 236,240 ----
                                        'lang_add'                              
=> lang('add'),
                                        'lang_add_statustext'   => lang('add a 
document'),
!                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.edit&entity_id='
 . $this->entity_id . '&cat_id='  . $this->cat_id)
  
                                );
***************
*** 240,244 ****
                                                'filter'                
=>$this->filter,
                                                'status_id'             
=>$this->status_id,
!                                               'query'                 
=>$this->query
                        );
  
--- 250,255 ----
                                                'filter'                
=>$this->filter,
                                                'status_id'             
=>$this->status_id,
!                                               'query'                 
=>$this->query,
!                                               'entity_id'             
=>$this->entity_id
                        );
  
***************
*** 248,251 ****
--- 259,278 ----
                        }
  
+                       if($this->entity_id)
+                       {
+                               $boentity               = 
CreateObject($this->currentapp.'.boentity');
+                               $boentity->entity_id=$this->entity_id;
+                       //      
$this->boadmin_entity->entity_id=$this->entity_id;
+                               $cat_list       = 
$boentity->select_category_list('filter',$this->cat_id);
+                               $entity         = 
$this->boadmin_entity->read_single($this->entity_id,false);
+                               $appname_sub    = $entity['name'];
+                       }
+                       else
+                       {
+                               $appname_sub    = lang('location');
+                       }
+ 
+ 
+ 
  //_debug_array($equipment_type_list);
                        $data = array
***************
*** 275,278 ****
--- 302,310 ----
                                'equipment_type_list'                           
        => $equipment_type_list,
  
+                               'lang_no_cat'                                   
=> lang('no category'),
+                               'lang_cat_statustext'                   => 
lang('Select the category. To do not use a category select NO CATEGORY'),
+                               'select_name'                                   
=> 'cat_id',
+                               'cat_list'                                      
        => $cat_list,
+ 
                                'lang_status_statustext'                => 
lang('Select the status the document belongs to. To do not use a category 
select NO STATUS'),
                                'status_name'                                   
=> 'status_id',
***************
*** 297,301 ****
                        $function_msg   = lang('list document');
  
!                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg . ' - ' . 
lang($this->cat_id);
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                        $this->save_sessiondata();
--- 329,333 ----
                        $function_msg   = lang('list document');
  
!                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg . ' - ' . 
$appname_sub;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                        $this->save_sessiondata();
***************
*** 338,344 ****
--- 370,389 ----
                        $location_code = 
get_var('location_code',array('POST','GET'));
                        $equipment_id = 
get_var('equipment_id',array('POST','GET'));
+                       $p_num = get_var('p_num',array('POST','GET'));
  
                        
$location=$this->bo->read_location_data($location_code,$equipment_id);
  
+                       if($this->cat_id)
+                       {
+                               $entity_data[$this->entity_id]['p_num']=$p_num;
+                               
$entity_data[$this->entity_id]['p_entity_id']=$this->entity_id;
+                               
$entity_data[$this->entity_id]['p_cat_id']=$this->cat_id;
+                               $entity = 
$this->boadmin_entity->read_single($this->entity_id,false);
+                               $category = 
$this->boadmin_entity->read_single_category($this->entity_id,$this->cat_id);
+                               $lookup_entity  = 
$this->bocommon->get_lookup_entity('document');
+                       }
+ 
+                       
$entity_data[$this->entity_id]['p_cat_name']=$category['name'];
+ 
                        
$location_data=$this->bolocation->initiate_ui_location(array(
                                                'values'                => 
$location,
***************
*** 347,356 ****
                                                'tenant'                => 
False,
                                                'equipment'             => 
$equipment_id,
!                                               'lookup_type'   => 'view'
                                                ));
  
- //_debug_array($receipt);
- 
- 
                        $this->config->read_repository();
                        $files_url = $this->config->config_data['files_url'];
--- 392,400 ----
                                                'tenant'                => 
False,
                                                'equipment'             => 
$equipment_id,
!                                               'lookup_type'   => 'view',
!                                               'lookup_entity' => 
$lookup_entity,
!                                               'entity_data'   => $entity_data
                                                ));
  
                        $this->config->read_repository();
                        $files_url = $this->config->config_data['files_url'];
***************
*** 473,481 ****
                                'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
!                               'type'                                          
        => $this->cat_id,
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the document belongs to. To do not use a category 
select NO CATEGORY'),
!                               '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),
--- 517,525 ----
                                'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
!                               'type'                                          
        => $this->doc_type,
                                'lang_no_cat'                                   
=> lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the document belongs to. To do not use a category 
select NO CATEGORY'),
!                               'select_name'                                   
=> 'doc_type',
!                               'cat_list'                                      
        => $this->bo->select_doc_type_list('filter',$this->doc_type),
  
  //                            'district_list'                                 
=> $this->bocommon->select_district_list('filter',$this->district_id),
***************
*** 644,648 ****
                                }
  
!                               if(!$values['cat_id'])
                                {
                                        
$receipt['error'][]=array('msg'=>lang('Please select a category !'));
--- 688,692 ----
                                }
  
!                               if(!$values['doc_type'])
                                {
                                        
$receipt['error'][]=array('msg'=>lang('Please select a category !'));
***************
*** 739,745 ****
                        );
  
!                       if ($values['cat_id'])
                        {
!                               $this->cat_id = $values['cat_id'];
                        }
                        if ($values['location_code'])
--- 783,789 ----
                        );
  
!                       if ($values['doc_type'])
                        {
!                               $this->doc_type = $values['doc_type'];
                        }
                        if ($values['location_code'])
***************
*** 815,819 ****
                                'lang_save_statustext'                  => 
lang('Save the document'),
  
!                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.'
 .$from . '&location_code=' . $location_code . '&equipment_id=' . $equipment_id 
. '&preserve=1'),
                                'lang_done'                                     
        => lang('done'),
                                'lang_done_statustext'                  => 
lang('Back to the list'),
--- 859,863 ----
                                'lang_save_statustext'                  => 
lang('Save the document'),
  
!                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uidocument.'
 .$from . '&location_code=' . $location_code . '&entity_id=' . $this->entity_id 
. '&cat_id=' . $this->cat_id . '&preserve=1'),
                                'lang_done'                                     
        => lang('done'),
                                'lang_done_statustext'                  => 
lang('Back to the list'),
***************
*** 849,855 ****
                                'lang_no_cat'                                   
=> lang('Select category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the document belongs to. To do not use a category 
select NO CATEGORY'),
!                               'select_name'                                   
=> 'values[cat_id]',
!                               'value_cat_id'                                  
=> $values['cat_id'],
!                               'cat_list'                                      
        => $this->bo->select_category_list('select',$values['cat_id']),
  
                                'lang_coordinator'                              
=> lang('Coordinator'),
--- 893,899 ----
                                'lang_no_cat'                                   
=> lang('Select category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the document belongs to. To do not use a category 
select NO CATEGORY'),
!                               'select_name'                                   
=> 'values[doc_type]',
!                               'value_cat_id'                                  
=> $values['doc_type'],
!                               'cat_list'                                      
        => $this->bo->select_doc_type_list('select',$values['doc_type']),
  
                                'lang_coordinator'                              
=> lang('Coordinator'),
***************
*** 978,984 ****
                        );
  
!                       if ($values['cat_id'])
                        {
!                               $this->cat_id = $values['cat_id'];
                        }
  
--- 1022,1028 ----
                        );
  
!                       if ($values['doc_type'])
                        {
!                               $this->cat_id = $values['doc_type'];
                        }
  
***************
*** 1072,1078 ****
                                'lang_no_cat'                                   
=> lang('Select category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the document belongs to. To do not use a category 
select NO CATEGORY'),
!                               'select_name'                                   
=> 'values[cat_id]',
!                               'value_cat_id'                                  
=> $values['cat_id'],
!                               'cat_list'                                      
        => $this->bo->select_category_list('select',$values['cat_id']),
  
                                'lang_coordinator'                              
=> lang('Coordinator'),
--- 1116,1122 ----
                                'lang_no_cat'                                   
=> lang('Select category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the document belongs to. To do not use a category 
select NO CATEGORY'),
!                               'select_name'                                   
=> 'values[doc_type]',
!                               'value_cat_id'                                  
=> $values['doc_type'],
!                               'cat_list'                                      
        => $this->bo->select_doc_type_list('select',$values['doc_type']),
  
                                'lang_coordinator'                              
=> lang('Coordinator'),

Index: class.bodocument.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bodocument.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** class.bodocument.inc.php    9 Nov 2003 20:25:11 -0000       1.11
--- class.bodocument.inc.php    23 Nov 2003 17:41:35 -0000      1.12
***************
*** 52,55 ****
--- 52,57 ----
                        $status_id      = 
get_var('status_id',array('POST','GET'));
                        $equipment_type = 
get_var('equipment_type',array('POST','GET'));
+                       $entity_id      = 
get_var('entity_id',array('POST','GET'));
+                       $doc_type       = 
get_var('doc_type',array('POST','GET'));
  
                        if ($start)
***************
*** 90,93 ****
--- 92,104 ----
                                $this->equipment_type = $equipment_type;
                        }
+                       if(isset($entity_id))
+                       {
+                               $this->entity_id = $entity_id;
+                       }
+                       if(isset($doc_type))
+                       {
+                               $this->doc_type = $doc_type;
+                       }
+ 
                }
  
***************
*** 113,116 ****
--- 124,129 ----
                        $this->cat_id   = $data['cat_id'];
                        $this->equipment_type   = $data['equipment_type'];
+                       $this->entity_id        = $data['entity_id'];
+                       $this->doc_type = $data['doc_type'];
                }
  
***************
*** 189,193 ****
  
  
!               function select_category_list($format='',$selected='')
                {
                        switch($format)
--- 202,206 ----
  
  
!               function select_doc_type_list($format='',$selected='')
                {
                        switch($format)
***************
*** 201,205 ****
                        }
  
!                       $categories= $this->so->select_category_list();
  
                        while (is_array($categories) && list(,$category) = 
each($categories))
--- 214,218 ----
                        }
  
!                       $categories= $this->so->select_doc_type_list();
  
                        while (is_array($categories) && list(,$category) = 
each($categories))
***************
*** 234,238 ****
                {
                        $document = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
!                                                                               
        'filter' => $this->filter,'cat_id' => $this->cat_id,'equipment_type' => 
$this->equipment_type));
                        $this->total_records = $this->so->total_records;
  
--- 247,251 ----
                {
                        $document = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
!                                                                               
        'filter' => $this->filter,'cat_id' => $this->cat_id,'equipment_type' => 
$this->equipment_type,'entity_id' => $this->entity_id));
                        $this->total_records = $this->so->total_records;
  





reply via email to

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