From b3088211e9c593961520baa95a57474ad5b3dc82 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Wed, 13 Jul 2016 13:53:10 +0530 Subject: [PATCH] additional fixes --- CRM/Admin/Form/MessageTemplates.php | 5 ++++- templates/CRM/Admin/Form/MessageTemplates.tpl | 2 +- templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CRM/Admin/Form/MessageTemplates.php b/CRM/Admin/Form/MessageTemplates.php index 56f9bfd55d..36d845bf99 100644 --- a/CRM/Admin/Form/MessageTemplates.php +++ b/CRM/Admin/Form/MessageTemplates.php @@ -170,7 +170,10 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Admin_Form { $this->add('text', 'msg_title', ts('Message Title'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_MessageTemplate', 'msg_title'), TRUE); $options = array(ts('Compose On-screen'), ts('Upload Document')); - $this->addRadio('file_type', ts('Source'), $options); + $element = $this->addRadio('file_type', ts('Source'), $options); + if ($this->_id) { + $element->freeze(); + } $this->addElement('file', "file_id", ts('Upload Document'), 'size=30 maxlength=60'); $this->addUploadElement("file_id"); diff --git a/templates/CRM/Admin/Form/MessageTemplates.tpl b/templates/CRM/Admin/Form/MessageTemplates.tpl index ce3d019c56..f6637db177 100644 --- a/templates/CRM/Admin/Form/MessageTemplates.tpl +++ b/templates/CRM/Admin/Form/MessageTemplates.tpl @@ -158,7 +158,7 @@ mimeType = $('a.delete-attachment').data('mimetype'); } - showHideUpload($("input[id$='_file_type']:checked").val()); + showHideUpload($("input[id$='_file_type']").val()); $("input[id$='_file_type']").on('click', function(){ showHideUpload(this.value); }); diff --git a/templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl b/templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl index 47eba65686..ec4e1ef00b 100644 --- a/templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl +++ b/templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl @@ -150,7 +150,8 @@ CRM.$(function($) { $('.crm-document-accordion').hide(); $('#document_file').on('change', function() { if (this.value) { - $('.crm-html_email-accordion, .crm-document-accordion').toggle(false); + $('.crm-html_email-accordion, .crm-document-accordion').hide(); + cj('#document_type').closest('tr').hide(); $('#template').val(''); } }); -- 2.25.1