When adding a new address to a profile, tick the "can receive mail" checkbox by default
authorNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Mon, 9 Jun 2014 09:01:54 +0000 (11:01 +0200)
committerNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Mon, 9 Jun 2014 16:33:38 +0000 (18:33 +0200)
modules/profile.php
modules/profile/addresses.inc.php

index 09937a3..7f2136a 100644 (file)
@@ -393,7 +393,7 @@ class ProfileModule extends PLModule
         pl_content_headers("text/html");
         $page->changeTpl('profile/adresses.address.tpl', NO_SKIN);
         $page->assign('i', $id);
-        $page->assign('address', array());
+        $page->assign('address', array('mail' => true));
         $page->assign('profile', Profile::get($pid));
         $page->assign('isMe', true);
         $page->assign('geocoding_removal', true);
index 24bc995..ed3e195 100644 (file)
@@ -32,7 +32,7 @@ class ProfileSettingAddresses implements ProfileSetting
                 $addresses[] = $address->toFormArray();
             }
             if (count($addresses) == 0) {
-                $address = new Address();
+                $address = new Address(array('mail' => 1));
                 $addresses[] = $address->toFormArray();
             }
             return $addresses;