Skip to content

Commit

Permalink
Add is_mandatory extrafield for surveys - refs BT#12915
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Jun 26, 2017
1 parent e6b3a47 commit 2e4767e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
41 changes: 41 additions & 0 deletions app/Migrations/Schema/V111/Version20170626091800.php
@@ -0,0 +1,41 @@
<?php
/* For licensing terms, see /license.txt */

namespace Application\Migrations\Schema\V111;

use Application\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;

/**
* Class Version20170626091800
*
* Create extrafield to make survey as mandatory
*
* @package Application\Migrations\Schema\V111
*/
class Version20170626091800 extends AbstractMigrationChamilo
{

/**
* @param \Doctrine\DBAL\Schema\Schema $schema
*/
public function up(Schema $schema)
{
$this->addSql("
INSERT INTO extra_field
(extra_field_type, field_type, variable, display_text, visible_to_self, changeable, created_at)
VALUES (12, 13, 'is_mandatory', 'IsMandatory', 1, 1, NOW());
");
}

/**
* @param \Doctrine\DBAL\Schema\Schema $schema
*/
public function down(Schema $schema)
{
$this->addSql("
DELETE FROM extra_field
WHERE extra_field_type = 12 AND field_type = 13 AND variable = 'is_mandatory';
");
}
}
2 changes: 2 additions & 0 deletions main/install/data.sql
Expand Up @@ -1960,3 +1960,5 @@ INSERT INTO settings_current (variable, type, category, selected_value, title, c
VALUES ('allow_download_documents_by_api_key', 'radio', 'WebServices', 'false', 'AllowDownloadDocumentsByApiKeyTitle', 'AllowDownloadDocumentsByApiKeyComment', '', NULL, 1);
INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_download_documents_by_api_key', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_download_documents_by_api_key', 'false', 'No');

INSERT INTO extra_field (extra_field_type, field_type, variable, display_text, visible_to_self, changeable, created_at) VALUES (12, 13, 'is_mandatory','IsMandatory', 1, 1, NOW());

0 comments on commit 2e4767e

Please sign in to comment.