Allows job addresses to be the mail address.
authorStéphane Jacob <sj@m4x.org>
Wed, 26 Oct 2011 15:34:58 +0000 (17:34 +0200)
committerStéphane Jacob <sj@m4x.org>
Wed, 26 Oct 2011 15:34:58 +0000 (17:34 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
classes/address.php
templates/profile/jobs.job.tpl

index af0e2f0..18f752e 100644 (file)
@@ -625,14 +625,16 @@ class Address
             'request'             => $this->request
         );
 
-        if ($this->type == self::LINK_PROFILE || $this->type == self::LINK_JOB) {
-            $address['pub'] = $this->pub;
+        if ($this->type == self::LINK_JOB) {
+            $address['pub']  = $this->pub;
+            $address['mail'] = $this->flags->hasFlag('mail');
         }
         if ($this->type == self::LINK_PROFILE) {
             static $flags = array('current', 'temporary', 'secondary', 'mail', 'cedex', 'deliveryIssue');
             foreach ($flags as $flag) {
                 $address[$flag] = $this->flags->hasFlag($flag);
             }
+            $address['pub']     = $this->pub;
             $address['comment'] = $this->comment;
             $address['phones']  = Phone::formatFormArray($this->phones);
         }
index dde72e9..747347b 100644 (file)
     </tr>
     {include file="geoloc/form.address.tpl" prefname="`$jobpref`[w_address]"
                      prefid=$jobid address=$job.w_address class="pair"}
+    <tr class="pair" {if $hiddenjob || $hiddenaddr}style="display: none"{/if}>
+      <td colspan="2">
+        <label>
+          <input type="checkbox" name="{$jobpref}[w_address][mail]" {if $job.w_address.mail}checked="checked"{/if} />
+            on peut {if $isMe}m'{/if}y envoyer du courrier par la poste
+        </label>
+      </td>
+    </tr>
     {if $hiddenaddr}
     <tr class="pair">
       <td class="titre" colspan="2">Adresse (masquée)</td>