From: Florent Bruneau Date: Tue, 27 Jan 2009 21:48:16 +0000 (+0100) Subject: Cleanup, use PlDict and last core. X-Git-Tag: xorg/1.0.0~332^2~405 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=f00c59e87637652efbe095022bb5dedd595e0037;p=platal.git Cleanup, use PlDict and last core. Signed-off-by: Florent Bruneau --- diff --git a/core b/core index e25ddad..f4e68a7 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit e25ddad9784ef9e8e4de1847b50207f88622a165 +Subproject commit f4e68a785c9cd69abf70db02944eb9422fef6414 diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index 32f7118..e2fcdc4 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -89,10 +89,9 @@ class XnetGrpModule extends PLModule Env::i('unread'), S::i('uid')); pl_redirect("#art" . Env::i('unread')); } - $arts = XDB::iterator("SELECT a.*, u.nom, u.prenom, u.promo, u.hruid, - FIND_IN_SET('photo', a.flags) AS photo + // XXX: Fix promo_min; promo_max + $arts = XDB::iterator("SELECT a.*, FIND_IN_SET('photo', a.flags) AS photo FROM groupex.announces AS a - INNER JOIN auth_user_md5 AS u USING(user_id) LEFT JOIN groupex.announces_read AS r ON (r.user_id = {?} AND r.announce_id = a.id) WHERE asso_id = {?} AND peremption >= CURRENT_DATE() AND (promo_min = 0 OR promo_min <= {?}) @@ -110,11 +109,10 @@ class XnetGrpModule extends PLModule S::i('uid'), $globals->asso('id'), S::i('promo'), S::i('promo')); $page->assign('article_index', $index); } else { - $arts = XDB::iterator("SELECT a.*, u.nom, u.prenom, u.promo, FIND_IN_SET('photo', a.flags) AS photo + $arts = XDB::iterator("SELECT a.*, FIND_IN_SET('photo', a.flags) AS photo FROM groupex.announces AS a - INNER JOIN auth_user_md5 AS u USING(user_id) WHERE asso_id = {?} AND peremption >= CURRENT_DATE() - AND FIND_IN_SET('public', u.flags)", + AND FIND_IN_SET('public', a.flags)", $globals->asso('id')); } if (may_update()) { diff --git a/plugins/function.profile.php b/plugins/function.profile.php index d686b1c..be02e7b 100644 --- a/plugins/function.profile.php +++ b/plugins/function.profile.php @@ -21,11 +21,15 @@ function smarty_function_profile($params, &$smarty) { - $with_promo = isset($params['with_promo']) ? $params['with_promo'] : false; - $with_sex = isset($params['with_sex']) ? $params['with_sex'] : true; - $with_link = isset($params['with_link']) ? $params['with_link'] : true; - $with_groupperms = isset($params['with_groupperms']) ? $params['with_groupperms'] : true; - $user = $params['user']; + $params = new PlDict($params); + $with_promo = $params->b('promo', false); + $with_sex = $params->b('sex', true); + $with_link = $params->b('link', true); + $with_groupperms = $params->b('groupperms', true); + $user = $params->v('user'); + if (ctype_digit($user)) { + $user = User::getWithUID($user); + } $name = pl_entities($user->fullName()); if ($with_sex && $user->isFemale()) { diff --git a/templates/skin/common.bandeau.tpl b/templates/skin/common.bandeau.tpl index 26e242b..71d84e5 100644 --- a/templates/skin/common.bandeau.tpl +++ b/templates/skin/common.bandeau.tpl @@ -32,13 +32,16 @@ -{if !$login && $smarty.session.auth} - {assign var="login" value="true"} -{/if} {* vim:set et sw=2 sts=2 sws=2 enc=utf8: *} diff --git a/templates/xnet/skin.tpl b/templates/xnet/skin.tpl index 805db2b..d8fbc0b 100644 --- a/templates/xnet/skin.tpl +++ b/templates/xnet/skin.tpl @@ -50,12 +50,12 @@ {include core=plpage.devel.tpl} - {if !$simple} + {if !t($simple)} {include file=skin/common.bandeau.tpl} {/if} - {if !$simple} + {if !t($simple)}
@@ -78,7 +78,7 @@ {if $xnet_type} {if $asso} {/if}{* fin simple *} - {if $menu && !$simple} + {if $menu && !t($simple)} - {if !$simple} + {if !t($simple)} @@ -162,7 +162,7 @@ {/if} {/if} - {if !$simple} + {if !t($simple)} diff --git a/templates/xnetgrp/form.announce.tpl b/templates/xnetgrp/form.announce.tpl index 554cbdc..3975155 100644 --- a/templates/xnetgrp/form.announce.tpl +++ b/templates/xnetgrp/form.announce.tpl @@ -66,10 +66,7 @@ {foreach from=$not_in_list item=u} - +
- {$xnet_type} + {$xnet_type}
----------
----------
- Annonce proposée par - - {$art.prenom} {$art.nom} (X{$art.promo}) - + Annonce proposée par {profile user=$art.user_id sex=false promo=true groupperms=false}
diff --git a/templates/xnetlists/sync.tpl b/templates/xnetlists/sync.tpl index a92d7aa..48437ad 100644 --- a/templates/xnetlists/sync.tpl +++ b/templates/xnetlists/sync.tpl @@ -34,7 +34,7 @@
{profile user=$u with_promo=false}{profile user=$u promo=false} {$u->promo()}