function indexAction() { $form = new Am_Form(); $form->setAction(REL_ROOT_URL . '/cancel/repeat'); $psOptions = array(); foreach ($this->getDi()->paysystemList->getAllPublic() as $ps) { $psOptions[$ps->getId()] = $this->renderPaysys($ps); } $paysys = $form->addAdvRadio('paysys_id')->setLabel(___('Payment System'))->loadOptions($psOptions); $paysys->addRule('required', ___('Please choose a payment system')); if (count($psOptions) == 1) { $paysys->setValue(key($psOptions)); $paysys->toggleFrozen(true); } $form->addHidden('id')->setValue($this->getFiltered('id')); $form->addSaveButton(___('Make Payment')); $this->view->form = $form; $this->view->display('cancel.phtml'); }
public function createRunForm() { $form = new Am_Form(); $form->setAction($this->getUrl(null, 'run')); $s = $form->addSelect('paysys_id')->setLabel(___('Choose a plugin')); $s->addRule('required'); foreach ($this->getModule()->getPlugins() as $p) { $s->addOption($p->getTitle(), $p->getId()); } $form->addDate('date')->setLabel(___('Run Rebill Manually'))->addRule('required'); $form->addHidden('back_url'); $form->addSubmit('run', array('value' => ___('Run'))); return $form; }
public function payoutInfoAction() { $form = new Am_Form(); $form->setAction($this->getUrl()); $this->getModule()->addPayoutInputs($form); $form->addSubmit('_save', array('value' => ___('Save'))); $form->addDataSource(new Am_Request($d = $this->user->toArray())); if ($form->isSubmitted() && $form->validate()) { foreach ($form->getValue() as $k => $v) { if ($k[0] == '_') { continue; } if ($k == 'aff_payout_type') { $this->user->set($k, $v); } else { $this->user->data()->set($k, $v); } } $this->user->update(); } $this->view->form = $form; $this->view->display('aff/payout-info.phtml'); }