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
3e25b2be
Commit
3e25b2be
authored
Jan 06, 2016
by
Oliver Eglseder
Browse files
[TASK] Link electionVotes to elections
parent
02120452
Changes
5
Hide whitespace changes
Inline
Side-by-side
Classes/Domain/Model/Election.php
View file @
3e25b2be
...
...
@@ -54,6 +54,11 @@ class Election extends AbstractEntity
*/
protected
$numberOfVotes
=
0
;
/**
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\Election\Domain\Model\ElectionVote>
*/
protected
$electionVotes
=
null
;
/**
* @return string
*/
...
...
@@ -165,4 +170,20 @@ class Election extends AbstractEntity
{
$this
->
numberOfVotes
=
$numberOfVotes
;
}
/**
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
*/
public
function
getElectionVotes
()
{
return
$this
->
electionVotes
;
}
/**
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $electionVotes
*/
public
function
setElectionVotes
(
$electionVotes
)
{
$this
->
electionVotes
=
$electionVotes
;
}
}
Resources/Private/Language/locallang.xlf
View file @
3e25b2be
...
...
@@ -237,6 +237,9 @@
<trans-unit
id=
"model.election.field.number_of_votes"
>
<source>
# of Votes/Elector
</source>
</trans-unit>
<trans-unit
id=
"view.be.election.list.voting_started"
>
<source>
Can not alter or delete; Voting has started
</source>
</trans-unit>
<!-- BE ELECTOR -->
...
...
Resources/Private/Partials/Model/Election/List.html
View file @
3e25b2be
...
...
@@ -27,12 +27,30 @@
</td>
<td>
<div
class=
"btn-group"
>
<f:link.action
class=
"btn btn-default"
action=
"edit"
controller=
"BeElection"
arguments=
"{election:election}"
>
<core:icon
identifier=
"actions-edit-rename"
/>
</f:link.action>
<f:link.action
class=
"btn btn-default"
action=
"delete"
controller=
"BeElection"
arguments=
"{election:election}"
>
<core:icon
identifier=
"actions-edit-delete"
/>
</f:link.action>
<f:if
condition=
"{election.electionVotes}"
>
<f:then>
<span
class=
"btn btn-default disabled"
>
<core:icon
identifier=
"actions-edit-rename"
state=
"disabled"
/>
</span>
<span
class=
"btn btn-default disabled"
>
<core:icon
identifier=
"actions-edit-delete"
state=
"disabled"
/>
</span>
<f:link.action
class=
"btn btn-default"
action=
"summary"
controller=
"BeElection"
arguments=
"{election:election}"
>
<core:icon
identifier=
"actions-edit-rename"
/>
</f:link.action>
</f:then>
<f:else>
<f:link.action
class=
"btn btn-default"
action=
"edit"
controller=
"BeElection"
arguments=
"{election:election}"
>
<core:icon
identifier=
"actions-edit-rename"
/>
</f:link.action>
<f:link.action
class=
"btn btn-default"
action=
"delete"
controller=
"BeElection"
arguments=
"{election:election}"
>
<core:icon
identifier=
"actions-edit-delete"
/>
</f:link.action>
</f:else>
</f:if>
</div>
</td>
</tr>
...
...
ext_tables.sql
View file @
3e25b2be
...
...
@@ -37,6 +37,7 @@ CREATE TABLE tx_election_domain_model_election (
electorate
INT
(
11
)
unsigned
DEFAULT
'0'
NOT
NULL
,
nominees
INT
(
11
)
unsigned
DEFAULT
'0'
NOT
NULL
,
number_of_votes
INT
(
11
)
unsigned
DEFAULT
'0'
NOT
NULL
,
election_votes
INT
(
11
)
unsigned
DEFAULT
'0'
NOT
NULL
,
PRIMARY
KEY
(
uid
),
KEY
parent
(
pid
)
...
...
ext_typoscript_setup.txt
View file @
3e25b2be
...
...
@@ -111,7 +111,6 @@ config.tx_extbase.persistence.classes {
foreign_table = tx_election_domain_model_electorate
}
}
nominees {
mapOnProperty = nominees
config {
...
...
@@ -120,6 +119,14 @@ config.tx_extbase.persistence.classes {
foreign_table = tx_election_domain_model_nominee
}
}
election_votes {
mapOnProperty = electionVotes
config {
type = inline
foreign_table = tx_election_domain_model_electionvote
foreign_field = election
}
}
}
}
}
...
...
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