From ca7d268f3bf3a4f9aee3ff18bfce63fdefe32131 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 23 Feb 2015 15:36:21 +0100 Subject: [PATCH] Ckeditor - Fix old fckeditor calls see BT#8968 --- plugin/ticket/src/myticket.php | 4 +- plugin/ticket/src/new_ticket.php | 53 +++++++++++------------ plugin/ticket/src/ticket_details.php | 64 ++++++++++++++-------------- 3 files changed, 58 insertions(+), 63 deletions(-) diff --git a/plugin/ticket/src/myticket.php b/plugin/ticket/src/myticket.php index be790b941b..37312022ad 100755 --- a/plugin/ticket/src/myticket.php +++ b/plugin/ticket/src/myticket.php @@ -5,9 +5,7 @@ * This script is the Tickets plugin main entry point * @package chamilo.plugin.ticket */ -/** - * Initialization - */ + $language_file = array('messages', 'userInfo', 'admin'); $cidReset = true; //needed in order to load the plugin lang variables diff --git a/plugin/ticket/src/new_ticket.php b/plugin/ticket/src/new_ticket.php index 5426f8379e..af3c273309 100755 --- a/plugin/ticket/src/new_ticket.php +++ b/plugin/ticket/src/new_ticket.php @@ -1,12 +1,9 @@ function load_course_list (div_course, my_user_id, user_email) { $.ajax({ - contentType: "application/x-www-form-urlencoded", - type: "GET", - url: "course_user_list.php", - data: "user_id="+my_user_id, - success: function(datos) { - $("#user_request").html(datos); - $("#user_id_request").val(my_user_id); - $("#personal_email").val(user_email); - $("#btnsubmit").attr("disabled", false); - ' . $scrollTol . ' - } + contentType: "application/x-www-form-urlencoded", + type: "GET", + url: "course_user_list.php", + data: "user_id="+my_user_id, + success: function(datos) { + $("#user_request").html(datos); + $("#user_id_request").val(my_user_id); + $("#personal_email").val(user_email); + $("#btnsubmit").attr("disabled", false); + ' . $scrollTol . ' + } }); } function changeType() { @@ -49,18 +46,18 @@ function changeType() { $("#project_id").val(projects[id]); $("#other_area").val(other_area[id]); $("#email").val(email[id]); - if(parseInt(course_required[id]) == 0){ - $("#divCourse").css("display", "none"); - if( id != "CUR"){ - $("#divEmail").css("display", "block"); - $("#personal_email").attr("required","required"); - } - $("#course_id").disabled = true; - $("#course_id").value = 0; - }else{ - $("#divCourse").css("display", "block"); - $("#course_id").prop("disabled", false); - $("#course_id").val(0); + if (parseInt(course_required[id]) == 0){ + $("#divCourse").css("display", "none"); + if( id != "CUR"){ + $("#divEmail").css("display", "block"); + $("#personal_email").attr("required","required"); + } + $("#course_id").disabled = true; + $("#course_id").value = 0; + } else { + $("#divCourse").css("display", "block"); + $("#course_id").prop("disabled", false); + $("#course_id").val(0); } } function handleClick2(myRadio) { @@ -70,7 +67,7 @@ function handleClick2(myRadio) { } function validate() { var re = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/; - fckEditor1val = FCKeditorAPI.__Instances["content"].GetHTML(); + fckEditor1val = CKEDITOR.instances["content"].getData(); document.getElementById("content").value= fckEditor1val; var selected = document.getElementById("category_id").selectedIndex; var id = document.getElementById("category_id").options[selected].value; diff --git a/plugin/ticket/src/ticket_details.php b/plugin/ticket/src/ticket_details.php index a83bf6b2b7..69a61456e0 100755 --- a/plugin/ticket/src/ticket_details.php +++ b/plugin/ticket/src/ticket_details.php @@ -40,11 +40,11 @@ $(document).ready(function(){ } } }); - + $("a#assign").click(function () { $( "#dialog-form" ).dialog( "open" ); }); - + $("input#responseyes").click(function () { if(!confirm("' . $plugin->get_lang('AreYouSure') . ' : ' . strtoupper(get_lang('Yes')) . '. ' . $plugin->get_lang('IfYouAreSureTheTicketWillBeClosed') . '")){ return false; @@ -73,7 +73,7 @@ $(document).ready(function(){ }); function validate() { - fckEditor1val = FCKeditorAPI.__Instances["content"].GetHTML(); + fckEditor1val = CKEDITOR.instances["content"].getData(); document.getElementById("content").value= fckEditor1val; if(fckEditor1val == ""){ alert("' . $plugin->get_lang('YouMustWriteAMessage') . '"); @@ -106,7 +106,7 @@ function add_image_form() { id: new_elem, class: "controls" }).appendTo(filepaths); - + input_file = $("", { type: "file", name: "attach_" + counter_image, @@ -124,7 +124,7 @@ function add_image_form() { new_filepath_id = $("#filepath_" + counter_image); new_filepath_id.append(input_file, link_remove.append(img_remove)); - + if (counter_image === 6) { var link_attach = $("#link-more-attach"); if (link_attach) { @@ -330,7 +330,7 @@ if (!isset($_POST['compose'])) { echo "
"; foreach ($messages as $message) { $type = "success"; - + if ($message['admin']) { $type = "normal"; if ($isAdmin) { @@ -339,10 +339,10 @@ if (!isset($_POST['compose'])) { }else { $message['message'].='' . get_lang('Sent') . ': ' . api_convert_and_format_date(api_get_local_time($message['sys_insert_datetime']), DATE_TIME_FORMAT_LONG, _api_get_timezone()) . ""; } - + $receivedMessage = '' . get_lang('Subject') . ': ' . $message['subject'] . '
' . get_lang('Message') . ':' . $message['message'] . '
'; $attachementLinks = ""; - + if (isset($message['atachments'])) { $attributeClass = array( 'class' => 'attachment-link' @@ -351,7 +351,7 @@ if (!isset($_POST['compose'])) { $attachementLinks .= Display::tag('div', $attach['attachment_link'], $attributeClass); } } - + $entireMessage = $receivedMessage . $attachementLinks; echo Display::return_message($entireMessage, $type, false); } @@ -386,11 +386,11 @@ function show_form_send_message() global $ticket; global $subject; global $plugin; - + Display::div('', array('span2')); - + $form = new FormValidator( - 'send_ticket', + 'send_ticket', 'POST', api_get_self() . '?ticket_id=' . $ticket['ticket']['ticket_id'], '', @@ -400,32 +400,32 @@ function show_form_send_message() 'class' => 'span9 offset1 form-horizontal' ) ); - + $form->addElement( - 'text', - 'subject', - get_lang('Subject'), + 'text', + 'subject', + get_lang('Subject'), array( - 'for' => 'subject', + 'for' => 'subject', 'value' => $subject, 'style' => 'width: 540px;' ) ); - + $form->addElement('hidden', 'ticket_id', $_GET['ticket_id']); - + $form->add_html_editor( - 'content', + 'content', get_lang('Message'), - false, - false, + false, + false, array( - 'ToolbarSet' => 'Profile', - 'Width' => '550', + 'ToolbarSet' => 'Profile', + 'Width' => '550', 'Height' => '250' ) ); - + if ($isAdmin) { $form->addElement( 'checkbox', @@ -434,29 +434,29 @@ function show_form_send_message() $plugin->get_lang('RequestConfirmation') ); } - + $form->addElement('html', ''); $form->addElement('html', '
'); $form->addElement('file', 'attach_1', get_lang('FilesAttachment')); $form->addElement('html', '
'); $form->addElement('html', '
'); - + $form->addElement('html', '
'); $form->addElement('html', ''); $form->addElement('html', '' . get_lang('AddOneMoreFile') . ''); $form->addElement('html', ''); $form->addElement('html', '(' . sprintf(get_lang('MaximunFileSizeX'), format_file_size(api_get_setting('message_max_upload_filesize'))) . ')'); - + $form->addElement('html', '
'); $form->addElement( - 'button', - 'compose', - get_lang('SendMessage'), + 'button', + 'compose', + get_lang('SendMessage'), array( 'class' => 'save' ) ); - + $form->display(); }