/**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_Teste');
     try {
         // TUIBuilder object
         $ui = new TUIBuilder(500, 400);
         $ui->setController($this);
         $ui->setForm($this->form);
         // reads the xml form
         $ui->parseFile('app/forms/datagrid.form.xml');
         // get the datagrid
         $this->datagrid = $ui->getWidget('datagrid');
         // put the TUIBuilder panel inside the TForm object
         $this->form->add($ui);
         // set form fields from interface fields
         $this->form->setFields($ui->getFields());
     } catch (Exception $e) {
         new TMessage('error', $e->getMessage());
     }
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
예제 #2
0
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm();
     try {
         // UIBuilder object
         $ui = new TUIBuilder(500, 300);
         $ui->setController($this);
         $ui->setForm($this->form);
         // reads the xml form
         $ui->parseFile('app/forms/sample.form.xml');
         // add the TUIBuilder panel inside the form
         $this->form->add($ui);
         // set the form fields from the interface
         $this->form->setFields($ui->getFields());
     } catch (Exception $e) {
         new TMessage('error', $e->getMessage());
     }
     // 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();
     // creates the form
     $this->form = new TForm('form_Customer');
     try {
         // UIBuilder object
         $ui = new TUIBuilder(500, 340);
         $ui->setController($this);
         $ui->setForm($this->form);
         // reads the xml form
         $ui->parseFile('app/forms/customerlist.form.xml');
         $this->datagrid = $ui->getWidget('datagrid1');
         $this->pageNavigation = $this->datagrid->getPageNavigation();
         $this->form->add($ui);
         $this->form->setFields($ui->getFields());
     } catch (Exception $e) {
         new TMessage('error', $e->getMessage());
     }
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
예제 #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'));
     }
     // security check
     TTransaction::open('library');
     if (User::newFromLogin(TSession::getValue('login'))->role->mnemonic !== 'OPERATOR' and User::newFromLogin(TSession::getValue('login'))->role->mnemonic !== 'LIBRARIAN') {
         throw new Exception(_t('Permission denied'));
     }
     TTransaction::close();
     // creates the form
     $this->form = new TForm('form_Member');
     try {
         // TUIBuilder object
         $ui = new TUIBuilder(500, 500);
         $ui->setController($this);
         $ui->setForm($this->form);
         // reads the xml form
         $ui->parseFile('app/forms/member.form.xml');
         $ui->getWidget('code_label')->setValue(_t('Code'));
         $ui->getWidget('name_label')->setValue(_t('Name'));
         $ui->getWidget('address_label')->setValue(_t('Address'));
         $ui->getWidget('city_label')->setValue(_t('City'));
         $ui->getWidget('category_label')->setValue(_t('Category'));
         $ui->getWidget('birthdate_label')->setValue(_t('Birthdate'));
         $ui->getWidget('phone_label')->setValue(_t('Phone'));
         $ui->getWidget('email_label')->setValue(_t('Email'));
         $ui->getWidget('login_label')->setValue(_t('Login'));
         $ui->getWidget('password_label')->setValue(_t('Password'));
         $ui->getWidget('registration_label')->setValue(_t('Registration'));
         $ui->getWidget('expiration_label')->setValue(_t('Expiration'));
         $ui->getWidget('new_button')->setLabel(_t('New'));
         $ui->getWidget('save_button')->setLabel(_t('Save'));
         // get the interface widgets
         $fields = $ui->getWidgets();
         // look for the TDataGrid object
         foreach ($fields as $name => $field) {
             if ($field instanceof TDataGrid) {
                 $this->datagrid = $field;
                 $this->pageNavigation = $this->datagrid->getPageNavigation();
             }
         }
         // add the TUIBuilder panel inside the TForm object
         $this->form->add($ui);
         // set form fields from interface fields
         $this->form->setFields($ui->getFields());
     } catch (Exception $e) {
         new TMessage('error', $e->getMessage());
     }
     // add the form to the page
     parent::add($this->form);
 }
예제 #5
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'));
     }
     // security check
     TTransaction::open('library');
     if (User::newFromLogin(TSession::getValue('login'))->role->mnemonic !== 'OPERATOR' and User::newFromLogin(TSession::getValue('login'))->role->mnemonic !== 'LIBRARIAN') {
         throw new Exception(_t('Permission denied'));
     }
     TTransaction::close();
     // creates the form
     $this->form = new TForm('form_Loan');
     try {
         // TUIBuilder object
         $ui = new TUIBuilder(500, 500);
         $ui->setController($this);
         $ui->setForm($this->form);
         // reads the xml form
         $ui->parseFile('app/forms/checkout.form.xml');
         $ui->getWidget('member_label')->setValue(_t('Member'));
         $ui->getWidget('barcode_label')->setValue(_t('Barcode'));
         $ui->getWidget('add_button')->setLabel(_t('Add'));
         $ui->getWidget('apply_button')->setLabel(_t('Apply'));
         $ui->getWidget('barcode')->setLabel(_t('Barcode'));
         $ui->getWidget('book_title')->setLabel(_t('Title'));
         // get the interface widgets
         $fields = $ui->getWidgets();
         // look for the TDataGrid object
         foreach ($fields as $name => $field) {
             if ($field instanceof TDataGrid) {
                 $this->datagrid = $field;
                 $this->pageNavigation = $this->datagrid->getPageNavigation();
             }
         }
         $item_barcode = $ui->getWidget('barcode_input');
         $obj = new ItemSeek();
         $action = new TAction(array($obj, 'onReload'));
         $item_barcode->setAction($action);
         // add the TUIBuilder panel inside the TForm object
         $this->form->add($ui);
         // set form fields from interface fields
         $this->form->setFields($ui->getFields());
     } catch (Exception $e) {
         new TMessage('error', $e->getMessage());
     }
     // add the form to the page
     parent::add($this->form);
 }