|
|
@@ -112,46 +112,51 @@ class EditAccountDataProvider extends BaseDataProvider
|
|
|
);
|
|
|
return ['error' => $error->getMessage()];
|
|
|
}
|
|
|
+ try {
|
|
|
+ $contact = $api->getContact('1');
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
+ logModuleCall(
|
|
|
+ 'kerioEmail',
|
|
|
+ __FUNCTION__,
|
|
|
+ $error,
|
|
|
+ 'Debug Error',
|
|
|
+ $error->getMessage()
|
|
|
+ );
|
|
|
+ return ['error' => $error->getMessage()];
|
|
|
+ }
|
|
|
$api->logout();
|
|
|
|
|
|
+
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
__FUNCTION__,
|
|
|
$account,
|
|
|
'Debug Error',
|
|
|
- $address
|
|
|
+ $contact
|
|
|
);
|
|
|
|
|
|
-/*
|
|
|
- $result = $repository->accounts->getAccountOptionsById($this->actionElementId);
|
|
|
|
|
|
- if($result instanceof Response && $result->getLastError())
|
|
|
- {
|
|
|
- throw new \Exception($result->getLastError());
|
|
|
- }
|
|
|
-
|
|
|
- $mailBoxParams = explode('@', $result->getName());
|
|
|
- $this->data['id'] = $result->getId();
|
|
|
- $this->data['username'] = $mailBoxParams[0];
|
|
|
- $this->data['domain'] = $mailBoxParams[1];
|
|
|
- $this->data['firstname'] = $result->getDataResourceA(Account::ATTR_FIRSTNAME);
|
|
|
- $this->data['lastname'] = $result->getDataResourceA(Account::ATTR_LASTNAME);
|
|
|
- $this->data['display_name'] = $result->getDataResourceA(Account::ATTR_DISPLAY_NAME);
|
|
|
- $this->data['status'] = $result->getDataResourceA(Account::ATTR_ACCOUNT_STATUS);
|
|
|
- $this->data['company'] = $result->getDataResourceA(Account::ATTR_COMPANY);
|
|
|
- $this->data['title'] = $result->getDataResourceA(Account::ATTR_PROF_TITLE);
|
|
|
- $this->data['phone'] = $result->getDataResourceA(Account::ATTR_PHONE);
|
|
|
- $this->data['home_phone'] = $result->getDataResourceA(Account::ATTR_HOME_PHONE);
|
|
|
- $this->data['mobile_phone'] = $result->getDataResourceA(Account::ATTR_MOBILE_PHONE);
|
|
|
- $this->data['fax'] = $result->getDataResourceA(Account::ATTR_FAX);
|
|
|
- $this->data['pager'] = $result->getDataResourceA(Account::ATTR_PAGER);
|
|
|
- $this->data['country'] = $result->getDataResourceA(Account::ATTR_COUNTRY);
|
|
|
- $this->data['city'] = $result->getDataResourceA(Account::ATTR_CITY);
|
|
|
- $this->data['street'] = $result->getDataResourceA(Account::ATTR_STREET);
|
|
|
- $this->data['post_code'] = $result->getDataResourceA(Account::ATTR_POSTAL_CODE);
|
|
|
- $this->data['currentCosId'] = $result->getDataResourceA(Account::ATTR_CLASS_OF_SERVICE_ID);
|
|
|
- $this->data['cosId'] = $result->getDataResourceA(Account::ATTR_CLASS_OF_SERVICE_ID);
|
|
|
- $this->data['state'] = $result->getDataResourceA(Account::ATTR_STATE);
|
|
|
+ $this->data['id'] = $account['id'];
|
|
|
+ $this->data['username'] = $account['loginName'];
|
|
|
+ $this->data['domain'] = $this->getWhmcsParamByKey('customfields')['maildomain'];
|
|
|
+ $this->data['firstname'] = $address['contacts'][0]['firstName'];
|
|
|
+ $this->data['lastname'] = $address['contacts'][0]['surName'];
|
|
|
+ $this->data['display_name'] = $address['contacts'][0]['commonName'];
|
|
|
+ $this->data['status'] = $account['isEnabled'];
|
|
|
+ $this->data['company'] = $address['contacts'][0]['companyName'];
|
|
|
+ $this->data['title'] = $address['contacts'][0]['titleBefore'];
|
|
|
+ $this->data['phone'] = $address['contacts'][0]['phoneNumberWorkVoice'];
|
|
|
+ $this->data['home_phone'] = '';
|
|
|
+ $this->data['mobile_phone'] = $address['contacts'][0]['phoneNumberMobile'];
|
|
|
+ $this->data['fax'] = '';
|
|
|
+ $this->data['pager'] = '';
|
|
|
+ $this->data['country'] = $address['contacts'][0]['postalAddressWork']['country'];
|
|
|
+ $this->data['city'] = $address['contacts'][0]['postalAddressWork'][''];
|
|
|
+ $this->data['street'] = $address['contacts'][0]['postalAddressWork'][''];
|
|
|
+ $this->data['post_code'] = $address['contacts'][0]['postalAddressWork'][''];
|
|
|
+ $this->data['currentCosId'] = '';
|
|
|
+ $this->data['cosId'] = '';
|
|
|
+ $this->data['state'] = $address['contacts'][0]['postalAddressWork'][''];
|
|
|
|
|
|
$lang = di('lang');
|
|
|
$this->availableValues['status'] = [
|
|
|
@@ -163,8 +168,6 @@ class EditAccountDataProvider extends BaseDataProvider
|
|
|
Kerio::ACC_STATUS_PENDING => $lang->absoluteT('kerio','account','status','pending')
|
|
|
];
|
|
|
|
|
|
- $this->readCosParams(); */
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|