phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property inc/class.borequest.inc.php inc/class....


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property inc/class.borequest.inc.php inc/class....
Date: Thu, 09 Feb 2006 13:22:56 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/02/09 13:22:56

Modified files:
        inc            : class.borequest.inc.php class.sorequest.inc.php 
                         class.uirequest.inc.php 
        templates/base : request.xsl 
        templates/default: request.xsl 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.borequest.inc.php.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sorequest.inc.php.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uirequest.inc.php.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/request.xsl.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/default/request.xsl.diff?tr1=1.8&tr2=1.9&r1=text&r2=text

Patches:
Index: property/inc/class.borequest.inc.php
diff -u property/inc/class.borequest.inc.php:1.10 
property/inc/class.borequest.inc.php:1.11
--- property/inc/class.borequest.inc.php:1.10   Fri Feb  3 12:05:49 2006
+++ property/inc/class.borequest.inc.php        Thu Feb  9 13:22:56 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.borequest.inc.php,v 1.10 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.borequest.inc.php,v 1.11 2006/02/09 13:22:56 
sigurdne Exp $
        */
 
        /**
@@ -58,6 +58,7 @@
                        $filter = get_var('filter',array('POST','GET'));
                        $cat_id = get_var('cat_id',array('POST','GET'));
                        $status_id      = 
get_var('status_id',array('POST','GET'));
+                       $allrows        = 
get_var('allrows',array('POST','GET'));
 
                        if ($start)
                        {
@@ -92,6 +93,10 @@
                        {
                                $this->status_id = $status_id;
                        }
+                       if(isset($allrows))
+                       {
+                               $this->allrows = $allrows;
+                       }
                }
 
                function save_sessiondata($data)
@@ -113,6 +118,7 @@
                        $this->order    = $data['order'];
                        $this->cat_id   = $data['cat_id'];
                        $this->status_id        = $data['status_id'];
+                       $this->allrows          = $data['allrows'];
                }
 
 
@@ -247,7 +253,7 @@
                function select_conditions($request_id='')
                {
                        $condition_type_list = 
$this->so->select_condition_type_list();
-                       
+
                        if($request_id)
                        {
                                $conditions = 
$this->so->select_conditions($request_id,$condition_type_list);
@@ -264,7 +270,7 @@
 
                        return $conditions;
                }
- 
+
                function 
select_consequence_list($consequence_value='',$consequencedefault_type='')
                {
                        if ($consequence_value)
@@ -387,10 +393,11 @@
                        return  $this->so->update_priority_key($values);
                }
 
-               function read($project_id)
+               function read($data)
                {
                        $request = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'filter' => $this->filter,'cat_id' => $this->cat_id,'status_id' => 
$this->status_id,'project_id' => $project_id));
+                                                                               
        'filter' => $this->filter,'cat_id' => $this->cat_id,'status_id' => 
$this->status_id,
+                                                                               
        'project_id' => 
$data['project_id'],'allrows'=>$data['allrows'],'list_descr' => 
$data['list_descr']));
                        $this->total_records = $this->so->total_records;
 
                        $this->uicols   = $this->so->uicols;
Index: property/inc/class.sorequest.inc.php
diff -u property/inc/class.sorequest.inc.php:1.13 
property/inc/class.sorequest.inc.php:1.14
--- property/inc/class.sorequest.inc.php:1.13   Mon Jan 30 22:14:19 2006
+++ property/inc/class.sorequest.inc.php        Thu Feb  9 13:22:56 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.sorequest.inc.php,v 1.13 2006/01/30 22:14:19 
sigurdne Exp $
+       * @version $Id: class.sorequest.inc.php,v 1.14 2006/02/09 13:22:56 
sigurdne Exp $
        */
 
        /**
@@ -186,6 +186,9 @@
                                $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:0);
                                $status_id = 
(isset($data['status_id'])?$data['status_id']:0);
                                $project_id = 
(isset($data['project_id'])?$data['project_id']:'');
+                               $project_id = 
(isset($data['project_id'])?$data['project_id']:'');
+                               $allrows = 
(isset($data['allrows'])?$data['allrows']:'');
+                               $list_descr = 
(isset($data['list_descr'])?$data['list_descr']:'');
                        }
 
                        $entity_table = 'fm_request';
@@ -214,6 +217,24 @@
                        $uicols['descr'][]                      = lang('title');
                        $uicols['statustext'][]         = lang('Request title');
 
+                       if($list_descr)
+                       {
+                               $cols.= ",$entity_table.descr as descr";
+                               $cols_return[]                          = 
'descr';
+                               $uicols['input_type'][]         = 'text';
+                               $uicols['name'][]                       = 
'descr';
+                               $uicols['descr'][]                      = 
lang('descr');
+                               $uicols['statustext'][]         = lang('Request 
descr');
+                       }
+
+
+                       $cols.= ",$entity_table.budget as budget";
+                       $cols_return[]                          = 'budget';
+                       $uicols['input_type'][]         = 'text';
+                       $uicols['name'][]                       = 'budget';
+                       $uicols['descr'][]                      = 
lang('budget');
+                       $uicols['statustext'][]         = lang('Request 
budget');
+
                        $cols.= ",$entity_table.coordinator";
                        $cols_return[]                          = 'coordinator';
                        $uicols['input_type'][]         = 'text';
@@ -282,8 +303,15 @@
 
                        $this->db2->query($sql,__LINE__,__FILE__);
                        $this->total_records = $this->db2->num_rows();
-                       $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
 
+                       if(!$allrows)
+                       {
+                               $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
+                       }
+                       else
+                       {
+                               $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__);
+                       }
 
                        $j=0;
                        while ($this->db->next_record())
Index: property/inc/class.uirequest.inc.php
diff -u property/inc/class.uirequest.inc.php:1.19 
property/inc/class.uirequest.inc.php:1.20
--- property/inc/class.uirequest.inc.php:1.19   Fri Feb  3 12:05:49 2006
+++ property/inc/class.uirequest.inc.php        Thu Feb  9 13:22:56 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.uirequest.inc.php,v 1.19 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.uirequest.inc.php,v 1.20 2006/02/09 13:22:56 
sigurdne Exp $
        */
 
        /**
@@ -36,7 +36,8 @@
                        'edit'                  => True,
                        'delete'                => True,
                        'priority_key'  => True,
-                       'view_file'             => True
+                       'view_file'             => True,
+                       'excel'         => True
                );
 
                function uirequest()
@@ -70,6 +71,7 @@
 
                        $this->menu->sub                        ='project';
                        $this->fakebase                         = 
$this->bo->fakebase;
+                       $this->allrows                          = 
$this->bo->allrows;
                }
 
                function save_sessiondata()
@@ -82,7 +84,8 @@
                                'order'         => $this->order,
                                'filter'        => $this->filter,
                                'cat_id'        => $this->cat_id,
-                               'status_id'     => $this->status_id
+                               'status_id'     => $this->status_id,
+                               'allrows'       => $this->allrows
                        );
                        $this->bo->save_sessiondata($data);
                }
@@ -128,6 +131,14 @@
                        }
                }
 
+               function excel()
+               {
+                       $start_date     = urldecode($this->start_date);
+                       $end_date               = urldecode($this->end_date);
+                       $list                   = 
$this->bo->read(array('start_date' =>$start_date, 'end_date' 
=>$end_date,'allrows'=>True,'list_descr' => true));
+                       $uicols                 = $this->bo->uicols;
+                       
$this->bocommon->excel($list,$uicols['name'],$uicols['descr'],$uicols['input_type']);
+               }
 
                function index()
                {
@@ -149,7 +160,7 @@
                        }
                        $links = $this->menu->links('request');
 
-                       $request_list = $this->bo->read($project_id);
+                       $request_list = $this->bo->read(array('project_id' => 
1,'allrows'=>$this->allrows));
 
 //_debug_array($request_list);
 
@@ -279,6 +290,22 @@
                                                                                
                                                        'cat_id'        
=>$this->cat_id)
                                                                                
));
                                        }
+                                       if($uicols['name'][$i]=='budget')
+                                       {
+                                               $table_header[$i]['sort_link']  
=true;
+                                               $table_header[$i]['sort']       
        = $this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'budget',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uirequest.index',
+                                                                               
                                                        'type_id'       
=>$type_id,
+                                                                               
                                                        'query'         
=>$this->query,
+                                                                               
                                                        'project_id'    
=>$project_id,
+                                                                               
                                                        'district_id'   => 
$this->district_id,
+                                                                               
                                                        'cat_id'        
=>$this->cat_id)
+                                                                               
));
+                                       }
                                        if($uicols['name'][$i]=='address')
                                        {
                                                $table_header[$i]['sort_link']  
=true;
@@ -355,13 +382,39 @@
                        );
 
 
+                       $link_excel = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uirequest.excel',
+                                               'sort'                  
=>$this->sort,
+                                               'order'                 
=>$this->order,
+                                               'cat_id'                
=>$this->cat_id,
+                                               'district_id'   
=>$this->district_id,
+                                               'filter'                
=>$this->filter,
+                                               'status_id'             
=>$this->status_id,
+                                               'project_id'    =>$project_id,
+                                               'query'                 
=>$this->query
+                       );
+
                        if($this->acl_manage)
                        {
                                $link_priority_key                              
        = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uirequest.priority_key');
                        }
 
+                       if(!$this->allrows)
+                       {
+                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else
+                       {
+                               $record_limit   = $this->bo->total_records;
+                       }
+
                        $data = array
                        (
+                               'lang_excel'                            => 
'excel',
+                               'link_excel'                            => 
$GLOBALS['phpgw']->link('/index.php',$link_excel),
+                               'lang_excel_help'                       => 
lang('Download table to MS Excel'),
+
                                'lang_priority_key'                             
        => lang('Priority key'),
                                'lang_priority_help'                            
=> lang('To alter the priority key'),
                                'link_priority_key'                             
        => $link_priority_key,
@@ -375,9 +428,11 @@
 
                                'lookup'                                        
        => $lookup,
                                'links'                                         
        => $links,
-                               'allow_allrows'                                 
=> false,
+                               'allow_allrows'                                 
=> true,
+                               'allrows'                                       
        => $this->allrows,
+
                                'start_record'                                  
=> $this->start,
-                               'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
+                               'record_limit'                                  
=> $record_limit,
                                'num_records'                                   
=> count($request_list),
                                'all_records'                                   
=> $this->bo->total_records,
                                'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
Index: property/templates/base/request.xsl
diff -u property/templates/base/request.xsl:1.7 
property/templates/base/request.xsl:1.8
--- property/templates/base/request.xsl:1.7     Thu Sep 22 08:55:41 2005
+++ property/templates/base/request.xsl Thu Feb  9 13:22:56 2006
@@ -1,4 +1,4 @@
-<!-- $Id: request.xsl,v 1.7 2005/09/22 08:55:41 sigurdne Exp $ -->
+<!-- $Id: request.xsl,v 1.8 2006/02/09 13:22:56 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -108,6 +108,15 @@
                                <td align="right">
                                        <xsl:call-template name="search_field"/>
                                </td>
+                               <td class="small_text" valign="top" 
align="left">
+                                       <xsl:variable 
name="link_excel"><xsl:value-of select="link_excel"/></xsl:variable>
+                                       <xsl:variable 
name="lang_excel_help"><xsl:value-of select="lang_excel_help"/></xsl:variable>
+                                       <xsl:variable 
name="lang_excel"><xsl:value-of select="lang_excel"/></xsl:variable>
+                                       <a href="javascript:var 
w=window.open('{$link_excel}','','')"
+                                               
onMouseOver="overlib('{$lang_excel_help}', CAPTION, '{$lang_excel}')"
+                                               onMouseOut="nd()">
+                                               <xsl:value-of 
select="lang_excel"/></a>
+                               </td>
                        </tr>
                        <tr>
                                <td colspan="14" width="100%">
Index: property/templates/default/request.xsl
diff -u property/templates/default/request.xsl:1.8 
property/templates/default/request.xsl:1.9
--- property/templates/default/request.xsl:1.8  Thu Sep 22 08:55:42 2005
+++ property/templates/default/request.xsl      Thu Feb  9 13:22:56 2006
@@ -1,4 +1,4 @@
-<!-- $Id: request.xsl,v 1.8 2005/09/22 08:55:42 sigurdne Exp $ -->
+<!-- $Id: request.xsl,v 1.9 2006/02/09 13:22:56 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -108,6 +108,15 @@
                                <td align="right">
                                        <xsl:call-template name="search_field"/>
                                </td>
+                               <td class="small_text" valign="top" 
align="left">
+                                       <xsl:variable 
name="link_excel"><xsl:value-of select="link_excel"/></xsl:variable>
+                                       <xsl:variable 
name="lang_excel_help"><xsl:value-of select="lang_excel_help"/></xsl:variable>
+                                       <xsl:variable 
name="lang_excel"><xsl:value-of select="lang_excel"/></xsl:variable>
+                                       <a href="javascript:var 
w=window.open('{$link_excel}','','')"
+                                               
onMouseOver="overlib('{$lang_excel_help}', CAPTION, '{$lang_excel}')"
+                                               onMouseOut="nd()">
+                                               <xsl:value-of 
select="lang_excel"/></a>
+                               </td>
                        </tr>
                        <tr>
                                <td colspan="14" width="100%">




reply via email to

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