From a2721f223e3100915fd48dfb7687b802bb51789d Mon Sep 17 00:00:00 2001 From: Pascal Corpet Date: Thu, 24 Feb 2005 08:33:22 +0000 Subject: [PATCH] wish 278 : email pro git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-497 --- htdocs/fiche.php | 8 ++- include/profil/assign_emploi.inc.php | 2 + include/profil/get_emploi.inc.php | 6 ++- include/profil/update_emploi.inc.php | 8 +-- include/profil/verif_emploi.inc.php | 2 + include/user.func.inc.php | 2 +- templates/fiche.tpl | 5 ++ templates/include/flags.radio.tpl | 29 +++++++++++ templates/profil/emploi.tpl | 99 +++++------------------------------- upgrade/0.9.5/30_entreprises.sql | 3 ++ 10 files changed, 69 insertions(+), 95 deletions(-) create mode 100644 templates/include/flags.radio.tpl diff --git a/htdocs/fiche.php b/htdocs/fiche.php index cf2e4f0..3a931da 100644 --- a/htdocs/fiche.php +++ b/htdocs/fiche.php @@ -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']); diff --git a/include/profil/assign_emploi.inc.php b/include/profil/assign_emploi.inc.php index 65f4388..8bda249 100644 --- a/include/profil/assign_emploi.inc.php +++ b/include/profil/assign_emploi.inc.php @@ -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); ?> diff --git a/include/profil/get_emploi.inc.php b/include/profil/get_emploi.inc.php index 40f6061..a5de23a 100644 --- a/include/profil/get_emploi.inc.php +++ b/include/profil/get_emploi.inc.php @@ -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 : diff --git a/include/profil/update_emploi.inc.php b/include/profil/update_emploi.inc.php index 3b9d14c..1281747 100644 --- a/include/profil/update_emploi.inc.php +++ b/include/profil/update_emploi.inc.php @@ -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)); ?> diff --git a/include/profil/verif_emploi.inc.php b/include/profil/verif_emploi.inc.php index 7940eca..9e0d843 100644 --- a/include/profil/verif_emploi.inc.php +++ b/include/profil/verif_emploi.inc.php @@ -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 diff --git a/include/user.func.inc.php b/include/user.func.inc.php index 9d84c7c..0538956 100644 --- a/include/user.func.inc.php +++ b/include/user.func.inc.php @@ -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) diff --git a/templates/fiche.tpl b/templates/fiche.tpl index 3acb75d..02ea616 100644 --- a/templates/fiche.tpl +++ b/templates/fiche.tpl @@ -152,6 +152,11 @@ function chgMainWinLoc( strPage ) { Poste : {$address.poste} {/if} + {if $address.email} +
+ E-mail : {$address.email} +
+ {/if} {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 index 0000000..2d232b7 --- /dev/null +++ b/templates/include/flags.radio.tpl @@ -0,0 +1,29 @@ + + + + + + + + + + + + +
+ + + site public + + + + transmis à l'AX + + + + prive + + Quelle couleur ?? +
+ + diff --git a/templates/profil/emploi.tpl b/templates/profil/emploi.tpl index 67f31a2..37ce567 100644 --- a/templates/profil/emploi.tpl +++ b/templates/profil/emploi.tpl @@ -30,35 +30,7 @@ Informations professionnelles - Entreprise n°{$i+1} - - - - - - - - - - - - -
- - - site public - - - - transmis à l'AX - - - - prive - - Quelle couleur ?? -
- - + {include file=include/flags.radio.tpl name="pubpro[$i]" val=$pubpro.$i} Entreprise ou organisme @@ -107,35 +79,7 @@ - - - - - - - - - - - - -
- - - site public - - - - transmis à l'AX - - - - prive - - Quelle couleur ?? -
- - + {include file=include/flags.radio.tpl name="adr_pubpro[$i]" val=$adr_pubpro.$i} Adresse professionnelle @@ -197,35 +141,7 @@ - - - - - - - - - - - - -
- - - site public - - - - transmis à l'AX - - - - prive - - Quelle couleur ?? -
- - + {include file=include/flags.radio.tpl name="tel_pubpro[$i]" val=$tel_pubpro.$i} Téléphone professionnel @@ -251,6 +167,15 @@ + {include file=include/flags.radio.tpl name="email_pubpro[$i]" val=$email_pubpro.$i} + + + E-mail + + + + + diff --git a/upgrade/0.9.5/30_entreprises.sql b/upgrade/0.9.5/30_entreprises.sql index 4a06935..c812b9b 100644 --- a/upgrade/0.9.5/30_entreprises.sql +++ b/upgrade/0.9.5/30_entreprises.sql @@ -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; -- 2.1.4