made lonely orders its own page, navigatable by tabs
This commit is contained in:
@@ -46,6 +46,13 @@ class OrderController extends mfBaseController {
|
||||
if(is_numeric($this->request->s)) {
|
||||
$pagination['start'] = intval($this->request->s);
|
||||
}
|
||||
|
||||
|
||||
$showLonelies = false;
|
||||
|
||||
if($this->request->noTermProducts) {
|
||||
$showLonelies = true;
|
||||
}
|
||||
|
||||
$my_networks = [];
|
||||
|
||||
@@ -104,36 +111,42 @@ class OrderController extends mfBaseController {
|
||||
$order_search[$name] = $value;
|
||||
}
|
||||
}
|
||||
//var_dump($order_search);exit;
|
||||
$pagination['maxItems'] = OrderModel::count($order_search);
|
||||
foreach(OrderModel::search($order_search, $pagination) as $order) {
|
||||
if(!array_key_exists($order->id, $orders)) {
|
||||
$orders[$order->id] = $order;
|
||||
|
||||
if(!$showLonelies) {
|
||||
//var_dump($order_search);exit;
|
||||
$pagination['maxItems'] = OrderModel::count($order_search);
|
||||
foreach(OrderModel::search($order_search, $pagination) as $order) {
|
||||
if(!array_key_exists($order->id, $orders)) {
|
||||
$orders[$order->id] = $order;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$userIds = $this->me->getAddressOrParent()->getUserIds();
|
||||
//var_dump($userIds);exit;
|
||||
if(!array_key_exists("network_linked_status", $order_search)) {
|
||||
$lonelyOrders = [];
|
||||
unset($order_search["network_id"]);
|
||||
$order_search['product_id'] = null;
|
||||
// orders without a product
|
||||
if($this->me->isAdmin()) {
|
||||
if(!$this->request->filter['network_id']) {
|
||||
|
||||
if($showLonelies) {
|
||||
$userIds = $this->me->getAddressOrParent()->getUserIds();
|
||||
//var_dump($userIds);exit;
|
||||
if(!array_key_exists("network_linked_status", $order_search)) {
|
||||
$lonelyOrders = [];
|
||||
unset($order_search["network_id"]);
|
||||
$order_search['product_id'] = null;
|
||||
// orders without a product
|
||||
if($this->me->isAdmin()) {
|
||||
if(!$this->request->filter['network_id']) {
|
||||
$lonelies = OrderModel::search($order_search);
|
||||
}
|
||||
} else {
|
||||
$order_search['create_by'] = $userIds;
|
||||
//var_dump($order_search);exit;
|
||||
$lonelies = OrderModel::search($order_search);
|
||||
}
|
||||
} else {
|
||||
$order_search['create_by'] = $userIds;
|
||||
//var_dump($order_search);exit;
|
||||
$lonelies = OrderModel::search($order_search);
|
||||
}
|
||||
foreach($lonelies as $order) {
|
||||
if(!array_key_exists($order->id, $orders)) {
|
||||
$lonelyOrders[$order->id] = $order;
|
||||
foreach($lonelies as $order) {
|
||||
if(!array_key_exists($order->id, $orders)) {
|
||||
$lonelyOrders[$order->id] = $order;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// orders with termination product not requiring termination_id
|
||||
$order_search['product_id'] = ">0";
|
||||
$order_search['termination_id'] = null;
|
||||
@@ -170,16 +183,19 @@ class OrderController extends mfBaseController {
|
||||
//$lonelyOrders[$order->id] = $order;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->layout()->set("lonelyOrders", $lonelyOrders);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$this->layout()->set("showLonelies", $showLonelies);
|
||||
$this->layout()->set("orders", $orders);
|
||||
$this->layout()->set("pagination", $pagination);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function getPreparedFilter($filter) {
|
||||
$new_filter = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user