From e166a1c7e84d70e07f980f0da25aafd2a1732281 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 1 Dec 2021 12:22:20 +1300 Subject: [PATCH] [Smarty variables] The last isset.... civicrm/report/list?reset=1 --- CRM/Report/Page/InstanceList.php | 26 +++++++++++++++------- templates/CRM/Report/Page/InstanceList.tpl | 16 ++++++------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/CRM/Report/Page/InstanceList.php b/CRM/Report/Page/InstanceList.php index 97657f0829..96c31a4799 100644 --- a/CRM/Report/Page/InstanceList.php +++ b/CRM/Report/Page/InstanceList.php @@ -45,6 +45,15 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page { */ protected $_grouping = NULL; + /** + * Possibly always null.... maybe $_title is used... + * + * The relationship between this & $_title is ambigous & seemingly not worked through. + * + * @var string + */ + protected $title; + /** * ID of parent report template if list is filtered by template. * @@ -190,19 +199,16 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page { $this->grouping = CRM_Utils_Request::retrieve('grp', 'String', $this); $rows = $this->info(); - + $this->assign('title', $this->title); $this->assign('list', $rows); if ($this->ovID or $this->compID) { // link to view all reports $reportUrl = CRM_Utils_System::url('civicrm/report/list', "reset=1"); - $this->assign('reportUrl', $reportUrl); - if ($this->ovID) { - $this->assign('title', $this->title); - } - else { + if (!$this->ovID) { CRM_Utils_System::setTitle(ts('%1 Reports', [1 => $this->_compName])); } } + $this->assign('reportUrl', $reportUrl ?? FALSE); // assign link to template list for users with appropriate permissions if (CRM_Core_Permission::check('administer Reports')) { if ($this->compID) { @@ -214,10 +220,10 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page { $templateUrl = CRM_Utils_System::url('civicrm/report/template/list', "reset=1"); } $this->assign('newButton', $newButton); - $this->assign('templateUrl', $templateUrl); $this->assign('compName', $this->_compName); - $this->assign('myReports', $this->myReports); } + $this->assign('myReports', $this->myReports); + $this->assign('templateUrl', $templateUrl ?? NULL); return parent::run(); } @@ -235,14 +241,17 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page { 'copy' => [ 'url' => CRM_Utils_System::url($urlCommon, 'reset=1&output=copy'), 'label' => ts('Save a Copy'), + 'confirm_message' => NULL, ], 'pdf' => [ 'url' => CRM_Utils_System::url($urlCommon, 'reset=1&force=1&output=pdf'), 'label' => ts('View as pdf'), + 'confirm_message' => NULL, ], 'print' => [ 'url' => CRM_Utils_System::url($urlCommon, 'reset=1&force=1&output=print'), 'label' => ts('Print report'), + 'confirm_message' => NULL, ], ]; // Hackery, Hackera, Hacker ahahahahahaha a super nasty hack. @@ -257,6 +266,7 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page { $actions['csv'] = [ 'url' => CRM_Utils_System::url($urlCommon, 'reset=1&force=1&output=csv'), 'label' => ts('Export to csv'), + 'confirm_message' => NULL, ]; } if (CRM_Core_Permission::check('administer Reports')) { diff --git a/templates/CRM/Report/Page/InstanceList.tpl b/templates/CRM/Report/Page/InstanceList.tpl index 329e717dc0..d12f9e31a7 100644 --- a/templates/CRM/Report/Page/InstanceList.tpl +++ b/templates/CRM/Report/Page/InstanceList.tpl @@ -9,10 +9,10 @@ *} {strip} @@ -22,7 +22,7 @@ {foreach from=$list item=rows key=report}
- {if isset($title)}{$title}{elseif $report EQ 'Contribute'}{ts}Contribution Reports{/ts}{else}{ts 1=$report}%1 Reports{/ts}{/if} + {if $title}{$title}{elseif $report EQ 'Contribute'}{ts}Contribution Reports{/ts}{else}{ts 1=$report}%1 Reports{/ts}{/if}
@@ -37,7 +37,7 @@
    {foreach from=$row.actions item=action key=action_name}
  • {$action.label}
  • {/foreach}
@@ -53,10 +53,10 @@
@@ -65,7 +65,7 @@
{icon icon="fa-info-circle"}{/icon} - {if !empty($myReports)} + {if !$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}   {else} {if $compName} @@ -73,7 +73,7 @@ {else} {ts}No reports have been created.{/ts}   {/if} - {if !empty($templateUrl)} + {if $templateUrl} {ts 1=$templateUrl}You can create reports by selecting from the list of report templates here.{/ts} {else} {ts}Contact your site administrator for help creating reports.{/ts} -- 2.25.1