/**
  * Add Groups/Hosts into menu
  *
  * @param IEBootstrapMenu $nav
  */
 private function groupsHostsMenu($nav)
 {
     EaseShared::webPage()->addCss('.dropdown-menu { overflow-y: auto } ');
     EaseShared::webPage()->addJavaScript("\$('.dropdown-menu').css('max-height',\$(window).height()-100);", null, true);
     $user = EaseShared::user();
     $host = new IEHost();
     $hosts = $host->getListing(null, null, array('icon_image', 'platform'));
     $hostsNotInGroup = array();
     $hnames = array();
     foreach ($hosts as $hID => $hInfo) {
         $hnames[$hInfo['host_name']] =& $hosts[$hID];
         $hostsNotInGroup[$hInfo['host_name']] = $hInfo;
     }
     $topItems = array('wizard-host.php' => EaseTWBPart::GlyphIcon('forward') . ' ' . _('Průvodce založením hostu'));
     $topItems['wizard-active-host.php'] = EaseTWBPart::GlyphIcon('star') . ' ' . _('Nový aktivní Host');
     $hostgroup = new IEHostgroup();
     $topItems['hostgroup.php'] = EaseTWBPart::GlyphIcon('plus') . ' ' . _('Nová skupina hostů');
     /* ,
        'exthostinfo.php' => _('Rozšířené informace hostů'),
        'hostdependency.php' => _('Závislosti hostů'),
        'hostescalation.php' => _('Eskalace hostů') */
     $pocHostgroup = $hostgroup->getMyRecordsCount();
     $hostGroupMenuItem = array();
     if ($pocHostgroup) {
         //$hostgroups = $hostgroup->myDbLink->queryToArray('SELECT ' . $hostgroup->getmyKeyColumn() . ', hostgroup_name, DatSave FROM ' . $hostgroup->myTable . ' WHERE user_id=' . $user->getUserID(), 'hostgroup_id');
         $hostgroups = $hostgroup->getListing(null, null, array('members'));
         foreach ($hostgroups as $cID => $hgInfo) {
             $hostGroupMenuItem['hostgroup.php?hostgroup_id=' . $hgInfo['hostgroup_id']] = EaseTWBPart::GlyphIcon('cloud') . ' ' . $hgInfo['hostgroup_name'];
             if (count($hgInfo['members'])) {
                 foreach ($hgInfo['members'] as $hgMember) {
                     if ($hgMember == '*') {
                         $image = null;
                     } else {
                         $hInfo =& $hnames[$hgMember];
                         $image = $hInfo['icon_image'];
                         unset($hostsNotInGroup[$hgMember]);
                     }
                     if (!$image) {
                         $image = 'unknown.gif';
                     }
                     if (isset($hInfo) && !is_null($hInfo)) {
                         $hostGroupMenuItem['host.php?host_id=' . $hInfo['host_id']] = ' ' . new IEHostIcon($hInfo) . ' ' . $hInfo['host_name'] . ' ' . new IEPlatformIcon($hInfo['platform']);
                     }
                 }
             }
         }
         $topItems['hostgroups.php'] = EaseTWBPart::GlyphIcon('list-alt') . ' ' . _('Přehled skupin hostů');
     } else {
         if (count($hostGroupMenuItem)) {
             $hostGroupMenuItem[] = '';
         }
     }
     if (count($hostsNotInGroup)) {
         foreach ($hostsNotInGroup as $menuHost) {
             $hostGroupMenuItem['host.php?host_id=' . $menuHost['host_id']] = ' ' . new IEHostIcon($menuHost) . ' ' . $menuHost['host_name'] . ' ' . new IEPlatformIcon($menuHost['platform']);
         }
     }
     $topItems['hosts.php'] = EaseTWBPart::GlyphIcon('list') . ' ' . _('Detailní přehled hostů');
     $topItems['map.php'] = EaseTWBPart::GlyphIcon('globe') . ' ' . _('Topologie');
     $nav->addDropDownMenu(_('Hosti'), array_merge($topItems, array('' => ''), $hostGroupMenuItem));
 }
Beispiel #2
0
    $warning->addItem(new EaseTWBLinkButton('contactgroup.php', _('Založit první skupinu kontaktů ' . EaseTWBPart::GlyphIcon('edit'))));
}
$host = new IEHost();
$pocHostu = $host->getMyRecordsCount();
if ($pocHostu) {
    $success = $oPage->columnI->addItem(new EaseHtmlDivTag('Host', new EaseTWBLinkButton('hosts.php', _('<i class="icon-list"></i>') . ' ' . sprintf(_('Definováno %s hostů'), $pocHostu)), array('class' => 'alert alert-success')));
} else {
    if ($pocTimeperiods) {
        $warning = $oPage->columnI->addItem(new EaseHtmlDivTag('Host', _('Nemáte definovaný žádný host'), array('class' => 'alert alert-info')));
        $warning->addItem(new EaseTWBLinkButton('host.php', _('Založit první host') . ' ' . EaseTWBPart::GlyphIcon('edit')));
    } else {
        $warning = $oPage->columnI->addItem(new EaseHtmlDivTag('Host', _('Hosty vyžadují časovou periodu ..'), array('class' => 'alert alert-danger')));
    }
}
$hostgroup = new IEHostgroup();
$pocHostgroups = $hostgroup->getMyRecordsCount();
if ($pocHostgroups) {
    $success = $oPage->columnI->addItem(new EaseHtmlDivTag('Hostgroup', new EaseTWBLinkButton('hostgroups.php', _('<i class="icon-list"></i>') . ' ' . sprintf(_('Definováno %s skupin hostů'), $pocHostgroups)), array('class' => 'alert alert-success')));
} else {
    $warning = $oPage->columnI->addItem(new EaseHtmlDivTag('Host', _('Nemáte definovaný žádnou skupinu hostů'), array('class' => 'alert alert-info')));
    $warning->addItem(new EaseTWBLinkButton('hostgroup.php', _('Založit první skupinu hostů <i class="icon-edit"></i>')));
}
$command = new IECommand();
$PocCommands = $command->getMyRecordsCount();
if ($PocCommands) {
    $success = $oPage->columnIII->addItem(new EaseHtmlDivTag('Command', new EaseTWBLinkButton('commands.php', _('<i class="icon-list"></i>') . ' ' . sprintf(_('Definováno %s příkazů'), $PocCommands)), array('class' => 'alert alert-success')));
} else {
    $warning = $oPage->columnIII->addItem(new EaseHtmlDivTag('Host', _('Nemáte definovaný žádné příkazy'), array('class' => 'alert alert-info')));
    $warning->addItem(new EaseTWBLinkButton('importcommand.php', _('Importovat příkazy') . ' <i class="icon-download"></i>'));
}
$service = new IEService();
Beispiel #3
0
$userInfoFrame->addItem($user);
$userInfoFrame->addItem(new EaseHtmlUlTag(array($user->getUserName(), new EaseHtmlATag('mailto:' . $user->getEmail(), $user->getEmail()))));
$pocTimeperiods = $contact->getMyRecordsCount($userID);
if ($pocTimeperiods) {
    $success = $oPage->columnIII->addItem(new EaseHtmlDivTag('Timeperiod', new EaseTWBLinkButton('timeperiods.php', _('<i class="icon-list"></i>') . ' ' . sprintf(_('Definováno %s časových period'), $pocTimeperiods)), array('class' => 'alert alert-success')));
}
$pocHostu = $host->getMyRecordsCount($userID);
if ($pocHostu) {
    $success = $oPage->columnII->addItem(new EaseHtmlDivTag('Host', new EaseTWBLinkButton('hosts.php', _('<i class="icon-list"></i>') . ' ' . sprintf(_('Definováno %s hostů'), $pocHostu)), array('class' => 'alert alert-success')));
} else {
    if ($pocTimeperiods) {
        $warning = $oPage->columnII->addItem(new EaseHtmlDivTag('Host', _('Nemáte definovaný žádný host'), array('class' => 'alert alert-info')));
        $warning->addItem(new EaseTWBLinkButton('host.php', _('Založit první host') . ' ' . EaseTWBPart::GlyphIcon('edit')));
    }
}
$pocHostgroups = $hostgroup->getMyRecordsCount($userID);
if ($pocHostgroups) {
    $success = $oPage->columnII->addItem(new EaseHtmlDivTag('Hostgroup', new EaseTWBLinkButton('hostgroups.php', _('<i class="icon-list"></i>') . ' ' . sprintf(_('Definováno %s skupin hostů'), $pocHostgroups)), array('class' => 'alert alert-success')));
}
$PocCommands = $command->getMyRecordsCount($userID);
if ($PocCommands) {
    $success = $oPage->columnIII->addItem(new EaseHtmlDivTag('Command', new EaseTWBLinkButton('commands.php', _('<i class="icon-list"></i>') . ' ' . sprintf(_('Definováno %s příkazů'), $PocCommands)), array('class' => 'alert alert-success')));
}
$pocServices = $service->getMyRecordsCount($userID);
if ($pocServices) {
    $success = $oPage->columnIII->addItem(new EaseHtmlDivTag('Service', new EaseTWBLinkButton('services.php', _('<i class="icon-list"></i>') . ' ' . sprintf(_('Definováno %s služeb'), $pocServices)), array('class' => 'alert alert-success')));
} else {
    if ($PocCommands) {
        if ($pocTimeperiods) {
            $warning = $oPage->columnIII->addItem(new EaseHtmlDivTag('Host', _('Nemáte definovaný žádné služby'), array('class' => 'alert alert-info')));
            $warning->addItem(new EaseTWBLinkButton('service.php', _('Založit první službu') . ' <i class="icon-edit"></i>'));