Fix message layout based in 1.11.x fix php warning, minor ui tweak

pull/3006/head
Julio Montoya 5 years ago
parent 29a537315c
commit 2361e4f8b0
  1. 20
      main/inc/ajax/message.ajax.php
  2. 6
      main/inc/lib/message.lib.php
  3. 1
      main/template/default/social/groups.html.twig
  4. 20
      main/template/default/social/inbox.html.twig
  5. 2
      main/template/default/social/profile.html.twig
  6. 23
      src/ThemeBundle/Resources/views/Layout/header.html.twig
  7. 24
      src/ThemeBundle/Resources/views/Layout/layout_one_col.html.twig

@ -17,18 +17,24 @@ switch ($action) {
$userId = api_get_user_id();
$listInbox = [];
if (api_get_setting('allow_message_tool') == 'true') {
$list = MessageManager::getNumberOfMessages(true, true);
$list = MessageManager::getMessageData(
0,
10,
null,
null,
['actions' => ['read'], 'type' => MessageManager::MESSAGE_TYPE_INBOX]
);
foreach ($list as $row) {
$user = api_get_user_info($row['user_sender_id']);
$temp['title'] = $row['title'];
$temp['date'] = $row['send_date'];
$user = api_get_user_info($row['0']);
$temp['title'] = $row['1'];
$temp['date'] = $row['2'];
$temp['fullname'] = $user['complete_name'];
$temp['email'] = $user['email'];
$temp['url'] = api_get_path(WEB_PATH).'main/messages/view_message.php?id='.$row['id'];
$temp['url'] = $row['1'];
$listInbox[] = $temp;
}
}
header("Content-type:application/json");
header('Content-type:application/json');
echo json_encode($listInbox);
break;
case 'get_notifications_friends':
@ -50,7 +56,7 @@ switch ($action) {
$listInvitations[] = $temp;
}
}
header("Content-type:application/json");
header('Content-type:application/json');
echo json_encode($listInvitations);
break;
case 'get_count_message':

@ -15,9 +15,9 @@ use ChamiloSession as Session;
*/
class MessageManager
{
const MESSAGE_TYPE_INBOX = 1;
const MESSAGE_TYPE_OUTBOX = 2;
const MESSAGE_TYPE_PROMOTED = 3;
public const MESSAGE_TYPE_INBOX = 1;
public const MESSAGE_TYPE_OUTBOX = 2;
public const MESSAGE_TYPE_PROMOTED = 3;
/**
* Get count new messages for the current user from the database.

@ -1,3 +1,4 @@
{% extends '@ChamiloTheme/Layout/layout_one_col.html.twig' %}
{% import '@ChamiloTheme/Macros/box.html.twig' as macro %}
{% block content %}

@ -1,3 +1,17 @@
{% autoescape false %}
{{ content_inbox }}
{% endautoescape %}
{% extends '@ChamiloTheme/Layout/layout_one_col.html.twig' %}
{% block content %}
{% autoescape false %}
<div class="row">
<div class="col-md-3">
<div class="social-network-menu">
{{ social_avatar_block }}
{{ social_menu_block }}
</div>
</div>
<div class="col-md-9">
{{ social_right_content }}
</div>
</div>
{% endautoescape %}
{% endblock %}

@ -1,4 +1,4 @@
{% extends '@ChamiloTheme/Layout/layout_one_col.html.twig' %}
{% import '@ChamiloTheme/Macros/box.html.twig' as macro %}
{% block content %}

@ -165,6 +165,12 @@ $(function () {
<div class="dropdown-header text-center">
<strong>Settings</strong>
</div>
<a class="dropdown-item" href="{{ url('legacy_main', { 'name' : 'auth/profile.php' }) }}">
<i class="fa fa-user"></i>
{{ "My profile"|trans }}
</a>
<a class="dropdown-item" href="{{ url('legacy_main', { 'name' : 'survey/pending.php' }) }}">
<i class="fa fa-chart-pie"></i> {{ 'PendingSurveys'|trans }}
</a>
@ -173,17 +179,14 @@ $(function () {
<i class="fa fa-graduation-cap" aria-hidden="true"></i>
{{ "MyCertificates"|trans }}
</a>
<a class="dropdown-item" href="{{ url('legacy_main', { 'name' : 'messages/inbox.php' }) }}">
<i class="fa fa-envelope" aria-hidden="true"></i>
{{ "Inbox"|trans }}
<span class="badge badge-success">42</span>
</a>
<a class="dropdown-item" href="{{ url('legacy_main', { 'name' : 'auth/profile.php' }) }}">
<i class="fa fa-user"></i>
{{ "Edit profile"|trans }}
</a>
{# <a class="dropdown-item" href="{{ url('legacy_main', { 'name' : 'messages/inbox.php' }) }}">#}
{# <i class="fa fa-envelope" aria-hidden="true"></i>#}
{# {{ "Inbox"|trans }}#}
{# <span class="badge badge-success">42</span>#}
{# </a>#}
<a class="dropdown-item" href="#">
<i class="fa fa-wrench"></i> {{ "Configuration"|trans }}
<i class="fa fa-wrench"></i> {{ "Administration"|trans }}
</a>
<a class="dropdown-item" id="logout_button" title="{{ "Logout"|trans }}"

@ -36,21 +36,17 @@
{% endblock %}
<section class="container-fluid">
<div class="mb-4">
<div id="card-container">
{% if introduction != '' %}
{{ introduction }}
{% endif %}
{% if introduction != '' %}
{{ introduction }}
{% endif %}
{% if actions != '' %}
{{ actions }}
{% endif %}
{# Content #}
{% block content %}
{{ content }}
{% endblock %}
</div>
</div>
{% if actions != '' %}
{{ actions }}
{% endif %}
{# Content #}
{% block content %}
{{ content }}
{% endblock %}
</section>
{% endautoescape %}
</section>

Loading…
Cancel
Save