Línea 106... |
Línea 106... |
106 |
$records_x_page = intval($this->params()->fromQuery('length', 10), 10);
|
106 |
$records_x_page = intval($this->params()->fromQuery('length', 10), 10);
|
107 |
$order = $this->params()->fromQuery('order', []);
|
107 |
$order = $this->params()->fromQuery('order', []);
|
108 |
$order_field = empty($order[0]['column']) ? 99 : intval($order[0]['column'], 10);
|
108 |
$order_field = empty($order[0]['column']) ? 99 : intval($order[0]['column'], 10);
|
109 |
$order_direction = empty($order[0]['dir']) ? 'ASC' : strtoupper(filter_var($order[0]['dir'], FILTER_SANITIZE_STRING));
|
109 |
$order_direction = empty($order[0]['dir']) ? 'ASC' : strtoupper(filter_var($order[0]['dir'], FILTER_SANITIZE_STRING));
|
Línea 110... |
Línea 110... |
110 |
|
110 |
|
111 |
$fields = ['first_name', 'last_name', 'corporate_email', 'company', 'country', 'state'];
|
111 |
$fields = ['first_name', 'last_name', 'corporate_email', 'company', 'country', 'sector'];
|
Línea 112... |
Línea 112... |
112 |
$order_field = isset($fields[$order_field]) ? $fields[$order_field] : 'first_name';
|
112 |
$order_field = isset($fields[$order_field]) ? $fields[$order_field] : 'first_name';
|
113 |
|
113 |
|
114 |
if (!in_array($order_direction, ['ASC', 'DESC'])) {
|
114 |
if (!in_array($order_direction, ['ASC', 'DESC'])) {
|
Línea 129... |
Línea 129... |
129 |
'first_name' => $record->first_name,
|
129 |
'first_name' => $record->first_name,
|
130 |
'last_name' => $record->last_name,
|
130 |
'last_name' => $record->last_name,
|
131 |
'corporate_email' => $record->corporate_email,
|
131 |
'corporate_email' => $record->corporate_email,
|
132 |
'company' => $record->company,
|
132 |
'company' => $record->company,
|
133 |
'country' => $record->country,
|
133 |
'country' => $record->country,
|
134 |
'state' => $record->state,
|
134 |
'sector' => $record->sector,
|
135 |
'actions' => [
|
135 |
'actions' => [
|
136 |
'link_edit' => $this->url()->fromRoute('discovery-contacts/edit', ['id' => $record->uuid]),
|
136 |
'link_edit' => $this->url()->fromRoute('discovery-contacts/edit', ['id' => $record->uuid]),
|
137 |
'link_delete' => $this->url()->fromRoute('discovery-contacts/delete', ['id' => $record->uuid]),
|
137 |
'link_delete' => $this->url()->fromRoute('discovery-contacts/delete', ['id' => $record->uuid]),
|
138 |
'link_view' => $this->url()->fromRoute('discovery-contacts/view', ['id' => $record->uuid]),
|
138 |
'link_view' => $this->url()->fromRoute('discovery-contacts/view', ['id' => $record->uuid]),
|
139 |
],
|
139 |
],
|