insert_session_fields.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <?php
  2. /*
  3. * This script insert session extra fields
  4. */
  5. //exit;
  6. require_once '../../main/inc/global.inc.php';
  7. api_protect_admin_script();
  8. $teachingHours = new ExtraField('session');
  9. $teachingHours->save(array(
  10. 'field_type' => ExtraField::FIELD_TYPE_INTEGER,
  11. 'variable' => 'teaching_hours',
  12. 'display_text' => get_lang('TeachingHours'),
  13. 'visible' => 1,
  14. 'changeable' => 1
  15. ));
  16. $cost = new ExtraField('session');
  17. $cost->save(array(
  18. 'field_type' => ExtraField::FIELD_TYPE_FLOAT,
  19. 'variable' => 'cost',
  20. 'display_text' => get_lang('Cost'),
  21. 'visible' => 1,
  22. 'changeable' => 1
  23. ));
  24. $vacancies = new ExtraField('session');
  25. $vacancies->save(array(
  26. 'field_type' => ExtraField::FIELD_TYPE_INTEGER,
  27. 'variable' => 'vacancies',
  28. 'display_text' => get_lang('Vacancies'),
  29. 'visible' => 1,
  30. 'changeable' => 1
  31. ));
  32. $recommendedNumberOfParticipants = new ExtraField('session');
  33. $recommendedNumberOfParticipants->save(array(
  34. 'field_type' => ExtraField::FIELD_TYPE_INTEGER,
  35. 'variable' => 'recommended_number_of_participants',
  36. 'display_text' => get_lang('RecommendedNumberOfParticipants'),
  37. 'visible' => 1,
  38. 'changeable' => 1
  39. ));
  40. $place = new ExtraField('session');
  41. $place->save(array(
  42. 'field_type' => ExtraField::FIELD_TYPE_ALPHANUMERIC,
  43. 'variable' => 'place',
  44. 'display_text' => get_lang('Place'),
  45. 'visible' => 1,
  46. 'changeable' => 1
  47. ));
  48. $schedule = new ExtraField('session');
  49. $schedule->save(array(
  50. 'field_type' => ExtraField::FIELD_TYPE_TEXT,
  51. 'variable' => 'schedule',
  52. 'display_text' => get_lang('Schedule'),
  53. 'visible' => 1,
  54. 'changeable' => 1
  55. ));
  56. $allowVisitors = new ExtraField('session');
  57. $allowVisitors->save(array(
  58. 'field_type' => ExtraField::FIELD_TYPE_CHECKBOX,
  59. 'variable' => 'allow_visitors',
  60. 'display_text' => get_lang('AllowVisitors'),
  61. 'visible' => 1,
  62. 'changeable' => 1
  63. ));
  64. $modeOptions = array(
  65. get_lang('Online'),
  66. get_lang('Presencial'),
  67. get_lang('B-Learning')
  68. );
  69. $mode = new ExtraField('session');
  70. $mode->save(array(
  71. 'field_type' => ExtraField::FIELD_TYPE_SELECT,
  72. 'variable' => 'mode',
  73. 'display_text' => get_lang('Mode'),
  74. 'visible' => 1,
  75. 'changeable' => 1,
  76. 'field_options' => implode('; ', $modeOptions)
  77. ));
  78. $isInductionSession = new ExtraField('session');
  79. $isInductionSession->save(array(
  80. 'field_type' => ExtraField::FIELD_TYPE_CHECKBOX,
  81. 'variable' => 'is_induccion_session',
  82. 'display_text' => get_lang('IsInductionSession'),
  83. 'visible' => 1,
  84. 'changeable' => 1
  85. ));
  86. $isOpenSession = new ExtraField('session');
  87. $isOpenSession->save(array(
  88. 'field_type' => ExtraField::FIELD_TYPE_CHECKBOX,
  89. 'variable' => 'is_open_session',
  90. 'display_text' => get_lang('IsOpenSession'),
  91. 'visible' => 1,
  92. 'changeable' => 1
  93. ));
  94. $duration = new ExtraField('session');
  95. $duration->save(array(
  96. 'field_type' => ExtraField::FIELD_TYPE_LETTERS_ONLY,
  97. 'variable' => 'human_text_duration',
  98. 'display_text' => get_lang('DurationInWords'),
  99. 'visible' => 1,
  100. 'changeable' => 1
  101. ));
  102. $showStatusOptions = array(
  103. get_lang('Open'),
  104. get_lang('InProcess'),
  105. get_lang('Closed')
  106. );
  107. $showStatus = new ExtraField('session');
  108. $showStatus->save(array(
  109. 'field_type' => ExtraField::FIELD_TYPE_SELECT,
  110. 'variable' => 'show_status',
  111. 'display_text' => get_lang('ShowStatus'),
  112. 'visible' => 1,
  113. 'changeable' => 1,
  114. 'field_options' => implode('; ', $showStatusOptions)
  115. ));
  116. $publicationStartDate = new ExtraField('session');
  117. $publicationStartDate->save(array(
  118. 'field_type' => ExtraField::FIELD_TYPE_DATE,
  119. 'variable' => 'publication_start_date',
  120. 'display_text' => get_lang('PublicationStartDate'),
  121. 'visible' => 1,
  122. 'changeable' => 1
  123. ));
  124. $publicationEndDate = new ExtraField('session');
  125. $publicationEndDate->save(array(
  126. 'field_type' => ExtraField::FIELD_TYPE_DATE,
  127. 'variable' => 'publication_end_date',
  128. 'display_text' => get_lang('PublicationEndDate'),
  129. 'visible' => 1,
  130. 'changeable' => 1
  131. ));
  132. $banner = new ExtraField('session');
  133. $banner->save(array(
  134. 'field_type' => ExtraField::FIELD_TYPE_FILE_IMAGE,
  135. 'variable' => 'banner',
  136. 'display_text' => get_lang('SessionBanner'),
  137. 'visible' => 1,
  138. 'changeable' => 1
  139. ));
  140. $brochure = new ExtraField('session');
  141. $brochure->save(array(
  142. 'field_type' => ExtraField::FIELD_TYPE_FILE,
  143. 'variable' => 'brochure',
  144. 'display_text' => get_lang('Brochure'),
  145. 'visible' => 1,
  146. 'changeable' => 1
  147. ));
  148. $targetOptions = array(
  149. get_lang('Minedu'),
  150. get_lang('Regiones')
  151. );
  152. $target = new ExtraField('session');
  153. $target->save(array(
  154. 'field_type' => ExtraField::FIELD_TYPE_SELECT,
  155. 'variable' => 'target',
  156. 'display_text' => get_lang('Target'),
  157. 'visible' => 1,
  158. 'changeable' => 1,
  159. 'field_options' => implode('; ', $targetOptions)
  160. ));
  161. $shortDescription = new ExtraField('session');
  162. $shortDescription->save(array(
  163. 'field_type' => ExtraField::FIELD_TYPE_TEXT,
  164. 'variable' => 'short_description',
  165. 'display_text' => get_lang('ShortDescription'),
  166. 'visible' => 1,
  167. 'changeable' => 1
  168. ));
  169. $id = new ExtraField('session');
  170. $id->save(array(
  171. 'field_type' => ExtraField::FIELD_TYPE_TEXT,
  172. 'variable' => 'code',
  173. 'display_text' => get_lang('Code'),
  174. 'visible' => 1,
  175. 'changeable' => 1
  176. ));