Skip to content

Commit

Permalink
Merge pull request #673 from arnaudbey/add-author-field
Browse files Browse the repository at this point in the history
add task authorMore field
  • Loading branch information
arnaudbey committed Nov 19, 2014
2 parents 1a9525b + d24621b commit 87649a7
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 0 deletions.
28 changes: 28 additions & 0 deletions app/DoctrineMigrations/Version20141119154615.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20141119154615 extends AbstractMigration
{
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE questionnaire ADD authorMore LONGTEXT DEFAULT NULL');
}

public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE questionnaire DROP authorMore');
}
}
30 changes: 30 additions & 0 deletions src/Innova/SelfBundle/Entity/Questionnaire.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ class Questionnaire
*/
protected $author;

/**
* @var string
*
* @ORM\Column(name="authorMore", type="text", nullable=true)
*/
private $authorMore;

/**
* @ORM\ManyToMany(targetEntity="User", inversedBy="revisedQuestionnaires")
* @ORM\JoinTable(name="questionnaires_revisors")
Expand Down Expand Up @@ -1155,4 +1162,27 @@ public function getFlow()
{
return $this->flow;
}

/**
* Set authorMore
*
* @param string $authorMore
* @return Questionnaire
*/
public function setAuthorMore($authorMore)
{
$this->authorMore = $authorMore;

return $this;
}

/**
* Get authorMore
*
* @return string
*/
public function getAuthorMore()
{
return $this->authorMore;
}
}
6 changes: 6 additions & 0 deletions src/Innova/SelfBundle/Form/Type/QuestionnaireType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ class QuestionnaireType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder ->add('authorMore', 'textarea', array(
'attr' => array('class'=>'form-control identity-select','data-field'=>'authorMore'),
'label' => 'editor.identity.authorMore',
'translation_domain' => 'messages'
));

$builder ->add('theme', 'text', array(
'attr' => array('class'=>'form-control identity-select','data-field'=>'theme'),
'label' => 'editor.identity.theme',
Expand Down
3 changes: 3 additions & 0 deletions src/Innova/SelfBundle/Manager/QuestionnaireManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ public function setIdentityField($questionnaire, $field, $value)
$em = $this->entityManager;

switch ($field) {
case 'authorMore':
$questionnaire->setAuthorMore($value);
break;
case 'authorRightMore':
$questionnaire->setAuthorRightMore($value);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ editor:
skill: Compétence
theme: Titre
fixedOrder: Ordre fixe
authorMore: Task author

log:
editor_create: Création de
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ editor:
skill: Skill
theme: Title
fixedOrder: Fixed order
authorMore: Task author

log:
editor_create: Create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ editor:
skill: Compétence
theme: Titre
fixedOrder: Ordre fixe
authorMore: Auteur(s) de la tâche

log:
editor_create: Création de
Expand Down
2 changes: 2 additions & 0 deletions src/Innova/SelfBundle/Resources/translations/messages.it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ editor:
skill: Competenza
theme: Titolo
fixedOrder: Ordine fisso
authorMore: Auteur(s) de la tâche

log:
editor_create: Creazione di
editor_edit: Modifica di
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,19 @@
</div>
</div>

<div class="col-md-12">
<div class="col-md-6">
<div class="panel panel-default ">
<div class="panel-heading">{{ 'editor.identity.authorMore' | trans }}</div>
<div class="panel-body">
<div class="form-group">
{{ form_widget(form.authorMore) }}
</div>
</div>
</div>
</div>
</div>

<div class="col-md-12">
<div class="alert alert-info" role="alert">
{{ 'editor.identity.createdby' | trans }}
Expand Down

0 comments on commit 87649a7

Please sign in to comment.