3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
37 * This class summarizes the import results
39 class CRM_Event_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 $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 $conflictRowCount = $this->get('conflictRowCount');
57 $duplicateRowCount = $this->get('duplicateRowCount');
58 $onDuplicate = $this->get('onDuplicate');
59 $mismatchCount = $this->get('unMatchCount');
60 if ($duplicateRowCount > 0) {
61 $urlParams = 'type=' . CRM_Import_Parser
::DUPLICATE
. '&parser=CRM_Event_Import_Parser';
62 $this->set('downloadDuplicateRecordsUrl', CRM_Utils_System
::url('civicrm/export', $urlParams));
64 elseif ($mismatchCount) {
65 $urlParams = 'type=' . CRM_Import_Parser
::NO_MATCH
. '&parser=CRM_Event_Import_Parser';
66 $this->set('downloadMismatchRecordsUrl', CRM_Utils_System
::url('civicrm/export', $urlParams));
69 $duplicateRowCount = 0;
70 $this->set('duplicateRowCount', $duplicateRowCount);
73 $this->assign('dupeError', FALSE);
75 if ($onDuplicate == CRM_Import_Parser
::DUPLICATE_UPDATE
) {
76 $dupeActionString = ts('These records have been updated with the imported data.');
78 elseif ($onDuplicate == CRM_Import_Parser
::DUPLICATE_FILL
) {
79 $dupeActionString = ts('These records have been filled in with the imported data.');
84 $dupeActionString = ts('These records have not been imported.');
86 $this->assign('dupeError', TRUE);
88 /* only subtract dupes from successful import if we're skipping */
90 $this->set('validRowCount', $totalRowCount - $invalidRowCount -
91 $conflictRowCount - $duplicateRowCount - $mismatchCount
94 $this->assign('dupeActionString', $dupeActionString);
101 'downloadConflictRecordsUrl',
102 'downloadErrorRecordsUrl',
104 'downloadDuplicateRecordsUrl',
105 'downloadMismatchRecordsUrl',
109 foreach ($properties as $property) {
110 $this->assign($property, $this->get($property));