partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 4fd7bdfee4723b3b346361f243a3be2e348b87d1
parent 2dbbc10b765d41ac0348858805a66e0cb2380e31
Author: Timo A. Hummel <timo@netraver.de>
Date:   Sat,  4 Jun 2011 09:19:12 +0200

Fixed sorting for storage locations and footprint

Diffstat:
Msrc/de/RaumZeitLabor/PartDB2/Part/PartManager.php | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/de/RaumZeitLabor/PartDB2/Part/PartManager.php b/src/de/RaumZeitLabor/PartDB2/Part/PartManager.php @@ -33,7 +33,18 @@ class PartManager extends Singleton { $qb->setParameter("filter", "%".$filter."%"); } - $qb->orderBy("p.".$sort, $dir); + switch ($sort) { + case "storageLocationName": + $orderBy = "st.name"; + break; + case "footprintName": + $orderBy = "f.footprint"; + break; + default; + $orderBy = "p.".$sort; + break; + } + $qb->orderBy($orderBy, $dir); $category = intval($category);