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_Contribute_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 $invalidSoftCreditRowCount = $this->get('invalidSoftCreditRowCount');
37 if ($invalidSoftCreditRowCount) {
38 $urlParams = 'type=' . CRM_Contribute_Import_Parser_Contribution
::SOFT_CREDIT_ERROR
. '&parser=CRM_Contribute_Import_Parser_Contribution';
39 $this->set('downloadSoftCreditErrorRecordsUrl', CRM_Utils_System
::url('civicrm/export', $urlParams));
41 $validSoftCreditRowCount = $this->get('validSoftCreditRowCount');
42 $invalidPledgePaymentRowCount = $this->get('invalidPledgePaymentRowCount');
43 if ($invalidPledgePaymentRowCount) {
44 $urlParams = 'type=' . CRM_Contribute_Import_Parser_Contribution
::PLEDGE_PAYMENT_ERROR
. '&parser=CRM_Contribute_Import_Parser_Contribution';
45 $this->set('downloadPledgePaymentErrorRecordsUrl', CRM_Utils_System
::url('civicrm/export', $urlParams));
47 $validPledgePaymentRowCount = $this->get('validPledgePaymentRowCount');
48 $duplicateRowCount = $this->get('duplicateRowCount');
49 $onDuplicate = $this->get('onDuplicate');
50 if ($duplicateRowCount > 0) {
51 $urlParams = 'type=' . CRM_Import_Parser
::DUPLICATE
. '&parser=CRM_Contribute_Import_Parser_Contribution';
52 $this->set('downloadDuplicateRecordsUrl', CRM_Utils_System
::url('civicrm/export', $urlParams));
55 $duplicateRowCount = 0;
56 $this->set('duplicateRowCount', $duplicateRowCount);
59 $this->assign('dupeError', FALSE);
61 if ($onDuplicate == CRM_Import_Parser
::DUPLICATE_UPDATE
) {
62 $dupeActionString = ts('These records have been updated with the imported data.');
64 elseif ($onDuplicate == CRM_Import_Parser
::DUPLICATE_FILL
) {
65 $dupeActionString = ts('These records have been filled in with the imported data.');
70 $dupeActionString = ts('These records have not been imported.');
72 $this->assign('dupeError', TRUE);
74 /* only subtract dupes from successful import if we're skipping */
76 $this->set('validRowCount', $totalRowCount - $invalidRowCount -
77 $duplicateRowCount - $invalidSoftCreditRowCount - $invalidPledgePaymentRowCount
80 $this->assign('dupeActionString', $dupeActionString);
86 'validSoftCreditRowCount',
87 'invalidSoftCreditRowCount',
88 'downloadErrorRecordsUrl',
90 'downloadDuplicateRecordsUrl',
92 'validPledgePaymentRowCount',
93 'invalidPledgePaymentRowCount',
94 'downloadPledgePaymentErrorRecordsUrl',
95 'downloadSoftCreditErrorRecordsUrl',
97 foreach ($properties as $property) {
98 $this->assign($property, $this->get($property));