Skip to content

Commit

Permalink
Add gamification_mode setting - refs BT#9886 #TMI
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed May 28, 2015
1 parent 3dad1cf commit 722803f
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main/install/data.sql
Expand Up @@ -1705,7 +1705,8 @@ VALUES
('hide_certificate_export_link', NULL, 'radio', 'Gradebook', 'false', 'CertificateHideExportLinkTitle', 'CertificateHideExportLinkComment', NULL, NULL, 1),
('dropbox_hide_course_coach', NULL, 'radio', 'Tools', 'false', 'DropboxHideCourseCoachTitle', 'DropboxHideCourseCoachComment', NULL, NULL, 1),
('sso_force_redirect', NULL, 'radio', 'Security', 'false', 'SSOForceRedirectTitle', 'SSOForceRedirectComment', NULL, NULL, 1),
('session_course_ordering', NULL, 'radio', 'Session', 'false', 'SessionCourseOrderingTitle', 'SessionCourseOrderingComment', NULL, NULL, 1);
('session_course_ordering', NULL, 'radio', 'Session', 'false', 'SessionCourseOrderingTitle', 'SessionCourseOrderingComment', NULL, NULL, 1),
('gamification_mode', NULL, 'radio', 'Platform', 0, 'GamificationModeTitle', 'GamificationModeComment', NULL, NULL, 1);

INSERT INTO settings_options (variable, value, display_text)
VALUES
Expand Down Expand Up @@ -1779,6 +1780,8 @@ VALUES
('sso_force_redirect', 'true', 'Yes'),
('sso_force_redirect', 'false', 'No'),
('session_course_ordering', 'true', 'Yes'),
('session_course_ordering', 'false', 'No');
('session_course_ordering', 'false', 'No'),
('gamification_mode', '0', 'Yes'),
('gamification_mode', '1', 'No');

UPDATE settings_current SET selected_value = '1.10.0.40' WHERE variable = 'chamilo_database_version';
@@ -0,0 +1,56 @@
<?php

namespace Chamilo\CoreBundle\Migrations\Schema\V110;

use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;

/**
* Class Version20150527120703
* LP autolunch -> autolaunch
* @package Chamilo\CoreBundle\Migrations\Schema\V110
*/
class Version20150527101600 extends AbstractMigrationChamilo
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
$value = api_get_configuration_value('gamification_mode');
$this->addSettingCurrent(
'gamification_mode',
'',
'radio',
'Platform',
$value == 0 ? 0: 1,
'GamificationModeTitle',
'GamificationModeComment',
null,
'',
1,
true,
false,
[
[
'value' => 1,
'text' => 'Yes'
],
[
'value' => 0,
'text' => 'No'
]
]
);
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
$this->addSql("DELETE FROM settings_options WHERE variable = 'gamification_mode'");
$this->addSql("DELETE FROM settings_current WHERE variable = 'gamification_mode'");
}

}

0 comments on commit 722803f

Please sign in to comment.