From a0c18e4ab38808cb065ab1fa521ec9a96000dcee Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Fri, 4 May 2018 16:36:20 +0200 Subject: [PATCH] fix: update search options Signed-off-by: Thierry Bugier --- inc/agent.class.php | 25 +++++++++------- inc/file.class.php | 12 ++++---- inc/fleet.class.php | 5 ---- inc/geolocation.class.php | 7 +---- inc/invitation.class.php | 26 +++++++--------- inc/package.class.php | 8 +++++ inc/policy.class.php | 6 ++-- inc/taskstatus.class.php | 60 +++++++++++++++++++++++++++++++++++++ inc/wellknownpath.class.php | 5 ---- 9 files changed, 103 insertions(+), 51 deletions(-) diff --git a/inc/agent.class.php b/inc/agent.class.php index ce645687..283b3e28 100644 --- a/inc/agent.class.php +++ b/inc/agent.class.php @@ -762,11 +762,6 @@ public function post_purgeItem() { public function getSearchOptionsNew() { $tab = parent::getSearchOptionsNew(); - $tab[0] = [ - 'id' => 'common', - 'name' => __('Agent', 'flyvemdm'), - ]; - $tab[] = [ 'id' => '2', 'table' => $this->getTable(), @@ -825,7 +820,7 @@ public function getSearchOptionsNew() { 'table' => $this->getTable(), 'field' => 'is_online', 'name' => __('Is online', 'flyvemdm'), - 'datatype' => 'boolean', + 'datatype' => 'bool', 'massiveaction' => false ]; @@ -834,7 +829,7 @@ public function getSearchOptionsNew() { 'table' => $this->getTable(), 'field' => 'mdm_type', 'name' => __('MDM type', 'flyvemdm'), - 'datatype' => 'boolean', + 'datatype' => 'bool', 'massiveaction' => false ]; @@ -843,7 +838,7 @@ public function getSearchOptionsNew() { 'table' => $this->getTable(), 'field' => 'has_system_permission', 'name' => __('Has system permission', 'flyvemdm'), - 'datatype' => 'boolean', + 'datatype' => 'bool', 'massiveaction' => false ]; @@ -852,7 +847,7 @@ public function getSearchOptionsNew() { 'table' => $this->getTable(), 'field' => 'enroll_status', 'name' => __('Enroll status', 'flyvemdm'), - 'datatype' => 'boolean', + 'datatype' => 'bool', 'massiveaction' => false ]; @@ -861,7 +856,7 @@ public function getSearchOptionsNew() { 'table' => $this->getTable(), 'field' => 'wipe', 'name' => __('Wipe requested', 'flyvemdm'), - 'datatype' => 'boolean', + 'datatype' => 'bool', 'massiveaction' => false ]; @@ -870,10 +865,18 @@ public function getSearchOptionsNew() { 'table' => $this->getTable(), 'field' => 'lock', 'name' => __('Lock requested', 'flyvemdm'), - 'datatype' => 'boolean', + 'datatype' => 'bool', 'massiveaction' => false ]; + $tab[] = [ + 'id' => '17', + 'table' => 'glpi_entities', + 'field' => 'completename', + 'name' => __('Entity'), + 'datatype' => 'dropdown' + ]; + return $tab; } diff --git a/inc/file.class.php b/inc/file.class.php index df6caff7..87f0ec2e 100644 --- a/inc/file.class.php +++ b/inc/file.class.php @@ -224,11 +224,6 @@ protected function createEntityDirectory($dir) { public function getSearchOptionsNew() { $tab = parent::getSearchOptionsNew(); - $tab[] = [ - 'id' => 'common', - 'name' => __s('File', 'flyvemdm'), - ]; - $tab[] = [ 'id' => '2', 'table' => $this->getTable(), @@ -255,6 +250,13 @@ public function getSearchOptionsNew() { 'datetype' => 'text', ]; + $tab[] = [ + 'id' => '5', + 'table' => 'glpi_entities', + 'field' => 'completename', + 'name' => __('Entity'), + 'datatype' => 'dropdown' + ]; return $tab; } diff --git a/inc/fleet.class.php b/inc/fleet.class.php index d69c6ee2..83deaec5 100644 --- a/inc/fleet.class.php +++ b/inc/fleet.class.php @@ -234,11 +234,6 @@ public function pre_deleteItem() { public function getSearchOptionsNew() { $tab = parent::getSearchOptionsNew(); - $tab[0] = [ - 'id' => 'common', - 'name' => __s('Fleet', 'flyvemdm') - ]; - $tab[] = [ 'id' => '2', 'table' => $this->getTable(), diff --git a/inc/geolocation.class.php b/inc/geolocation.class.php index f5602b01..2905c2af 100644 --- a/inc/geolocation.class.php +++ b/inc/geolocation.class.php @@ -291,12 +291,7 @@ public static function showForAgent(CommonDBTM $item) { * @return array */ public function getSearchOptionsNew() { - $tab = []; - - $tab[] = [ - 'id' => 'common', - 'name' => __s('Geolocation', 'flyvemdm'), - ]; + $tab = parent::getSearchOptionsNew(); $tab[] = [ 'id' => '2', diff --git a/inc/invitation.class.php b/inc/invitation.class.php index 359b2dce..2ea9de12 100644 --- a/inc/invitation.class.php +++ b/inc/invitation.class.php @@ -418,21 +418,7 @@ public function sendInvitation() { * @return array */ public function getSearchOptionsNew() { - $tab = []; - - $tab[] = [ - 'id' => 'common', - 'name' => __s('Invitation', 'flyvemdm'), - ]; - - $tab[] = [ - 'id' => '1', - 'table' => $this->getTable(), - 'field' => 'name', - 'name' => __('name'), - 'massiveaction' => false, - 'datatype' => 'itemlink', - ]; + $tab = parent::getSearchOptionsNew(); $tab[] = [ 'id' => '2', @@ -440,7 +426,7 @@ public function getSearchOptionsNew() { 'field' => 'id', 'name' => __('ID'), 'massiveaction' => false, - 'datatype' => 'integer', + 'datatype' => 'number' ]; $tab[] = [ @@ -470,6 +456,14 @@ public function getSearchOptionsNew() { 'datatype' => 'string', ]; + $tab[] = [ + 'id' => '6', + 'table' => 'glpi_entities', + 'field' => 'completename', + 'name' => __('Entity'), + 'datatype' => 'dropdown' + ]; + return $tab; } diff --git a/inc/package.class.php b/inc/package.class.php index 89f400ed..5942d738 100644 --- a/inc/package.class.php +++ b/inc/package.class.php @@ -386,6 +386,14 @@ public function getSearchOptionsNew() { 'datatype' => 'image', ]; + $tab[] = [ + 'id' => '6', + 'table' => 'glpi_entities', + 'field' => 'completename', + 'name' => __('Entity'), + 'datatype' => 'dropdown' + ]; + return $tab; } diff --git a/inc/policy.class.php b/inc/policy.class.php index c8df4d82..5ca3c603 100644 --- a/inc/policy.class.php +++ b/inc/policy.class.php @@ -165,7 +165,7 @@ public function getSearchOptionsNew() { 'table' => $this->getTable(), 'field' => 'is_android_policy', 'name' => __('For Android', 'flyvemdm'), - 'datatype' => 'string', + 'datatype' => 'bool', 'massiveaction' => false, ]; @@ -174,7 +174,7 @@ public function getSearchOptionsNew() { 'table' => $this->getTable(), 'field' => 'is_android_system', 'name' => __('Requires system permission', 'flyvemdm'), - 'datatype' => 'string', + 'datatype' => 'bool', 'massiveaction' => false, ]; @@ -183,7 +183,7 @@ public function getSearchOptionsNew() { 'table' => $this->getTable(), 'field' => 'is_apple_policy', 'name' => __('For iOS', 'flyvemdm'), - 'datatype' => 'string', + 'datatype' => 'bool', 'massiveaction' => false, ]; diff --git a/inc/taskstatus.class.php b/inc/taskstatus.class.php index 9c52ff78..22fffdf1 100644 --- a/inc/taskstatus.class.php +++ b/inc/taskstatus.class.php @@ -335,4 +335,64 @@ public static function showForFleet(CommonDBTM $item, $withTemplate = '') { Html::closeForm(); } + + public function getSearchOptionsNew() { + $tab = parent::getSearchOptionsNew(); + + $tab[] = [ + 'id' => '2', + 'table' => $this->getTable(), + 'field' => 'id', + 'name' => __('ID'), + 'massiveaction' => false, + 'datatype' => 'number', + ]; + + $tab[] = [ + 'id' => '3', + 'table' => $this->getTable(), + 'field' => 'date_creation', + 'name' => __('Creation date'), + 'datatype' => 'datetime', + 'massiveaction' => false + ]; + + $tab[] = [ + 'id' => '4', + 'table' => $this->getTable(), + 'field' => 'date_mod', + 'name' => __('Last update'), + 'datatype' => 'datetime', + 'massiveaction' => false + ]; + + $tab[] = [ + 'id' => '5', + 'table' => $this->getTable(), + 'field' => 'plugin_flyvemdm_agents_id', + 'name' => PluginFlyvemdmAgent::getTypeName(1), + 'datatype' => 'itemlink', + 'massiveaction' => false + ]; + + $tab[] = [ + 'id' => '6', + 'table' => $this->getTable(), + 'field' => 'plugin_flyvemdm_tasks_id', + 'name' => PluginFlyvemdmTask::getTypeName(1), + 'datatype' => 'itemlink', + 'massiveaction' => false + ]; + + $tab[] = [ + 'id' => '7', + 'table' => $this->getTable(), + 'field' => 'status', + 'name' => __('Status', 'flyvemdm'), + 'datatype' => 'string', + 'massiveaction' => false + ]; + + return $tab; + } } diff --git a/inc/wellknownpath.class.php b/inc/wellknownpath.class.php index e278303f..23bb9ab5 100644 --- a/inc/wellknownpath.class.php +++ b/inc/wellknownpath.class.php @@ -85,11 +85,6 @@ public function getFromDBByPath($path) { public function getSearchOptionsNew() { $tab = parent::getSearchOptionsNew(); - $tab[0] = [ - 'id' => 'common', - 'name' => __('Well known path', 'flyvemdm'), - ]; - $tab[] = [ 'id' => '2', 'table' => $this->getTable(),