fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10586] property: more on condition survey


From: Sigurd Nes
Subject: [Fmsystem-commits] [10586] property: more on condition survey
Date: Tue, 11 Dec 2012 13:43:51 +0000

Revision: 10586
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10586
Author:   sigurdne
Date:     2012-12-11 13:43:51 +0000 (Tue, 11 Dec 2012)
Log Message:
-----------
property: more on condition survey

Modified Paths:
--------------
    trunk/phpgwapi/js/yahoo/common.js
    trunk/phpgwapi/js/yahoo/datatable.js
    trunk/property/inc/class.uicondition_survey.inc.php
    trunk/property/templates/base/condition_survey.xsl

Modified: trunk/phpgwapi/js/yahoo/common.js
===================================================================
--- trunk/phpgwapi/js/yahoo/common.js   2012-12-11 09:48:09 UTC (rev 10585)
+++ trunk/phpgwapi/js/yahoo/common.js   2012-12-11 13:43:51 UTC (rev 10586)
@@ -15,16 +15,14 @@
        return config;
 };
 
-/*
 
-       YAHOO.portico.FormatterAmount0 = function(elCell, oRecord, oColumn, 
oData)
-       {
-alert('hei');
-//             var amount = YAHOO.util.Number.format(oData, {decimalPlaces:0, 
decimalSeparator:",", thousandsSeparator:" "});
-               elCell.innerHTML = "<div align=\"right\">ee"+amount+"</div>";
-       }       
-*/
+YAHOO.portico.FormatterAmount0 = function(elCell, oRecord, oColumn, oData)
+{
+       var amount = YAHOO.util.Number.format(oData, {decimalPlaces:0, 
decimalSeparator:",", thousandsSeparator:" "});
+       elCell.innerHTML = "<div align=\"right\"><pre>"+amount+"</pre></div>";
+}      
 
+
 /** Hook widgets to translations **/
 YAHOO.portico.js_alias_method_chain(YAHOO.widget.Calendar, 'init', 'i18n', 
function(id, container, config) {
        YAHOO.portico.lang('Calendar', config);

Modified: trunk/phpgwapi/js/yahoo/datatable.js
===================================================================
--- trunk/phpgwapi/js/yahoo/datatable.js        2012-12-11 09:48:09 UTC (rev 
10585)
+++ trunk/phpgwapi/js/yahoo/datatable.js        2012-12-11 13:43:51 UTC (rev 
10586)
@@ -86,6 +86,7 @@
                        sortDir: 'ResultSet.sortDir'
         }
     };
+
     var myDataTable = new YAHOO.widget.DataTable("datatable-container", 
         YAHOO.portico.columnDefs, myDataSource, {
             paginator: pag,

Modified: trunk/property/inc/class.uicondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.uicondition_survey.inc.php 2012-12-11 09:48:09 UTC 
(rev 10585)
+++ trunk/property/inc/class.uicondition_survey.inc.php 2012-12-11 13:43:51 UTC 
(rev 10586)
@@ -351,7 +351,7 @@
                        $file_def = array
                        (
                                array('key' => 
'file_name','label'=>lang('Filename'),'sortable'=>false,'resizeable'=>true),
-                               array('key' => 
'delete_file','label'=>lang('Delete 
file'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter'),
+                               array('key' => 
'delete_file','label'=>lang('Delete 
file'),'sortable'=>false,'resizeable'=>true),
                        );
 
 
@@ -360,7 +360,7 @@
                        (
                                'container'             => 
'datatable-container_0',
                                'requestUrl'    => 
json_encode(self::link(array('menuaction' => 
'property.uicondition_survey.get_files', 'id' => 
$id,'phpgw_return_as'=>'json'))),
-                               'ColumnDefs'    => json_encode($file_def),
+                               'ColumnDefs'    => $file_def,
                        
                        );
 
@@ -378,14 +378,14 @@
                        (
                                'container'             => 
'datatable-container_1',
                                'requestUrl'    => 
json_encode(self::link(array('menuaction' => 
'property.uicondition_survey.get_related', 'id' => 
$id,'phpgw_return_as'=>'json'))),
-                               'ColumnDefs'    => json_encode($related_def)
+                               'ColumnDefs'    => $related_def
                        );
 
                        $summation_def = array
                        (
                                array('key' => 
'building_part','label'=>lang('building 
part'),'sortable'=>false,'resizeable'=>true),
                                array('key' => 
'category','label'=>lang('category'),'sortable'=>true,'resizeable'=>true),
-                               array('key' => 'period_1','label'=>lang('year') 
. ':: < 1' 
,'sortable'=>false,'resizeable'=>true,'formatter'=>'YAHOO.portico.formatLink'),
+                               array('key' => 'period_1','label'=>lang('year') 
. ':: < 1' 
,'sortable'=>false,'resizeable'=>true,'formatter'=>'YAHOO.portico.FormatterAmount0'),
                                array('key' => 'period_2','label'=>lang('year') 
. ':: 1 - 5' 
,'sortable'=>false,'resizeable'=>true,'formatter'=>'YAHOO.portico.FormatterAmount0'),
                                array('key' => 'period_3','label'=>lang('year') 
. ':: 6 - 10' 
,'sortable'=>false,'resizeable'=>true,'formatter'=>'YAHOO.portico.FormatterAmount0'),
                                array('key' => 'period_4','label'=>lang('year') 
. ':: 11 - 15' 
,'sortable'=>false,'resizeable'=>true,'formatter'=>'YAHOO.portico.FormatterAmount0'),
@@ -398,7 +398,7 @@
                        (
                                'container'             => 
'datatable-container_2',
                                'requestUrl'    => 
json_encode(self::link(array('menuaction' => 
'property.uicondition_survey.get_summation', 'id' => 
$id,'phpgw_return_as'=>'json'))),
-                               'ColumnDefs'    => json_encode($summation_def)
+                               'ColumnDefs'    => $summation_def
                        );
 
                        $data = array

Modified: trunk/property/templates/base/condition_survey.xsl
===================================================================
--- trunk/property/templates/base/condition_survey.xsl  2012-12-11 09:48:09 UTC 
(rev 10585)
+++ trunk/property/templates/base/condition_survey.xsl  2012-12-11 13:43:51 UTC 
(rev 10586)
@@ -1,5 +1,22 @@
 <!-- $Id$ -->
 
+<func:function name="phpgw:conditional">
+       <xsl:param name="test"/>
+       <xsl:param name="true"/>
+       <xsl:param name="false"/>
+
+       <func:result>
+               <xsl:choose>
+                       <xsl:when test="$test">
+                       <xsl:value-of select="$true"/>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:value-of select="$false"/>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </func:result>
+</func:function>
+
        <!-- add / edit -->
 <xsl:template match="data" xmlns:formvalidator="http://www.w3.org/TR/html4/"; 
xmlns:php="http://php.net/xsl";>
                <xsl:call-template name="yui_phpgw_i18n"/>
@@ -336,10 +353,33 @@
 
 <xsl:template name="datasource-definition">
        <script>
-       YAHOO.util.Event.onDOMReady(function(){
-
-               <xsl:for-each select="datatable_def">
-                       YAHOO.portico.inlineTableHelper("<xsl:value-of 
select="container"/>", <xsl:value-of select="requestUrl"/>, <xsl:value-of 
select="ColumnDefs"/>);
+               var columnDefs = [];
+               YAHOO.util.Event.onDOMReady(function(){
+                       <xsl:for-each select="datatable_def">
+                               columnDefs = [
+                                       <xsl:for-each select="ColumnDefs">
+                                       {
+                                               resizeable: true,
+                                               key: "<xsl:value-of 
select="key"/>",
+                                               <xsl:if test="label">
+                                               label: "<xsl:value-of 
select="label"/>",
+                                               </xsl:if>
+                                               sortable: <xsl:value-of 
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
+                                               <xsl:if test="hidden">
+                                               hidden: true,
+                                               </xsl:if>
+                                               <xsl:if test="formatter">
+                                               formatter: <xsl:value-of 
select="formatter"/>,
+                                               </xsl:if>
+                                               <xsl:if test="editor">
+                                               editor: <xsl:value-of 
select="editor"/>,
+                                           </xsl:if>
+                                               className: "<xsl:value-of 
select="className"/>"
+                                       }<xsl:value-of 
select="phpgw:conditional(not(position() = last()), ',', '')"/>
+                               </xsl:for-each>
+                               ];
+                       
+                       YAHOO.portico.inlineTableHelper("<xsl:value-of 
select="container"/>", <xsl:value-of select="requestUrl"/>, columnDefs);
                </xsl:for-each>
 
        });




reply via email to

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