wish 278 : email pro
authorPascal Corpet <pascal.corpet@m4x.org>
Thu, 24 Feb 2005 08:33:22 +0000 (08:33 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:15 +0000 (23:28 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-497

htdocs/fiche.php
include/profil/assign_emploi.inc.php
include/profil/get_emploi.inc.php
include/profil/update_emploi.inc.php
include/profil/verif_emploi.inc.php
include/user.func.inc.php
templates/fiche.tpl
templates/include/flags.radio.tpl [new file with mode: 0644]
templates/profil/emploi.tpl
upgrade/0.9.5/30_entreprises.sql

index cf2e4f0..3a931da 100644 (file)
@@ -98,7 +98,7 @@ if (!logged()) {
         }
     }
     foreach ($user['adr_pro'] as $i=>$adr) {
-        if ($adr['pub'] != 'public' && $adr['tel_pub'] != 'public' && $adr['adr_pub'] != 'public')
+        if ($adr['pub'] != 'public' && $adr['tel_pub'] != 'public' && $adr['adr_pub'] != 'public' && $adr['email_pub'] != 'public')
             unset($user['adr_pro'][$i]);
         else {
             if ($adr['adr_pub'] != 'public') {
@@ -121,6 +121,9 @@ if (!logged()) {
                 $user['adr_pro'][$i]['fax'] = '';
                 $user['adr_pro'][$i]['mobile'] = '';
             }
+            if ($adr['email_pub'] != 'public') {
+                $user['adr_pro'][$i]['email'] = '';
+            }
         }
     }
     if ($user['medals_pub'] != 'public') {
@@ -135,7 +138,8 @@ foreach($user['adr_pro'] as $i=>$pro) {
         && $pro['secteur'] == '' && $pro['poste'] == ''
         && $pro['adr1'] == '' && $pro['adr2'] == '' && $pro['adr3'] == ''
         && $pro['cp'] == '' && $pro['ville'] == '' && $pro['pays'] == ''
-        && $pro['tel'] == '' && $pro['fax'] == '' && $pro['mobile'] == '')
+        && $pro['tel'] == '' && $pro['fax'] == '' && $pro['mobile'] == ''
+        && $pro['email'] == '')
         unset($user['adr_pro'][$i]);
 }
 if (count($user['adr_pro']) == 0) unset($user['adr_pro']);
index 65f4388..8bda249 100644 (file)
@@ -38,6 +38,8 @@ $page->assign('mobilepro', $mobilepro);
 $page->assign('pubpro',$pubpro);
 $page->assign('adr_pubpro',$adr_pubpro);
 $page->assign('tel_pubpro',$tel_pubpro);
+$page->assign('emailpro',$emailpro);
+$page->assign('email_pubpro',$email_pubpro);
 $page->assign('cv',$cv);
 
 ?>
index 40f6061..a5de23a 100644 (file)
@@ -25,7 +25,7 @@ require_once('fonction.emploi.inc.php');
 
 $res = $globals->xdb->iterRow("SELECT entrid, entreprise, secteur, ss_secteur, poste, fonction,
        adr1, adr2, adr3, cp, ville, pays, region, tel, fax, mobile,
-       pub, adr_pub, tel_pub
+       pub, adr_pub, tel_pub, email, email_pub
         FROM entreprises
         WHERE uid = {?} ORDER BY entrid",Session::getInt('uid', -1));
 
@@ -34,7 +34,7 @@ for($i = 0; $i < $nb_res ; $i++){
        list($endrid[$i], $entreprise[$i], $secteur[$i], $ss_secteur[$i], $poste[$i], $fonction[$i],
                     $adrpro1[$i], $adrpro2[$i], $adrpro3[$i], $cppro[$i], $villepro[$i], $payspro[$i], $regionpro[$i],
              $telpro[$i], $faxpro[$i], $mobilepro[$i], $pubpro[$i], $adr_pubpro[$i],
-            $tel_pubpro[$i]) = $res->next();
+            $tel_pubpro[$i], $emailpro[$i], $email_pubpro[$i]) = $res->next();
 }
 //limite dure a 2
 for($i = $nb_res; $i < 2 ; $i++){
@@ -57,6 +57,8 @@ for($i = $nb_res; $i < 2 ; $i++){
        $pubpro[$i] = '';
        $adr_pubpro[$i] = '';
        $tel_pubpro[$i] = '';
+       $emailpro[$i] = '';
+       $email_pubpro[$i] = '';
 }
 
 //recuperation des donnees sur les secteurs :
index 3b9d14c..1281747 100644 (file)
@@ -21,7 +21,7 @@
 
 for($i = 0; $i < 2; $i++){
 
-    $globals->xdb->execute("REPLACE INTO entreprises(uid,entrid,entreprise,secteur,ss_secteur,poste,fonction,adr1,adr2,adr3,cp,ville,pays,region,tel,fax,mobile,pub, adr_pub, tel_pub) ".
+    $globals->xdb->execute("REPLACE INTO entreprises(uid,entrid,entreprise,secteur,ss_secteur,poste,fonction,adr1,adr2,adr3,cp,ville,pays,region,tel,fax,mobile,pub, adr_pub, tel_pub, email, email_pub) ".
               "VALUES ({?}, {?}, {?}, ".
              "{?},".
              "{?}".
@@ -29,7 +29,8 @@ for($i = 0; $i < 2; $i++){
              "{?}, {?}, {?}, {?}, ".
              "{?}, {?}, ".
              "{?}, {?}, {?}, {?}, ".
-             "{?}, {?}, {?})",
+             "{?}, {?}, {?}, ".
+             "{?}, {?})",
              Session::getInt('uid', -1) , $i , $entreprise[$i] ,
              ( ($secteur[$i] == "") ? null : $secteur[$i]), //sinon un faux 0 est rentre dans la base
              ( ($ss_secteur[$i] == "") ? null : $ss_secteur[$i]),
@@ -37,7 +38,8 @@ for($i = 0; $i < 2; $i++){
               $adrpro1[$i], $adrpro2[$i], $adrpro3[$i], $cppro[$i],
               $villepro[$i], $payspro[$i],
              $regionpro[$i], $telpro[$i], $faxpro[$i], $mobilepro[$i],
-             $pubpro[$i], $adr_pubpro[$i], $tel_pubpro[$i]);
+             $pubpro[$i], $adr_pubpro[$i], $tel_pubpro[$i],
+             $emailpro[$i], $email_pubpro[$i]);
 }
 $globals->xdb->execute("UPDATE auth_user_md5 set cv= {?} WHERE user_id = {?}", $cv, Session::getInt('uid', -1));
 ?>
index 7940eca..9e0d843 100644 (file)
@@ -49,6 +49,8 @@ replace_ifset_i($mobilepro,"mobilepro",$i);
 replace_ifset_i($pubpro,"pubpro",$i);
 replace_ifset_i($adr_pubpro,"adr_pubpro",$i);
 replace_ifset_i($tel_pubpro,"tel_pubpro",$i);
+replace_ifset_i($emailpro,"emailpro",$i);
+replace_ifset_i($email_pubpro,"email_pubpro",$i);
 replace_ifset($cv,"cv");
 
 // validité de l'entreprise
index 9d84c7c..0538956 100644 (file)
@@ -183,7 +183,7 @@ function &get_user_details($login, $from_uid = '')
     $sql  = "SELECT  e.entreprise, s.label as secteur , ss.label as sous_secteur , f.fonction_fr as fonction,
                      e.poste, e.adr1, e.adr2, e.adr3, e.cp, e.ville,
                      gp.pays, gr.name AS region, e.tel, e.fax, e.mobile, e.entrid,
-                     e.pub, e.tel_pub
+                     e.pub, e.tel_pub, e.email, e.email_pub
                FROM  entreprises AS e
           LEFT JOIN  emploi_secteur AS s ON(e.secteur = s.id)
           LEFT JOIN  emploi_ss_secteur AS ss ON(e.ss_secteur = ss.id AND e.secteur = ss.secteur)
index 3acb75d..02ea616 100644 (file)
@@ -152,6 +152,11 @@ function chgMainWinLoc( strPage ) {
           <em>Poste : </em> <strong>{$address.poste}</strong>
         </div>
         {/if}
+        {if $address.email}
+        <div>
+          <em>E-mail : </em> <strong>{$address.email}</strong>
+        </div>
+        {/if}
       </div>
 
       {include file="geoloc/address.tpl" address=$address titre="Adresse : "}
diff --git a/templates/include/flags.radio.tpl b/templates/include/flags.radio.tpl
new file mode 100644 (file)
index 0000000..2d232b7
--- /dev/null
@@ -0,0 +1,29 @@
+    <tr>
+      <td colspan="5" class="pflags">
+        <table class="flags" summary="Flags" cellpadding="0" cellspacing="0">
+          <tr>
+            <td class="vert">
+              <input type="radio" name="{$name}" value="public" {if $val eq 'public'}checked="checked"{/if} />
+            </td>
+            <td class="texte">
+              site public
+            </td>
+            <td class="orange">
+              <input type="radio" name="{$name}" value="ax" {if $val eq 'ax'}checked="checked"{/if} />
+            </td>
+            <td class="texte">
+              transmis à l'AX
+            </td>
+            <td class="rouge">
+              <input type="radio" name="{$name}" value="private" {if $val eq 'private'}checked="checked"{/if} />
+            </td>
+            <td class="texte">
+              prive
+            </td>
+            <td class="texte">
+              <a href="{"docs/faq.php"|url}#flags" class="popup_800x240">Quelle couleur ??</a>
+            </td>
+          </tr>
+        </table>
+      </td>
+    </tr>
index 67f31a2..37ce567 100644 (file)
         Informations professionnelles - Entreprise n°{$i+1}
       </th>
     </tr>
-    <tr>
-      <td colspan="5" class="pflags">
-        <table class="flags" summary="Flags" cellpadding="0" cellspacing="0">
-          <tr>
-            <td class="vert">
-              <input type="radio" name="pubpro[{$i}]" value="public" {if $pubpro.$i eq 'public'}checked="checked"{/if} />
-            </td>
-            <td class="texte">
-              site public
-            </td>
-            <td class="orange">
-              <input type="radio" name="pubpro[{$i}]" value="ax" {if $pubpro.$i eq 'ax'}checked="checked"{/if} />
-            </td>
-            <td class="texte">
-              transmis à l'AX
-            </td>
-            <td class="rouge">
-              <input type="radio" name="pubpro[{$i}]" value="private" {if $pubpro.$i eq 'private'}checked="checked"{/if} />
-            </td>
-            <td class="texte">
-              prive
-            </td>
-            <td class="texte">
-              <a href="{"docs/faq.php"|url}#flags" class="popup_800x240">Quelle couleur ??</a>
-            </td>
-          </tr>
-        </table>
-      </td>
-    </tr>
+    {include file=include/flags.radio.tpl name="pubpro[$i]" val=$pubpro.$i}
     <tr>
       <td class="colg">
         <span class="titre">Entreprise ou organisme</span>
         </select>
       </td>
     </tr>
-    <tr>
-      <td colspan="5" class="pflags">
-        <table class="flags" summary="Flags" cellpadding="0" cellspacing="0">
-          <tr>
-            <td class="vert">
-              <input type="radio" name="adr_pubpro[{$i}]" value="public" {if $adr_pubpro.$i eq 'public'}checked="checked"{/if} />
-            </td>
-            <td class="texte">
-              site public
-            </td>
-            <td class="orange">
-              <input type="radio" name="adr_pubpro[{$i}]" value="ax" {if $adr_pubpro.$i eq 'ax'}checked="checked"{/if} />
-            </td>
-            <td class="texte">
-              transmis à l'AX
-            </td>
-            <td class="rouge">
-              <input type="radio" name="adr_pubpro[{$i}]" value="private" {if $adr_pubpro.$i eq 'private'}checked="checked"{/if} />
-            </td>
-            <td class="texte">
-              prive
-            </td>
-            <td class="texte">
-              <a href="{"docs/faq.php"|url}#flags" class="popup_800x240">Quelle couleur ??</a>
-            </td>
-          </tr>
-        </table>
-      </td>
-    </tr>
+    {include file=include/flags.radio.tpl name="adr_pubpro[$i]" val=$adr_pubpro.$i}
     <tr>
       <td class="colg">
         <span class="titre">Adresse professionnelle</span>
         </select>
       </td>
     </tr>
-    <tr>
-      <td colspan="5" class="pflags">
-        <table class="flags" summary="Flags" cellpadding="0" cellspacing="0">
-          <tr>
-            <td class="vert">
-              <input type="radio" name="tel_pubpro[{$i}]" value="public" {if $tel_pubpro.$i eq 'public'}checked="checked"{/if} />
-            </td>
-            <td class="texte">
-              site public
-            </td>
-            <td class="orange">
-              <input type="radio" name="tel_pubpro[{$i}]" value="ax" {if $tel_pubpro.$i eq 'ax'}checked="checked"{/if} />
-            </td>
-            <td class="texte">
-              transmis à l'AX
-            </td>
-            <td class="rouge">
-              <input type="radio" name="tel_pubpro[{$i}]" value="private" {if $tel_pubpro.$i eq 'private'}checked="checked"{/if} />
-            </td>
-            <td class="texte">
-              prive
-            </td>
-            <td class="texte">
-              <a href="{"docs/faq.php"|url}#flags" class="popup_800x240">Quelle couleur ??</a>
-            </td>
-          </tr>
-        </table>
-      </td>
-    </tr>
+    {include file=include/flags.radio.tpl name="tel_pubpro[$i]" val=$tel_pubpro.$i}
     <tr>
       <td class="colg">
         <span class="titre">Téléphone professionnel</span>
         <input type="text" size="18" maxlength="18" name="mobilepro[{$i}]" value="{$mobilepro.$i}" />
       </td>
     </tr>
+    {include file=include/flags.radio.tpl name="email_pubpro[$i]" val=$email_pubpro.$i}
+    <tr>
+      <td class="colg">
+        <span class="titre">E-mail</span>
+      </td>
+      <td>
+        <input tyep="text" size="30" maxlength="60" name="emailpro[{$i}]" value="{$emailpro.$i}" />
+      </td>
+    </tr>
   </table>
 </div>
 
index 4a06935..c812b9b 100644 (file)
@@ -7,3 +7,6 @@ pub = IF(FIND_IN_SET('entreprise_public', visibilite), 'public', IF(FIND_IN_SET(
 adr_pub = IF(FIND_IN_SET('adr_public', visibilite), 'public', IF(FIND_IN_SET('adr_ax', visibilite), 'ax', 'private')), 
 tel_pub = IF(FIND_IN_SET('tel_public', visibilite), 'public', IF(FIND_IN_SET('tel_ax', visibilite),'ax', 'private'));
 ALTER TABLE entreprises DROP visibilite;
+ALTER TABLE entreprises
+ADD email VARCHAR(60) NOT NULL AFTER mobile,
+ADD email_pub ENUM('private', 'ax', 'public') DEFAULT 'private' NOT NULL;