<?php
/**
 * Rocky Zhang 2012.5.28
*/

class app_ome extends app {
    var $ver = '2.0';
    var $name = '联通ShopEx体系ERP';
    var $author = 'rocky anjiaxin';
    var $help = 'http://www.shopex.cn/help/ShopEx48/help_shopex48-ekaidian-app-ome.html';
    
    function ctl_mapper(){
        return array(
            'admin:order/order:index'=>'order_ctl:index',
            'admin:order/order:detail'=>'order_ctl:detail',
            'admin:order/order:colsetting'=>'order_ctl:colsetting',
            'admin:order/order:save_col_setting'=>'order_ctl:save_col_setting',
        );
    }
    
    function listener(){
        return array(
            'trading/order:payed'=>'order_listener:order_to_ome',
            'trading/order:refund'=>'order_listener:refund_to_ome',
            'trading/order:create'=>'order_listener:order_to_ome',
            'trading/order:addmemo'=>'order_listener:order_to_ome',
            'trading/order:editorder'=>'order_listener:order_to_ome',
            'trading/order:cancel'=>'order_listener:order_to_ome',
            'member/account:saleservice'=>'order_listener:aftersale_to_ome',
        );
    }
    
    function output_modifiers(){
        return array(
            'admin:order/order:showEdit'=>'order_modifier:showEdit',
        );
    }
    
    function crontab_queue() {
         return array(
           'mdl_matrix:run_queue',
         );
    }
    
    function getMenu(&$menu){
        $menu['order']['items'][0]['items'][] = array (
            'type' => 'menu',
            'label' => 'OME同步日志',
            'link' => 'index.php?ctl=plugins/ome_queue&act=index',
        );
    }
    
    function setting_load(){}
}

