Просмотр исходного кода

Bugfix: remove COS logic from ressources

andre 2 лет назад
Родитель
Сommit
bae42e4e7b
1 измененных файлов с 11 добавлено и 22 удалено
  1. 11 22
      app/UI/Client/Ressource/Pages/Ressources.php

+ 11 - 22
app/UI/Client/Ressource/Pages/Ressources.php

@@ -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);