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
18 use Civi\Api4\UserJob
;
21 * This class summarizes the import results.
23 class CRM_Contact_Import_Form_Summary
extends CRM_Import_Form_Summary
{
26 * Set variables up before form is built.
28 * @throws \API_Exception
29 * @throws \CRM_Core_Exception
31 public function preProcess() {
32 $userJobID = CRM_Utils_Request
::retrieve('user_job_id', 'String', $this, TRUE);
33 $userJob = UserJob
::get(TRUE)->addWhere('id', '=', $userJobID)->addSelect('metadata', 'type_id:label')->execute()->first();
34 $this->setTitle($userJob['type_id:label']);
35 $onDuplicate = $userJob['metadata']['submitted_values']['onDuplicate'];
36 $this->assign('dupeError', FALSE);
38 if ($onDuplicate === CRM_Import_Parser
::DUPLICATE_UPDATE
) {
39 $this->assign('dupeActionString', ts('These records have been updated with the imported data.'));
41 elseif ($onDuplicate === CRM_Import_Parser
::DUPLICATE_FILL
) {
42 $this->assign('dupeActionString', ts('These records have been filled in with the imported data.'));
46 $this->assign('dupeActionString', ts('These records have not been imported.'));
47 $this->assign('dupeError', TRUE);
50 $this->assign('groupAdditions', $this->getUserJob()['metadata']['summary_info']['groups'] ??
[]);
51 $this->assign('tagAdditions', $this->getUserJob()['metadata']['summary_info']['tags'] ??
[]);
52 $this->assignOutputURLs();
53 $session = CRM_Core_Session
::singleton();
54 $session->pushUserContext(CRM_Utils_System
::url('civicrm/import/contact', 'reset=1'));