fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15272] property: paging


From: sigurdne
Subject: [Fmsystem-commits] [15272] property: paging
Date: Fri, 10 Jun 2016 08:45:37 +0000 (UTC)

Revision: 15272
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15272
Author:   sigurdne
Date:     2016-06-10 08:45:36 +0000 (Fri, 10 Jun 2016)
Log Message:
-----------
property: paging

Modified Paths:
--------------
    trunk/phpgwapi/js/jquery/common.js
    trunk/phpgwapi/templates/base/datatable_inline.xsl
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/inc/class.uiworkorder.inc.php

Modified: trunk/phpgwapi/js/jquery/common.js
===================================================================
--- trunk/phpgwapi/js/jquery/common.js  2016-06-09 10:23:04 UTC (rev 15271)
+++ trunk/phpgwapi/js/jquery/common.js  2016-06-10 08:45:36 UTC (rev 15272)
@@ -261,7 +261,6 @@
 
 JqueryPortico.inlineTableHelper = function (container, ajax_url, columns, 
options, data)
 {
-
        options = options || {};
        var disablePagination = options['disablePagination'] || false;
        var disableFilter = options['disableFilter'] || false;
@@ -274,6 +273,7 @@
        var editor_action = options['editor_action'] || false;
        var editor_cols = [];
        var allrows = options['allrows'] || false;
+       var pageLength = options['rows_per_page'] || 10;
 
        for (i = 0; i < columns.length; i++)
        {
@@ -288,16 +288,29 @@
        }
 
        var lengthMenu = null;
-       try
+
+       if(pageLength != 10)
        {
-               lengthMenu = JqueryPortico.i18n.lengthmenu();
+               lengthMenu = [[],[]];
+               for (var i = 1; i < 5; i++)
+               {
+                       lengthMenu[0].push( pageLength*i );
+                       lengthMenu[1].push( pageLength*i );
+               }
        }
-       catch (err)
+       else
        {
-               lengthMenu = [[10, 25, 50, 100],[10, 25, 50, 100]];
+               try
+               {
+                       lengthMenu = JqueryPortico.i18n.lengthmenu();
+               }
+               catch (err)
+               {
+                       lengthMenu = [[10, 25, 50, 100],[10, 25, 50, 100]];
+               }
        }
 
-       if (allrows == true)
+       if (allrows == true && data.length == 0)
        {
                lengthmenu_allrows = [];
 
@@ -318,6 +331,14 @@
                }
        }
 
+       if (data.length > 5)
+       {
+               lengthMenu[0].push(data.length);
+               lengthMenu[1].push(data.length);
+       }
+
+
+
        var language = null;
        try
        {
@@ -423,6 +444,7 @@
                         }*/
                },
                lengthMenu: lengthMenu,
+               pageLength: pageLength,
                language: language,
                columns: columns,
                //      stateSave:              true,

Modified: trunk/phpgwapi/templates/base/datatable_inline.xsl
===================================================================
--- trunk/phpgwapi/templates/base/datatable_inline.xsl  2016-06-09 10:23:04 UTC 
(rev 15271)
+++ trunk/phpgwapi/templates/base/datatable_inline.xsl  2016-06-10 08:45:36 UTC 
(rev 15272)
@@ -368,6 +368,9 @@
                        <xsl:if test="editor_action">
                                options<xsl:number value="$num"/>.editor_action 
= "<xsl:value-of select="editor_action" />";
                        </xsl:if>
+                       <xsl:if test="rows_per_page">
+                               options<xsl:number value="$num"/>.rows_per_page 
= "<xsl:value-of select="rows_per_page" />";
+                       </xsl:if>
                </xsl:for-each>
                if (JqueryPortico.buttons<xsl:number value="$num"/>)
                {

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2016-06-09 10:23:04 UTC (rev 
15271)
+++ trunk/property/inc/class.uiproject.inc.php  2016-06-10 08:45:36 UTC (rev 
15272)
@@ -1702,7 +1702,8 @@
                                'ColumnDefs' => $budget_def,
                                'config' => array(
                                        array('disableFilter' => true),
-                                       array('disablePagination' => true),
+                                       array('rows_per_page' => 
$rows_per_page),
+//                                     array('disablePagination' => true),
                                        array('initial_page' => $initial_page)
                                )
                        );

Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php        2016-06-09 10:23:04 UTC 
(rev 15271)
+++ trunk/property/inc/class.uiworkorder.inc.php        2016-06-10 08:45:36 UTC 
(rev 15272)
@@ -2090,10 +2090,9 @@
                                'data' => json_encode($content_budget),
                                'ColumnDefs' => $budget_def,
                                'config' => array(
-                                       array(
-                                               'disableFilter' => true),
-                                       array(
-                                               'disablePagination' => true)
+                                       array('disableFilter' => true),
+//                                     array('disablePagination' => true),
+                                       array('rows_per_page' => 
$rows_per_page),
                                )
                        );
 




reply via email to

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