Move gradebook_detailed_admin_view setting to database - refs #7794

1.10.x
Yannick Warnier 9 years ago
parent 95211d49c8
commit 9ed26091d2
  1. 26
      app/Migrations/Schema/V110/Version20150813143000.php
  2. 6
      main/gradebook/lib/flatview_data_generator.class.php
  3. 2
      main/install/configuration.dist.php
  4. 9
      main/install/data.sql

@ -34,6 +34,24 @@ class Version20150813143000 extends AbstractMigrationChamilo
1 => ['value' => 'false', 'text' => 'No'] 1 => ['value' => 'false', 'text' => 'No']
] ]
); );
$this->addSettingCurrent(
'gradebook_detailed_admin_view',
null,
'radio',
'Gradebook',
'false',
'ShowAdditionalColumnsInStudentResultsPageTitle',
'ShowAdditionalColumnsInStudentResultsPageComment',
null,
null,
1,
true,
false,
[
0 => ['value' => 'true', 'text' => 'Yes'],
1 => ['value' => 'false', 'text' => 'No']
]
);
} }
/** /**
@ -44,25 +62,27 @@ class Version20150813143000 extends AbstractMigrationChamilo
$entityManage = $this->getEntityManager(); $entityManage = $this->getEntityManager();
$deleteOptions = $entityManage->createQueryBuilder(); $deleteOptions = $entityManage->createQueryBuilder();
$deleteSettings = $entityManage->createQueryBuilder();
$deleteOptions->delete('ChamiloCoreBundle:SettingsOptions', 'o') $deleteOptions->delete('ChamiloCoreBundle:SettingsOptions', 'o')
->andWhere( ->andWhere(
$deleteOptions->expr()->in( $deleteOptions->expr()->in(
'o.variable', 'o.variable',
[ [
'prevent_multiple_simultaneous_login' 'prevent_multiple_simultaneous_login',
'gradebook_detailed_admin_view'
] ]
) )
); );
$deleteOptions->getQuery()->execute(); $deleteOptions->getQuery()->execute();
$deleteSettings = $entityManage->createQueryBuilder();
$deleteSettings->delete('ChamiloCoreBundle:SettingsCurrent', 's') $deleteSettings->delete('ChamiloCoreBundle:SettingsCurrent', 's')
->andWhere( ->andWhere(
$deleteSettings->expr()->in( $deleteSettings->expr()->in(
's.variable', 's.variable',
[ [
'prevent_multiple_simultaneous_login' 'prevent_multiple_simultaneous_login',
'gradebook_detailed_admin_view'
] ]
) )
); );

@ -173,7 +173,7 @@ class FlatViewDataGenerator
api_get_self().'?selectcat='.$sub_cat->get_id().'&'.api_get_cidreq() api_get_self().'?selectcat='.$sub_cat->get_id().'&'.api_get_cidreq()
).$add_weight; ).$add_weight;
if (api_get_configuration_value('gradebook_detailed_admin_view') == true) { if (api_get_setting('gradebook_detailed_admin_view') === 'true') {
$links = $sub_cat->get_links(); $links = $sub_cat->get_links();
$evaluations = $sub_cat->get_evaluations(); $evaluations = $sub_cat->get_evaluations();
@ -442,7 +442,7 @@ class FlatViewDataGenerator
foreach ($allcat as $sub_cat) { foreach ($allcat as $sub_cat) {
$score = $sub_cat->calc_score($user_id); $score = $sub_cat->calc_score($user_id);
if (api_get_configuration_value('gradebook_detailed_admin_view')) { if (api_get_setting('gradebook_detailed_admin_view') === 'true') {
$links = $sub_cat->get_links(); $links = $sub_cat->get_links();
$evaluations = $sub_cat->get_evaluations(); $evaluations = $sub_cat->get_evaluations();
@ -497,7 +497,7 @@ class FlatViewDataGenerator
$this->params['only_total_category'] == false) $this->params['only_total_category'] == false)
) { ) {
if (!$show_all) { if (!$show_all) {
if (api_get_configuration_value('gradebook_detailed_admin_view')) { if (api_get_setting('gradebook_detailed_admin_view') === 'true') {
$finalList = array_merge($linkScoreList, $evalScoreList); $finalList = array_merge($linkScoreList, $evalScoreList);
if (empty($finalList)) { if (empty($finalList)) {
$average = 0; $average = 0;

@ -202,8 +202,6 @@ $_configuration['system_stable'] = NEW_VERSION_STABLE;
) )
);*/ );*/
// Detail view of gradebook categories.
//$_configuration['gradebook_detailed_admin_view'] = false;
// E-mail accounts to send notifications to when executing cronjobs - works for main/cron/import_csv.php // E-mail accounts to send notifications to when executing cronjobs - works for main/cron/import_csv.php
//$_configuration['cron_notification_mails'] = array('email@example.com', 'email2@example.com'); //$_configuration['cron_notification_mails'] = array('email@example.com', 'email2@example.com');

@ -1720,7 +1720,8 @@ VALUES
('sso_force_redirect', NULL, 'radio', 'Security', 'false', 'SSOForceRedirectTitle', 'SSOForceRedirectComment', 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), ('gamification_mode', NULL, 'radio', 'Platform', '0', 'GamificationModeTitle', 'GamificationModeComment', NULL, NULL, 1),
('prevent_multiple_simultaneous_login', NULL, 'radio', 'Security', 'false', 'PreventMultipleSimultaneousLoginTitle', 'PreventMultipleSimultaneousLoginComment', NULL, NULL, 1); ('prevent_multiple_simultaneous_login', NULL, 'radio', 'Security', 'false', 'PreventMultipleSimultaneousLoginTitle', 'PreventMultipleSimultaneousLoginComment', NULL, NULL, 1),
('gradebook_detailed_admin_view', NULL, 'radio', 'Gradebook', 'false', 'ShowAdditionalColumnsInStudentResultsPageTitle', 'ShowAdditionalColumnsInStudentResultsPageComment', NULL, NULL, 1);
INSERT INTO settings_options (variable, value, display_text) INSERT INTO settings_options (variable, value, display_text)
VALUES VALUES
@ -1798,6 +1799,8 @@ VALUES
('gamification_mode', '1', 'Yes'), ('gamification_mode', '1', 'Yes'),
('gamification_mode', '0', 'No'), ('gamification_mode', '0', 'No'),
('prevent_multiple_simultaneous_login', '1', 'Yes'), ('prevent_multiple_simultaneous_login', '1', 'Yes'),
('prevent_multiple_simultaneous_login', '0', 'No'); ('prevent_multiple_simultaneous_login', '0', 'No'),
('gradebook_detailed_admin_view', '1', 'Yes'),
('gradebook_detailed_admin_view', '0', 'No');
UPDATE settings_current SET selected_value = '1.10.0.45' WHERE variable = 'chamilo_database_version'; UPDATE settings_current SET selected_value = '1.10.0.46' WHERE variable = 'chamilo_database_version';

Loading…
Cancel
Save