From 910076d668bd061b48b0ac002724e47ba9b4111f Mon Sep 17 00:00:00 2001 From: pedrod Date: Fri, 6 Oct 2023 22:40:40 +0000 Subject: [PATCH] small fixes --- module/LogisticsBundle/Controller/CatalogController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 }