phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc/class.uilocation.inc.php, 1.1.1.2


From: nomail
Subject: [Phpgroupware-cvs] property/inc/class.uilocation.inc.php, 1.1.1.2
Date: Tue, 25 May 2004 14:32:28 +0200

Update of /property/inc
Modified Files:
        Branch: 
          class.uilocation.inc.php

date: 2004/05/25 12:32:28;  author: sigurdne;  state: Exp;  lines: +103 -6

Log Message:
no message
=====================================================================
Index: property/inc/class.uilocation.inc.php
diff -u property/inc/class.uilocation.inc.php:1.1.1.1 
property/inc/class.uilocation.inc.php:1.1.1.2
--- property/inc/class.uilocation.inc.php:1.1.1.1       Fri Apr 23 13:14:10 2004
+++ property/inc/class.uilocation.inc.php       Tue May 25 12:32:28 2004
@@ -34,7 +34,8 @@
                        'edit'          => True,
                        'delete'        => True,
                        'update_cat'=> True,
-                       'stop'=> True
+                       'stop'          => True,
+                       'summary'       => True
                );
 
                function uilocation()
@@ -93,6 +94,7 @@
 
                function excel()
                {
+                       $summary                = 
get_var('summary',array('GET'));
                        $GLOBALS['phpgw_info']['flags']['noframework'] = True;
                        require('PEAR.php');
                        $xls            = 
CreateObject($this->currentapp.'.excel');
@@ -102,17 +104,23 @@
                        $lookup_name    = 
get_var('lookup_name',array('POST','GET'));
                        $lookup_tenant  = 
get_var('lookup_tenant',array('POST','GET'));
 
-               //      $location_list = 
$this->bo->read($type_id,$lookup_tenant,$allrows=true);
-                       $location_list = 
$this->bo->read(array('type_id'=>$type_id,'lookup_tenant'=>$lookup_tenant,'lookup'=>$lookup,'allrows'=>True));
+                       if(!$summary)
+                       {
+                               $list = 
$this->bo->read(array('type_id'=>$type_id,'lookup_tenant'=>$lookup_tenant,'lookup'=>$lookup,'allrows'=>True));
+                       }
+                       else
+                       {
+                               $list= $this->bo->read_summary();
+                       }
 
                        $uicols = $this->bo->uicols;
                        $count_uicols_name=count($uicols['name']);
 
                        $j=0;
-                       if (isset($location_list) AND is_array($location_list))
+                       if (isset($list) AND is_array($list))
                        {
                                $str=$xls->Begin();
-                               foreach($location_list as $location_entry)
+                               foreach($list as $location_entry)
                                {
                                        $m=0;
                                        for ($k=0;$k<$count_uicols_name;$k++)
@@ -1271,9 +1279,98 @@
                        );
 
                        $appname                = lang('Access error');
-                       $function_msg   = lang('Update the not active category 
for locations');
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' : ' . $appname;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('stop' => $data));
+               }
+               function summary()
+               {
+                       $links = $this->menu->links('summary');
+
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('location','menu'));
+
+                       $summary_list= $this->bo->read_summary();
+                       $uicols = $this->bo->uicols;
+
+                       $j=0;
+                       if (isSet($summary_list) AND is_array($summary_list))
+                       {
+                               foreach($summary_list as $summary)
+                               {
+                                       for 
($i=0;$i<count($uicols['name']);$i++)
+                                       {
+                                               
$content[$j]['row'][$i]['value']                        = 
$summary[$uicols['name'][$i]];
+                                               $content[$j]['row'][$i]['name'] 
                        = $summary['name'][$i];
+                                       }
+
+                                       $j++;
+                               }
+                       }
+
+                       $uicols_count   = count($uicols['descr']);
+                       for ($i=0;$i<$uicols_count;$i++)
+                       {
+                               if($uicols['input_type'][$i]!='hidden')
+                               {
+                                       $table_header[$i]['header']     = 
$uicols['descr'][$i];
+                                       $table_header[$i]['width']              
= '15%';
+                                       $table_header[$i]['align']              
= 'left';
+
+                               }
+                       }
+
+
+
+                       $link_excel = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uilocation.excel',
+                                               'district_id'           
=>$this->district_id,
+                                               'part_of_town_id'       
=>$this->part_of_town_id,
+                                               'filter'                        
=>$this->filter,
+                                               'type_id'                       
=>$type_id,
+                                               'summary'                       
=>True
+                       );
+
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uilocation.summary',
+                                               'district_id'           
=>$this->district_id,
+                                               'part_of_town_id'       
=>$this->part_of_town_id,
+                                               'filter'                        
=>$this->filter,
+                                               'type_id'                       
=>$type_id
+                       );
+
+
+                       $data = array
+                       (
+                               'links'                                         
=> $links,
+                               'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'owner_name'                                    
=> 'filter',
+                               'owner_list'                                    
=> $this->bo->get_owner_type_list('filter', $this->filter),
+                               'lang_show_all'                                 
=> lang('Show all'),
+                               'lang_owner_statustext'                 => 
lang('Select the owner type. To show all entries select SHOW ALL'),
+                               'select_name_part_of_town'              => 
'part_of_town_id',
+                               'part_of_town_list'                             
=> $this->bocommon->select_part_of_town('filter',$this->part_of_town_id),
+                               'lang_town_statustext'                  => 
lang('Select the part of town the property belongs to. To do not use a part of 
town -  select NO PART OF TOWN'),
+                               'lang_no_part_of_town'                  => 
lang('No Part of town'),
+
+                               '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',
+                               'lang_excel'                                    
=> 'excel',
+                               'link_excel'                                    
=> $GLOBALS['phpgw']->link('/index.php',$link_excel),
+                               'lang_excel_help'                               
=> lang('Download table to MS Excel'),
+                               'overlib_source'                                
=> './'.$this->currentapp.'/inc/overlib.js',
+                               'table_header_summary'                  => 
$table_header,
+                               'values'                                        
        => $content
+                       );
+
+//_debug_array($data);
+
+                       $appname                = lang('Summary');
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' : ' . $appname;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('summary' => $data));
                }
        }
 ?>




reply via email to

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