From: Ravish Nair Date: Thu, 30 May 2013 13:04:14 +0000 (+0530) Subject: -- CRM-12682 applied patch and made some modifications X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4c71ccb4c33bc6dafb6203562629fe4092bd2c57;p=civicrm-core.git -- CRM-12682 applied patch and made some modifications --- diff --git a/CRM/Contact/Form/Task/PDFLetterCommon.php b/CRM/Contact/Form/Task/PDFLetterCommon.php index fa33e96194..c865c1ceb2 100644 --- a/CRM/Contact/Form/Task/PDFLetterCommon.php +++ b/CRM/Contact/Form/Task/PDFLetterCommon.php @@ -74,6 +74,16 @@ class CRM_Contact_Form_Task_PDFLetterCommon { * @return void */ static function buildQuickForm(&$form) { + //Added for CRM-12682: Add activity subject and campaign fields + CRM_Campaign_BAO_Campaign::addCampaign($form); + $form->add( + 'text', + 'subject', + ts('Activity Subject'), + array('size' => 45, 'maxlength' => 255), + FALSE + ); + $form->add('static', 'pdf_format_header', NULL, ts('Page Format')); $form->add( 'select', @@ -354,6 +364,8 @@ class CRM_Contact_Form_Task_PDFLetterCommon { } function createActivities($form, $html_message, $contactIds) { + //Added for CRM-12682: Add activity subject and campaign fields + $formValues = $form->controller->exportValues($form->getName()); $session = CRM_Core_Session::singleton(); $userID = $session->get('userID'); @@ -363,6 +375,8 @@ class CRM_Contact_Form_Task_PDFLetterCommon { 'name' ); $activityParams = array( + 'subject' => $formValues['subject'], + 'campaign_id' => $formValues['campaign_id'], 'source_contact_id' => $userID, 'activity_type_id' => $activityTypeID, 'activity_date_time' => date('YmdHis'), diff --git a/templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl b/templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl index 9fd17bee78..da7e5a51bd 100644 --- a/templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl +++ b/templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl @@ -27,9 +27,17 @@ {if $form.template.html} - + + + + + + + + +
{$form.template.label}{$form.template.label} {$form.template.html}
{$form.subject.label}{$form.subject.html}
{$form.campaign_id.label}{$form.campaign_id.html}
{/if} diff --git a/templates/CRM/Mailing/Form/InsertTokens.tpl b/templates/CRM/Mailing/Form/InsertTokens.tpl index 0357845123..448d2776f5 100644 --- a/templates/CRM/Mailing/Form/InsertTokens.tpl +++ b/templates/CRM/Mailing/Form/InsertTokens.tpl @@ -107,9 +107,9 @@ function selectValue( val ) { document.getElementsByName("updateTemplate")[0].checked = false; showSaveUpdateChkBox(); if ( !val ) { + document.getElementById("subject").value =""; if ( !isPDF ) { document.getElementById(text_message).value =""; - document.getElementById("subject").value =""; } if ( editor == "ckeditor" ) { oEditor = CKEDITOR.instances[html_message]; @@ -147,9 +147,8 @@ function selectValue( val ) { var dataUrl = {/literal}"{crmURL p='civicrm/ajax/template' h=0 }"{literal}; cj.post( dataUrl, {tid: val}, function( data ) { + cj("#subject").val( data.subject ); if ( !isPDF ) { - cj("#subject").val( data.subject ); - if ( data.msg_text ) { cj("#"+text_message).val( data.msg_text ); cj("div.text").show();