[Fusionforge-commits] r9266 - in trunk/gforge/common: . system_event

Christian Bayle cbayle at libremir.placard.fr.eu.org
Mon Mar 29 10:00:58 CEST 2010


Author: cbayle
Date: 2010-03-29 10:00:58 +0200 (Mon, 29 Mar 2010)
New Revision: 9266

Added:
   trunk/gforge/common/system_event/
   trunk/gforge/common/system_event/SystemEvent.class.php
   trunk/gforge/common/system_event/SystemEventManager.class.php
Log:
Add Codendi system_event glue


Added: trunk/gforge/common/system_event/SystemEvent.class.php
===================================================================
--- trunk/gforge/common/system_event/SystemEvent.class.php	                        (rev 0)
+++ trunk/gforge/common/system_event/SystemEvent.class.php	2010-03-29 08:00:58 UTC (rev 9266)
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
+ *
+ * This file is a part of Codendi.
+ *
+ * Codendi 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.
+ *
+ * Codendi 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 Codendi. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * 
+ */
+
+
+
+/**
+ * System Event class
+ *
+ */
+abstract class SystemEvent {
+
+  const PRIORITY_MEDIUM = 2; 
+}
+
+?>
+

Added: trunk/gforge/common/system_event/SystemEventManager.class.php
===================================================================
--- trunk/gforge/common/system_event/SystemEventManager.class.php	                        (rev 0)
+++ trunk/gforge/common/system_event/SystemEventManager.class.php	2010-03-29 08:00:58 UTC (rev 9266)
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
+ *
+ * This file is a part of Codendi.
+ *
+ * Codendi 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.
+ *
+ * Codendi 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 Codendi. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * 
+ */
+
+/**
+* Manager of system events
+*
+* Base class to manage system events
+*/
+class SystemEventManager {
+    
+   
+
+    // Constructor
+    function SystemEventManager() {
+       
+    }
+
+    protected static $_instance;
+    /**
+     * SystemEventManager is singleton
+     */
+    public static function instance() {
+        if (!isset(self::$_instance)) {
+            $c = __CLASS__;
+            self::$_instance = new $c;
+        }
+        return self::$_instance;
+    }
+ 
+    /**
+     * Create a new event, store it in the db and send notifications
+     */
+    public function createEvent($type, $parameters, $priority) {
+        $sql = "INSERT INTO system_event (type, parameters,create_date,log) VALUES ('".$type."','".$parameters['group_list_id']."','".$_SERVER['REQUEST_TIME']."', 'NEW');";
+		return db_query($sql);
+        }
+    
+    
+    
+      
+             
+}
+
+?>
+




More information about the Fusionforge-commits mailing list