Commit | Line | Data |
---|---|---|
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 | /** | |
f12c6f7d | 19 | * This class summarizes the import results. |
6a488035 | 20 | */ |
52892e8b | 21 | class CRM_Contact_Import_Form_Summary extends CRM_Import_Form_Summary { |
6a488035 TO |
22 | |
23 | /** | |
fe482240 | 24 | * Set variables up before form is built. |
c4f66023 EM |
25 | * |
26 | * @throws \API_Exception | |
27 | * @throws \CRM_Core_Exception | |
6a488035 TO |
28 | */ |
29 | public function preProcess() { | |
30 | // set the error message path to display | |
81c3812a | 31 | $this->assign('errorFile', $this->get('errorFile')); |
feab3e2e | 32 | $onDuplicate = $this->getSubmittedValue('onDuplicate'); |
6a488035 TO |
33 | $this->assign('dupeError', FALSE); |
34 | ||
a05662ef | 35 | if ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) { |
c4f66023 | 36 | $this->assign('dupeActionString', ts('These records have been updated with the imported data.')); |
6a488035 | 37 | } |
a05662ef | 38 | elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) { |
c4f66023 | 39 | $this->assign('dupeActionString', ts('These records have been filled in with the imported data.')); |
6a488035 TO |
40 | } |
41 | else { | |
42 | /* Skip by default */ | |
c4f66023 | 43 | $this->assign('dupeActionString', ts('These records have not been imported.')); |
6a488035 TO |
44 | $this->assign('dupeError', TRUE); |
45 | } | |
6a488035 | 46 | |
c4f66023 EM |
47 | $this->assign('groupAdditions', $this->get('groupAdditions')); |
48 | $this->assign('tagAdditions', $this->get('tagAdditions')); | |
99e3c5f7 | 49 | $this->assign('totalRowCount', $this->getRowCount()); |
c4f66023 | 50 | $this->assign('validRowCount', $this->getRowCount(CRM_Import_Parser::VALID) + $this->getRowCount(CRM_Import_Parser::UNPARSED_ADDRESS_WARNING)); |
99e3c5f7 | 51 | $this->assign('invalidRowCount', $this->getRowCount(CRM_Import_Parser::ERROR)); |
f5d23fe9 | 52 | $this->assign('duplicateRowCount', $this->getRowCount(CRM_Import_Parser::DUPLICATE)); |
c4f66023 EM |
53 | $this->assign('unMatchCount', $this->getRowCount(CRM_Import_Parser::NO_MATCH)); |
54 | $this->assign('unparsedAddressCount', $this->getRowCount(CRM_Import_Parser::UNPARSED_ADDRESS_WARNING)); | |
99e3c5f7 | 55 | $this->assign('downloadDuplicateRecordsUrl', $this->getDownloadURL(CRM_Import_Parser::DUPLICATE)); |
f5d23fe9 | 56 | $this->assign('downloadErrorRecordsUrl', $this->getDownloadURL(CRM_Import_Parser::ERROR)); |
c4f66023 EM |
57 | $this->assign('downloadMismatchRecordsUrl', $this->getDownloadURL(CRM_Import_Parser::NO_MATCH)); |
58 | $this->assign('downloadAddressRecordsUrl', $this->getDownloadURL(CRM_Import_Parser::UNPARSED_ADDRESS_WARNING)); | |
6a488035 TO |
59 | $session = CRM_Core_Session::singleton(); |
60 | $session->pushUserContext(CRM_Utils_System::url('civicrm/import/contact', 'reset=1')); | |
61 | } | |
62 | ||
6a488035 | 63 | /** |
fe482240 | 64 | * Clean up the import table we used. |
6a488035 TO |
65 | */ |
66 | public function postProcess() { | |
6a488035 TO |
67 | } |
68 | ||
6a488035 | 69 | } |