|
|
@@ -187,27 +187,40 @@ class Ressources extends DataTable implements ClientArea
|
|
|
return ['error' => $error->getMessage()];
|
|
|
}
|
|
|
|
|
|
- $api->logout();
|
|
|
/**
|
|
|
* format model to array
|
|
|
*/
|
|
|
$data = [];
|
|
|
foreach ($ressources as $ressource)
|
|
|
{
|
|
|
- /* @var $account Ressource */
|
|
|
+ try {
|
|
|
+ $manager = $api->getUserById($ressource['manager']['id'], $domainID);
|
|
|
+ } catch (KerioApiException $error) {
|
|
|
+ logModuleCall(
|
|
|
+ 'kerioEmail',
|
|
|
+ __FUNCTION__,
|
|
|
+ $error,
|
|
|
+ 'Debug Error',
|
|
|
+ $error->getMessage()
|
|
|
+ );
|
|
|
+ return ['error' => $error->getMessage()];
|
|
|
+ }
|
|
|
|
|
|
$ressourceArray = [
|
|
|
'id' => $ressource['id'],
|
|
|
'ressource' => $ressource['name'],
|
|
|
'description' => $ressource['description'],
|
|
|
'type' => $ressource['type'],
|
|
|
- 'manager' => $ressource['manager']['id'],
|
|
|
+ 'manager' => $manager['name'],
|
|
|
'status' => $ressource['isEnabled'] ? 'active' : 'default'
|
|
|
];
|
|
|
|
|
|
$data[] = $ressourceArray;
|
|
|
}
|
|
|
|
|
|
+ $api->logout();
|
|
|
+
|
|
|
+
|
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
|
__FUNCTION__,
|