Ckeditor - Fix old fckeditor calls see BT#8968

1.10.x
Julio Montoya 10 years ago
parent 66961e94aa
commit ca7d268f3b
  1. 4
      plugin/ticket/src/myticket.php
  2. 53
      plugin/ticket/src/new_ticket.php
  3. 64
      plugin/ticket/src/ticket_details.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

@ -1,12 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.plugin.ticket
*/
/**
* INIT SECTION
*/
$language_file = array('messages', 'userInfo', 'admin');
$cidReset = true;
require_once '../config.php';
@ -30,17 +27,17 @@ $htmlHeadXtra[] = '
<script>
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;

@ -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 = $("<input/>", {
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 "<div class='span8 offset2'>";
foreach ($messages as $message) {
$type = "success";
if ($message['admin']) {
$type = "normal";
if ($isAdmin) {
@ -339,10 +339,10 @@ if (!isset($_POST['compose'])) {
}else {
$message['message'].='<b>' . get_lang('Sent') . ': ' . api_convert_and_format_date(api_get_local_time($message['sys_insert_datetime']), DATE_TIME_FORMAT_LONG, _api_get_timezone()) . "</b>";
}
$receivedMessage = '<b>' . get_lang('Subject') . ': </b> ' . $message['subject'] . '<br/> <b>' . get_lang('Message') . ':</b>' . $message['message'] . '<br/>';
$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', '<span id="filepaths">');
$form->addElement('html', '<div id="filepath_1">');
$form->addElement('file', 'attach_1', get_lang('FilesAttachment'));
$form->addElement('html', '</div>');
$form->addElement('html', '</span>');
$form->addElement('html', '<div class="controls">');
$form->addElement('html', '<span id="link-more-attach" >');
$form->addElement('html', '<span class="label label-info" onclick="return add_image_form()">' . get_lang('AddOneMoreFile') . '</span>');
$form->addElement('html', '</span>');
$form->addElement('html', '(' . sprintf(get_lang('MaximunFileSizeX'), format_file_size(api_get_setting('message_max_upload_filesize'))) . ')');
$form->addElement('html', '<br/>');
$form->addElement(
'button',
'compose',
get_lang('SendMessage'),
'button',
'compose',
get_lang('SendMessage'),
array(
'class' => 'save'
)
);
$form->display();
}

Loading…
Cancel
Save