Example #1
0
 /**
  * init
  */
 public function init()
 {
     $this->term = $this->getPage()->getTerm();
     $this->setup = \coa\Db\CoaSetup::getMapper()->findByCourseId($this->term->courseId);
     // Create Tk_Table structure
     $ff = \Form\Factory::getInstance();
     $tf = \Table\Factory::getInstance();
     $this->table = $tf->createTable('CompanyManager');
     //$this->table->addCell($tf->createCellCheckbox());
     $this->table->addCell($tf->createCellString('name'))->setKey();
     $this->table->addCell($tf->createCellString('status'));
     $this->table->addCell($tf->createCellEmail('email'));
     $this->table->addCell($tf->createCellString('country'));
     $this->table->addCell($tf->createCellString('totalUnits'));
     $this->table->addCell($tf->createCellString('totalPlaces'));
     $this->table->addAction($tf->createActionCsv());
     $this->table->addFilter($ff->createFieldText('keywords')->setPlaceholder('Keywords'))->setLabel('');
     $now = \Tk\Date::create();
     $this->table->addFilter($ff->createFieldDate('dateFrom')->setPlaceholder('Date From')->setValue(\Tk\Date::create($now->getYear() . '-01-01')->floor()));
     $this->table->addFilter($ff->createFieldDate('dateTo')->setPlaceholder('Date To')->setValue(\Tk\Date::create($now->getYear() . '-12-31')->ceil()));
     $list = \Ext\Db\PlacementType::getMapper()->findByTermId($this->term->id);
     $this->table->addFilter($ff->createFieldSelectMulti('placementTypeId', $list))->addStyle('width', '200px');
     $list = \Ext\Db\Term::getMapper()->findByCourseId($this->term->courseId);
     $this->table->addFilter($ff->createFieldSelect('termId', $list)->prependOption('-- All Terms --', ''))->addStyle('width', '200px');
     $this->addChild($tf->createTableRenderer($this->table), 'Table');
 }