<?php

class hooks_external extends hooks {
    
    function __construct() {
        $this->module_name = 'external'; 
    }

    /*
    * Install additonal menu options provided by module
    */

    function install_options($app) {
	global $path_to_root;

	switch($app->id) {
	    case 'system':
		$app->add_rapp_function(0, _("Mail sending setup"),
			$path_to_root."/modules/".$this->module_name."/mail_setup.php?", 'SA_SETUPCOMPANY', MENU_SETTINGS);
                if(!IS_DEMO) $app->add_rapp_function(0, _("SMS setup"),
			$path_to_root."/modules/".$this->module_name."/sms_setup.php?", 'SA_SETUPCOMPANY', MENU_SETTINGS);
                if(!IS_DEMO) $app->add_lapp_function(0, _("SMS "),
			$path_to_root."/modules/".$this->module_name."/sendsms.php?", 'SA_SETUPCOMPANY', MENU_SETTINGS);
                $app->add_rapp_function(0, _("MPesa setup"),
			$path_to_root."/modules/".$this->module_name."/mpesa_setup.php?", 'SA_SETUPCOMPANY', MENU_SETTINGS);
                break;
            case 'GL':
                $app->add_lapp_function(2, _("Payment Modes"),
                    $path_to_root."/gl/manage/payment_modes.php?", 'SA_BANKACCOUNT', MENU_MAINTENANCE);
		break;
            case 'stock':
                $app->add_rapp_function(2, _("Stock Store UOM"),
			$path_to_root."/modules/".$this->module_name."/stock/stock_uom.php?", 'SA_SETUPCOMPANY', MENU_MAINTENANCE);
                $app->add_lapp_function(0, _("Stock Transactions"),
			$path_to_root."/modules/".$this->module_name."/stock/stock_transactions.php?", 'SA_SETUPCOMPANY', MENU_TRANSACTION);
                $app->add_lapp_function(3, _("Sales &Pricing With Qty Range"),
			$path_to_root."/modules/".$this->module_name."/stock/prices.php?", 'SA_SALESPRICE', MENU_MAINTENANCE);
			$app->add_rapp_function(2, _("Bulk Stock Adjustments"),
			$path_to_root."/modules/".$this->module_name."/manage/import_stocktake.php?NewAdjustment=1", 'SA_INVENTORYADJUSTMENT');
		break;
	}
    }

}
