diff --git a/main/inc/lib/message.lib.php b/main/inc/lib/message.lib.php
index 34ba8257de..f13da2348a 100755
--- a/main/inc/lib/message.lib.php
+++ b/main/inc/lib/message.lib.php
@@ -226,7 +226,7 @@ class MessageManager
}
// validating fields
- if (empty($subject)) {
+ if (empty($subject) && empty($group_id) ) {
return get_lang('YouShouldWriteASubject');
} else if ($total_filesize > intval(api_get_setting('message_max_upload_filesize'))) {
return sprintf(get_lang("FilesSizeExceedsX"),format_file_size(api_get_setting('message_max_upload_filesize')));
@@ -239,9 +239,10 @@ class MessageManager
$content = Database::escape_string($content);
//message in inbox for user friend
- //@todo is possible to edit a message??????????
+ //@todo it's possible to edit a message? yes, only for groups
if ($edit_message_id) {
- $query = " UPDATE $table_message SET update_date = '".api_get_utc_datetime()."', title = '$subject', content = '$content' WHERE id = '$edit_message_id' ";
+ //title = '$subject',
+ $query = " UPDATE $table_message SET update_date = '".api_get_utc_datetime()."', content = '$content' WHERE id = '$edit_message_id' ";
$result = Database::query($query);
$inbox_last_id = $edit_message_id;
} else {
@@ -855,13 +856,12 @@ class MessageManager
*/
public static function display_messages_for_group($group_id) {
global $my_group_role;
- $rows = self::get_messages_by_group($group_id);
-
+ $rows = self::get_messages_by_group($group_id);
$rows = self::calculate_children($rows);
$group_info = GroupPortalManager::get_group_data($group_id);
$current_user_id = api_get_user_id();
- $topics_per_page = 5;
- $items_per_page = 3;
+ $topics_per_page = 5;
+ $items_per_page = 10;
$count_items = 0;
$html_messages = '';
$query_vars = array('id'=>$group_id,'topics_page_nr'=>0);
@@ -893,15 +893,18 @@ class MessageManager
$html .= '
';
- $html .= '
';
+ /*$html .= '';
$html .= ''.(((isset($_GET['anchor_topic']) && $_GET['anchor_topic'] == 'topic_'.$topic['id']) || in_array('items_'.$topic['id'].'_page_nr',$param_names))?Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align: middle')):
Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align: middle'))).'
'.Security::remove_XSS($topic['title']).'';
- $html .= '';
+ $html .= '';*/
+
+
+ $html .= '
'.Security::remove_XSS($topic['title']).'
';
if ($topic['send_date']!=$topic['update_date']) {
if (!empty($topic['update_date']) && $topic['update_date'] != '0000-00-00 00:00:00' ) {
- $html .= '
('.get_lang('LastUpdate').' '.date_to_str_ago($topic['update_date']).')';
+ $html .= '
'.get_lang('LastUpdate').' '.date_to_str_ago($topic['update_date']).'';
}
} else {
$html .= '
'.get_lang('Created').' '.date_to_str_ago($topic['send_date']).'';
@@ -909,7 +912,7 @@ class MessageManager
$html .= '
';
$html .= '
';
- $html.= '
';
+ $html.= '
';
$html.= '
'.Display :: return_icon('talk.png', get_lang('Reply')).'';
diff --git a/main/social/groups.php b/main/social/groups.php
index a6097cc5ef..44e6546d84 100755
--- a/main/social/groups.php
+++ b/main/social/groups.php
@@ -19,7 +19,6 @@ require_once api_get_path(LIBRARY_PATH).'social.lib.php';
require_once api_get_path(LIBRARY_PATH).'message.lib.php';
require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
-
$this_section = SECTION_SOCIAL;
//jquery thickbox already called from main/inc/header.inc.php
@@ -93,12 +92,10 @@ jQuery(document).ready(function() {
});
$("#tabs").tabs();
$("#tab_browse").tabs();
-
+ var valor = "'.$anchor.'";
- var valor = "'.$anchor.'";
-
- $(".head").click(function() {
+ $(".head").click(function() {
$(this).next().next().slideToggle("fast");
image_clicked = $("#" + this.id + " img").attr("src");
image_clicked_info = image_clicked.split("/");
@@ -265,7 +262,7 @@ if ($group_id != 0 ) {
echo '
';
echo '
';
//Group's title
- echo '
';
+ echo '
';
//Group's description
echo '
'.$group_info['description'].'
';
echo '
';
@@ -279,10 +276,11 @@ if ($group_id != 0 ) {
}
echo '
';
if (!empty($relation_group_title)) {
+ /*
echo '
';
echo ''.get_lang('StatusInThisGroup').' : ';
echo $relation_group_title;
- echo '
';
+ echo '
';*/
}
//Group's tags
if (!empty($tags)) {
@@ -334,11 +332,7 @@ if ($group_id != 0 ) {
$member_content .= '
';
$i++;
}
- }
- //if (count($members) > $min_count_members) {
- //More link
- //}
- //$member_content .= '
';
+ }
}
$headers = array(get_lang('Messages'), get_lang('Members'));
echo Display::tabs($headers, array($content, $member_content),'tabs');
diff --git a/main/social/message_for_group_form.inc.php b/main/social/message_for_group_form.inc.php
index b497474e73..acfdbbfbc9 100755
--- a/main/social/message_for_group_form.inc.php
+++ b/main/social/message_for_group_form.inc.php
@@ -89,7 +89,8 @@ $page_topic = !empty($_GET['topics_page_nr'])?intval($_GET['topics_page_nr']):1
?>
:
-
+
*
'.$group_info['name'].'
'; + echo ''.$group_info['name'].'
'; //Group's description echo '