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 inc/class...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property inc/class.uilocation.inc.php inc/class...
Date: Sun, 30 Sep 2007 16:20:37 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Changes by:     Sigurd Nes <sigurdne>   07/09/30 16:20:37

Modified files:
        inc            : class.uilocation.inc.php 
                         class.uiproject.inc.php 
        templates/base : project.xsl 

Log message:
        related info / budget info

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uilocation.inc.php?cvsroot=phpgroupware&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uiproject.inc.php?cvsroot=phpgroupware&r1=1.56&r2=1.57
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/project.xsl?cvsroot=phpgroupware&r1=1.13&r2=1.14

Patches:
Index: inc/class.uilocation.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uilocation.inc.php,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- inc/class.uilocation.inc.php        21 Sep 2007 19:28:56 -0000      1.54
+++ inc/class.uilocation.inc.php        30 Sep 2007 16:20:36 -0000      1.55
@@ -24,7 +24,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage location
-       * @version $Id: class.uilocation.inc.php,v 1.54 2007/09/21 19:28:56 
sigurdne Exp $
+       * @version $Id: class.uilocation.inc.php,v 1.55 2007/09/30 16:20:36 
sigurdne Exp $
        */
 
        /**
@@ -864,6 +864,7 @@
                                        'datatype'      => $custom['datatype']
                                        );
 
+                               $attributes_values[$r]['attrib_id']             
= $custom['id'];
                                $attributes_values[$r]['id']                    
= $custom['id'];
                                $attributes_values[$r]['input_text']    = 
$custom['input_text'];
                                $attributes_values[$r]['statustext']    = 
$custom['statustext'];
@@ -872,6 +873,12 @@
                                $attributes_values[$r]['input_name']    = 
$custom['column_name'];
                                $attributes_values[$r]['value']                 
= $values[$custom['column_name']];
                                
+                               /* Preserve attribute values from post */
+                               if(isset($receipt['error']) && (isset( 
$values_attribute) && is_array( $values_attribute)))
+                               {
+                                       $attributes_values[$r]['value'] = 
$values_attribute[$r]['value'];
+                               }
+
                                if($attributes_values[$r]['datatype']=='D' && 
$attributes_values[$r]['value'])
                                {
                                        $timestamp_date= 
mktime(0,0,0,date(m,strtotime($attributes_values[$r]['value'])),date(d,strtotime($attributes_values[$r]['value'])),date(y,strtotime($attributes_values[$r]['value'])));
@@ -960,6 +967,7 @@
                                }
                        }
 
+//_debug_array($attributes_values);
                        
$GLOBALS['phpgw']->session->appsession('location_datatype',$this->currentapp,$location_datatype);
 
                        $insert_record['extra'][]                               
                = 'cat_id';
@@ -1044,6 +1052,41 @@
                        {
                                $change_type_list = 
$this->bo->select_change_type($values['change_type']);
 
+                               $location_types = 
$this->soadmin_location->read(array('order'=>'id','sort'=>'ASC'));
+                               foreach ($location_types as $location_type)
+                               {
+                                       if($type_id != $location_type['id'])
+                                       {
+                                               if($type_id > 
$location_type['id'])
+                                               {
+                                                       $entities_link[] = array
+                                                       (
+                                                               'entity_link'   
                => $GLOBALS['phpgw']->link('/index.php',array(
+                                                                               
                                        'menuaction'=> 
$this->currentapp.'.uilocation.edit',
+                                                                               
                                        
'location_code'=>implode('-',array_slice($location, 0, $location_type['id']))
+                                                                               
                                        )
+                                                                               
                                ),
+                                                               
'lang_entity_statustext'        => $location_type['descr'],
+                                                               'text_entity'   
                => $location_type['name'],
+                                                       );
+                                               }
+                                               else
+                                               {
+                                                       $entities_link[] = array
+                                                       (
+                                                               'entity_link'   
                => $GLOBALS['phpgw']->link('/index.php',array(
+                                                                               
                                        'menuaction'=> 
$this->currentapp.'.uilocation.index',
+                                                                               
                                        'type_id'=> $location_type['id'],
+                                                                               
                                        
'query'=>implode('-',array_slice($location, 0, $location_type['id']))
+                                                                               
                                        )
+                                                                               
                                ),
+                                                               
'lang_entity_statustext'        => $location_type['descr'],
+                                                               'text_entity'   
                => $location_type['name'],
+                                                       );
+                                               }
+                                       }
+                               }
+
                                $entities= 
$this->bo->read_entity_to_link($location_code);
 
                                if (isset($entities) AND is_array($entities))
@@ -1464,6 +1507,41 @@
 
                        $dateformat= (implode($sep,$dlarr));
 
+                       $location_types = 
$this->soadmin_location->read(array('order'=>'id','sort'=>'ASC'));
+                       foreach ($location_types as $location_type)
+                       {
+                               if($type_id != $location_type['id'])
+                               {
+                                       if($type_id > $location_type['id'])
+                                       {
+                                               $entities_link[] = array
+                                               (
+                                                       'entity_link'           
        => $GLOBALS['phpgw']->link('/index.php',array(
+                                                                               
                                'menuaction'=> 
$this->currentapp.'.uilocation.view',
+                                                                               
                                
'location_code'=>implode('-',array_slice($location, 0, $location_type['id']))
+                                                                               
                                )
+                                                                               
                        ),
+                                                       
'lang_entity_statustext'        => $location_type['descr'],
+                                                       'text_entity'           
        => $location_type['name'],
+                                               );
+                                       }
+                                       else
+                                       {
+                                               $entities_link[] = array
+                                               (
+                                                       'entity_link'           
        => $GLOBALS['phpgw']->link('/index.php',array(
+                                                                               
                                'menuaction'=> 
$this->currentapp.'.uilocation.index',
+                                                                               
                                'type_id'=> $location_type['id'],
+                                                                               
                                'query'=>implode('-',array_slice($location, 0, 
$location_type['id']))
+                                                                               
                                )
+                                                                               
                        ),
+                                                       
'lang_entity_statustext'        => $location_type['descr'],
+                                                       'text_entity'           
        => $location_type['name'],
+                                               );
+                                       }
+                               }
+                       }
+
                        $entities= 
$this->bo->read_entity_to_link($location_code);
 
                        if (isset($entities) AND is_array($entities))

Index: inc/class.uiproject.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uiproject.inc.php,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- inc/class.uiproject.inc.php 23 Mar 2007 16:02:48 -0000      1.56
+++ inc/class.uiproject.inc.php 30 Sep 2007 16:20:36 -0000      1.57
@@ -24,7 +24,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage project
-       * @version $Id: class.uiproject.inc.php,v 1.56 2007/03/23 16:02:48 
sigurdne Exp $
+       * @version $Id: class.uiproject.inc.php,v 1.57 2007/09/30 16:20:36 
sigurdne Exp $
        */
 
        /**
@@ -906,10 +906,13 @@
                                $msgbox_data ='';
                        }
 
+                       $values['sum'] = 
isset($values['budget'])?$values['budget']:0;
+                       
                        if(isset($values['reserve']) && $values['reserve']!=0)
                        {
                                
$reserve_remainder=$values['reserve']-$values['deviation'];
                                $remainder_percent= 
number_format(($reserve_remainder/$values['reserve'])*100, 2, ',', '');
+                               $values['sum'] = $values['sum'] + 
$values['reserve'];
                        }
 
                        $jscal = CreateObject('phpgwapi.jscalendar');
@@ -1017,6 +1020,8 @@
                                'value_reserve'                                 
=> (isset($values['reserve'])?$values['reserve']:''),
                                'lang_reserve_statustext'                       
=> lang('Enter the reserve'),
 
+                               'value_sum'                                     
        => (isset($values['sum'])?$values['sum']:''),
+
                                'lang_reserve_remainder'                        
=> lang('reserve remainder'),
                                'value_reserve_remainder'                       
=> (isset($reserve_remainder)?$reserve_remainder:''),
                                'value_reserve_remainder_percent'               
=> (isset($remainder_percent)?$remainder_percent:''),
@@ -1215,10 +1220,13 @@
                                }
                        }
 
-                       if($values['reserve'])
+                       $values['sum'] = 
isset($values['budget'])?$values['budget']:0;
+                       
+                       if(isset($values['reserve']) && $values['reserve']!=0)
                        {
                                
$reserve_remainder=$values['reserve']-$values['deviation'];
                                $remainder_percent= 
number_format(($reserve_remainder/$values['reserve'])*100, 2, ',', '');
+                               $values['sum'] = $values['sum'] + 
$values['reserve'];
                        }
 
 //_debug_array($values);
@@ -1282,7 +1290,8 @@
 
                                'lang_reserve'                          => 
lang('reserve'),
                                'value_reserve'                         => 
$values['reserve'],
-                               'lang_reserve_statustext'               => 
lang('Enter the reserve'),
+
+                               'value_sum'                                     
        => (isset($values['sum'])?$values['sum']:''),
 
                                'lang_reserve_remainder'                => 
lang('reserve remainder'),
                                'value_reserve_remainder'               => 
isset($reserve_remainder)?$reserve_remainder:'',

Index: templates/base/project.xsl
===================================================================
RCS file: /sources/phpgroupware/property/templates/base/project.xsl,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- templates/base/project.xsl  23 Mar 2007 16:02:48 -0000      1.13
+++ templates/base/project.xsl  30 Sep 2007 16:20:36 -0000      1.14
@@ -1,4 +1,4 @@
-<!-- $Id: project.xsl,v 1.13 2007/03/23 16:02:48 sigurdne Exp $ -->
+<!-- $Id: project.xsl,v 1.14 2007/09/30 16:20:36 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -460,6 +460,15 @@
                        </tr>
                        <tr>
                                <td valign="top">
+                                       <xsl:value-of select="lang_sum"/>
+                               </td>
+                               <td>
+                                       <xsl:value-of select="value_sum"/>
+                                       <xsl:text> </xsl:text> [ <xsl:value-of 
select="currency"/> ]
+                               </td>
+                       </tr>
+                       <tr>
+                               <td valign="top">
                                        <xsl:value-of 
select="lang_reserve_remainder"/>
                                </td>
                                <td>
@@ -971,6 +980,15 @@
                        </tr>
                        <tr>
                                <td valign="top">
+                                       <xsl:value-of select="lang_sum"/>
+                               </td>
+                               <td>
+                                       <xsl:value-of select="value_sum"/>
+                                       <xsl:text> </xsl:text> [ <xsl:value-of 
select="currency"/> ]
+                               </td>
+                       </tr>
+                       <tr>
+                               <td valign="top">
                                        <xsl:value-of 
select="lang_reserve_remainder"/>
                                </td>
                                <td>




reply via email to

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