Version20150522222222.php 29 KB

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