[svn r18784] logic changes - allow to write title with quotes - (partial FS#3704)

skala
Isaac Flores 16 years ago
parent 85a00df7a5
commit 98edd78a8a
  1. 8
      main/inc/lib/message.lib.php
  2. 24
      main/messages/inbox.php
  3. 12
      main/messages/message.class.php
  4. 5
      main/messages/outbox.php
  5. 4
      main/messages/view_message.php
  6. 19
      main/social/index.php

@ -33,14 +33,14 @@ function inbox_display() {
$success= get_lang('SelectedMessagesDeleted').
"&nbsp
<br><a href=\"".
"../social/index.php$redirect\">".
"../social/index.php?$redirect\">".
get_lang('BackToInbox').
"</a>";
} else {
$success= get_lang('SelectedMessagesDeleted').
"&nbsp
<br><a href=\"".
"../social/index.php$redirect\">".
"../social/index.php?$redirect\">".
get_lang('BackToInbox').
"</a>";
}
@ -118,14 +118,14 @@ function outbox_display() {
$success= get_lang('SelectedMessagesDeleted').
"&nbsp
<br><a href=\"".
"../social/index.php$redirect\">".
"../social/index.php?$redirect\">".
get_lang('BackToOutbox').
"</a>";
}else {
$success= get_lang('SelectedMessagesDeleted').
"&nbsp
<br><a href=\"".
"../social/index.php$redirect\">".
"../social/index.php?$redirect\">".
get_lang('BackToOutbox').
"</a>";
}

@ -5,7 +5,7 @@
Copyright (c) 2009 Dokeos SPRL
Copyright (c) 2009 Julio Montoya Armas <gugli100@gmail.com>
Copyright (c) Facultad de Matematicas, UADY (M<EFBFBD>xico)
Copyright (c) Facultad de Matematicas, UADY (México)
Copyright (c) Evie, Free University of Brussels (Belgium)
Copyright (c) 2009 Isaac Flores Paz <isaac.flores@dokeos.com>
@ -72,28 +72,35 @@ function deselect_all(formita)
*/
$nameTools = get_lang('Messages');
$request=api_is_xml_http_request();
if (isset($_GET['form_reply']) || isset($_GET['form_delete'])) {
/***********************************************/
$info_reply=array();
$info_delete=array();
/***********************************************/
if ( isset($_GET['form_reply']) ) {
$info_reply=explode(',',$_GET['form_reply']);
$count_reply=count($info_reply);
$button_sent=urldecode($info_reply[4]);
}
/***********************************************/
if ( isset($_GET['form_delete']) ) {
$info_delete=explode(',',$_GET['form_delete']);
$count_delete=(count($info_delete)-1);
}
/***********************************************/
if ( isset($info_reply[4])) {
$title = $info_reply[0];
$content = $info_reply[1];
if ( isset($button_sent) ) {
$title = urldecode($info_reply[0]);
$content = urldecode($info_reply[1]);
$user_reply= $info_reply[2];
if (isset($info_reply[2]) && $info_reply[2]>0) {
if ( isset($user_reply) && $user_reply>0 && strlen($info_reply[0]) >0) {
MessageManager::send_message($user_reply, $title, $content);
MessageManager::display_success_message($user_reply);
exit;
} elseif($info_reply[2]==0) {
} elseif ( ($info_reply[2]==0) || strlen($info_reply[0])==0) {
$message_box=get_lang('ErrorSendingMessage').
'&nbsp;
<br /><a href="../social/index.php#remote-tab-2">'.
<br /><a href="../social/index.php?#remote-tab-2">'.
get_lang('BackToInbox').
'</a>';
Display::display_error_message($message_box,false);
@ -105,12 +112,13 @@ if ( isset($info_reply[4])) {
}
$message_box=get_lang('SelectedMessagesDeleted').
'&nbsp;
<br /><a href="../social/index.php#remote-tab-2">'.
<br /><a href="../social/index.php?#remote-tab-2">'.
get_lang('BackToInbox').
'</a>';
Display::display_normal_message($message_box,false);
exit;
}
}
if ($request===false) {
$interbreadcrumb[]= array (

@ -136,7 +136,7 @@ class MessageManager {
$request=api_is_xml_http_request();
$sql_query = "SELECT id as col0, user_sender_id as col1, title as col2, send_date as col3 FROM $table_message " .
"WHERE user_receiver_id=".api_get_user_id()." AND msg_status IN (0,1)" .
"ORDER BY col$column $direction LIMIT $from,$number_of_items";
"ORDER BY send_date desc, col$column $direction LIMIT $from,$number_of_items";
$sql_result = api_sql_query($sql_query,__FILE__,__LINE__);
$i = 0;
$message_list = array ();
@ -148,9 +148,9 @@ class MessageManager {
}
if ($request===true) {
$message[1] = mb_convert_encoding(GetFullUserName($result[1]),'UTF-8',$charset);
$message[2] = '<a onclick="get_action_url_and_show_messages(1,'.$result[0].')" href="javascript:void(0)">'.mb_convert_encoding($result[2],'UTF-8',$charset).'</a>';
$message[2] = '<a onclick="get_action_url_and_show_messages(1,'.$result[0].')" href="javascript:void(0)">'.str_replace("\\","",mb_convert_encoding($result[2],'UTF-8',$charset)).'</a>';
$message[4] = '<a onclick="reply_to_messages(\'show\','.$result[0].',\'\')" href="javascript:void(0)">'.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).'</a>'.
'&nbsp;&nbsp;<a onclick="delete_one_message('.$result[0].')" href="#../messages/inbox.php?rs=1&amp;action=deleteone&id='.$result[0].'" >'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).'</a>';
'&nbsp;&nbsp;<a onclick="delete_one_message('.$result[0].')" href="javascript:void(0)" >'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).'</a>';
} else {
$message[1] = GetFullUserName(($result[1]));
$message[2] = '<a href="view_message.php?id='.$result[0].'">'.$result[2].'</a>';
@ -266,7 +266,7 @@ class MessageManager {
}
if ($request===true) {
$message[1] = mb_convert_encoding(GetFullUserName($result[1]),'UTF-8',$charset);
$message[2] = '<a onclick="show_sent_message('.$result[0].')" href="javascript:void(0)">'.mb_convert_encoding($result[2],'UTF-8',$charset).'</a>';
$message[2] = '<a onclick="show_sent_message('.$result[0].')" href="javascript:void(0)">'.str_replace("\\","",mb_convert_encoding($result[2],'UTF-8',$charset)).'</a>';
$message[4] = '&nbsp;&nbsp;<a onclick="delete_one_message_outbox('.$result[0].')" href="javascript:void(0)" >'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).'</a>';
} else {
$message[1] = GetFullUserName($result[1]);
@ -330,7 +330,7 @@ class MessageManager {
<TABLE>
<TR>
<TD width="100%">
<TR> <h1>'.mb_convert_encoding($row[5],'UTF-8',$charset).'</h1></TR>
<TR> <h1>'.str_replace("\\","",mb_convert_encoding($row[5],'UTF-8',$charset)).'</h1></TR>
</TD>
<TR>
<TD>'.mb_convert_encoding(get_lang('From'),'UTF-8',$charset).'&nbsp;<b>'.GetFullUserName($row[1]).'</b> '.mb_convert_encoding(strtolower(get_lang('To')),'UTF-8',$charset).'&nbsp; <b>'.mb_convert_encoding(GetFullUserName($row[2]),'UTF-8',$charset).'</b> </TD>
@ -379,7 +379,7 @@ class MessageManager {
<TABLE>
<TR>
<TD width="100%">
<TR> <h1>'.mb_convert_encoding($row[5],'UTF-8',$charset).'</h1></TR>
<TR> <h1>'.str_replace("\\","",mb_convert_encoding($row[5],'UTF-8',$charset)).'</h1></TR>
</TD>
<TR>
<TD>'.mb_convert_encoding(get_lang('From'),'UTF-8',$charset).'&nbsp;<b>'.GetFullUserName($row[1]).'</b> '.mb_convert_encoding(strtolower(get_lang('To')),'UTF-8',$charset).'&nbsp; <b>'.mb_convert_encoding(GetFullUserName($row[2]),'UTF-8',$charset).'</b> </TD>

@ -5,7 +5,8 @@
Copyright (c) 2009 Dokeos SPRL
Copyright (c) 2009 Julio Montoya Armas <gugli100@gmail.com>
Copyright (c) Facultad de Matematicas, UADY (M<EFBFBD>xico)
Copyright (c) 2009 Isaac Flores Paz <florespaz@bidsoftperu.com>
Copyright (c) Facultad de Matematicas, UADY (México)
Copyright (c) Evie, Free University of Brussels (Belgium)
For a full list of contributors, see "credits.txt".
@ -99,7 +100,7 @@ if( trim($info_delete_outbox[0])=='delete' ) {
}
$message_box=get_lang('SelectedMessagesDeleted').
'&nbsp
<br><a href="../social/index.php#remote-tab-3">'.
<br><a href="../social/index.php?#remote-tab-3">'.
get_lang('BackToOutbox').
'</a>';
Display::display_normal_message($message_box,false);

@ -1,11 +1,11 @@
<?php // $Id: view_message.php 18698 2009-02-25 18:13:46Z cvargas1 $
<?php // $Id: view_message.php 18784 2009-03-03 21:02:25Z iflorespaz $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2009 Dokeos SPRL
Copyright (c) 2009 Julio Montoya Armas <gugli100@gmail.com>
Copyright (c) Facultad de Matematicas, UADY (M<EFBFBD>xico)
Copyright (c) Facultad de Matematicas, UADY (México)
Copyright (c) Evie, Free University of Brussels (Belgium)
Copyright (c) 2009 Isaac Flores Paz <isaac.flores.paz@gmail.com>
For a full list of contributors, see "credits.txt".

@ -391,7 +391,6 @@ code {
font-family: "Courier New", Courier, monospace;
}
</style>';
/*onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang('ConfirmDeleteMessage')))."'".')) return false;"*/
$_SESSION['social_exist']=true;
$_SESSION['social_dest'] = 'index.php';
$interbreadcrumb[]= array (
@ -405,14 +404,13 @@ $interbreadcrumb[]= array (
Display :: display_header('');
if (isset($_GET['sendform'])) {
$form_reply=array();
$params_url='?'.$_SERVER['argv'][0];
$form_reply[]=$_POST['title'];
$form_reply[]=$_POST['content'];
$form_reply[]=urlencode($_POST['title']);
$form_reply[]=urlencode($_POST['content']);
$form_reply[]=$_POST['user_list'];
$form_reply[]=$_POST['re_id'];
$form_reply[]=$_POST['compose'];
$form_reply[]=urlencode($_POST['compose']);
$form_info=implode(',',$form_reply);
$form_send_data_message="?form_reply=$form_info";
$form_send_data_message='?form_reply='.$form_info;
} elseif (isset($_GET['inbox'])) {
$form_delete=array();
$form_delete[]=$_POST['action'];
@ -420,7 +418,7 @@ if (isset($_GET['sendform'])) {
$form_delete[]=$_POST['id'][$i];
}
$form_info=implode(',',$form_delete);
$form_send_data_message="?form_delete=$form_info";
$form_send_data_message='?form_delete='.($form_info);
} elseif (isset($_GET['outbox'])) {
$form_delete_outbox=array();
$form_delete_outbox[]=$_POST['action'];
@ -428,8 +426,9 @@ if (isset($_GET['sendform'])) {
$form_delete_outbox[]=$_POST['out'][$i];
}
$form_info_outbox=implode(',',$form_delete_outbox);
$form_send_data_message="?form_delete_outbox=$form_info_outbox";
$form_send_data_message='?form_delete_outbox='.($form_info_outbox);
}
$form_url_send=isset($form_send_data_message) ? $form_send_data_message :'';
?>
<div id="container-9">
<ul>
@ -437,8 +436,8 @@ if (isset($_GET['sendform'])) {
<?php
if (api_get_setting('allow_message_tool')=='true') {
?>
<li><a href="../messages/inbox.php<?php echo $form_send_data_message; ?>"><span><?php echo get_lang('Inbox'); ?></span></a></li>
<li><a href="../messages/outbox.php<?php echo $form_send_data_message; ?>"><span><?php echo get_lang('Outbox'); ?></span></a></li>
<li><a href="../messages/inbox.php<?php echo $form_url_send; ?>"><span><?php echo get_lang('Inbox'); ?></span></a></li>
<li><a href="../messages/outbox.php<?php echo $form_url_send; ?>"><span><?php echo get_lang('Outbox'); ?></span></a></li>
<?php }
if (api_get_setting('allow_social_tool')=='true') {
?>

Loading…
Cancel
Save