Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
t3o sites
voting.typo3.org
extensions
election
Commits
f21669f9
Commit
f21669f9
authored
Jan 11, 2016
by
Stefan Busemann
Browse files
[BUGFIX] Adds error message if no configuration is available
parent
c287f307
Changes
2
Hide whitespace changes
Inline
Side-by-side
Classes/Controller/BeDashboardController.php
View file @
f21669f9
...
...
@@ -13,6 +13,9 @@ namespace TYPO3\Election\Controller;
*
* The TYPO3 project - inspiring people to share!
*/
use
TYPO3\CMS\Core\Messaging\AbstractMessage
;
use
TYPO3\CMS\Extbase\Utility\DebuggerUtility
;
use
TYPO3\CMS\Extbase\Utility\LocalizationUtility
;
use
TYPO3\Election\Domain\Repository\ElectionCircularRepository
;
use
TYPO3\Election\Domain\Repository\ElectorImportRepository
;
...
...
@@ -40,16 +43,37 @@ class BeDashboardController extends AbstractBeController
'elections'
=>
$this
->
electionRepository
->
findAll
(),
]
);
if
(
$this
->
backendUserHasUserGroup
(
$this
->
configuration
->
getElectionManagerGroup
()))
{
$this
->
view
->
assign
(
'electorImports'
,
$this
->
objectManager
->
get
(
ElectorImportRepository
::
class
)
->
findAll
()
if
(
$this
->
configuration
)
{
$electionManagerGroup
=
$this
->
configuration
->
getElectionManagerGroup
();
}
else
{
$this
->
addFlashMessage
(
LocalizationUtility
::
translate
(
'view.be.dashboard.index.no_configuration_msg_body'
,
$this
->
extensionName
),
LocalizationUtility
::
translate
(
'view.be.dashboard.index.no_configuration_msg_title'
,
$this
->
extensionName
),
AbstractMessage
::
ERROR
);
$this
->
view
->
assign
(
'electionCirculars'
,
$this
->
objectManager
->
get
(
ElectionCircularRepository
::
class
)
->
findAll
()
}
if
(
$electionManagerGroup
)
{
if
(
$this
->
backendUserHasUserGroup
())
{
$this
->
view
->
assign
(
'electorImports'
,
$this
->
objectManager
->
get
(
ElectorImportRepository
::
class
)
->
findAll
()
);
$this
->
view
->
assign
(
'electionCirculars'
,
$this
->
objectManager
->
get
(
ElectionCircularRepository
::
class
)
->
findAll
()
);
}
}
else
{
$this
->
addFlashMessage
(
LocalizationUtility
::
translate
(
'view.be.dashboard.index.no_configuration_msg_body'
,
$this
->
extensionName
),
LocalizationUtility
::
translate
(
'view.be.dashboard.index.no_electionmanagergroup_msg_body'
,
$this
->
extensionName
),
AbstractMessage
::
WARNING
);
}
}
/**
...
...
Resources/Private/Language/locallang.xlf
View file @
f21669f9
...
...
@@ -98,6 +98,22 @@
<source>
There are no Election Circulars
</source>
</trans-unit>
<trans-unit
id=
"view.be.dashboard.index.no_configuration_msg_title"
>
<source>
No configuration is available
</source>
</trans-unit>
<trans-unit
id=
"view.be.dashboard.index.no_configuration_msg_body"
>
<source>
Please add a configuration record.
</source>
</trans-unit>
<trans-unit
id=
"view.be.dashboard.index.no_electionmanagergroup_msg_title"
>
<source>
No election manager group is set
</source>
</trans-unit>
<trans-unit
id=
"view.be.dashboard.index.no_electionmanagergroup_msg_body"
>
<source>
Please add an election group in your configuration.
</source>
</trans-unit>
<!-- BE CONFIGURATION-->
<trans-unit
id=
"view.be.configuration.edit.welcome"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment