andre 2 лет назад
Родитель
Сommit
878fbcd32d
2 измененных файлов с 33 добавлено и 2 удалено
  1. 21 0
      api/KerioWhmcs.php
  2. 12 2
      app/UI/Client/EmailAccount/Providers/EditAccountDataProvider.php

+ 21 - 0
api/KerioWhmcs.php

@@ -164,6 +164,27 @@ class KerioWhmcs extends KerioConnectApi {
 		return $result;
 	}
 
+	/**
+	 * Set address of a user
+	 *
+	 * @param	string	User Id
+	 * @param	array	User Attributes
+	 *
+	 * @return	array	address of user
+	 */
+	public function setAddress($id, $fields) {
+		$method = 'Users.setPersonalContact';
+
+		$params = array(
+			'userIds' => array(
+					$id,
+				),
+			'contact' => $fields,
+			);
+		$result = $this->sendRequest($method, $params);
+		return $result;
+	}
+
 	/**
 	 * Get login name by user's Id
 	 * 

+ 12 - 2
app/UI/Client/EmailAccount/Providers/EditAccountDataProvider.php

@@ -158,12 +158,22 @@ class EditAccountDataProvider extends BaseDataProvider
         $productManager = new ProductManager();
         $productManager->loadByHostingId($hid);
 
+        $fields['firstName'] = $this->formData['firstname'];
+        $fields['surName'] = $this->formData['lastname'];
+        $fields['commonName'] = $this->formData['display_name'];
+        $fields['companyName'] = $this->formData['company'];
+        $fields['titleBefore'] = $this->formData['title'];
+        $fields['phoneNumberWorkVoice'] = $this->formData['home_phone'];
+        $fields['phoneNumberMobile'] = $this->formData['mobile_phone'];
+        $fields['departmentName'] = $this->formData['department'];
+        $fields['profession'] = $this->formData['profession'];
+
         logModuleCall(
             'kerioEmail',
             __FUNCTION__,
-            $this->formData,
+            $this->data,
             'Debug Error',
-            $productManager
+            $fields
         );
 
 /*        if(!$result)