* then they weill differ
*
* @param $formValues array values from form. The important values we are looking for are
- * - contact_select_id[1]
- * - contribution_contact_select_id[1]
+ * - contact_id
+ * - soft_credit_contact_id
*/
function storeContactFields($formValues){
// in a 'standalone form' (contact id not in the url) the contact will be in the form values
- if (!empty($formValues['contact_select_id'])) {
- $this->_contactID = $formValues['contact_select_id'][1];
+ if (!empty($formValues['contact_id'])) {
+ $this->_contactID = $formValues['contact_id'];
}
list($this->_memberDisplayName,
//CRM-10375 Where the payer differs to the member the payer should get the email.
// here we store details in order to do that
- if (!empty($formValues['contribution_contact_select_id']) && !empty($formValues['contribution_contact_select_id']['1'])) {
- $this->_receiptContactId = $this->_contributorContactID = $formValues['contribution_contact_select_id'][1];
+ if (!empty($formValues['soft_credit_contact_id'])) {
+ $this->_receiptContactId = $this->_contributorContactID = $formValues['soft_credit_contact_id'];
list( $this->_contributorDisplayName,
$this->_contributorEmail ) = CRM_Contact_BAO_Contact_Location::getEmailDetails( $this->_contributorContactID );
}
}
if ($this->_context == 'standalone') {
- CRM_Contact_Form_NewContact::buildQuickForm($this);
+ $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE), TRUE);
}
$selOrgMemType[0][0] = $selMemTypeOrg[0] = ts('- select -');
//CRM-10223 - allow contribution to be recorded against different contact
// causes a conflict in standalone mode so skip in standalone for now
$this->addElement('checkbox', 'is_different_contribution_contact', ts('Record Payment from a Different Contact?'));
- $this->add('select', 'soft_credit_type_id', ts('Membership payment is : '),
- array('' => ts('- Select - ')) + CRM_Core_OptionGroup::values("soft_credit_type", FALSE));
- CRM_Contact_Form_NewContact::buildQuickForm($this, 1, NULL, FALSE, 'contribution_');
+ $this->addSelect('soft_credit_type_id', array('entity' => 'contribution_soft'));
+ $this->addEntityRef('soft_credit_contact_id', ts('Payment From'), array('create' => TRUE));
}
$this->addElement('checkbox',
}
}
- //check if contact is selected in standalone mode
- if (isset($params['contact_select_id'][1]) && !$params['contact_select_id'][1]) {
- $errors['contact[1]'] = ts('Please select a contact or create new contact');
- }
-
if (!empty($errors)) {
return $errors;
}
//CRM-10223 - allow contribution to be recorded against different contact
// causes a conflict in standalone mode so skip in standalone for now
$this->addElement('checkbox', 'contribution_contact', ts('Record Payment from a Different Contact?'));
- $this->add('select', 'soft_credit_type_id', ts('Membership payment is : '),
- array('' => ts('- Select - ')) + CRM_Core_OptionGroup::values("soft_credit_type", FALSE));
- require_once 'CRM/Contact/Form/NewContact.php';
- CRM_Contact_Form_NewContact::buildQuickForm($this,1, null, false,'contribution_');
+ $this->addSelect('soft_credit_type_id', array('entity' => 'contribution_soft'));
+ $this->addEntityRef('soft_credit_contact_id', ts('Payment From'), array('create' => TRUE));
}
}
<tr>
<td class="font-size12pt label"><strong>{ts}Member{/ts}</strong></td><td class="font-size12pt"><strong>{$displayName}</strong></td>
</tr>
- {else}
+ {else}
{if !$membershipMode and !$emailExists and $outBound_option != 2}
{assign var='profileCreateCallback' value=1 }
{/if}
- {include file="CRM/Contact/Form/NewContact.tpl"}
+ <td class="label">{$form.contact_id.label}</td>
+ <td>{$form.contact_id.html}</td>
{/if}
{if $membershipMode}
<tr><td class="label">{$form.payment_processor_id.label}</td><td>{$form.payment_processor_id.html}</td></tr>
<td> </td>
<td>
<table class="compressed">
- <tr class="crm-membership-form-block-honor-type">
+ <tr class="crm-membership-form-block-soft-credit-type">
<td class="label">{$form.soft_credit_type.label}</td>
<td>{$form.soft_credit_type.html}</td>
</tr>
- <tr id ='contributionContact' class="crm-membership-form-block-contribution-type">
- {include file="CRM/Contact/Form/NewContact.tpl"}
+ <tr class="crm-membership-form-block-soft-credit-contact-id">
+ <td class="label">{$form.soft_credit_contact_id.label}</td>
+ <td>{$form.soft_credit_contact_id.html}</td>
</tr>
</table>
</td>
<td> </td>
<td>
<table class="compressed">
- <tr class="crm-membership-form-block-honor-type">
+ <tr class="crm-membership-form-block-soft-credit-type">
<td class="label">{$form.soft_credit_type_id.label}</td>
<td>{$form.soft_credit_type_id.html}</td>
</tr>
- <tr id ='contributionContact' class="crm-membership-form-block-contribution-type">
- {include file="CRM/Contact/Form/NewContact.tpl"}
+ <tr class="crm-membership-form-block-soft-credit-contact-id">
+ <td class="label">{$form.soft_credit_contact_id.label}</td>
+ <td>{$form.soft_credit_contact_id.html}</td>
</tr>
</table>
</td>
<td> </td>
<td>
<table class="compressed">
- <tr class="crm-membership-form-block-honor-type">
+ <tr class="crm-membership-form-block-soft-credit-type">
<td class="label">{$form.soft_credit_type_id.label}</td>
<td>{$form.soft_credit_type_id.html}</td>
</tr>
- <tr id='contributionContact' class="crm-membership-form-block-contribution-type">
- {include file="CRM/Contact/Form/NewContact.tpl"}
+ <tr class="crm-membership-form-block-soft-credit-contact-id">
+ <td class="label">{$form.soft_credit_contact_id.label}</td>
+ <td>{$form.soft_credit_contact_id.html}</td>
</tr>
</table>
</td>
<td> </td>
<td>
<table class="form-layout-compressed">
- <tr class="crm-membership-form-block-honor-type">
- <td class="label">{$form.honor_type_id.label}</td>
- <td>{$form.honor_type_id.html}</td>
+ <tr class="crm-membership-form-block-soft-credit-type">
+ <td class="label">{$form.soft_credit_type_id.label}</td>
+ <td>{$form.soft_credit_type_id.html}</td>
</tr>
- <tr id='contributionContact' class="crm-membership-form-block-contribution-type">
- {include file="CRM/Contact/Form/NewContact.tpl"}
+ <tr class="crm-membership-form-soft-credit-contact-id">
+ <td class="label">{$form.soft_credit_contact_id.label}</td>
+ <td>{$form.soft_credit_contact_id.html}</td>
</tr>
</table>
</td>
<name>soft_credit_type_id</name>
<type>int unsigned</type>
<default>NULL</default>
- <title>Soft Credit Type ID</title>
+ <title>Soft Credit Type</title>
<pseudoconstant>
<optionGroupName>soft_credit_type</optionGroupName>
</pseudoconstant>