Commit | Line | Data |
---|---|---|
52892e8b CW |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
bc77d7c0 | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
52892e8b | 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 | | |
52892e8b | 9 | +--------------------------------------------------------------------+ |
d25dd0ee | 10 | */ |
52892e8b CW |
11 | |
12 | /** | |
13 | * | |
14 | * @package CRM | |
ca5cec67 | 15 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
52892e8b CW |
16 | */ |
17 | ||
18 | /** | |
2b4bc760 | 19 | * This class summarizes the import results. |
20 | * | |
52892e8b CW |
21 | * TODO: CRM-11254 - if preProcess and postProcess functions can be reconciled between the 5 child classes, |
22 | * those classes can be removed entirely and this class will not need to be abstract | |
23 | */ | |
99e3c5f7 | 24 | abstract class CRM_Import_Form_Summary extends CRM_Import_Forms { |
52892e8b | 25 | |
992a3d9e EM |
26 | /** |
27 | * Set variables up before form is built. | |
28 | * | |
29 | * @return void | |
30 | */ | |
31 | public function preProcess() { | |
32 | $this->assignOutputURLs(); | |
33 | } | |
34 | ||
52892e8b | 35 | /** |
fe482240 | 36 | * Build the form object. |
52892e8b CW |
37 | */ |
38 | public function buildQuickForm() { | |
39 | $this->addButtons(array( | |
40 | array( | |
41 | 'type' => 'next', | |
42 | 'name' => ts('Done'), | |
43 | 'isDefault' => TRUE, | |
44 | ), | |
971e129b | 45 | )); |
52892e8b CW |
46 | } |
47 | ||
48 | /** | |
2b4bc760 | 49 | * Return a descriptive name for the page, used in wizard header. |
52892e8b CW |
50 | * |
51 | * @return string | |
52892e8b CW |
52 | */ |
53 | public function getTitle() { | |
54 | return ts('Summary'); | |
55 | } | |
96025800 | 56 | |
992a3d9e EM |
57 | protected function assignOutputURLs(): void { |
58 | $this->assign('totalRowCount', $this->getRowCount()); | |
59 | $this->assign('validRowCount', $this->getRowCount(CRM_Import_Parser::VALID) + $this->getRowCount(CRM_Import_Parser::UNPARSED_ADDRESS_WARNING)); | |
60 | $this->assign('invalidRowCount', $this->getRowCount(CRM_Import_Parser::ERROR)); | |
61 | $this->assign('duplicateRowCount', $this->getRowCount(CRM_Import_Parser::DUPLICATE)); | |
62 | $this->assign('unMatchCount', $this->getRowCount(CRM_Import_Parser::NO_MATCH)); | |
63 | $this->assign('unparsedAddressCount', $this->getRowCount(CRM_Import_Parser::UNPARSED_ADDRESS_WARNING)); | |
64 | $this->assign('downloadDuplicateRecordsUrl', $this->getDownloadURL(CRM_Import_Parser::DUPLICATE)); | |
65 | $this->assign('downloadErrorRecordsUrl', $this->getDownloadURL(CRM_Import_Parser::ERROR)); | |
66 | $this->assign('downloadMismatchRecordsUrl', $this->getDownloadURL(CRM_Import_Parser::NO_MATCH)); | |
67 | $this->assign('downloadAddressRecordsUrl', $this->getDownloadURL(CRM_Import_Parser::UNPARSED_ADDRESS_WARNING)); | |
68 | } | |
69 | ||
52892e8b | 70 | } |