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
d2996bc8
Commit
d2996bc8
authored
Dec 22, 2015
by
Oliver Eglseder
Browse files
[TASK] Add number of votes property to election
parent
e4d36514
Changes
6
Hide whitespace changes
Inline
Side-by-side
Classes/Domain/Model/Election.php
View file @
d2996bc8
<?php
namespace
TYPO3\Election\Domain\Model
;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Class Election
...
...
@@ -49,6 +49,11 @@ class Election extends AbstractEntity
*/
protected
$nominees
=
null
;
/**
* @var int
*/
protected
$numberOfVotes
=
0
;
/**
* @return string
*/
...
...
@@ -144,4 +149,20 @@ class Election extends AbstractEntity
{
$this
->
nominees
=
$nominees
;
}
/**
* @return int
*/
public
function
getNumberOfVotes
()
{
return
$this
->
numberOfVotes
;
}
/**
* @param int $numberOfVotes
*/
public
function
setNumberOfVotes
(
$numberOfVotes
)
{
$this
->
numberOfVotes
=
$numberOfVotes
;
}
}
Resources/Private/Language/locallang.xlf
View file @
d2996bc8
...
...
@@ -186,6 +186,9 @@
<trans-unit
id=
"view.be.election.edit.welcome"
>
<source>
Update an Election.
</source>
</trans-unit>
<trans-unit
id=
"model.election.field.number_of_votes"
>
<source>
# of Votes/Elector
</source>
</trans-unit>
<!-- BE ELECTOR -->
...
...
Resources/Private/Partials/Model/Election/FormFields/NumberOfVotes.html
0 → 100644
View file @
d2996bc8
<fieldset
class=
"form-section"
>
<div
class=
"form-group"
>
<label>
<f:translate
key=
"model.election.field.number_of_votes"
>
# of Votes/Elector
</f:translate>
</label>
<div
class=
"form-control-wrap"
style=
"max-width: 480px"
>
<f:form.textfield
class=
"form-control"
property=
"numberOfVotes"
/>
</div>
</div>
</fieldset>
Resources/Private/Partials/Model/Election/Forms/EditForm.html
View file @
d2996bc8
...
...
@@ -4,3 +4,4 @@
<f:render
partial=
"Model/Election/FormFields/EndDate"
arguments=
"{election:election}"
/>
<f:render
partial=
"Model/Election/FormFields/Electorate"
arguments=
"{election:election,electorates:electorates}"
/>
<f:render
partial=
"Model/Election/FormFields/Nominees"
arguments=
"{election:election,nominees:nominees}"
/>
<f:render
partial=
"Model/Election/FormFields/NumberOfVotes"
arguments=
"{election:election}"
/>
ext_tables.sql
View file @
d2996bc8
...
...
@@ -19,17 +19,18 @@ CREATE TABLE tx_election_domain_model_configuration (
#
Table
structure
for
table
'tx_election_domain_model_election'
#
CREATE
TABLE
tx_election_domain_model_election
(
uid
INT
(
11
)
unsigned
NOT
NULL
auto_increment
,
pid
INT
(
11
)
unsigned
DEFAULT
'0'
NOT
NULL
,
creation_date
INT
(
11
)
unsigned
DEFAULT
'0'
NOT
NULL
,
creation_user
INT
(
11
)
unsigned
DEFAULT
'0'
NOT
NULL
,
title
VARCHAR
(
255
)
DEFAULT
''
NOT
NULL
,
description
text
NOT
NULL
,
start_date
INT
(
11
)
DEFAULT
'0'
NOT
NULL
,
end_date
INT
(
11
)
DEFAULT
'0'
NOT
NULL
,
electorate
INT
(
11
)
DEFAULT
'0'
NOT
NULL
,
nominees
INT
(
11
)
DEFAULT
'0'
NOT
NULL
,
uid
INT
(
11
)
unsigned
NOT
NULL
auto_increment
,
pid
INT
(
11
)
unsigned
DEFAULT
'0'
NOT
NULL
,
creation_date
INT
(
11
)
unsigned
DEFAULT
'0'
NOT
NULL
,
creation_user
INT
(
11
)
unsigned
DEFAULT
'0'
NOT
NULL
,
title
VARCHAR
(
255
)
DEFAULT
''
NOT
NULL
,
description
text
NOT
NULL
,
start_date
INT
(
11
)
DEFAULT
'0'
NOT
NULL
,
end_date
INT
(
11
)
DEFAULT
'0'
NOT
NULL
,
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
,
PRIMARY
KEY
(
uid
),
KEY
parent
(
pid
)
...
...
ext_typoscript_setup.txt
View file @
d2996bc8
...
...
@@ -89,6 +89,7 @@ config.tx_extbase.persistence.classes {
description.mapOnProperty = description
start_date.mapOnProperty = startDate
end_date.mapOnProperty = endDate
number_of_votes.mapOnProperty = numberOfVotes
electorate {
mapOnProperty = electorate
config {
...
...
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