From 3b3e9d150cc36f1ac440ef897a1fea19621214ee Mon Sep 17 00:00:00 2001 From: x2001corpet Date: Fri, 26 Aug 2005 08:14:23 +0000 Subject: [PATCH] amelioration du lien paiement / evenements + choix pour la synchro ax dans le profil git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@28 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 10 ++++++---- htdocs.net/groupe/evenements.php | 15 +++++++++++---- htdocs.net/groupe/evt-detail.php | 4 ++++ htdocs/paiement/index.php | 4 +++- include/money.inc.php | 18 ++++++++++++++++-- include/profil/assign_general.inc.php | 2 ++ include/profil/get_general.inc.php | 5 ++++- include/profil/update_general.inc.php | 4 +++- include/tabs.inc.php | 4 ++-- templates/paiement/index.tpl | 5 +++++ templates/profil/general.tpl | 30 ++++++++++++++++++++++++++++++ templates/xnet/groupe/evenements.tpl | 2 +- templates/xnet/groupe/evt-detail.tpl | 2 +- templates/xnet/groupe/form_evenement.tpl | 8 ++++---- 14 files changed, 92 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index bff3a1c..3cafdcf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,20 +13,22 @@ Bug/Wish : * Paiments : - #336 : Micro -> Tele(payments). -MC - - Fixed little text mistake in Payments menu -CAT + - Fixed little text mistake in Payments menu. -CAT + - Direct link from and to events. -Car * Profile : - #330,333: Interface improvements. -Car - #332: User can precise why he asks for a usage name. -Car - - #335: Already assigned promotion don't generate a request -CAT + - #335: Already assigned promotion don't generate a request. -CAT + - User can accept/refuse synchronisatio from AX by admin. -Car * Xnet : - Various bug fixes in events management. -Car - #334: Interface improvements. -Car * User Interface: - - #337: Added link to trackers and support website for admins -CAT - - #338: Broken FSF link fixed on donation page -CAT + - #337: Added link to trackers and support website for admins. -CAT + - #338: Broken FSF link fixed on donation page. -CAT ================================================================================ VERSION 0.9.8 18 Jul 2005 diff --git a/htdocs.net/groupe/evenements.php b/htdocs.net/groupe/evenements.php index f3fd9c0..bcd71ac 100644 --- a/htdocs.net/groupe/evenements.php +++ b/htdocs.net/groupe/evenements.php @@ -23,13 +23,17 @@ if ($eid = Env::get('eid')) { if (may_update() && Post::get('intitule')) { $short_name = Env::get('short_name'); //Quelques vérifications sur l'alias (caractères spéciaux) - if ($short_name && !preg_match( "/^[a-zA-Z0-9\-.]{3,20}$/", $short_name)) { + if ($short_name && !preg_match( "/^[a-zA-Z0-9\-.]{3,20}$/", $short_name)) + { $page->trig("Le raccourci demandé n'est pas valide. Vérifie qu'il comporte entre 3 et 20 caractères et qu'il ne contient que des lettres non accentuées, des chiffres ou les caractères - et ."); $short_name = $infos['short_name']; $page->assign('get_form', true); + $get_form = true; + // set the field to the previously requested field + $page->assign('evt', $_REQUEST); } //vérifier que l'alias n'est pas déja pris if ($short_name && $short_name != $infos['short_name']) { @@ -38,6 +42,9 @@ if (may_update() && Post::get('intitule')) { $page->trig("Le raccourci demandé est déjà utilisé. Choisis en un autre."); $short_name = $infos['short_name']; $page->assign('get_form', true); + $get_form = true; + // set the field to the previously requested field + $page->assign('evt', $_REQUEST); } } if ($short_name && $infos['short_name'] && $short_name != $infos['short_name']) { @@ -78,7 +85,7 @@ if (may_update() && Post::get('intitule')) { debut = {?}, fin = {?}, membres_only = {?}, advertise = {?}, show_participants = {?}, short_name = {?}", $eid, $globals->asso('id'), Session::get('uid'), Post::get('intitule'), - (Post::get('paiement')>0)?Post::get('paiement'):NULL, Post::get('descriptif'), + (Post::get('paiement_id')>0)?Post::get('paiement_id'):NULL, Post::get('descriptif'), Post::get('deb_Year')."-".Post::get('deb_Month')."-".Post::get('deb_Day')." ".Post::get('deb_Hour').":".Post::get('deb_Minute').":00", Post::get('fin_Year')."-".Post::get('fin_Month')."-".Post::get('fin_Day')." ".Post::get('fin_Hour').":".Post::get('fin_Minute').":00", Post::get('membres_only'), Post::get('advertise'), Post::get('show_participants'), $short_name, $eid); @@ -103,7 +110,7 @@ if (may_update() && Post::get('intitule')) { } // request for a new payment - if (Post::get('paiement') == -1 && $money_defaut >= 0) { + if (Post::get('paiement_id') == -1 && $money_defaut >= 0) { require_once ('validations.inc.php'); $p = new PayReq(Session::get('uid'), Post::get('intitule')." - ".$globals->asso('nom'), Post::get('site'), $money_defaut, Post::get('confirmation'),0, 999, $globals->asso('id'), $eid); $p->submit(); @@ -129,7 +136,7 @@ if (may_update() && Env::has('sup') && $eid) { $globals->xdb->execute("DELETE FROM requests WHERE type = 'paiements' AND data LIKE {?}", PayReq::same_event($eid, $globals->asso('id'))); } -if (may_update() && (Env::has('add') || (Env::has('mod') && $eid))) { +if (may_update() && (Env::has('add') || (Env::has('mod') && $eid || $get_form))) { $page->assign('get_form', true); $res = $globals->xdb->iterator ("SELECT id, text FROM {$globals->money->mpay_tprefix}paiements WHERE asso_id = {?}", $globals->asso('id')); diff --git a/htdocs.net/groupe/evt-detail.php b/htdocs.net/groupe/evt-detail.php index bf49dbe..eeabdeb 100644 --- a/htdocs.net/groupe/evt-detail.php +++ b/htdocs.net/groupe/evt-detail.php @@ -47,6 +47,10 @@ if (Env::get('ins')) { require_once('xnet/evenements.php'); $evt = get_event_detail(Env::get('eid')); + +if (!$evt) + header("Location: evenements.php"); + if (Env::has('ins')) { subscribe_lists_event($participate, Session::get("uid"), $evt['participant_list'], $evt['absent_list']); header("Location: evenements.php?backfrom=".Env::get('eid')); diff --git a/htdocs/paiement/index.php b/htdocs/paiement/index.php index 0d1c1cb..5990ae7 100644 --- a/htdocs/paiement/index.php +++ b/htdocs/paiement/index.php @@ -33,7 +33,7 @@ if($pay->flags->hasflag('old')){ $page->trig("La transaction selectionnée est périmée."); $pay = new Payment(); } -$val = ($op=="submit" && Env::has('montant')) ? Env::get('montant') : $pay->montant_def; +$val = (Env::has('montant')) ? Env::get('montant') : $pay->montant_def; if (($e = $pay->check($val)) !== true) { $page->trig($e); @@ -48,10 +48,12 @@ if ($op=='submit') { if ($res->total()) $page->assign('transactions', $res); } +$val = floor($val).".".substr(floor(($val - floor($val))*100+100),1); $page->assign('montant',$val); $page->assign('meth', $meth); $page->assign('pay', $pay); +$page->assign('evtlink', $pay->event()); $page->assign('prefix',$globals->money->mpay_tprefix); $page->run(); diff --git a/include/money.inc.php b/include/money.inc.php index 78979ba..196153e 100644 --- a/include/money.inc.php +++ b/include/money.inc.php @@ -33,6 +33,7 @@ class Payment var $montant_min; var $montant_max; var $montant_def; + var $asso_id; var $api = null; @@ -43,14 +44,16 @@ class Payment { global $globals; $r = $ref==-1 ? $globals->money->mpay_def_id : $ref; - $res = $globals->xdb->query("SELECT id, text, url, flags, mail, montant_min, montant_max, montant_def + $res = $globals->xdb->query("SELECT id, text, url, flags, mail, montant_min, montant_max, montant_def, asso_id FROM {$globals->money->mpay_tprefix}paiements WHERE id={?}", $r); list($this->id, $this->text, $this->url, $flags, $this->mail, - $this->montant_min, $this->montant_max, $this->montant_def) = $res->fetchOneRow(); + $this->montant_min, $this->montant_max, $this->montant_def, $this->asso_id) = $res->fetchOneRow(); $this->montant_min = (float)$this->montant_min; $this->montant_max = (float)$this->montant_max; $this->flags = new Flagset($flags); + + return $link; } // }}} @@ -84,6 +87,17 @@ class Payment { return $this->api->prepareform($this); } + + function event() + { + global $globals; + if ($this->asso_id) + { + $res = $globals->xdb->query("SELECT eid, a.diminutif FROM groupex.evenements AS e, groupex.asso AS a WHERE e.asso_id = {?} AND a.id = {?}", $this->asso_id, $this->asso_id); + return $res->fetchOneAssoc(); + } + return null; + } } // }}} diff --git a/include/profil/assign_general.inc.php b/include/profil/assign_general.inc.php index 1823b75..ef2d1c7 100644 --- a/include/profil/assign_general.inc.php +++ b/include/profil/assign_general.inc.php @@ -45,4 +45,6 @@ $page->assign('appli_type2',$appli_type2); $page->assign('photo_pub',$photo_pub); $page->assign('nouvellephoto', $nouvellephoto); $page->assign('nickname', $nickname); + +$page->assign('synchro_ax', $synchro_ax); ?> diff --git a/include/profil/get_general.inc.php b/include/profil/get_general.inc.php index 67ea33f..c6c7e5a 100644 --- a/include/profil/get_general.inc.php +++ b/include/profil/get_general.inc.php @@ -22,6 +22,7 @@ // on ramène les données du profil connecté (uid paramètre de session) $sql = "SELECT u.nom, u.prenom, u.nom_ini, u.prenom_ini, u.promo, u.promo_sortie, u.nom_usage, u.nationalite, q.profile_mobile, q.profile_mobile_pub, q.profile_web, q.profile_web_pub, q.profile_freetext, q.profile_freetext_pub, q.profile_nick, + q.profile_from_ax, a1.aid, a1.type, a2.aid, a2.type FROM auth_user_md5 AS u INNER JOIN auth_user_quick AS q USING(user_id) @@ -32,6 +33,7 @@ $sql = "SELECT u.nom, u.prenom, u.nom_ini, u.prenom_ini, u.promo, u.promo_sorti $result = $globals->xdb->query($sql, Session::getInt('uid', -1)); list($nom, $prenom, $nom_ini, $prenom_ini, $promo, $promo_sortie, $nom_usage, $nationalite, $mobile, $mobile_pub, $web, $web_pub, $freetext, $freetext_pub, $nickname, + $synchro_ax, $appli_id1,$appli_type1, $appli_id2,$appli_type2) = $result->fetchOneRow(); $result = $globals->xdb->query("SELECT pub FROM photo WHERE uid = {?}", Session::getInt('uid', -1)); @@ -54,11 +56,12 @@ replace_ifset($appli_type1,"appli_type1"); replace_ifset($appli_type2,"appli_type2"); replace_ifset($nickname,"nickname"); -if(Env::has('modifier') || Env::has('suivant')) { +if(Env::has('modifier') || Env::has('suivant') && Env::get('old_tab') == 'general') { $mobile_pub = Env::get('mobile_pub'); $web_pub = Env::has('web_pub')?'public':'private'; $freetext_pub = Env::has('freetext_pub')?'public':'private'; $photo_pub = Env::has('photo_pub')?'public':'private'; + $synchro_ax = Env::has("synchro_ax")?1:0; } require_once("xorg.misc.inc.php"); diff --git a/include/profil/update_general.inc.php b/include/profil/update_general.inc.php index ea784a5..8921abc 100644 --- a/include/profil/update_general.inc.php +++ b/include/profil/update_general.inc.php @@ -41,12 +41,14 @@ $globals->xdb->execute( profile_nick={?}, profile_mobile={?}, profile_mobile_pub={?}, profile_web={?}, profile_web_pub={?}, - profile_freetext={?}, profile_freetext_pub={?} + profile_freetext={?}, profile_freetext_pub={?}, + profile_from_ax = {?} WHERE user_id = {?}", $nickname, $mobile, $mobile_pub, $web, $web_pub, $freetext, $freetext_pub, + $synchro_ax, Session::getInt('uid', -1)); if ($nickname != $nickname_anc) { diff --git a/include/tabs.inc.php b/include/tabs.inc.php index 559179f..9bffc5b 100644 --- a/include/tabs.inc.php +++ b/include/tabs.inc.php @@ -21,9 +21,9 @@ $tabname_array = Array( - "general" => "Informations\ngénérales", + "general" => "Général", "adresses" => "Adresses\npersonnelles", - "poly" => "Informations\npolytechniciennes", + "poly" => "Groupes X\nBinets", "deco" => "Décorations\nMédailles", "emploi" => "Informations\nprofessionnelles", "skill" => "Compétences\ndiverses", diff --git a/templates/paiement/index.tpl b/templates/paiement/index.tpl index b17a55d..5b1790d 100644 --- a/templates/paiement/index.tpl +++ b/templates/paiement/index.tpl @@ -75,6 +75,11 @@ recevras une confirmation par email. {$pay->api->text}

{/if} +{if $evtlink} +

+Si tu n'es pas encore inscrit à cet événement, n'oublie pas d'aller t'inscrire. +

+{/if} {else} diff --git a/templates/profil/general.tpl b/templates/profil/general.tpl index 8a54ec7..68c45c8 100644 --- a/templates/profil/general.tpl +++ b/templates/profil/general.tpl @@ -140,6 +140,36 @@
+ + + + + + + + + + +
+ Synchronisation avec l'AX +
+ Le service annuaire de l'AX met à jour l'annuaire papier à partir des informations que tu lui envoies. Tu peux choisir ici de récupérer directement ces données pour l'annuaire en ligne. +
+ + + + + +
+ + + Autoriser la synchronisation depuis l'AX. +
+
+
+ +
diff --git a/templates/xnet/groupe/evenements.tpl b/templates/xnet/groupe/evenements.tpl index a2a637a..2d8b228 100644 --- a/templates/xnet/groupe/evenements.tpl +++ b/templates/xnet/groupe/evenements.tpl @@ -21,7 +21,7 @@ {**************************************************************************}

{$asso.nom} : -{if ($smarty.request.add || $smarty.request.mod) && $admin} +{if ($smarty.request.add || $smarty.request.mod || $get_form) && $admin} Evénements {else} Evénements diff --git a/templates/xnet/groupe/evt-detail.tpl b/templates/xnet/groupe/evt-detail.tpl index 29e4d48..7a195e7 100644 --- a/templates/xnet/groupe/evt-detail.tpl +++ b/templates/xnet/groupe/evt-detail.tpl @@ -89,7 +89,7 @@ {if $montant > 0 || $paid > 0}

$paid}class="erreur"{/if}> Pour cet événement tu dois payer {$montant|replace:'.':','} € {if $paid > 0}, et tu as déjà payé {$paid|replace:'.':','} €{/if} - {if $evt.paiement_id} [Effectuer le paiement]{/if} + {if $evt.paiement_id && $montant > $paid} [Effectuer le paiement]{/if}

{/if}
diff --git a/templates/xnet/groupe/form_evenement.tpl b/templates/xnet/groupe/form_evenement.tpl index f6f2d3a..72eb71d 100644 --- a/templates/xnet/groupe/form_evenement.tpl +++ b/templates/xnet/groupe/form_evenement.tpl @@ -39,14 +39,14 @@

- + - + @@ -90,10 +90,10 @@ -
Intitulé de l'événement :Intitulé de l'événement :
Evénement en raccourci (pour les mailings listes) :Evénement en raccourci (pour les mailings listes) :
Référence de paiement : + Référence de paiement : - {if $evt.paiement_id eq -2} {/if} -- 2.1.4