From: x2003bruneau Date: Thu, 27 Jul 2006 16:30:43 +0000 (+0000) Subject: Fix some layout issues when browsing through the group list X-Git-Tag: xorg/0.9.11~232 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=f0430dc7403d6c3c29f51132c0f8295c782d7555;p=platal.git Fix some layout issues when browsing through the group list git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@682 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/modules/xnet.php b/modules/xnet.php index f116c68..e5bb296 100644 --- a/modules/xnet.php +++ b/modules/xnet.php @@ -203,21 +203,22 @@ class XnetModule extends PLModule $page->assign('dom', $dom); $res = XDB::query("SELECT id,nom FROM groupex.dom - WHERE FIND_IN_SET({?}, cat) ORDER BY nom", $cat); + WHERE FIND_IN_SET({?}, cat) + ORDER BY nom", $cat); $doms = $res->fetchAllAssoc(); $page->assign('doms', $doms); if (empty($doms)) { - $res = XDB::iterator("SELECT diminutif, nom FROM groupex.asso - WHERE FIND_IN_SET({?}, cat) ORDER BY nom", $cat); + $res = XDB::query("SELECT diminutif, nom FROM groupex.asso + WHERE FIND_IN_SET({?}, cat) + ORDER BY nom", $cat); + $page->assign('gps', $res->fetchAllAssoc()); } elseif (!is_null($dom)) { - $res = XDB::iterator("SELECT diminutif, nom FROM groupex.asso - WHERE FIND_IN_SET({?}, cat) AND dom={?} - ORDER BY nom", $cat, $dom); - } else { - $res = null; + $res = XDB::query("SELECT diminutif, nom FROM groupex.asso + WHERE FIND_IN_SET({?}, cat) AND dom={?} + ORDER BY nom", $cat, $dom); + $page->assign('gps', $res->fetchAllAssoc()); } - $page->assign('gps', $res); $page->useMenu(); $page->setType($cat); diff --git a/templates/xnet/groupes.tpl b/templates/xnet/groupes.tpl index a039531..49ace1e 100644 --- a/templates/xnet/groupes.tpl +++ b/templates/xnet/groupes.tpl @@ -27,14 +27,12 @@ - {if !$doms || !$gps}
Groupes X
Binets
Institutions
Promotions
- {/if} {if $doms} @@ -46,15 +44,24 @@ {/if} - {if $gps} - - {iterate from=$gps item=g} - - + - {/if}
{$g.nom}
+ {if $gps} + + {foreach from=$gps item=g name=all key=i} + {if $doms || $i is even} + + {/if} + + {if !$doms && $i is even && $smarty.foreach.all.last}{/if} + {if $doms || $i is odd || $smarty.foreach.all.last} + + {/if} + {/foreach}
+ {$g.nom} +
- {/iterate} + {/if}