|
|
@@ -75,8 +75,30 @@ class EditRessourceDataProvider extends BaseDataProvider
|
|
|
);
|
|
|
return ['error' => $error->getMessage()];
|
|
|
}
|
|
|
+ $attr = array(
|
|
|
+ "id",
|
|
|
+ "loginName",
|
|
|
+ "isEnabled");
|
|
|
+ try {
|
|
|
+ $users = $api->getUsers($attr,$domainID);
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
+ logModuleCall(
|
|
|
+ 'kerioEmail',
|
|
|
+ __FUNCTION__,
|
|
|
+ $error,
|
|
|
+ 'Debug Error',
|
|
|
+ $error->getMessage()
|
|
|
+ );
|
|
|
+ return ['error' => $error->getMessage()];
|
|
|
+ }
|
|
|
$api->logout();
|
|
|
|
|
|
+ foreach($users as $user) {
|
|
|
+ if($user['isEnabled']){
|
|
|
+ $this->availableValues['manager'][ $user['id']] = $user['loginName'] . '@' . $this->getWhmcsParamByKey('domain');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$lang = di('lang');
|
|
|
$this->data['id'] = $ressource[0]['id'];
|
|
|
$this->data['name'] = $ressource[0]['name'];
|
|
|
@@ -84,7 +106,7 @@ class EditRessourceDataProvider extends BaseDataProvider
|
|
|
$this->data['status'] = $ressource[0]['isEnabled'] == true ? Kerio::ACC_STATUS_ACTIVE : Kerio::ACC_STATUS_CLOSED;
|
|
|
$this->data['type'] = $ressource[0]['type'] === 'Room' ? di('lang')->absoluteT('kerio','ressource','type','location') : di('lang')->absoluteT('kerio','ressource','type','equipment');;
|
|
|
$this->data['description'] = $ressource[0]['description'];
|
|
|
- $this->data['manager'] = [ $ressource[0]['manager']['id'] => $ressource[0]['manager']['name'] . '@' . $ressource[0]['manager']['domainName'] ];
|
|
|
+ $this->data['manager'] = $ressource[0]['manager']['name'] . '@' . $ressource[0]['manager']['domainName'];
|
|
|
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|