/**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // create the form
     $this->form = new TForm();
     // create the form fields
     $html = new THtmlEditor('html_text');
     $html->setSize(500, 200);
     // creates the action button
     $button1 = new TButton('action1');
     $button1->setAction(new TAction(array($this, 'onShow')), 'Show');
     $button1->setImage('ico_apply.png');
     // creates the table wrapper and put it inside the form
     $table = new TTable();
     $this->form->add($table);
     // pack elements
     $table->addRow()->addCell(new TLabel('HTML:'));
     $table->addRow()->addCell($html);
     $table->addRow()->addCell($button1);
     // define wich are the form fields
     $this->form->setFields(array($html, $button1));
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
 /**
  * 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'));
     }
     // security check
     TTransaction::open('changeman');
     if (Member::newFromLogin(TSession::getValue('login'))->role_mnemonic !== 'ADMINISTRATOR' and Member::newFromLogin(TSession::getValue('login'))->role_mnemonic !== 'MANAGER') {
         throw new Exception(_t('Permission denied'));
     }
     TTransaction::close();
     // creates a table
     $table = new TTable();
     // creates the form
     $this->form = new TForm('form_Document');
     $this->form->add($this->notebook);
     $this->form->class = 'tform';
     $this->form->add($table);
     $table->addRowSet(new TLabel(_t('Document')), '')->class = 'tformtitle';
     // create the form fields
     $id = new TEntry('id');
     $id_project = new TDBCombo('id_project', 'changeman', 'Project', 'id', 'description');
     $title = new TEntry('title');
     $content = new THtmlEditor('content');
     $id->setEditable(FALSE);
     // define the sizes
     $id->setSize(100);
     $id_project->setSize(200);
     $title->setSize(200, 40);
     $content->setSize(680, 350);
     $table->addRowSet(new TLabel('ID:'), $id);
     $table->addRowSet(new TLabel(_t('Project') . ': '), $id_project);
     $table->addRowSet(new TLabel(_t('Title') . ': '), $title);
     $hbox = new THBox();
     $hbox->style = 'margin: 10px';
     $hbox->add($content);
     $row = $table->addRow();
     $row->addCell($lbl = new TLabel(_t('Content') . ': '));
     $lbl->setFontStyle('b');
     $row = $table->addRow();
     $cell = $row->addCell($hbox);
     $cell->colspan = 3;
     // create an action button (save)
     $save_button = new TButton('save');
     // define the button action
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('ico_save.png');
     // define wich are the form fields
     $this->form->setFields(array($id, $id_project, $title, $content, $save_button));
     $table->addRowSet($save_button, '')->class = 'tformaction';
     $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();
     $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);
 }
示例#4
0
 /**
  * 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 the form
     $this->form = new TForm('form_Note');
     $this->form->class = 'tform';
     // creates a table
     $table = new TTable();
     $table->addRowSet(new TLabel(_t('Note')), '')->class = 'tformtitle';
     // add the table inside the form
     $this->form->add($table);
     // create the form fields
     $id_issue = new THidden('id_issue');
     $note = new THtmlEditor('note');
     // define the sizes
     $id_issue->setSize(100);
     $note->setSize(640, 200);
     $note->style = 'margin: 10px';
     // add a row for the field id_issue
     $row = $table->addRow();
     $row->addCell($id_issue);
     // add a row for the field note
     $row = $table->addRow();
     $row->addCell($lbl = new TLabel(_t('Notes') . ': '));
     $row = $table->addRow();
     $row->addCell($note);
     $lbl->setFontStyle('b');
     // create an action button (save)
     $save_button = new TButton('save');
     // define the button action
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('ico_save.png');
     // add a row for the form action
     $row = $table->addRow();
     $row->addCell($save_button);
     // define wich are the form fields
     $this->form->setFields(array($id_issue, $note, $save_button));
     $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);
 }
 /**
  * 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'));
     }
     // security check
     TTransaction::open('changeman');
     if (Member::newFromLogin(TSession::getValue('login'))->role_mnemonic !== 'ADMINISTRATOR' and Member::newFromLogin(TSession::getValue('login'))->role_mnemonic !== 'MANAGER') {
         throw new Exception(_t('Permission denied'));
     }
     TTransaction::close();
     // creates a table
     $table = new TTable();
     // creates the form
     $this->form = new TForm('form_Release');
     $this->form->class = 'tform';
     $this->form->style = 'width: 640px';
     $this->form->add($table);
     $table->width = '100%';
     $table->addRowSet(new TLabel(_t('Release')), '')->class = 'tformtitle';
     $options = array('Y' => _t('Yes'), 'N' => _t('No'));
     // create the form fields
     $id = new TEntry('id');
     $id_project = new TDBCombo('id_project', 'changeman', 'Project', 'id', 'description');
     $name = new TEntry('name');
     $sendmail = new TRadioGroup('sendmail');
     $description = new THtmlEditor('description');
     $id_project->addValidation(_t('Project'), new TRequiredValidator());
     $name->addValidation(_t('Name'), new TRequiredValidator());
     $id->setEditable(FALSE);
     // define the sizes
     $id->setSize(100);
     $id_project->setSize(200);
     $name->setSize(200, 40);
     $description->setSize(530, 200);
     $sendmail->addItems($options);
     $sendmail->setLayout('horizontal');
     $sendmail->setValue('N');
     $table->addRowSet(new TLabel('ID:'), $id);
     $table->addRowSet(new TLabel(_t('Project') . ': '), $id_project);
     $table->addRowSet(new TLabel(_t('Name') . ': '), $name);
     $table->addRowSet(new TLabel(_t('Send e-mail') . ': '), $sendmail);
     $hbox = new THBox();
     $hbox->style = 'margin: 10px';
     $hbox->add($description);
     // 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($hbox);
     $cell->colspan = 3;
     // create an action button (save)
     $save_button = new TButton('save');
     // define the button action
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('ico_save.png');
     $table->addRowSet($save_button, '')->class = 'tformaction';
     // define wich are the form fields
     $this->form->setFields(array($id, $id_project, $name, $description, $sendmail, $save_button));
     // add the form to the page
     parent::add($this->form);
 }
 /**
  * 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'));
     }
     // security check
     TTransaction::open('changeman');
     if (Member::newFromLogin(TSession::getValue('login'))->role_mnemonic == 'CUSTOMER') {
         throw new Exception(_t('Permission denied'));
     }
     TTransaction::close();
     $table = new TTable();
     // creates the form
     $this->form = new TForm('form_Issue');
     $this->form->add($table);
     $table->width = '100%';
     $this->form->style = 'width: 750px';
     $this->form->class = 'tform';
     $table->addRowSet(new TLabel(_t('Issue')), '')->class = 'tformtitle';
     $table1 = new TTable();
     $table2 = new TTable();
     // create the form fields
     $id = new TEntry('id');
     $id_user = new TDBCombo('id_user', 'changeman', 'Member', 'id', 'name');
     $id_status = new TDBCombo('id_status', 'changeman', 'Status', 'id', 'complete_description');
     $id_project = new TDBCombo('id_project', 'changeman', 'Project', 'id', 'description');
     $id_priority = new TDBCombo('id_priority', 'changeman', 'Priority', 'id', 'description_translated');
     $id_category = new TDBCombo('id_category', 'changeman', 'Category', 'id', 'description_translated');
     $id_release = new TDBCombo('id_release', 'changeman', 'Release', 'id', 'name');
     $id_member = new TDBCombo('id_member', 'changeman', 'Member', 'id', 'name');
     $register_date = new TDate('register_date');
     $close_date = new TDate('close_date');
     $time = new TEntry('issue_time');
     $title = new TEntry('title');
     $description = new THtmlEditor('description');
     $solution = new THtmlEditor('solution');
     $id_user->addValidation(_t('User'), new TRequiredValidator());
     $id_status->addValidation(_t('Status'), new TRequiredValidator());
     $id_project->addValidation(_t('Project'), new TRequiredValidator());
     $id_priority->addValidation(_t('Priority'), new TRequiredValidator());
     $id_category->addValidation(_t('Category'), new TRequiredValidator());
     $register_date->addValidation(_t('Start date'), new TRequiredValidator());
     $title->addValidation(_t('Title'), new TRequiredValidator());
     $description->addValidation(_t('Description'), new TRequiredValidator());
     // define the sizes
     $id->setSize(100);
     $id_user->setSize(200);
     $id_status->setSize(200);
     $id_project->setSize(200);
     $id_priority->setSize(200);
     $id_category->setSize(200);
     $id_release->setSize(200);
     $id_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);
     // add a row for the field id
     $table1->addRowSet(new TLabel('ID:'), $id);
     $table1->addRowSet(new TLabel(_t('User') . ': '), $id_user);
     $table1->addRowSet(new TLabel(_t('Status') . ': '), $id_status);
     $table1->addRowSet(new TLabel(_t('Project') . ': '), $id_project);
     $table1->addRowSet(new TLabel(_t('Priority') . ': '), $id_priority);
     $table1->addRowSet(new TLabel(_t('Category') . ': '), $id_category);
     $table2->addRowSet(new TLabel(_t('Release') . ': '), $id_release);
     $table2->addRowSet(new TLabel(_t('Assigned to')), $id_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);
     $subnotebook = new TNotebook();
     $subnotebook->setSize(710, 320);
     $subnotebook->style = 'padding: 50px';
     $subnotebook->appendPage(_t('Description'), $description);
     $subnotebook->appendPage(_t('Solution'), $solution);
     $hbox = new THBox();
     $hbox->add($subnotebook);
     $hbox->style = 'margin: 10px';
     $row = $table->addRow();
     $cell = $row->addCell($hbox);
     $cell->colspan = 3;
     // create an action button (save)
     $save_button = new TButton('save');
     // define the button action
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('ico_save.png');
     $table->addRowSet($save_button, '')->class = 'tformaction';
     // define wich are the form fields
     $this->form->setFields(array($id, $id_user, $id_status, $id_project, $id_priority, $id_category, $id_release, $id_member, $register_date, $close_date, $time, $title, $description, $solution, $save_button));
     // add the form to the page
     parent::add($this->form);
 }
 /**
  * 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->class = 'tform';
     $this->form->style = 'width: 750px';
     $table->width = '100%';
     $this->form->add($table);
     $table->addRowSet(new TLabel(_t('Issue')), '')->class = 'tformtitle';
     // add the table inside the form
     $this->form->add($table);
     // create the form fields
     $id_project = new TCombo('id_project');
     $id_priority = new TDBCombo('id_priority', 'changeman', 'Priority', 'id', 'description_translated');
     $id_category = new TDBCombo('id_category', 'changeman', 'Category', 'id', 'description_translated');
     $register_date = new TDate('register_date');
     $time = new TEntry('issue_time');
     $title = new TEntry('title');
     $description = new THtmlEditor('description');
     $file = new TFile('file');
     $register_date->setValue(date('Y-m-d'));
     $register_date->setMask('yyyy-mm-dd');
     $time->setValue(date('H:i'));
     $id_priority->setValue(2);
     // default
     $description->style = 'margin: 10px';
     TTransaction::open('changeman');
     $member = Member::newFromLogin(TSession::getValue('login'));
     $member_projects = $member->getProjectsList();
     $id_project->addItems($member_projects);
     // if just one project, its the default
     if (count($member_projects) == 1) {
         $project_keys = array_keys($member_projects);
         $id_project->setValue($project_keys[0]);
     }
     TTransaction::close();
     $id_project->addValidation(_t('Project'), new TRequiredValidator());
     $id_priority->addValidation(_t('Priority'), new TRequiredValidator());
     $id_category->addValidation(_t('Category'), new TRequiredValidator());
     $register_date->addValidation(_t('Start date'), new TRequiredValidator());
     $title->addValidation(_t('Title'), new TRequiredValidator());
     $description->addValidation(_t('Description'), new TRequiredValidator());
     // define the sizes
     $id_project->setSize(200);
     $id_priority->setSize(200);
     $id_category->setSize(200);
     $register_date->setSize(100);
     $file->setSize(250);
     $time->setSize(50);
     $time->setMask('99:99');
     $title->setSize(200, 40);
     $description->setSize(680, 300);
     $table1->addRowSet(new TLabel(_t('Project') . ': '), $id_project);
     $table1->addRowSet(new TLabel(_t('Priority') . ': '), $id_priority);
     $table1->addRowSet(new TLabel(_t('Category') . ': '), $id_category);
     $table2->addRowSet(new TLabel(_t('Start date') . ':'), array($register_date, $time));
     $table2->addRowSet(new TLabel(_t('Title') . ':'), $title);
     $table2->addRowSet(new TLabel(_t('File') . ':'), $file);
     $row = $table->addRow();
     $row->addCell($table1);
     $row->addCell($table2);
     $label_description = new TLabel(_t('Description'));
     $label_description->setFontStyle('b');
     $row = $table->addRow();
     $row->addCell($label_description);
     $row = $table->addRow();
     $cell = $row->addCell($description);
     $cell->colspan = 3;
     // create an action button (save)
     $save_button = new TButton('save');
     // define the button action
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('ico_save.png');
     $table->addRowSet($save_button, '')->class = 'tformaction';
     // define wich are the form fields
     $this->form->setFields(array($id_project, $id_priority, $id_category, $register_date, $time, $title, $file, $description, $save_button));
     // add the form to the page
     parent::add($this->form);
 }