

namibia
52c971b388eaa2c5d148a16a9c3e11cccd40b67d
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 91 92 93 94 95 96 97 98 99 100 |
<?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); $session->Contact['firstName']=$session->Profile['firstName']; $session->Contact['familyName']=$session->Profile['familyName']; $session->Contact['email']=$session->Profile['email']; $session->Contact['mobile']=$session->Profile['mobile']; $contact = $contactService->create($session->Contact); $session->Company['contact'] = $contact->id; $session->Company['name']= $session->Profile['firstName'].' '.$session->Profile['familyName']; $session->Company['businessName']= $session->Profile['firstName'].' '.$session->Profile['familyName']; $session->Company['group']= '3'; $session->Company['groupDivision']= '3'; // $session->Company['region']= '1'; // $session->Company['city']= '1'; // 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.'; #-> 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
Revision | Author | Commited | Message |
---|---|---|---|
52c971 ...
![]() |
Mark | Tue 14 Mar, 2017 10:28:32 +0000 | text changes to registration mail content |
da65b1 ...
![]() |
Mark | Wed 22 Feb, 2017 12:49:52 +0000 | UPDATE to Registration process to include location details and create dealership |
a47412 ...
![]() |
Mark | Tue 10 Jan, 2017 09:13:14 +0000 | updates for removing id and date of birth |
9aa85c ...
![]() |
Mark | Mon 21 Nov, 2016 18:15:54 +0000 | user registration remove company and owner etc |
bb2698 ...
![]() |
Mark | Mon 24 Oct, 2016 08:44:08 +0000 | latest update |
df0489 ... | Mark | Fri 14 Oct, 2016 10:01:00 +0000 | initial commit |