<?php
$config->version = 'biz5.1';
$config->dashboard->modules = 'my,todo,effort';

$config->psi = new stdclass();
$config->psi->turnon = true;

$config->hasPreAndNextObjects .= 'salary,';

if(!defined('TABLE_FUND'))             define('TABLE_FUND',             '`' . $config->db->prefix . 'cash_fund`');
if(!defined('TABLE_INVOICE'))          define('TABLE_INVOICE',          '`' . $config->db->prefix . 'cash_invoice`');
if(!defined('TABLE_INVOICEDETAIL'))    define('TABLE_INVOICEDETAIL',    '`' . $config->db->prefix . 'cash_invoicedetail`');
if(!defined('TABLE_KINGDEEACCOUNT'))   define('TABLE_KINGDEEACCOUNT',   '`' . $config->db->prefix . 'cash_kingdeeaccount`');
if(!defined('TABLE_MAPPINGRELATION'))  define('TABLE_MAPPINGRELATION',  '`' . $config->db->prefix . 'cash_mappingrelation`');
if(!defined('TABLE_TRADEINVOICE'))     define('TABLE_TRADEINVOICE',     '`' . $config->db->prefix . 'cash_tradeinvoice`');
if(!defined('TABLE_VOUCHER'))          define('TABLE_VOUCHER',          '`' . $config->db->prefix . 'cash_voucher`');
if(!defined('TABLE_VOUCHERDETAIL'))    define('TABLE_VOUCHERDETAIL',    '`' . $config->db->prefix . 'cash_voucherdetail`');
if(!defined('TABLE_CUSTOMERINVOICE'))  define('TABLE_CUSTOMERINVOICE',  '`' . $config->db->prefix . 'crm_customerinvoice`');
if(!defined('TABLE_ORDERACTION'))      define('TABLE_ORDERACTION',      '`' . $config->db->prefix . 'crm_orderaction`');
if(!defined('TABLE_ORDERFIELD'))       define('TABLE_ORDERFIELD',       '`' . $config->db->prefix . 'crm_orderfield`');
if(!defined('TABLE_QUOTATION'))        define('TABLE_QUOTATION',        '`' . $config->db->prefix . 'crm_quotation`');
if(!defined('TABLE_COMMISSIONRULE'))   define('TABLE_COMMISSIONRULE',   '`' . $config->db->prefix . 'hr_commissionrule`');
if(!defined('TABLE_BONUS'))            define('TABLE_BONUS',            '`' . $config->db->prefix . 'hr_bonus`');
if(!defined('TABLE_SALARY'))           define('TABLE_SALARY',           '`' . $config->db->prefix . 'hr_salary`');
if(!defined('TABLE_SALARYDETAIL'))     define('TABLE_SALARYDETAIL',     '`' . $config->db->prefix . 'hr_salarydetail`');
if(!defined('TABLE_SALARYCOMMISSION')) define('TABLE_SALARYCOMMISSION', '`' . $config->db->prefix . 'hr_salarycommission`');
if(!defined('TABLE_TRADECOMMISSION'))  define('TABLE_TRADECOMMISSION',  '`' . $config->db->prefix . 'hr_tradecommission`');
if(!defined('TABLE_BATCH'))            define('TABLE_BATCH',            '`' . $config->db->prefix . 'psi_batch`');
if(!defined('TABLE_BATCHPRODUCT'))     define('TABLE_BATCHPRODUCT',     '`' . $config->db->prefix . 'psi_batchproduct`');
if(!defined('TABLE_PSI_ORDER'))        define('TABLE_PSI_ORDER',        '`' . $config->db->prefix . 'psi_order`');
if(!defined('TABLE_PSI_ORDERPRODUCT')) define('TABLE_PSI_ORDERPRODUCT', '`' . $config->db->prefix . 'psi_orderproduct`');
if(!defined('TABLE_PSI_ORDERREFUND'))  define('TABLE_PSI_ORDERREFUND',  '`' . $config->db->prefix . 'psi_orderrefund`');
if(!defined('TABLE_PURCHASEPRODUCT'))  define('TABLE_PURCHASEPRODUCT',  '`' . $config->db->prefix . 'psi_purchaseproduct`');
if(!defined('TABLE_COMPANY'))          define('TABLE_COMPANY',          '`' . $config->db->prefix . 'sys_company`');
if(!defined('TABLE_EFFORT'))           define('TABLE_EFFORT',           '`' . $config->db->prefix . 'sys_effort`');
if(!defined('TABLE_ISSUE'))            define('TABLE_ISSUE',            '`' . $config->db->prefix . 'sys_issue`');
if(!defined('TABLE_STORE'))            define('TABLE_STORE',            '`' . $config->db->prefix . 'sys_store`');
if(!defined('TABLE_WECHATAGENT'))      define('TABLE_WECHATAGENT',      '`' . $config->db->prefix . 'sys_wechatagent`');
if(!defined('TABLE_WEEKLY'))           define('TABLE_WEEKLY',           '`' . $config->db->prefix . 'sys_weekly`');
if(!defined('TABLE_OAUTH'))            define('TABLE_OAUTH',            '`' . $config->db->prefix . 'sys_oauth`');
if(!defined('TABLE_SEARCHINDEX'))      define('TABLE_SEARCHINDEX',      '`' . $config->db->prefix . 'sys_searchindex`');
if(!defined('TABLE_SEARCHDICT'))       define('TABLE_SEARCHDICT',       '`' . $config->db->prefix . 'sys_searchdict`');

$config->objectTables['effort']     = TABLE_EFFORT;
$config->objectTables['feedback']   = TABLE_ISSUE;
$config->objectTables['invoice']    = TABLE_INVOICE;
$config->objectTables['payable']    = TABLE_FUND;
$config->objectTables['receivable'] = TABLE_FUND;
$config->objectTables['psiorder']   = TABLE_PSI_ORDER;
$config->objectTables['weekly']     = TABLE_WEEKLY;
$config->objectTables['salary']     = TABLE_SALARY;

$config->rights->member['company'][] = 'browse';

$config->rights->member['customer'][] = 'showImport';
$config->rights->member['customer'][] = 'ajaxGetCustomerInvoices';

$config->rights->member['order'][] = 'getRoles';
$config->rights->member['order'][] = 'operate';
$config->rights->member['order'][] = 'tasks';
$config->rights->member['order'][] = 'ajaxGetProducts';
$config->rights->member['order'][] = 'ajaxGetCompanyOrderList';
$config->rights->member['order'][] = 'ajaxGetOrderProductList';

$config->rights->member['product'][] = 'ajaxCheckFieldLength';

$config->rights->member['feedback'][] = 'personal';
$config->rights->member['feedback'][] = 'browse';
$config->rights->member['feedback'][] = 'ajaxGetContacts';

$config->rights->member['salary'][] = 'personal';
$config->rights->member['salary'][] = 'browse';
$config->rights->member['salary'][] = 'view';
$config->rights->member['salary'][] = 'setCommission';
$config->rights->member['salary'][] = 'ajaxGetTax';
$config->rights->member['salary'][] = 'ajaxGetDeptUsers';

$config->rights->member['commission'][] = 'getRemainRates';

$config->rights->member['my'][] = 'salary';
$config->rights->member['my'][] = 'search';
$config->rights->member['my'][] = 'viewSalary';
$config->rights->member['my'][] = 'setPassword';
$config->rights->member['my'][] = 'checkPassword';
$config->rights->member['my'][] = 'effort';

$config->rights->member['effort'][] = 'batchCreate';
$config->rights->member['effort'][] = 'createForObject';
$config->rights->member['effort'][] = 'edit';
$config->rights->member['effort'][] = 'batchEdit';
$config->rights->member['effort'][] = 'view';
$config->rights->member['effort'][] = 'delete';
$config->rights->member['effort'][] = 'export';
$config->rights->member['effort'][] = 'calendar';
$config->rights->member['effort'][] = 'browseWeekly';
$config->rights->member['effort'][] = 'viewWeekly';
$config->rights->member['effort'][] = 'createWeekly';
$config->rights->member['effort'][] = 'editWeekly';
$config->rights->member['effort'][] = 'deleteWeekly';

$config->rights->member['sale'][]     = 'index';
$config->rights->member['purchase'][] = 'index';

$config->rights->member['receivable'][] = 'index';
$config->rights->member['receivable'][] = 'ajaxGetContracts';
$config->rights->member['receivable'][] = 'ajaxGetOrders';
$config->rights->member['receivable'][] = 'ajaxGetBatches';

$config->rights->member['refund'][] = 'deduction';

$config->rights->member['payable'][] = 'index';
$config->rights->member['payable'][] = 'ajaxGetOrders';
$config->rights->member['payable'][] = 'ajaxGetBatches';

$config->rights->member['invoice'][] = 'index';
$config->rights->member['invoice'][] = 'ajaxGetDrawnMoney';
$config->rights->member['invoice'][] = 'ajaxGetInvoiceCount';
$config->rights->member['invoice'][] = 'ajaxGetInvoiceDetails';

$config->rights->member['wechat'][] = 'uploadImage';
$config->rights->member['wechat'][] = 'bindUser';
$config->rights->member['wechat'][] = 'unbindUser';

$config->rights->member['search'][] = 'index';

$filter->wechat = new stdclass();
$filter->wechat->oauthcallback = new stdclass();
$filter->wechat->oauthcallback->get['code'] = 'reg::/^[a-zA-Z0-9_\-]+$/';

$filter->api = new stdclass();
$filter->api->default = new stdclass();
$filter->api->default->get['lang'] = 'reg::lang';

$filter->my->search = new stdclass();
$filter->my->search->get['words'] = 'reg::any';
$filter->my->search->get['module'] = 'code';

$filter->user->importldap = new stdclass();
$filter->user->importldap->cookie['pagerUserImportldap'] = 'int';

$filter->effort = new stdclass();
$filter->effort->export = new stdclass();
$filter->effort->export->cookie['checkedItem'] = 'reg::checked';

$filter->order = new stdclass();
$filter->order->export = new stdclass();
$filter->order->export->cookie['checkedItem'] = 'reg::checked';
