fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9310] property: custom fields at tickets


From: Sigurd Nes
Subject: [Fmsystem-commits] [9310] property: custom fields at tickets
Date: Tue, 08 May 2012 09:13:32 +0000

Revision: 9310
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9310
Author:   sigurdne
Date:     2012-05-08 09:13:31 +0000 (Tue, 08 May 2012)
Log Message:
-----------
property: custom fields at tickets

Modified Paths:
--------------
    trunk/property/inc/class.uitts.inc.php
    trunk/property/js/yahoo/tts.index.js

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2012-05-08 09:09:44 UTC (rev 
9309)
+++ trunk/property/inc/class.uitts.inc.php      2012-05-08 09:13:31 UTC (rev 
9310)
@@ -421,18 +421,6 @@
                                $this->status_id                = 
$default_status;
                        }
 
-/*
-                       $bgcolor_array[1]       = '#dadada';
-                       $bgcolor_array[2]       = '#dad0d0';
-                       $bgcolor_array[3]       = '#dacaca';
-                       $bgcolor_array[4]       = '#dac0c0';
-                       $bgcolor_array[5]       = '#dababa';
-                       $bgcolor_array[6]       = '#dab0b0';
-                       $bgcolor_array[7]       = '#daaaaa';
-                       $bgcolor_array[8]       = '#da9090';
-                       $bgcolor_array[9]       = '#da8a8a';
-                       $bgcolor_array[10]      = '#da7a7a';
- */
                        $bgcolor_array[1]       = '#da7a7a';
                        $bgcolor_array[2]       = '#dababa';
                        $bgcolor_array[3]       = '#dadada';
@@ -1249,15 +1237,16 @@
                        //values for Pagination
                        $json = array
                                (
-                                       'recordsReturned'       => 
$datatable['pagination']['records_returned'],
-                                       'totalRecords'          => 
(int)$datatable['pagination']['records_total'],
-                                       'startIndex'            => 
$datatable['pagination']['records_start'],
-                                       'sort'                          => 
$datatable['sorting']['order'],
-                                       'dir'                           => 
$datatable['sorting']['sort'],
-                                       'records'                       => 
array(),
-                                       'show_sum'                      => 
$this->acl->check('.ticket.order', PHPGW_ACL_READ, 'property'),
-                                       'sum_budget'            => 
$this->bo->sum_budget,
-                                       'sum_actual_cost'       => 
$this->bo->sum_actual_cost
+                                       'recordsReturned'               => 
$datatable['pagination']['records_returned'],
+                                       'totalRecords'                  => 
(int)$datatable['pagination']['records_total'],
+                                       'startIndex'                    => 
$datatable['pagination']['records_start'],
+                                       'sort'                                  
=> $datatable['sorting']['order'],
+                                       'dir'                                   
=> $datatable['sorting']['sort'],
+                                       'records'                               
=> array(),
+                                       'show_sum_estimate'             => 
in_array('estimate', $custom_cols),//$this->acl->check('.ticket.order', 
PHPGW_ACL_READ, 'property'),
+                                       'show_sum_actual_cost'  => 
in_array('actual_cost', $custom_cols),
+                                       'sum_budget'                    => 
$this->bo->sum_budget,
+                                       'sum_actual_cost'               => 
$this->bo->sum_actual_cost
                                );
 
                        // values for datatable

Modified: trunk/property/js/yahoo/tts.index.js
===================================================================
--- trunk/property/js/yahoo/tts.index.js        2012-05-08 09:09:44 UTC (rev 
9309)
+++ trunk/property/js/yahoo/tts.index.js        2012-05-08 09:13:31 UTC (rev 
9310)
@@ -116,7 +116,7 @@
 
        this.myParticularRenderEvent = function()
        {
-               if(values_ds.show_sum)
+               if(values_ds.show_sum_estimate || 
values_ds.show_sum_actual_cost)
                {
                        tableYUI.deleteTFoot();
                        addFooterDatatable();
@@ -128,23 +128,48 @@
                tmp_sum_budget = YAHOO.util.Number.format(values_ds.sum_budget, 
{decimalPlaces:0, decimalSeparator:",", thousandsSeparator:" "});
                tmp_sum_actual_cost = 
YAHOO.util.Number.format(values_ds.sum_actual_cost, {decimalPlaces:2, 
decimalSeparator:",", thousandsSeparator:" "});
 
+               var show_estimate = false;
+               var show_actual_cost = false;
                count_empty = 0;
                for(i=0;i<myColumnDefs.length;i++)
                {
                        if (myColumnDefs[i].key == 'estimate')
                        {
+                               show_estimate = true;
                                count_empty = i;
                                break;
                        }
                }
 
+               count_empty_cost = 0;
+               for(i=0;i<myColumnDefs.length;i++)
+               {
+                       if (myColumnDefs[i].key == 'actual_cost')
+                       {
+                               count_empty_cost = i;
+                               show_actual_cost = true;
+                               break;
+                       }
+               }
+
+               if(!count_empty)
+               {
+                       count_empty = count_empty_cost;
+               }
+
                count_empty_end = myColumnDefs.length - count_empty - 2;
 
                //Create ROW
                newTR = document.createElement('tr');
                td_empty(count_empty);
-               td_sum(tmp_sum_budget);
-               td_sum(tmp_sum_actual_cost);
+               if(show_estimate)
+               {
+                       td_sum(tmp_sum_budget);
+               }
+               if(show_actual_cost)
+               {
+                       td_sum(tmp_sum_actual_cost);
+               }
                td_empty(count_empty_end);
                //Add to Table
                myfoot = tableYUI.createTFoot();




reply via email to

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