#10976 datatables seatch agents

This commit is contained in:
Jonathan 2023-05-05 13:04:27 +02:00
parent 0336f03a6c
commit 49a795fdb9
4 changed files with 15 additions and 8 deletions

View File

@ -136,7 +136,13 @@ if ($searchAgents) {
$select = 'SELECT DISTINCT(t1.id_agente), t1.ultimo_contacto, t1.nombre, t1.comentarios, t1.id_os, t1.intervalo, t1.id_grupo, t1.disabled, t1.alias, t1.quiet'; $select = 'SELECT DISTINCT(t1.id_agente), t1.ultimo_contacto, t1.nombre, t1.comentarios, t1.id_os, t1.intervalo, t1.id_grupo, t1.disabled, t1.alias, t1.quiet';
if (is_array($order)) { if (is_array($order)) {
$limit = ' ORDER BY '.$order['field'].' '.$order['direction']; // Datatables offset, limit.
$start = get_parameter('start', 0);
$length = get_parameter(
'length',
$config['block_size']
);
$limit = ' ORDER BY '.$order['field'].' '.$order['direction'].' LIMIT '.$length.' OFFSET '.$start;
} }
$query = $select.$sql; $query = $select.$sql;

View File

@ -64,6 +64,11 @@ try {
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar', 'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
] ]
); );
html_print_action_buttons(
'',
[ 'type' => 'data_table' ]
);
} catch (Exception $e) { } catch (Exception $e) {
echo $e->getMessage(); echo $e->getMessage();
} }

View File

@ -76,14 +76,10 @@ if (enterprise_installed()) {
html_print_table($table); html_print_table($table);
if ($searchAgents && $totalAgents > 0) { if ($searchAgents) {
echo $list_agents; echo $list_agents;
echo "<a href='index.php?search_category=agents&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf( echo "<a href='index.php?search_category=agents&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".__('View all matches').'</a>';
__('Show %s of %s. View all matches'),
$count_agents_main,
$totalAgents
).'</a>';
} }

View File

@ -205,7 +205,7 @@ ui_print_standard_header(
); );
$only_count = false; $only_count = false;
hd($searchTab);
switch ($searchTab) { switch ($searchTab) {
case 'main': case 'main':
$only_count = true; $only_count = true;