???
authorMaxime Bourget <bmx007@gmail.com>
Fri, 14 Jun 2013 12:46:19 +0000 (13:46 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Fri, 14 Jun 2013 12:46:19 +0000 (13:46 +0100)
hooks.php

index 589ce02bd37a3b52f1788956272aa713f14799a3..5b2624929ff188e7a14e3a2a66a747d1f5ef911d 100644 (file)
--- a/hooks.php
+++ b/hooks.php
@@ -17,13 +17,13 @@ class hooks_order_line_extra extends hooks {
        /*
                Install additonal menu options provided by module
        */
-    function install_tabs($app) {
-        global $path_to_root;
+               function install_tabs($app) {
+                               global $path_to_root;
 
-    }
+               }
 
-    function install_options($app) {
-        global $path_to_root;
+               function install_options($app) {
+                               global $path_to_root;
                                switch($app->id) {
                                        case 'orders':
                                                $app->add_rapp_function(0, _('Order Extra'), 
@@ -39,11 +39,11 @@ class hooks_order_line_extra extends hooks {
                                                break;
                                }
 
-    }
+               }
 
-    function install_access()
+               function install_access()
        {
-        $security_sections[SS_ORDERLINEX] =  _("Order Line Extra");
+                               $security_sections[SS_ORDERLINEX] =  _("Order Line Extra");
                $security_areas['SA_ORDERLINEX_EDIT'] = array(SS_ORDERLINEX|1, _("Edit lines"));
                $security_areas['SA_ORDERLINEX_SCHEDULE'] = array(SS_ORDERLINEX|1, _("Item Schedule"));
                $security_areas['SA_ORDERLINEX_REFRESH'] = array(SS_ORDERLINEX|1, _("Reset Cache"));
@@ -51,36 +51,36 @@ class hooks_order_line_extra extends hooks {
                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;
+               /* This method is called on extension activation for company.   */
+               function activate_extension($company, $check_only=true)
+               {
+                               global $db_connections;
 
-        $updates = array(
+                               $updates = array(
                                                'alter_sales_order_details.sql' => array('sales_order_details','required_date'),
                                                'alter_sales_order_details_2.sql' => array('sales_order_details','expiry_date'),
                                                'create_denorm_order_details_queue.sql' => array('denorm_order_details_queue'),
                                                'create_denorm_qoh.sql' => array('denorm_qoh'),
                                                'create_order_summary_view.sql' => array('order_summary_view'),
-        );
+                               );
 
                                return $this->update_databases($company, $updates, $check_only)
                                                                && update_order_detail_defaults(true)
                                                                && update_queue_quantities()
                                                                && update_qoh_for_item()
                                                                ;
-    }
+               }
 
-    function deactivate_extension($company, $check_only=true)
-    {
-        global $db_connections;
+               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
-        );
+                               $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);
-    }
+                               return $this->update_databases($company, $updates, $check_only);
+               }
 
                function get_allowed_quantity($detail_id, $opts) {
                        $location = array_shift($opts);
@@ -122,9 +122,9 @@ class hooks_order_line_extra extends hooks {
                        }
 
                        // update null fields of new entered orders.
-               $types = array(ST_SALESORDER, 'order_xtra');
-               if(in_array($trans_type, $types)) update_order_detail_defaults();
-       
+                       $types = array(ST_SALESORDER, 'order_xtra');
+                       if(in_array($trans_type, $types)) update_order_detail_defaults();
+
                }
 
 
@@ -133,9 +133,9 @@ class hooks_order_line_extra extends hooks {
                $types = array(ST_CUSTCREDIT, ST_CUSTDELIVERY, ST_INVADJUST, ST_PURCHORDER, ST_WORKORDER, ST_MANUISSUE,
                                ST_SALESORDER, ST_SALESQUOTE, ST_MANURECEIVE);
                if(in_array($trans_type, $types)) {
-                       update_queue_quantities();
-                       update_qoh_for_item();
-               }
+                               update_queue_quantities();
+                               update_qoh_for_item();
+                       }
                }
 }