return 'Contribution';
}
+ /**
+ * Explicitly declare the form context.
+ */
+ public function getDefaultContext() {
+ return 'create';
+ }
+
/**
* Set variables up before form is built.
*/
else {
$this->assign('price', TRUE);
}
- $this->add('select', 'price_set_id', ts('Price Set'),
- [
- '' => ts('- none -'),
- ] + $price,
- NULL, ['onchange' => "showHideAmountBlock( this.value, 'price_set_id' );"]
- );
+
+ $this->addField('price_set_id', [
+ 'entity' => 'PriceSet',
+ 'options' => $price,
+ 'onchange' => "showHideAmountBlock( this.value, 'price_set_id' );",
+ ]);
+
//CiviPledge fields.
$config = CRM_Core_Config::singleton();
if (in_array('CiviPledge', $config->enableComponents)) {
else {
$this->assign('price', TRUE);
}
- $this->add('select', 'price_set_id', ts('Price Set'),
- [
- '' => ts('- none -'),
- ] + $price,
- NULL, ['onchange' => "return showHideByValue('price_set_id', '', 'map-field', 'block', 'select', false);"]
- );
+ $this->addField('price_set_id', [
+ 'entity' => 'PriceSet',
+ 'options' => $price,
+ 'onchange' => "return showHideByValue('price_set_id', '', 'map-field', 'block', 'select', false);",
+ ]);
+
$default = [$this->createElement('radio', NULL, NULL, NULL, 0)];
$this->add('hidden', 'price_field_id', '', ['id' => 'price_field_id']);
for ($i = 1; $i <= self::NUM_OPTION; $i++) {
else {
$this->assign('price', TRUE);
}
- $this->add('select', 'member_price_set_id', ts('Membership Price Set'), (['' => ts('- none -')] + $price));
+ //$this->add('select', 'member_price_set_id', ts('Membership Price Set'), (['' => ts('- none -')] + $price));
+
+ $this->addField('member_price_set_id', [
+ 'entity' => 'PriceSet',
+ 'name' => 'price_set_id',
+ 'options' => $price,
+ ]);
$session = CRM_Core_Session::singleton();
$single = $session->get('singleForm');
*
* Generated from xml/schema/CRM/Price/PriceSet.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b8036fb0c2f5ad76f8f3bdf93f9db0f0)
+ * (GenCodeChecksum:2465848603f66c170842a63e347ab3e7)
*/
/**
'id' => [
'name' => 'id',
'type' => CRM_Utils_Type::T_INT,
- 'title' => ts('Price Set ID'),
+ 'title' => ts('Price Set'),
'description' => ts('Price Set'),
'required' => TRUE,
'where' => 'civicrm_price_set.id',
'entity' => 'PriceSet',
'bao' => 'CRM_Price_BAO_PriceSet',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'Select',
+ ],
],
'domain_id' => [
'name' => 'domain_id',
<log>true</log>
<field>
<name>id</name>
- <title>Price Set ID</title>
+ <title>Price Set</title>
<type>int unsigned</type>
<required>true</required>
<comment>Price Set</comment>
<add>1.8</add>
+ <html>
+ <type>Select</type>
+ </html>
</field>
<primaryKey>
<name>id</name>