コード例 #1
0
 protected function basicFields($search)
 {
     // Search by Source
     $search->addSearchField('source', 'source', 'select', '', 'basic');
     $pp = new PeriodicPayment();
     $options = array('' => 'All');
     $sources = $pp->getEnumOptions('source');
     $options += $sources;
     $search->setOptions('source', $options);
     // Search by Frequency
     $search->addSearchField('frequency', 'frequency', 'select', '', 'basic');
     $options = array('' => 'All');
     $frequencies = $pp->getEnumOptions('frequency');
     $options += $frequencies;
     $search->setOptions('frequency', $options);
     // Search by Bank Account
     $search->addSearchField('cb_account_id', 'Bank Account', 'select', 0, 'advanced');
     $cb = new CBAccount();
     $cbs = $cb->getAll();
     $options = array('0' => 'All');
     $options += $cbs;
     $search->setOptions('cb_account_id', $options);
     // Search by Status
     $search->addSearchField('status', 'status', 'select', '', 'advanced');
     $options = array('' => 'All');
     $statuses = $pp->getEnumOptions('status');
     $options += $statuses;
     $search->setOptions('status', $options);
     // Search by Source
     $search->addSearchField('company_id', 'company', 'select', 0, 'advanced');
     $company = new Company();
     $options = array('0' => 'All');
     $companies = $company->getAll();
     $options += $companies;
     $search->setOptions('company_id', $options);
     // Search by Next Due Date
     $search->addSearchField('next_due_date', 'Due Between', 'between', '', 'advanced');
 }
コード例 #2
0
 public function view()
 {
     if (isset($this->_data['id'])) {
         $pp = new PeriodicPayment();
         $pp->load($this->_data['id']);
         $this->view->set('periodicpayment', $pp);
         $sidebar = new SidebarController($this->view);
         $sidebarlist = array();
         $sidebarlist['showall'] = array('tag' => 'View All Payments', 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'index')));
         $sidebar->addList('Actions', $sidebarlist);
         $this->view->register('sidebar', $sidebar);
         $this->view->set('sidebar', $sidebar);
     } else {
         sendTo($this->name, 'index', $this->_modules);
     }
 }