Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Fix tab in packages because changes in GLPI. closes #3114
Browse files Browse the repository at this point in the history
  • Loading branch information
ddurieux committed Mar 13, 2021
1 parent 390fb9b commit 4d7b234
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 123 deletions.
105 changes: 0 additions & 105 deletions inc/deployinstall.class.php

This file was deleted.

40 changes: 22 additions & 18 deletions inc/deploypackage.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,13 +461,7 @@ function showList() {
function defineTabs($options = []) {
$ong = [];
$this->addDefaultFormTab($ong);
if ($this->fields['id'] > 0) {
$this->addStandardTab('PluginFusioninventoryDeployinstall', $ong, $options);
}
if ($this->fields['plugin_fusioninventory_deploygroups_id'] > 0) {
$this->addStandardTab(__CLASS__, $ong, $options);
}

$this->addStandardTab(__CLASS__, $ong, $options);
$ong['no_all_tab'] = true;
return $ong;
}
Expand Down Expand Up @@ -1013,17 +1007,24 @@ function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {

case __CLASS__ :
if ($item->canUpdateItem()) {
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = $item->countVisibilities();
return self::createTabEntry(_n('Target for deploy on demand',
'Targets for deploy on demand',
$nb, 'fusioninventory'),
$nb);
} else {
return _n('Target for deploy on demand',
'Targets for deploy on demand', 2,
'fusioninventory');
$tabs = [];
if ($item->fields['id'] > 0) {
$tabs[1] = __('Package actions', 'fusioninventory');
}
if ($item->fields['plugin_fusioninventory_deploygroups_id'] > 0) {
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = $item->countVisibilities();
$tabs[2] = self::createTabEntry(_n('Target for deploy on demand',
'Targets for deploy on demand',
$nb, 'fusioninventory'),
$nb);
} else {
$tabs[2] = _n('Target for deploy on demand',
'Targets for deploy on demand', 2,
'fusioninventory');
}
}
return $tabs;
}

case 'Computer':
Expand All @@ -1049,9 +1050,12 @@ function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) {

if ($item->getType() == __CLASS__) {
if ($tabnum == 1) {
if ($tabnum == 2) {
$item->showVisibility();
return true;
} else if ($tabnum == 1) {
$item->displayOrderTypeForm();
return true;
}
} else if ($item->getType() == 'Computer') {
$package = new self();
Expand Down

0 comments on commit 4d7b234

Please sign in to comment.