3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
21 * This class summarizes the import results
23 class CRM_Event_Import_Form_Summary
extends CRM_Import_Form_Summary
{
26 * Set variables up before form is built.
30 public function preProcess() {
31 // set the error message path to display
32 $this->assign('errorFile', $this->get('errorFile'));
34 $totalRowCount = $this->get('totalRowCount');
35 $relatedCount = $this->get('relatedCount');
36 $totalRowCount +
= $relatedCount;
37 $this->set('totalRowCount', $totalRowCount);
39 $invalidRowCount = $this->get('invalidRowCount');
40 $conflictRowCount = $this->get('conflictRowCount');
41 $duplicateRowCount = $this->get('duplicateRowCount');
42 $onDuplicate = $this->get('onDuplicate');
43 $mismatchCount = $this->get('unMatchCount');
44 if ($duplicateRowCount > 0) {
45 $urlParams = 'type=' . CRM_Import_Parser
::DUPLICATE
. '&parser=CRM_Event_Import_Parser';
46 $this->set('downloadDuplicateRecordsUrl', CRM_Utils_System
::url('civicrm/export', $urlParams));
48 elseif ($mismatchCount) {
49 $urlParams = 'type=' . CRM_Import_Parser
::NO_MATCH
. '&parser=CRM_Event_Import_Parser';
50 $this->set('downloadMismatchRecordsUrl', CRM_Utils_System
::url('civicrm/export', $urlParams));
53 $duplicateRowCount = 0;
54 $this->set('duplicateRowCount', $duplicateRowCount);
57 $this->assign('dupeError', FALSE);
59 if ($onDuplicate == CRM_Import_Parser
::DUPLICATE_UPDATE
) {
60 $dupeActionString = ts('These records have been updated with the imported data.');
62 elseif ($onDuplicate == CRM_Import_Parser
::DUPLICATE_FILL
) {
63 $dupeActionString = ts('These records have been filled in with the imported data.');
68 $dupeActionString = ts('These records have not been imported.');
70 $this->assign('dupeError', TRUE);
72 /* only subtract dupes from successful import if we're skipping */
74 $this->set('validRowCount', $totalRowCount - $invalidRowCount -
75 $conflictRowCount - $duplicateRowCount - $mismatchCount
78 $this->assign('dupeActionString', $dupeActionString);
85 'downloadConflictRecordsUrl',
86 'downloadErrorRecordsUrl',
88 'downloadDuplicateRecordsUrl',
89 'downloadMismatchRecordsUrl',
93 foreach ($properties as $property) {
94 $this->assign($property, $this->get($property));