From d42cf9b277729feac0ad6e83d8d503c8f7c10f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Tue, 31 Oct 2017 07:31:28 +0800 Subject: [PATCH] * add score init --- db/update9.5.1.sql | 1 + module/custom/lang/zh-cn.php | 1 + module/custom/view/score.html.php | 42 +++++------ module/score/config.php | 74 +++++++++--------- module/score/control.php | 23 ++++++ module/score/lang/zh-cn.php | 19 ++++- module/score/model.php | 121 +++++++++++++++++++++++------- module/score/view/init.html.php | 64 ++++++++++++++++ www/js/my.full.js | 6 +- 9 files changed, 259 insertions(+), 92 deletions(-) create mode 100644 module/score/view/init.html.php diff --git a/db/update9.5.1.sql b/db/update9.5.1.sql index 7223eb3bf6..1fbe58313e 100644 --- a/db/update9.5.1.sql +++ b/db/update9.5.1.sql @@ -88,6 +88,7 @@ CREATE TABLE `zt_score` ( `score` decimal(12,1) NOT NULL DEFAULT '0.0', `after` decimal(12,1) NOT NULL DEFAULT '0.0', `time` datetime NOT NULL, + `objectID` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `account` (`account`), KEY `model` (`model`), diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 4c9205a2c6..e7470b42cf 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -17,6 +17,7 @@ $lang->custom->setPublic = '设为公共'; $lang->custom->required = '必填项'; $lang->custom->score = '积分'; $lang->custom->scoreReset = '重置积分'; +$lang->custom->scoreInit = '初始化积分'; $lang->custom->object['story'] = '需求'; $lang->custom->object['task'] = '任务'; diff --git a/module/custom/view/score.html.php b/module/custom/view/score.html.php index 9b3127bd93..1cb97f36e6 100644 --- a/module/custom/view/score.html.php +++ b/module/custom/view/score.html.php @@ -10,25 +10,25 @@ */ ?> -
-
- - - - - - - - - -
custom->score; ?>custom->scoreList, isset($config->global->score) ? $config->global->score : 0, '', 'block'); ?>
" . $lang->custom->scoreReset, '', "class='btn'");?>
-
-
- +
+
+ + + + + + + + + +
custom->score; ?>custom->scoreList, isset($config->global->score) ? $config->global->score : 0, '', 'block'); ?>
global->scoreInit) ? common::printLink('score', 'refresh', '', " " . $lang->custom->scoreReset, '', ' id="scoreRefresh" class="btn iframe" data-width="480"', true, true) : common::printLink('score', 'init', '', " " . $lang->custom->scoreInit, '', ' id="scoreInit" class="btn iframe" data-width="480"', true, true); ?>
+
+
+ \ No newline at end of file diff --git a/module/score/config.php b/module/score/config.php index c83cf8a182..692a3e6697 100644 --- a/module/score/config.php +++ b/module/score/config.php @@ -1,55 +1,55 @@ score = new stdClass(); -$config->score->model['user']['login'] = array('num' => 3, 'time' => 24, 'score' => 1, 'other' => ''); -$config->score->model['user']['changePassword'] = array('num' => 1, 'time' => 0, 'score' => 10, 'other' => array(1 => 2, 2 => 5)); -$config->score->model['user']['editProfile'] = array('num' => 1, 'time' => 0, 'score' => 10, 'other' => ''); +$config->score->model['user']['login'] = array('num' => 3, 'time' => 24, 'score' => 1, 'ext' => ''); +$config->score->model['user']['changePassword'] = array('num' => 1, 'time' => 0, 'score' => 10, 'ext' => array(1 => 2, 2 => 5)); +$config->score->model['user']['editProfile'] = array('num' => 1, 'time' => 0, 'score' => 10, 'ext' => ''); -$config->score->model['tutorial']['keepAll'] = array('num' => 1, 'time' => 0, 'score' => 100, 'other' => ''); +$config->score->model['tutorial']['keepAll'] = array('num' => 1, 'time' => 0, 'score' => 100, 'ext' => ''); -$config->score->model['ajax']['selectTheme'] = array('num' => 1, 'time' => 0, 'score' => 10, 'other' => ''); -$config->score->model['ajax']['selectLang'] = array('num' => 1, 'time' => 0, 'score' => 10, 'other' => ''); -$config->score->model['ajax']['showSearchMenu'] = array('num' => 1, 'time' => 0, 'score' => 10, 'other' => ''); -$config->score->model['ajax']['dragSelected'] = array('num' => 1, 'time' => 0, 'score' => 20, 'other' => ''); -$config->score->model['ajax']['lastNext'] = array('num' => 1, 'time' => 0, 'score' => 20, 'other' => ''); -$config->score->model['ajax']['switchToDataTable'] = array('num' => 1, 'time' => 0, 'score' => 1, 'other' => ''); -$config->score->model['ajax']['submitPage'] = array('num' => 1, 'time' => 0, 'score' => 1, 'other' => ''); -$config->score->model['ajax']['customMenu'] = array('num' => 1, 'time' => 0, 'score' => 1, 'other' => ''); -$config->score->model['ajax']['quickDump'] = array('num' => 1, 'time' => 0, 'score' => 10, 'other' => ''); -$config->score->model['ajax']['batchCreate'] = array('num' => 1, 'time' => 0, 'score' => 20, 'other' => ''); -$config->score->model['ajax']['batchEdit'] = array('num' => 1, 'time' => 0, 'score' => 20, 'other' => ''); +$config->score->model['ajax']['selectTheme'] = array('num' => 1, 'time' => 0, 'score' => 10, 'ext' => ''); +$config->score->model['ajax']['selectLang'] = array('num' => 1, 'time' => 0, 'score' => 10, 'ext' => ''); +$config->score->model['ajax']['showSearchMenu'] = array('num' => 1, 'time' => 0, 'score' => 10, 'ext' => ''); +$config->score->model['ajax']['dragSelected'] = array('num' => 1, 'time' => 0, 'score' => 20, 'ext' => ''); +$config->score->model['ajax']['lastNext'] = array('num' => 1, 'time' => 0, 'score' => 20, 'ext' => ''); +$config->score->model['ajax']['switchToDataTable'] = array('num' => 1, 'time' => 0, 'score' => 1, 'ext' => ''); +$config->score->model['ajax']['submitPage'] = array('num' => 1, 'time' => 0, 'score' => 1, 'ext' => ''); +$config->score->model['ajax']['customMenu'] = array('num' => 1, 'time' => 0, 'score' => 1, 'ext' => ''); +$config->score->model['ajax']['quickDump'] = array('num' => 1, 'time' => 0, 'score' => 10, 'ext' => ''); +$config->score->model['ajax']['batchCreate'] = array('num' => 1, 'time' => 0, 'score' => 20, 'ext' => ''); +$config->score->model['ajax']['batchEdit'] = array('num' => 1, 'time' => 0, 'score' => 20, 'ext' => ''); -$config->score->model['doc']['create'] = array('num' => 0, 'time' => 0, 'score' => 1, 'other' => ''); +$config->score->model['doc']['create'] = array('num' => 0, 'time' => 0, 'score' => 1, 'ext' => ''); -$config->score->model['todo']['create'] = array('num' => 5, 'time' => 24, 'score' => 1, 'other' => ''); +$config->score->model['todo']['create'] = array('num' => 5, 'time' => 24, 'score' => 1, 'ext' => ''); -$config->score->model['story']['create'] = array('num' => 0, 'time' => 0, 'score' => 1, 'other' => ''); -$config->score->model['story']['close'] = array('num' => 0, 'time' => 0, 'score' => 1, 'other' => array('createID' => 2));//每个需求被完成关闭,需求的创建者额外增加2分,关闭者增加1分 +$config->score->model['story']['create'] = array('num' => 0, 'time' => 0, 'score' => 1, 'ext' => ''); +$config->score->model['story']['close'] = array('num' => 0, 'time' => 0, 'score' => 1, 'ext' => array('createID' => 2));//每个需求被完成关闭,需求的创建者额外增加2分,关闭者增加1分 -$config->score->model['task']['create'] = array('num' => 0, 'time' => 0, 'score' => 1, 'other' => ''); -$config->score->model['task']['close'] = array('num' => 0, 'time' => 0, 'score' => 1, 'other' => ''); -$config->score->model['task']['finish'] = array('num' => 0, 'time' => 0, 'score' => 1, 'other' => array(1 => 2, 2 => 1, 3 => 0)); +$config->score->model['task']['create'] = array('num' => 0, 'time' => 0, 'score' => 1, 'ext' => ''); +$config->score->model['task']['close'] = array('num' => 0, 'time' => 0, 'score' => 1, 'ext' => ''); +$config->score->model['task']['finish'] = array('num' => 0, 'time' => 0, 'score' => 1, 'ext' => array(1 => 2, 2 => 1, 3 => 0)); -$config->score->model['bug']['create'] = array('num' => 0, 'time' => 0, 'score' => 1, 'other' => ''); -$config->score->model['bug']['confirmBug'] = array('num' => 0, 'time' => 0, 'score' => 1, 'other' => array(1 => 3, 2 => 2, 3 => 1)); -$config->score->model['bug']['createFormCase'] = array('num' => 0, 'time' => 0, 'score' => 1, 'other' => ''); -$config->score->model['bug']['resolve'] = array('num' => 0, 'time' => 0, 'score' => 1, 'other' => array(1 => 3, 2 => 2, 3 => 1)); -$config->score->model['bug']['saveTplModal'] = array('num' => 0, 'time' => 0, 'score' => 20, 'other' => ''); +$config->score->model['bug']['create'] = array('num' => 0, 'time' => 0, 'score' => 1, 'ext' => ''); +$config->score->model['bug']['confirmBug'] = array('num' => 0, 'time' => 0, 'score' => 1, 'ext' => array(1 => 3, 2 => 2, 3 => 1)); +$config->score->model['bug']['createFormCase'] = array('num' => 0, 'time' => 0, 'score' => 1, 'ext' => ''); +$config->score->model['bug']['resolve'] = array('num' => 0, 'time' => 0, 'score' => 1, 'ext' => array(1 => 3, 2 => 2, 3 => 1)); +$config->score->model['bug']['saveTplModal'] = array('num' => 0, 'time' => 0, 'score' => 20, 'ext' => ''); -$config->score->model['testTask']['runCase'] = array('num' => 0, 'time' => 0, 'score' => 1, 'other' => ''); +$config->score->model['testTask']['runCase'] = array('num' => 0, 'time' => 0, 'score' => 1, 'ext' => ''); -$config->score->model['testcase']['create'] = array('num' => 0, 'time' => 0, 'score' => 1, 'other' => ''); +$config->score->model['testcase']['create'] = array('num' => 0, 'time' => 0, 'score' => 1, 'ext' => ''); -$config->score->model['build']['create'] = array('num' => 0, 'time' => 0, 'score' => 10, 'other' => ''); +$config->score->model['build']['create'] = array('num' => 0, 'time' => 0, 'score' => 10, 'ext' => ''); -$config->score->model['project']['create'] = array('num' => 0, 'time' => 0, 'score' => 10, 'other' => ''); -$config->score->model['project']['close'] = array('num' => 0, 'time' => 0, 'score' => 0, 'other' => array('manager' => array(20, 10), 'member' => array(5, 5))); +$config->score->model['project']['create'] = array('num' => 0, 'time' => 0, 'score' => 10, 'ext' => ''); +$config->score->model['project']['close'] = array('num' => 0, 'time' => 0, 'score' => 0, 'ext' => array('manager' => array(20, 10), 'member' => array(5, 5))); -$config->score->model['productplan']['create'] = array('num' => 0, 'time' => 0, 'score' => 10, 'other' => ''); +$config->score->model['productplan']['create'] = array('num' => 0, 'time' => 0, 'score' => 10, 'ext' => ''); -$config->score->model['release']['create'] = array('num' => 0, 'time' => 0, 'score' => 10, 'other' => ''); +$config->score->model['release']['create'] = array('num' => 0, 'time' => 0, 'score' => 10, 'ext' => ''); -$config->score->model['block']['set'] = array('num' => 1, 'time' => 0, 'score' => 20, 'other' => ''); +$config->score->model['block']['set'] = array('num' => 1, 'time' => 0, 'score' => 20, 'ext' => ''); -$config->score->model['search']['saveQuery'] = array('num' => 1, 'time' => 0, 'score' => 1, 'other' => ''); -$config->score->model['search']['saveQueryAdvanced'] = array('num' => 1, 'time' => 0, 'score' => 1, 'other' => ''); +$config->score->model['search']['saveQuery'] = array('num' => 1, 'time' => 0, 'score' => 1, 'ext' => ''); +$config->score->model['search']['saveQueryAdvanced'] = array('num' => 1, 'time' => 0, 'score' => 1, 'ext' => ''); diff --git a/module/score/control.php b/module/score/control.php index 797f197249..f271b7c464 100644 --- a/module/score/control.php +++ b/module/score/control.php @@ -59,4 +59,27 @@ class score extends control { $this->loadModel('score')->score('ajax', $method); } + + public function init($lastID = 0) + { + if(helper::isAjaxRequest()) + { + $result = $this->score->init($lastID); + if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); + if($result['status'] == 'finish') + { + $this->send(array('result' => 'finished', 'message' => $this->lang->score->initFinish)); + } + else + { + $this->send(array('result' => 'unfinished', 'message' => $this->lang->score->processed, 'lastID' => $result['lastID'])); + } + } + $this->display(); + } + + public function refresh() + { + $this->display(); + } } \ No newline at end of file diff --git a/module/score/lang/zh-cn.php b/module/score/lang/zh-cn.php index c2a0efbbcd..76dbc60e99 100644 --- a/module/score/lang/zh-cn.php +++ b/module/score/lang/zh-cn.php @@ -1,8 +1,19 @@ score->common = '积分'; -$lang->score->record = '积分记录'; -$lang->score->current = '当前积分'; -$lang->score->level = '等级积分'; +$lang->score->common = '积分'; +$lang->score->record = '积分记录'; +$lang->score->current = '当前积分'; +$lang->score->level = '等级积分'; +$lang->score->init = '初始化'; +$lang->score->initTips = '初始化将根据历史记录计算,执行时间可能会比较长.
请勿在未完成前关闭窗口'; +$lang->score->initStart = '开始初始化'; +$lang->score->initLoading = '正在初始化...'; +$lang->score->initFinish = '初始化完成'; +$lang->score->refresh = '重置积分'; +$lang->score->refreshTips = '重置积分将对所有用户积分清零,执行时间可能会比较长.
请勿在未完成前关闭窗口'; +$lang->score->refreshStart = '开始重置所有积分'; +$lang->score->refreshLoading = '积分重置中...'; +$lang->score->refreshFinish = '重置完成'; +$lang->score->processed = '正在处理中...'; $lang->score->id = '编号'; $lang->score->userID = '用户ID'; diff --git a/module/score/model.php b/module/score/model.php index def18a562c..2b9b4561c1 100644 --- a/module/score/model.php +++ b/module/score/model.php @@ -9,6 +9,8 @@ */ class scoreModel extends model { + public static $num = 0; + /** * get user score logs * @@ -29,23 +31,27 @@ class scoreModel extends model * @param string $model * @param string $method * @param string $param + * @param string $account + * @param string $time * * @access public * @return bool */ - public function score($model = '', $method = '', $param = '') + public function score($model = '', $method = '', $param = '', $account = '', $time = '') { - if(empty($this->config->score->model[$model][$method])) return true; - $rule = $this->config->score->model[$model][$method]; - $desc = $this->lang->score->models[$model]; - $user = $this->app->user->account; + if(!isset($this->config->score->model[$model][$method]) || empty($this->config->score->model[$model][$method])) return true; + $rule = $this->config->score->model[$model][$method]; + $desc = $this->lang->score->models[$model]; + $user = empty($account) ? $this->app->user->account : $account; + $time = empty($time) ? helper::now() : $time; + $objectID = is_numeric($param) ? $param : 0; switch($model) { case 'user': if($method == 'login') $desc = $this->lang->score->methods[$model][$method] . 'IP:' . helper::getRemoteIp(); if($method == 'changePassword') { - if(!empty($rule['other'][$param])) $rule['score'] = $rule['score'] + $rule['other'][$param]; + if(!empty($rule['ext'][$param])) $rule['score'] = $rule['score'] + $rule['ext'][$param]; $desc = $this->lang->score->methods[$model][$method]; } break; @@ -63,8 +69,8 @@ class scoreModel extends model if(!empty($createUser)) { $newRule = $rule; - $newRule['score'] = $rule['other']['createID']; - $this->saveScore($createUser->openedBy, $newRule, $model, $method, $desc); + $newRule['score'] = $rule['ext']['createID']; + $this->saveScore($createUser->openedBy, $newRule, $model, $method, $desc, $objectID, $time); unset($newRule); } } @@ -76,7 +82,7 @@ class scoreModel extends model $desc = $this->lang->score->methods[$model][$method] . 'ID:' . $param; //每完成一个任务,增加初始积分1 + 工时积分round(工时 /10 * 预计 / 消耗) + 优先级积分(p1 2, p2, 1) 如果任务取消了,没有积分。 $task = $this->loadModel('task')->getById($param); - if(!empty($rule['other'][$task->pri])) $rule['score'] = $rule['score'] + $rule['other'][$task->pri]; + if(!empty($rule['ext'][$task->pri])) $rule['score'] = $rule['score'] + $rule['ext'][$task->pri]; if(!empty($task->estimate)) $rule['score'] = $rule['score'] + round(($task->consumed / 10 * $task->estimate / $task->consumed), 1); } break; @@ -94,10 +100,16 @@ class scoreModel extends model if($method == 'saveTplModal') $desc = $this->lang->score->methods[$model][$method] . 'ID:' . $param; if($method == 'confirmBug') { - $user = $param->openedBy; - if(!empty($rule['other'][$param->severity])) $rule['score'] = $rule['score'] + $rule['other'][$param->severity]; + $objectID = $param->id; + $user = $param->openedBy; + $desc .= 'ID:' . $param->id; + if(!empty($rule['ext'][$param->severity])) $rule['score'] = $rule['score'] + $rule['ext'][$param->severity]; + } + if($method == 'resolve' && !empty($rule['ext'][$param->severity])) + { + $objectID = $param->id; + $rule['score'] = $rule['score'] + $rule['ext'][$param->severity]; } - if($method == 'resolve' && !empty($rule['other'][$param->severity])) $rule['score'] = $rule['score'] + $rule['other'][$param->severity]; break; case 'testTask': if($method == 'runCase') $desc = $this->lang->score->methods[$model][$method] . 'ID:' . $param; @@ -109,20 +121,21 @@ class scoreModel extends model if($method == 'create') $desc .= 'ID:' . $param; if($method == 'close') { - $desc = $this->lang->score->methods[$model][$method] . ',' . $desc . 'ID:' . $param->id; + $desc = $this->lang->score->methods[$model][$method] . ',' . $desc . 'ID:' . $param->id; + $objectID = $param->id; if(!empty($param->PM)) { - $rule['score'] = $param->end > date('Y-m-d') ? $rule['other']['manager'][0] + $rule['other']['manager'][1] : $rule['other']['manager'][0]; - $this->saveScore($param->PM, $rule, $model, $method, $desc); + $rule['score'] = $param->end > date('Y-m-d') ? $rule['ext']['manager'][0] + $rule['ext']['manager'][1] : $rule['ext']['manager'][0]; + $this->saveScore($param->PM, $rule, $model, $method, $desc, $objectID, $time); } $teams = $this->dao->select('account')->from(TABLE_TEAM)->where('project')->eq($param->id)->fetchGroup('account'); if(!empty($teams)) { $users = array_keys($teams); - $rule['score'] = $param->end > date('Y-m-d') ? $rule['other']['member'][0] + $rule['other']['member'][1] : $rule['other']['member'][0]; + $rule['score'] = $param->end > date('Y-m-d') ? $rule['ext']['member'][0] + $rule['ext']['member'][1] : $rule['ext']['member'][0]; foreach($users as $user) { - if($user != $param->PM) $this->saveScore($user, $rule, $model, $method, $desc); + if($user != $param->PM) $this->saveScore($user, $rule, $model, $method, $desc, $objectID, $time); } } } @@ -145,7 +158,7 @@ class scoreModel extends model $desc = $this->lang->score->methods[$model][$method]; break; } - $this->saveScore($user, $rule, $model, $method, $desc); + $this->saveScore($user, $rule, $model, $method, $desc, $objectID, $time); } /** @@ -156,11 +169,13 @@ class scoreModel extends model * @param string $model * @param string $method * @param string $desc + * @param int $objectID + * @param string $time * * @access private * @return bool */ - private function saveScore($account = '', $rule = array(), $model = '', $method = '', $desc = '') + private function saveScore($account = '', $rule = array(), $model = '', $method = '', $desc = '', $objectID = 0, $time = '') { if(!empty($rule['num']) || !empty($rule['time'])) { @@ -171,7 +186,8 @@ class scoreModel extends model } else { - $count = $this->dao->select('id')->from(TABLE_SCORE)->where('account')->eq($account)->andWhere('time')->between(date('Y-m-d 0:0:0'), date('Y-m-d 23:59:59'))->andWhere('model')->eq($model)->andWhere('method')->eq($method)->count(); + $timestamp = empty($time) ? time() : strtotime($time); + $count = $this->dao->select('id')->from(TABLE_SCORE)->where('account')->eq($account)->andWhere('time')->between(date('Y-m-d 0:0:0', $timestamp), date('Y-m-d 23:59:59', $timestamp))->andWhere('model')->eq($model)->andWhere('method')->eq($method)->count(); if($count >= $rule['num']) return true; } } @@ -181,15 +197,16 @@ class scoreModel extends model { $user = $this->loadModel('user')->getById($account); - $data = new stdClass(); - $data->account = $account; - $data->model = $model; - $data->method = $method; - $data->desc = $desc; - $data->before = $user->score; - $data->score = $rule['score']; - $data->after = $user->score + $rule['score']; - $data->time = helper::now(); + $data = new stdClass(); + $data->account = $account; + $data->model = $model; + $data->method = $method; + $data->desc = $desc; + $data->objectID = $objectID; + $data->before = $user->score; + $data->score = $rule['score']; + $data->after = $user->score + $rule['score']; + $data->time = empty($time) ? helper::now() : $time; $this->dao->insert(TABLE_SCORE)->data($data)->exec(); $this->dao->query("UPDATE " . TABLE_USER . " SET `score`=`score` + " . $rule['score'] . ",`score_level`=`score_level` + " . $rule['score'] . " WHERE `account`='" . $account . "'"); $this->dao->commit(); @@ -202,6 +219,7 @@ class scoreModel extends model /** * reset all user score and level score + * * @access public * @return void */ @@ -209,4 +227,49 @@ class scoreModel extends model { } + + /** + * Score init from action + * + * @param int $lastID + * + * @access public + * @return array + */ + public function init($lastID = 0) + { + if($lastID == 0) + { + $this->dao->query("UPDATE " . TABLE_USER . " SET `score`=0,`score_level`=0"); + $this->dao->query("TRUNCATE TABLE " . TABLE_SCORE); + } + $actions = $this->dao->select('*')->from(TABLE_ACTION)->where('id')->gt($lastID)->orderBy('id_asc')->limit(100)->fetchAll('id'); + if(empty($actions)) + { + $this->loadModel('setting')->setItem('system.common.global.scoreInit', 1); + return array('num' => 0, 'status' => 'finish'); + } + foreach($actions as $action) + { + $param = $action->objectID; + if($action->objectType == 'project' && $action->action == 'closed') $param = $this->dao->findById($action->objectID)->from(TABLE_PROJECT)->fetch(); + if($action->objectType == 'bug' && ($action->action == 'bugconfirmed' || $action->action == 'resolved')) $param = $this->dao->findById($action->objectID)->from(TABLE_BUG)->fetch(); + $this->score($action->objectType, $this->fix_key($action->action), $param, $action->actor, $action->date); + } + return array('status' => 'more', 'lastID' => max(array_keys($actions))); + } + + /** + * fix action type for score + * + * @param $string + * + * @access private + * @return mixed + */ + private function fix_key($string) + { + $strings = array('created' => 'create', 'closed' => 'close', 'finished' => 'finish', 'bugconfirmed' => 'confirmBug', 'resolved' => 'resolve'); + return isset($strings[$string]) ? $strings[$string] : $string; + } } \ No newline at end of file diff --git a/module/score/view/init.html.php b/module/score/view/init.html.php new file mode 100644 index 0000000000..f79f8e0e51 --- /dev/null +++ b/module/score/view/init.html.php @@ -0,0 +1,64 @@ + + * @package score + * @version $Id$ + * @link http://www.zentao.net + */ +?> + +
+ +
+

score->init; ?>

+
+

score->initTips; ?>

+

+ +

+
+
+ + + + \ No newline at end of file diff --git a/www/js/my.full.js b/www/js/my.full.js index a37638381c..3712882c44 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -705,6 +705,11 @@ function checkTable($table) var isChecked = $checkbox.prop('checked'); if(!$this.is(':checkbox')) { + if(!$.cookie('ajax_dragSelected') && $checkbox.size() > 2) + { + $.cookie('ajax_dragSelected', 'on', {expires: config.cookieLife, path: config.webRoot}); + $.get(createLink('score', 'ajax', "method=dragSelected")); + } isChecked = checked === true || checked === false ? checked : !isChecked; $checkbox.prop('checked', isChecked); } @@ -714,7 +719,6 @@ function checkTable($table) $tr.closest('.table').find('.rows-selector').prop('checked', false); } }; - var isSelectableTable = $table.hasClass('table-selectable'); $table.selectable(