Skip to content

Commit

Permalink
Close #143 - Add Antivirus get search options submenu
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Hamon committed Dec 13, 2016
1 parent 9109b68 commit b770dbf
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 2 deletions.
34 changes: 34 additions & 0 deletions front/antivirus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/*
Copyright (C) 2010-2016 by the FusionInventory Development Team.
Copyright (C) 2016 Teclib'
This file is part of Armadito Plugin for GLPI.
Armadito Plugin for GLPI is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Armadito Plugin for GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Armadito Plugin for GLPI. If not, see <http://www.gnu.org/licenses/>.
**/

include('../../../inc/includes.php');

Html::header(__('Armadito', 'armadito'), $_SERVER["PHP_SELF"], "plugins", "pluginarmaditomenu", "antiviruses");

PluginArmaditoMenu::displayHeader();
PluginArmaditoMenu::displayMenu("mini");

Search::show('PluginArmaditoAntivirus');

Html::footer();
?>
3 changes: 2 additions & 1 deletion hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ function plugin_armadito_install()
'PluginArmaditoScan' => 10,
'PluginArmaditoScanConfig' => 10,
'PluginArmaditoStateDetail' => 10,
'PluginArmaditoAVConfig' => 10
'PluginArmaditoAVConfig' => 10,
'PluginArmaditoAntivirus' => 10
);

cleanAllDisplayPreferences($classes);
Expand Down
12 changes: 12 additions & 0 deletions inc/antivirus.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ function initFromDB($av_id)
}
}

function getSearchOptions()
{
$search_options = new PluginArmaditoSearchoptions('Antivirus');

$items['Id'] = new PluginArmaditoSearchitemlink('id', $this->getTable(), 'PluginArmaditoAntivirus');
$items['Name'] = new PluginArmaditoSearchtext('name', $this->getTable());
$items['Version'] = new PluginArmaditoSearchtext('version', $this->getTable());
$items['OS Name'] = new PluginArmaditoSearchtext('osname', $this->getTable());

return $search_options->get($items);
}

function isAntivirusInDB()
{
global $DB;
Expand Down
3 changes: 2 additions & 1 deletion inc/menu.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,10 @@ static function displayAntivirusMenu()
$submenu = new PluginArmaditoSubMenu('Antiviruses');
$menu_entries = array();

if (Session::haveRight('plugin_armadito_states', READ))
if (Session::haveRight('plugin_armadito_states', READ) && Session::haveRight('plugin_armadito_antiviruses', READ))
{
$menu_entries[] = new PluginArmaditoMenuEntry('Board', self::BOARD_PNG, 'stateboard.php');
$menu_entries[] = new PluginArmaditoMenuEntry('Antiviruses', self::LISTING_PNG, 'antivirus.php');
$menu_entries[] = new PluginArmaditoMenuEntry('States', self::LISTING_PNG, 'state.php');
}

Expand Down

0 comments on commit b770dbf

Please sign in to comment.