fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8696] property: project budget per year


From: Sigurd Nes
Subject: [Fmsystem-commits] [8696] property: project budget per year
Date: Fri, 27 Jan 2012 10:32:41 +0000

Revision: 8696
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8696
Author:   sigurdne
Date:     2012-01-27 10:32:41 +0000 (Fri, 27 Jan 2012)
Log Message:
-----------
property: project budget per year

Modified Paths:
--------------
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/inc/class.uis_agreement.inc.php
    trunk/property/js/yahoo/project.edit.js
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php
    trunk/property/templates/base/project.xsl

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2012-01-27 09:56:46 UTC (rev 
8695)
+++ trunk/property/inc/class.uiproject.inc.php  2012-01-27 10:32:41 UTC (rev 
8696)
@@ -1603,12 +1603,24 @@
 
                        //---datatable 
settings---------------------------------------------------      
 
+
+                       if($id)
+                       {
+                               $content_budget = 
array();//$this->bo->get_budget($id);
+                               $lang_delete = lang('Check to delete year');
+                               foreach($content_budget as & $b_entry)
+                               {
+                                       $b_entry['delete_year'] = "<input 
type='checkbox' name='values[delete_b_year][]' value='{$b_entry['year']}' 
title='{$lang_delete}'>";
+                               }
+                       }
+
                        $datavalues[0] = array
                                (
                                        'name'                                  
=> "0",
-                                       'values'                                
=> json_encode($values['workorder_budget']),
-                                       'total_records'                 => 
count($values['workorder_budget']),
-                                       'edit_action'                   => 
json_encode($GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit'))),
+                                       'values'                                
=> json_encode($content_budget),
+                                       'total_records'                 => 
count($content_budget),
+                                       'edit_action'                   => "''",
+                                       'permission'                    => "''",
                                        'is_paginator'                  => 1,
                                        'footer'                                
=> 0
                                );
@@ -1617,25 +1629,23 @@
                        $myColumnDefs[0] = array
                                (
                                        'name'          => "0",
-                                       'values'        =>      
json_encode(array(      array('key' => 
'workorder_id','label'=>lang('Workorder'),'sortable'=>true,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink'),
-                                                                               
                                array('key' => 
'title','label'=>lang('title'),'sortable'=>true,'resizeable'=>true),
-                                                                               
                                array('key' => 
'b_account_id','label'=>lang('Budget 
account'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
-                                                                               
                                array('key' => 
'contract_sum','label'=>lang('contract 
sum'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
-                                                                               
                                array('key' => 
'budget','label'=>lang('Budget'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
-                                                                               
                                array('key' => 
'calculation','label'=>lang('Calculation'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
-                                                                               
                                array('key' => 
'actual_cost','label'=>lang('actual 
cost'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
-                                                                               
                //              array('key' => 
'charge_tenant','label'=>lang('charge 
tenant'),'sortable'=>true,'resizeable'=>true),
-                                                                               
                                array('key' => 
'vendor_name','label'=>lang('Vendor'),'sortable'=>true,'resizeable'=>true),
-                                                                               
                                array('key' => 
'status','label'=>lang('Status'),'sortable'=>true,'resizeable'=>true)))
+                                       'values'        =>      
json_encode(array(      array('key' => 
'year','label'=>lang('year'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'category','label'=>lang('category'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'ecodimb','label'=>lang('dimb'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'budget_account','label'=>lang('budget 
account'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'budget','label'=>lang('budget'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'actual_cost','label'=>lang('actual 
cost'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'delete_year','label'=>lang('Delete'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter')))
                                );
 
+
                        $datavalues[1] = array
                                (
                                        'name'                                  
=> "1",
-                                       'values'                                
=> json_encode($record_history),
-                                       'total_records'                 => 
count($record_history),
-                                       'edit_action'                   => "''",
-                                       'is_paginator'                  => 0,
+                                       'values'                                
=> json_encode($values['workorder_budget']),
+                                       'total_records'                 => 
count($values['workorder_budget']),
+                                       'edit_action'                   => 
json_encode($GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit'))),
+                                       'is_paginator'                  => 1,
                                        'footer'                                
=> 0
                                );
 
@@ -1643,15 +1653,19 @@
                        $myColumnDefs[1] = array
                                (
                                        'name'          => "1",
-                                       'values'        =>      
json_encode(array(      array('key' => 
'value_date','label'=>lang('Date'),'sortable'=>true,'resizeable'=>true),
-                                                                               
                                array('key' => 
'value_user','label'=>lang('User'),'Action'=>true,'resizeable'=>true),
-                                                                               
                                array('key' => 
'value_action','label'=>lang('action'),'sortable'=>true,'resizeable'=>true),
-                                                                               
                                array('key' => 
'value_old_value','label'=>lang('old value'),    
'sortable'=>true,'resizeable'=>true),
-                                                                               
                                array('key' => 
'value_new_value','label'=>lang('new 
value'),'sortable'=>true,'resizeable'=>true)))
+                                       'values'        =>      
json_encode(array(      array('key' => 
'workorder_id','label'=>lang('Workorder'),'sortable'=>true,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink'),
+                                                                               
                                array('key' => 
'title','label'=>lang('title'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
'b_account_id','label'=>lang('Budget 
account'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
+                                                                               
                                array('key' => 
'contract_sum','label'=>lang('contract 
sum'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
+                                                                               
                                array('key' => 
'budget','label'=>lang('Budget'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
+                                                                               
                                array('key' => 
'calculation','label'=>lang('Calculation'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
+                                                                               
                                array('key' => 
'actual_cost','label'=>lang('actual 
cost'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
+                                                                               
                //              array('key' => 
'charge_tenant','label'=>lang('charge 
tenant'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
'vendor_name','label'=>lang('Vendor'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
'status','label'=>lang('Status'),'sortable'=>true,'resizeable'=>true)))
                                );
 
                
-               
                        $invoices = array();
                        if ($id)
                        {
@@ -1724,14 +1738,37 @@
                        
                        $datavalues[] = $notify_info['datavalues'];
 
-                       $myColumnDefs[] = $notify_info['column_defs'];
+                       $myColumnDefs[3] = $notify_info['column_defs'];
 
                        $myButtons      = array();
                        if($mode == 'edit')
                        {
-                               $myButtons[]    = $notify_info['buttons'];
+                               $myButtons[3]   = $notify_info['buttons'];
                        }
 
+                       $datavalues[4] = array
+                               (
+                                       'name'                                  
=> "4",
+                                       'values'                                
=> json_encode($record_history),
+                                       'total_records'                 => 
count($record_history),
+                                       'edit_action'                   => "''",
+                                       'is_paginator'                  => 0,
+                                       'footer'                                
=> 0
+                               );
+
+
+                       $myColumnDefs[4] = array
+                               (
+                                       'name'          => "4",
+                                       'values'        =>      
json_encode(array(      array('key' => 
'value_date','label'=>lang('Date'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
'value_user','label'=>lang('User'),'Action'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
'value_action','label'=>lang('action'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
'value_old_value','label'=>lang('old value'),    
'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
'value_new_value','label'=>lang('new 
value'),'sortable'=>true,'resizeable'=>true)))
+                               );
+
+
+
 //     _debug_array($myButtons);die();
                        
//----------------------------------------------datatable settings--------
 

Modified: trunk/property/inc/class.uis_agreement.inc.php
===================================================================
--- trunk/property/inc/class.uis_agreement.inc.php      2012-01-27 09:56:46 UTC 
(rev 8695)
+++ trunk/property/inc/class.uis_agreement.inc.php      2012-01-27 10:32:41 UTC 
(rev 8696)
@@ -1453,9 +1453,10 @@
                        if($id)
                        {
                                $content_budget = $this->bo->get_budget($id);
+                               $lang_delete = lang('Check to delete year');
                                foreach($content_budget as & $b_entry)
                                {
-                                       $b_entry['delete_year'] = '<input 
type="checkbox" name="values[delete_b_year][]" value="'.$b_entry['year'].'" 
title="'.lang('Check to delete year').'">';                               
+                                       $b_entry['delete_year'] = "<input 
type='checkbox' name='values[delete_b_year][]' value='{$b_entry['year']}' 
title='{$lang_delete}'>";
                                }
                        }
 
@@ -1479,7 +1480,7 @@
                                                                                
                                array('key' => 
'budget_account','label'=>lang('budget 
account'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'budget','label'=>lang('budget'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'actual_cost','label'=>lang('actual 
cost'),'sortable'=>false,'resizeable'=>true),
-                                                                               
                                array('key' => 
'delete_year','label'=>lang('Delete 
budget'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter')))
+                                                                               
                                array('key' => 
'delete_year','label'=>lang('Delete'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter')))
                                );
 
                        //--------------------------------------------JSON 
CODE------------

Modified: trunk/property/js/yahoo/project.edit.js
===================================================================
--- trunk/property/js/yahoo/project.edit.js     2012-01-27 09:56:46 UTC (rev 
8695)
+++ trunk/property/js/yahoo/project.edit.js     2012-01-27 10:32:41 UTC (rev 
8696)
@@ -2,6 +2,7 @@
 var  myPaginator_1, myDataTable_1;
 var  myPaginator_2, myDataTable_2;
 var  myPaginator_3, myDataTable_3;
+var  myPaginator_4, myDataTable_4;
 
 
/********************************************************************************/
        YAHOO.widget.DataTable.formatLink = function(elCell, oRecord, oColumn, 
oData)
@@ -39,12 +40,18 @@
        {
                elCell.innerHTML = "<div align=\"right\">"+oData+"</div>";
        }       
+
+       var FormatterCenter = function(elCell, oRecord, oColumn, oData)
+       {
+               elCell.innerHTML = "<center>"+oData+"</center>";
+       }
        
 
/********************************************************************************/
     
        this.myParticularRenderEvent = function()
        {
-               this.addFooterDatatable0(myPaginator_0,myDataTable_0);
-               this.addFooterDatatable1(myPaginator_2,myDataTable_2);
+       //      this.addFooterDatatable0(myPaginator_0,myDataTable_0);
+               this.addFooterDatatable1(myPaginator_1,myDataTable_1);
+               this.addFooterDatatable2(myPaginator_2,myDataTable_2);
        }
 
 
/********************************************************************************/
@@ -52,13 +59,41 @@
        {
                //call getTotalSum(name of column) in property.js
                tmp_sum1 = getTotalSum('budget',2,paginator,datatable);
+
+               if(typeof(tableYUI)=='undefined')
+               {
+                       tableYUI = 
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[0].parentNode;
+                       tableYUI.setAttribute("id","tableYUI");
+               }
+               else
+               {
+                       tableYUI.deleteTFoot();
+               }
+
+               //Create ROW
+               newTR = document.createElement('tr');
+
+               td_sum('Sum');
+               td_empty(3);
+               td_sum(tmp_sum1);
+               td_empty(2);
+
+               myfoot = tableYUI.createTFoot();
+               myfoot.setAttribute("id","myfoot");
+               myfoot.appendChild(newTR);
+       }
+
+       this.addFooterDatatable1 = function(paginator,datatable)
+       {
+               //call getTotalSum(name of column) in property.js
+               tmp_sum1 = getTotalSum('budget',2,paginator,datatable);
                tmp_sum2 = getTotalSum('calculation',2,paginator,datatable);
                tmp_sum3 = getTotalSum('actual_cost',2,paginator,datatable);
                tmp_sum4 = getTotalSum('contract_sum',2,paginator,datatable);
 
                if(typeof(tableYUI)=='undefined')
                {
-                       tableYUI = 
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[0].parentNode;
+                       tableYUI = 
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[1].parentNode;
                        tableYUI.setAttribute("id","tableYUI");
                }
                else
@@ -83,7 +118,7 @@
        }
 
 
/********************************************************************************/
-       this.addFooterDatatable1 = function(paginator,datatable)
+       this.addFooterDatatable2 = function(paginator,datatable)
        {
                //call getTotalSum(name of column) in property.js
                tmp_sum1 = getTotalSum('amount',2,paginator,datatable);
@@ -91,7 +126,7 @@
 
                if(typeof(tableYUI2)=='undefined')
                {
-                       tableYUI2 = 
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[1].parentNode;
+                       tableYUI2 = 
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[2].parentNode;
                        tableYUI2.setAttribute("id","tableYUI");
                }
                else

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2012-01-27 09:56:46 UTC (rev 8695)
+++ trunk/property/setup/setup.inc.php  2012-01-27 10:32:41 UTC (rev 8696)
@@ -127,6 +127,7 @@
                'fm_projectbranch',
                'fm_project_group',
                'fm_project_history',
+               'fm_project_budget',
                'fm_tts_status',
                'fm_tts_tickets',
                'fm_tts_history',

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2012-01-27 09:56:46 UTC (rev 
8695)
+++ trunk/property/setup/tables_current.inc.php 2012-01-27 10:32:41 UTC (rev 
8696)
@@ -1372,6 +1372,24 @@
                        'ix' => array('location_code'),
                        'uc' => array()
                ),
+               'fm_project_budget' => array(
+                       'fd' => array(
+                               'project_id' => array('type' => 
'int','precision' => 4,'nullable' => False),
+                               'year' => array('type' => 'int','precision' => 
4,'nullable' => False),
+                               'budget_account' =>  array('type' => 
'varchar','precision' => 15,'nullable' => False),
+                               'ecodimb' => array('type' => 'int','precision' 
=> 4,'nullable' => True),
+                               'category' => array('type' => 'int','precision' 
=> 4,'nullable' => True),
+                               'budget' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
+                               'actual_cost' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
+                               'user_id' => array('type' => 'int','precision' 
=> 4,'nullable' => True),
+                               'entry_date' => array('type' => 
'int','precision' => 4,'nullable' => True),
+                               'modified_date' => array('type' => 
'int','precision' => 4,'nullable' => True)
+                       ),
+                       'pk' => array('project_id','year'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
                'fm_project_group' => array(
                        'fd' => array(
                                'id' => array('type' => 'int','precision' => 
'4','nullable' => False),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2012-01-27 09:56:46 UTC (rev 
8695)
+++ trunk/property/setup/tables_update.inc.php  2012-01-27 10:32:41 UTC (rev 
8696)
@@ -5817,7 +5817,48 @@
                }
        }
 
+
        /**
+       * Update property version from 0.9.17.633 to 0.9.17.634
+       * Add project budget per year
+       */
+/*
+       $test[] = '0.9.17.633';
+       function property_upgrade0_9_17_633()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM fm_cache");
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'fm_project_budget', array(
+                               'fd' => array(
+                                       'project_id' => array('type' => 
'int','precision' => 4,'nullable' => False),
+                                       'year' => array('type' => 
'int','precision' => 4,'nullable' => False),
+                                       'budget_account' =>  array('type' => 
'varchar','precision' => 15,'nullable' => False),
+                                       'ecodimb' => array('type' => 
'int','precision' => 4,'nullable' => True),
+                                       'category' => array('type' => 
'int','precision' => 4,'nullable' => True),
+                                       'budget' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
+                                       'actual_cost' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
+                                       'user_id' => array('type' => 
'int','precision' => 4,'nullable' => True),
+                                       'entry_date' => array('type' => 
'int','precision' => 4,'nullable' => True),
+                                       'modified_date' => array('type' => 
'int','precision' => 4,'nullable' => True)
+                               ),
+                               'pk' => array('project_id','year'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.634';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+
+*/
+       /**
        * Update property version from 0.9.17.607 to 0.9.17.608
        * Add more room for address at tickets
        * 

Modified: trunk/property/templates/base/project.xsl
===================================================================
--- trunk/property/templates/base/project.xsl   2012-01-27 09:56:46 UTC (rev 
8695)
+++ trunk/property/templates/base/project.xsl   2012-01-27 10:32:41 UTC (rev 
8696)
@@ -364,6 +364,15 @@
                                                                </td>
                                                        </tr>
                                                        <tr>
+                                                               <td width="19%" 
align="left" valign="top">
+                                                                       
<xsl:value-of select="php:function('lang', 'budget')"/>
+                                                               </td>
+                                                               <td>
+                                                                       <div 
id="paging_0"> </div>
+                                                                       <div 
id="datatable-container_0"/>
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
                                                                <td 
valign="top">
                                                                        
<xsl:value-of select="lang_reserve"/>
                                                                </td>
@@ -415,8 +424,8 @@
                                                                        
<xsl:otherwise>
                                                                                
<td>
                                                                                
        <!-- DataTable -->
-                                                                               
        <div id="paging_0"> </div>
-                                                                               
        <div id="datatable-container_0"/>
+                                                                               
        <div id="paging_1"> </div>
+                                                                               
        <div id="datatable-container_1"/>
                                                                                
</td>
                                                                        
</xsl:otherwise>
                                                                </xsl:choose>
@@ -572,8 +581,8 @@
                                                </table>
                                        </div>
                                        <div id="history">
-                                               <div id="paging_1"> </div>
-                                               <div 
id="datatable-container_1"/>
+                                               <div id="paging_4"> </div>
+                                               <div 
id="datatable-container_4"/>
                                        </div>
                                        <xsl:call-template 
name="attributes_values"/>
                                </div>




reply via email to

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