/**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // security check
     if (TSession::getValue('logged') !== TRUE) {
         throw new Exception(_t('Not logged'));
     }
     // creates a table
     $table = new TTable();
     $this->notebook = new TNotebook();
     $this->notebook->setSize(600, 350);
     $this->notebook->appendPage(_t('Data'), $table);
     // creates the form
     $this->form = new TForm('form_Release');
     $this->form->add($this->notebook);
     $options = array('Y' => _t('Yes'), 'N' => _t('No'));
     // create the form fields
     $id = new TEntry('id');
     $id_project = new TEntry('project');
     $name = new TEntry('name');
     $description = new THtmlEditor('description');
     $id->setEditable(FALSE);
     $id_project->setEditable(FALSE);
     $name->setEditable(FALSE);
     $description->setEditable(FALSE);
     // define the sizes
     $id->setSize(100);
     $id_project->setSize(200);
     $name->setSize(200, 40);
     $description->setSize(530, 200);
     // add a row for the field id
     $row = $table->addRow();
     $row->addCell(new TLabel('ID:'));
     $row->addCell($id);
     // add a row for the field id_project
     $row = $table->addRow();
     $row->addCell(new TLabel(_t('Project') . ': '));
     $row->addCell($id_project);
     // add a row for the field name
     $row = $table->addRow();
     $row->addCell(new TLabel(_t('Name') . ': '));
     $row->addCell($name);
     // add a row for the field description
     $row = $table->addRow();
     $row->addCell($lbl = new TLabel(_t('Description') . ': '));
     $lbl->setFontStyle('b');
     $row = $table->addRow();
     $cell = $row->addCell($description);
     $cell->colspan = 3;
     // define wich are the form fields
     $this->form->setFields(array($id, $id_project, $name, $description));
     $container = new TTable();
     $container->addRow()->addCell($this->form);
     // add the form to the page
     parent::add($container);
 }
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // security check
     if (TSession::getValue('logged') !== TRUE) {
         throw new Exception(_t('Not logged'));
     }
     // creates a table
     $table = new TTable();
     $table1 = new TTable();
     $table2 = new TTable();
     // creates the form
     $this->form = new TForm('form_Issue');
     $this->form->style = 'width: 750px';
     $this->form->add($table);
     $table->width = '100%';
     $this->form->class = 'tform';
     $table->addRowSet(new TLabel(_t('Issue')), '')->class = 'tformtitle';
     // create the form fields
     $id = new TEntry('id');
     $user = new TEntry('user');
     $status = new TEntry('status');
     $project = new TEntry('project');
     $priority = new TEntry('priority');
     $category = new TEntry('category');
     $id_release = new TEntry('id_release');
     $member = new TEntry('member');
     $register_date = new TEntry('register_date');
     $close_date = new TEntry('close_date');
     $time = new TEntry('issue_time');
     $title = new TEntry('title');
     $description = new THtmlEditor('description');
     $solution = new THtmlEditor('solution');
     $user->setEditable(FALSE);
     $status->setEditable(FALSE);
     $project->setEditable(FALSE);
     $priority->setEditable(FALSE);
     $category->setEditable(FALSE);
     $id_release->setEditable(FALSE);
     $member->setEditable(FALSE);
     $register_date->setEditable(FALSE);
     $close_date->setEditable(FALSE);
     $time->setEditable(FALSE);
     $title->setEditable(FALSE);
     $description->setEditable(FALSE);
     $solution->setEditable(FALSE);
     // define the sizes
     $id->setSize(100);
     $user->setSize(200);
     $status->setSize(200);
     $project->setSize(200);
     $priority->setSize(200);
     $category->setSize(200);
     $id_release->setSize(100);
     $member->setSize(200);
     $register_date->setSize(100);
     $close_date->setSize(100);
     $time->setSize(200);
     $title->setSize(200, 40);
     $description->setSize(680, 300);
     $solution->setSize(680, 300);
     $register_date->setMask('yyyy-mm-dd');
     $close_date->setMask('yyyy-mm-dd');
     $id->setEditable(FALSE);
     $table1->addRowSet(new TLabel('ID:'), $id);
     $table1->addRowSet(new TLabel(_t('User') . ': '), $user);
     $table1->addRowSet(new TLabel(_t('Status') . ': '), $status);
     $table1->addRowSet(new TLabel(_t('Project') . ': '), $project);
     $table1->addRowSet(new TLabel(_t('Priority') . ': '), $priority);
     $table1->addRowSet(new TLabel(_t('Category') . ': '), $category);
     $table2->addRowSet(new TLabel(_t('Release') . ': '), $id_release);
     $table2->addRowSet(new TLabel(_t('Assigned to')), $member);
     $table2->addRowSet(new TLabel(_t('Start date') . ':'), $register_date);
     $table2->addRowSet(new TLabel(_t('Due date') . ':'), $close_date);
     $table2->addRowSet(new TLabel(_t('Time') . ':'), $time);
     $table2->addRowSet(new TLabel(_t('Title') . ':'), $title);
     $row = $table->addRow();
     $row->addCell($table1);
     $row->addCell($table2);
     $notes_area = new THtmlEditor('notes_area');
     $notes_area->setEditable(FALSE);
     $notes_area->setSize(680, 300);
     $subnotebook = new TNotebook();
     $subnotebook->setSize(710, 330);
     $subnotebook->appendPage(_t('Description'), $description);
     $subnotebook->appendPage(_t('Solution'), $solution);
     $subnotebook->appendPage(_t('Notes'), $notes_area);
     $hbox = new THBox();
     $hbox->style = 'margin: 10px';
     $hbox->add($subnotebook);
     $row = $table->addRow();
     $cell = $row->addCell($hbox);
     $cell->colspan = 3;
     // define wich are the form fields
     $this->form->setFields(array($id, $user, $status, $project, $priority, $category, $id_release, $member, $register_date, $close_date, $time, $title, $description, $solution, $notes_area));
     // add the form to the page
     parent::add($this->form);
 }