From fec3aabea5651b66f601f08b0efdee961e02468f Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Wed, 30 Oct 2013 18:10:26 -0400 Subject: [PATCH] disable page break box if section header not checked --- templates/CRM/Report/Form/Criteria.tpl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/templates/CRM/Report/Form/Criteria.tpl b/templates/CRM/Report/Form/Criteria.tpl index 8f81493cce..d4d1b15fa9 100644 --- a/templates/CRM/Report/Form/Criteria.tpl +++ b/templates/CRM/Report/Form/Criteria.tpl @@ -134,6 +134,17 @@ // hide and display the appropriate blocks as directed by the php code on_load_init_blocks( showRows, hideBlocks, '' ); + + cj('input[id^="order_by_section_"]').click(disPageBreak).each(disPageBreak); + + function disPageBreak() { + if (!cj(this).attr('checked')) { + cj(this).parent('td').next('td').children('input[id^="order_by_pagebreak_"]').attr({checked: false, disabled: "disabled"}); + } + else { + cj(this).parent('td').next('td').children('input[id^="order_by_pagebreak_"]').attr({disabled: false}); + } + } function hideRow(i) { showHideRow(i); @@ -141,7 +152,7 @@ cj('select#order_by_column_'+ i).val(''); cj('select#order_by_order_'+ i).val('ASC'); cj('input#order_by_section_'+ i).attr('checked', false); - cj('input#order_by_pageBreak_'+ i).attr('checked', false); + cj('input#order_by_pagebreak_'+ i).attr('checked', false); } {/literal} -- 2.25.1