[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [14050] rental composite: fix order by status
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [14050] rental composite: fix order by status |
Date: |
Tue, 29 Sep 2015 12:01:37 +0000 |
Revision: 14050
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14050
Author: sigurdne
Date: 2015-09-29 12:01:36 +0000 (Tue, 29 Sep 2015)
Log Message:
-----------
rental composite: fix order by status
Modified Paths:
--------------
branches/dev-syncromind/rental/inc/class.socommon.inc.php
branches/dev-syncromind/rental/inc/class.socomposite.inc.php
Modified: branches/dev-syncromind/rental/inc/class.socommon.inc.php
===================================================================
--- branches/dev-syncromind/rental/inc/class.socommon.inc.php 2015-09-29
01:11:39 UTC (rev 14049)
+++ branches/dev-syncromind/rental/inc/class.socommon.inc.php 2015-09-29
12:01:36 UTC (rev 14050)
@@ -6,14 +6,17 @@
protected $join;
protected $left_join;
protected $sort_field;
-
+ protected $skip_limit_query;
+
+
public function __construct()
{
- $this->db = clone $GLOBALS['phpgw']->db;
- $this->like = & $this->db->like;
- $this->join = & $this->db->join;
- $this->left_join = & $this->db->left_join;
- $this->sort_field = null;
+ $this->db = clone
$GLOBALS['phpgw']->db;
+ $this->like = & $this->db->like;
+ $this->join = & $this->db->join;
+ $this->left_join = & $this->db->left_join;
+ $this->sort_field = null;
+ $this->skip_limit_query = null;
}
/**
@@ -220,7 +223,7 @@
* Sigurd: try to limit the candidates to a minimum
*/
$bypass_offset_check = false;
- if($num_of_objects && is_array($id_field_name_info) &&
$id_field_name_info['translated'])
+ if(!$this->skip_limit_query && $num_of_objects &&
is_array($id_field_name_info) && $id_field_name_info['translated'])
{
$bypass_offset_check = true;
$sql_parts_filter = explode('FROM',$sql, 2);
Modified: branches/dev-syncromind/rental/inc/class.socomposite.inc.php
===================================================================
--- branches/dev-syncromind/rental/inc/class.socomposite.inc.php
2015-09-29 01:11:39 UTC (rev 14049)
+++ branches/dev-syncromind/rental/inc/class.socomposite.inc.php
2015-09-29 12:01:36 UTC (rev 14050)
@@ -200,8 +200,19 @@
}
$dir = $ascending ? 'ASC' : 'DESC';
$order = $sort_field ? "ORDER BY {$this->marshal($sort_field,
'field')} $dir ": '';
+ $this->sort_field = $sort_field;
-// _debug_array("SELECT {$cols} FROM {$tables} {$joins} WHERE
{$condition} {$order}");
+ switch($sort_field)
+ {
+ case 'status':
+ $this->skip_limit_query = true;
+ break;
+
+ default:
+ break;
+ }
+
+// _debug_array("SELECT {$cols} FROM {$tables} {$joins} WHERE
{$condition} {$order}");
return "SELECT {$cols} FROM {$tables} {$joins} WHERE
{$condition} {$order}";
}
@@ -482,4 +493,3 @@
return $uicols;
}
}
-?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [14050] rental composite: fix order by status,
Sigurd Nes <=