Commit dc2cf59c authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1515484: fixing pagination on webservices logs page



This was mostly right but the json bits were not hooked up
Also fixing layout of table to be more like a similar
table, User -> Search

behatnotneeded

Change-Id: I9b29c8cc780535efae5b74b4f1eedb60d2227625
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 58296067
......@@ -33,6 +33,11 @@
</tbody>
</table>
{$pagination|safe}
{if $pagination_js}
<script type="application/javascript">
{$pagination_js|safe}
</script>
{/if}
</div>
{else}
<div class="panel-body">
......
......@@ -45,4 +45,4 @@
.panel-pagination {
width: 100%;
clear: both;
}
\ No newline at end of file
}
......@@ -27,18 +27,31 @@ if ($action == 'search') {
$params->institution_requested = param_alphanum('institution_requested', null);
$params->offset = param_integer('offset', 0);
$params->limit = param_integer('limit', 10);
$params->setlimit = param_integer('setlimit', false);
$params->onlyerrors = param_integer('onlyerrors', 0);
$params->sortby = param_alpha('sortby', 'timelogged');
$params->sortdir = param_alpha('sortdir', 'desc');
json_headers();
if (param_boolean('raw', false)) {
json_headers();
$data['error'] = false;
$data['message'] = null;
$data = get_log_search_results($params);
echo json_encode($data);
exit;
}
else {
$data['data'] = build_webservice_log_search_results($params);
list($html, $columns, $searchurl, $pagination) = build_webservice_log_search_results($params);
}
$data['error'] = false;
$data['message'] = null;
echo json_encode($data);
exit;
json_reply(false, array(
'message' => null,
'data' => array(
'tablerows' => $html,
'pagination' => $pagination['html'],
'pagination_js' => $pagination['javascript'],
'offset' => $params->offset,
'setlimit' => $params->setlimit,
)
));
}
......@@ -28,6 +28,7 @@ if (is_array($functionquery)) {
$functionquery = $functionquery[0];
}
$functionname = (!empty($functionquery)) ? get_field('external_functions', 'name', 'id', $functionquery) : '';
$search = (object) array(
'userquery' => $username,
'functionquery' => $functionname,
......@@ -140,7 +141,7 @@ $form = array(
);
unset($form['elements'][0]);
$form = pieform($form);
$smarty = smarty();
$smarty = smarty(array('paginator'));
setpageicon($smarty, 'icon-puzzle-piece');
safe_require('auth', 'webservice');
......@@ -152,6 +153,7 @@ $smarty->assign('protocols', array('REST', 'XML-RPC', 'SOAP'));
$smarty->assign('authtypes', array('TOKEN', 'USER', 'OAUTH'));
$smarty->assign('results', $html);
$smarty->assign('pagination', $pagination['html']);
$smarty->assign('pagination_js', $pagination['javascript']);
$smarty->assign('columns', $columns);
$smarty->assign('searchurl', $searchurl['url']);
$smarty->assign('sortby', $searchurl['sortby']);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment