Remove E_NOTICE and fix group

1.10.x
Angel Fernando Quiroz Campos 9 years ago
parent 87c15ccb83
commit 284de9eec2
  1. 2
      main/inc/lib/group_portal_manager.lib.php
  2. 30
      main/inc/lib/internationalization.lib.php
  3. 10
      main/inc/lib/message.lib.php
  4. 2
      main/inc/lib/usergroup.lib.php
  5. 15
      main/social/group_view.php
  6. 2
      main/social/groups.php
  7. 23
      main/social/message_for_group_form.inc.php
  8. 28
      main/template/default/social/avatar_block.tpl
  9. 3
      main/template/default/social/group_block.tpl

@ -1256,7 +1256,7 @@ class GroupPortalManager
break;
case GROUP_USER_PERMISSION_HRM:
$relation_group_title = get_lang('IAmAHRM');
$links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&action=add_message_group" class="ajax" data-title="'.get_lang('ComposeMessage').' title="'.get_lang('ComposeMessage').'">'.Display::return_icon('compose_message.png', get_lang('NewTopic'), array('hspace' => '6')).'<span class="social-menu-text4" >'.get_lang('NewTopic').'</span></a></li>';
$links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&action=add_message_group" class="ajax" data-size="lg" data-title="'.get_lang('ComposeMessage').' title="'.get_lang('ComposeMessage').'">'.Display::return_icon('compose_message.png', get_lang('NewTopic'), array('hspace' => '6')).'<span class="social-menu-text4" >'.get_lang('NewTopic').'</span></a></li>';
$links .= '<li><a href="group_view.php?id='.$group_id.'">'.Display::return_icon('message_list.png', get_lang('MessageList'), array('hspace' => '6')).'<span class="'.($show == 'messages_list' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('MessageList').'</span></a></li>';
$links .= '<li><a href="group_invitation.php?id='.$group_id.'">'.Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace' => '6')).'<span class="'.($show == 'invite_friends' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>';
$links .= '<li><a href="group_members.php?id='.$group_id.'">'.Display::return_icon('member_list.png', get_lang('MemberList'), array('hspace' => '6')).'<span class="'.($show == 'member_list' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('MemberList').'</span></a></li>';

@ -742,22 +742,26 @@ function date_to_str_ago($date)
$time %= $seconds;
}
if ($key_result[0] == $min_day && $key_result[1]== $min_minute) {
$key_result[1] = ' 0 '.$min_hours;
$str_result[0] = $time_result[0].' '.$key_result[0];
$str_result[1] = $key_result[1];
}
if (!empty($key_result)) {
if ($key_result[0] == $min_day && $key_result[1]== $min_minute) {
$key_result[1] = ' 0 '.$min_hours;
$str_result[0] = $time_result[0].' '.$key_result[0];
$str_result[1] = $key_result[1];
}
if ($key_result[0] == $min_year && ($key_result[1] == $min_day || $key_result[1] == $min_week)) {
$key_result[1] = ' 0 '.$min_months;
$str_result[0] = $time_result[0].' '.$key_result[0];
$str_result[1] = $key_result[1];
if ($key_result[0] == $min_year && ($key_result[1] == $min_day || $key_result[1] == $min_week)) {
$key_result[1] = ' 0 '.$min_months;
$str_result[0] = $time_result[0].' '.$key_result[0];
$str_result[1] = $key_result[1];
}
}
if (!empty($str_result[1])) {
$str = $str_result[0].', '.$str_result[1];
} else {
$str = $str_result[0];
if (!empty($str_result)) {
if (!empty($str_result[1])) {
$str = $str_result[0].', '.$str_result[1];
} else {
$str = $str_result[0];
}
}
date_default_timezone_set($system_timezone);

@ -1245,7 +1245,8 @@ class MessageManager
[
'class' => 'ajax btn btn-default',
'title' => get_lang('Edit'),
'data-title' => get_lang('Edit')
'data-title' => get_lang('Edit'),
'data-size' => 'lg'
]
);
}
@ -1268,7 +1269,8 @@ class MessageManager
[
'class' => 'ajax btn btn-default',
'title' => get_lang('Reply'),
'data-title' => get_lang('Reply')
'data-title' => get_lang('Reply'),
'data-size' => 'lg'
]
);
@ -1311,10 +1313,10 @@ class MessageManager
$links.= '<div id="message-reply-link">';
if (($my_group_role == GROUP_USER_PERMISSION_ADMIN || $my_group_role == GROUP_USER_PERMISSION_MODERATOR) || $topic['user_sender_id'] == $current_user_id) {
$links.= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=edit_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn" data-title="'.get_lang('Edit').'" title="'.get_lang('Edit').'">'.
$links.= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=edit_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn" data-size="lg" data-title="'.get_lang('Edit').'" title="'.get_lang('Edit').'">'.
Display :: return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>';
}
$links.= '&nbsp;&nbsp;<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=reply_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn" data-title="'.get_lang('Reply').'" title="'.get_lang('Reply').'">';
$links.= '&nbsp;&nbsp;<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=reply_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn" data-size="lg" data-title="'.get_lang('Reply').'" title="'.get_lang('Reply').'">';
$links.= Display :: return_icon('talk.png', get_lang('Reply')).'</a>';
$links.= '</div>';

@ -2020,7 +2020,7 @@ class UserGroup extends Model
break;
case GROUP_USER_PERMISSION_HRM:
$relation_group_title = get_lang('IAmAHRM');
$links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&action=add_message_group" class="ajax" title="'.get_lang('ComposeMessage').'" data-title="'.get_lang('ComposeMessage').'">'.
$links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&action=add_message_group" class="ajax" title="'.get_lang('ComposeMessage').'" data-size="lg" data-title="'.get_lang('ComposeMessage').'">'.
Display::return_icon('compose_message.png', get_lang('NewTopic'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('NewTopic').'</span></a></li>';
$links .= '<li><a href="group_view.php?id='.$group_id.'">'.
Display::return_icon('message_list.png', get_lang('MessageList'), array('hspace'=>'6')).'<span class="'.($show=='messages_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MessageList').'</span></a></li>';

@ -44,7 +44,7 @@ function remove_image_form(id_elem1) {
if (filepaths.childNodes.length < 3) {
var link_attach = document.getElementById("link-more-attach");
if (link_attach) {
link_attach.innerHTML=\'<a href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a>\';
link_attach.innerHTML=\'<a href="javascript://" class="btn btn-default" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a>\';
}
}
}
@ -62,7 +62,12 @@ function add_image_form() {
filepaths.appendChild(elem1);
id_elem1 = "filepath_"+counter_image;
id_elem1 = "\'"+id_elem1+"\'";
document.getElementById("filepath_"+counter_image).innerHTML = "<input type=\"file\" name=\"attach_"+counter_image+"\" size=\"20\" />&nbsp;<a href=\"javascript:remove_image_form("+id_elem1+")\"><img src=\"'.api_get_path(WEB_IMG_PATH).'delete.gif\"></a>";
document.getElementById("filepath_"+counter_image).innerHTML = "\n\
<input type=\"file\" name=\"attach_"+counter_image+"\" size=\"20\" />\n\
<a href=\"javascript:remove_image_form("+id_elem1+")\">\n\
<img src=\"' . api_get_path(WEB_IMG_PATH) . 'delete.gif\">\n\
</a>\n\
";
if (filepaths.childNodes.length == 3) {
var link_attach = document.getElementById("link-more-attach");
@ -199,7 +204,8 @@ if ($is_group_member || $group_info['visibility'] == GROUP_PERMISSION_OPEN) {
[
'class' => 'ajax btn btn-default',
'title' => get_lang('ComposeMessage'),
'data-title' => get_lang('ComposeMessage')
'data-title' => get_lang('ComposeMessage'),
'data-size' => 'lg'
]
);
} else {
@ -217,7 +223,8 @@ if ($is_group_member || $group_info['visibility'] == GROUP_PERMISSION_OPEN) {
[
'class' => 'ajax btn btn-default',
'title' => get_lang('ComposeMessage'),
'data-title' => get_lang('ComposeMessage')
'data-title' => get_lang('ComposeMessage'),
'data-size' => 'lg'
]
);
}

@ -123,6 +123,8 @@ foreach ($results as $result) {
$item_0 = Display::div($result['picture'], array('class'=>'box_description_group_image'));
$members = Display::span($count_users_group, array('class'=>'box_description_group_member'));
$item_1 = Display::div(Display::tag('h4', $url_open.$name.$url_close).$members, array('class'=>'box_description_group_title'));
$item_2 = '';
$item_3 = '';
if ($result['description'] != '') {
$item_3 = '<div class="box_description_group_content" >'.cut($result['description'],100,true).'</div>';

@ -84,14 +84,25 @@ if (api_get_setting('allow_message_tool')=='true') {
$config = ['ToolbarSet' => 'Messages'];
$form->addHtmlEditor('content', get_lang('Message'), true, false, $config);
$form->addElement('label', null, get_lang('AttachmentFiles'));
$form->addElement('label', null, '<div id="link-more-attach">
<a class="btn btn-default" href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a>'
$form->addElement(
'label',
get_lang('AttachmentFiles'),
'
<div id="link-more-attach">
<a class="btn btn-default" href="javascript://" onclick="return add_image_form()">
' . get_lang('AddOneMoreFile') . '
</a>
</div>
'
);
$form->addElement('html', '<span id="filepaths"></span>');
$form->addElement('file', 'attach_1', sprintf(get_lang('MaximunFileSizeX'), format_file_size(api_get_setting('message_max_upload_filesize'))));
$form->addElement('html', '</div>');
$form->addElement('label', null, '<div id="filepaths"></div>');
$form->addElement(
'file',
'attach_1',
sprintf(get_lang('MaximunFileSizeX'),
format_file_size(api_get_setting('message_max_upload_filesize')))
);
$form->addButtonSend(get_lang('SendMessage'));
$form->setDefaults(['content' => $message, 'title' => $subject]);

@ -1,19 +1,19 @@
<div class="social-profile">
<div class="social-profile thumbnail text-center">
{% if show_group %}
<div class="img-profile">
<a href="{{ _p.web_main ~ 'social/group_view.php?id=' ~ group_id }}">
<img src="{{ user_group_image.file }}" class="img-responsive img-circle">
</a>
</div>
<div class="group-title"><h4>{{ user_group.name }}</h4></div>
<div class="group-description">{{ user_group.description }}</div>
{% if user_is_group_admin %}
<div id="edit_image">
<a class="btn btn-default" href="{{ _p.web_main ~ 'social/group_edit.php?id=' ~ group_id }}">
{{ 'EditGroup'|get_lang }}
</a>
<img src="{{ user_group_image.file }}" class="img-profile img-responsive img-circle">
<div class="caption">
<h4 class="group-title">
<a href="{{ _p.web_main ~ 'social/group_view.php?id=' ~ group_id }}">{{ user_group.name }}</a>
</h4>
<p class="group-description">{{ user_group.description }}</p>
{% if user_is_group_admin %}
<div id="edit_image">
<a class="btn btn-default" href="{{ _p.web_main ~ 'social/group_edit.php?id=' ~ group_id }}">
{{ 'EditGroup'|get_lang }}
</a>
</div>
{% endif %}
</div>
{% endif %}
{% elseif show_user %}
<a href="{{ user_image.big }}" class="expand-image">
<img class="img-responsive img-circle" src="{{ user_image.normal }}">

@ -1,4 +1 @@
<div class="panel panel-default social-avatar">
{{ social_avatar_block }}
<p class="lead">{{ group_info.complete_name }}</p>
</div>

Loading…
Cancel
Save