Version20150522222222.php 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. namespace Application\Migrations\Schema\V110;
  4. use Application\Migrations\AbstractMigrationChamilo;
  5. use Doctrine\DBAL\Schema\Schema;
  6. /**
  7. * Class Version20150522222222
  8. * @package Application\Migrations\Schema\V11010
  9. */
  10. class Version20150522222222 extends AbstractMigrationChamilo
  11. {
  12. /**
  13. * @param Schema $schema
  14. */
  15. public function up(Schema $schema)
  16. {
  17. // The first ALTER queries here requires a check because the field might already exist
  18. $connection = $this->connection;
  19. $fieldExists = false;
  20. $sql = "SELECT *
  21. FROM user
  22. LIMIT 1";
  23. $result = $connection->executeQuery($sql);
  24. $dataList = $result->fetchAll();
  25. if (!empty($dataList)) {
  26. foreach ($dataList as $data) {
  27. if (isset($data['last_login'])) {
  28. $fieldExists = true;
  29. }
  30. }
  31. }
  32. if (!$fieldExists) {
  33. $this->addSql('ALTER TABLE user ADD COLUMN last_login datetime DEFAULT NULL');
  34. }
  35. // calendar events comments
  36. $fieldExists = false;
  37. $sql = "SELECT *
  38. FROM c_calendar_event
  39. LIMIT 1";
  40. $result = $connection->executeQuery($sql);
  41. $dataList = $result->fetchAll();
  42. if (!empty($dataList)) {
  43. foreach ($dataList as $data) {
  44. if (isset($data['comment'])) {
  45. $fieldExists = true;
  46. }
  47. }
  48. }
  49. if (!$fieldExists) {
  50. $this->addSql("ALTER TABLE c_calendar_event ADD COLUMN comment TEXT");
  51. }
  52. // Move some settings from configuration.php to the database
  53. // Current settings categories are:
  54. // Platform, Course, Session, Languages, User, Tools, Editor, Security,
  55. // Tuning, Gradebook, Timezones, Tracking, Search, stylesheets (lowercase),
  56. // LDAP, CAS, Shibboleth, Facebook
  57. // Allow select the return link in the LP view
  58. $value = $this->getConfigurationValue('allow_lp_return_link');
  59. $this->addSettingCurrent(
  60. 'allow_lp_return_link',
  61. '',
  62. 'radio',
  63. 'Course',
  64. ($value?$value:'true'),
  65. 'AllowLearningPathReturnLinkTitle',
  66. 'AllowLearningPathReturnLinkComment',
  67. null,
  68. '',
  69. 1,
  70. true,
  71. false,
  72. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  73. );
  74. // If true the export link is blocked.
  75. $value = $this->getConfigurationValue('hide_scorm_export_link');
  76. $this->addSettingCurrent(
  77. 'hide_scorm_export_link',
  78. '',
  79. 'radio',
  80. 'Course',
  81. ($value?$value:'false'),
  82. 'HideScormExportLinkTitle',
  83. 'HideScormExportLinkComment',
  84. null,
  85. '',
  86. 1,
  87. true,
  88. false,
  89. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  90. );
  91. // If true the copy link is blocked.
  92. //$_configuration['hide_scorm_copy_link'] = false;
  93. $value = $this->getConfigurationValue('hide_scorm_copy_link');
  94. $this->addSettingCurrent(
  95. 'hide_scorm_copy_link',
  96. '',
  97. 'radio',
  98. 'Course',
  99. ($value?$value:'false'),
  100. 'HideScormCopyLinkTitle',
  101. 'HideScormCopyLinkComment',
  102. null,
  103. '',
  104. 1,
  105. true,
  106. false,
  107. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  108. );
  109. // If true the pdf export link is blocked.
  110. //$_configuration['hide_scorm_pdf_link'] = false;
  111. $value = $this->getConfigurationValue('hide_scorm_pdf_link');
  112. $this->addSettingCurrent(
  113. 'hide_scorm_pdf_link',
  114. '',
  115. 'radio',
  116. 'Course',
  117. ($value?$value:'false'),
  118. 'HideScormPdfLinkTitle',
  119. 'HideScormPdfLinkComment',
  120. null,
  121. '',
  122. 1,
  123. true,
  124. false,
  125. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  126. );
  127. // Default session days before coach access
  128. //$_configuration['session_days_before_coach_access'] = 0;
  129. $value = $this->getConfigurationValue('session_days_before_coach_access');
  130. $this->addSettingCurrent(
  131. 'session_days_before_coach_access',
  132. '',
  133. 'textfield',
  134. 'Session',
  135. ($value?$value:'0'),
  136. 'SessionDaysBeforeCoachAccessTitle',
  137. 'SessionDaysBeforeCoachAccessComment',
  138. null,
  139. '',
  140. 1,
  141. true,
  142. false
  143. );
  144. // Default session days after coach access
  145. //$_configuration['session_days_after_coach_access'] = 0;
  146. $value = $this->getConfigurationValue('session_days_after_coach_access');
  147. $this->addSettingCurrent(
  148. 'session_days_after_coach_access',
  149. '',
  150. 'textfield',
  151. 'Session',
  152. ($value?$value:'0'),
  153. 'SessionDaysAfterCoachAccessTitle',
  154. 'SessionDaysAfterCoachAccessComment',
  155. null,
  156. '',
  157. 1,
  158. true,
  159. false
  160. );
  161. // PDF Logo header in app/Resources/public/css/themes/xxx/images/pdf_logo_header.png
  162. //$_configuration['pdf_logo_header'] = false;
  163. $value = $this->getConfigurationValue('pdf_logo_header');
  164. $this->addSettingCurrent(
  165. 'pdf_logo_header',
  166. '',
  167. 'radio',
  168. 'Course',
  169. ($value?$value:'false'),
  170. 'PdfLogoHeaderTitle',
  171. 'PdfLogoHeaderComment',
  172. null,
  173. '',
  174. 1,
  175. true,
  176. false,
  177. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  178. );
  179. // Order inscription user list by official_code
  180. //$_configuration['order_user_list_by_official_code'] = false;
  181. $value = $this->getConfigurationValue('order_user_list_by_official_code');
  182. $this->addSettingCurrent(
  183. 'order_user_list_by_official_code',
  184. '',
  185. 'radio',
  186. 'Platform',
  187. ($value?$value:'false'),
  188. 'OrderUserListByOfficialCodeTitle',
  189. 'OrderUserListByOfficialCodeComment',
  190. null,
  191. '',
  192. 1,
  193. true,
  194. false,
  195. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  196. );
  197. // Default course setting "email_alert_manager_on_new_quiz"
  198. //$_configuration['email_alert_manager_on_new_quiz'] = 1;
  199. $value = $this->getConfigurationValue('email_alert_manager_on_new_quiz');
  200. $this->addSettingCurrent(
  201. 'email_alert_manager_on_new_quiz',
  202. '',
  203. 'radio',
  204. 'Course',
  205. ($value?$value:'true'),
  206. 'AlertManagerOnNewQuizTitle',
  207. 'AlertManagerOnNewQuizComment',
  208. null,
  209. '',
  210. 1,
  211. true,
  212. false,
  213. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  214. );
  215. // Show official code in exercise report list.
  216. //$_configuration['show_official_code_exercise_result_list'] = false;
  217. $value = $this->getConfigurationValue('show_official_code_exercise_result_list');
  218. $this->addSettingCurrent(
  219. 'show_official_code_exercise_result_list',
  220. '',
  221. 'radio',
  222. 'Tools',
  223. ($value?$value:'false'),
  224. 'ShowOfficialCodeInExerciseResultListTitle',
  225. 'ShowOfficialCodeInExerciseResultListComment',
  226. null,
  227. '',
  228. 1,
  229. true,
  230. false,
  231. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  232. );
  233. // Hide private courses from course catalog
  234. //$_configuration['course_catalog_hide_private'] = false;
  235. $value = $this->getConfigurationValue('course_catalog_hide_private');
  236. $this->addSettingCurrent(
  237. 'course_catalog_hide_private',
  238. '',
  239. 'radio',
  240. 'Platform',
  241. ($value?$value:'false'),
  242. 'HidePrivateCoursesFromCourseCatalogTitle',
  243. 'HidePrivateCoursesFromCourseCatalogComment',
  244. null,
  245. '',
  246. 1,
  247. true,
  248. false,
  249. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  250. );
  251. // Display sessions catalog
  252. // 0 = show only courses; 1 = show only sessions; 2 = show courses and sessions
  253. //$_configuration['catalog_show_courses_sessions'] = 0;
  254. $value = $this->getConfigurationValue('catalog_show_courses_sessions');
  255. $this->addSettingCurrent(
  256. 'catalog_show_courses_sessions',
  257. '',
  258. 'radio',
  259. 'Platform',
  260. ($value?$value:'0'),
  261. 'CoursesCatalogueShowSessionsTitle',
  262. 'CoursesCatalogueShowSessionsComment',
  263. null,
  264. '',
  265. 1,
  266. true,
  267. false,
  268. [0 => ['value' => '0', 'text' => 'CatalogueShowOnlyCourses'], 1 => ['value' => '1', 'text' => 'CatalogueShowOnlySessions'], 2 => ['value' => '2', 'text' => 'CatalogueShowCoursesAndSessions']]
  269. );
  270. // Auto detect language custom pages.
  271. // $_configuration['auto_detect_language_custom_pages'] = true;
  272. $value = $this->getConfigurationValue('auto_detect_language_custom_pages');
  273. $this->addSettingCurrent(
  274. 'auto_detect_language_custom_pages',
  275. '',
  276. 'radio',
  277. 'Platform',
  278. ($value?$value:'true'),
  279. 'AutoDetectLanguageCustomPagesTitle',
  280. 'AutoDetectLanguageCustomPagesComment',
  281. null,
  282. '',
  283. 1,
  284. true,
  285. false,
  286. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  287. );
  288. // Show reduce LP report
  289. //$_configuration['lp_show_reduced_report'] = false;
  290. $value = $this->getConfigurationValue('lp_show_reduced_report');
  291. $this->addSettingCurrent(
  292. 'lp_show_reduced_report',
  293. '',
  294. 'radio',
  295. 'Tools',
  296. ($value?$value:'false'),
  297. 'LearningPathShowReducedReportTitle',
  298. 'LearningPathShowReducedReportComment',
  299. null,
  300. '',
  301. 1,
  302. true,
  303. false,
  304. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  305. );
  306. //Allow session-to-session copy
  307. //$_configuration['allow_session_course_copy_for_teachers'] = true;
  308. $value = $this->getConfigurationValue('allow_session_course_copy_for_teachers');
  309. $this->addSettingCurrent(
  310. 'allow_session_course_copy_for_teachers',
  311. '',
  312. 'radio',
  313. 'Session',
  314. ($value?$value:'false'),
  315. 'AllowSessionCourseCopyForTeachersTitle',
  316. 'AllowSessionCourseCopyForTeachersComment',
  317. null,
  318. '',
  319. 1,
  320. true,
  321. false,
  322. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  323. );
  324. // Hide the logout button
  325. //$_configuration['hide_logout_button'] = true;
  326. $value = $this->getConfigurationValue('hide_logout_button');
  327. $this->addSettingCurrent(
  328. 'hide_logout_button',
  329. '',
  330. 'radio',
  331. 'Security',
  332. ($value?$value:'false'),
  333. 'HideLogoutButtonTitle',
  334. 'HideLogoutButtonComment',
  335. null,
  336. '',
  337. 1,
  338. true,
  339. false,
  340. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  341. );
  342. // Prevent redirecting admin to admin page
  343. //$_configuration['redirect_admin_to_courses_list'] = true;
  344. $value = $this->getConfigurationValue('redirect_admin_to_courses_list');
  345. $this->addSettingCurrent(
  346. 'redirect_admin_to_courses_list',
  347. '',
  348. 'radio',
  349. 'Platform',
  350. ($value?$value:'false'),
  351. 'RedirectAdminToCoursesListTitle',
  352. 'RedirectAdminToCoursesListComment',
  353. null,
  354. '',
  355. 1,
  356. true,
  357. false,
  358. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  359. );
  360. // Shows the custom course icon instead of the classic green board icon
  361. //$_configuration['course_images_in_courses_list'] = false;
  362. $value = $this->getConfigurationValue('course_images_in_courses_list');
  363. $this->addSettingCurrent(
  364. 'course_images_in_courses_list',
  365. '',
  366. 'radio',
  367. 'Course',
  368. ($value?$value:'false'),
  369. 'CourseImagesInCoursesListTitle',
  370. 'CourseImagesInCoursesListComment',
  371. null,
  372. '',
  373. 1,
  374. true,
  375. false,
  376. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  377. );
  378. // Which student publication will be taken when connected to the gradebook: first|last
  379. //$_configuration['student_publication_to_take_in_gradebook'] = 'first';
  380. $value = $this->getConfigurationValue('student_publication_to_take_in_gradebook');
  381. $this->addSettingCurrent(
  382. 'student_publication_to_take_in_gradebook',
  383. '',
  384. 'radio',
  385. 'Gradebook',
  386. ($value?$value:'first'),
  387. 'StudentPublicationSelectionForGradebookTitle',
  388. 'StudentPublicationSelectionForGradebookComment',
  389. null,
  390. '',
  391. 1,
  392. true,
  393. false,
  394. [0 => ['value' => 'first', 'text' => 'First'], 1 => ['value' => 'last', 'text' => 'Last']]
  395. );
  396. // Show a filter by official code
  397. //$_configuration['certificate_filter_by_official_code'] = false;
  398. $value = $this->getConfigurationValue('certificate_filter_by_official_code');
  399. $this->addSettingCurrent(
  400. 'certificate_filter_by_official_code',
  401. '',
  402. 'radio',
  403. 'Gradebook',
  404. ($value?$value:'false'),
  405. 'FilterCertificateByOfficialCodeTitle',
  406. 'FilterCertificateByOfficialCodeComment',
  407. null,
  408. '',
  409. 1,
  410. true,
  411. false,
  412. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  413. );
  414. // Max quantity of fkceditor allowed in the exercise result page otherwise
  415. // Textareas are used.
  416. //$_configuration['exercise_max_ckeditors_in_page'] = 0;
  417. $value = $this->getConfigurationValue('exercise_max_ckeditors_in_page');
  418. $this->addSettingCurrent(
  419. 'exercise_max_ckeditors_in_page',
  420. '',
  421. 'textfield',
  422. 'Tools',
  423. ($value?$value:'0'),
  424. 'MaxCKeditorsOnExerciseResultsPageTitle',
  425. 'MaxCKeditorsOnExerciseResultsPageComment',
  426. null,
  427. '',
  428. 1,
  429. true,
  430. false,
  431. array()
  432. );
  433. // Default upload option
  434. //$_configuration['document_if_file_exists_option'] = 'rename'; // overwrite
  435. $value = $this->getConfigurationValue('document_if_file_exists_option');
  436. $this->addSettingCurrent(
  437. 'document_if_file_exists_option',
  438. '',
  439. 'radio',
  440. 'Tools',
  441. ($value?$value:'rename'),
  442. 'DocumentDefaultOptionIfFileExistsTitle',
  443. 'DocumentDefaultOptionIfFileExistsComment',
  444. null,
  445. '',
  446. 1,
  447. true,
  448. false,
  449. [0 => ['value' => 'rename', 'text' => 'Rename'], 1 => ['value' => 'overwrite', 'text' => 'Overwrite']]
  450. );
  451. // Enable add_gradebook_certificates.php cron task
  452. //$_configuration['add_gradebook_certificates_cron_task_enabled'] = true;
  453. $value = $this->getConfigurationValue('add_gradebook_certificates_cron_task_enabled');
  454. $this->addSettingCurrent(
  455. 'add_gradebook_certificates_cron_task_enabled',
  456. '',
  457. 'radio',
  458. 'Tools',
  459. ($value?$value:'false'),
  460. 'GradebookCronTaskGenerationTitle',
  461. 'GradebookCronTaskGenerationComment',
  462. null,
  463. '',
  464. 1,
  465. true,
  466. false,
  467. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  468. );
  469. // Which OpenBadges backpack send the badges
  470. //$_configuration['openbadges_backpack'] = 'https://backpack.openbadges.org/';
  471. $value = $this->getConfigurationValue('openbadges_backpack');
  472. $this->addSettingCurrent(
  473. 'openbadges_backpack',
  474. '',
  475. 'textfield',
  476. 'Gradebook',
  477. ($value?$value:'https://backpack.openbadges.org/'),
  478. 'OpenBadgesBackpackUrlTitle',
  479. 'OpenBadgesBackpackUrlComment',
  480. null,
  481. '',
  482. 1,
  483. true,
  484. false,
  485. []
  486. );
  487. // Shows a warning message explaining that the site uses cookies
  488. //$_configuration['cookie_warning'] = false;
  489. $value = $this->getConfigurationValue('cookie_warning');
  490. $this->addSettingCurrent(
  491. 'cookie_warning',
  492. '',
  493. 'radio',
  494. 'Tools',
  495. ($value?$value:'false'),
  496. 'CookieWarningTitle',
  497. 'CookieWarningComment',
  498. null,
  499. '',
  500. 1,
  501. true,
  502. false,
  503. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  504. );
  505. // If there are any tool available and the user is not registered hide the group
  506. //$_configuration['hide_course_group_if_no_tools_available'] = false;
  507. $value = $this->getConfigurationValue('hide_course_group_if_no_tools_available');
  508. $this->addSettingCurrent(
  509. 'hide_course_group_if_no_tools_available',
  510. '',
  511. 'radio',
  512. 'Tools',
  513. ($value?$value:'false'),
  514. 'HideCourseGroupIfNoToolAvailableTitle',
  515. 'HideCourseGroupIfNoToolAvailableComment',
  516. null,
  517. '',
  518. 1,
  519. true,
  520. false,
  521. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  522. );
  523. // Allow student to enroll into a session without an approval needing
  524. //$_configuration['catalog_allow_session_auto_subscription'] = false;
  525. $value = $this->getConfigurationValue('catalog_allow_session_auto_subscription');
  526. $this->addSettingCurrent(
  527. 'catalog_allow_session_auto_subscription',
  528. '',
  529. 'radio',
  530. 'Session',
  531. ($value?$value:'false'),
  532. 'CatalogueAllowSessionAutoSubscriptionTitle',
  533. 'CatalogueAllowSessionAutoSubscriptionComment',
  534. null,
  535. '',
  536. 1,
  537. true,
  538. false,
  539. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  540. );
  541. // Decode UTF-8 from Web Services (option passed to SOAP)
  542. //$_configuration['registration.soap.php.decode_utf8'] = false;
  543. $value = $this->getConfigurationValue('registration.soap.php.decode_utf8');
  544. $this->addSettingCurrent(
  545. 'registration.soap.php.decode_utf8',
  546. '',
  547. 'radio',
  548. 'Platform',
  549. ($value?$value:'false'),
  550. 'SoapRegistrationDecodeUtf8Title',
  551. 'SoapRegistrationDecodeUtf8Comment',
  552. null,
  553. '',
  554. 1,
  555. true,
  556. false,
  557. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  558. );
  559. // Show delete option in attendance
  560. //$_configuration['allow_delete_attendance'] = false;
  561. $value = $this->getConfigurationValue('allow_delete_attendance');
  562. $this->addSettingCurrent(
  563. 'allow_delete_attendance',
  564. '',
  565. 'radio',
  566. 'Tools',
  567. ($value?$value:'false'),
  568. 'AttendanceDeletionEnableTitle',
  569. 'AttendanceDeletionEnableComment',
  570. null,
  571. '',
  572. 1,
  573. true,
  574. false,
  575. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  576. );
  577. // Enable Gravatar profile image if no local image has been given
  578. //$_configuration['gravatar_enabled'] = true;
  579. $value = $this->getConfigurationValue('gravatar_enabled');
  580. $this->addSettingCurrent(
  581. 'gravatar_enabled',
  582. '',
  583. 'radio',
  584. 'Platform',
  585. ($value?$value:'false'),
  586. 'GravatarPicturesTitle',
  587. 'GravatarPicturesComment',
  588. null,
  589. '',
  590. 1,
  591. true,
  592. false,
  593. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  594. );
  595. // If Gravatar is enabled, tells which type of picture we want (default is "mm").
  596. // Options: mm | identicon | monsterid | wavatar
  597. //$_configuration['gravatar_type'] = 'mm';
  598. $value = $this->getConfigurationValue('gravatar_type');
  599. $this->addSettingCurrent(
  600. 'gravatar_type',
  601. '',
  602. 'radio',
  603. 'Platform',
  604. ($value?$value:'mm'),
  605. 'GravatarPicturesTypeTitle',
  606. 'GravatarPicturesTypeComment',
  607. null,
  608. '',
  609. 1,
  610. true,
  611. false,
  612. [
  613. 0 => ['value' => 'mm', 'text' => 'mystery-man'],
  614. 1 => ['value' => 'identicon', 'text' => 'identicon'],
  615. 2 => ['value' => 'monsterid', 'text' => 'monsterid'],
  616. 3 => ['value' => 'wavatar', 'text' => 'wavatar']
  617. ]
  618. );
  619. // Limit for the Session Admin role. The administration page show only
  620. // User block -> Add user
  621. // Course Sessions block -> Training session list
  622. //$_configuration['limit_session_admin_role'] = false;
  623. $value = $this->getConfigurationValue('limit_session_admin_role');
  624. $this->addSettingCurrent(
  625. 'limit_session_admin_role',
  626. '',
  627. 'radio',
  628. 'Session',
  629. ($value?$value:'false'),
  630. 'SessionAdminPermissionsLimitTitle',
  631. 'SessionAdminPermissionsLimitComment',
  632. null,
  633. '',
  634. 1,
  635. true,
  636. false,
  637. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  638. );
  639. // Show session description
  640. //$_configuration['show_session_description'] = false;
  641. $value = $this->getConfigurationValue('show_session_description');
  642. $this->addSettingCurrent(
  643. 'show_session_description',
  644. '',
  645. 'radio',
  646. 'Session',
  647. ($value?$value:'false'),
  648. 'ShowSessionDescriptionTitle',
  649. 'ShowSessionDescriptionComment',
  650. null,
  651. '',
  652. 1,
  653. true,
  654. false,
  655. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  656. );
  657. // Hide only for students the link to export certificates to PDF
  658. //$_configuration['hide_certificate_export_link_students'] = false;
  659. $value = $this->getConfigurationValue('hide_certificate_export_link_students');
  660. $this->addSettingCurrent(
  661. 'hide_certificate_export_link_students',
  662. '',
  663. 'radio',
  664. 'Gradebook',
  665. ($value?$value:'false'),
  666. 'CertificateHideExportLinkStudentTitle',
  667. 'CertificateHideExportLinkStudentComment',
  668. null,
  669. '',
  670. 1,
  671. true,
  672. false,
  673. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  674. );
  675. // Hide for all user roles the link to export certificates to PDF
  676. //$_configuration['hide_certificate_export_link'] = false;
  677. $value = $this->getConfigurationValue('hide_certificate_export_link');
  678. $this->addSettingCurrent(
  679. 'hide_certificate_export_link',
  680. '',
  681. 'radio',
  682. 'Gradebook',
  683. ($value?$value:'false'),
  684. 'CertificateHideExportLinkTitle',
  685. 'CertificateHideExportLinkComment',
  686. null,
  687. '',
  688. 1,
  689. true,
  690. false,
  691. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  692. );
  693. // Hide session course coach in dropbox sent to user list
  694. //$_configuration['dropbox_hide_course_coach'] = false;
  695. $value = $this->getConfigurationValue('dropbox_hide_course_coach');
  696. $this->addSettingCurrent(
  697. 'dropbox_hide_course_coach',
  698. '',
  699. 'radio',
  700. 'Tools',
  701. ($value ? $value : 'false'),
  702. 'DropboxHideCourseCoachTitle',
  703. 'DropboxHideCourseCoachComment',
  704. null,
  705. '',
  706. 1,
  707. true,
  708. false,
  709. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  710. );
  711. $value = $this->getConfigurationValue('dropbox_hide_general_coach');
  712. $this->addSettingCurrent(
  713. 'dropbox_hide_general_coach',
  714. '',
  715. 'radio',
  716. 'Tools',
  717. ($value ? $value : 'false'),
  718. 'DropboxHideGeneralCoachTitle',
  719. 'DropboxHideGeneralCoachComment',
  720. null,
  721. '',
  722. 1,
  723. true,
  724. false,
  725. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  726. );
  727. // If SSO is used, the redirection to the master server is forced.
  728. //$_configuration['force_sso_redirect'] = false;
  729. $value = $this->getConfigurationValue('force_sso_redirect');
  730. $this->addSettingCurrent(
  731. 'sso_force_redirect',
  732. '',
  733. 'radio',
  734. 'Security',
  735. ($value?$value:'false'),
  736. 'SSOForceRedirectTitle',
  737. 'SSOForceRedirectComment',
  738. null,
  739. '',
  740. 1,
  741. true,
  742. false,
  743. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  744. );
  745. // Session course ordering in the the session view.
  746. // false = alphabetic order (default)
  747. // true = based in the session course list
  748. //$_configuration['session_course_ordering'] = false;
  749. $value = $this->getConfigurationValue('session_course_ordering');
  750. $this->addSettingCurrent(
  751. 'session_course_ordering',
  752. '',
  753. 'radio',
  754. 'Session',
  755. ($value?$value:'false'),
  756. 'SessionCourseOrderingTitle',
  757. 'SessionCourseOrderingComment',
  758. null,
  759. '',
  760. 1,
  761. true,
  762. false,
  763. [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
  764. );
  765. }
  766. /**
  767. * @param Schema $schema
  768. */
  769. public function down(Schema $schema)
  770. {
  771. $this->addSql("DELETE FROM settings_options WHERE variable IN ('session_course_ordering', 'sso_force_redirect', 'dropbox_hide_course_coach', 'hide_certificate_export_link', 'hide_certificate_export_link_students', 'show_session_description', 'limit_session_admin_role', 'gravatar_type', 'gravatar_enabled', 'allow_delete_attendance', 'registration.soap.php.decode_utf8', 'catalog_allow_session_auto_subscription', 'hide_course_group_if_no_tools_available', 'cookie_warning', 'openbadges_backpack', 'add_gradebook_certificates_cron_task_enabled', 'document_if_file_exists_option', 'exercise_max_ckeditors_in_page', 'certificate_filter_by_official_code', 'student_publication_to_take_in_gradebook', 'course_images_in_courses_list', 'redirect_admin_to_courses_list', 'hide_logout_button', 'allow_session_course_copy_for_teachers', 'lp_show_reduced_report', 'auto_detect_language_custom_pages', 'catalog_show_courses_sessions', 'course_catalog_hide_private', 'show_official_code_exercise_result_list', 'allow_lp_return_link', 'hide_scorm_export_link', 'hide_scorm_copy_link', 'hide_scorm_pdf_link', 'session_days_before_coach_access', 'session_days_after_coach_access', 'pdf_logo_header', 'order_user_list_by_official_code', 'email_alert_manager_on_new_quiz')");
  772. $this->addSql("DELETE FROM settings_current WHERE variable IN ('session_course_ordering', 'sso_force_redirect', 'dropbox_hide_course_coach', 'hide_certificate_export_link', 'hide_certificate_export_link_students', 'show_session_description', 'limit_session_admin_role', 'gravatar_type', 'gravatar_enabled', 'allow_delete_attendance', 'registration.soap.php.decode_utf8', 'catalog_allow_session_auto_subscription', 'hide_course_group_if_no_tools_available', 'cookie_warning', 'openbadges_backpack', 'add_gradebook_certificates_cron_task_enabled', 'document_if_file_exists_option', 'exercise_max_ckeditors_in_page', 'certificate_filter_by_official_code', 'student_publication_to_take_in_gradebook', 'course_images_in_courses_list', 'redirect_admin_to_courses_list', 'hide_logout_button', 'allow_session_course_copy_for_teachers', 'lp_show_reduced_report', 'auto_detect_language_custom_pages', 'catalog_show_courses_sessions', 'course_catalog_hide_private', 'show_official_code_exercise_result_list', 'allow_lp_return_link', 'hide_scorm_export_link', 'hide_scorm_copy_link', 'hide_scorm_pdf_link', 'session_days_before_coach_access', 'session_days_after_coach_access', 'pdf_logo_header', 'order_user_list_by_official_code', 'email_alert_manager_on_new_quiz')");
  773. $this->addSql('ALTER TABLE user DROP COLUMN last_login');
  774. }
  775. }