fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15229] Backport 15222:15228 from Syncromind


From: sigurdne
Subject: [Fmsystem-commits] [15229] Backport 15222:15228 from Syncromind
Date: Tue, 31 May 2016 09:04:38 +0000 (UTC)

Revision: 15229
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15229
Author:   sigurdne
Date:     2016-05-31 09:04:38 +0000 (Tue, 31 May 2016)
Log Message:
-----------
Backport 15222:15228 from Syncromind

Modified Paths:
--------------
    trunk/phpgwapi/js/jquery/common.js
    trunk/phpgwapi/templates/base/datatable_inline.xsl
    trunk/property/inc/class.uientity.inc.php
    trunk/property/js/portico/entity.edit.js
    trunk/property/js/portico/generic_document.edit.js
    trunk/property/templates/base/entity.xsl

Property Changed:
----------------
    trunk/


Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14937-15027,15165-15215
/branches/stavangerkommune:12743-12875,12986
   + /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14937-15027,15165-15215,15223-15228
/branches/stavangerkommune:12743-12875,12986

Modified: trunk/phpgwapi/js/jquery/common.js
===================================================================
--- trunk/phpgwapi/js/jquery/common.js  2016-05-31 01:34:33 UTC (rev 15228)
+++ trunk/phpgwapi/js/jquery/common.js  2016-05-31 09:04:38 UTC (rev 15229)
@@ -380,7 +380,15 @@
                data: data,
                ajax: ajax_def,
                fnServerParams: function (aoData)
-               {
+               {                       
+                       if (eval('paramsTable' + 
container.substr(container.length -1, 1)).length)
+                       {       
+                               $.each(eval('paramsTable' + 
container.substr(container.length -1, 1)), function (k, v)
+                               {
+                                       aoData[v.name] = v.value;
+                               });
+                       }
+
                        if (typeof (aoData.order) != 'undefined')
                        {
                                var column = aoData.order[0].column;

Modified: trunk/phpgwapi/templates/base/datatable_inline.xsl
===================================================================
--- trunk/phpgwapi/templates/base/datatable_inline.xsl  2016-05-31 01:34:33 UTC 
(rev 15228)
+++ trunk/phpgwapi/templates/base/datatable_inline.xsl  2016-05-31 09:04:38 UTC 
(rev 15229)
@@ -22,12 +22,13 @@
        <xsl:param name="tabletools" />
        <xsl:param name="config" />
        <xsl:param name="data" />
+       <xsl:param name="separator" select="'_'" />
        
        <xsl:variable name="num">
-               <xsl:number count="*"/>
+               <xsl:number value="substring-after($container, $separator)"/>
        </xsl:variable>
        
-       <div id='message{($num - 1)}' class='message'/>
+       <div id='message{$num}' class='message'/>
        
        <table id="{$container}" class="display cell-border compact responsive 
no-wrap" width="100%">
                <thead>
@@ -73,11 +74,11 @@
        
        <script>
                
-       var oTable<xsl:number value="($num - 1)"/> = null;
+       var oTable<xsl:number value="$num"/> = null;
                
        <xsl:choose>
                        <xsl:when test="$tabletools">
-                                       JqueryPortico.buttons<xsl:number 
value="($num - 1)"/> =         {
+                                       JqueryPortico.buttons<xsl:number 
value="$num"/> =       {
                                                        buttons: 
                                                                [
                                                                        
<xsl:for-each select="$tabletools">
@@ -86,7 +87,7 @@
                                                                                
                {
                                                                                
                        text: "<xsl:value-of select="php:function('lang', 
'select all')"/>",
                                                                                
                        action: function () {
-                                                                               
                                var api = oTable<xsl:number value="($num - 
1)"/>.api();
+                                                                               
                                var api = oTable<xsl:number 
value="$num"/>.api();
                                                                                
                                api.rows().select();
                                                                                
                                $(".mychecks").each(function()
                                                                                
                                {
@@ -105,7 +106,7 @@
                                                                                
                {
                                                                                
                        text: "<xsl:value-of select="php:function('lang', 
'select none')"/>",
                                                                                
                        action: function () {
-                                                                               
                                var api = oTable<xsl:number value="($num - 
1)"/>.api();
+                                                                               
                                var api = oTable<xsl:number 
value="$num"/>.api();
                                                                                
                                api.rows().deselect();
                                                                                
                                $(".mychecks").each(function()
                                                                                
                                {
@@ -122,7 +123,7 @@
                                                                                
                        sUrl: '<xsl:value-of select="download"/>',
                                                                                
                        action: function (e, dt, node, config) {
                                                                                
                          var sUrl = config.sUrl;
-                                                                               
                          var addtional_filterdata = oTable<xsl:number 
value="($num - 1)"/>.dataTableSettings[0]['ajax']['data'];
+                                                                               
                          var addtional_filterdata = oTable<xsl:number 
value="$num"/>.dataTableSettings[0]['ajax']['data'];
                                                                                
                        <![CDATA[
                                                                                
                                var oParams = {};
                                                                                
                                oParams.length = -1;
@@ -184,7 +185,7 @@
                                                                                
                        </xsl:choose>
                                                                                
                        action: function (e, dt, node, config) {
                                                                                
                                                        var receiptmsg = [];
-                                                                               
                                                        var selected = 
JqueryPortico.fnGetSelected(oTable<xsl:number value="($num - 1)"/>);
+                                                                               
                                                        var selected = 
JqueryPortico.fnGetSelected(oTable<xsl:number value="$num"/>);
                                                                                
                                                        var numSelected =       
selected.length;
 
                                                                                
                                                        if (numSelected ==0){
@@ -214,7 +215,7 @@
                                                                                
                                                        for (; n &lt; 
numSelected; ) {
 
                                                                                
                                //                              
console.log(selected[n]);
-                                                                               
                                                                var aData = 
oTable<xsl:number value="($num - 1)"/>.fnGetData( selected[n] ); //complete 
dataset from json returned from server
+                                                                               
                                                                var aData = 
oTable<xsl:number value="$num"/>.fnGetData( selected[n] ); //complete dataset 
from json returned from server
                                                                                
                                //                              
console.log(aData);
 
                                                                                
                                                                //delete stuff 
comes here
@@ -236,16 +237,16 @@
                                                                                
                                                                {               
                                                                                
                                                                                
action += "&amp;confirm=yes&amp;phpgw_return_as=json";
                                                                                
                                                                                
JqueryPortico.execute_ajax(action, function(result){
-                                                                               
                                                                                
        document.getElementById("message<xsl:number value="($num - 
1)"/>").innerHTML += '<br/>' + result;
-                                                                               
                                                                                
        oTable<xsl:number value="($num - 1)"/>.fnDraw();
+                                                                               
                                                                                
        document.getElementById("message<xsl:number value="$num"/>").innerHTML 
+= '<br/>' + result;
+                                                                               
                                                                                
        oTable<xsl:number value="$num"/>.fnDraw();
                                                                                
                                                                                
});                                                                             
                                                                        
                                                                                
                                                                }
                                                                                
                                                                else if (target 
== 'ajax')
                                                                                
                                                                {
                                                                                
                                                                                
action += "&amp;phpgw_return_as=json";
                                                                                
                                                                                
JqueryPortico.execute_ajax(action, function(result){
-                                                                               
                                                                                
        document.getElementById("message<xsl:number value="($num - 
1)"/>").innerHTML += '<br/>' + result;
-                                                                               
                                                                                
        oTable<xsl:number value="($num - 1)"/>.fnDraw();
+                                                                               
                                                                                
        document.getElementById("message<xsl:number value="$num"/>").innerHTML 
+= '<br/>' + result;
+                                                                               
                                                                                
        oTable<xsl:number value="$num"/>.fnDraw();
                                                                                
                                                                                
});                                                                             
                                                                                
                                                                                
                                                                }
                                                                                
                                                                else
@@ -331,46 +332,46 @@
                        </xsl:for-each>
                ];
 
-               var columns<xsl:number value="($num - 1)"/> = [];
+               var columns<xsl:number value="$num"/> = [];
 <![CDATA[
                for(i=0;i < PreColumns.length;i++)
                {
                        if ( PreColumns[i]['visible'] == true )
                        {
 ]]>
-                               columns<xsl:number value="($num - 
1)"/>.push(PreColumns[i]);
+                               columns<xsl:number 
value="$num"/>.push(PreColumns[i]);
 <![CDATA[
                        }
                }
 ]]>
 
-               var options<xsl:number value="($num - 1)"/> = {};
+               var options<xsl:number value="$num"/> = {};
                <xsl:for-each select="$config">
                        <xsl:if test="allrows">
-                               options<xsl:number value="($num - 1)"/>.allrows 
= true;
+                               options<xsl:number value="$num"/>.allrows = 
true;
                        </xsl:if>
                        <xsl:if test="singleSelect">
-                               options<xsl:number value="($num - 
1)"/>.singleSelect = true;
+                               options<xsl:number value="$num"/>.singleSelect 
= true;
                        </xsl:if>
                        <xsl:if test="disableFilter">
-                               options<xsl:number value="($num - 
1)"/>.disableFilter = true;
+                               options<xsl:number value="$num"/>.disableFilter 
= true;
                        </xsl:if>
                        <xsl:if test="disablePagination">
-                               options<xsl:number value="($num - 
1)"/>.disablePagination = true;
+                               options<xsl:number 
value="$num"/>.disablePagination = true;
                        </xsl:if>
                        <xsl:if test="order">
-                               options<xsl:number value="($num - 1)"/>.order = 
<xsl:value-of select="order" />;
+                               options<xsl:number value="$num"/>.order = 
<xsl:value-of select="order" />;
                        </xsl:if>
                        <xsl:if test="responsive">
-                               options<xsl:number value="($num - 
1)"/>.responsive = true;
+                               options<xsl:number value="$num"/>.responsive = 
true;
                        </xsl:if>
                        <xsl:if test="editor_action">
-                               options<xsl:number value="($num - 
1)"/>.editor_action = "<xsl:value-of select="editor_action" />";
+                               options<xsl:number value="$num"/>.editor_action 
= "<xsl:value-of select="editor_action" />";
                        </xsl:if>
                </xsl:for-each>
-               if (JqueryPortico.buttons<xsl:number value="($num - 1)"/>)
+               if (JqueryPortico.buttons<xsl:number value="$num"/>)
                {
-                       options<xsl:number value="($num - 1)"/>.TableTools = 
JqueryPortico.buttons<xsl:number value="($num - 1)"/>;
+                       options<xsl:number value="$num"/>.TableTools = 
JqueryPortico.buttons<xsl:number value="$num"/>;
                }
 
                <xsl:variable name="dataset">
@@ -384,7 +385,8 @@
                        </xsl:choose>
                </xsl:variable>
 //             $(document).ready(function() {
-               oTable<xsl:number value="($num - 1)"/> = 
JqueryPortico.inlineTableHelper("<xsl:value-of select="$container"/>", 
<xsl:value-of select="$requestUrl"/>, columns<xsl:number value="($num - 1)"/>, 
options<xsl:number value="($num - 1)"/> , <xsl:value-of select="$dataset"/>);
+               var paramsTable<xsl:number value="$num"/> = [];
+               oTable<xsl:number value="$num"/> = 
JqueryPortico.inlineTableHelper("<xsl:value-of select="$container"/>", 
<xsl:value-of select="$requestUrl"/>, columns<xsl:number value="$num"/>, 
options<xsl:number value="$num"/> , <xsl:value-of select="$dataset"/>);
 //     });
        </script>
 </xsl:template>
\ No newline at end of file

Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php   2016-05-31 01:34:33 UTC (rev 
15228)
+++ trunk/property/inc/class.uientity.inc.php   2016-05-31 09:04:38 UTC (rev 
15229)
@@ -2021,6 +2021,55 @@
 
                        if ($id)
                        {
+                               $location_id = 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
$this->acl_location);
+                               
+                               $get_docs = false;
+                               $check_doc = 
$this->bocommon->get_lookup_entity('document');
+                               foreach ($check_doc as $_check)
+                               {
+                                       if ($_check['id'] == $this->entity_id)
+                                       {
+                                               $get_docs = true;
+                                               break;
+                                       }
+                               }
+
+                               if ($get_docs)
+                               {                                       
+                                       $tabs['document'] = array('label' => 
lang('document'), 'link' => '#document', 'disable' => 0);
+                                       
+                                       $cats = 
CreateObject('phpgwapi.categories', -1, 'property', '.document');
+                                       $cats->supress_info = true;
+                                       $categories = 
$cats->formatted_xslt_list(array('format' => 'filter', 'selected' => '',
+                                               'globals' => true, 'use_acl' => 
true));
+                                       $default_value = array('cat_id' => '', 
'name' => lang('no document type'), 'selected' => 'selected');
+                                       array_unshift($categories['cat_list'], 
$default_value);
+
+                                       foreach ($categories['cat_list'] as & 
$_category)
+                                       {
+                                               $_category['id'] = 
$_category['cat_id'];
+                                       }
+                                       $doc_type_filter = 
$categories['cat_list'];
+                               
+                                       $documents_def = array
+                                               (
+                                               array('key' => 'document_name', 
'label' => lang('name'), 'sortable' => false, 'resizeable' => true),
+                                               array('key' => 'title', 'label' 
=> lang('title'), 'sortable' => false, 'resizeable' => true)
+                                       );
+
+                                       $datatable_def[] = array
+                                               (
+                                               'container' => 
'datatable-container_7',
+                                               'requestUrl' => 
json_encode(self::link(array('menuaction' => 'property.uientity.get_documents', 
+                                                       'location_id' => 
$location_id, 'entity_id' => $this->entity_id, 'cat_id' => $this->cat_id, 'num' 
=> $values['num'], 'phpgw_return_as' => 'json'))),
+                                               'data' => "",
+                                               'ColumnDefs' => $documents_def,
+                                               'config' => array(
+                                                       array('disableFilter' 
=> true)
+                                               )
+                                       );
+                               }
+                               
                                if (!$category['enable_bulk'])
                                {
                                        $tabs['related'] = array('label' => 
lang('log'), 'link' => '#related', 'disable' => 0);
@@ -2072,8 +2121,8 @@
                                        )
                                );
 
-                               //if ($category['enable_bulk'])
-                               //{
+                               if ($category['enable_bulk'])
+                               {
                                        $tabs['inventory'] = array('label' => 
lang('inventory'), 'link' => '#inventory',
                                                'disable' => 0);
 
@@ -2110,8 +2159,8 @@
                                                        
array('disablePagination' => true)
                                                )
                                        );
-                               //}
-                               $location_id = 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
$this->acl_location);
+                               }
+                               
                                if ($_enable_controller)
                                {
                                        $_controls = 
$this->get_controls_at_component($location_id, $id);
@@ -2245,53 +2294,6 @@
                                        );
                                }
                                
-                               $get_docs = false;
-                               $check_doc = 
$this->bocommon->get_lookup_entity('document');
-                               foreach ($check_doc as $_check)
-                               {
-                                       if ($_check['id'] == $this->entity_id)
-                                       {
-                                               $get_docs = true;
-                                               break;
-                                       }
-                               }
-
-                               //if ($get_docs)
-                               //{                                     
-                                       $tabs['document'] = array('label' => 
lang('document'), 'link' => '#document', 'disable' => 0);
-                                       
-                                       $cats = 
CreateObject('phpgwapi.categories', -1, 'property', '.document');
-                                       $cats->supress_info = true;
-                                       $categories = 
$cats->formatted_xslt_list(array('format' => 'filter', 'selected' => '',
-                                               'globals' => true, 'use_acl' => 
true));
-                                       $default_value = array('cat_id' => '', 
'name' => lang('no document type'), 'selected' => 'selected');
-                                       array_unshift($categories['cat_list'], 
$default_value);
-
-                                       foreach ($categories['cat_list'] as & 
$_category)
-                                       {
-                                               $_category['id'] = 
$_category['cat_id'];
-                                       }
-                                       $doc_type_filter = 
$categories['cat_list'];
-                               
-                                       $documents_def = array
-                                               (
-                                               array('key' => 'document_name', 
'label' => lang('name'), 'sortable' => false, 'resizeable' => true),
-                                               array('key' => 'title', 'label' 
=> lang('title'), 'sortable' => false, 'resizeable' => true)
-                                       );
-
-                                       $datatable_def[] = array
-                                               (
-                                               'container' => 
'datatable-container_7',
-                                               'requestUrl' => 
json_encode(self::link(array('menuaction' => 'property.uientity.get_documents', 
-                                                       'location_id' => 
$location_id, 'entity_id' => $this->entity_id, 'cat_id' => $this->cat_id, 'num' 
=> $values['num'], 'phpgw_return_as' => 'json'))),
-                                               'data' => "",
-                                               'ColumnDefs' => $documents_def,
-                                               'config' => array(
-                                                       array('disableFilter' 
=> true)
-                                               )
-                                       );
-                               //}
-                               
                        }
 
                        //$category['org_unit'] =1;

Modified: trunk/property/js/portico/entity.edit.js
===================================================================
--- trunk/property/js/portico/entity.edit.js    2016-05-31 01:34:33 UTC (rev 
15228)
+++ trunk/property/js/portico/entity.edit.js    2016-05-31 09:04:38 UTC (rev 
15229)
@@ -220,19 +220,23 @@
 
 var documents = null;
 var requestUrlDoc = null;
-
+       
 $(document).ready(function ()
 {
        $('#doc_type').change( function()
        {
-               var oTable = $("#datatable-container_7").dataTable();
+               //oTable7.dataTableSettings[6]['ajax']['data']['doc_type'] = 
$(this).val();
+               paramsTable7.push( { "name": 'doc_type', "value": $(this).val() 
} );
+               oTable7.fnDraw();                               
+
+               /*var oTable = $("#datatable-container_7").dataTable();
                var api = oTable.api();
                var requestUrl = api.ajax.url();
                Url = JqueryPortico.parseURL(requestUrl);
                oArgs = Url.searchObject;
                oArgs.doc_type = $(this).val();
                requestUrl = phpGWLink('index.php', oArgs, true);
-               api.ajax.url(requestUrl).load();
+               api.ajax.url(requestUrl).load();*/
        });
 
        $("#workorder_cancel").on("submit", function (e)

Modified: trunk/property/js/portico/generic_document.edit.js
===================================================================
--- trunk/property/js/portico/generic_document.edit.js  2016-05-31 01:34:33 UTC 
(rev 15228)
+++ trunk/property/js/portico/generic_document.edit.js  2016-05-31 09:04:38 UTC 
(rev 15229)
@@ -77,7 +77,8 @@
 function filterData(objParams)
 {
        $.each(objParams, function(key, value) {
-               oTable1.dataTableSettings[1]['ajax']['data'][key] = value;
+               //oTable1.dataTableSettings[1]['ajax']['data'][key] = value;
+               paramsTable1.push( { "name": key, "value": value } );
        });
        
        oTable1.fnDraw();

Modified: trunk/property/templates/base/entity.xsl
===================================================================
--- trunk/property/templates/base/entity.xsl    2016-05-31 01:34:33 UTC (rev 
15228)
+++ trunk/property/templates/base/entity.xsl    2016-05-31 09:04:38 UTC (rev 
15229)
@@ -802,7 +802,8 @@
                                        </xsl:when>
                                </xsl:choose>
 
-
+                               <xsl:choose>
+                                       <xsl:when test="enable_bulk = 1">
                                                <div id="inventory">
                                                        <fieldset>
                                                                <div 
class="pure-control-group">
@@ -831,8 +832,8 @@
                                                                </xsl:choose>
                                                        </fieldset>
                                                </div>
-               
-
+                                       </xsl:when>
+                               </xsl:choose>
                        </div>
                        <xsl:choose>
                                <xsl:when test="mode = 'edit'">




reply via email to

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