fmsystem-commits
[Top][All Lists]
Advanced

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

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


From: Sigurd Nes
Subject: [Fmsystem-commits] [10943] property: budget handling
Date: Fri, 01 Mar 2013 09:18:09 +0000

Revision: 10943
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10943
Author:   sigurdne
Date:     2013-03-01 09:18:08 +0000 (Fri, 01 Mar 2013)
Log Message:
-----------
property: budget handling

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

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2013-02-28 17:55:47 UTC (rev 
10942)
+++ trunk/property/inc/class.uiproject.inc.php  2013-03-01 09:18:08 UTC (rev 
10943)
@@ -1771,6 +1771,8 @@
 
                        $sum_actual_cost = 0;
                        $sum_oblications = 0;
+                       $rows_per_page = 10;
+                       $initial_page = 1;
 
                        if($id)
                        {
@@ -1780,8 +1782,21 @@
                                $lang_active = lang('Check to activate period');
                                $values['sum'] = 0;
 
+                               $_year_count = array();
+                               foreach ($content_budget as $key => $row)
+                               {
+                                       $_year_count[$row['year']]  +=1;
+                                       $rows_per_page = 
$_year_count[$row['year']];
+                               }
+
                                if($content_budget)
                                {
+                                       $initial_page = 
floor(count($content_budget)/$rows_per_page);
+                               }
+
+/*
+                               if($content_budget)
+                               {
                                        foreach ($content_budget as $key => 
$row)
                                        {
                                                $_year_arg[$key]  = 
$row['year'];
@@ -1792,7 +1807,7 @@
 
                                        reset($content_budget);
                                }
-
+*/
                                foreach($content_budget as & $b_entry)
                                {
                                        if($b_entry['active'])
@@ -1886,7 +1901,8 @@
                                        'edit_action'                   => "''",
                                        'permission'                    => "''",
                                        'is_paginator'                  => 1,
-                                       'rows_per_page'                 => 12,
+                                       'rows_per_page'                 => 
$rows_per_page,
+                                       'initial_page'                  => 
$initial_page,
                                        'footer'                                
=> 0
                        );
 

Modified: trunk/property/js/yahoo/property2.js
===================================================================
--- trunk/property/js/yahoo/property2.js        2013-02-28 17:55:47 UTC (rev 
10942)
+++ trunk/property/js/yahoo/property2.js        2013-03-01 09:18:08 UTC (rev 
10943)
@@ -380,11 +380,19 @@
                                rows_per_page = data[0]['rows_per_page'];
                        }
 
+                       var initial_page = 1;
+
+                       if(typeof(data[0]['initial_page'])!= 'undefined' && 
data[0]['initial_page'])
+                       {
+                               initial_page = data[0]['initial_page'];
+                       }
+
                        myPaginatorConfig = {
                                                                        
containers                      : pager,
                                                                        
totalRecords            : data[0]["total_records"],
                                                                        
pageLinks                       : 10,
-                                                                       
rowsPerPage                     : rows_per_page
+                                                                       
rowsPerPage                     : rows_per_page,
+                                                                       
initialPage                     : initial_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 17:55:47 UTC (rev 
10942)
+++ trunk/property/templates/base/project.xsl   2013-03-01 09:18:08 UTC (rev 
10943)
@@ -642,6 +642,9 @@
                                                                                
<xsl:if test="rows_per_page">
                                                                                
        rows_per_page: "<xsl:value-of select="rows_per_page"/>",
                                                                                
</xsl:if>
+                                                                               
<xsl:if test="initial_page">
+                                                                               
        initial_page: "<xsl:value-of select="initial_page"/>",
+                                                                               
</xsl:if>
                                                                                
footer:<xsl:value-of select="footer"/>
                                                                        }
                                                                ]




reply via email to

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