<?php
if(!isset($config->score)) $config->score = new stdclass();
$config->score->require = new stdclass();
$config->score->require->createrule = 'type, name, score';
$config->score->require->editrule   = 'type, name, score';
$config->score->require->gift       = 'score, giftTo, desc';
$config->score->require->apply      = 'rule, actionDate, reviewer, desc';
$config->score->require->edit       = 'rule, actionDate, reviewer, desc';

$config->score->types = array('common', 'bonus', 'share');

$config->score->systemRuleIDList = array();
$config->score->systemRuleIDList['service']    = 1;
$config->score->systemRuleIDList['attendance'] = 2;
$config->score->systemRuleIDList['bonus']      = 3;
$config->score->systemRuleIDList['share']      = 4;

$config->score->levelList = json_encode(array(0, 1000, 2000, 3000, 4000)); // Default level list.
$config->score->sectList  = null;

/* Score rule. */
$config->score->systemRule = new stdclass();
// $config->score->systemRule->user = new stdclass();
// $config->score->systemRule->user->login          = array('times' => 0, 'hour' => 24, 'score' => 1);
// $config->score->systemRule->user->editProfile    = array('times' => 1, 'hour' => 0,  'score' => 10);
// $config->score->systemRule->user->changePassword = array('times' => 1, 'hour' => 0,  'score' => 10);

global $lang;
$config->score->search['module']    = 'score';
$config->score->search['actionURL'] = inlink('allGrant', 'type=bysearch');

$config->score->search['fields']['type']     = $lang->score->type;
$config->score->search['fields']['time']     = $lang->score->time;
$config->score->search['fields']['giver']    = $lang->score->giver;
$config->score->search['fields']['receiver'] = $lang->score->receiver;
$config->score->search['fields']['dept']     = $lang->score->dept;
$config->score->search['fields']['rule']     = $lang->score->behavior;
$config->score->search['fields']['id']       = $lang->score->id;

$config->score->search['params']['type']     = array('operator' => '=',  'control' => 'select', 'values' => array('') + $lang->score->grantTypeList);
$config->score->search['params']['time']     = array('operator' => '>=', 'control' => 'input',  'values' => '', 'class' => 'datetime');
$config->score->search['params']['giver']    = array('operator' => '=',  'control' => 'select', 'values' => 'set in control');
$config->score->search['params']['receiver'] = array('operator' => '=',  'control' => 'select', 'values' => 'set in control');
$config->score->search['params']['dept']     = array('operator' => '=',  'control' => 'select', 'values' => 'depts');
$config->score->search['params']['rule']     = array('operator' => '=',  'control' => 'select', 'values' => 'set in control');
$config->score->search['params']['id']       = array('operator' => '=',  'control' => 'input',  'values' => '');
