fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [12571] fix multifileupload and refresh table after u


From: Sigurd Nes
Subject: [Fmsystem-commits] [12571] fix multifileupload and refresh table after upload for tts, entity and condition_survey
Date: Fri, 09 Jan 2015 10:35:56 +0000

Revision: 12571
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12571
Author:   sigurdne
Date:     2015-01-09 10:35:55 +0000 (Fri, 09 Jan 2015)
Log Message:
-----------
fix multifileupload and refresh table after upload for tts, entity and 
condition_survey

Modified Paths:
--------------
    branches/dev-syncromind/property/inc/class.uicondition_survey.inc.php
    branches/dev-syncromind/property/inc/class.uitts.inc.php
    branches/dev-syncromind/property/js/portico/condition_survey_edit.js
    branches/dev-syncromind/property/js/portico/entity.edit.js
    branches/dev-syncromind/property/js/portico/tts.view.js
    branches/dev-syncromind/property/templates/base/condition_survey.xsl

Modified: branches/dev-syncromind/property/inc/class.uicondition_survey.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uicondition_survey.inc.php       
2015-01-08 23:10:06 UTC (rev 12570)
+++ branches/dev-syncromind/property/inc/class.uicondition_survey.inc.php       
2015-01-09 10:35:55 UTC (rev 12571)
@@ -447,7 +447,10 @@
                                'container'             => 
'datatable-container_0',
                                'requestUrl'    => 
json_encode(self::link(array('menuaction' => 
'property.uicondition_survey.get_files', 'id' => 
$id,'phpgw_return_as'=>'json'))),
                                'ColumnDefs'    => $file_def,
-
+                               'config'                => array(
+                                       array('disableFilter'   => true),
+                                       array('disablePagination'       => true)
+                               )
                        );
 
                        $related_def = array
@@ -491,7 +494,11 @@
                        (
                                'container'             => 
'datatable-container_2',
                                'requestUrl'    => 
json_encode(self::link(array('menuaction' => 
'property.uicondition_survey.get_summation', 'id' => 
$id,'phpgw_return_as'=>'json'))),
-                               'ColumnDefs'    => $summation_def
+                               'ColumnDefs'    => $summation_def,
+                               'config'                => array(
+                                       array('disableFilter'   => true),
+                                       array('disablePagination'       => true)
+                               )
                        );
 
                        $this->config                           = 
CreateObject('phpgwapi.config','property');
@@ -531,9 +538,7 @@
                        self::add_javascript('phpgwapi', 'tinybox2', 
'packed.js');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/tinybox2/style.css');
 
-//                     $GLOBALS['phpgw_info']['server']['no_jscombine'] = true;
-
-                       self::render_template_xsl(array('condition_survey'), 
$data);
+                       
self::render_template_xsl(array('condition_survey','datatable_inline'), $data);
                }
 
 

Modified: branches/dev-syncromind/property/inc/class.uitts.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uitts.inc.php    2015-01-08 
23:10:06 UTC (rev 12570)
+++ branches/dev-syncromind/property/inc/class.uitts.inc.php    2015-01-09 
10:35:55 UTC (rev 12571)
@@ -1396,14 +1396,16 @@
                        if( phpgw::get_var('phpgw_return_as') == 'json' )
                        {
 
-                               if(count($content_files))
-                               {
-                                       return json_encode($content_files);
-                               }
-                               else
-                               {
-                                       return "";
-                               }
+                               $total_records = count($content_files);
+
+                               return  array
+                               (
+                                       'data'                          => 
$content_files,
+                                       'draw'                          => 
phpgw::get_var('draw', 'int'),
+                                       'recordsTotal'          => 
$total_records,
+                                       'recordsFiltered'       => 
$total_records
+                               );
+
                        }
                        return $content_files;
                }

Modified: branches/dev-syncromind/property/js/portico/condition_survey_edit.js
===================================================================
--- branches/dev-syncromind/property/js/portico/condition_survey_edit.js        
2015-01-08 23:10:06 UTC (rev 12570)
+++ branches/dev-syncromind/property/js/portico/condition_survey_edit.js        
2015-01-09 10:35:55 UTC (rev 12571)
@@ -18,7 +18,7 @@
        {
                var oArgs = 
{menuaction:'property.uicondition_survey.get_files', id:survey_id};
                var strURL = phpGWLink('index.php', oArgs, true);
-               YAHOO.portico.updateinlineTableHelper('datatable-container_0', 
strURL);
+               JqueryPortico.updateinlineTableHelper(oTable0, strURL);
        }
        
        function lightbox_hide()

Modified: branches/dev-syncromind/property/js/portico/entity.edit.js
===================================================================
--- branches/dev-syncromind/property/js/portico/entity.edit.js  2015-01-08 
23:10:06 UTC (rev 12570)
+++ branches/dev-syncromind/property/js/portico/entity.edit.js  2015-01-09 
10:35:55 UTC (rev 12571)
@@ -2,22 +2,12 @@
        this.fileuploader = function()
        {
                var sUrl = phpGWLink('index.php', fileuploader_action);
-               var onDialogShow = function(e, args, o)
-               {
-                       var frame = document.createElement('iframe');
-                       frame.src = sUrl;
-                       frame.width = "100%";
-                       frame.height = "400";
-                       o.setBody(frame);
-               };
-               lightbox.showEvent.subscribe(onDialogShow, lightbox);
-               lightbox.show();
-       }
+               TINY.box.show({iframe:sUrl, 
boxid:"frameless",width:750,height:450,fixed:false,maskid:"darkmask",maskopacity:40,
 mask:true, animate:true, close: true}); //refresh_files is called after upload
+       };
 
        this.refresh_files = function()
        {
-               base_java_url['action'] = 'get_files';
-               execute_async(myDataTable_0);
+               oTable0.fnDraw();
        }
 
        this.showlightbox_add_inventory = function(location_id, id)

Modified: branches/dev-syncromind/property/js/portico/tts.view.js
===================================================================
--- branches/dev-syncromind/property/js/portico/tts.view.js     2015-01-08 
23:10:06 UTC (rev 12570)
+++ branches/dev-syncromind/property/js/portico/tts.view.js     2015-01-09 
10:35:55 UTC (rev 12571)
@@ -149,13 +149,15 @@
        this.fileuploader = function()
        {
                var sUrl = phpGWLink('index.php', fileuploader_action);
-               TINY.box.show({iframe:sUrl, 
boxid:"frameless",width:750,height:450,fixed:false,maskid:"darkmask",maskopacity:40,
 mask:true, animate:true, close: true,closejs:function(){location.reload();}});
+               TINY.box.show({iframe:sUrl, 
boxid:"frameless",width:750,height:450,fixed:false,maskid:"darkmask",maskopacity:40,
 mask:true, animate:true, close: true}); //refresh_files is called after upload
        };
 
        this.refresh_files = function()
        {
                base_java_url['action'] = 'get_files';
-               execute_async(myDataTable_2);
+               var oArgs = base_java_url;
+               var strURL = phpGWLink('index.php', oArgs, true);
+               JqueryPortico.updateinlineTableHelper(oTable2, strURL);
        };
 
        window.addEventListener("load", function()

Modified: branches/dev-syncromind/property/templates/base/condition_survey.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/condition_survey.xsl        
2015-01-08 23:10:06 UTC (rev 12570)
+++ branches/dev-syncromind/property/templates/base/condition_survey.xsl        
2015-01-09 10:35:55 UTC (rev 12571)
@@ -1,22 +1,5 @@
 <!-- $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:php="http://php.net/xsl";>
     <xsl:call-template name="jquery_phpgw_i18n"/>
@@ -256,6 +239,8 @@
                                                                                
  <xsl:with-param name="container" select ='container'/>
                                                                                
  <xsl:with-param name="requestUrl" select ='requestUrl' />
                                                                                
  <xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
+                                                                               
        <xsl:with-param name="tabletools" select ='tabletools' />
+                                                                               
        <xsl:with-param name="config" select ='config' />
                                                                                
</xsl:call-template>
                                                                        
</xsl:if>
                                                        </xsl:for-each>
@@ -305,6 +290,8 @@
                                                                                
  <xsl:with-param name="container" select ='container'/>
                                                                                
  <xsl:with-param name="requestUrl" select ='requestUrl' />
                                                                                
  <xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
+                                                                               
        <xsl:with-param name="tabletools" select ='tabletools' />
+                                                                               
        <xsl:with-param name="config" select ='config' />
                                                                                
</xsl:call-template>
                                                                        
</xsl:if>
                                                        </xsl:for-each>
@@ -327,6 +314,8 @@
                                                                                
  <xsl:with-param name="container" select ='container'/>
                                                                                
  <xsl:with-param name="requestUrl" select ='requestUrl' />
                                                                                
  <xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
+                                                                               
        <xsl:with-param name="tabletools" select ='tabletools' />
+                                                                               
        <xsl:with-param name="config" select ='config' />
                                                                                
</xsl:call-template>
                                                                        
</xsl:if>
                                                        </xsl:for-each>
@@ -505,84 +494,3 @@
     </xsl:choose>
 </xsl:template>
 
-<xsl:template name="table_setup">
-       <xsl:param name="container" />
-       <xsl:param name="requestUrl" />
-       <xsl:param name="ColumnDefs" />
-       <table id="{$container}" class="display cell-border compact responsive 
no-wrap" width="100%">
-               <thead>
-                       <tr>
-                               <xsl:for-each select="$ColumnDefs">
-                                       <xsl:choose>
-                                               <xsl:when test="hidden">
-                                                       <xsl:if test="hidden 
=0">
-                                                               <th>
-                                                                       
<xsl:value-of select="label"/>
-                                                               </th>
-                                                               </xsl:if>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <th>
-                                                               <xsl:value-of 
select="label"/>
-                                                       </th>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </xsl:for-each>
-                       </tr>
-               </thead>
-       </table>
-       <script>
-               JqueryPortico.inlineTablesDefined += 1;
-               var PreColumns = [
-                               <xsl:for-each select="$ColumnDefs">
-                               {
-                                       data:                   "<xsl:value-of 
select="key"/>",
-                                       class:                  "<xsl:value-of 
select="className"/>",
-                                       orderable:              <xsl:value-of 
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
-                                       <xsl:choose>
-                                               <xsl:when test="hidden">
-                                                       <xsl:if test="hidden 
=0">
-                                                               visible         
        :true,
-                                                       </xsl:if>
-                                                       <xsl:if test="hidden 
=1">
-                                                               class:          
        'none',
-                                                               visible         
        :false,
-                                                       </xsl:if>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                               visible         
        :true,
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       <xsl:if test="formatter">
-                                        render: function (dummy1, dummy2, 
oData) {
-                                                       try {
-                                                               var ret = 
<xsl:value-of select="formatter"/>("<xsl:value-of select="key"/>", oData);
-                                                       }
-                                                       catch(err) {
-                                                               return 
err.message;
-                                                       }
-                                                       return ret;
-                         },
-
-                                       </xsl:if>
-                                       defaultContent: "<xsl:value-of 
select="defaultContent"/>"
-                               }<xsl:value-of 
select="phpgw:conditional(not(position() = last()), ',', '')"/>
-                       </xsl:for-each>
-               ];
-<![CDATA[
-               columns = [];
-
-               for(i=0;i < PreColumns.length;i++)
-               {
-                       if ( PreColumns[i]['visible'] == true )
-                       {
-                               columns.push(PreColumns[i]);
-                       }
-               }
-]]>
-
-               JqueryPortico.inlineTableHelper("<xsl:value-of 
select="$container"/>", <xsl:value-of select="$requestUrl"/>, columns);
-
-       </script>
-</xsl:template>
-




reply via email to

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