Allow delete(clear) thematic plan item - refs BT#12440

remotes/angel/1.11.x
Angel Fernando Quiroz Campos 8 years ago
parent 3649e6af59
commit 48a01b9ce7
  1. 21
      main/course_progress/index.php
  2. 10
      main/course_progress/thematic_plan.php

@ -230,6 +230,27 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
$interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('NewThematicAdvance'));
}
if ($action == 'thematic_plan_list') {
$htmlHeadXtra[] = "
<script>
$(function () {
$('.btn-delete').on('click', function (e) {
e.preventDefault();
var id = $(this).data('id') || 0;
if (!id) {
return;
}
//$('[name=\"title[' + id + ']\"]').val('');
CKEDITOR.instances['description[' + id + ']'].setData('');
});
});
</script>
";
}
// Distpacher actions to controller
switch ($action) {
case 'thematic_add':

@ -45,8 +45,16 @@ if ($action === 'thematic_plan_list') {
$form->addElement('hidden', 'thematic_id', $thematic_id);
foreach ($default_thematic_plan_title as $id => $title) {
$btnDelete = Display::toolbarButton(
get_lang('Delete'),
'#',
'times',
'danger',
['role' => 'button', 'data-id' => $id, 'class' => 'btn-delete']
);
$form->addElement('hidden', 'description_type['.$id.']', $id);
$form->addText('title['.$id.']', get_lang('Title'), false, array('size'=>'50'));
$form->addText("title[$id]", [get_lang('Title'), null, $btnDelete], false);
$form->addHtmlEditor(
'description['.$id.']',
get_lang('Description'),

Loading…
Cancel
Save