Skip to content
Snippets Groups Projects
Unverified Commit 392c3dcb authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #20797 from colemanw/reportTplFixes

Fix undefined tpl vars in CiviReport
parents 21b2e659 9e0c477b
Branches
Tags
No related merge requests found
Showing with 47 additions and 40 deletions
......@@ -49,7 +49,7 @@
{include file="CRM/Report/Form/ErrorMessage.tpl"}
</div>
{/if}
{if $outputMode == 'print'}
{if !empty($outputMode) && $outputMode == 'print'}
<script type="text/javascript">
window.print();
</script>
......
......@@ -7,7 +7,7 @@
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if !$printOnly} {* NO print section starts *}
{if empty($printOnly)} {* NO print section starts *}
{* build the print pdf buttons *}
<div class="crm-tasks">
......@@ -19,7 +19,7 @@
<table class="form-layout-compressed">
<tr>
{include file="CRM/common/tasks.tpl" location="botton"}
{if $instanceUrl}
{if !empty($instanceUrl)}
<td>&nbsp;&nbsp;<i class="crm-i fa-chevron-right" aria-hidden="true"></i> <a href="{$instanceUrl}">{ts}Existing report(s) from this template{/ts}</a></td>
{/if}
</tr>
......@@ -27,13 +27,13 @@
</td>
<td>
<table class="form-layout-compressed" align="right">
{if $chartSupported}
{if !empty($chartSupported)}
<tr>
<td>{$form.charts.html|crmAddClass:big}</td>
<td align="right">{$form.$chart.html}</td>
</tr>
{/if}
{if $form.groups}
{if !empty($form.groups)}
<tr>
<td>
{$form.groups.html}{$form.$group.html}
......@@ -71,7 +71,7 @@
// Disable print/pdf output of charts
$('select[name=charts]', 'form.crm-report-form').change(function() {
var viewType = $(this).val(),
flashChartType = '{/literal}{if $chartType}{$chartType}{else}{/if}{literal}';
flashChartType = '{/literal}{if !empty($chartType)}{$chartType}{else}{/if}{literal}';
$('#_qf_Summary_submit_pdf, #_qf_Summary_submit_print').prop('disabled', (viewType && flashChartType != viewType));
});
});
......
......@@ -24,7 +24,7 @@
{foreach from=$table item=field key=fieldName}
{literal}var val = "dnc";{/literal}
{assign var=fieldOp value=$fieldName|cat:"_op"}
{if !($field.operatorType & 4) && !$field.no_display && $form.$fieldOp.html}
{if !(!empty($field.operatorType) && $field.operatorType & 4) && empty($field.no_display) && !empty($form.$fieldOp.html)}
{literal}var val = document.getElementById("{/literal}{$fieldOp}{literal}").value;{/literal}
{/if}
{literal}showHideMaxMinVal( "{/literal}{$fieldName}{literal}", val );{/literal}
......@@ -52,7 +52,7 @@
$('.crm-report-criteria-groupby input:checkbox').click(function() {
$('#fields_' + this.id.substr(10)).prop('checked', this.checked);
});
{/literal}{if $displayToggleGroupByFields}{literal}
{/literal}{if !empty($displayToggleGroupByFields)}{literal}
$('.crm-report-criteria-field input:checkbox').click(function() {
$('#group_bys_' + this.id.substr(7)).prop('checked', this.checked);
});
......
......@@ -7,7 +7,7 @@
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if $outputMode eq 'html' && !$rows}
{if !empty($outputMode) && $outputMode eq 'html' && empty($rows)}
<div class="messages status no-popup">
{icon icon="fa-info-circle"}{/icon} {ts}None found.{/ts}
</div>
......
......@@ -7,8 +7,8 @@
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if !$printOnly} {* NO print section starts *}
{if $criteriaForm}
{if empty($printOnly)} {* NO print section starts *}
{if !empty($criteriaForm)}
<div class="crm-report-criteria"> {* criteria section starts *}
<div id="mainTabContainer">
{*tab navigation bar*}
......@@ -18,7 +18,7 @@
<a title="{$tab.title|escape}" href="#report-tab-{$tab.div_label}">{$tab.title}</a>
</li>
{/foreach}
{if $instanceForm OR $instanceFormError}
{if !empty($instanceForm) OR !empty($instanceFormError)}
<li id="tab_settings" class="ui-corner-all">
<a title="{ts}Title and Format{/ts}" href="#report-tab-format">{ts}Title and Format{/ts}</a>
</li>
......@@ -35,7 +35,7 @@
{include file="CRM/Report/Form/Criteria.tpl"}
{*settings*}
{if $instanceForm OR $instanceFormError}
{if !empty($instanceForm) OR !empty($instanceFormError)}
{include file="CRM/Report/Form/Tabs/Instance.tpl"}
{/if}
</div> {* end mainTabContainer *}
......@@ -51,7 +51,7 @@
CRM.$(function($) {
var tabSettings = {
collapsible: true,
active: {/literal}{if $rows}false{else}0{/if}{literal}
active: {/literal}{if !empty($rows)}false{else}0{/if}{literal}
};
// If a tab contains an error, open it
if ($('.civireport-criteria .crm-error', '#mainTabContainer').length) {
......
......@@ -24,7 +24,7 @@
{*include the graph*}
{include file="CRM/Report/Form/Layout/Graph.tpl"}
{if $printOnly}
{if !empty($printOnly)}
<h1>{$reportTitle}</h1>
<div id="report-date">{$reportDate}</div>
{/if}
......
......@@ -7,7 +7,7 @@
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if !$rows}
{if empty($rows)}
<p>{ts}None found.{/ts}</p>
{else}
{if !empty($pager) and $pager->_response and $pager->_response.numPages > 1}
......@@ -98,7 +98,7 @@
{assign var=fieldHover value=$field|cat:"_hover"}
{assign var=fieldClass value=$field|cat:"_class"}
<td class="crm-report-{$field}{if $header.type eq 1024 OR $header.type eq 1 OR $header.type eq 512} report-contents-right{elseif $row.$field eq 'Subtotal'} report-label{/if}">
{if $row.$fieldLink}
{if !empty($row.$fieldLink)}
<a title="{$row.$fieldHover|escape}" href="{$row.$fieldLink}" {if !empty($row.$fieldClass)} class="{$row.$fieldClass}"{/if}>
{/if}
......@@ -130,7 +130,7 @@
{$row.$field}
{/if}
{if $row.$fieldLink}</a>{/if}
{if !empty($row.$fieldLink)}</a>{/if}
</td>
{/foreach}
</tr>
......
......@@ -8,13 +8,13 @@
+--------------------------------------------------------------------+
*}
{if !empty($top)}
{if $printOnly}
{if !empty($printOnly)}
<h1>{$reportTitle}</h1>
<div id="report-date">{$reportDate}</div>
<div id="report-date">{if !empty($reportDate)}{$reportDate}{/if}</div>
{/if}
{if $statistics}
{if !empty($statistics)}
<table class="report-layout statistics-table">
{if !empty($statistics.groups)}
{if !empty($statistics.groups)}
{foreach from=$statistics.groups item=row}
<tr>
<th class="statistics" scope="row">{$row.title}</th>
......
......@@ -12,7 +12,7 @@
{foreach from=$colGroups item=grpFields key=dnc}
{assign var="count" value="0"}
{* Wrap custom field sets in collapsed accordion pane. *}
{if $grpFields.use_accordian_for_field_selection}
{if !empty($grpFields.use_accordian_for_field_selection)}
<div class="crm-accordion-wrapper crm-accordion collapsed">
<div class="crm-accordion-header">
{$grpFields.group_title}
......@@ -33,7 +33,7 @@
{/if}
</tr>
</table>
{if $grpFields.use_accordian_for_field_selection}
{if !empty($grpFields.use_accordian_for_field_selection)}
</div><!-- /.crm-accordion-body -->
</div><!-- /.crm-accordion-wrapper -->
{/if}
......
......@@ -14,7 +14,7 @@
{foreach from=$filters item=table key=tableName}
{assign var="filterCount" value=$table|@count}
{* Wrap custom field sets in collapsed accordion pane. *}
{if $filterGroups.$tableName.group_title and $filterCount gte 1}
{if !empty($filterGroups.$tableName.group_title) and $filterCount gte 1}
{* we should close table that contains other filter elements before we start building custom group accordion
*}
{if $counter eq 1}
......@@ -33,23 +33,26 @@
{assign var=filterVal value=$fieldName|cat:"_value"}
{assign var=filterMin value=$fieldName|cat:"_min"}
{assign var=filterMax value=$fieldName|cat:"_max"}
{if $field.operatorType & 4}
{if !empty($field.operatorType) && $field.operatorType & 4}
<tr class="report-contents crm-report crm-report-criteria-filter crm-report-criteria-filter-{$tableName}">
<td class="label report-contents">{$field.title}</td>
{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName=$fieldName hideRelativeLabel=1, from='_from' to='_to'}
<td class="label report-contents">{if !empty($field.title)}{$field.title}{/if}</td>
{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName=$fieldName hideRelativeLabel=1 from='_from' to='_to'}
</tr>
{elseif $form.$fieldOp.html}
<tr class="report-contents crm-report crm-report-criteria-filter crm-report-criteria-filter-{$tableName}" {if $field.no_display} style="display: none;"{/if}>
<td class="label report-contents">{$field.title}</td>
<tr class="report-contents crm-report crm-report-criteria-filter crm-report-criteria-filter-{$tableName}" {if !empty($field.no_display)} style="display: none;"{/if}>
<td class="label report-contents">{if !empty($field.title)}{$field.title}{/if}</td>
<td class="report-contents">{$form.$fieldOp.html}</td>
<td>
<span id="{$filterVal}_cell">{$form.$filterVal.label}&nbsp;{$form.$filterVal.html}</span>
<span id="{$filterMin}_max_cell">{$form.$filterMin.label}&nbsp;{$form.$filterMin.html}&nbsp;&nbsp;{$form.$filterMax.label}&nbsp;{$form.$filterMax.html}</span>
<span id="{$filterMin}_max_cell">
{if !empty($form.$filterMin)}{$form.$filterMin.label}&nbsp;{$form.$filterMin.html}&nbsp;&nbsp;{/if}
{if !empty($form.$filterMax)}{$form.$filterMax.label}&nbsp;{$form.$filterMax.html}{/if}
</span>
</td>
</tr>
{/if}
{/foreach}
{if $filterGroups.$tableName.group_title}
{if !empty($filterGroups.$tableName.group_title)}
</table>
</div><!-- /.crm-accordion-body -->
</div><!-- /.crm-accordion-wrapper -->
......
......@@ -58,19 +58,23 @@
<td class="report-label">{$form.parent_id.label} {help id="id-parent" file="CRM/Admin/Form/Navigation.hlp"}</td>
<td>{$form.parent_id.html|crmAddClass:huge}</td>
</tr>
{if !empty($form.drilldown_id)}
<tr class="crm-report-instanceForm-form-block-drilldown">
<td class="report-label">{$form.drilldown_id.label}</td>
<td>{$form.drilldown_id.html}</td>
</tr>
{/if}
{if $config->userFramework neq 'Joomla'}
<tr class="crm-report-instanceForm-form-block-permission">
<td class="report-label" width="20%">{$form.permission.label} {help id="id-report_perms" file="CRM/Report/Form/Tabs/Settings.hlp"}</td>
<td>{$form.permission.html|crmAddClass:huge}</td>
</tr>
{if !empty($form.grouprole)}
<tr class="crm-report-instanceForm-form-block-role">
<td class="report-label" width="20%">{$form.grouprole.label}</td>
<td>{$form.grouprole.html|crmAddClass:huge}</td>
</tr>
{/if}
{/if}
<tr class="crm-report-instanceForm-form-block-add-to-my-reports">
<td class="report-label">{$form.add_to_my_reports.label} {help id="id-add_to_my_reports" file="CRM/Report/Form/Tabs/Settings.hlp"}</td>
......@@ -119,7 +123,7 @@
});
</script>
{/literal}
{if $is_navigation}
{if !empty($is_navigation)}
<script type="text/javascript">
document.getElementById('is_navigation').checked = true;
showHideByValue('is_navigation','','navigation_menu','table-row','radio',false);
......
......@@ -9,10 +9,10 @@
*}
{strip}
<div class="action-link">
{if $templateUrl}
{if !empty($templateUrl)}
<a href="{$templateUrl}" class="button"><span><i class="crm-i fa-plus-circle" aria-hidden="true"></i> {$newButton}</span></a>
{/if}
{if $reportUrl}
{if !empty($reportUrl)}
<a href="{$reportUrl}" class="button"><span>{ts}View All Reports{/ts}</span></a>
{/if}
</div>
......@@ -53,10 +53,10 @@
</div>
<div class="action-link">
{if $templateUrl}
{if !empty($templateUrl)}
<a href="{$templateUrl}" class="button"><span><i class="crm-i fa-plus-circle" aria-hidden="true"></i> {$newButton}</span></a>
{/if}
{if $reportUrl}
{if !empty($reportUrl)}
<a href="{$reportUrl}" class="button"><span>{ts}View All Reports{/ts}</span></a>
{/if}
</div>
......@@ -65,11 +65,11 @@
<div class="crm-content-block">
<div class="messages status no-popup">
{icon icon="fa-info-circle"}{/icon}
{if $myReports}
{if !empty($myReports)}
{ts}You do not have any private reports. To add a report to this section, edit the Report Settings for a report and set 'Add to My Reports' to Yes.{/ts} &nbsp;
{else}
{ts 1=$compName}No %1 reports have been created.{/ts} &nbsp;
{if $templateUrl}
{if !empty($templateUrl)}
{ts 1=$templateUrl}You can create reports by selecting from the <a href="%1">list of report templates here.</a>{/ts}
{else}
{ts}Contact your site administrator for help creating reports.{/ts}
......
......@@ -28,7 +28,7 @@
<tr id="row_{counter}" class="crm-report-templateList">
<td class="crm-report-templateList-title" style="width:35%;">
<a href="{$row.url}" title="{ts}Create report from this template{/ts}"><i class="crm-i fa-chevron-right" aria-hidden="true"></i> <strong>{$row.title}</strong></a>
{if $row.instanceUrl}
{if !empty($row.instanceUrl)}
<div style="font-size:10px;text-align:right;margin-top:3px;">
<a href="{$row.instanceUrl}">{ts}Existing Report(s){/ts}</a>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment