Forráskód Böngészése

add mail forwarding

andre 1 éve
szülő
commit
b450078c4b

+ 4 - 6
app/UI/Client/EmailAccount/Providers/EditAccountDataProvider.php

@@ -78,8 +78,8 @@ class EditAccountDataProvider extends BaseDataProvider
         $this->data['currentCosId'] = $result->getDataResourceA(Account::ATTR_CLASS_OF_SERVICE_ID);
         $this->data['cosId']        = $result->getDataResourceA(Account::ATTR_CLASS_OF_SERVICE_ID);
         $this->data['state']        = $result->getDataResourceA(Account::ATTR_STATE);
-        $this->data['target']       = $result->getDataResourceA(Account::ATTR_MAIL_FORWARD);
-        if (empty($this->data['target'])) {
+        $this->data['zimbraPrefMailForwardingAddress']       = $result->getDataResourceA(Account::ATTR_MAIL_FORWARD);
+        if (empty($this->data['zimbraPrefMailForwardingAddress'])) {
             $this->data['forward'] = 'off';
         } else {
             $this->data['forward'] = 'on';
@@ -115,14 +115,12 @@ class EditAccountDataProvider extends BaseDataProvider
         {
             $value = in_array($field, $fieldToProtection) ? htmlentities($value) : $value;
         }
-        if (empty($this->formData['target'])) {
+        if (empty($this->formData['zimbraPrefMailForwardingAddress'])) {
             $this->formData['zimbraPrefMailLocalDeliveryDisabled'] = FALSE;
-            $this->formData['zimbraPrefMailForwardingAddress'] = NULL;
         } else {
             $this->formData['zimbraPrefMailLocalDeliveryDisabled'] = TRUE;
-            $this->formData['zimbraPrefMailForwardingAddress'] = $this->formData['target'];
-            unset($this->formData['target']);
         }
+        unset($this->formData['forward']);
         /**
          * product manager allow to check product settings
          */

+ 1 - 1
app/UI/Client/EmailAccount/Sections/EditForwardSection.php

@@ -21,7 +21,7 @@ class EditForwardSection extends FreeFieldsSection
 
     public function initContent()
     {
-        $field = new Text('target');
+        $field = new Text('zimbraPrefMailForwardingAddress');
         $field->addValidator(new EmailValidator());
         $this->generateDoubleSection([new Checkbox('forward'), $field]);
     }