fix subscribe thingy
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Sat, 7 May 2005 12:49:15 +0000 (12:49 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:53 +0000 (23:28 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-624

htdocs.net/groupe/asso.php
htdocs.net/groupe/edit.php
templates/xnet/groupe/asso.tpl
templates/xnet/groupe/edit.tpl
upgrade/0.9.6/00_xnet.sql

index 729ca74..bc697d5 100644 (file)
@@ -5,6 +5,7 @@ require 'xnet.inc.php';
 new_page('xnet/groupe/asso.tpl', AUTH_PUBLIC);
 $page->useMenu();
 $page->setType($globals->asso('cat'));
+$page->assign('is_member', is_member());
 
 $page->assign('asso', $globals->asso());
 if (!$globals->asso('id')) {
index 389e3e5..fbf2e0d 100644 (file)
@@ -7,21 +7,21 @@
         if (has_perms()) {
             $globals->xdb->execute(
                 "UPDATE  groupex.asso
-                    SET  nom={?}, diminutif={?}, cat={?}, dom={?}, descr={?}, site={?}, mail={?}, resp={?}, forum={?}, mail_domain={?}, ax={?}
+                    SET  nom={?}, diminutif={?}, cat={?}, dom={?}, descr={?}, site={?}, mail={?}, resp={?}, forum={?}, mail_domain={?}, ax={?}, sub_url={?}
                   WHERE  id={?}",
                   Post::get('nom'), Post::get('diminutif'), Post::get('cat'), Post::getInt('dom'),
                   Post::get('descr'), Post::get('site'), Post::get('mail'), Post::get('resp'),
-                  Post::get('forum'), Post::get('mail_domain'), Post::has('ax'), $globals->asso('id'));
+                  Post::get('forum'), Post::get('mail_domain'), Post::has('ax'), Post::get('sub_url'), $globals->asso('id'));
             if (Post::get('mail_domain')) {
                 $globals->xdb->execute('INSERT INTO virtual_domains (domain) VALUES({?})', Post::get('mail_domain'));
             }
         } else {
             $globals->xdb->execute(
                 "UPDATE  groupex.asso
-                    SET  descr={?}, site={?}, mail={?}, resp={?}, forum={?}, ax={?}
+                    SET  descr={?}, site={?}, mail={?}, resp={?}, forum={?}, ax={?}, sub_url={?}
                   WHERE  id={?}",
                   Post::get('descr'), Post::get('site'), Post::get('mail'), Post::get('resp'),
-                  Post::get('forum'), Post::has('ax'), $globals->asso('id'));
+                  Post::get('forum'), Post::has('ax'), Post::get('sub_url'), $globals->asso('id'));
         }
 
         if ($_FILES['logo']['name']) {
index 4c118e4..063b67f 100644 (file)
   </tr>
   {/if}
 
+  {if !$is_member}
   <tr>
-    <td class="titre" colspan="2">
-      <strong>TODO: INSCRIPTION</strong>
+    <td class="titre">
+      M'inscrire :
+    </td>
+    <td>
+      <a href="{$asso.sub_url|default:"inscrire.php"}">m'inscrire</a>
     </td>
   </tr>
+  {/if}
 
   {if $asso.ax}
   <tr>
index c760301..f279b95 100644 (file)
     </tr>
 
     <tr>
-      <td class="titre" colspan="2">
-        <strong>TODO: INSCRIPTION</strong>
+      <td class="titre">
+        Lien pour l'inscription:<br />
+        <em>laisser vide par défaut</em>
+      </td>
+      <td>
+        <input type="text" size="40" name="sub_url" value="{$asso.sub_url}" />
       </td>
     </tr>
 
index 0e1e997..43de972 100644 (file)
@@ -10,6 +10,9 @@ alter table groupex.asso change column resp resp CHAR(255) not null;
 alter table groupex.asso change column forum forum CHAR(255) not null;
 alter table groupex.asso change column mail_domain mail_domain CHAR(255) not null;
 alter table groupex.asso add unique index (diminutif);
+alter table groupex.asso add column sub_url char(255) not null;
 
 alter table groupex.membres change column uid uid int not null;
 
+update groupex.asso set sub_url='http://www2.x-consult.org/xconsult/register.php' where diminutif = 'X-Mines-Consult';
+