diff --git a/module/LogisticsBundle/Controller/CatalogController.php b/module/LogisticsBundle/Controller/CatalogController.php index c3afc47bc6..f5f36a515b 100644 --- a/module/LogisticsBundle/Controller/CatalogController.php +++ b/module/LogisticsBundle/Controller/CatalogController.php @@ -36,7 +36,9 @@ public function overviewAction() // Gets last order for every request $lastOrders = array(); foreach ($requests as $request) { - $lastOrders[] = $this->getLastOrderByRequest($request); + $lastOrder = $this->getLastOrderByRequest($request); + if ($lastOrder) + $lastOrders[] = $lastOrder; } return new ViewModel( @@ -112,7 +114,7 @@ public function catalogAction() ); $allArticles[] = $articleInfo; - } elseif ($art->isGreaterVtkVisibility() && $academic->isInWorkingGroup()) { + } elseif ($art->isGreaterVtkVisibility() && ($academic->isInWorkingGroup() || $academic->isPraesidium($this->getCurrentAcademicYear()))) { $articleInfo = array( 'article' => $art, 'mapped' => $mapped[$art->getId()] ?? 0, @@ -660,6 +662,7 @@ private function getLastOrderByRequest($request) // Gets the mo $orders = $this->getEntityManager() ->getRepository('LogisticsBundle\Entity\Order') ->findAllByRequest($request); + array_pop($orders); // pop dummy order return current($orders); // Gets the first element of an array }