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
19 * This class summarizes the import results.
21 class CRM_Activity_Import_Form_Summary
extends CRM_Import_Form_Summary
{
24 * Set variables up before form is built.
26 public function preProcess() {
27 // set the error message path to display
28 $this->assign('errorFile', $this->get('errorFile'));
30 $totalRowCount = $this->get('totalRowCount');
31 $relatedCount = $this->get('relatedCount');
32 $totalRowCount +
= $relatedCount;
33 $this->set('totalRowCount', $totalRowCount);
35 $invalidRowCount = $this->get('invalidRowCount');
36 $conflictRowCount = $this->get('conflictRowCount');
37 $duplicateRowCount = $this->get('duplicateRowCount');
38 $onDuplicate = $this->get('onDuplicate');
39 $mismatchCount = $this->get('unMatchCount');
40 if ($duplicateRowCount > 0) {
41 $urlParams = 'type=' . CRM_Import_Parser
::DUPLICATE
. '&parser=CRM_Activity_Import_Parser';
42 $this->set('downloadDuplicateRecordsUrl', CRM_Utils_System
::url('civicrm/export', $urlParams));
44 elseif ($mismatchCount) {
45 $urlParams = 'type=' . CRM_Import_Parser
::NO_MATCH
. '&parser=CRM_Activity_Import_Parser';
46 $this->set('downloadMismatchRecordsUrl', CRM_Utils_System
::url('civicrm/export', $urlParams));
49 $duplicateRowCount = 0;
50 $this->set('duplicateRowCount', $duplicateRowCount);
53 $this->assign('dupeError', FALSE);
55 if ($onDuplicate == CRM_Import_Parser
::DUPLICATE_UPDATE
) {
56 $dupeActionString = ts('These records have been updated with the imported data.');
58 elseif ($onDuplicate == CRM_Import_Parser
::DUPLICATE_FILL
) {
59 $dupeActionString = ts('These records have been filled in with the imported data.');
64 $dupeActionString = ts('These records have not been imported.');
66 $this->assign('dupeError', TRUE);
68 // Only subtract dupes from successful import if we're skipping.
70 $this->set('validRowCount', $totalRowCount - $invalidRowCount -
71 $conflictRowCount - $duplicateRowCount - $mismatchCount
74 $this->assign('dupeActionString', $dupeActionString);
81 'downloadConflictRecordsUrl',
82 'downloadErrorRecordsUrl',
84 'downloadDuplicateRecordsUrl',
85 'downloadMismatchRecordsUrl',
89 foreach ($properties as $property) {
90 $this->assign($property, $this->get($property));