X-Git-Url: https://xp-dev.com/git/namibia/blobdiff_plain/9aa85c56e9cd4cb70d6d651b0e2fb8e9d40c15ff..HEAD:/module/User/src/User/Service/Registration.php diff --git a/module/User/src/User/Service/Registration.php b/module/User/src/User/Service/Registration.php index 4b33854..7223194 100644 --- a/module/User/src/User/Service/Registration.php +++ b/module/User/src/User/Service/Registration.php @@ -23,13 +23,26 @@ class Registration extends \User\DataBin\Registration { $contactService = new \Person\Service\Contact(); $contactService->setWorkflow(new \Person\Workflow()); -// $companyService = new \Company\Service\Company(); -// $companyService->setWorkflow(new \Company\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); @@ -37,8 +50,8 @@ class Registration extends \User\DataBin\Registration // $session->Company['contbillingContactact'] = $billingContact->id; // } //\Utility\Debug::errorLog('create company', $session->Company); -// $company = $companyService->create($session->Company); -// $session->Profile['company'] = $company->id; + $company = $companyService->create($session->Company); + $session->Profile['company'] = $company->id; // if ($session->Profile['permissions'] < 5 || $session->Profile['permissions'] > 8) // { // $session->Profile['permissions'] = 5; @@ -47,7 +60,7 @@ class Registration extends \User\DataBin\Registration \Utility\Debug::errorLog('create profile', $session->Profile); $profile = $profileService->create($session->Profile); -// $toCompanyId = ''; + $toCompanyId = ''; $toProfileId = $profile->id; $email = $profile->email; $mobile = null; @@ -58,10 +71,7 @@ class Registration extends \User\DataBin\Registration $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.'; + . 'and you will receive email confirmation once your account has been verified.'; #-> Send welcome notification to User. $oNotify = new \Utility\Comms\Notification();