|
|
|
@ -57,10 +57,26 @@ if (!empty($userList) || api_is_platform_admin()) { |
|
|
|
|
; |
|
|
|
|
|
|
|
|
|
if (!empty($keyword)) { |
|
|
|
|
$qb |
|
|
|
|
->andWhere('u.firstname LIKE :keyword OR u.lastname LIKE :keyword OR u.username LIKE :keyword') |
|
|
|
|
->setParameter('keyword', "%$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 |
|
|
|
|
->andWhere('u.firstname LIKE :keyword OR u.lastname LIKE :keyword OR u.username LIKE :keyword') |
|
|
|
|
->setParameter('keyword', "%$keyword%") |
|
|
|
|
; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$query = $qb->getQuery(); |
|
|
|
@ -99,9 +115,10 @@ $form->addButtonSearch(get_lang('Search')); |
|
|
|
|
$tpl = new Template($plugin->get_lang('plugin_title')); |
|
|
|
|
$tpl->assign('users', $items); |
|
|
|
|
$tpl->assign('form', $form->returnForm()); |
|
|
|
|
|
|
|
|
|
$url = api_get_path(WEB_PLUGIN_PATH).'studentfollowup/posts.php?'; |
|
|
|
|
$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('care_title', $plugin->get_lang('CareDetailView')); |
|
|
|
|
$content = $tpl->fetch('/'.$plugin->get_name().'/view/my_students.html.twig'); |
|
|
|
|