mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
close#326 - When clicking on add a report, we should directly go to the report form if we have only one possible report
This commit is contained in:
parent
4a035d27d7
commit
22c295b51b
@ -73,6 +73,14 @@ class ReportController extends Controller
|
||||
$cFGroups = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')
|
||||
->findByEntity('Chill\ReportBundle\Entity\Report');
|
||||
|
||||
|
||||
if(count($cFGroups) === 1 ){
|
||||
return $this->redirect(
|
||||
$this->generateUrl('report_new',
|
||||
array('person_id' => $person_id, 'cf_group_id' => $cFGroups[0]->getId())));
|
||||
}
|
||||
|
||||
|
||||
$cFGroupsChoice = array();
|
||||
|
||||
foreach ($cFGroups as $cFGroup) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user