Skip to content

Commit

Permalink
[ClacoForm] adds confirmation on entry submission
Browse files Browse the repository at this point in the history
  • Loading branch information
Elorfin committed Feb 17, 2021
1 parent 38873df commit c3e820e
Show file tree
Hide file tree
Showing 18 changed files with 133 additions and 930 deletions.
37 changes: 36 additions & 1 deletion src/plugin/claco-form/Entity/ClacoForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
class ClacoForm extends AbstractResource
{
use Uuid;

// entries list configuration
use ListParameters;

Expand Down Expand Up @@ -73,6 +72,22 @@ class ClacoForm extends AbstractResource
*/
protected $details;

/**
* Ask for confirmation when a user submit a new entry.
*
* @ORM\Column(type="boolean")
*
* @var bool
*/
private $showConfirm = false;

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

/**
* ClacoForm constructor.
*/
Expand Down Expand Up @@ -144,6 +159,26 @@ public function getKeywords()
return $this->keywords->toArray();
}

public function getShowConfirm(): bool
{
return $this->showConfirm;
}

public function setShowConfirm(bool $showConfirm)
{
$this->showConfirm = $showConfirm;
}

public function getConfirmMessage(): ?string
{
return $this->confirmMessage;
}

public function setConfirmMessage(string $message = null)
{
$this->confirmMessage = $message;
}

public function getDetails()
{
return $this->details;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace Claroline\ClacoFormBundle\Installation\Migrations\pdo_mysql;

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

/**
* Auto-generated migration based on mapping information: modify it with caution.
*
* Generation date: 2021/02/15 10:56:42
*/
class Version20210215105628 extends AbstractMigration
{
public function up(Schema $schema)
{
$this->addSql('
ALTER TABLE claro_clacoformbundle_claco_form
ADD showConfirm TINYINT(1) NOT NULL,
ADD confirmMessage LONGTEXT DEFAULT NULL
');
}

public function down(Schema $schema)
{
$this->addSql('
ALTER TABLE claro_clacoformbundle_claco_form
DROP showConfirm,
DROP confirmMessage
');
}
}
Loading

0 comments on commit c3e820e

Please # to comment.