/**
 * Formulář cíle cesty pro hosta
 * @param IEHost $host
 * @return \EaseTWBPanel
 */
function endRouteForm($host)
{
    $form = new EaseTWBForm('traceto');
    $form->addInput(new IEHostSelect('dest_host_id'), _('Gateway'), null, _('Zvolte již definovanou gateway, nabo zadejte konkrétní adresu.'));
    $form->addInput(new EaseHtmlInputTextTag('ip'), _('IP Adresa'), null, _('První pingnutelná veřejá adresa po cestě z hostu na monitorovací server'));
    $form->addItem(new EaseTWSubmitButton(_('Sledovat cestu'), 'success', array('onClick' => "\$('#preload').css('visibility', 'visible');")));
    EaseShared::webPage()->addItem(new EaseHtmlDivTag('preload', new IEFXPreloader(), array('class' => 'fuelux')));
    return new EaseTWBPanel(_('Volba cíle sledování') . ': ' . $host->getName(), 'default', $form, _('Vyberte hosta nebo zadejte IP adresu'));
}
 function __construct($formName, $formAction = null, $formMethod = 'post', $formContents = null, $tagProperties = null)
 {
     parent::__construct($formName, $formAction, $formMethod, $formContents, $tagProperties);
     $this->addItem(new EaseTWBFormGroup(_('IP adresa serveru'), new EaseHtmlInputTextTag('serverip'), '', $_SERVER['SERVER_ADDR'], _('Adresa na níž běží icinga. Sem se posílají NSCA testy a z této adresy je povoleno se dotazovat NRPE pluginů')));
     $this->addItem(new EaseTWBFormGroup(_('nsca heslo'), new EaseHtmlInputTextTag('nscapassword'), '', '', _('Heslo kterým je šifrována NSCA komunikace')));
     $this->addItem(new EaseTWSubmitButton(_('Uložit') . '&nbsp' . EaseTWBPart::GlyphIcon('save'), 'success'));
 }
 /**
  * Formulář pro potvrzení nasazení senzoru
  * @param IEHost $host
  */
 public function __construct($host)
 {
     parent::__construct('sensor');
     $this->addItem(new EaseHtmlInputHiddenTag('operation', 'confirm'));
     $this->addItem(new EaseHtmlInputHiddenTag($host->getmyKeyColumn(), $host->getId()));
     $this->addItem(new EaseTWSubmitButton(_('Senzor je nasazen')));
     $status = $host->getSensorStatus();
     $this->addItem(new IETWBSwitch('confirm', $status == 2));
 }
 public function finalize()
 {
     $subcontatcts = $this->contact->getChilds();
     foreach ($subcontatcts as $subcontatctID => $subcontatctInfo) {
         $this->addItem(new EaseTWBButtonDropdown($subcontatctInfo['type'] . ' ' . $subcontatctInfo['contact'], 'success', 'xs', array(new EaseHtmlATag('contact.php?parent_id=' . $this->contact->getId() . '&contact_id=' . $subcontatctID, EaseTWBPart::GlyphIcon('wrench') . ' ' . _('Vlastnosti')), new EaseHtmlATag('?contact_id=' . $this->contact->getId() . '&delsubcont_id=' . $subcontatctID, EaseTWBPart::GlyphIcon('minus') . ' ' . _('smazat') . ' ' . $subcontatctInfo['type']))));
         unset($this->subcontactTypes[$subcontatctInfo['type']]);
         $this->addItem('<br/>');
     }
     if (count($this->subcontactTypes)) {
         $form = new EaseTWBForm('ContatctTweak', 'contacttweak.php');
         $form->addItem(new EaseHtmlSelect('contact', $this->subcontactTypes));
         $form->addItem(new EaseHtmlInputHiddenTag('contact_id', $this->contact->getId()));
         $form->addItem(new EaseTWBFormGroup(_('Kontakt'), new EaseHtmlInputTextTag('cnt', $this->cnt), EaseShared::webPage()->getRequestValue('cnt'), _('telefonní číslo, email či jabberová adresa dle druhu kontaktu')));
         $form->addItem(new EaseTWSubmitButton(_('Uložit'), 'success'));
         $this->addItem(new EaseTWBPanel(_('Přidat kontaktní údaj'), 'default', $form));
     } else {
         $this->addItem(new EaseHtmlDivTag('plno', _('K tomuto kontaktu již není možné přidávat další údaje.'), array('class' => 'well warning', 'style' => 'margin: 10px')));
     }
 }
 /**
  * Formulář Bootstrapu
  *
  * @param string $formName      jméno formuláře
  * @param string $formAction    cíl formulář např login.php
  * @param string $formMethod    metoda odesílání POST|GET
  * @param mixed  $formContents  prvky uvnitř formuláře
  * @param array  $tagProperties vlastnosti tagu například:
  *                              array('enctype' => 'multipart/form-data')
  */
 function __construct($formName, $formAction = null, $formMethod = 'post', $formContents = null, $tagProperties = null)
 {
     parent::__construct($formName, $formAction, $formMethod, $formContents, $tagProperties);
     $term = EaseShared::webPage()->getRequestValue('search', 'string');
     $this->setTagProperties(array('class' => 'navbar-form', 'role' => 'search'));
     $group = $this->addItem(new EaseHtmlDivTag(null, new EaseHtmlInputTextTag('search', $term, array('class' => 'form-control pull-right typeahead', 'style' => 'width: 150px; margin-right: 35px, border: 1px solid black; background-color: #e5e5e5;', 'placeholder' => _('Hledání'))), array('class' => 'input-group')));
     $buttons = $group->addItem(new EaseHtmlSpanTag(null, null, array('class' => 'input-group-btn')));
     $buttons->addItem(new EaseHtmlButtonTag(new EaseHtmlSpanTag(null, new EaseHtmlSpanTag(NULL, _('Zavřít'), array('class' => 'sr-only')), array('class' => 'glyphicon glyphicon-remove')), array('type' => 'reset', 'class' => 'btn btn-default')));
     $buttons->addItem(new EaseHtmlButtonTag(new EaseHtmlSpanTag(null, new EaseHtmlSpanTag(NULL, _('Hledat'), array('class' => 'sr-only')), array('class' => 'glyphicon glyphicon-search')), array('type' => 'submit', 'class' => 'btn btn-default')));
 }
 function finalize()
 {
     parent::finalize();
     $platform = $this->service->getDataValue('platform');
     $this->addItem(new EaseTWBFormGroup(_('Jméno'), new EaseHtmlInputTextTag('service_name', $this->service->getName()), $this->service->getName(), _('Název služby testu')));
     $addNewItem = new EaseHtmlInputSearchTag('check_command-remote', $this->service->getDataValue('check_command-remote'), array('class' => 'search-input', 'title' => _('vzdálený test')));
     $addNewItem->setDataSource('jsoncommand.php?maxRows=20&platform=' . $platform);
     $this->addItem(new EaseTWBFormGroup(_('Vzdálený Příkaz'), $addNewItem, _('Hledej příkazy pro: ') . $platform, _('Příkaz vykonávaný vzdáleným senzorem NRPE/NSCP.exe')));
     $this->addItem(new EaseTWBFormGroup(_('Parametry'), new EaseHtmlInputTextTag('check_command-params', $this->service->getDataValue('check_command-params')), $this->service->getDataValue('command-params'), _('Parametry vzdáleného příkazu. (Pro nrpe oddělované vykřičníkem.)')));
     $this->addItem(new EaseTWBFormGroup(_('Platforma'), new IEPlatformSelector('platform', null, $platform), _('Platforma sledovaného stroje')));
     $this->addItem(new EaseTWSubmitButton(_('Založit') . '&nbsp' . EaseTWBPart::GlyphIcon('forward'), 'success'));
     $serviceId = $this->service->getId();
     if ($serviceId) {
         $this->addItem(new EaseHtmlInputHiddenTag('service_id', $serviceId));
     }
 }
Beispiel #7
0
if ($delete == 'true') {
    $script->delete();
}
$oPage->addItem(new IEPageTop(_('Editace skriptu') . ' ' . $script->getName()));
switch ($oPage->getRequestValue('action')) {
    case 'delete':
        $form = new EaseContainer();
        $form->addItem(new EaseHtmlH2Tag($script->getName()));
        $confirmator = $form->addItem(new EaseTWBPanel(_('Opravdu smazat ?')), 'danger');
        $confirmator->addItem(new EaseTWBWell(nl2br($script->getDataValue('body'))));
        $confirmator->addItem(new EaseTWBLinkButton('?' . $script->myKeyColumn . '=' . $script->getID(), _('Ne') . ' ' . EaseTWBPart::glyphIcon('ok'), 'success'));
        $confirmator->addItem(new EaseTWBLinkButton('?delete=true&' . $script->myKeyColumn . '=' . $script->getID(), _('Ano') . ' ' . EaseTWBPart::glyphIcon('remove'), 'danger'));
        break;
    default:
        $scriptEditor = new IECfgEditor($script);
        $form = new EaseTWBForm('Script', 'script.php', 'POST', $scriptEditor, array('class' => 'form-horizontal'));
        if (!$script->getId()) {
            $form->addItem(new EaseTWSubmitButton(_('Založit'), 'success'));
        } else {
            $form->addItem(new EaseTWSubmitButton(_('Uložit'), 'success'));
        }
        break;
}
$oPage->addItem(new IEPageBottom());
$infopanel = new IEInfoBox($script);
$tools = new EaseTWBPanel(_('Nástroje'), 'warning');
if ($script->getId()) {
    $tools->addItem($script->deleteButton());
    $tools->addItem(new EaseTWBPanel(_('Transfer'), 'warning', $script->transferForm()));
    $command = new IECommand();
    $usages = $command->getColumnsFromMySQL(array($command->getMyKeyColumn(), $command->nameColumn), array('script_id' => $command->getId()), $command->nameColumn, $command->getMyKeyColumn());
Beispiel #8
0
$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>'));
        }
    }
}
$pocServicegroups = $serviceGroup->getMyRecordsCount($userID);
if ($pocServicegroups) {
    $success = $oPage->columnIII->addItem(new EaseHtmlDivTag('Servicegroup', new EaseTWBLinkButton('servicegroups.php', _('<i class="icon-list"></i>') . ' ' . sprintf(_('Definováno %s skupin služeb'), $pocServicegroups)), array('class' => 'alert alert-success')));
}
if ($oUser->getSettingValue('admin')) {
    $oPage->columnI->addItem(new EaseTWBLinkButton('login.php?force_id=' . $userID, _('Přihlásit se jako uživatel <i class="icon-refresh"></i>')));
}
if ($oUser->getSettingValue('admin') || $oUser->getId() == $userID) {
    $ownershipForm = new EaseTWBForm('ownershipForm', null, 'POST');
    $ownershipForm->addInput(new IEUserSelect('ownership'), _('Nový vlastník'));
    $ownershipForm->addItem(new EaseTWSubmitButton(_('Předat'), 'warning'));
    $oPage->columnII->addItem(new EaseTWBPanel(_('Předat vlastnictví'), 'warning', $ownershipForm));
}
$oPage->columnIII->addItem($user->deleteButton());
$oPage->addItem(new IEPageBottom());
$oPage->draw();
 /**
  * Formulář Bootstrapu.
  *
  * @param string $formName      jméno formuláře
  * @param string $formAction    cíl formulář např login.php
  * @param string $formMethod    metoda odesílání POST|GET
  * @param mixed  $formContents  prvky uvnitř formuláře
  * @param array  $tagProperties vlastnosti tagu například:
  *                              array('enctype' => 'multipart/form-data')
  */
 public function __construct($formName, $formAction = null, $formMethod = 'post', $formContents = null, $tagProperties = null)
 {
     parent::__construct($formName, $formAction, $formMethod, $formContents, $tagProperties);
     $this->row = $this->addItem(new EaseTWBRow());
 }
 /**
  * Formulář skupiny uživatelů
  * @param IEUserGroup $userGroup
  */
 function __construct($userGroup)
 {
     $this->userGroup = $userGroup;
     parent::__construct('usergroup', $userGroup->keyword . '.php', 'POST');
 }
Beispiel #11
0
        $host = new IEHost();
        $allHosts = $host->getListing();
        foreach ($allHosts as $hostId => $hostInfo) {
            $host->dataReset();
            $host->loadFromMySQL((int) $hostId);
            $host->setDataValue('config_hash', $host->getConfigHash());
            $host->saveToMySQL();
        }
        $oPage->addStatusMessage(sprintf(_('Stavy %s senzorů byly nastaveny'), count($allHosts)), 'success');
    }
}
$oPage->addItem(new IEPageTop(_('Reset objekt')));
$resetForm = new EaseTWBForm('reset');
$resetForm->addInput(new IEYesNoSwitch('host', FALSE), _('Hosti'), null, _('Smaže hosty, ale nechá předlohy'));
$resetForm->addInput(new IEYesNoSwitch('hostgroup', FALSE), _('Skupiny hostů'), null, _('Smaže skupiny hostů'));
$resetForm->addInput(new IEYesNoSwitch('contact', FALSE), _('Kontakty'), null, _('Smaže kontakty'));
$resetForm->addInput(new IEYesNoSwitch('contactgroup', FALSE), _('Skupiny kontaktů'), null, _('Smaže skupiny kontaktů'));
$resetForm->addInput(new IEYesNoSwitch('service', FALSE), _('Služby'), null, _('Smaže služby'));
$resetForm->addInput(new IEYesNoSwitch('servicegroup', FALSE), _('Skupiny služeb'), null, _('Smaže skupiny služeb'));
$resetForm->addItem(new EaseTWSubmitButton(_('Vymazat všechna data'), 'danger'));
$toolRow = new EaseTWBRow();
$toolRow->addColumn(6, new EaseTWBWell($resetForm));
$resyncForm = new EaseTWBForm('resync');
$resyncForm->addInput(new IEYesNoSwitch('desync', FALSE), _('Rozhodit Hash'), null, _('Všechny hosty s nasazeným senzorem budou hlásat zastaralou konfiguraci'));
$resyncForm->addInput(new IEYesNoSwitch('sync', FALSE), _('Nastavit Hash'), null, _('Všechny hosty s nasazeným senzorem budou hlásat aktuální konfiguraci'));
$resyncForm->addItem(new EaseTWSubmitButton(_('Provést operaci'), 'warning', array('onClick' => "\$('#preload').css('visibility', 'visible');")));
$toolRow->addColumn(6, new EaseTWBWell($resyncForm));
$oPage->container->addItem(new EaseTWBPanel(_('Pročištění databáze'), 'danger', $toolRow));
EaseShared::webPage()->addItem(new EaseHtmlDivTag('preload', new IEFXPreloader(), array('class' => 'fuelux')));
$oPage->addItem(new IEPageBottom());
$oPage->draw();
 /**
  * Formulář výměny jedné služby za jinou
  *
  * @param IEService $service
  */
 function __construct($service)
 {
     parent::__construct('swapService', null, 'GET');
     $this->service = $service;
 }
Beispiel #13
0
        break;
    default:
        $hostEdit = new IECfgEditor($host);
        $form = $hostParams->addItem(new EaseHtmlForm('Host', 'host.php', 'POST', $hostEdit, array('class' => 'form-horizontal')));
        $form->setTagID($form->getTagName());
        $form->addItem('<br>');
        $form->addItem(new EaseTWSubmitButton(_('Uložit'), 'success'));
        $oPage->addCss('
input.ui-button { width: 100%; }
');
        $tools->addItem($host->deleteButton());
        $oPage->addItem(new EaseHtmlDivTag('preload', new IEFXPreloader(), array('class' => 'fuelux')));
        if ($host->getDataValue('active_checks_enabled') == '1') {
            $tools->addItem(new EaseTWBLinkButton('?action=populate&host_id=' . $host->getID(), _('Oskenovat a sledovat služby'), null, array('onClick' => "\$('#preload').css('visibility', 'visible');")));
        }
        $renameForm = new EaseTWBForm('Rename', '?action=rename&amp;host_id=' . $host->getID());
        $renameForm->addItem(new EaseHtmlInputTextTag('newname'), $host->getName(), array('class' => 'form-control'));
        $renameForm->addItem(new EaseTWSubmitButton(_('Přejmenovat'), 'success'));
        $tools->addItem(new EaseTWBPanel(_('Přejmenování'), 'info', $renameForm));
        if (count($host->getDataValue('parents'))) {
            $tools->addItem(new EaseTWBLinkButton('?action=parent&host_id=' . $host->getId(), _('Přiřadit rodiče'), 'default'));
        } else {
            $tools->addItem(new EaseTWBLinkButton('?action=parent&host_id=' . $host->getId(), _('Přiřadit rodiče'), 'success'));
        }
        if ($host->getDataValue('icon_image')) {
            $tools->addItem(new EaseTWBLinkButton('?action=icon&host_id=' . $host->getId(), _('Změnit ikonu'), 'default'));
        } else {
            $tools->addItem(new EaseTWBLinkButton('?action=icon&host_id=' . $host->getId(), _('Nastavit ikonu'), 'success'));
        }
        if ($host->getDataValue('address')) {
            $tools->addItem(new EaseTWBLinkButton('watchroute.php?host_id=' . $host->getId(), _('Sledovat cestu'), 'success', array('onClick' => "\$('#preload').css('visibility', 'visible');")));
 */
require_once 'includes/IEInit.php';
if ($oPage->isPosted()) {
    $importer = new IECommand();
    $success = 0;
    $cfgText = $oPage->getRequestValue('cfgtext');
    if ($cfgText) {
        $success += $importer->importText($cfgText, array('command_type' => $oPage->getRequestValue('type')));
    }
    if (isset($_FILES['cfgfile']['tmp_name']) && strlen(trim($_FILES['cfgfile']['tmp_name']))) {
        $success += $importer->importFile($_FILES['cfgfile']['tmp_name'], array('command_type' => $oPage->getRequestValue('type')));
    }
    if ($success) {
        $oPage->addStatusMessage(sprintf(_('Příkaz %s byl naimportován'), $importer->getName()), 'success');
    } else {
        $oPage->addStatusMessage(_('Příkaz nebyl naimportován'), 'warning');
    }
} else {
    $oPage->addStatusMessage(_('Zadejte konfigurační fragment příkazu, nebo zvolte soubor k importu'));
}
$oPage->addItem(new IEPageTop(_('Načtení příkazů ze souboru')));
$fileForm = new EaseTWBForm('CfgFileUp', null, 'POST', null, array('class' => 'form-horizontal', 'enctype' => 'multipart/form-data'));
$fileForm->addInput(new EaseHtmlTextareaTag('cfgtext', ''), _('konfigurační fragment'));
$fileForm->addInput(new EaseHtmlInputFileTag('cfgfile', null), _('konfigurační soubor'));
$typeSelector = new EaseHtmlSelect('type', 'check');
$typeSelector->addItems(array('check' => 'check', 'notify' => 'notify', 'handler' => 'handler'));
$fileForm->addInput($typeSelector, _('druh vkládaných příkazů'));
$fileForm->addItem(new EaseTWSubmitButton(_('importovat'), 'success'));
$oPage->container->addItem(new EaseTWBPanel(_('Import příkazu do konfigurace'), 'success', $fileForm));
$oPage->addItem(new IEPageBottom());
$oPage->draw();
 /**
  * Editor k přidávání členů skupiny
  *
  * @param IEHost $host
  */
 public function __construct($host)
 {
     parent::__construct();
     $fieldName = $this->getmyKeyColumn();
     if ($host->getDataValue('platform') == 'generic') {
         $note = '<small><span class="label label-info">Tip:</span> ' . _('Další sledovatelné služby budou nabídnuty po nastavení platformy hosta a vzdáleného senzoru.') . '</small>';
     } else {
         $note = array();
     }
     $initialContent = new EaseTWBPanel(_('Sledované služby'), 'default', null, $note);
     $initialContent->setTagCss(array('width' => '100%'));
     if (is_null($host->getMyKey())) {
         $initialContent->addItem(_('Nejprve je potřeba uložit záznam'));
     } else {
         $hostName = $host->getName();
         $service = new IEService();
         $parentServUsed = array();
         $host_active = (bool) $host->getCfgValue('active_checks_enabled');
         $host_passive = (bool) $host->getCfgValue('passive_checks_enabled');
         $servicesAssigned = $service->myDbLink->queryToArray('SELECT ' . $service->myKeyColumn . ',display_name,' . $service->nameColumn . ' FROM ' . $service->myTable . ' WHERE ' . $fieldName . ' LIKE \'%"' . $host->getName() . '"%\'', $service->myKeyColumn);
         $allServices = $service->getListing(null, true, array('platform', 'parent_id', 'passive_checks_enabled', 'active_checks_enabled', 'display_name'));
         foreach ($allServices as $serviceID => $serviceInfo) {
             $servicePassive = (bool) $serviceInfo['passive_checks_enabled'];
             $serviceActive = (bool) $serviceInfo['active_checks_enabled'];
             if ($serviceInfo['register'] != 1) {
                 unset($allServices[$serviceID]);
                 continue;
             }
             if ($serviceInfo['platform'] != 'generic' && $serviceInfo['platform'] != $host->getDataValue('platform')) {
                 unset($allServices[$serviceID]);
                 continue;
             }
             if ((!$host_passive || !$servicePassive) && (!$host_active || !$serviceActive)) {
                 unset($allServices[$serviceID]);
                 continue;
             }
         }
         foreach ($servicesAssigned as $serviceID => $serviceInfo) {
             if (isset($allServices[$serviceID]) && isset($parentServUsed[$allServices[$serviceID]['parent_id']])) {
                 $parentServUsed[$allServices[$serviceID]['parent_id']] = $allServices[$serviceID]['parent_id'];
             }
             unset($allServices[$serviceID]);
         }
         if (count($allServices)) {
             foreach ($allServices as $serviceID => $serviceInfo) {
                 if (isset($parentServUsed[$serviceInfo['parent_id']])) {
                     continue;
                 }
                 $unchMenu = array();
                 if (intval($serviceInfo['parent_id'])) {
                     $unchMenu[] = new EaseHtmlATag('servicetweak.php?service_id=' . $serviceID, EaseTWBPart::GlyphIcon('wrench') . ' ' . _('Editace'));
                 }
                 $unchMenu[] = new EaseHtmlATag('?addservice=' . $serviceInfo[$service->nameColumn] . '&amp;service_id=' . $serviceID . '&amp;' . $host->getmyKeyColumn() . '=' . $host->getMyKey() . '&amp;' . $host->nameColumn . '=' . $host->getName(), EaseTWBPart::GlyphIcon('plus') . ' ' . _('Začít sledovat'));
                 if (strlen($serviceInfo['display_name'])) {
                     $serviceName = $serviceInfo['display_name'];
                 } else {
                     $serviceName = $serviceInfo[$service->nameColumn];
                 }
                 $initialContent->addItem(new EaseTWBButtonDropdown($serviceName, 'inverse', 'xs', $unchMenu));
             }
         }
         if (count($servicesAssigned)) {
             $saveAsTemplateButton = new EaseTWBLinkButton('stemplate.php?action=copyhost&host_id=' . $host->getId(), _('Uložit jako předlohu'), 'success');
             $initialContent->footer($saveAsTemplateButton);
             $initialContent->addItem('</br>');
             foreach ($servicesAssigned as $serviceID => $serviceInfo) {
                 if (strlen($serviceInfo['display_name'])) {
                     $serviceName = $serviceInfo['display_name'];
                 } else {
                     $serviceName = $serviceInfo[$service->nameColumn];
                 }
                 $initialContent->addItem(new EaseTWBButtonDropdown($serviceName, 'success', 'xs', array(new EaseHtmlATag('?delservice=' . $serviceInfo[$service->nameColumn] . '&amp;service_id=' . $serviceID . '&amp;' . $host->getmyKeyColumn() . '=' . $host->getMyKey() . '&amp;' . $host->nameColumn . '=' . $host->getName(), EaseTWBPart::GlyphIcon('remove') . ' ' . _('Přestat sledovat')), new EaseHtmlATag('servicetweak.php?service_id=' . $serviceID . '&amp;host_id=' . $host->getId(), EaseTWBPart::GlyphIcon('wrench') . ' ' . _('Editace')))));
             }
         } else {
             $presetSelForm = new EaseTWBForm('presetSelForm');
             $presetSelForm->addItem(new EaseHtmlInputHiddenTag($host->getmyKeyColumn(), $host->getId()));
             $presetSelForm->addItem(new EaseHtmlInputHiddenTag('action', 'applystemplate'));
             $presetSelForm->addItem(new IEStemplateSelect('stemplate_id'));
             $presetSelForm->addItem(new EaseTWSubmitButton(_('Aplikovat předlohu'), 'success'));
             $presetSelForm->setTagClass('form-inline');
             $initialContent->footer($presetSelForm);
         }
     }
     $this->addItem($initialContent);
 }
Beispiel #16
0
 /**
  * Formulář pro přenos konfigurace
  *
  * @return \EaseTWBForm
  */
 public function &transferForm()
 {
     $exportForm = new EaseTWBForm('Export', $this->keyword . '.php');
     $exportForm->addItem(new EaseHtmlInputHiddenTag('action', 'export'));
     $exportForm->addItem(new EaseHtmlInputHiddenTag($this->myKeyColumn, $this->getId()));
     $exportForm->addInput(new EaseHtmlInputTextTag('destination', $this->user->getSettingValue('exporturl')), _('Cíl exportu'));
     $exportForm->addItem(new EaseHtmlH4Tag(_('Rekurzivní import')));
     foreach ($this->keywordsInfo as $columnName => $columnInfo) {
         if (isset($columnInfo['refdata']['table'])) {
             $exportForm->addInput(new EaseTWBSwitch('rels[' . $columnName . ']'), $columnInfo['title']);
         }
     }
     $exportForm->addInput(new EaseTWSubmitButton(_('Exportovat'), 'warning'));
     return $exportForm;
 }
 /**
  * Pokus o zjistenu parametru prikazu
  */
 public function discoveryParams()
 {
     $cmdline = $this->command->getDataValue('command_line');
     $this->addItem('<br>' . $cmdline);
     $params = array();
     $parts = array_reverse(explode(' ', $cmdline));
     $checkCmd = end($parts);
     foreach ($parts as $cmdPartID => $cmdPart) {
         if (strstr($cmdPart, 'ARG')) {
             $params[substr($cmdPart, 5, 1)] = $parts[$cmdPartID + 1][1];
         }
     }
     $handle = popen($checkCmd . ' --help 2>&1', 'r');
     $help = '';
     while (!feof($handle)) {
         $help .= fread($handle, 2096);
     }
     pclose($handle);
     $helplines = explode("\n", $help);
     $options = array();
     foreach ($helplines as $hip => $helpline) {
         $helpline = trim($helpline);
         if (strlen($helpline) && $helpline[0] == '-') {
             $options[$helpline[1]] = trim($helplines[$hip + 1]);
         }
     }
     $this->addItem($this->printPre($params));
     $this->addItem($this->printPre($options));
     $twform = new EaseTWBForm('servtweak');
     foreach ($params as $id => $key) {
         if (isset($options[$key])) {
             $twform->addItem(new EaseTWBFormGroup('arg' . $id, new EaseHtmlInputTextTag($options[$key], ''), null, $options[$key]));
         }
     }
     $this->addItem($twform);
 }
 public function finalize()
 {
     $this->addItem(new EaseTWSubmitButton(_('Přiřadit kontakt'), 'success'));
     parent::finalize();
 }
Beispiel #19
0
if ($oPage->isPosted()) {
    $params = array();
    $public = $oPage->getRequestValue('public');
    if ($public) {
        $params['public'] = true;
    }
    $generate = $oPage->getRequestValue('generate');
    if ($public) {
        $params['generate'] = true;
    }
    $importer = new IEImporter($params);
    $cfgText = $oPage->getRequestValue('cfgtext');
    if ($cfgText) {
        $importer->importCfgText($cfgText, $params);
    }
    if (isset($_FILES['cfgfile']['tmp_name']) && strlen(trim($_FILES['cfgfile']['tmp_name']))) {
        $importer->importCfgFile($_FILES['cfgfile']['tmp_name']);
    }
} else {
    $oPage->addStatusMessage(_('Zadejte konfigurační fragment příkazu, nebo zvolte soubor k importu'));
}
$oPage->addItem(new IEPageTop(_('Import konfigurace')));
$importForm = new EaseTWBForm('CfgFileUp', null, 'POST', null, array('class' => 'form-horizontal', 'enctype' => 'multipart/form-data'));
$importForm->addInput(new EaseHtmlTextareaTag('cfgtext', ''), _('konfigurační fragment'));
$importForm->addInput(new EaseHtmlInputFileTag('cfgfile'), _('konfigurační soubor'));
$importForm->addInput(new IETWBSwitch('public'), _('Importovat data jako veřejná'));
$importForm->addInput(new IETWBSwitch('generate'), _('Generovat do konfigurace'));
$importForm->addItem(new EaseTWSubmitButton(_('importovat'), 'success', array('title' => _('zahájí import konfigurace'))));
$oPage->container->addItem(new EaseTWBPanel(_('Import konfigurace'), 'warning', $importForm));
$oPage->addItem(new IEPageBottom());
$oPage->draw();
Beispiel #20
0
            } else {
                $oUser->addStatusMessage(_('Skupina hostů byla uložena'), 'success');
            }
            $hostgroup->saveMembers();
        }
        $delete = $oPage->getGetValue('delete', 'bool');
        if ($delete == 'true') {
            $hostgroup->delete();
            $oPage->redirect('hostgroups.php');
            exit;
        }
        break;
}
$oPage->addItem(new IEPageTop(_('Editace skupiny hostů') . ' ' . $hostgroup->getName()));
$hostgroupEdit = new IECfgEditor($hostgroup);
$form = new EaseTWBForm('Hostgroup', 'hostgroup.php', 'POST', $hostgroupEdit, array('class' => 'form-horizontal'));
$form->setTagID($form->getTagName());
if (!is_null($hostgroup->getMyKey())) {
    $form->addItem(new EaseHtmlInputHiddenTag($hostgroup->getmyKeyColumn(), $hostgroup->getMyKey()));
}
$form->addItem(new EaseTWSubmitButton(_('Uložit'), 'success'));
$oPage->addItem(new IEPageBottom());
$infopanel = new IEInfoBox($hostgroup);
$tools = new EaseTWBPanel(_('Nástroje'), 'warning');
if ($hostgroup->getId()) {
    $tools->addItem($hostgroup->deleteButton());
    $tools->addItem(new EaseTWBPanel(_('Transfer'), 'warning', $hostgroup->transferForm()));
}
$pageRow = new EaseTWBRow();
$pageRow->addColumn(2, $infopanel);
$pageRow->addColumn(6, new EaseTWBPanel(new EaseHtmlH1Tag($hostgroup->getDataValue('alias') . ' <small>' . $hostgroup->getName() . '</small>'), 'default', $form));