[Ref] [Import][Member] Remove unused params
[civicrm-core.git] / CRM / Member / Import / Form / Summary.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 5 | |
bc77d7c0
TO
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 |
6a488035 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
6a488035
TO
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
16 */
17
18/**
19 * This class summarizes the import results
20 */
52892e8b 21class CRM_Member_Import_Form_Summary extends CRM_Import_Form_Summary {
6a488035
TO
22
23 /**
fe482240 24 * Set variables up before form is built.
6a488035
TO
25 *
26 * @return void
6a488035
TO
27 */
28 public function preProcess() {
6a488035 29 // set the error message path to display
bb3a214a 30 $this->assign('errorFile', $this->get('errorFile'));
6a488035
TO
31
32 $totalRowCount = $this->get('totalRowCount');
33 $relatedCount = $this->get('relatedCount');
34 $totalRowCount += $relatedCount;
35 $this->set('totalRowCount', $totalRowCount);
36
719a6fec 37 $invalidRowCount = $this->get('invalidRowCount');
6a488035 38 $duplicateRowCount = $this->get('duplicateRowCount');
719a6fec 39 $onDuplicate = $this->get('onDuplicate');
67fa4d56 40
6a488035 41 if ($duplicateRowCount > 0) {
ca4caf13 42 $urlParams = 'type=' . CRM_Import_Parser::DUPLICATE . '&parser=CRM_Member_Import_Parser_Membership';
6a488035
TO
43 $this->set('downloadDuplicateRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
44 }
6a488035
TO
45 else {
46 $duplicateRowCount = 0;
47 $this->set('duplicateRowCount', $duplicateRowCount);
48 }
49
50 $this->assign('dupeError', FALSE);
51
a05662ef 52 if ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) {
6a488035
TO
53 $dupeActionString = ts('These records have been updated with the imported data.');
54 }
a05662ef 55 elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) {
6a488035
TO
56 $dupeActionString = ts('These records have been filled in with the imported data.');
57 }
58 else {
59 /* Skip by default */
60
61 $dupeActionString = ts('These records have not been imported.');
62
63 $this->assign('dupeError', TRUE);
64
ceb10dc7 65 /* only subtract dupes from successful import if we're skipping */
6a488035
TO
66
67 $this->set('validRowCount', $totalRowCount - $invalidRowCount -
67fa4d56 68 $duplicateRowCount
6a488035
TO
69 );
70 }
71 $this->assign('dupeActionString', $dupeActionString);
72
be2fb01f 73 $properties = [
353ffa53
TO
74 'totalRowCount',
75 'validRowCount',
76 'invalidRowCount',
353ffa53
TO
77 'downloadErrorRecordsUrl',
78 'duplicateRowCount',
79 'downloadDuplicateRecordsUrl',
353ffa53 80 'groupAdditions',
be2fb01f 81 ];
6a488035
TO
82 foreach ($properties as $property) {
83 $this->assign($property, $this->get($property));
84 }
85 }
86
6a488035 87}