| Línea 76... |
Línea 76... |
| 76 |
}
|
76 |
}
|
| 77 |
}
|
77 |
}
|
| 78 |
}
|
78 |
}
|
| Línea 79... |
Línea 79... |
| 79 |
|
79 |
|
| 80 |
if ($isJson) {
|
80 |
if ($isJson) {
|
| 81 |
// $search = $this->params()->fromQuery('search');
|
81 |
$search = $this->params()->fromQuery('search');
|
| 82 |
// $search = empty($search['value']) ? '' : filter_var($search['value'], FILTER_SANITIZE_STRING);
|
82 |
$search = empty($search['value']) ? '' : filter_var($search['value'], FILTER_SANITIZE_STRING);
|
| 83 |
// $page = intval($this->params()->fromQuery('start', 1), 10);
|
83 |
$page = intval($this->params()->fromQuery('start', 1), 10);
|
| 84 |
// $records_x_page = intval($this->params()->fromQuery('length', 10), 10);
|
84 |
$records_x_page = intval($this->params()->fromQuery('length', 10), 10);
|
| 85 |
// $order = $this->params()->fromQuery('order', []);
|
85 |
$order = $this->params()->fromQuery('order', []);
|
| 86 |
// $order_field = empty($order[0]['column']) ? 99 : intval($order[0]['column'], 10);
|
86 |
$order_field = empty($order[0]['column']) ? 99 : intval($order[0]['column'], 10);
|
| 87 |
// $order_direction = empty($order[0]['dir']) ? 'ASC' : strtoupper(filter_var($order[0]['dir'], FILTER_SANITIZE_STRING));
|
87 |
$order_direction = empty($order[0]['dir']) ? 'ASC' : strtoupper(filter_var($order[0]['dir'], FILTER_SANITIZE_STRING));
|
| 88 |
// $fields = ['first_name', 'last_name', 'corporate_email', 'activity'];
|
88 |
$fields = ['first_name', 'last_name', 'corporate_email', 'activity'];
|
| 89 |
// $order_field = isset($fields[$order_field]) ? $fields[$order_field] : 'first_name';
|
89 |
$order_field = isset($fields[$order_field]) ? $fields[$order_field] : 'first_name';
|
| 90 |
|
90 |
|
| 91 |
// if (!in_array($order_direction, ['ASC', 'DESC'])) {
|
91 |
if (!in_array($order_direction, ['ASC', 'DESC'])) {
|
| 92 |
// $order_direction = 'ASC';
|
92 |
$order_direction = 'ASC';
|
| 93 |
// }
|
93 |
}
|
| 94 |
|
94 |
|
| 95 |
|
95 |
|
| 96 |
// //Quede aqui en el mapper
|
96 |
//Quede aqui en el mapper
|
| 97 |
// $discoveryContactMapper = DiscoveryContactLogMapper::getInstance($this->adapter);
|
97 |
$discoveryContactMapper = DiscoveryContactLogMapper::getInstance($this->adapter);
|
| 98 |
// $paginator = $discoveryContactMapper->fetchAllDataTableForCompanyIdAndContactId($currentCompany->id, $currentUser->id, $page, $records_x_page);
|
98 |
$paginator = $discoveryContactMapper->fetchAllDataTableForCompanyIdAndContactId($currentCompany->id, $currentUser->id, $page, $records_x_page);
|
| 99 |
// return new JsonModel([
|
99 |
return new JsonModel([
|
| 100 |
// 'success' => true,
|
100 |
'success' => true,
|
| 101 |
// 'paginator' => $paginator
|
101 |
'paginator' => $paginator
|
| 102 |
// ]);
|
102 |
]);
|
| 103 |
} else {
|
103 |
} else {
|
| Línea 104... |
Línea 104... |
| 104 |
}
|
104 |
}
|
| 105 |
|
105 |
|
| 106 |
|
106 |
|
| 107 |
// return new JsonModel([
|
107 |
// return new JsonModel([
|
| 108 |
// 'success' => true,
|
108 |
// 'success' => true,
|
| 109 |
// 'message' => $currentUser
|
- |
|
| 110 |
// ]);
|
- |
|
| 111 |
}
|
- |
|
| 112 |
$search = $this->params()->fromQuery('search');
|
- |
|
| 113 |
$search = empty($search['value']) ? '' : filter_var($search['value'], FILTER_SANITIZE_STRING);
|
- |
|
| 114 |
$page = intval($this->params()->fromQuery('start', 1), 10);
|
- |
|
| 115 |
$records_x_page = intval($this->params()->fromQuery('length', 10), 10);
|
- |
|
| 116 |
$order = $this->params()->fromQuery('order', []);
|
- |
|
| 117 |
$order_field = empty($order[0]['column']) ? 99 : intval($order[0]['column'], 10);
|
- |
|
| 118 |
$order_direction = empty($order[0]['dir']) ? 'ASC' : strtoupper(filter_var($order[0]['dir'], FILTER_SANITIZE_STRING));
|
- |
|
| 119 |
$fields = ['first_name', 'last_name', 'corporate_email', 'activity'];
|
- |
|
| 120 |
$order_field = isset($fields[$order_field]) ? $fields[$order_field] : 'first_name';
|
- |
|
| 121 |
|
- |
|
| Línea 122... |
Línea -... |
| 122 |
if (!in_array($order_direction, ['ASC', 'DESC'])) {
|
- |
|
| 123 |
$order_direction = 'ASC';
|
- |
|
| 124 |
}
|
- |
|
| 125 |
|
109 |
// 'message' => $currentUser
|
| 126 |
|
110 |
// ]);
|
| 127 |
//Quede aqui en el mapper
|
111 |
}
|
| 128 |
$discoveryContactMapper = DiscoveryContactLogMapper::getInstance($this->adapter);
|
112 |
|
| 129 |
$paginator = $discoveryContactMapper->fetchAllDataTableForCompanyIdAndContactId($currentCompany->id, $currentUser->id, $page, $records_x_page);
|
- |
|
| 130 |
return new JsonModel([
|
- |
|
| 131 |
'success' => true,
|
- |
|
| 132 |
'paginator' => $paginator
|
- |
|
| 133 |
]);
|
- |
|
| 134 |
|
- |
|
| 135 |
|
113 |
|
| 136 |
// return new JsonModel([
|
114 |
return new JsonModel([
|