diff --git a/CRM/Import/Form/Preview.php b/CRM/Import/Form/Preview.php index d0994b0fe997..053f30072917 100644 --- a/CRM/Import/Form/Preview.php +++ b/CRM/Import/Form/Preview.php @@ -72,6 +72,10 @@ protected function assignPreviewVariables(): void { $this->assign('mapper', $this->getMappedFieldLabels()); $this->assign('dataValues', $this->getDataRows([], 2)); $this->assign('columnNames', $this->getColumnHeaders()); + // This can be overridden by Civi-Import so that the Download url + // links that go to SearchKit open in a new tab. + $this->assign('isOpenResultsInNewTab'); + $this->assign('allRowsURL'); //get the mapping name displayed if the mappingId is set $mappingId = $this->get('loadMappingId'); if ($mappingId) { diff --git a/ext/civiimport/civiimport.php b/ext/civiimport/civiimport.php index 158135f84604..d8df1ca60904 100644 --- a/ext/civiimport/civiimport.php +++ b/ext/civiimport/civiimport.php @@ -238,7 +238,12 @@ function civiimport_civicrm_buildForm(string $formName, $form) { } } - if ($formName === 'CRM_Contact_Import_Form_Summary') { + //@todo - do for all Preview forms - just need to fix each Preview.tpl to + // not open in new tab as they are not yet consolidated into one file. + // (Or consolidate them now). + if ($formName === 'CRM_Contact_Import_Form_Summary' || $formName === 'CRM_Contribute_Import_Form_Preview') { + $form->assign('isOpenResultsInNewTab', TRUE); $form->assign('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/search', '', TRUE, '/display/Import_' . $form->getUserJobID() . '/Import_' . $form->getUserJobID() . '?_status=ERROR', FALSE)); + $form->assign('allRowsUrl', CRM_Utils_System::url('civicrm/search', '', TRUE, '/display/Import_' . $form->getUserJobID() . '/Import_' . $form->getUserJobID(), FALSE)); } } diff --git a/templates/CRM/Contribute/Import/Form/Preview.tpl b/templates/CRM/Contribute/Import/Form/Preview.tpl index 03458208b07c..9f4f93f658ff 100644 --- a/templates/CRM/Contribute/Import/Form/Preview.tpl +++ b/templates/CRM/Contribute/Import/Form/Preview.tpl @@ -20,7 +20,7 @@ {if $invalidRowCount}

- {ts 1=$invalidRowCount 2=$downloadErrorRecordsUrl}CiviCRM has detected invalid data or formatting errors in %1 records. If you continue, these records will be skipped. You can download a file with just these problem records: Download Errors. If you wish, you can then correct them in the original import file, cancel this import, and begin again at step 1.{/ts} + {ts 1=$invalidRowCount 2=$downloadErrorRecordsUrl}CiviCRM has detected invalid data or formatting errors in %1 records. If you continue, these records will be skipped. You can review these problem records: See Errors. If you wish, you can then correct them in the original import file, cancel this import, and begin again at step 1.{/ts}

{/if} @@ -32,7 +32,9 @@ - + {if $invalidRowCount} @@ -40,7 +42,7 @@
{ts}Total Rows{/ts} {$totalRowCount}{ts}Total rows (contribution records) in uploaded file.{/ts}{ts}Total rows (contribution records) in uploaded file.{/ts} + {if $allRowsUrl} {ts}See rows{/ts}{/if} +
{$invalidRowCount} {ts}Rows with invalid data in one or more fields. These rows will be skipped (not imported).{/ts} {if $invalidRowCount} -

{ts}Download Errors{/ts}

+

{ts}See Errors{/ts}

{/if}