Skip to content

Commit

Permalink
Fix for bug in ShiftBundle which caused errors and whithescreen
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiddons committed Jul 24, 2024
1 parent 36556ab commit 7939db7
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion module/CommonBundle/Component/Form/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ protected function createUnitsArray($academic): array
->findAllActiveAndDisplayed()->getResult(),
$this->getEntityManager()
->getRepository(Unit::class)
->findAllActiveAndDisplayedAndWorkgroupQuery()->getResult(),
->findAllActiveAndDisplayedAndWorkgroupQuery()->getResult()
);
}

Expand Down
5 changes: 3 additions & 2 deletions module/LogisticsBundle/Form/Admin/Article/Add.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function init()
),
'required' => true,
'attributes' => array(
'options' => $this->createUnitsArray(),
'options' => $this->createUnitsArray($academic = null),
),
)
);
Expand Down Expand Up @@ -243,9 +243,10 @@ private function createLocationsArray()
}

/**
* @param $academic
* @return array
*/
private function createUnitsArray()
protected function createUnitsArray($academic): array
{
$units = $this->getEntityManager()
->getRepository('CommonBundle\Entity\General\Organization\Unit')
Expand Down
9 changes: 5 additions & 4 deletions module/LogisticsBundle/Form/Admin/Article/Csv.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

namespace LogisticsBundle\Form\Admin\Article;


use RuntimeException;

/**
Expand Down Expand Up @@ -33,7 +33,7 @@ public function init()
),
'required' => true,
'attributes' => array(
'options' => $this->createUnitsArray(),
'options' => $this->createUnitsArray($academic = null),
),
)
);
Expand Down Expand Up @@ -71,9 +71,10 @@ public function init()
}

/**
* @param $academic
* @return array
*/
private function createUnitsArray()
protected function createUnitsArray($academic): array
{
$units = $this->getEntityManager()
->getRepository('CommonBundle\Entity\General\Organization\Unit')
Expand All @@ -90,4 +91,4 @@ private function createUnitsArray()

return $unitsArray;
}
}
}
5 changes: 3 additions & 2 deletions module/LogisticsBundle/Form/Admin/Order/Add.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function init()
'required' => true,
'attributes' => array(
'multiple' => true,
'options' => $this->createUnitsArray(),
'options' => $this->createUnitsArray($academic = null),
'id' => 'order_review_unit',
),
)
Expand Down Expand Up @@ -254,9 +254,10 @@ private function createLocationsArray()
}

/**
* @param $academic
* @return array
*/
private function createUnitsArray()
protected function createUnitsArray($academic): array
{
$units = $this->getEntityManager()
->getRepository('CommonBundle\Entity\General\Organization\Unit')
Expand Down
5 changes: 3 additions & 2 deletions module/ShiftBundle/Form/Admin/RegistrationShift/Add.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public function init()
'label' => 'Unit',
'required' => true,
'attributes' => array(
'options' => $this->createUnitsArray(),
'options' => $this->createUnitsArray($academic = null),
),
)
);
Expand Down Expand Up @@ -334,9 +334,10 @@ private function createDuplicatesArray()
}

/**
* @param $academic
* @return array
*/
private function createUnitsArray()
protected function createUnitsArray($academic): array
{
$units = $this->getEntityManager()
->getRepository('CommonBundle\Entity\General\Organization\Unit')
Expand Down
5 changes: 3 additions & 2 deletions module/ShiftBundle/Form/Admin/Shift/Add.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function init()
'label' => 'Unit',
'required' => true,
'attributes' => array(
'options' => $this->createUnitsArray(),
'options' => $this->createUnitsArray($academic = null),
),
)
);
Expand Down Expand Up @@ -362,9 +362,10 @@ private function createDuplicatesArray()
}

/**
* @param $academic
* @return array
*/
private function createUnitsArray()
protected function createUnitsArray($academic): array
{
$units = $this->getEntityManager()
->getRepository('CommonBundle\Entity\General\Organization\Unit')
Expand Down
5 changes: 3 additions & 2 deletions module/ShiftBundle/Form/Admin/Shift/Csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function init()
'label' => 'Unit',
'required' => true,
'attributes' => array(
'options' => $this->createUnitsArray(),
'options' => $this->createUnitsArray($academic = null),
),
)
);
Expand Down Expand Up @@ -181,9 +181,10 @@ private function createDuplicatesArray()
}

/**
* @param $academic
* @return array
*/
private function createUnitsArray()
protected function createUnitsArray($academic): array
{
$units = $this->getEntityManager()
->getRepository('CommonBundle\Entity\General\Organization\Unit')
Expand Down
5 changes: 3 additions & 2 deletions module/ShiftBundle/Form/RegistrationShift/Search/Unit.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ public function init()
{
parent::init();


$this->add(
array(
'type' => 'select',
'name' => 'unit',
'attributes' => array(
'options' => $this->createUnitsArray(),
'options' => $this->createUnitsArray($academic = null),
),
'options' => array(
'input' => array(
Expand All @@ -36,7 +37,7 @@ public function init()
$this->remove('csrf');
}

private function createUnitsArray()
protected function createUnitsArray($academic): array
{
$units = $this->getEntityManager()
->getRepository('CommonBundle\Entity\General\Organization\Unit')
Expand Down
4 changes: 2 additions & 2 deletions module/ShiftBundle/Form/Shift/Search/Unit.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function init()
'type' => 'select',
'name' => 'unit',
'attributes' => array(
'options' => $this->createUnitsArray(),
'options' => $this->createUnitsArray($academic = null),
),
'options' => array(
'input' => array(
Expand All @@ -36,7 +36,7 @@ public function init()
$this->remove('csrf');
}

private function createUnitsArray()
protected function createUnitsArray($academic): array
{
$units = $this->getEntityManager()
->getRepository('CommonBundle\Entity\General\Organization\Unit')
Expand Down

0 comments on commit 7939db7

Please sign in to comment.