fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10939] property: budget handling


From: Sigurd Nes
Subject: [Fmsystem-commits] [10939] property: budget handling
Date: Thu, 28 Feb 2013 14:43:29 +0000

Revision: 10939
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10939
Author:   sigurdne
Date:     2013-02-28 14:43:23 +0000 (Thu, 28 Feb 2013)
Log Message:
-----------
property: budget handling

Modified Paths:
--------------
    trunk/property/inc/class.soproject.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/js/yahoo/property2.js
    trunk/property/templates/base/project.xsl

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2013-02-28 13:04:34 UTC (rev 
10938)
+++ trunk/property/inc/class.soproject.inc.php  2013-02-28 14:43:23 UTC (rev 
10939)
@@ -1438,6 +1438,13 @@
                                        
$historylog->add('B',$project['id'],$project['budget'], $old_budget);
                                }
 
+                               if($project['budget_reset_buffer'])
+                               {
+                                       $this->db->query("UPDATE fm_project SET 
budget = 0 WHERE id = " . (int)$project['id'],__LINE__,__FILE__);
+                                       $this->db->query("DELETE FROM 
fm_project_buffer_budget WHERE buffer_project_id = " . 
(int)$project['id'],__LINE__,__FILE__);
+                                       $historylog->add('B',$project['id'],0, 
$old_budget);
+                                       
$historylog->add('RM',$project['id'],'reset', false);
+                               }
                        }
                        else // investment or operation
                        {

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2013-02-28 13:04:34 UTC (rev 
10938)
+++ trunk/property/inc/class.uiproject.inc.php  2013-02-28 14:43:23 UTC (rev 
10939)
@@ -1780,6 +1780,19 @@
                                $lang_active = lang('Check to activate period');
                                $values['sum'] = 0;
 
+                               if($content_budget)
+                               {
+                                       foreach ($content_budget as $key => 
$row)
+                                       {
+                                               $_year_arg[$key]  = 
$row['year'];
+                                               $_month_arg[$key] = 
$row['month'];
+                                       }
+
+                                       array_multisort($_year_arg, SORT_DESC, 
$_month_arg, SORT_ASC, $content_budget);
+
+                                       reset($content_budget);
+                               }
+
                                foreach($content_budget as & $b_entry)
                                {
                                        if($b_entry['active'])
@@ -1814,8 +1827,6 @@
                        $values['sum']  = number_format($values['sum'], 0, ',', 
' ');
                        $value_remainder = number_format($value_remainder, 0, 
',', ' ');
 
-//_debug_array($content_budget);die();
-
                        if( isset($values['project_type_id']) && 
$values['project_type_id']==3)
                        {
 
@@ -1875,6 +1886,7 @@
                                        'edit_action'                   => "''",
                                        'permission'                    => "''",
                                        'is_paginator'                  => 1,
+                                       'rows_per_page'                 => 12,
                                        'footer'                                
=> 0
                        );
 

Modified: trunk/property/js/yahoo/property2.js
===================================================================
--- trunk/property/js/yahoo/property2.js        2013-02-28 13:04:34 UTC (rev 
10938)
+++ trunk/property/js/yahoo/property2.js        2013-02-28 14:43:23 UTC (rev 
10939)
@@ -374,12 +374,17 @@
 
                if(data[0]["is_paginator"]==1)
                {
+                       var rows_per_page = 0;
+                       if(typeof(data[0]['rows_per_page'])!= 'undefined' && 
data[0]['rows_per_page'])
+                       {
+                               rows_per_page = data[0]['rows_per_page'];
+                       }
 
                        myPaginatorConfig = {
                                                                        
containers                      : pager,
                                                                        
totalRecords            : data[0]["total_records"],
                                                                        
pageLinks                       : 10,
-                                                                       
rowsPerPage                     : 10
+                                                                       
rowsPerPage                     : rows_per_page
                                                                }
 
                        eval("myPaginator_"+num+" = new 
YAHOO.widget.Paginator(myPaginatorConfig)");

Modified: trunk/property/templates/base/project.xsl
===================================================================
--- trunk/property/templates/base/project.xsl   2013-02-28 13:04:34 UTC (rev 
10938)
+++ trunk/property/templates/base/project.xsl   2013-02-28 14:43:23 UTC (rev 
10939)
@@ -437,37 +437,54 @@
                                                                                
                        <xsl:apply-templates select="year_list/options"/>
                                                                                
                </select>
                                                                                
        </td>
+
                                                                                
        <xsl:choose>
-                                                                               
        <xsl:when test="project_type_id !='3'">
-                                                                               
                <td>
-                                                                               
                        <select name="values[budget_periodization]">
-                                                                               
                                <xsl:attribute name="title">
-                                                                               
                                        <xsl:value-of 
select="php:function('lang', 'periodization')"/>
-                                                                               
                                </xsl:attribute>
-                                                                               
                                <option value="0">
-                                                                               
                                        <xsl:value-of 
select="php:function('lang', 'periodization')"/>
-                                                                               
                                </option>
-                                                                               
                                <xsl:apply-templates 
select="periodization_list/options"/>
-                                                                               
                        </select>
-                                                                               
                </td>
-                                                                               
                <td>
-                                                                               
                        <input type="checkbox" 
name="values[budget_periodization_all]" value="True">
-                                                                               
                                <xsl:attribute name="title">
-                                                                               
                                        <xsl:value-of 
select="php:function('lang', 'all')"/>
-                                                                               
                                        <xsl:text> </xsl:text>
-                                                                               
                                        <xsl:value-of 
select="php:function('lang', 'periods')"/>
-                                                                               
                                </xsl:attribute>
-                                                                               
                        </input>
-                                                                               
                </td>
-                                                                               
                <td>
-                                                                               
                        <input type="checkbox" 
name="values[budget_periodization_activate]" value="1">
-                                                                               
                                <xsl:attribute name="title">
-                                                                               
                                        <xsl:value-of 
select="php:function('lang', 'activate')"/>
-                                                                               
                                </xsl:attribute>
-                                                                               
                        </input>
-                                                                               
                </td>
-                                                                               
        </xsl:when>
-                                                                               
</xsl:choose>
+                                                                               
                <xsl:when test="project_type_id ='3'">
+                                                                               
                        <td>
+                                                                               
                                <input type="checkbox" 
name="values[budget_reset_buffer]" value="1">
+                                                                               
                                        <xsl:attribute name="title">
+                                                                               
                                                <xsl:value-of 
select="php:function('lang', 'delete')"/>
+                                                                               
                                                <xsl:text> </xsl:text>
+                                                                               
                                                <xsl:value-of 
select="php:function('lang', 'buffer')"/>
+                                                                               
                                                <xsl:text> </xsl:text>
+                                                                               
                                                <xsl:value-of 
select="php:function('lang', 'budget')"/>
+                                                                               
                                        </xsl:attribute>
+                                                                               
                                </input>
+                                                                               
                        </td>
+                                                                               
                </xsl:when>
+                                                                               
        </xsl:choose>
+                                                                               
        
+                                                                               
        <xsl:choose>
+                                                                               
                <xsl:when test="project_type_id !='3'">
+                                                                               
                        <td>
+                                                                               
                                <select name="values[budget_periodization]">
+                                                                               
                                        <xsl:attribute name="title">
+                                                                               
                                                <xsl:value-of 
select="php:function('lang', 'periodization')"/>
+                                                                               
                                        </xsl:attribute>
+                                                                               
                                        <option value="0">
+                                                                               
                                                <xsl:value-of 
select="php:function('lang', 'periodization')"/>
+                                                                               
                                        </option>
+                                                                               
                                        <xsl:apply-templates 
select="periodization_list/options"/>
+                                                                               
                                </select>
+                                                                               
                        </td>
+                                                                               
                        <td>
+                                                                               
                                <input type="checkbox" 
name="values[budget_periodization_all]" value="True">
+                                                                               
                                        <xsl:attribute name="title">
+                                                                               
                                                <xsl:value-of 
select="php:function('lang', 'all')"/>
+                                                                               
                                                <xsl:text> </xsl:text>
+                                                                               
                                                <xsl:value-of 
select="php:function('lang', 'periods')"/>
+                                                                               
                                        </xsl:attribute>
+                                                                               
                                </input>
+                                                                               
                        </td>
+                                                                               
                        <td>
+                                                                               
                                <input type="checkbox" 
name="values[budget_periodization_activate]" value="1">
+                                                                               
                                        <xsl:attribute name="title">
+                                                                               
                                                <xsl:value-of 
select="php:function('lang', 'activate')"/>
+                                                                               
                                        </xsl:attribute>
+                                                                               
                                </input>
+                                                                               
                        </td>
+                                                                               
                </xsl:when>
+                                                                               
        </xsl:choose>
                                                                                
</tr>
                                                                        </table>
                                                                </td>
@@ -622,6 +639,9 @@
                                                                                
total_records: <xsl:value-of select="total_records"/>,
                                                                                
edit_action:  <xsl:value-of select="edit_action"/>,
                                                                                
is_paginator:  <xsl:value-of select="is_paginator"/>,
+                                                                               
<xsl:if test="rows_per_page">
+                                                                               
        rows_per_page: "<xsl:value-of select="rows_per_page"/>",
+                                                                               
</xsl:if>
                                                                                
footer:<xsl:value-of select="footer"/>
                                                                        }
                                                                ]




reply via email to

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