Fixes nationalities deletion.
[platal.git] / modules / payment.php
index 7b2311a..1fa7639 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -222,7 +222,7 @@ class PaymentModule extends PLModule
                              FROM  group_events
                             WHERE  paiement_id = {?}', $ref);
         if ($eid = $res->fetchOneCell()) {
-            $this->load('xnetevents.inc.php');
+            require_once dirname(__FILE__) . '/xnetevents/xnetevents.inc.php';
             $evt = get_event_detail($eid);
             subscribe_lists_event(0, $uid, $evt, $montant, true);
         }
@@ -316,7 +316,7 @@ class PaymentModule extends PLModule
                              FROM  group_events
                             WHERE  paiement_id = {?}', $ref);
         if ($eid = $res->fetchOneCell()) {
-            $this->load('xnetevents.inc.php');
+            require_once dirname(__FILE__) . '/xnetevents/xnetevents.inc.php';
             $evt = get_event_detail($eid);
             subscribe_lists_event(0, $uid, $evt, $montant, true);
         }
@@ -454,6 +454,11 @@ class PaymentModule extends PLModule
         $table_editor->describe('amount_max','montant maximum',false);
         $table_editor->describe('mail','email contact',true);
         $table_editor->describe('confirmation','message confirmation',false);
+
+        // adds a column with the start date of the linked event if there is one
+        $table_editor->add_option_table('group_events','group_events.paiement_id = t.id');
+        $table_editor->add_option_field('group_events.debut', 'related_event', 'évènement', 'timestamp');
+
         $table_editor->apply($page, $action, $id);
     }
 }