specialty-tutor-edit.tpl 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <script type='text/javascript' src="../js/sepe.js"></script>
  2. <script type='text/javascript'>
  3. $(document).ready(function () {
  4. $("input[type='submit']").click(function(e){
  5. e.preventDefault();
  6. e.stopPropagation();
  7. if ( $("#slt_user_exists").val() == "1" ) {
  8. if ($("select[name='existingTutor']").val()=="") {
  9. alert("{{ 'SelectUserExistsMessage' | get_plugin_lang('SepePlugin') }}")
  10. } else {
  11. $("form").submit();
  12. }
  13. } else {
  14. var document_type = $("select[name='document_type']").val();
  15. var document_number = $("input[name='document_number']").val();
  16. var document_letter = $("input[name='document_letter']").val();
  17. var vplatform_user_id = $("select[name='platform_user_id']").val();
  18. if ($.trim(document_type)=='' || $.trim(document_number)=='' || $.trim(document_letter)=='') {
  19. alert("{{ 'RequiredTutorField' | get_plugin_lang('SepePlugin') }}");
  20. } else {
  21. if ($("input[name='new_tutor']" ).val()=="0") {
  22. $.post("function.php", {tab:"checkTutorEdit", type:document_type, number:document_number, letter:document_letter, platform_user_id:vplatform_user_id},
  23. function (data) {
  24. if (data.status == "false") {
  25. if (confirm(data.content)) {
  26. $("form").submit();
  27. }
  28. } else {
  29. $("form").submit();
  30. }
  31. }, "json");
  32. } else {
  33. $("form").submit();
  34. }
  35. }
  36. }
  37. });
  38. });
  39. </script>
  40. <link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
  41. <div class="row">
  42. <form class="form-horizontal" action="specialty-tutor-edit.php" method="post" name="form_specialty_action">
  43. <div class="col-md-3">
  44. <div id="course_category_well" class="well">
  45. <ul class="nav nav-list">
  46. <li class="nav-header"><h3>{{ 'Actions' | get_plugin_lang('SepePlugin') }}:</h3></li>
  47. <li>
  48. {% if new_tutor == "1" %}
  49. <input type="hidden" name="action_id" value="{{ action_id }}" />
  50. <input type="hidden" name="specialty_id" value="{{ specialty_id }}" />
  51. <input type="hidden" name="new_tutor" value="1" />
  52. {% else %}
  53. <input type="hidden" name="action_id" value="{{ action_id }}" />
  54. <input type="hidden" name="specialty_id" value="{{ specialty_id }}" />
  55. <input type="hidden" name="specialtyTutorId" value="{{ tutor_id }}" />
  56. <input type="hidden" name="new_tutor" value="0" />
  57. {% endif %}
  58. <input type="hidden" name="sec_token" value="{{ sec_token }}" />
  59. <input class="btn btn-primary sepe-btn-menu-side" type="submit" value="{{ 'SaveChanges' | get_plugin_lang('SepePlugin') }}" />
  60. </li>
  61. <li>
  62. <input class="btn btn-warning sepe-btn-menu-side" type="reset" value="{{ 'Reset' | get_plugin_lang('SepePlugin') }}" />
  63. </li>
  64. </ul>
  65. </div>
  66. </div>
  67. <div class="col-md-9">
  68. {% if message_info != "" %}
  69. <div class="alert alert-success">
  70. {{ message_info }}
  71. </div>
  72. {% endif %}
  73. {% if message_error != "" %}
  74. <div class="alert alert-danger">
  75. {{ message_error }}
  76. </div>
  77. {% endif %}
  78. {% if new_tutor == "1" %}
  79. <div class="well_border">
  80. <div class="form-group">
  81. <label class="control-label col-sm-3">{{ 'UseExistingTutor' | get_plugin_lang('SepePlugin') }}: </label>
  82. <div class="col-sm-9">
  83. <select id="slt_user_exists" class="form-control" name="slt_user_exists">
  84. <option value="1" selected="selected">{{ 'UseExisting' | get_plugin_lang('SepePlugin') }}</option>
  85. <option value="0">{{ 'CreateNewTutor' | get_plugin_lang('SepePlugin') }}</option>
  86. </select>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="well_border" id="tutors-list-layer">
  91. <fieldset>
  92. <legend>{{ 'TutorsList' | get_plugin_lang('SepePlugin') }}</legend>
  93. <div class="form-group">
  94. <label class="control-label col-sm-3">{{ 'Tutor' | get_plugin_lang('SepePlugin') }}: </label>
  95. <div class="col-sm-9">
  96. <select name="existingTutor" class="form-control">
  97. <option value=""></option>
  98. {% for tutor in ExistingTutorsList %}
  99. <option value="{{ tutor.id }}">{{ tutor.data }}</option>
  100. {% endfor %}
  101. </select>
  102. </div>
  103. </div>
  104. </fieldset>
  105. </div>
  106. <div class="well_border" style="display:none" id="tutor-data-layer">
  107. {% else %}
  108. <input type="hidden" name="slt_user_exists" value="0" />
  109. <div class="well_border" id="tutor-data-layer">
  110. {% endif %}
  111. <fieldset>
  112. <legend>{{ 'TutorTrainer' | get_plugin_lang('SepePlugin') }}</legend>
  113. <div class="well">
  114. <legend><h4>{{ 'TutorIdentifier' | get_plugin_lang('SepePlugin') | upper }}: </h4></legend>
  115. <div class="form-group">
  116. <label class="control-label col-sm-3">{{ 'DocumentType' | get_plugin_lang('SepePlugin') }}: </label>
  117. <div class="col-sm-9">
  118. <select name="document_type" class="form-control">
  119. <option value=""></option>
  120. {% if info.document_type == "D" %}
  121. <option value="D" selected="selected">{{ 'DocumentTypeD' | get_plugin_lang('SepePlugin') }}</option>
  122. {% else %}
  123. <option value="D">{{ 'DocumentTypeD' | get_plugin_lang('SepePlugin') }}</option>
  124. {% endif %}
  125. {% if info.document_type == "E" %}
  126. <option value="E" selected="selected">{{ 'DocumentTypeE' | get_plugin_lang('SepePlugin') }}</option>
  127. {% else %}
  128. <option value="E">{{ 'DocumentTypeE' | get_plugin_lang('SepePlugin') }}</option>
  129. {% endif %}
  130. {% if info.document_type == "U" %}
  131. <option value="U" selected="selected">{{ 'DocumentTypeU' | get_plugin_lang('SepePlugin') }}</option>
  132. {% else %}
  133. <option value="U">{{ 'DocumentTypeU' | get_plugin_lang('SepePlugin') }}</option>
  134. {% endif %}
  135. {% if info.document_type == "G" %}
  136. <option value="G" selected="selected">{{ 'DocumentTypeG' | get_plugin_lang('SepePlugin') }}</option>
  137. {% else %}
  138. <option value="G">{{ 'DocumentTypeG' | get_plugin_lang('SepePlugin') }}</option>
  139. {% endif %}
  140. {% if info.document_type == "W" %}
  141. <option value="W" selected="selected">{{ 'DocumentTypeW' | get_plugin_lang('SepePlugin') }}</option>
  142. {% else %}
  143. <option value="W">{{ 'DocumentTypeW' | get_plugin_lang('SepePlugin') }}</option>
  144. {% endif %}
  145. {% if info.document_type == "H" %}
  146. <option value="H" selected="selected">{{ 'DocumentTypeH' | get_plugin_lang('SepePlugin') }}</option>
  147. {% else %}
  148. <option value="H">{{ 'DocumentTypeH' | get_plugin_lang('SepePlugin') }}</option>
  149. {% endif %}
  150. </select>
  151. </div>
  152. </div>
  153. <div class="form-group">
  154. <label class="control-label col-sm-3">{{ 'DocumentNumber' | get_plugin_lang('SepePlugin') }}: </label>
  155. <div class="col-sm-2">
  156. <input class="form-control" type="text" name="document_number" value="{{ info.document_number }}" />
  157. </div>
  158. </div>
  159. <div class="form-group">
  160. <label class="control-label col-sm-3">{{ 'DocumentLetter' | get_plugin_lang('SepePlugin') }}: </label>
  161. <div class="col-sm-1">
  162. <input class="form-control" type="text" name="document_letter" value="{{ info.document_letter }}" />
  163. </div>
  164. </div>
  165. <div class="warning-message">
  166. {{ 'DocumentFormatMessage' | get_plugin_lang('SepePlugin') }}
  167. </div>
  168. </div>
  169. <div class="form-group">
  170. <label class="control-label col-sm-3">{{ 'TutorAccreditation' | get_plugin_lang('SepePlugin') }}: </label>
  171. <div class="col-sm-9">
  172. <input class="form-control" type="text" name="tutor_accreditation" value="{{ info.tutor_accreditation }}" style="width:100%" />
  173. <div class="alert alert-info sepe-message-info sepe-margin-top">{{ 'TutorAccreditationMessage' | get_plugin_lang('SepePlugin') }}</div>
  174. </div>
  175. </div>
  176. <div class="form-group">
  177. <label class="control-label col-sm-3">{{ 'ProfessionalExperience' | get_plugin_lang('SepePlugin') }}: </label>
  178. <div class="col-sm-2">
  179. <input class="form-control" class="sepe-numeric-field" type="number" name="professional_experience" value="{{ info.professional_experience }}" />
  180. </div>
  181. <div class="alert alert-info sepe-message-info col-sm-7">{{ 'ProfessionalExperienceMessage' | get_plugin_lang('SepePlugin') }}</div>
  182. </div>
  183. <div class="form-group">
  184. <label class="control-label col-sm-3">{{ 'TeachingCompetence' | get_plugin_lang('SepePlugin') }}: </label>
  185. <div class="col-sm-9">
  186. <select name="teaching_competence" class="form-control" >
  187. <option value=""></option>
  188. {% if info.teaching_competence == "01" %}
  189. <option value="01" selected="selected">{{ 'TeachingCompetence01' | get_plugin_lang('SepePlugin') }}</option>
  190. {% else %}
  191. <option value="01">{{ 'TeachingCompetence01' | get_plugin_lang('SepePlugin') }}</option>
  192. {% endif %}
  193. {% if info.teaching_competence == "02" %}
  194. <option value="02" selected="selected">{{ 'TeachingCompetence02' | get_plugin_lang('SepePlugin') }}</option>
  195. {% else %}
  196. <option value="02">{{ 'TeachingCompetence02' | get_plugin_lang('SepePlugin') }}</option>
  197. {% endif %}{% if info.teaching_competence == "03" %}
  198. <option value="03" selected="selected">{{ 'TeachingCompetence03' | get_plugin_lang('SepePlugin') }}</option>
  199. {% else %}
  200. <option value="03">{{ 'TeachingCompetence03' | get_plugin_lang('SepePlugin') }}</option>
  201. {% endif %}{% if info.teaching_competence == "04" %}
  202. <option value="04" selected="selected">{{ 'TeachingCompetence04' | get_plugin_lang('SepePlugin') }}</option>
  203. {% else %}
  204. <option value="04">{{ 'TeachingCompetence04' | get_plugin_lang('SepePlugin') }}</option>
  205. {% endif %}{% if info.teaching_competence == "05" %}
  206. <option value="05" selected="selected">{{ 'TeachingCompetence05' | get_plugin_lang('SepePlugin') }}</option>
  207. {% else %}
  208. <option value="05">{{ 'TeachingCompetence05' | get_plugin_lang('SepePlugin') }}</option>
  209. {% endif %}{% if info.teaching_competence == "06" %}
  210. <option value="06" selected="selected">{{ 'TeachingCompetence06' | get_plugin_lang('SepePlugin') }}</option>
  211. {% else %}
  212. <option value="06">{{ 'TeachingCompetence06' | get_plugin_lang('SepePlugin') }}</option>
  213. {% endif %}
  214. </select>
  215. </div>
  216. </div>
  217. <div class="form-group">
  218. <label class="control-label col-sm-3">{{ 'ExperienceTeleforming' | get_plugin_lang('SepePlugin') }}: </label>
  219. <div class="col-sm-2">
  220. <input class="form-control" type="number" name="experience_teleforming" value="{{ info.experience_teleforming }}" />
  221. </div>
  222. <div class="col-sm-7 alert alert-info sepe-message-info">{{ 'ExperienceTeleformingMessage' | get_plugin_lang('SepePlugin') }}</div>
  223. </div>
  224. <div class="form-group">
  225. <label class="control-label col-sm-3">{{ 'TrainingTeleforming' | get_plugin_lang('SepePlugin') }}: </label>
  226. <div class="col-sm-9">
  227. <select name="training_teleforming" class="form-control">
  228. <option value=""></option>
  229. {% if info.training_teleforming == "01" %}
  230. <option value="01" selected="selected">{{ 'TrainingTeleforming01' | get_plugin_lang('SepePlugin') }}</option>
  231. {% else %}
  232. <option value="01">{{ 'TrainingTeleforming01' | get_plugin_lang('SepePlugin') }}</option>
  233. {% endif %}
  234. {% if info.training_teleforming == "02" %}
  235. <option value="02" selected="selected">{{ 'TrainingTeleforming02' | get_plugin_lang('SepePlugin') }}</option>
  236. {% else %}
  237. <option value="02">{{ 'TrainingTeleforming02' | get_plugin_lang('SepePlugin') }}</option>
  238. {% endif %}
  239. {% if info.training_teleforming == "03" %}
  240. <option value="03" selected="selected">{{ 'TrainingTeleforming03' | get_plugin_lang('SepePlugin') }}</option>
  241. {% else %}
  242. <option value="03">{{ 'TrainingTeleforming03' | get_plugin_lang('SepePlugin') }}</option>
  243. {% endif %}
  244. {% if info.training_teleforming == "04" %}
  245. <option value="04" selected="selected">{{ 'TrainingTeleforming04' | get_plugin_lang('SepePlugin') }}</option>
  246. {% else %}
  247. <option value="04">{{ 'TrainingTeleforming04' | get_plugin_lang('SepePlugin') }}</option>
  248. {% endif %}
  249. </select>
  250. </div>
  251. </div>
  252. <div class="well sepe-subfield">
  253. <legend class="sepe-subfield">{{ 'PlatformTeacher' | get_plugin_lang('SepePlugin') | upper }}: </legend>
  254. <div class="form-group">
  255. <label class="control-label col-sm-3">{{ 'Teacher' | get_plugin_lang('SepePlugin') }}: </label>
  256. <div class="col-sm-9">
  257. <select name="platform_user_id" class="form-control">
  258. <option value="" selected="selected"></option>
  259. {% for teacher in listTeachers %}
  260. {% if info.platform_user_id == teacher.user_id %}
  261. <option value="{{ teacher.id }}" selected="selected">{{ teacher.firstname }} {{ teacher.lastname }}</option>
  262. {% else %}
  263. <option value="{{ teacher.id }}">{{ teacher.firstname }} {{ teacher.lastname }}</option>
  264. {% endif %}
  265. {% endfor %}
  266. </select>
  267. </div>
  268. </div>
  269. </div>
  270. </fieldset>
  271. </div>
  272. </form>
  273. </div>