CRM_Mailing_BAO_Mailing::commonLetterCompose($form);
- if ($form->_single) {
- $cancelURL = CRM_Utils_System::url(
- 'civicrm/contact/view',
- "reset=1&cid={$form->_cid}&selectedChild=activity",
- FALSE,
- NULL,
- FALSE
+ $buttons = array();
+ if ($form->get('action') != CRM_Core_Action::VIEW) {
+ $buttons[] = array(
+ 'type' => 'submit',
+ 'name' => $form->_single ? ts('Make PDF') : ts('Make PDFs'),
+ 'isDefault' => TRUE,
);
-
- if ($form->get('action') == CRM_Core_Action::VIEW) {
- $form->addButtons(array(
- array(
- 'type' => 'cancel',
- 'name' => ts('Done'),
- 'js' => array('onclick' => "location.href='{$cancelURL}'; return false;"),
- ),
- )
- );
- }
- else {
- $form->addButtons(array(
- array(
- 'type' => 'submit',
- 'name' => ts('Make PDF Letter'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Done'),
- 'js' => array('onclick' => "location.href='{$cancelURL}'; return false;"),
- ),
- )
- );
- }
- }
- else {
- $form->addButtons(array(
- array(
- 'type' => 'submit',
- 'name' => ts('Make PDF Letters'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Done'),
- ),
- ));
}
+ $buttons[] = array(
+ 'type' => 'cancel',
+ 'name' => $form->get('action') == CRM_Core_Action::VIEW ? ts('Done') : ts('Cancel'),
+ );
+ $form->addButtons($buttons);
$form->addFormRule(array('CRM_Contact_Form_Task_PDFLetterCommon', 'formRule'), $form);
}
parent::buildQuickForm();
+ $this->assign('cancelURL', $this->_cancelURL);
+
if (($this->_multiRecord & CRM_Core_Action::DELETE) && $this->_recordExists) {
$this->_deleteButtonName = $this->getButtonName('upload', 'delete');
$this->addElement('submit', $this->_deleteButtonName, ts('Delete'));
- $buttons[] = array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- 'isDefault' => TRUE,
- 'js' => array('onclick' => "location.href='{$this->_cancelURL}'; return false;"),
- );
- $this->addButtons($buttons);
return;
}
'isDefault' => TRUE,
);
- $buttons[] = array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- 'isDefault' => TRUE,
- 'js' => array('onclick' => "location.href='{$this->_cancelURL}'; return false;"),
- );
-
$this->addButtons($buttons);
$this->addFormRule(array('CRM_Profile_Form', 'formRule'), $this);
<dt>{ts}From{/ts}</dt><dd>{if $fromName}{$fromName}{else}{ts}(display name not available){/ts}{/if}</dd>
<dt>{ts}To{/ts}</dt><dd>{$toName}</dd>
<dt>{ts}Message{/ts}</dt><dd>{$message}</dd>
-<dt> </dt><dd><input type="button" name="Done" value="Done" onClick="location.href='{crmURL p='civicrm/contact/view/activity' q="history=1&show=1"}';"></dd>
+<dt> </dt>
+ <dd class="crm-submit-buttons">
+ <a class="button cancel" href="{crmURL p='civicrm/contact/view/activity' q="history=1&show=1"}">{ts}Done{/ts}</a>
+ </dd>
</dl>
</fieldset>
</div>
<div class="icon inform-icon"></div>
{ts}Are you sure you want to delete this record?{/ts}
</div>
- <span class="crm-button">{$form._qf_Edit_upload_delete.html}</span>
- <div class="crm-submit-buttons" style='display:inline'>{include file="CRM/common/formButtons.tpl"}</div>
+
+ <div class="crm-submit-buttons">
+ <span class="crm-button">{$form._qf_Edit_upload_delete.html}</span>
+ <a class="button cancel" href="{$cancelURL}">{ts}Cancel{/ts}</a>
+ </div>
{else}
{if ! empty( $fields )}
{* Wrap in crm-container div so crm styles are used.*}
{assign var=floatStyle value='float:right'}
{/if}
<div class="crm-submit-buttons" style='{$floatStyle}'>
- {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}<span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>{/if}
+ {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}<span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>{/if}
+ <a class="button cancel" href="{$cancelURL}">{ts}Cancel{/ts}</a>
</div>
{/if}
{if $help_post && $action neq 4}<br /><div class="messages help">{$help_post}</div>{/if}