Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
fix: update search options
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry authored and DIOHz0r committed May 10, 2018
1 parent 2af5ffd commit a0c18e4
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 51 deletions.
25 changes: 14 additions & 11 deletions inc/agent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -825,7 +820,7 @@ public function getSearchOptionsNew() {
'table' => $this->getTable(),
'field' => 'is_online',
'name' => __('Is online', 'flyvemdm'),
'datatype' => 'boolean',
'datatype' => 'bool',
'massiveaction' => false
];

Expand All @@ -834,7 +829,7 @@ public function getSearchOptionsNew() {
'table' => $this->getTable(),
'field' => 'mdm_type',
'name' => __('MDM type', 'flyvemdm'),
'datatype' => 'boolean',
'datatype' => 'bool',
'massiveaction' => false
];

Expand All @@ -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
];

Expand All @@ -852,7 +847,7 @@ public function getSearchOptionsNew() {
'table' => $this->getTable(),
'field' => 'enroll_status',
'name' => __('Enroll status', 'flyvemdm'),
'datatype' => 'boolean',
'datatype' => 'bool',
'massiveaction' => false
];

Expand All @@ -861,7 +856,7 @@ public function getSearchOptionsNew() {
'table' => $this->getTable(),
'field' => 'wipe',
'name' => __('Wipe requested', 'flyvemdm'),
'datatype' => 'boolean',
'datatype' => 'bool',
'massiveaction' => false
];

Expand All @@ -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;
}

Expand Down
12 changes: 7 additions & 5 deletions inc/file.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -255,6 +250,13 @@ public function getSearchOptionsNew() {
'datetype' => 'text',
];

$tab[] = [
'id' => '5',
'table' => 'glpi_entities',
'field' => 'completename',
'name' => __('Entity'),
'datatype' => 'dropdown'
];
return $tab;
}

Expand Down
5 changes: 0 additions & 5 deletions inc/fleet.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
7 changes: 1 addition & 6 deletions inc/geolocation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
26 changes: 10 additions & 16 deletions inc/invitation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,29 +418,15 @@ 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',
'table' => $this->getTable(),
'field' => 'id',
'name' => __('ID'),
'massiveaction' => false,
'datatype' => 'integer',
'datatype' => 'number'
];

$tab[] = [
Expand Down Expand Up @@ -470,6 +456,14 @@ public function getSearchOptionsNew() {
'datatype' => 'string',
];

$tab[] = [
'id' => '6',
'table' => 'glpi_entities',
'field' => 'completename',
'name' => __('Entity'),
'datatype' => 'dropdown'
];

return $tab;
}

Expand Down
8 changes: 8 additions & 0 deletions inc/package.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,14 @@ public function getSearchOptionsNew() {
'datatype' => 'image',
];

$tab[] = [
'id' => '6',
'table' => 'glpi_entities',
'field' => 'completename',
'name' => __('Entity'),
'datatype' => 'dropdown'
];

return $tab;
}

Expand Down
6 changes: 3 additions & 3 deletions inc/policy.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function getSearchOptionsNew() {
'table' => $this->getTable(),
'field' => 'is_android_policy',
'name' => __('For Android', 'flyvemdm'),
'datatype' => 'string',
'datatype' => 'bool',
'massiveaction' => false,
];

Expand All @@ -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,
];

Expand All @@ -183,7 +183,7 @@ public function getSearchOptionsNew() {
'table' => $this->getTable(),
'field' => 'is_apple_policy',
'name' => __('For iOS', 'flyvemdm'),
'datatype' => 'string',
'datatype' => 'bool',
'massiveaction' => false,
];

Expand Down
60 changes: 60 additions & 0 deletions inc/taskstatus.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
5 changes: 0 additions & 5 deletions inc/wellknownpath.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit a0c18e4

Please sign in to comment.