Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrodevog committed Oct 6, 2023
1 parent f2a4e18 commit 910076d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions module/LogisticsBundle/Controller/CatalogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 910076d

Please sign in to comment.