list.tpl 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. <script>
  2. function confirmation(name) {
  3. if (confirm("{{ "AreYouSureToDeleteJS"|get_lang }} \"" + name + "\" ?")) {
  4. return true;
  5. } else {
  6. return false;
  7. }
  8. }
  9. </script>
  10. {% set configuration = 'lp_category_accordion'|api_get_configuration_value %}
  11. <div class="lp-accordion panel-group" id="lp-accordion" role="tablist" aria-multiselectable="true">
  12. {% for lp_data in data %}
  13. {% set show_category = true %}
  14. {% if filtered_category and filtered_category != lp_data.category.id %}
  15. {% set show_category = false %}
  16. {% endif %}
  17. {% if show_category %}
  18. {% if configuration == 0 %}
  19. <!--- old view -->
  20. {% if categories|length > 1 and lp_data.category.id %}
  21. {% if is_allowed_to_edit %}
  22. <h3 class="page-header">
  23. {{ lp_data.category.getName() | trim }}
  24. {% if lp_data.category.getId() > 0 %}
  25. {% if not _c.session_id %}
  26. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_lp_category&id=' ~ lp_data.category.getId() }}"
  27. title="{{ "Edit"|get_lang }}">
  28. <img src="{{ "edit.png"|icon }}" alt="{{ "Edit"|get_lang }}">
  29. </a>
  30. {% if subscription_settings.allow_add_users_to_lp_category %}
  31. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_users_to_category&id=' ~ lp_data.category.getId() }}"
  32. title="{{ "AddUsers"|get_lang }}">
  33. <img src="{{ "user.png"|icon }}" alt="{{ "AddUsers"|get_lang }}">
  34. </a>
  35. {% endif %}
  36. {% if loop.index0 == 1 %}
  37. <a href="#">
  38. <img src="{{ "up_na.png"|icon }}" alt="{{ "Move"|get_lang }}">
  39. </a>
  40. {% else %}
  41. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_up_category&id=' ~ lp_data.category.getId() }}"
  42. title="{{ "Move"|get_lang }}">
  43. <img src="{{ "up.png"|icon }}" alt="{{ "Move"|get_lang }}">
  44. </a>
  45. {% endif %}
  46. {% if (data|length - 1) == loop.index0 %}
  47. <a href="#">
  48. <img src="{{ "down_na.png"|icon }}" alt="{{ "Move"|get_lang }}">
  49. </a>
  50. {% else %}
  51. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_down_category&id=' ~ lp_data.category.getId() }}"
  52. title="{{ "Move"|get_lang }}">
  53. <img src="{{ "down.png"|icon }}" alt="{{ "Move"|get_lang }}">
  54. </a>
  55. {% endif %}
  56. {% endif %}
  57. {% if lp_data.category_visibility == 0 %}
  58. <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_visibility', 'id':lp_data.category.id, 'new_status':1}|url_encode }}"
  59. title="{{ 'Show'|get_lang }}">
  60. <img src="{{ 'invisible.png'|icon }}" alt="{{ 'Show'|get_lang }}">
  61. </a>
  62. {% else %}
  63. <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_visibility', 'id':lp_data.category.id, 'new_status':0}|url_encode }}"
  64. title="{{ 'Hide'|get_lang }}">
  65. <img src="{{ 'visible.png'|icon }}" alt="{{ 'Hide'|get_lang }}">
  66. </a>
  67. {% endif %}
  68. {% if lp_data.category_is_published == 0 %}
  69. <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':1}|url_encode }}"
  70. title="{{ 'LearnpathPublish'|get_lang }}">
  71. <img src="{{ 'lp_publish_na.png'|icon }}"
  72. alt="{{ 'LearnpathPublish'|get_lang }}">
  73. </a>
  74. {% else %}
  75. <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':0}|url_encode }}"
  76. title="{{ 'LearnpathDoNotPublish'|get_lang }}">
  77. <img src="{{ 'lp_publish.png'|icon }}" alt="{{ 'Hide'|get_lang }}">
  78. </a>
  79. {% endif %}
  80. {% if not _c.session_id %}
  81. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=delete_lp_category&id=' ~ lp_data.category.getId() }}"
  82. title="{{ "Delete"|get_lang }}">
  83. <img src="{{ "delete.png"|icon }}" alt="{{ "Delete"|get_lang }}">
  84. </a>
  85. {% endif %}
  86. {% endif %}
  87. </h3>
  88. {% elseif lp_data.lp_list is not empty %}
  89. <h3 class="page-header">{{ lp_data.category.getName() }}</h3>
  90. {% endif %}
  91. {% endif %}
  92. {% if lp_data.lp_list %}
  93. <div class="table-responsive">
  94. <table class="table table-hover table-striped">
  95. <thead>
  96. <tr>
  97. <th>
  98. {{ "Title"|get_lang }}
  99. </th>
  100. {% if is_allowed_to_edit %}
  101. <th>{{ "PublicationDate"|get_lang }}</th>
  102. <th>{{ "ExpirationDate"|get_lang }}</th>
  103. <th>{{ "Progress"|get_lang }}</th>
  104. {% if allow_min_time %}
  105. <th>{{ "TimeSpentTimeRequired"|get_lang }}</th>
  106. {% endif %}
  107. <th>{{ "AuthoringOptions"|get_lang }}</th>
  108. {% else %}
  109. {% if not is_invitee %}
  110. <th>{{ "Progress"|get_lang }}</th>
  111. {% endif %}
  112. {% if allow_min_time %}
  113. <th>{{ "TimeSpentTimeRequired"|get_lang }}</th>
  114. {% endif %}
  115. <th>{{ "Actions"|get_lang }}</th>
  116. {% endif %}
  117. </tr>
  118. </thead>
  119. <tbody>
  120. {% for row in lp_data.lp_list %}
  121. <tr>
  122. <td>
  123. {{ row.learnpath_icon }}
  124. <a href="{{ row.url_start }}">
  125. {{ row.title }}
  126. {{ row.session_image }}
  127. {{ row.extra }}
  128. </a>
  129. </td>
  130. {% if is_allowed_to_edit %}
  131. <td>
  132. {% if row.start_time %}
  133. <span class="small">{{ row.start_time }}</span>
  134. {% endif %}
  135. </td>
  136. <td>
  137. <span class="small">{{ row.end_time }}</span>
  138. </td>
  139. <td>
  140. {{ row.dsp_progress }}
  141. </td>
  142. {% if allow_min_time %}
  143. <td>
  144. {% if row.info_time_prerequisite %}
  145. {{ row.info_time_prerequisite }}
  146. {% endif %}
  147. </td>
  148. {% endif %}
  149. {% else %}
  150. {% if not is_invitee %}
  151. <td>
  152. {{ row.dsp_progress }}
  153. </td>
  154. {% endif %}
  155. {% if allow_min_time %}
  156. <td>
  157. {% if row.info_time_prerequisite %}
  158. {{ row.info_time_prerequisite }}
  159. {% endif %}
  160. </td>
  161. {% endif %}
  162. {% endif %}
  163. <td>
  164. {{ row.action_build }}
  165. {{ row.action_edit }}
  166. {{ row.action_visible }}
  167. {{ row.action_tracking }}
  168. {{ row.action_publish }}
  169. {{ row.action_subscribe_users }}
  170. {{ row.action_serious_game }}
  171. {{ row.action_reinit }}
  172. {{ row.action_default_view }}
  173. {{ row.action_debug }}
  174. {{ row.action_export }}
  175. {{ row.action_copy }}
  176. {{ row.action_auto_launch }}
  177. {{ row.action_pdf }}
  178. {{ row.action_delete }}
  179. {{ row.action_order }}
  180. {{ row.action_update_scorm }}
  181. {{ row.action_export_to_course_build }}
  182. </td>
  183. </tr>
  184. {% endfor %}
  185. </tbody>
  186. </table>
  187. </div>
  188. {% endif %}
  189. <!--- end old view -->
  190. {% else %}
  191. <!-- new view block accordeon -->
  192. {% if lp_data.category.id == 0 %}
  193. {% if is_allowed_to_edit %}
  194. {% if lp_data.lp_list %}
  195. <div class="table-responsive">
  196. <table class="table table-hover table-striped">
  197. <thead>
  198. <tr>
  199. <th>{{ "Title"|get_lang }}</th>
  200. {% if is_allowed_to_edit %}
  201. <th>{{ "PublicationDate"|get_lang }}</th>
  202. <th>{{ "ExpirationDate"|get_lang }}</th>
  203. <th>{{ "Progress"|get_lang }}</th>
  204. <th>{{ "AuthoringOptions"|get_lang }}</th>
  205. {% else %}
  206. {% if not is_invitee %}
  207. <th>{{ "Progress"|get_lang }}</th>
  208. {% endif %}
  209. <th>{{ "Actions"|get_lang }}</th>
  210. {% endif %}
  211. </tr>
  212. </thead>
  213. <tbody>
  214. {% for row in lp_data.lp_list %}
  215. <tr>
  216. <td>
  217. {{ row.learnpath_icon }}
  218. <a href="{{ row.url_start }}">
  219. {{ row.title }}
  220. {{ row.session_image }}
  221. {{ row.extra }}
  222. </a>
  223. </td>
  224. {% if is_allowed_to_edit %}
  225. <td>
  226. {% if row.start_time %}
  227. <span class="small">{{ row.start_time }}</span>
  228. {% endif %}
  229. </td>
  230. <td>
  231. <span class="small">{{ row.end_time }}</span>
  232. </td>
  233. <td>
  234. {{ row.dsp_progress }}
  235. </td>
  236. {% else %}
  237. {% if not is_invitee %}
  238. <td>
  239. {{ row.dsp_progress }}
  240. </td>
  241. {% endif %}
  242. {% endif %}
  243. <td>
  244. {{ row.action_build }}
  245. {{ row.action_edit }}
  246. {{ row.action_visible }}
  247. {{ row.action_tracking }}
  248. {{ row.action_publish }}
  249. {{ row.action_subscribe_users }}
  250. {{ row.action_serious_game }}
  251. {{ row.action_reinit }}
  252. {{ row.action_default_view }}
  253. {{ row.action_debug }}
  254. {{ row.action_export }}
  255. {{ row.action_copy }}
  256. {{ row.action_auto_launch }}
  257. {{ row.action_pdf }}
  258. {{ row.action_delete }}
  259. {{ row.action_order }}
  260. {{ row.action_update_scorm }}
  261. </td>
  262. </tr>
  263. {% endfor %}
  264. </tbody>
  265. </table>
  266. </div>
  267. {% endif %}
  268. {% else %}
  269. <div id="not-category" class="panel panel-default">
  270. <div class="panel-body">
  271. {% for row in lp_data.lp_list %}
  272. <div class="lp-item">
  273. <div class="row">
  274. <div class="col-md-8">
  275. <i class="fa fa-chevron-circle-right" aria-hidden="true"></i>
  276. <a href="{{ row.url_start }}">
  277. {{ row.title }}
  278. {{ row.session_image }}
  279. {{ row.extra }}
  280. </a>
  281. </div>
  282. <div class="col-md-3">
  283. {{ row.dsp_progress }}
  284. </div>
  285. <div class="col-md-1">
  286. {{ row.action_pdf }}
  287. </div>
  288. </div>
  289. </div>
  290. {% endfor %}
  291. </div>
  292. </div>
  293. {% endif %}
  294. {% endif %}
  295. {% if categories|length > 1 and lp_data.category.id %}
  296. <div class="panel panel-default">
  297. <div class="panel-heading" role="tab" id="heading-{{ lp_data.category.getId() }}">
  298. {% if is_allowed_to_edit %}
  299. <div class="tools-actions pull-right">
  300. {% if lp_data.category.getId() > 0 %}
  301. {% if not _c.session_id %}
  302. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_lp_category&id=' ~ lp_data.category.getId() }}"
  303. title="{{ "Edit"|get_lang }}">
  304. <img src="{{ "edit.png"|icon }}" alt="{{ "Edit"|get_lang }}">
  305. </a>
  306. {% if subscription_settings.allow_add_users_to_lp_category %}
  307. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_users_to_category&id=' ~ lp_data.category.getId() }}"
  308. title="{{ "AddUsers"|get_lang }}">
  309. <img src="{{ "user.png"|icon }}" alt="{{ "AddUsers"|get_lang }}">
  310. </a>
  311. {% endif %}
  312. {% if loop.index0 == 1 %}
  313. <a href="#">
  314. <img src="{{ "up_na.png"|icon }}" alt="{{ "Move"|get_lang }}">
  315. </a>
  316. {% else %}
  317. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_up_category&id=' ~ lp_data.category.getId() }}"
  318. title="{{ "Move"|get_lang }}">
  319. <img src="{{ "up.png"|icon }}" alt="{{ "Move"|get_lang }}">
  320. </a>
  321. {% endif %}
  322. {% if (data|length - 1) == loop.index0 %}
  323. <a href="#">
  324. <img src="{{ "down_na.png"|icon }}" alt="{{ "Move"|get_lang }}">
  325. </a>
  326. {% else %}
  327. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_down_category&id=' ~ lp_data.category.getId() }}"
  328. title="{{ "Move"|get_lang }}">
  329. <img src="{{ "down.png"|icon }}" alt="{{ "Move"|get_lang }}">
  330. </a>
  331. {% endif %}
  332. {% endif %}
  333. {% if lp_data.category_visibility == 0 %}
  334. <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_visibility', 'id':lp_data.category.id, 'new_status':1}|url_encode }}"
  335. title="{{ 'Show'|get_lang }}">
  336. <img src="{{ 'invisible.png'|icon }}" alt="{{ 'Show'|get_lang }}">
  337. </a>
  338. {% else %}
  339. <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_visibility', 'id':lp_data.category.id, 'new_status':0}|url_encode }}"
  340. title="{{ 'Hide'|get_lang }}">
  341. <img src="{{ 'visible.png'|icon }}" alt="{{ 'Hide'|get_lang }}">
  342. </a>
  343. {% endif %}
  344. {% if lp_data.category_visibility == 1 %}
  345. {% if lp_data.category_is_published == 0 %}
  346. <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':1}|url_encode }}"
  347. title="{{ 'LearnpathPublish'|get_lang }}">
  348. <img src="{{ 'lp_publish_na.png'|icon }}"
  349. alt="{{ 'LearnpathPublish'|get_lang }}">
  350. </a>
  351. {% else %}
  352. <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':0}|url_encode }}"
  353. title="{{ 'LearnpathDoNotPublish'|get_lang }}">
  354. <img src="{{ 'lp_publish.png'|icon }}" alt="{{ 'Hide'|get_lang }}">
  355. </a>
  356. {% endif %}
  357. {% else %}
  358. <img src="{{ 'lp_publish_na.png'|icon }}"
  359. alt="{{ 'LearnpathPublish'|get_lang }}">
  360. {% endif %}
  361. {% if not _c.session_id %}
  362. <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=delete_lp_category&id=' ~ lp_data.category.getId() }}"
  363. title="{{ "Delete"|get_lang }}">
  364. <img src="{{ "delete.png"|icon }}" alt="{{ "Delete"|get_lang }}">
  365. </a>
  366. {% endif %}
  367. {% endif %}
  368. </div>
  369. {% endif %}
  370. <h4 class="panel-title">
  371. <a role="button" data-toggle="collapse" data-parent="#lp-accordion"
  372. href="#collapse-{{ lp_data.category.getId() }}" aria-expanded="true"
  373. aria-controls="collapse-{{ lp_data.category.getId() }}">
  374. {{ lp_data.category.getName() }}
  375. </a>
  376. </h4>
  377. </div>
  378. {% set number = number + 1 %}
  379. <div id="collapse-{{ lp_data.category.getId() }}" class="panel-collapse collapse {{ (number == 1 ? 'in':'') }}"
  380. role="tabpanel" aria-labelledby="heading-{{ lp_data.category.getId() }}">
  381. <div class="panel-body">
  382. {% if lp_data.lp_list %}
  383. {% if is_allowed_to_edit %}
  384. <div class="table-responsive">
  385. <table class="table table-hover table-striped">
  386. <thead>
  387. <tr>
  388. <th>{{ "Title"|get_lang }}</th>
  389. {% if is_allowed_to_edit %}
  390. <th>{{ "PublicationDate"|get_lang }}</th>
  391. <th>{{ "ExpirationDate"|get_lang }}</th>
  392. <th>{{ "Progress"|get_lang }}</th>
  393. <th>{{ "AuthoringOptions"|get_lang }}</th>
  394. {% else %}
  395. {% if not is_invitee %}
  396. <th>{{ "Progress"|get_lang }}</th>
  397. {% endif %}
  398. <th>{{ "Actions"|get_lang }}</th>
  399. {% endif %}
  400. </tr>
  401. </thead>
  402. <tbody>
  403. {% for row in lp_data.lp_list %}
  404. <tr>
  405. <td>
  406. {{ row.learnpath_icon }}
  407. <a href="{{ row.url_start }}">
  408. {{ row.title }}
  409. {{ row.session_image }}
  410. {{ row.extra }}
  411. </a>
  412. </td>
  413. {% if is_allowed_to_edit %}
  414. <td>
  415. {% if row.start_time %}
  416. <span class="small">{{ row.start_time }}</span>
  417. {% endif %}
  418. </td>
  419. <td>
  420. <span class="small">{{ row.end_time }}</span>
  421. </td>
  422. <td>
  423. {{ row.dsp_progress }}
  424. </td>
  425. {% else %}
  426. {% if not is_invitee %}
  427. <td>
  428. {{ row.dsp_progress }}
  429. </td>
  430. {% endif %}
  431. {% endif %}
  432. <td>
  433. {{ row.action_build }}
  434. {{ row.action_edit }}
  435. {{ row.action_visible }}
  436. {{ row.action_tracking }}
  437. {{ row.action_publish }}
  438. {{ row.action_subscribe_users }}
  439. {{ row.action_serious_game }}
  440. {{ row.action_reinit }}
  441. {{ row.action_default_view }}
  442. {{ row.action_debug }}
  443. {{ row.action_export }}
  444. {{ row.action_copy }}
  445. {{ row.action_auto_launch }}
  446. {{ row.action_pdf }}
  447. {{ row.action_delete }}
  448. {{ row.action_order }}
  449. {{ row.action_update_scorm }}
  450. </td>
  451. </tr>
  452. {% endfor %}
  453. </tbody>
  454. </table>
  455. </div>
  456. {% else %}
  457. {% for row in lp_data.lp_list %}
  458. <div class="lp-item">
  459. <div class="row">
  460. <div class="col-md-8">
  461. <i class="fa fa-chevron-circle-right" aria-hidden="true"></i>
  462. <a href="{{ row.url_start }}">
  463. {{ row.title }}
  464. {{ row.session_image }}
  465. {{ row.extra }}
  466. </a>
  467. </div>
  468. <div class="col-md-3">
  469. {{ row.dsp_progress }}
  470. </div>
  471. <div class="col-md-1">
  472. {{ row.action_pdf }}
  473. </div>
  474. </div>
  475. </div>
  476. {% endfor %}
  477. {% endif %}
  478. {% endif %}
  479. </div>
  480. </div>
  481. </div>
  482. {% endif %}
  483. <!-- end view block accordeon -->
  484. {% endif %}
  485. {% endif %}
  486. {% endfor %}
  487. </div>
  488. {% if not is_invitee and lp_is_shown and allow_min_time %}
  489. <div class="controls text-center">
  490. {% if not is_ending %}
  491. <button class="btn btn-primary" type="button" disabled>
  492. {{ 'IHaveFinishedTheLessonsNotifyTheTeacher'|get_lang }}
  493. </button>
  494. {% else %}
  495. <a href="{{ web_self ~ "?" ~ _p.web_cid_query ~ "&action=send_notify_teacher" }}" class="btn btn-primary">
  496. {{ 'IHaveFinishedTheLessonsNotifyTheTeacher'|get_lang }}
  497. </a>
  498. {% endif %}
  499. </div>
  500. {% endif %}
  501. {% if is_allowed_to_edit and not lp_is_shown %}
  502. <div id="no-data-view">
  503. <h2>{{ "LearningPaths"|get_lang }}</h2>
  504. <img src="{{ "scorms.png"|icon(64) }}" width="64" height="64">
  505. <div class="controls">
  506. <a href="{{ web_self ~ "?" ~ _p.web_cid_query ~ "&action=add_lp" }}" class="btn btn-default">
  507. {{ "LearnpathAddLearnpath"|get_lang }}
  508. </a>
  509. </div>
  510. </div>
  511. {% endif %}