Jelajahi Sumber

edit ressource

andre 2 tahun lalu
induk
melakukan
9672acce2d

+ 0 - 1
app/UI/Client/Ressource/Pages/Ressources.php

@@ -137,7 +137,6 @@ class Ressources extends DataTable implements ClientArea
 
         $actions = new SpanDropdownButton('actions');
         $actions->addButton(new ChangeStatusButton());
-        $actions->addButton(new ChangePasswordButton());
 
         $this->addActionButton($actions);
 

+ 7 - 86
app/UI/Client/Ressource/Providers/EditRessourceDataProvider.php

@@ -133,14 +133,6 @@ class EditRessourceDataProvider extends BaseDataProvider
             'managert'
         ];
 
-        logModuleCall(
-            'kerioEmail',
-            __FUNCTION__,
-            $this->formData,
-            'Debug Error',
-            $this->actionElementId
-        );
-
         foreach ($this->formData as $field => &$value)
         {
             $value = in_array($field, $fieldToProtection) ? htmlentities($value) : $value;
@@ -191,47 +183,14 @@ class EditRessourceDataProvider extends BaseDataProvider
      */
     public function updateStatus()
     {
-        /**
-         * hosting id
-         */
-        $hid = $this->request->get('id');
-
-        /**
-         * product manager allow to check product settings
-         */
-        $productManager = new ProductManager();
-        $productManager->loadByHostingId($hid);
-
-        /**
-         *
-         * get soap create domain  service
-         */
-        $service =(new KerioManager())
-            ->getApiByHosting($hid)
-            ->soap
-            ->service()
-            ->updateRessourceStatus()
-            ->setProductManager($productManager)
-        ;
-        /**
-         *
-         * set product manager & form data to service
-         */
-
-        /**
-         * run service for each id
-         */
-        $service->setFormData($this->formData);
-        $result = $service->run();
-
-        if(!$result)
-        {
-            return (new HtmlDataJsonResponse())->setMessageAndTranslate($service->getError())->setStatusError();
-        }
 
-        /**
-         * return success
-         */
+        logModuleCall(
+            'kerioEmail',
+            __FUNCTION__,
+            $this->formData,
+            'Debug Error',
+            $this->data
+        );
         return (new HtmlDataJsonResponse())->setMessageAndTranslate('ressourceStatusHasBeenUpdated')->setStatusSuccess();
 
     }
@@ -241,44 +200,6 @@ class EditRessourceDataProvider extends BaseDataProvider
      */
     public function changePassword()
     {
-        /**
-         * hosting id
-         */
-        $hid = $this->request->get('id');
-
-        /**
-         * product manager allow to check product settings
-         */
-        $productManager = new ProductManager();
-        $productManager->loadByHostingId($hid);
-
-        /**
-         *
-         * get soap create domain  service
-         */
-        $service =(new KerioManager())
-            ->getApiByHosting($hid)
-            ->soap
-            ->service()
-            ->updateRessourcePassword()
-            ->setProductManager($productManager)
-        ;
-        /**
-         *
-         * set product manager & form data to service
-         */
-
-        /**
-         * run service for each id
-         */
-        $service->setFormData($this->formData);
-        $result = $service->run();
-
-        if(!$result)
-        {
-            return (new HtmlDataJsonResponse())->setMessageAndTranslate($service->getError())->setStatusError();
-        }
 
-        return (new HtmlDataJsonResponse())->setMessageAndTranslate('passwordChangedSuccessfully')->setStatusSuccess();
     }
 }