3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2014
37 * This class summarizes the import results
39 class CRM_Contribute_Import_Form_Summary
extends CRM_Import_Form_Summary
{
42 * Set variables up before form is built
46 public function preProcess() {
47 // set the error message path to display
48 $errorFile = $this->assign('errorFile', $this->get('errorFile'));
50 $totalRowCount = $this->get('totalRowCount');
51 $relatedCount = $this->get('relatedCount');
52 $totalRowCount +
= $relatedCount;
53 $this->set('totalRowCount', $totalRowCount);
55 $invalidRowCount = $this->get('invalidRowCount');
56 $invalidSoftCreditRowCount = $this->get('invalidSoftCreditRowCount');
57 if ($invalidSoftCreditRowCount) {
58 $urlParams = 'type=' . CRM_Contribute_Import_Parser
::SOFT_CREDIT_ERROR
. '&parser=CRM_Contribute_Import_Parser';
59 $this->set('downloadSoftCreditErrorRecordsUrl', CRM_Utils_System
::url('civicrm/export', $urlParams));
61 $validSoftCreditRowCount = $this->get('validSoftCreditRowCount');
62 $invalidPledgePaymentRowCount = $this->get('invalidPledgePaymentRowCount');
63 if ($invalidPledgePaymentRowCount) {
64 $urlParams = 'type=' . CRM_Contribute_Import_Parser
::PLEDGE_PAYMENT_ERROR
. '&parser=CRM_Contribute_Import_Parser';
65 $this->set('downloadPledgePaymentErrorRecordsUrl', CRM_Utils_System
::url('civicrm/export', $urlParams));
67 $validPledgePaymentRowCount = $this->get('validPledgePaymentRowCount');
68 $conflictRowCount = $this->get('conflictRowCount');
69 $duplicateRowCount = $this->get('duplicateRowCount');
70 $onDuplicate = $this->get('onDuplicate');
71 $mismatchCount = $this->get('unMatchCount');
72 if ($duplicateRowCount > 0) {
73 $urlParams = 'type=' . CRM_Import_Parser
::DUPLICATE
. '&parser=CRM_Contribute_Import_Parser';
74 $this->set('downloadDuplicateRecordsUrl', CRM_Utils_System
::url('civicrm/export', $urlParams));
76 elseif ($mismatchCount) {
77 $urlParams = 'type=' . CRM_Import_Parser
::NO_MATCH
. '&parser=CRM_Contribute_Import_Parser';
78 $this->set('downloadMismatchRecordsUrl', CRM_Utils_System
::url('civicrm/export', $urlParams));
81 $duplicateRowCount = 0;
82 $this->set('duplicateRowCount', $duplicateRowCount);
85 $this->assign('dupeError', FALSE);
87 if ($onDuplicate == CRM_Import_Parser
::DUPLICATE_UPDATE
) {
88 $dupeActionString = ts('These records have been updated with the imported data.');
90 elseif ($onDuplicate == CRM_Import_Parser
::DUPLICATE_FILL
) {
91 $dupeActionString = ts('These records have been filled in with the imported data.');
96 $dupeActionString = ts('These records have not been imported.');
98 $this->assign('dupeError', TRUE);
100 /* only subtract dupes from successful import if we're skipping */
102 $this->set('validRowCount', $totalRowCount - $invalidRowCount -
103 $conflictRowCount - $duplicateRowCount - $mismatchCount - $invalidSoftCreditRowCount - $invalidPledgePaymentRowCount
106 $this->assign('dupeActionString', $dupeActionString);
108 $properties = array('totalRowCount', 'validRowCount', 'invalidRowCount', 'validSoftCreditRowCount', 'invalidSoftCreditRowCount', 'conflictRowCount', 'downloadConflictRecordsUrl', 'downloadErrorRecordsUrl', 'duplicateRowCount', 'downloadDuplicateRecordsUrl', 'downloadMismatchRecordsUrl', 'groupAdditions', 'unMatchCount', 'validPledgePaymentRowCount', 'invalidPledgePaymentRowCount', 'downloadPledgePaymentErrorRecordsUrl', 'downloadSoftCreditErrorRecordsUrl');
109 foreach ($properties as $property) {
110 $this->assign($property, $this->get($property));