Commit d2996bc8 authored by Oliver Eglseder's avatar Oliver Eglseder
Browse files

[TASK] Add number of votes property to election

parent e4d36514
<?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;
}
}
......@@ -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 -->
......
<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>
......@@ -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}"/>
......@@ -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)
......
......@@ -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 {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment