1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60:
<?php
namespace FlexiPeeHP\ui;
class AdresarForm extends \Ease\TWB\Form
{
public $address = null;
public function __construct($address)
{
$addressID = $address->getMyKey();
$this->address = $address;
parent::__construct('address'.$addressID);
$this->addInput(new \Ease\Html\InputTag('kod',
$address->getDataValue('kod')), _('Code'));
$this->addInput(new \Ease\Html\InputTag('nazev',
$address->getDataValue('nazev')), _('Name'));
if (strlen($address->getDataValue('email')) == 0) {
$address->addStatusMessage(_('Email address is empty'), 'warning');
}
$this->addInput(new \Ease\Html\InputTag('email',
$address->getDataValue('email')), _('Email'));
$this->addInput(new \Ease\Html\TextareaTag('poznam',
$address->getDataValue('poznam')), _('Note'));
$this->addItem(new \Ease\Html\InputHiddenTag('class',
get_class($address)));
if (!is_null($addressID)) {
$this->addItem(new \Ease\Html\InputHiddenTag($address->keyColumn,
$addressID));
}
}
}