function buildQuickForm() { $this->addElement('hidden', 'batch_status', true); $this->addElement('hidden', 'id', $_GET['id']); $this->add('text', 'batch_title', ts('Batch Title'), array('size' => 35, 'maxlength' => 64, 'style' => 'text-align:right'), true); $this->add('textarea', 'description', ts('Description'), null, false); $emptySelect1[''] = '- select -'; $bankAccounts = $bankAccounts = CRM_Finance_BAO_BankAccount::getBankAccountsList($emptySelect1); $this->add('select', 'banking_account', ts('Bank Account'), $bankAccounts, true); $this->addDate('banking_date', ts('Banking Date'), true, array('formatType' => 'activityDate')); $this->addElement('checkbox', 'exclude_from_posting', ts('Exclude from posting'), null, null); $this->add('select', 'contribution_type_id', ts('Contribution Type'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::contributionType(), true); $this->add('select', 'payment_instrument_id', ts('Payment Method'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument(), true); $this->addFormRule(array($this, 'formRule')); $this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'spacing' => ' ', 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel')))); $this->assign('formObject', $this); }
protected function buildExtraDataDefaultQuickForm(CRM_Core_Form $form) { require_once 'CRM/Finance/BAO/BatchType.php'; require_once 'CRM/Finance/BAO/BankAccount.php'; require_once 'CRM/Contribute/PseudoConstant.php'; $form->add('text', 'batch_title', ts('Batch Title'), null, true); $form->add('textarea', 'description', ts('Description'), null, false); $emptySelect1[''] = '- select -'; $bankAccounts = CRM_Finance_BAO_BankAccount::getBankAccountsList($emptySelect1); $form->add('select', 'banking_account', ts('Bank Account'), $bankAccounts, true); //TODO: how to get this in civicrm default format? $current = CRM_Utils_Date::getToday(null, 'm/d/Y'); $form->addDate('banking_date', ts('Banking Date'), true, array('formatType' => 'activityDate', 'value' => $current)); $form->addElement('checkbox', 'exclude_from_posting', ts('Exclude from posting'), null, null); $emptySelect[''] = '- select -'; $contributionTypes = CRM_Finance_BAO_BatchType::getContributionTypesList($emptySelect); $form->add('select', 'contribution_type_id', ts('Contribution Type'), $contributionTypes, true); $el = $form->add('select', 'payment_instrument_id', ts('Payment Method'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument(), true); $el->setValue($this->getDefaultPaymentMethodId()); if (!in_array('campaign_id', $this->hideDefaultFields)) { $form->add('text', 'campaign_name', ts('Default Campaign Code'), array('class' => 'form text huge'), true); $form->add('hidden', 'campaign_id'); } if (!in_array('received_date', $this->hideDefaultFields)) { $form->addDate('received_date', ts('Received date'), true, array('formatType' => 'activityDate', 'value' => $current)); } //$form->add('select', 'contribution_type_id', ts('Contribution Type ID'), array(''=>ts( '- select -' )) + CRM_Contribute_PseudoConstant::contributionType( ), true ); //matusz: http://support.vedaconsulting.co.uk/issues/81 //$form->addDate( 'expected_posting_date', ts('Expected posting date'), true, array('formatType' => 'activityDate') ); $form->addFormRule(array($this, 'extraDataQuickFormRule')); }