308a9419d9303d0007931e99ee4e477901da3983
[order_line_extra.git] / hooks.php
1 <?php
2 // ----------------------------------------------------------------
3 // $ Revision:  1.0 $
4 // Creator: Maxime Bourge
5 // date_:   2013-05-04
6 // Title:   Order Line Extra
7 // Free software under GNU GPL
8 // ----------------------------------------------------------------
9 define ('SS_ORDERLINEX', 131<<8);
10
11 class hooks_orderline_extra extends hooks {
12         var $module_name = 'Order Line Extra';
13
14         /*
15                 Install additonal menu options provided by module
16         */
17     function install_tabs($app) {
18         global $path_to_root;
19
20     }
21
22     function install_options($app) {
23         global $path_to_root;
24     }
25
26     function install_access()
27         {
28         $security_sections[SS_ORDERLINEX] =  _("Order Line eXtra");
29
30                 return array($security_areas, $security_sections);
31         }
32
33     /* This method is called on extension activation for company.   */
34     function activate_extension($company, $check_only=true)
35     {
36         global $db_connections;
37
38         $updates = array(
39             'alter_sales_order_details.sql' => array('0_sales_order_details', )
40         );
41
42         return $this->update_databases($company, $updates, $check_only);
43     }
44
45     function deactivate_extension($company, $check_only=true)
46     {
47         global $db_connections;
48
49         $updates = array(
50             'clean_sales_order_details.sql' => array('ugly_hack') // FIXME: just an ugly hack to clean database on deactivation
51         );
52
53         return $this->update_databases($company, $updates, $check_only);
54     }
55 }
56 ?>