[-] BO : Fix carrier association listing on warehouse form

This commit is contained in:
rGaillard committed 2012-11-06 15:23:57 +00:00
1 parent 3d6d183ee7
commit 3918fe70b9
2 files changed
+5 -2

No files matched your search

+4 -1
View File
@@ -132,11 +132,14 @@ class WarehouseCore extends ObjectModel
* *
* @return array Ids of the associated carriers * @return array Ids of the associated carriers
*/ */
public function getCarriers() public function getCarriers($return_reference = false)
{ {
$ids_carrier = array(); $ids_carrier = array();
$query = new DbQuery(); $query = new DbQuery();
if ($return_reference)
$query->select('wc.id_carrier');
else
$query->select('c.id_carrier'); $query->select('c.id_carrier');
$query->from('warehouse_carrier', 'wc'); $query->from('warehouse_carrier', 'wc');
$query->innerJoin('carrier', 'c', 'c.id_reference = wc.id_carrier'); $query->innerJoin('carrier', 'c', 'c.id_reference = wc.id_carrier');
@@ -349,7 +349,7 @@ class AdminWarehousesControllerCore extends AdminController
$ids_shop[] = $shop['id_shop']; $ids_shop[] = $shop['id_shop'];
// loads current carriers associated with this warehouse // loads current carriers associated with this warehouse
$carriers = $obj->getCarriers(); $carriers = $obj->getCarriers(true);
// if an address is available : force specific fields values // if an address is available : force specific fields values
if ($address != null) if ($address != null)