From 2dcac0f527e8207d754af8974d81b2bce3f433d9 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sat, 8 Sep 2007 20:35:10 +0200 Subject: [PATCH] Working HTML part of the job tab Signed-off-by: Florent Bruneau --- include/fonction.emploi.inc.php | 41 ------- include/secteur.emploi.inc.php | 60 ---------- modules/profile.php | 26 ++++- modules/profile/jobs.inc.php | 10 ++ templates/include/flags.radio.tpl | 27 +++-- templates/profile/adresses.address.tpl | 4 +- templates/profile/base.tpl | 7 ++ templates/profile/jobs.job.tpl | 202 +++++++++++++++++++-------------- templates/profile/jobs.secteur.tpl | 31 +++++ templates/profile/jobs.tpl | 65 +++++++++-- 10 files changed, 266 insertions(+), 207 deletions(-) delete mode 100644 include/fonction.emploi.inc.php delete mode 100644 include/secteur.emploi.inc.php create mode 100644 templates/profile/jobs.secteur.tpl diff --git a/include/fonction.emploi.inc.php b/include/fonction.emploi.inc.php deleted file mode 100644 index ee67115..0000000 --- a/include/fonction.emploi.inc.php +++ /dev/null @@ -1,41 +0,0 @@ - \n"; - - $res = XDB::iterRow("SELECT id, fonction_fr, FIND_IN_SET('titre', flags) from fonctions_def ORDER BY id"); - while(list($fid, $flabel, $ftitre) = $res->next()){ - if($ftitre) - $html.= "\n"; - else - $html .= "\n"; - } - return $html; -} - -function _select_fonction_smarty($params){ - return select_fonction($params['fonction']); -} - -$page->register_function('select_fonction', '_select_fonction_smarty'); -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: -?> diff --git a/include/secteur.emploi.inc.php b/include/secteur.emploi.inc.php deleted file mode 100644 index 4f2d48b..0000000 --- a/include/secteur.emploi.inc.php +++ /dev/null @@ -1,60 +0,0 @@ - \n"; - $res = XDB::iterRow("SELECT id, label FROM emploi_secteur"); - while (list($tmp_id, $tmp_label) = $res->next()) { - $html .= "\n"; - } - return $html; -} - -function select_ss_secteur($secteur,$ss_secteur){ - if ($secteur) { - $html = "\n"; - $res = XDB::iterRow("SELECT id, label FROM emploi_ss_secteur WHERE secteur = {?}", $secteur); - while (list($tmp_id, $tmp_label) = $res->next()){ - $html .= "\n"; - } - return $html; - } - else{ - return "\n"; - } -} - -//fonctions pour smarty -function _select_secteur_smarty($params){ - return select_secteur($params['secteur']); -} - -function _select_ss_secteur_smarty($params){ - return select_ss_secteur($params['secteur'], $params['ss_secteur']); -} -$page->register_function('select_secteur', '_select_secteur_smarty'); -$page->register_function('select_ss_secteur', '_select_ss_secteur_smarty'); -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: -?> diff --git a/modules/profile.php b/modules/profile.php index 2e4d29e..ccbd047 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -33,8 +33,10 @@ class ProfileModule extends PLModule 'profile/ax' => $this->make_hook('ax', AUTH_COOKIE, 'admin'), 'profile/edit' => $this->make_hook('p_edit', AUTH_MDP), 'profile/ajax/address' => $this->make_hook('ajax_address', AUTH_COOKIE, 'user', NO_AUTH), - 'profile/ajax/tel' => $this->make_hook('ajax_tel', AUTH_COOKIE, 'user', NO_AUTH), - 'profile/ajax/medal' => $this->make_hook('ajax_medal', AUTH_COOKIE, 'user', NO_AUTH), + 'profile/ajax/tel' => $this->make_hook('ajax_tel', AUTH_COOKIE, 'user', NO_AUTH), + 'profile/ajax/medal' => $this->make_hook('ajax_medal', AUTH_COOKIE, 'user', NO_AUTH), + 'profile/ajax/job' => $this->make_hook('ajax_job', AUTH_COOKIE, 'user', NO_AUTH), + 'profile/ajax/secteur' => $this->make_hook('ajax_secteur', AUTH_COOKIE, 'user', NO_AUTH), 'profile/medal' => $this->make_hook('medal', AUTH_PUBLIC), 'profile/orange' => $this->make_hook('p_orange', AUTH_MDP), 'profile/usage' => $this->make_hook('p_usage', AUTH_MDP), @@ -371,6 +373,26 @@ class ProfileModule extends PLModule $page->assign('ajaxdeco', true); } + function handler_ajax_job(&$page, $id) + { + $page->changeTpl('profile/jobs.job.tpl', NO_SKIN); + $page->assign('i', $id); + $page->assign('job', array()); + $page->assign('ajaxjob', true); + $page->assign('new', true); + } + + function handler_ajax_secteur(&$page, $id, $sect, $ssect = -1) + { + $res = XDB::iterator("SELECT id, label + FROM emploi_ss_secteur + WHERE secteur = {?}", $sect); + $page->changeTpl('profile/jobs.secteur.tpl', NO_SKIN); + $page->assign('id', $id); + $page->assign('ssecteurs', $res); + $page->assign('sel', $ssect); + } + function handler_p_orange(&$page) { $page->changeTpl('profile/orange.tpl'); diff --git a/modules/profile/jobs.inc.php b/modules/profile/jobs.inc.php index 40628ee..05e538c 100644 --- a/modules/profile/jobs.inc.php +++ b/modules/profile/jobs.inc.php @@ -27,6 +27,16 @@ class ProfileJobs extends ProfilePage { parent::__construct($wiz); } + + public function prepare(PlatalPage &$page) + { + parent::prepare($page); + $page->assign('secteurs', XDB::iterator("SELECT id, label + FROM emploi_secteur")); + $page->assign('fonctions', XDB::iterator("SELECT id, fonction_fr, FIND_IN_SET('titre', flags) AS title + FROM fonctions_def + ORDER BY id")); + } } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: diff --git a/templates/include/flags.radio.tpl b/templates/include/flags.radio.tpl index 8b59d1d..1c21d20 100644 --- a/templates/include/flags.radio.tpl +++ b/templates/include/flags.radio.tpl @@ -21,23 +21,29 @@ {**************************************************************************} {if $display eq "mini"} - + - + - + {elseif $display eq "div"} - + - + - + {else} {if !$notable} @@ -47,19 +53,22 @@
- + site public - + transmis à l'AX - + privé diff --git a/templates/profile/adresses.address.tpl b/templates/profile/adresses.address.tpl index 2f58968..1ae3caa 100644 --- a/templates/profile/adresses.address.tpl +++ b/templates/profile/adresses.address.tpl @@ -53,8 +53,8 @@
-
- {include file="include/flags.radio.tpl" name="`$adpref`[pub]" notable=true val=$adr.pub} +
+ {include file="include/flags.radio.tpl" name="`$adpref`[pub]" notable=true val=$adr.pub display="div"}
{include file="geoloc/form.address.tpl" name=$adpref id=$adid adr=$adr}
diff --git a/templates/profile/base.tpl b/templates/profile/base.tpl index 6be0a17..addb55b 100644 --- a/templates/profile/base.tpl +++ b/templates/profile/base.tpl @@ -22,6 +22,13 @@
+ {icon name=information title="Voir ma fiche"} Tu peux consulter ta fiche telle que la + voient les X, + l'AX ou + n'importe quel internaute. + {include file="include/flags.radio.tpl" notable=true disabled=true name="profile_ex_pub"} +
+
{include file=$profile_page}
diff --git a/templates/profile/jobs.job.tpl b/templates/profile/jobs.job.tpl index 5ad21be..bfdb471 100644 --- a/templates/profile/jobs.job.tpl +++ b/templates/profile/jobs.job.tpl @@ -20,94 +20,128 @@ {* *} {**************************************************************************} +{if $ajaxjob} + +{/if} {assign var=jobid value="job_`$i`"} {assign var=jobpref value="job[`$i`]"} - - - - - - - - - - - - - - - - - - - - - - - - - - + +
-
- {include file="include/flags.radio.tpl" notable=true display="div" name="`$jobpref`[pub]" value=$job.pub} -
- Entreprise n°{$i+1} : - -
Page Web
Secteur d'activité - -
Sous-Secteur d'activité - -
Poste occupé - -
Fonction occupée - -
-
-
- {include file="include/flags.radio.tpl" name="`$jobpref`[adr][pub]" val=$job.adr.pub display="div"} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - -
+
+ {include file="include/flags.radio.tpl" notable=true display="div" name="`$jobpref`[pub]" value=$job.pub}
- -
-
- {include file="include/flags.radio.tpl" name="`$jobpref`[tel_pub]" val=$job.tel_pub display="div"} + Entreprise n°{$i+1} : + + + {icon name=cross title="Supprimer cet emploi"} + +
Page Web
Secteur d'activité + +
Sous-Secteur d'activité +
Poste occupé + +
Fonction occupée + +
+ E-mail professionnel : + + + {include file="include/flags.radio.tpl" name="`$jobpref`[email_pub]" val=$job.mail_pub display="div"} + +
+
+
Adresse
+
+ {include file="include/flags.radio.tpl" name="`$jobpref`[adr][pub]" val=$job.adr.pub display="div"} +
+
+ {include file="geoloc/form.address.tpl" name="`$jobpref`[adr]" id="`$jobpref`_adr" adr=$job.adr} +
- Téléphone - - - - - - - - - - - - - -
Bureau :
Fax :
Mobile :
- -
-
- {include file="include/flags.radio.tpl" name="`$jobpref`[email_pub]" val=$job.mail_pub display="div"} -
- E-mail : - -
+
+
Téléphone
+
+ {include file="include/flags.radio.tpl" name="`$jobpref`[tel_pub]" val=$job.tel_pub display="div"} +
+ + + + + + + + + + + + + +
Bureau :
Fax :
Mobile :
+
+
+
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/profile/jobs.secteur.tpl b/templates/profile/jobs.secteur.tpl new file mode 100644 index 0000000..5af83dd --- /dev/null +++ b/templates/profile/jobs.secteur.tpl @@ -0,0 +1,31 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2007 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + + + + +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/profile/jobs.tpl b/templates/profile/jobs.tpl index 69022ff..f0bfd77 100644 --- a/templates/profile/jobs.tpl +++ b/templates/profile/jobs.tpl @@ -20,16 +20,64 @@ {* *} {**************************************************************************} + {foreach from=$entreprises item=job key=i} -
-{include file="profile/jobs.job.tpl" i=$i job=$job} -
+{include file="profile/jobs.job.tpl" i=$i job=$job new=false} + {/foreach} {if $jobs|@count eq 0} -
-{include file="profile/jobs.job.tpl" i=0 job=0} -
+{include file="profile/jobs.job.tpl" i=0 job=0 new=true} + {/if}
@@ -38,16 +86,15 @@
- +
- Informations professionnelles - CV + Curriculum vitae
-
Curriculum vitae :
privé -- 2.1.4