|
|
@@ -153,7 +153,7 @@ class Ressources extends DataTable implements ClientArea
|
|
|
$hosting = Hosting::where('id', $this->getRequestValue('id'))->first();
|
|
|
|
|
|
|
|
|
- $accounts = (new ZimbraManager())
|
|
|
+ $ressources = (new ZimbraManager())
|
|
|
->getApiByServer($hosting->server)
|
|
|
->soap
|
|
|
->repository()
|
|
|
@@ -163,40 +163,29 @@ class Ressources extends DataTable implements ClientArea
|
|
|
logModuleCall(
|
|
|
'zimbraEmail',
|
|
|
__FUNCTION__,
|
|
|
- $accounts,
|
|
|
+ $ressources,
|
|
|
'Debug Ressource',
|
|
|
$hosting
|
|
|
);
|
|
|
|
|
|
- $productManager = new ProductManager();
|
|
|
- $productManager->loadByHostingId($hosting->id);
|
|
|
-
|
|
|
- if($productManager->get('filterRessourcesByCOS') === 'on' && $productManager->get('cos_name') != ClassOfServices::CUSTOM_ZIMBRA)
|
|
|
- {
|
|
|
- $availableCoses = is_array($productManager->getSettingCos()) ? array_keys($productManager->getSettingCos()) : [$productManager->getSettingCos()];
|
|
|
- $filter = new FilterByCosId();
|
|
|
- $filter->setAvailableCoses($availableCoses);
|
|
|
- $accounts = $filter->filter($accounts);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* format model to array
|
|
|
*/
|
|
|
$data = [];
|
|
|
- foreach ($accounts as $account)
|
|
|
+ foreach ($ressources as $ressource)
|
|
|
{
|
|
|
/* @var $account Ressource */
|
|
|
|
|
|
- $accountArray = [
|
|
|
- 'id' => $account->getId(),
|
|
|
- 'mailbox' => $account->getName(),
|
|
|
- 'date_created' => RessourceHelper::getFormattedData($account->getDataResourceA('zimbraCreateTimestamp')),
|
|
|
- 'last_login' => RessourceHelper::getFormattedData($account->getDataResourceA('zimbraLastLogonTimestamp'), 'd/m/Y H:i'),
|
|
|
- 'type' => $account->getDataResourceA('zimbraRessourceType'),
|
|
|
- 'status' => $account->getDataResourceA('zimbraRessourceStatus')
|
|
|
+ $ressourceArray = [
|
|
|
+ 'id' => $ressource->getId(),
|
|
|
+ 'mailbox' => $ressource->getName(),
|
|
|
+ 'date_created' => RessourceHelper::getFormattedData($ressource->getDataResourceA('zimbraCreateTimestamp')),
|
|
|
+ 'last_login' => RessourceHelper::getFormattedData($ressource->getDataResourceA('zimbraLastLogonTimestamp'), 'd/m/Y H:i'),
|
|
|
+ 'type' => $ressource->getDataResourceA('zimbraRessourceType'),
|
|
|
+ 'status' => $ressource->getDataResourceA('zimbraRessourceStatus')
|
|
|
];
|
|
|
|
|
|
- $data[] = $accountArray;
|
|
|
+ $data[] = $ressourceArray;
|
|
|
}
|
|
|
$dataProv = new ArrayDataProvider();
|
|
|
$dataProv->setDefaultSorting('mailbox', 'ASC')->setData($data);
|