Initial commit
authorMaxime Bourget <bmx007@gmail.com>
Sat, 4 May 2013 10:31:55 +0000 (11:31 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Sat, 4 May 2013 10:41:32 +0000 (11:41 +0100)
hooks.php [new file with mode: 0644]
sql/alter_sales_order_detail.sql [new file with mode: 0644]

diff --git a/hooks.php b/hooks.php
new file mode 100644 (file)
index 0000000..308a941
--- /dev/null
+++ b/hooks.php
@@ -0,0 +1,56 @@
+<?php
+// ----------------------------------------------------------------
+// $ Revision:  1.0 $
+// Creator: Maxime Bourge
+// date_:   2013-05-04
+// Title:   Order Line Extra
+// Free software under GNU GPL
+// ----------------------------------------------------------------
+define ('SS_ORDERLINEX', 131<<8);
+
+class hooks_orderline_extra extends hooks {
+       var $module_name = 'Order Line Extra';
+
+       /*
+               Install additonal menu options provided by module
+       */
+    function install_tabs($app) {
+        global $path_to_root;
+
+    }
+
+    function install_options($app) {
+        global $path_to_root;
+    }
+
+    function install_access()
+       {
+        $security_sections[SS_ORDERLINEX] =  _("Order Line eXtra");
+
+               return array($security_areas, $security_sections);
+       }
+
+    /* This method is called on extension activation for company.   */
+    function activate_extension($company, $check_only=true)
+    {
+        global $db_connections;
+
+        $updates = array(
+            'alter_sales_order_details.sql' => array('0_sales_order_details', )
+        );
+
+        return $this->update_databases($company, $updates, $check_only);
+    }
+
+    function deactivate_extension($company, $check_only=true)
+    {
+        global $db_connections;
+
+        $updates = array(
+            'clean_sales_order_details.sql' => array('ugly_hack') // FIXME: just an ugly hack to clean database on deactivation
+        );
+
+        return $this->update_databases($company, $updates, $check_only);
+    }
+}
+?>
diff --git a/sql/alter_sales_order_detail.sql b/sql/alter_sales_order_detail.sql
new file mode 100644 (file)
index 0000000..4183f4e
--- /dev/null
@@ -0,0 +1,4 @@
+ALTER TABlE 0_sales_order_details
+ADD COLUMN required_date DATE,
+ADD COLUMN comments TEXT
+ADD COLUMN priority INTEGER;