Esempio n. 1
0
        $form = new EaseHtmlForm('Contact', 'contact.php', 'POST', $contactEdit, array('class' => 'form-horizontal'));
        $form->setTagID($form->getTagName());
        if (!is_null($contact->getMyKey())) {
            $form->addItem(new EaseHtmlInputHiddenTag($contact->getmyKeyColumn(), $contact->getMyKey()));
        }
        $form->addItem('<br>');
        $form->addItem(new EaseTWSubmitButton(_('Uložit'), 'success'));
        break;
}
$service = new IEService();
$serviceUsages = $service->getColumnsFromMySQL(array($service->getMyKeyColumn(), $service->nameColumn), array('contacts' => '%' . $contact->getName() . '%'), $service->nameColumn, $service->getMyKeyColumn());
$oPage->addItem(new IEPageBottom());
$infopanel = new IEInfoBox($contact);
$tools = new EaseTWBPanel(_('Nástroje'), 'warning');
if ($contact->getId()) {
    $tools->addItem($contact->deleteButton());
    $tools->addItem(new EaseTWBPanel(_('Transfer'), 'warning', $contact->transferForm()));
    if (count($serviceUsages)) {
        $usedBy = new EaseTWBPanel(_('Používaný službami'));
        $listing = $usedBy->addItem(new EaseHtmlUlTag(null, array('class' => 'list-group')));
        foreach ($serviceUsages as $usage) {
            $listing->addItem(new EaseHtmlLiTag(new EaseHtmlATag('service.php?service_id=' . $usage['service_id'], $usage[$service->nameColumn]), array('class' => 'list-group-item')));
        }
        $infopanel->addItem($usedBy);
    }
    $host = new IEHost();
    $hostUsages = $host->getColumnsFromMySQL(array($host->getMyKeyColumn(), $host->nameColumn), array('contacts' => '%' . $contact->getName() . '%'), $host->nameColumn, $host->getMyKeyColumn());
    if (count($hostUsages)) {
        $usedBy = new EaseTWBPanel(_('Používaný hosty'));
        $listing = $usedBy->addItem(new EaseHtmlUlTag(null, array('class' => 'list-group')));
        foreach ($hostUsages as $usage) {
Esempio n. 2
0
            } else {
                $oUser->addStatusMessage(_('Kontakt nebyl přejmenován'), 'warning');
            }
        }
        break;
}
$delete = $oPage->getGetValue('delete', 'bool');
if ($delete == 'true') {
    $contact->delete();
    $oPage->redirect('contacts.php');
    exit;
}
$delsubcont = $oPage->getGetValue('delsubcont_id', 'int');
if ($delsubcont) {
    $delcnt = clone $contact;
    $delcnt->delete($delsubcont);
}
$oPage->addItem(new IEPageTop(_('Editace kontaktu') . ' ' . $contact->getName()));
$oPage->addPageColumns();
$oPage->columnII->addItem(new EaseHtmlH3Tag($contact->getName()));
$oPage->columnII->addItem(new IEContactTweaker($contact));
if ($contact->getName() != $oUser->getUserLogin()) {
    $oPage->columnIII->addItem($contact->deleteButton($contact->getName(), 'contact_id=' . $contact->getId()));
}
$renameForm = new EaseTWBForm('Rename', '?action=rename&amp;contact_id=' . $contact->getID() . '&contact_id=' . $contact->getId());
$renameForm->addItem(new EaseHtmlInputTextTag('newname'), $contact->getName(), array('class' => 'form-control'));
$renameForm->addItem(new EaseTWSubmitButton(_('Přejmenovat'), 'success'));
$oPage->columnIII->addItem(new EaseTWBPanel(_('Přejmenování'), 'default', $renameForm));
//$oPage->columnI->addItem(new IEHostSelector($contact));
$oPage->addItem(new IEPageBottom());
$oPage->draw();