UI improvements see BT#12815

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 8b2d6b9d1f
commit 589df455f4
  1. 19
      plugin/studentfollowup/my_students.php
  2. 5
      plugin/studentfollowup/view/my_students.html.twig
  3. 3
      plugin/studentfollowup/view/post.html.twig

@ -57,12 +57,28 @@ if (!empty($userList) || api_is_platform_admin()) {
; ;
if (!empty($keyword)) { if (!empty($keyword)) {
$keyword = explode(' ', $keyword);
if (is_array($keyword)) {
foreach ($keyword as $key) {
$key = trim($key);
//$key = api_replace_dangerous_char($key);
if (empty($key)) {
continue;
}
$qb
->andWhere('u.firstname LIKE :keyword OR u.lastname LIKE :keyword OR u.username LIKE :keyword')
->setParameter('keyword', "%$key%")
;
}
} else {
$qb $qb
->andWhere('u.firstname LIKE :keyword OR u.lastname LIKE :keyword OR u.username LIKE :keyword') ->andWhere('u.firstname LIKE :keyword OR u.lastname LIKE :keyword OR u.username LIKE :keyword')
->setParameter('keyword', "%$keyword%") ->setParameter('keyword', "%$keyword%")
; ;
} }
}
$query = $qb->getQuery(); $query = $qb->getQuery();
$items = new Paginator($query, $fetchJoinCollection = true); $items = new Paginator($query, $fetchJoinCollection = true);
$totalItems = count($items); $totalItems = count($items);
@ -99,9 +115,10 @@ $form->addButtonSearch(get_lang('Search'));
$tpl = new Template($plugin->get_lang('plugin_title')); $tpl = new Template($plugin->get_lang('plugin_title'));
$tpl->assign('users', $items); $tpl->assign('users', $items);
$tpl->assign('form', $form->returnForm()); $tpl->assign('form', $form->returnForm());
$url = api_get_path(WEB_PLUGIN_PATH).'studentfollowup/posts.php?'; $url = api_get_path(WEB_PLUGIN_PATH).'studentfollowup/posts.php?';
$tpl->assign('post_url', $url); $tpl->assign('post_url', $url);
$url = api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?';
$tpl->assign('my_students_url', $url);
$tpl->assign('pagination', $pagination); $tpl->assign('pagination', $pagination);
$tpl->assign('care_title', $plugin->get_lang('CareDetailView')); $tpl->assign('care_title', $plugin->get_lang('CareDetailView'));
$content = $tpl->fetch('/'.$plugin->get_name().'/view/my_students.html.twig'); $content = $tpl->fetch('/'.$plugin->get_name().'/view/my_students.html.twig');

@ -10,9 +10,12 @@
<tr> <tr>
<td>{{ user.user.completeNameWithUsername }}</td> <td>{{ user.user.completeNameWithUsername }}</td>
<td> <td>
<a href="{{ post_url }}&student_id={{ user.user.id }}"> <a href="{{ my_students_url }}&student={{ user.user.id }}">
<img src="{{ '2rightarrow.png'|icon() }}"> <img src="{{ '2rightarrow.png'|icon() }}">
</a> </a>
<a href="{{ post_url }}&student_id={{ user.user.id }}">
<img src="{{ 'blog.png'|icon() }}">
</a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

@ -6,7 +6,6 @@
<div class="col-md-8"> <div class="col-md-8">
<h2>{{ post.title }}</h2> <h2>{{ post.title }}</h2>
<p>{{ post.content }}</p> <p>{{ post.content }}</p>
{% if type == 'simple' %} {% if type == 'simple' %}
{% set countElements = post.hasParent + post.children.count %} {% set countElements = post.hasParent + post.children.count %}
{% if countElements %} {% if countElements %}
@ -19,7 +18,6 @@
</a> </a>
{% endif %} {% endif %}
{% endif %} {% endif %}
{#{% if type == 'all' %}#} {#{% if type == 'all' %}#}
{#{% if related_posts %}#} {#{% if related_posts %}#}
{#<h3>Related</h3>#} {#<h3>Related</h3>#}
@ -33,7 +31,6 @@
{#{% endif %}#} {#{% endif %}#}
{#{% endif %}#} {#{% endif %}#}
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<p>{{ post.createdAt |date('d/m/Y') }}</p> <p>{{ post.createdAt |date('d/m/Y') }}</p>
<p>{{ post.insertUser.completeName }}</p> <p>{{ post.insertUser.completeName }}</p>

Loading…
Cancel
Save