Add a class Group to handler xnet groups.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 1 Feb 2009 19:10:48 +0000 (20:10 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 1 Feb 2009 19:10:48 +0000 (20:10 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
31 files changed:
classes/group.php [new file with mode: 0644]
classes/platalglobals.php.in
classes/profile.php
classes/user.php
classes/xnetpage.php
core
modules/xnetgrp.php
templates/payment/xnet.tpl
templates/profile/groupesx.tpl
templates/xnet/skin.tpl
templates/xnetevents/admin.tpl
templates/xnetevents/calendar.tpl
templates/xnetevents/edit.tpl
templates/xnetevents/index.tpl
templates/xnetevents/subscribe.tpl
templates/xnetgrp/announce-admin.tpl
templates/xnetgrp/announce-edit.tpl
templates/xnetgrp/annuaire.tpl
templates/xnetgrp/asso.tpl
templates/xnetgrp/edit.tpl
templates/xnetgrp/forum.tpl
templates/xnetgrp/inscrire.tpl
templates/xnetgrp/mail.tpl
templates/xnetgrp/membres-add.tpl
templates/xnetgrp/membres-del.tpl
templates/xnetgrp/membres-edit.tpl
templates/xnetgrp/subscribe-valid.tpl
templates/xnetlists/alias-create.tpl
templates/xnetlists/create.tpl
templates/xnetlists/index.tpl
templates/xnetlists/sync.tpl

diff --git a/classes/group.php b/classes/group.php
new file mode 100644 (file)
index 0000000..62236db
--- /dev/null
@@ -0,0 +1,122 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2009 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                *
+ ***************************************************************************/
+
+class Group
+{
+    public $id;
+    public $shortname;
+    private $data = array();
+
+    private $members = null;
+    private $admins  = null;
+
+    private function __construct(array $data)
+    {
+        foreach ($data as $key=>$value) {
+            $this->data[$key] = $value;
+        }
+        $this->id = intval($this->data['id']);
+        $this->shortname = $this->data['diminutif'];
+    }
+
+    public function __get($name)
+    {
+        if (property_exists($this, $name)) {
+            return $this->$name;
+        }
+
+        if (isset($this->data[$name])) {
+            return $this->data[$name];
+        }
+
+        return null;
+    }
+
+    public function __isset($name)
+    {
+        return property_exists($this, $name) || isset($this->data[$name]);
+    }
+
+    public function getMemberUIDs()
+    {
+        if (is_null($this->members)) {
+            $this->members = XDB::fetchColumn('SELECT  uid
+                                                 FROM  groupex.membres
+                                                WHERE  asso_id = {?}', $this->id);
+        }
+        return $this->members;
+    }
+
+    public function getMembers($sortby = null, $count = null, $offset = null)
+    {
+        return User::getBuildUsersWithUIDs($this->getMemberUIDs(), $sortby, $count, $offset);
+    }
+
+    public function getMemberCount()
+    {
+        return count($this->getMemberUIDs());
+    }
+
+    public function getAdminUIDs()
+    {
+        if (is_null($this->admins)) {
+            $this->admins = XDB::fetchColumn('SELECT  uid
+                                                FROM  groupex.membres
+                                               WHERE  asso_id = {?} AND perms = \'admin\'', $this->id);
+        }
+        return $this->admins;
+    }
+
+    public function getAdmins($sortby = null, $count = null, $offset = null)
+    {
+        return User::getBuildUsersWithUIDs($this->getAdminUIDs(), $sortby, $count, $offset);
+    }
+
+    public function getAdminCount()
+    {
+        return count($this->getAdminUIDs());
+    }
+
+    static public function get($id)
+    {
+        if (!$id) {
+            return null;
+        }
+        if (ctype_digit($id)) {
+            $where = XDB::format('id = {?}', $id);
+        } else {
+            $where = XDB::format('diminutif = {?}', $id);
+        }
+        $res = XDB::query('SELECT  a.*, d.nom AS domnom,
+                                   FIND_IN_SET(\'wiki_desc\', a.flags) AS wiki_desc,
+                                   FIND_IN_SET(\'notif_unsub\', a.flags) AS notif_unsub
+                             FROM  groupex.asso AS a
+                        LEFT JOIN  groupex.dom  AS d ON d.id = a.dom
+                            WHERE  ' . $where);
+        if ($res->numRows() != 1) {
+            return null;
+        }
+        return new Group($res->fetchOneAssoc());
+    }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
index 00353f7..697c297 100644 (file)
@@ -49,7 +49,7 @@ class PlatalGlobals extends PlGlobals
         $this->bootstrap(array('NbValid'), array($this, 'updateNbValid'));
     }
 
-    public function asso($key=null)
+    public function asso($key = null)
     {
         static $aid = null;
 
@@ -59,30 +59,17 @@ class PlatalGlobals extends PlGlobals
                 $gp = substr($gp, 0, $p);
             }
 
-            if ($gp) {
-                $res = XDB::query('SELECT  a.*, d.nom AS domnom,
-                                           FIND_IN_SET(\'wiki_desc\', a.flags) AS wiki_desc,
-                                           FIND_IN_SET(\'notif_unsub\', a.flags) AS notif_unsub
-                                     FROM  groupex.asso AS a
-                                LEFT JOIN  groupex.dom  AS d ON d.id = a.dom
-                                    WHERE  diminutif = {?}', $gp);
-                if (!($aid = $res->fetchOneAssoc())) {
-                    $aid = array();
-                }
-            } else {
-                $aid = array();
-            }
+            $aid = Group::get($gp);
         }
         if (empty($key)) {
             return $aid;
-        } elseif ( isset($aid[$key]) ) {
-            return $aid[$key];
+        } elseif (isset($aid->$key) ) {
+            return $aid->$key;
         } else {
             return null;
         }
     }
 
-
     public function updateNbIns()
     {
         $res = XDB::query("SELECT  COUNT(*)
index d224585..6151a1a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 4b84c79..cea85c6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 50d86bb..d59a2ec 100644 (file)
@@ -139,11 +139,10 @@ function list_all_my_groups($params)
     if (!S::logged()) {
         return;
     }
-    $res = XDB::iterRow(
-            "SELECT  a.nom, a.diminutif
-               FROM  groupex.asso    AS a
-         INNER JOIN  groupex.membres AS m ON m.asso_id = a.id
-              WHERE  m.uid={?}", S::v('uid'));
+    $res = XDB::iterRow('SELECT  a.nom, a.diminutif
+                           FROM  groupex.asso    AS a
+                     INNER JOIN  groupex.membres AS m ON m.asso_id = a.id
+                          WHERE  m.uid = {?}', S::i('uid'));
     $links = '<a href="exit">déconnexion</a>';
     $html = '<div>Mes groupes (' . $links . ') :</div>';
     while (list($nom, $mini) = $res->next()) {
diff --git a/core b/core
index a794b0b..b5e56a7 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit a794b0bd619df7b333018eb8435f755032ea4e8b
+Subproject commit b5e56a710b4bf25ed7b186c2cb9ea6e822db8fa3
index 27df50b..52e6092 100644 (file)
@@ -328,20 +328,18 @@ class XnetGrpModule extends PLModule
 
         $sort = Env::s('order', 'directory_name');
         $ofs  = Env::i('offset');
+        if ($ofs < 0) {
+            $ofs = 0;
+        }
 
         if (Env::b('admin')) {
-            $uids = XDB::fetchColumn('SELECT  uid
-                                        FROM  groupex.membres
-                                       WHERE  asso_id = {?} AND perms = \'admin\'',
-                                     $globals->asso('id'));
+            $users = $globals->asso()->getAdmins($sort, NB_PER_PAGE, $ofs * NB_PER_PAGE);
+            $count = $globals->asso()->getAdminCount();
         } else {
-            $uids = XDB::fetchColumn('SELECT  uid
-                                        FROM  groupex.membres
-                                       WHERE  asso_id = {?}', $globals->asso('id'));
+            $users = $globals->asso()->getMembers($sort, NB_PER_PAGE, $ofs * NB_PER_PAGE);
+            $count = $globals->asso()->getMemberCount();
         }
-        $users = User::getBuildUsersWithUIDs($uids, $sort,
-                                             NB_PER_PAGE, $ofs * NB_PER_PAGE);
-        $page->assign('pages', (count($uids) + NB_PER_PAGE - 1) / NB_PER_PAGE);
+        $page->assign('pages', ($count + NB_PER_PAGE - 1) / NB_PER_PAGE);
         $page->assign('current', $ofs);
         $page->assign('order', $sort);
         $page->assign('users', $users);
@@ -361,11 +359,8 @@ class XnetGrpModule extends PLModule
     function handler_vcard(&$page, $photos = null)
     {
         global $globals;
-        $res = XDB::query('SELECT  uid
-                             FROM  groupex.membres
-                            WHERE  asso_id = {?}', $globals->asso('id'));
         $vcard = new VCard($photos == 'photos', 'Membre du groupe ' . $globals->asso('nom'));
-        $vcard->addUsers($res->fetchColumn());
+        $vcard->addUsers($globals->asso()->getMemberUIDs());
         $vcard->show();
     }
 
@@ -375,11 +370,7 @@ class XnetGrpModule extends PLModule
         if (is_null($filename)) {
             $filename = $globals->asso('diminutif') . '.csv';
         }
-        $id = XDB::fetchColumn("SELECT  uid
-                                  FROM  groupex.membres
-                                 WHERE  asso_id = {?}",
-                                $globals->asso('id'));
-        $users = User::getBuildUsersWithUIDs($id, 'full_name');
+        $users = $globals->asso()->getMembers('directory_name');
         header('Content-Type: text/x-csv; charset=utf-8;');
         header('Pragma: ');
         header('Cache-Control: ');
@@ -593,7 +584,6 @@ class XnetGrpModule extends PLModule
                 break;
             }
         }
-//        var_dump($_SESSION);
         http_redirect($_SERVER['HTTP_REFERER']);
     }
 
index 599a551..4f25b69 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
-<h1>{$asso.nom}&nbsp;: Gestion des télépaiements </h1>
+<h1>{$asso->nom}&nbsp;: Gestion des télépaiements </h1>
 
 <p class="descr">
-Voici la liste des paiements en ligne possible pour le groupe {$asso.nom} :
+Voici la liste des paiements en ligne possible pour le groupe {$asso->nom} :
 </p>
 
 {foreach from=$titres item=p}
index b9c6b49..9f6566b 100644 (file)
 {foreach from=$assos item="asso"}
 <div style="width:48%;float:left" >
 <fieldset style="margin:0.6em">
-    <legend style="padding:4px"><strong><a href="http://www.polytechnique.net/login/{$asso.diminutif}">{$asso.nom}</a></strong></legend>
-    {if $asso.has_logo}
-    <a href="http://www.polytechnique.net/login/{$asso.diminutif}" style="width: 30%; display: block; float: right; ">
-      <img alt="[ LOGO ]" src="http://www.polytechnique.net/{$asso.diminutif}/logo" style="width: 100%" />
+    <legend style="padding:4px"><strong><a href="http://www.polytechnique.net/login/{$asso->diminutif}">{$asso->nom}</a></strong></legend>
+    {if $asso->has_logo}
+    <a href="http://www.polytechnique.net/login/{$asso->diminutif}" style="width: 30%; display: block; float: right; ">
+      <img alt="[ LOGO ]" src="http://www.polytechnique.net/{$asso->diminutif}/logo" style="width: 100%" />
     </a>
     {/if}
     <ul style="padding-top:0px;padding-bottom:0px">
-        <li><a href="http://www.polytechnique.net/{$asso.diminutif}/annuaire">annuaire</a></li>
-        <li><a href="http://www.polytechnique.net/{$asso.diminutif}/trombi">trombino</a></li>
-        <li><a href="http://www.polytechnique.net/{$asso.diminutif}/geoloc">carte</a></li>
-        {if $asso.lists}
-            <li><a href="http://www.polytechnique.net/{$asso.diminutif}/lists">listes de diffusion</a></li>
+        <li><a href="http://www.polytechnique.net/{$asso->diminutif}/annuaire">annuaire</a></li>
+        <li><a href="http://www.polytechnique.net/{$asso->diminutif}/trombi">trombino</a></li>
+        <li><a href="http://www.polytechnique.net/{$asso->diminutif}/geoloc">carte</a></li>
+        {if $asso->lists}
+            <li><a href="http://www.polytechnique.net/{$asso->diminutif}/lists">listes de diffusion</a></li>
         {/if}
-        {if $asso.events}
-            <li><a href="http://www.polytechnique.net/{$asso.diminutif}/events">{$asso.events} événement{if $asso.events > 1}s{/if}</a></li>
+        {if $asso->events}
+            <li><a href="http://www.polytechnique.net/{$asso->diminutif}/events">{$asso->events} événement{if $asso->events > 1}s{/if}</a></li>
         {/if}
-        {if !$asso.lists}
+        {if !$asso->lists}
             <li style="display:block">&nbsp;</li>
         {/if}
-        {if !$asso.events}
+        {if !$asso->events}
             <li style="display:block">&nbsp;</li>
         {/if}
     </ul>
index 2899130..9326e03 100644 (file)
@@ -82,8 +82,8 @@
             </td>
             {if $asso}
             <td class="logo">
-              {if $asso.site}
-                <a href="{$asso.site}"><img src='{$platal->ns}logo' alt="LOGO" height="80" /></a>
+              {if $asso->site}
+                <a href="{$asso->site}"><img src='{$platal->ns}logo' alt="LOGO" height="80" /></a>
               {else}
                 <img src='{$platal->ns}logo' alt="LOGO" height="80"/>
               {/if}
               {/if}
             {/foreach}
           {/foreach}
-          {if $asso && ($is_admin || 
+          {if $asso && $is_admin} {* WARN: this breaks "see the site as"  || 
                       ($smarty.session.suid && ($smarty.session.suid.perms->hasFlag('admin') ||
-                                                $smarty.session.suid.may_update[$asso.id])))}
+                                                $smarty.session.suid.may_update[$asso->id])))} *}
           <h1>Voir le site comme...</h1>
           <form method="post" action="{$platal->ns}change_rights">
             <div>
index ab83d43..80c3fa7 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-<h1>{$asso.nom}&nbsp;: <a href='{$platal->ns}events'>Événements</a> </h1>
+<h1>{$asso->nom}&nbsp;: <a href='{$platal->ns}events'>Événements</a> </h1>
 
 <p>
   {if $evt.titre || count($moments) eq 1}
index 4798a0d..9b50789 100644 (file)
@@ -25,13 +25,13 @@ VERSION:2.0
 CALSCALE:GREGORIAN
 X-WR-TIMEZONE:Europe/Paris
 METHOD:PUBLISH
-{display_ical name="x-wr-calname" value=$asso.nom}
+{display_ical name="x-wr-calname" value=$asso->nom}
 BEGIN:VEVENT
 DSTAMP:{$timestamp|date_format:"%Y%m%dT%H%M%SZ"}
 DTSTART;VALUE=DATE;TZID=Europe/Paris:{$e.debut}
 DTEND;VALUE=DATE;TZID=Europe/Paris:{$e.fin}
 ORGANIZER;CN="{$e.prenom} {$e.nom}":MAILTO:{$e.alias}@polytechnique.org
-UID:event-{$e.short_name}-{$e.eid}@{$asso.diminutif}.polytechnique.org
+UID:event-{$e.short_name}-{$e.eid}@{$asso->diminutif}.polytechnique.org
 {if $admin}
 {foreach from=$participants item=m}
 {if $m.x}
index 31ab564..661826a 100644 (file)
@@ -35,7 +35,7 @@ function deadlineChange(box)
 {/literal}
 </script>
 
-<h1>{$asso.nom}&nbsp;: {$evt.intitule|default:"Nouvel événement"}</h1>
+<h1>{$asso->nom}&nbsp;: {$evt.intitule|default:"Nouvel événement"}</h1>
 
 <p class="descr">
   Un événement peut être une réunion, un séminaire, une conférence, un voyage promo,
@@ -184,7 +184,7 @@ Ton inscription à [METS LE NOM DE L'EVENEMENT ICI] a bien été enregistrée et
 
 -- 
 {$smarty.session.prenom} {$smarty.session.nom}{/if}</textarea><br />
-        Page internet de l'événement&nbsp;: <input size="40" name="site" value="{$paiement_site|default:$asso.site|default:$globals->baseurl|cat:'/'|cat:$platal->ns}" /><br />
+        Page internet de l'événement&nbsp;: <input size="40" name="site" value="{$paiement_site|default:$asso->site|default:$globals->baseurl|cat:'/'|cat:$platal->ns}" /><br />
         Le nouveau paiement sera activé automatiquement après validation par le trésorier de Polytechnique.org,
         ce qui sera fait sous peu.
         <script type="text/javascript">//<![CDATA[
index 5311d07..19b858c 100644 (file)
 {**************************************************************************}
 
 {if !$is_admin}
-<h1>{$asso.nom}&nbsp;: Événements</h1>
+<h1>{$asso->nom}&nbsp;: Événements</h1>
 {else}
 <h1>
-  {$asso.nom}&nbsp;: 
+  {$asso->nom}&nbsp;: 
   {if $archive}[<a href="{$platal->ns}events">Événements</a>] {else}Événements {/if}
   {if $archive}Archives {else}[<a href="{$platal->ns}events/archive">Archives</a>] {/if}
 </h1>
index 695fe59..688876a 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-<h1>{$asso.nom}&nbsp;: Evénement {$event.intitule}</h1>
+<h1>{$asso->nom}&nbsp;: Evénement {$event.intitule}</h1>
 
 <p>
   [<a href="{$platal->ns}events">Revenir à la liste des événements</a>]
index 973cee5..5b5aec4 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-<h1>{$asso.nom}&nbsp;: Administration des announces</h1>
+<h1>{$asso->nom}&nbsp;: Administration des announces</h1>
 
 <table class="bicol">
   <tr>
index ce18b19..e1317f1 100644 (file)
@@ -32,7 +32,7 @@ function visibilityChange(box)
 }
 {/literal}
 </script>
-<h1>{$asso.nom}&nbsp;: Édition d'une annonce</h1>
+<h1>{$asso->nom}&nbsp;: Édition d'une annonce</h1>
 
 {if $art.texte}
 <div>
index 7ed7eb6..ee05e60 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
-<h1>{$asso.nom}&nbsp;: Annuaire du groupe </h1>
+<h1>{$asso->nom}&nbsp;: Annuaire du groupe </h1>
 
 <p class="descr">
-Le groupe {$asso.nom} compte {$nb_tot} membres&nbsp;:
+Le groupe {$asso->nom} compte {$nb_tot} membres&nbsp;:
 </p>
 
 <ul class="descr">
@@ -42,17 +42,17 @@ Le groupe {$asso.nom} compte {$nb_tot} membres&nbsp;:
   </li>
   {/if}
   <li>
-    <a href="{$platal->ns}annuaire/csv/{$asso.diminutif}.csv">
+    <a href="{$platal->ns}annuaire/csv/{$asso->diminutif}.csv">
       {icon name=page_excel title="Fichier Excel"} 
       Obtenir au format Excel
     </a>
   </li>
   <li>
-    <a href="{$platal->ns}annuaire/vcard/photos/{$asso.diminutif}.vcf">
+    <a href="{$platal->ns}annuaire/vcard/photos/{$asso->diminutif}.vcf">
       {icon name=vcard title="Carte de visite"} 
       Ajouter les membres à ton carnet d'adresse
     </a>
-    (<a href="{$platal->ns}annuaire/vcard/{$asso.diminutif}.vcf">sans les photos</a>)
+    (<a href="{$platal->ns}annuaire/vcard/{$asso->diminutif}.vcf">sans les photos</a>)
   </li>
 </ul>
 
@@ -112,9 +112,11 @@ Le groupe {$asso.nom} compte {$nb_tot} membres&nbsp;:
     {if $user->group_comm}
     <td>{$user->group_comm}</td>
     {/if}
-    <td class="right" {if !$m->group_comm}colspan="2"{/if}>
-      <a href="https://www.polytechnique.org/vcard/{$m.email}.vcf">{icon name=vcard title="[vcard]"}</a>
-      <a href="mailto:{$m.email}@polytechnique.org">{icon name=email title="email"}</a>
+    <td class="right" {if !$user->group_comm}colspan="2"{/if}>
+      {if $user->hasProfile()}
+      <a href="https://www.polytechnique.org/vcard/{$user->login()}.vcf">{icon name=vcard title="[vcard]"}</a>
+      {/if}
+      <a href="mailto:{$user->bestEmail()}">{icon name=email title="email"}</a>
     </td>
     {if $is_admin}
     <td class="center">
index 5714102..41b468f 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
-<h1>{$asso.nom}&nbsp;: Accueil</h1>
+<h1>{$asso->nom}&nbsp;: Accueil</h1>
 
 <table cellpadding="0" cellspacing="0" class='tiny'>
-  {if $asso.site}
+  {if $asso->site}
   <tr>
     <td class="titre">
       Site Web&nbsp;:
     </td>
-    <td><a href="{$asso.site}">{$asso.site}</a></td>
+    <td><a href="{$asso->site}">{$asso->site}</a></td>
   </tr>
   {/if}
 
-  {if $asso.resp || $asso.mail}
+  {if $asso->resp || $asso->mail}
   <tr>
     <td class="titre">
       Contact&nbsp;:
     </td>
     <td>
-      {if $asso.mail}
-      {mailto address=$asso.mail text=$asso.resp|utf8_decode|default:"par email" encode=javascript}
+      {if $asso->mail}
+      {mailto address=$asso->mail text=$asso->resp|utf8_decode|default:"par email" encode=javascript}
       {else}
-      {$asso.resp}
+      {$asso->resp}
       {/if}
     </td>
   </tr>
   {/if}
 
-  {if $asso.forum}
+  {if $asso->forum}
   <tr>
     <td class="titre">
       Forum&nbsp;:
     </td>
     <td>
       <a href="{$platal->ns}forum">par le web</a>
-      ou <a href="news://ssl.polytechnique.org/{$asso.forum}">par nntp</a>
+      ou <a href="news://ssl.polytechnique.org/{$asso->forum}">par nntp</a>
     </td>
   </tr>
   {/if}
 
-  {if !$is_member && $is_logged && $asso.inscriptible && $xnet_type != 'promotions'}
+  {if !$is_member && $is_logged && $asso->inscriptible && $xnet_type != 'promotions'}
   <tr>
     <td class="titre">
       M'inscrire&nbsp;:
     </td>
     <td>
-      <a href="{if $asso.sub_url}{$asso.sub_url}{else}{$platal->ns}subscribe{/if}">m'inscrire</a>
+      <a href="{if $asso->sub_url}{$asso->sub_url}{else}{$platal->ns}subscribe{/if}">m'inscrire</a>
     </td>
   </tr>
   {elseif $is_member}
       Me désinscrire&nbsp;:
     </td>
     <td>
-      <a href="{if $asso.unsub_url}{$asso.unsub_url}{else}{$platal->ns}unsubscribe{/if}">me désinscrire</a>
+      <a href="{if $asso->unsub_url}{$asso->unsub_url}{else}{$platal->ns}unsubscribe{/if}">me désinscrire</a>
     </td>
   </tr>
   {/if}
 
-  {if $asso.ax}
+  {if $asso->ax}
   <tr>
     <td class="titre center" colspan="2">
       groupe agréé par l'AX
 <br />
 
 <div style="text-align: justify">
-  {if $asso.wiki_desc}
-  {$asso.descr|miniwiki:title|smarty:nodefaults}
+  {if $asso->wiki_desc}
+  {$asso->descr|miniwiki:title|smarty:nodefaults}
   {else}
-  {$asso.descr|smarty:nodefaults}
+  {$asso->descr|smarty:nodefaults}
   {/if}
 </div>
 
index ce76dbf..5f0277b 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-<h1>{if $asso.nom}{$asso.nom}&nbsp;: {/if}Éditer l'accueil</h1>
+<h1>{if $asso->nom}{$asso->nom}&nbsp;: {/if}Éditer l'accueil</h1>
 
 <form method="post" action="{$platal->ns}edit" enctype="multipart/form-data">
   {xsrf_token_field}
@@ -31,7 +31,7 @@
         Nom&nbsp;:
       </td>
       <td>
-        <input type="text" size="40" value="{$asso.nom}" name="nom" />
+        <input type="text" size="40" value="{$asso->nom}" name="nom" />
       </td>
     </tr>
     <tr>
@@ -39,7 +39,7 @@
         Diminutif&nbsp;:
       </td>
       <td>
-        <input type="text" size="40" value="{$asso.diminutif}" name="diminutif" />
+        <input type="text" size="40" value="{$asso->diminutif}" name="diminutif" />
       </td>
     </tr>
     <tr>
@@ -47,7 +47,7 @@
         Domaine DNS&nbsp;:
       </td>
       <td>
-        <input type="text" size="40" value="{$asso.mail_domain}" name="mail_domain" />
+        <input type="text" size="40" value="{$asso->mail_domain}" name="mail_domain" />
       </td>
     </tr>
     <tr>
       </td>
       <td>
         <select name="cat">
-          <option value="groupesx" {if $asso.cat eq GroupesX}selected="selected"{/if}>Groupes X</option>
-          <option value="binets" {if $asso.cat eq Binets}selected="selected"{/if}>Binets</option>
-          <option value="promotions" {if $asso.cat eq Promotions}selected="selected"{/if}>Promotions</option>
-          <option value="institutions" {if $asso.cat eq Institutions}selected="selected"{/if}>Institutions</option>
+          <option value="groupesx" {if $asso->cat eq GroupesX}selected="selected"{/if}>Groupes X</option>
+          <option value="binets" {if $asso->cat eq Binets}selected="selected"{/if}>Binets</option>
+          <option value="promotions" {if $asso->cat eq Promotions}selected="selected"{/if}>Promotions</option>
+          <option value="institutions" {if $asso->cat eq Institutions}selected="selected"{/if}>Institutions</option>
         </select>
       </td>
     </tr>
@@ -71,7 +71,7 @@
         <select name="dom">
           <option value=""></option>
           {iterate from=$dom item=d}
-          <option value="{$d.id}" {if $d.id eq $asso.dom}selected="selected"{/if}>{$d.nom} [{$d.cat}]</option>
+          <option value="{$d.id}" {if $d.id eq $asso->dom}selected="selected"{/if}>{$d.nom} [{$d.cat}]</option>
           {/iterate}
         </select>
       </td>
@@ -94,7 +94,7 @@
         Site web&nbsp;:
       </td>
       <td>
-        <input type="text" size="40" value="{$asso.site|default:"http://"}" name="site" />
+        <input type="text" size="40" value="{$asso->site|default:"http://"}" name="site" />
       </td>
     </tr>
 
         Contact&nbsp;:
       </td>
       <td>
-        <input type="text" size="40" name="resp" value="{$asso.resp}" />
+        <input type="text" size="40" name="resp" value="{$asso->resp}" />
       </td>
     </tr>
 
         Adresse email&nbsp;:
       </td>
       <td>
-        <input type="text" size="40" name="mail" value="{$asso.mail}" />
+        <input type="text" size="40" name="mail" value="{$asso->mail}" />
       </td>
     </tr>
 
         Forum&nbsp;:
       </td>
       <td>
-        <input type="text" size="40" name="forum" value="{$asso.forum}" />
+        <input type="text" size="40" name="forum" value="{$asso->forum}" />
       </td>
     </tr>
 
       </td>
       <td>
         <input type="radio" value="1" id="inscr_yes"
-          {if $asso.inscriptible eq 1}checked="checked"{/if}
+          {if $asso->inscriptible eq 1}checked="checked"{/if}
           name="inscriptible" />
         <label for="inscr_yes">oui</label>
         <input type="radio" value="0" id="inscr_no"
-          {if $asso.inscriptible neq 1}checked="checked"{/if}
+          {if $asso->inscriptible neq 1}checked="checked"{/if}
           name="inscriptible" />
         <label for="inscr_no">non</label>
       </td>
         <em>laisser vide par défaut</em>
       </td>
       <td>
-        <input type="text" size="40" name="sub_url" value="{$asso.sub_url}" />
+        <input type="text" size="40" name="sub_url" value="{$asso->sub_url}" />
       </td>
     </tr>
 
         <em>laisser vide par défaut</em>
       </td>
       <td>
-        <input type="text" size="40" name="unsub_url" value="{$asso.unsub_url}" />
+        <input type="text" size="40" name="unsub_url" value="{$asso->unsub_url}" />
       </td>
     </tr>
 
     <tr>
       <td class="titre center" colspan="2">
-        <label><input type="checkbox" value="1" name="ax" {if $asso.ax}checked="checked"{/if} />
+        <label><input type="checkbox" value="1" name="ax" {if $asso->ax}checked="checked"{/if} />
         groupe agréé par l'AX</label>
       </td>
     </tr>
       <td class="titre center" colspan="2">
         Diffusion de la liste des membres&nbsp;:
         <select name="pub">
-          <option value="public" {if $asso.pub eq 'public'}selected="selected"{/if}>Publique</option>
-          <option value="membre" {if $asso.pub eq 'membre'}selected="selected"{/if}>Aux membres du groupe</option>
-          <option value="private" {if $asso.pub eq 'private'}selected="selected"{/if}>Aux animateurs du groupe</option>
+          <option value="public" {if $asso->pub eq 'public'}selected="selected"{/if}>Publique</option>
+          <option value="membre" {if $asso->pub eq 'membre'}selected="selected"{/if}>Aux membres du groupe</option>
+          <option value="private" {if $asso->pub eq 'private'}selected="selected"{/if}>Aux animateurs du groupe</option>
         </select>
       </td>
     </tr>
     <tr>
       <td class="titre center" colspan="2">
-        <label><input type="checkbox" value="1" name="notif_unsub" {if $asso.notif_unsub}checked="checked"{/if} />
+        <label><input type="checkbox" value="1" name="notif_unsub" {if $asso->notif_unsub}checked="checked"{/if} />
         prévenir les animateurs lors de la désinscription d'un membre</label>
       </td>
     </tr>
       {icon name=information title="Syntaxe wiki"} Voir la syntaxe wiki autorisée pour la description.
     </a>
     <textarea name="descr" cols="70" rows="15" id="descr"
-              {if !$asso.wiki_desc && $asso.descr}class="error"{/if}>{$asso.descr}</textarea>
+              {if !$asso->wiki_desc && $asso->descr}class="error"{/if}>{$asso->descr}</textarea>
     <input type="submit" name="preview" value="Aperçu de la description"
            onclick="previewWiki('descr', 'preview_descr', true, 'preview_descr'); return false;" /><br />
     <input type="submit" name="submit" value="Enregistrer" />
index b56abee..80604c7 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-<h1>{$asso.nom}&nbsp;: Forum</h1>
+<h1>{$asso->nom}&nbsp;: Forum</h1>
 
 {$banana|smarty:nodefaults}
 
index 0eac944..28a4d5d 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-<h1>Demande d'inscription à {$asso.nom}</h1>
+<h1>Demande d'inscription à {$asso->nom}</h1>
 
 {if $user && $is_admin && $show_form}
 
 <p class="descr">
 <strong>Ta demande d'inscription a bien été envoyée !</strong> Tu seras averti par email de la suite qui lui sera donnée.
 <p>
-<p class="descr">[<a href="{$platal->ns}">Retour à la page d'accueil de {$asso.nom}</a>]</p>
+<p class="descr">[<a href="{$platal->ns}">Retour à la page d'accueil de {$asso->nom}</a>]</p>
 
 {else}
 
 <p class="descr">
-Pour t'inscrire à {$asso.nom}, il te faut en demander l'autorisation aux animateurs du groupe via le
+Pour t'inscrire à {$asso->nom}, il te faut en demander l'autorisation aux animateurs du groupe via le
 formulaire ci-dessous. Vérifie et corrige au besoin les différents champs, puis clique sur
 [&nbsp;M'inscrire&nbsp;!&nbsp;].
 </p>
 <form action="{$platal->ns}subscribe" method="post">
   {xsrf_token_field}
   <p class="descr">
-  <strong>OUI, je souhaite être inscrit au groupe {$asso.nom}.</strong>
+  <strong>OUI, je souhaite être inscrit au groupe {$asso->nom}.</strong>
   </p>
   <p class="descr">
   Indique ci-après <strong>tes motivations</strong> qui seront communiquées aux animateurs du groupe&nbsp;:
   </p> <textarea cols=80 rows=12 name="message">
 Chers Camarades,
 
-Je souhaite m'inscrire à {$asso.nom}.
+Je souhaite m'inscrire à {$asso->nom}.
 
 Merci d'avance d'avoir la gentillesse de valider mon inscription.
 
index 2040597..1a91b92 100644 (file)
@@ -21,7 +21,7 @@
 {**************************************************************************}
 
 
-<h1>{$asso.nom}&nbsp;: Envoyer un email</h1>
+<h1>{$asso->nom}&nbsp;: Envoyer un email</h1>
 
 <p class="descr">
 Ton message peut être personnalisé&nbsp;: si tu rentres les mots &lt;cher&gt;, &lt;prenom&gt;,
@@ -131,11 +131,11 @@ masculin ou féminin, par son prénom, ou son nom.
 {else}
 &lt;cher&gt; &lt;prenom&gt;,
 
-Nous avons le plaisir de t'adresser la lettre mensuelle du groupe {$asso.nom}.
+Nous avons le plaisir de t'adresser la lettre mensuelle du groupe {$asso->nom}.
 
 (insérer le texte...)
 
-Le bureau du groupe {$asso.nom}.
+Le bureau du groupe {$asso->nom}.
 {/if}
          </textarea>
       </td>
index cff436b..01ddadf 100644 (file)
@@ -52,7 +52,7 @@ function searchX()
 {/literal}
 //]]></script>
 
-<h1>{$asso.nom}&nbsp;: Ajout d'un membre</h1>
+<h1>{$asso->nom}&nbsp;: Ajout d'un membre</h1>
 
 <form method="post" action="{$platal->ns}member/new/">
   {xsrf_token_field}
index 7bbd86e..9a46b52 100644 (file)
@@ -32,7 +32,7 @@
 
 {else}
  
-<h1>{$asso.nom}&nbsp;: gestion des membres</h1>
+<h1>{$asso->nom}&nbsp;: gestion des membres</h1>
 
 <h2>
   Suppression du membre&nbsp;: {$user.prenom} {$user.nom}
@@ -44,7 +44,7 @@
   <div class="center">
     <p class="descr">
     {if $self}
-    Êtes-vous sûr de vouloir vous désinscrire du groupe {$asso.nom} et de toutes
+    Êtes-vous sûr de vouloir vous désinscrire du groupe {$asso->nom} et de toutes
     les listes de diffusion associées ?
     {else}
     Êtes-vous sûr de vouloir supprimer {$user.prenom} {$user.nom} du groupe,
index d36e235..044f821 100644 (file)
@@ -40,7 +40,7 @@
 {/literal}
 </script>
 
-<h1>{$asso.nom}&nbsp;: gestion des membres</h1>
+<h1>{$asso->nom}&nbsp;: gestion des membres</h1>
 
 <p>
 [<a href='{$platal->ns}annuaire'>Retour à l'annuaire</a>]
index 51348c9..8d4cfac 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-<h1>{$asso.nom}&nbsp;: Validation des inscriptions</h1>
+<h1>{$asso->nom}&nbsp;: Validation des inscriptions</h1>
 
 <script type="text/javascript">//<![CDATA[
 {literal}
index 4c3d79d..29719e5 100644 (file)
@@ -54,7 +54,7 @@ de modération), il est recommandé de créer <a href="{$platal->ns}lists/create
     <tr>
       <td><strong>Adresse&nbsp;souhaitée&nbsp;:</strong></td>
       <td>
-        <input type='text' name='liste' value='{$smarty.post.liste}' />@{$asso.mail_domain}
+        <input type='text' name='liste' value='{$smarty.post.liste}' />@{$asso->mail_domain}
       </td>
     </tr>
   </table>
index 7fc9f43..db7cb14 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-<h1>{$asso.nom}&nbsp;: Création d'une liste de diffusion</h1>
+<h1>{$asso->nom}&nbsp;: Création d'une liste de diffusion</h1>
 
 <p class="descr">
 <strong>Note&nbsp;:</strong> les listes de diffusion sont un outil particulièrement adapté pour des
@@ -42,7 +42,7 @@ Si tu as besoin de cette fonctionnalité, il faut alors <strong>impérativement<
     <tr>
       <td><strong>Adresse&nbsp;souhaitée&nbsp;:</strong></td>
       <td colspan='3'>
-        <input type='text' name='liste' value='{$smarty.post.liste}' />@{$asso.mail_domain}
+        <input type='text' name='liste' value='{$smarty.post.liste}' />@{$asso->mail_domain}
       </td>
     </tr>
     <tr>
index 3a2dcda..de9c8e8 100644 (file)
@@ -34,9 +34,9 @@
 
 {else}
 
-<h1>{$asso.nom}&nbsp;: Listes de diffusion</h1>
+<h1>{$asso->nom}&nbsp;: Listes de diffusion</h1>
 
-<h2>Listes de diffusion du groupe {$asso.nom}&nbsp;:</h2>
+<h2>Listes de diffusion du groupe {$asso->nom}&nbsp;:</h2>
 
 <p class="descr">
 Une liste dont <strong>la diffusion</strong> est modérée est une liste dont les emails sont validés
@@ -62,7 +62,7 @@ croix verte te permet de t'inscrire, après accord des responsables si l'inscrip
   {foreach from=$listes item=l}
   <tr>
     <td class='center'>
-      <a href="mailto:{$l.list}@{$asso.mail_domain}">{icon name=email title="email"}</a>
+      <a href="mailto:{$l.list}@{$asso->mail_domain}">{icon name=email title="email"}</a>
     </td>
     <td>
       {if $l.own}
@@ -106,7 +106,7 @@ croix verte te permet de t'inscrire, après accord des responsables si l'inscrip
 t'empêcherait de t'y réabonner par la suite sans l'aide d'un administrateur.
 </p>
         
-<h2>Voici les alias existants pour le groupe {$asso.nom}&nbsp;:</h2>
+<h2>Voici les alias existants pour le groupe {$asso->nom}&nbsp;:</h2>
 
 <table cellspacing="0" cellpadding="0" class='large'>
   <tr>
index 48437ad..a1cf661 100644 (file)
@@ -21,7 +21,7 @@
 {**************************************************************************}
 
 {include file='lists/header_listes.tpl' on='sync'}
-<h1>Non abonnés à la liste {$platal->argv[1]}@{$asso.mail_domain}</h1>
+<h1>Non abonnés à la liste {$platal->argv[1]}@{$asso->mail_domain}</h1>
 
 <form action="{$platal->ns}lists/sync/{$platal->argv[1]}" method="post">
   {xsrf_token_field}