Git Repository Public Repository

namibia

URLs

Copy to Clipboard
 
a474123352c7f66ddeb00932857300a567ebe777
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
namespace User\Service;



/**
 * Registration, login and forgot password functionality.
 * @author andre.fourie
 */
class Registration extends \User\DataBin\Registration
{

	/**
	 * ExecuteAfter: RegisterFinal.
	 * Register a new dealership and its primary user.
	 * @param array $meta
	 * @param object|null $jobRecord
	 * @param object|null $record
	 * @param \Workspace\Utility\ServiceInputParams $contract
	 * @return array
	 */
	public function RegisterCompany($meta, $jobRecord, $session, \Workspace\Utility\ServiceInputParams $contract)
	{
		$contactService = new \Person\Service\Contact();
		$contactService->setWorkflow(new \Person\Workflow());
//		$companyService = new \Company\Service\Company();
//		$companyService->setWorkflow(new \Company\Workflow());
		$profileService = new \User\Service\Profile();
		$profileService->setWorkflow(new \User\Workflow());
		//\Utility\Debug::errorLog('create contact', $session->Contact);
		$contact = $contactService->create($session->Contact);
		$session->Company['contact'] = $contact->id;
//		if (isset($session->BillingContact))
//		{
//		//\Utility\Debug::errorLog('create billing contact', $session->BillingContact);
//			$billingContact = $contactService->create($session->BillingContact);
//			$session->Company['contbillingContactact'] = $billingContact->id;
//		}
		//\Utility\Debug::errorLog('create company', $session->Company);
//		$company = $companyService->create($session->Company);
//		$session->Profile['company'] = $company->id;
//		if ($session->Profile['permissions'] < 5 || $session->Profile['permissions'] > 8)
//		{
//			$session->Profile['permissions'] = 5;
//		}
		$session->Profile['permissions'] = 12;
		\Utility\Debug::errorLog('create profile', $session->Profile);
		$profile = $profileService->create($session->Profile);

		$toCompanyId	= '';
		$toProfileId	= $profile->id;
		$email			= $profile->email;
		$mobile			= null;
		$subject		= null;
		$templateName	= 'activation-pending';

		$params = array();
		$params['firstName']	= $profile->firstName;
		$params['familyName']	= $profile->familyName;
		$params['message'] 		= 'Thank you for registering. Your registration was submitted for approval '
								. 'and you will receive email confirmation once your account has been verified.'
								. 'Please note that if any documents were not uploaded they need to be emailed'
								. ' (info@bid4cars.com.na) or faxed (086 618 5584) before we can approve your '
								. 'account.';

		#-> Send welcome notification to User.
		$oNotify = new \Utility\Comms\Notification();
		$oNotify->sendFromTemplate(
				null, null,
				$toCompanyId, $toProfileId,
				$email, $mobile,
				$subject,
				$templateName,
				$params
		);
		
		
		#-> Send welcome notification to Admin.
		$oNotify = new \Utility\Comms\Notification();
		$oNotify->sendFromTemplate(
				null, null,
				$toCompanyId, $toProfileId,
				'info@bid4cars.com.na', $mobile,
				$subject,
				$templateName,
				$params
		);
	}

}

Commits for namibiamodule/User/src/User/Service/Registration.php

Diff revisions: vs.
Revision Author Commited Message
a47412 ... Diff Diff Mark Tue 10 Jan, 2017 09:13:14 +0000

updates for removing id and date of birth

9aa85c ... Diff Diff Mark Mon 21 Nov, 2016 18:15:54 +0000

user registration remove company and owner etc

bb2698 ... Diff Diff Mark Mon 24 Oct, 2016 08:44:08 +0000

latest update

df0489 ... Mark Fri 14 Oct, 2016 10:01:00 +0000

initial commit