add jquery script, use it to autoload on xnet when xorg cookie is present
[platal.git] / modules / xnetevents.php
index 269f5a2..f35b2f8 100644 (file)
@@ -30,7 +30,7 @@ class XnetEventsModule extends PLModule
             '%grp/events/sub'   => $this->make_hook('sub',     AUTH_MDP),
             '%grp/events/csv'   => $this->make_hook('csv',     AUTH_MDP),
             '%grp/events/ical'  => $this->make_hook('ical',    AUTH_MDP),
-            '%grp/events/edit'  => $this->make_hook('edit',    AUTH_MDP),
+            '%grp/events/edit'  => $this->make_hook('edit',    AUTH_MDP, 'groupadmin'),
             '%grp/events/admin' => $this->make_hook('admin',   AUTH_MDP),
         );
     }
@@ -266,7 +266,7 @@ class XnetEventsModule extends PLModule
             return PL_NOT_FOUND;
         }
 
-        header('Content-type: text/x-csv; encoding=iso-8859-1');
+        header('Content-type: text/x-csv; encoding=UTF-8');
         header('Pragma: ');
         header('Cache-Control: ');
 
@@ -433,13 +433,19 @@ class XnetEventsModule extends PLModule
                                 Post::v('site'), $money_defaut,
                                 Post::v('confirmation'), 0, 999,
                                 $globals->asso('id'), $eid);
-                $p->submit();
+                if ($p->accept()) {
+                    $p->submit();
+                } else {
+                    $page->assign('paiement_message', Post::v('confirmation'));
+                    $page->assign('paiement_site', Post::v('site'));
+                    $error = true;
+                }
             }
 
             // events with no sub-event: add a sub-event with no name
             if ($nb_moments == 0) {
                 XDB::execute("INSERT INTO groupex.evenements_items
-                                        VALUES ({?}, {?}, '', '', 0)", $eid, 1);
+                                   VALUES ({?}, {?}, '', '', 0)", $eid, 1);
             }
 
             if (!$error) {