Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2015-03-02-21-30-06
[civicrm-core.git] / templates / CRM / Report / Form / Instance.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25 *}
26 <div id="report-tab-format" class="civireport-criteria">
27 <table class="form-layout">
28 <tr class="crm-report-instanceForm-form-block-title">
29 <td class="report-label" width="20%">{$form.title.label} {help id="id-report_title" file="CRM/Report/Form/Settings.hlp"}</td>
30 <td >{$form.title.html}</td>
31 </tr>
32 <tr class="crm-report-instanceForm-form-block-description">
33 <td class="report-label" width="20%">{$form.description.label}</td>
34 <td>{$form.description.html}</td>
35 </tr>
36 <tr class="crm-report-instanceForm-form-block-report_header">
37 <td class="report-label" width="20%">{$form.report_header.label}{help id="id-report_header" file="CRM/Report/Form/Settings.hlp"}</td>
38 <td>{$form.report_header.html}</td>
39 </tr>
40 <tr class="crm-report-instanceForm-form-block-report_footer">
41 <td class="report-label" width="20%">{$form.report_footer.label}</td>
42 <td>{$form.report_footer.html}</td>
43 </tr>
44 </table>
45 </div>
46
47 <div id="report-tab-email" class="civireport-criteria">
48 <h3 class="email-delivery-settings-title">{ts}Email Delivery Settings{/ts} {help id="id-email_settings" file="CRM/Report/Form/Settings.hlp"}</h3>
49 <table class="form-layout email-delivery-settings-fields">
50 <tr class="crm-report-instanceForm-form-block-email_subject">
51 <td class="report-label" width="20%">{$form.email_subject.label}</td>
52 <td>{$form.email_subject.html|crmAddClass:huge}</td>
53 </tr>
54 <tr class="crm-report-instanceForm-form-block-email_to">
55 <td class="report-label">{$form.email_to.label}</td>
56 <td>{$form.email_to.html|crmAddClass:huge}</td>
57 </tr>
58 <tr class="crm-report-instanceForm-form-block-email_cc">
59 <td class="report-label">{$form.email_cc.label}</td>
60 <td>{$form.email_cc.html|crmAddClass:huge}</td>
61 </tr>
62 </table>
63 </div>
64
65 <div id="report-tab-access" class="civireport-criteria">
66 <table class="form-layout">
67 <tr class="crm-report-instanceForm-form-block-is_navigation">
68 <td class="report-label">{$form.is_navigation.label}</td>
69 <td>{$form.is_navigation.html}<br />
70 <span class="description">{ts}All report instances are automatically included in the Report Listing page. Check this box to also add this report to the navigation menu.{/ts}</span>
71 </td>
72 </tr>
73 <tr class="crm-report-instanceForm-form-block-parent_id" id="navigation_menu">
74 <td class="report-label">{$form.parent_id.label} {help id="id-parent" file="CRM/Admin/Form/Navigation.hlp"}</td>
75 <td>{$form.parent_id.html|crmAddClass:huge}</td>
76 </tr>
77 <tr class="crm-report-instanceForm-form-block-drilldown">
78 <td class="report-label">{$form.drilldown_id.label}</td>
79 <td>{$form.drilldown_id.html}</td>
80 </tr>
81 {if $config->userFramework neq 'Joomla'}
82 <tr class="crm-report-instanceForm-form-block-permission">
83 <td class="report-label" width="20%">{$form.permission.label} {help id="id-report_perms" file="CRM/Report/Form/Settings.hlp"}</td>
84 <td>{$form.permission.html|crmAddClass:huge}</td>
85 </tr>
86 <tr class="crm-report-instanceForm-form-block-role">
87 <td class="report-label" width="20%">{$form.grouprole.label}</td>
88 <td>{$form.grouprole.html|crmAddClass:huge}</td>
89 </tr>
90 {/if}
91 <tr class="crm-report-instanceForm-form-block-isReserved">
92 <td class="report-label">{$form.is_reserved.label} {help id="id-is_reserved" file="CRM/Report/Form/Settings.hlp"}</td>
93 <td>{$form.is_reserved.html}
94 <span class="description">{ts}If reserved, only users with 'administer reserved reports' permission can modify this report instance.{/ts}</span>
95 </td>
96 </tr>
97 <tr class="crm-report-instanceForm-form-block-addToDashboard">
98 <td class="report-label">{$form.addToDashboard.label} {help id="id-dash_avail" file="CRM/Report/Form/Settings.hlp"}</td>
99 <td>{$form.addToDashboard.html}
100 <span class="description">{ts}Users with appropriate permissions can add this report to their dashboard.{/ts}</span>
101 </td>
102 </tr>
103 <tr id ="limit_result" class="crm-report-instanceForm-form-block-limitUser">
104 <td class="report-label">{$form.row_count.label} {help id="id-dash_limit" file="CRM/Report/Form/Settings.hlp"}</td>
105 <td>{$form.row_count.html}</td>
106 </tr>
107 </table>
108 </div>
109
110 {include file="CRM/common/showHideByFieldValue.tpl"
111 trigger_field_id ="is_navigation"
112 trigger_value =""
113 target_element_id ="navigation_menu"
114 target_element_type ="table-row"
115 field_type ="radio"
116 invert = 0
117 }
118 {include file="CRM/common/showHideByFieldValue.tpl"
119 trigger_field_id ="addToDashboard"
120 trigger_value =""
121 target_element_id ="limit_result"
122 target_element_type ="table-row"
123 field_type ="radio"
124 invert = 0
125 }
126
127 {if $is_navigation}
128 <script type="text/javascript">
129 document.getElementById('is_navigation').checked = true;
130 showHideByValue('is_navigation','','navigation_menu','table-row','radio',false);
131 </script>
132 {/if}
133
134 {literal}
135 <script type="text/javascript">
136 CRM.$(function($) {
137 var confirmed = false,
138 formName = {/literal}"{$form.formName}"{literal};
139 $('#_qf_' + formName + '_submit_next, #_qf_' + formName + '_submit_save').click(function() {
140 if ($('#is_navigation').prop('checked') && $('#parent_id').val() == '') {
141 var confirmMsg = {/literal}'{ts escape="js"}You have chosen to include this report in the Navigation Menu without selecting a Parent Menu item from the dropdown. This will add the report to the top level menu bar. Are you sure you want to continue?{/ts}'{literal}
142 return confirm(confirmMsg);
143 }
144 });
145 // Pop-up confirmation when clicking "Save a copy" (submit_next) or "Create Report" (submit_save)
146 var saveAction = $('#_qf_' + formName + '_submit_next').length ? 'next' : 'save';
147 $('#_qf_' + formName + '_submit_' + saveAction).click(function(e) {
148 if (!confirmed) {
149 var $button = $(this),
150 title = 'tr.crm-report-instanceForm-form-block-title',
151 description = 'tr.crm-report-instanceForm-form-block-description';
152 e.preventDefault();
153 e.stopImmediatePropagation();
154 CRM.confirm({
155 title: $(this).attr('value'),
156 message: '<table class="form-layout"><tr>' + $(title).html() + '</tr><tr>' + $(description).html() + '</tr></table>',
157 open: function() {
158 var $name = $('[name=title]', this);
159 if (saveAction == 'next') {
160 $name.val('' + $name.val() + ' ' + {/literal}'{ts escape='js'}(copy){/ts}'{literal})
161 }
162 }
163 })
164 .on('crmConfirm:yes', function() {
165 confirmed = true;
166 $('[name=title]', '#' + formName).val($('[name=title]', this).val());
167 $('[name=description]', '#' + formName).val($('[name=description]', this).val());
168 $button.click();
169 });
170 }
171 });
172 });
173 </script>
174 {/literal}