#523: do not overwrite the organizer id when saving changes to an event
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 26 Oct 2006 12:49:39 +0000 (12:49 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 26 Oct 2006 12:49:39 +0000 (12:49 +0000)
(and use the new url_catcher in user freetext)

git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1029 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
modules/profile.php
modules/xnetevents.php
templates/xnetevents/edit.tpl

index ae1c150..f6555e8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -37,6 +37,7 @@ Bug/Wish:
     * Xnet/Events:
         - #490: Events can be opened to non-members                        -FRU
         - #514: Improve visibility of open events                          -FRU
+        - #523: Organizer does not change when editing an event            -FRU
 
 From 0.9.11 branch:
 
index ec07500..e676872 100644 (file)
@@ -191,8 +191,8 @@ class ProfileModule extends PLModule
 
         $new   = Env::v('modif') == 'new';
         $user  = get_user_details($login, S::v('uid'), $view);
-        $user['freetext'] = preg_replace('/((?:https?|ftp):\/\/(?:&amp;|\.*,*[a-z@0-9~%$£µ&i#\-+=_\/\?])*)/i',
-                                         '<a href="\\0">\\0</a>', $user['freetext']);
+        require_once('url_catcher.inc.php');
+        $user['freetext'] = url_catcher($user['freetext'], false);
         $title = $user['prenom'] . ' ' . empty($user['nom_usage']) ? $user['nom'] : $user['nom_usage'];
         $page->assign('xorg_title', $title);
 
index ef4c145..977ea1f 100644 (file)
@@ -338,7 +338,6 @@ class XnetEventsModule extends PLModule
             $evt = array(
                 'eid'              => $eid,
                 'asso_id'          => $globals->asso('id'),
-                'organisateur_uid' => S::v('uid'),
                 'paiement_id'      => Post::v('paiement_id') > 0 ? Post::v('paiement_id') : null,
                 'debut'            => Post::v('deb_Year').'-'.Post::v('deb_Month')
                                       .'-'.Post::v('deb_Day').' '.Post::v('deb_Hour')
@@ -350,10 +349,13 @@ class XnetEventsModule extends PLModule
             );
 
             $trivial = array('intitule', 'descriptif', 'noinvite',
-                             'show_participants', 'accept_nonmembre');
+                             'show_participants', 'accept_nonmembre', 'organisateur_uid');
             foreach ($trivial as $k) {
                 $evt[$k] = Post::v($k);
             }
+            if (!$eid) {
+                $evt['organisateur_uid'] = S::v('uid');
+            }
 
             if (Post::v('deadline')) {
                 $evt['deadline_inscription'] = Post::v('inscr_Year').'-'
@@ -419,7 +421,7 @@ class XnetEventsModule extends PLModule
             }
 
             if (is_null($evt['eid'])) {
-                pl_redirect('events/'.$eid);
+                pl_redirect('events');
             }
         }
 
@@ -435,9 +437,9 @@ class XnetEventsModule extends PLModule
         // when modifying an old event retreive the old datas
         if ($eid) {
             $res = XDB::query(
-                    "SELECT    eid, intitule, descriptif, debut, fin,
-                                show_participants, paiement_id, short_name,
-                                deadline_inscription, noinvite, accept_nonmembre
+                    "SELECT    eid, intitule, descriptif, debut, fin, organisateur_uid,
+                            show_participants, paiement_id, short_name,
+                            deadline_inscription, noinvite, accept_nonmembre
                        FROM    groupex.evenements
                       WHERE eid = {?}", $eid);
             $evt = $res->fetchOneAssoc();
index f3642d7..fc483ae 100644 (file)
@@ -215,6 +215,7 @@ function deadlineChange(box)
   </table>
  
   <div class="center">
+    {if $evt.eid}<input type="hidden" name="organisateur_uid" value="{$evt.organisateur_uid}" />{/if}
     <input type="submit" name="valid" value="Valider" />
     &nbsp;
     <input type="reset" value="Annuler" />