[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12919] fix conditional sorting
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [12919] fix conditional sorting |
Date: |
Sat, 28 Mar 2015 12:35:35 +0000 |
Revision: 12919
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12919
Author: sigurdne
Date: 2015-03-28 12:35:34 +0000 (Sat, 28 Mar 2015)
Log Message:
-----------
fix conditional sorting
Modified Paths:
--------------
branches/dev-syncromind/property/inc/class.sogab.inc.php
branches/dev-syncromind/property/inc/class.uigab.inc.php
Modified: branches/dev-syncromind/property/inc/class.sogab.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.sogab.inc.php 2015-03-27
22:54:54 UTC (rev 12918)
+++ branches/dev-syncromind/property/inc/class.sogab.inc.php 2015-03-28
12:35:34 UTC (rev 12919)
@@ -71,14 +71,29 @@
$check_payments =
isset($data['check_payments']) ? $data['check_payments'] : '';
}
- if ($order)
+ switch ($order)
{
- $ordermethod = " order by
fm_gab_location.{$order} {$sort}";
+ case 'gaards_nr':
+ $ordermethod = " ORDER BY
SUBSTRING(gab_id,5,5) {$sort}";
+ break;
+ case 'bruksnr':
+ $ordermethod = " ORDER BY
SUBSTRING(gab_id,10,4) {$sort}";
+ break;
+ case 'feste_nr':
+ $ordermethod = " ORDER BY
SUBSTRING(gab_id,14,4) {$sort}";
+ break;
+ case 'seksjons_nr':
+ $ordermethod = " ORDER BY
SUBSTRING(gab_id,18,3) {$sort}";
+ break;
+ case 'location_code':
+ $ordermethod = " ORDER BY
fm_gab_location.location_code {$sort}";
+ break;
+ case 'address':
+ $ordermethod = " ORDER BY
fm_gab_location.address {$sort}";
+ break;
+ default:
+ $ordermethod = ' ORDER BY gab_id ASC';
}
- else
- {
- $ordermethod = ' order by gab_id ASC';
- }
$where = 'WHERE';
$filtermethod = '';
Modified: branches/dev-syncromind/property/inc/class.uigab.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uigab.inc.php 2015-03-27
22:54:54 UTC (rev 12918)
+++ branches/dev-syncromind/property/inc/class.uigab.inc.php 2015-03-28
12:35:34 UTC (rev 12919)
@@ -237,7 +237,7 @@
'input_type' =>
array('hidden','text','text','text','text','hidden','text','text','text','link','link'),
'name' =>
array('gab_id','gaards_nr','bruksnr','feste_nr','seksjons_nr','hits','owner','location_code','address','map','gab'),
'formatter' =>
array('','','','','','','','','','linktToMap','linktToGab'),
- 'sortable' =>
array('','true','','','','','','true','','',''),
+ 'sortable' =>
array('',true,true,true,true,'','',true,true,'',''),
'descr' =>
array('dummy',lang('Gaards nr'),lang('Bruks nr'),lang('Feste
nr'),lang('Seksjons
nr'),lang('hits'),lang('Owner'),lang('Location'),lang('Address'),lang('Map'),lang('Gab')),
'className' =>
array('','','','','','','','center','','center','center')
);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12919] fix conditional sorting,
Sigurd Nes <=