Add dropbox_hide_general_coach setting see BT#10253

1.10.x
Julio Montoya 10 years ago
parent 56a13a0ba2
commit 57f99efbdc
  1. 19
      app/Migrations/Schema/V110/Version20150522222222.php
  2. 30
      main/dropbox/dropbox_functions.inc.php
  3. 3
      main/install/data.sql

@ -707,7 +707,7 @@ class Version20150522222222 extends AbstractMigrationChamilo
'',
'radio',
'Tools',
($value?$value:'false'),
($value ? $value : 'false'),
'DropboxHideCourseCoachTitle',
'DropboxHideCourseCoachComment',
null,
@ -718,6 +718,23 @@ class Version20150522222222 extends AbstractMigrationChamilo
[0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
);
$value = api_get_configuration_value('dropbox_hide_general_coach');
$this->addSettingCurrent(
'dropbox_hide_general_coach',
'',
'radio',
'Tools',
($value ? $value : 'false'),
'DropboxHideGeneralCoachTitle',
'DropboxHideGeneralCoachComment',
null,
'',
1,
true,
false,
[0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
);
// If SSO is used, the redirection to the master server is forced.
//$_configuration['force_sso_redirect'] = false;
$value = api_get_configuration_value('force_sso_redirect');

@ -570,16 +570,34 @@ function display_add_form($dropbox_unid, $viewReceivedCategory, $viewSentCategor
);
}
$hideCoach = api_get_setting('dropbox_hide_course_coach');
$complete_user_list2 = CourseManager::get_coach_list_from_course_code(
$course_info['code'],
api_get_session_id()
);
if ($hideCoach !== 'true') {
$complete_user_list2 = CourseManager::get_coach_list_from_course_code(
$course_info['code'],
api_get_session_id()
$generalCoachList = array();
$courseCoachList = array();
foreach ($complete_user_list2 as $coach) {
if ($coach['type'] == 'general_coach') {
$generalCoachList[] = $coach;
} else {
$courseCoachList[] = $coach;
}
}
$hideCourseCoach = api_get_setting('dropbox_hide_course_coach');
if ($hideCourseCoach == 'false') {
$complete_user_list_for_dropbox = array_merge(
$complete_user_list_for_dropbox,
$courseCoachList
);
}
$hideGeneralCoach = api_get_setting('dropbox_hide_general_coach');
if ($hideGeneralCoach == 'false') {
$complete_user_list_for_dropbox = array_merge(
$complete_user_list_for_dropbox,
$complete_user_list2
$generalCoachList
);
}
} else {

@ -1707,6 +1707,7 @@ VALUES
('hide_certificate_export_link_students', NULL, 'radio', 'Gradebook', 'false', 'CertificateHideExportLinkStudentTitle', 'CertificateHideExportLinkStudentComment', NULL, NULL, 1),
('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),
('dropbox_hide_general_coach', NULL, 'radio', 'Tools', 'false', 'DropboxHideGeneralCoachTitle', 'DropboxHideGeneralCoachComment', 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),
('gamification_mode', NULL, 'radio', 'Platform', '0', 'GamificationModeTitle', 'GamificationModeComment', NULL, NULL, 1),
@ -1786,6 +1787,8 @@ VALUES
('hide_certificate_export_link', 'false', 'No'),
('dropbox_hide_course_coach', 'true', 'Yes'),
('dropbox_hide_course_coach', 'false', 'No'),
('dropbox_hide_general_coach', 'true', 'Yes'),
('dropbox_hide_general_coach', 'false', 'No'),
('sso_force_redirect', 'true', 'Yes'),
('sso_force_redirect', 'false', 'No'),
('session_course_ordering', 'true', 'Yes'),

Loading…
Cancel
Save