} } else { if (isset($f['filters']) && count($f['filters'])) { $r = [$f['filters'][0]['field'], '=', []]; foreach ($f['filters'] as $f2) { array_push($r[2], $f2['value']); } array_push($res, $r); } } } } $sort = []; if (!empty($model->data['sort'])) { foreach ($model->data['sort'] as $s) { if (isset($s['dir'], $s['field'])) { $sort[$s['field']] = $s['dir']; } } } if (isset($data['selection'])) { if ($data['selection'] === 'user') { array_push($res, ['id_user', '=', $model->inc->user->get_id()]); } else { if ($data['selection'] === 'group') { array_push($res, ['id_group', '=', $model->inc->user->get_group()]); } } } return $pm->search($res, $sort); }
<?php /* * Describe what it does or you're a pussy * **/ /** @var $model \bbn\mvc\model*/ if (isset($model->data['search'])) { $pm = new \bbn\appui\task($model->db); if ($rows = $pm->search($model->data['search'])) { return ['rows' => $rows]; } } return ['rows' => []];