projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #4764 from rohankatkar/CRM-15615
[civicrm-core.git]
/
templates
/
CRM
/
Contact
/
Form
/
Task
/
PDFLetterCommon.tpl
diff --git
a/templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl
b/templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl
index 01a2f69c24a81fb6e3a0e2e02d9538b09eb5e51f..64a9a2f155e438820974a06fb4ffbbb160fec22b 100644
(file)
--- a/
templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl
+++ b/
templates/CRM/Contact/Form/Task/PDFLetterCommon.tpl
@@
-1,8
+1,8
@@
{*
+--------------------------------------------------------------------+
{*
+--------------------------------------------------------------------+
- | CiviCRM version 4.
4
|
+ | CiviCRM version 4.
5
|
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-201
3
|
+ | Copyright CiviCRM LLC (c) 2004-201
4
|
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
@@
-49,9
+49,9
@@
<div class="crm-block crm-form-block crm-pdf-format-form-block">
<table class="form-layout-compressed">
<tr>
<div class="crm-block crm-form-block crm-pdf-format-form-block">
<table class="form-layout-compressed">
<tr>
- <td class="label-left">{$form.format_id.label}
</td><td>{$form.format_id.html}
{help id="id-pdf-format" file="CRM/Contact/Form/Task/PDFLetterCommon.hlp"}</td>
- <td
colspan="2">
</td>
-
</tr>
+ <td class="label-left">{$form.format_id.label}
{help id="id-pdf-format" file="CRM/Contact/Form/Task/PDFLetterCommon.hlp"}</td>
+ <td
>{$form.format_id.html}
</td>
+ </tr>
<tr>
<td class="label-left">{$form.paper_size.label}</td><td>{$form.paper_size.html}</td>
<td class="label-left">{$form.orientation.label}</td><td>{$form.orientation.html}</td>
<tr>
<td class="label-left">{$form.paper_size.label}</td><td>{$form.paper_size.html}</td>
<td class="label-left">{$form.orientation.label}</td><td>{$form.orientation.html}</td>
@@
-72,6
+72,10
@@
<td class="label-left">{$form.margin_left.label}</td><td>{$form.margin_left.html}</td>
<td class="label-left">{$form.margin_right.label}</td><td>{$form.margin_right.html}</td>
</tr>
<td class="label-left">{$form.margin_left.label}</td><td>{$form.margin_left.html}</td>
<td class="label-left">{$form.margin_right.label}</td><td>{$form.margin_right.html}</td>
</tr>
+ <tr>
+ <td class="label-left">{$form.stationery.label}</td><td>{$form.stationery.html}</td>
+ <td colspan="2"> </td>
+ </tr>
</table>
<div id="bindFormat">{$form.bind_format.html} {$form.bind_format.label}</div>
<div id="updateFormat" style="display: none">{$form.update_format.html} {$form.update_format.label}</div>
</table>
<div id="bindFormat">{$form.bind_format.html} {$form.bind_format.label}</div>
<div id="updateFormat" style="display: none">{$form.update_format.html} {$form.update_format.label}</div>
@@
-117,8
+121,11
@@
{literal}
<script type="text/javascript">
{literal}
<script type="text/javascript">
-cj(function() {
- cj().crmAccordions();
+CRM.$(function($) {
+ var $form = $('form.{/literal}{$form.formClass}{literal}');
+ $('#format_id', $form).on('change', function() {
+ selectFormat($(this).val());
+ });
});
var currentWidth;
});
var currentWidth;
@@
-133,10
+140,7
@@
function showBindFormatChkBox()
if ( document.getElementById('template') == null || document.getElementById('template').value == '' ) {
templateExists = false;
}
if ( document.getElementById('template') == null || document.getElementById('template').value == '' ) {
templateExists = false;
}
- var formatExists = true;
- if ( document.getElementById('format_id').value == 0 ) {
- formatExists = false;
- }
+ var formatExists = !!cj('#format_id').val();
if ( templateExists && formatExists ) {
document.getElementById("bindFormat").style.display = "block";
} else if ( formatExists && document.getElementById("saveTemplate") != null && document.getElementById("saveTemplate").checked ) {
if ( templateExists && formatExists ) {
document.getElementById("bindFormat").style.display = "block";
} else if ( formatExists && document.getElementById("saveTemplate") != null && document.getElementById("saveTemplate").checked ) {
@@
-153,20
+157,21
@@
function showBindFormatChkBox()
function showUpdateFormatChkBox()
{
function showUpdateFormatChkBox()
{
- if (
document.getElementById('format_id').value != 0
) {
-
document.getElementById("updateFormat").style.display = "block"
;
+ if (
cj('#format_id').val()
) {
+
cj("#updateFormat").show()
;
}
}
}
}
-function hideUpdateFormatChkBox()
-{
- document.getElementById("update_format").checked = false;
- document.getElementById("updateFormat").style.display = "none";
+function updateFormatLabel() {
+ cj('.pdf-format-header-label').html(cj('#format_id option:selected').text() || cj('#format_id').attr('placeholder'));
}
}
+updateFormatLabel();
+
function selectFormat( val, bind )
{
function selectFormat( val, bind )
{
- if ( val == null || val == 0 ) {
+ updateFormatLabel();
+ if (!val) {
val = 0;
bind = false;
}
val = 0;
bind = false;
}
@@
-181,7
+186,7
@@
function selectFormat( val, bind )
cj("#margin_left").val( data.margin_left );
cj("#margin_right").val( data.margin_right );
selectPaper( data.paper_size );
cj("#margin_left").val( data.margin_left );
cj("#margin_right").val( data.margin_right );
selectPaper( data.paper_size );
-
hideUpdateFormatChkBox
();
+
cj("#update_format").prop({checked: false}).parent().hide
();
document.getElementById('bind_format').checked = bind;
showBindFormatChkBox();
}, 'json');
document.getElementById('bind_format').checked = bind;
showBindFormatChkBox();
}, 'json');