* + my score log
This commit is contained in:
@@ -106,6 +106,7 @@ define('TABLE_ENTRY', '`' . $config->db->prefix . 'entry`');
|
||||
define('TABLE_WEBHOOK', '`' . $config->db->prefix . 'webhook`');
|
||||
define('TABLE_WEBHOOKDATAS', '`' . $config->db->prefix . 'webhookdatas`');
|
||||
define('TABLE_LOG', '`' . $config->db->prefix . 'log`');
|
||||
define('TABLE_SCORE', '`' . $config->db->prefix . 'score`');
|
||||
if(!defined('TABLE_LANG')) define('TABLE_LANG', '`' . $config->db->prefix . 'lang`');
|
||||
|
||||
$config->objectTables['product'] = TABLE_PRODUCT;
|
||||
|
||||
@@ -175,10 +175,14 @@ $lang->my->menu->dynamic = 'Dynamic|my|dynamic|';
|
||||
$lang->my->menu->profile = array('link' => 'Profile|my|profile', 'alias' => 'editprofile');
|
||||
$lang->my->menu->changePassword = 'Password|my|changepassword';
|
||||
$lang->my->menu->manageContacts = 'Contact|my|managecontacts';
|
||||
$lang->my->menu->score = array('link' => 'Score|score|browse', 'subModule' => 'score');
|
||||
|
||||
$lang->todo = new stdclass();
|
||||
$lang->todo->menu = $lang->my->menu;
|
||||
|
||||
$lang->score = new stdclass();
|
||||
$lang->score->menu = $lang->my->menu;
|
||||
|
||||
/* 产品视图设置。*/
|
||||
$lang->product = new stdclass();
|
||||
$lang->product->menu = new stdclass();
|
||||
@@ -342,7 +346,6 @@ $lang->admin->menu->cron = array('link' => 'Cron|cron|index', 'subModule' =
|
||||
$lang->admin->menu->trashes = array('link' => 'Recycle|action|trash', 'subModule' => 'action');
|
||||
$lang->admin->menu->dev = array('link' => 'Develop|dev|api', 'alias' => 'db', 'subModule' => 'dev,editor');
|
||||
$lang->admin->menu->entry = array('link' => 'API|entry|browse', 'alias' => 'create,edit', 'subModule' => 'entry,webhook');
|
||||
$lang->admin->menu->score = array('link' => 'Score|score|browse', 'subModule' => 'score');
|
||||
$lang->admin->menu->sso = 'RangerTeam|admin|sso';
|
||||
|
||||
$lang->convert = new stdclass();
|
||||
@@ -355,7 +358,6 @@ $lang->editor = new stdclass();
|
||||
$lang->mail = new stdclass();
|
||||
$lang->cron = new stdclass();
|
||||
$lang->dev = new stdclass();
|
||||
$lang->score = new stdclass();
|
||||
$lang->entry = new stdclass();
|
||||
$lang->webhook = new stdclass();
|
||||
$lang->search = new stdclass();
|
||||
@@ -370,7 +372,6 @@ $lang->custom->menu = $lang->admin->menu;
|
||||
$lang->editor->menu = $lang->admin->menu;
|
||||
$lang->mail->menu = $lang->admin->menu;
|
||||
$lang->dev->menu = $lang->admin->menu;
|
||||
$lang->score->menu = $lang->admin->menu;
|
||||
$lang->webhook->menu = $lang->admin->menu;
|
||||
|
||||
/* 菜单分组。*/
|
||||
@@ -394,6 +395,7 @@ $lang->menugroup->testreport = 'qa';
|
||||
$lang->menugroup->people = 'company';
|
||||
$lang->menugroup->dept = 'company';
|
||||
$lang->menugroup->todo = 'my';
|
||||
$lang->menugroup->score = 'my';
|
||||
$lang->menugroup->action = 'admin';
|
||||
$lang->menugroup->backup = 'admin';
|
||||
$lang->menugroup->cron = 'admin';
|
||||
@@ -402,7 +404,6 @@ $lang->menugroup->custom = 'admin';
|
||||
$lang->menugroup->editor = 'admin';
|
||||
$lang->menugroup->mail = 'admin';
|
||||
$lang->menugroup->dev = 'admin';
|
||||
$lang->menugroup->score = 'admin';
|
||||
$lang->menugroup->entry = 'admin';
|
||||
$lang->menugroup->webhook = 'admin';
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ $lang->my->menuOrder[40] = 'myProject';
|
||||
$lang->my->menuOrder[45] = 'dynamic';
|
||||
$lang->my->menuOrder[50] = 'profile';
|
||||
$lang->my->menuOrder[55] = 'changePassword';
|
||||
$lang->my->menuOrder[60] = 'score';
|
||||
$lang->todo->menuOrder = $lang->my->menuOrder;
|
||||
|
||||
/* product menu order. */
|
||||
|
||||
@@ -167,18 +167,22 @@ $lang->my->menu->account = array('link' => '<span id="myname"><i class="i
|
||||
$lang->my->menu->index = '首页|my|index';
|
||||
$lang->my->menu->todo = array('link' => '待办|my|todo|', 'subModule' => 'todo');
|
||||
$lang->my->menu->task = array('link' => '任务|my|task|', 'subModule' => 'task');
|
||||
$lang->my->menu->bug = array('link' => 'Bug|my|bug|', 'subModule' => 'bug');
|
||||
$lang->my->menu->bug = array('link' => 'Bug|my|bug|', 'subModule' => 'bug');
|
||||
$lang->my->menu->testtask = array('link' => '测试|my|testtask|', 'subModule' => 'testcase,testtask', 'alias' => 'testcase');
|
||||
$lang->my->menu->story = array('link' => '需求|my|story|', 'subModule' => 'story');
|
||||
$lang->my->menu->story = array('link' => '需求|my|story|', 'subModule' => 'story');
|
||||
$lang->my->menu->myProject = "{$lang->projectCommon}|my|project|";
|
||||
$lang->my->menu->dynamic = '动态|my|dynamic|';
|
||||
$lang->my->menu->profile = array('link' => '档案|my|profile', 'alias' => 'editprofile');
|
||||
$lang->my->menu->changePassword = '密码|my|changepassword';
|
||||
$lang->my->menu->manageContacts = '联系人|my|managecontacts';
|
||||
$lang->my->menu->score = array('link' => '积分|score|browse', 'subModule' => 'score');
|
||||
|
||||
$lang->todo = new stdclass();
|
||||
$lang->todo = new stdclass();
|
||||
$lang->todo->menu = $lang->my->menu;
|
||||
|
||||
$lang->score = new stdclass();
|
||||
$lang->score->menu = $lang->my->menu;
|
||||
|
||||
/* 产品视图设置。*/
|
||||
$lang->product = new stdclass();
|
||||
$lang->product->menu = new stdclass();
|
||||
@@ -342,7 +346,6 @@ $lang->admin->menu->cron = array('link' => '计划任务|cron|index', 'subM
|
||||
$lang->admin->menu->trashes = array('link' => '回收站|action|trash', 'subModule' => 'action');
|
||||
$lang->admin->menu->dev = array('link' => '二次开发|dev|api', 'alias' => 'db', 'subModule' => 'dev,editor');
|
||||
$lang->admin->menu->entry = array('link' => '接口|entry|browse', 'alias' => 'create,edit', 'subModule' => 'entry,webhook');
|
||||
$lang->admin->menu->score = array('link' => '积分|score|browse', 'subModule' => 'score');
|
||||
$lang->admin->menu->sso = '然之集成|admin|sso';
|
||||
|
||||
$lang->convert = new stdclass();
|
||||
@@ -358,7 +361,6 @@ $lang->dev = new stdclass();
|
||||
$lang->entry = new stdclass();
|
||||
$lang->webhook = new stdclass();
|
||||
$lang->search = new stdclass();
|
||||
$lang->score = new stdclass();
|
||||
|
||||
$lang->convert->menu = $lang->admin->menu;
|
||||
$lang->upgrade->menu = $lang->admin->menu;
|
||||
@@ -370,7 +372,6 @@ $lang->custom->menu = $lang->admin->menu;
|
||||
$lang->editor->menu = $lang->admin->menu;
|
||||
$lang->mail->menu = $lang->admin->menu;
|
||||
$lang->dev->menu = $lang->admin->menu;
|
||||
$lang->score->menu = $lang->admin->menu;
|
||||
$lang->entry->menu = $lang->admin->menu;
|
||||
$lang->webhook->menu = $lang->admin->menu;
|
||||
|
||||
@@ -395,6 +396,7 @@ $lang->menugroup->testreport = 'qa';
|
||||
$lang->menugroup->people = 'company';
|
||||
$lang->menugroup->dept = 'company';
|
||||
$lang->menugroup->todo = 'my';
|
||||
$lang->menugroup->score = 'my';
|
||||
$lang->menugroup->action = 'admin';
|
||||
$lang->menugroup->backup = 'admin';
|
||||
$lang->menugroup->cron = 'admin';
|
||||
@@ -403,7 +405,6 @@ $lang->menugroup->custom = 'admin';
|
||||
$lang->menugroup->editor = 'admin';
|
||||
$lang->menugroup->mail = 'admin';
|
||||
$lang->menugroup->dev = 'admin';
|
||||
$lang->menugroup->score = 'admin';
|
||||
$lang->menugroup->entry = 'admin';
|
||||
$lang->menugroup->webhook = 'admin';
|
||||
|
||||
|
||||
@@ -175,10 +175,14 @@ $lang->my->menu->dynamic = '動態|my|dynamic|';
|
||||
$lang->my->menu->profile = array('link' => '檔案|my|profile', 'alias' => 'editprofile');
|
||||
$lang->my->menu->changePassword = '密碼|my|changepassword';
|
||||
$lang->my->menu->manageContacts = '聯繫人|my|managecontacts';
|
||||
$lang->my->menu->score = array('link' => '積分|score|browse', 'subModule' => 'score');
|
||||
|
||||
$lang->todo = new stdclass();
|
||||
$lang->todo->menu = $lang->my->menu;
|
||||
|
||||
$lang->score = new stdclass();
|
||||
$lang->scoret->menu = $lang->my->menu;
|
||||
|
||||
/* 產品視圖設置。*/
|
||||
$lang->product = new stdclass();
|
||||
$lang->product->menu = new stdclass();
|
||||
@@ -341,7 +345,6 @@ $lang->admin->menu->safe = array('link' => '安全|admin|safe', 'alias' =>
|
||||
$lang->admin->menu->cron = array('link' => '計劃任務|cron|index', 'subModule' => 'cron');
|
||||
$lang->admin->menu->trashes = array('link' => '資源回收筒|action|trash', 'subModule' => 'action');
|
||||
$lang->admin->menu->dev = array('link' => '二次開發|dev|api', 'alias' => 'db', 'subModule' => 'dev,editor');
|
||||
$lang->admin->menu->score = array('link' => '積分|score|browse', 'subModule' => 'score');
|
||||
$lang->admin->menu->sso = '然之整合|admin|sso';
|
||||
|
||||
$lang->convert = new stdclass();
|
||||
@@ -355,7 +358,6 @@ $lang->mail = new stdclass();
|
||||
$lang->cron = new stdclass();
|
||||
$lang->dev = new stdclass();
|
||||
$lang->search = new stdclass();
|
||||
$lang->score = new stdclass();
|
||||
|
||||
$lang->convert->menu = $lang->admin->menu;
|
||||
$lang->upgrade->menu = $lang->admin->menu;
|
||||
@@ -367,7 +369,6 @@ $lang->custom->menu = $lang->admin->menu;
|
||||
$lang->editor->menu = $lang->admin->menu;
|
||||
$lang->mail->menu = $lang->admin->menu;
|
||||
$lang->dev->menu = $lang->admin->menu;
|
||||
$lang->scoret->menu = $lang->admin->menu;
|
||||
|
||||
/* 菜單分組。*/
|
||||
$lang->menugroup = new stdclass();
|
||||
@@ -390,6 +391,7 @@ $lang->menugroup->testreport = 'qa';
|
||||
$lang->menugroup->people = 'company';
|
||||
$lang->menugroup->dept = 'company';
|
||||
$lang->menugroup->todo = 'my';
|
||||
$lang->menugroup->score = 'my';
|
||||
$lang->menugroup->action = 'admin';
|
||||
$lang->menugroup->backup = 'admin';
|
||||
$lang->menugroup->cron = 'admin';
|
||||
@@ -398,7 +400,6 @@ $lang->menugroup->custom = 'admin';
|
||||
$lang->menugroup->editor = 'admin';
|
||||
$lang->menugroup->mail = 'admin';
|
||||
$lang->menugroup->dev = 'admin';
|
||||
$lang->menugroup->score = 'admin';
|
||||
|
||||
/* 錯誤提示信息。*/
|
||||
$lang->error = new stdclass();
|
||||
|
||||
@@ -164,6 +164,7 @@ class commonModel extends model
|
||||
if($module == 'tutorial') return true;
|
||||
if($module == 'block') return true;
|
||||
if($module == 'product' and $method == 'showerrornone') return true;
|
||||
if($module == 'score' and $method == 'browse') return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1131,7 +1132,6 @@ class commonModel extends model
|
||||
|
||||
/* Check is the super admin or not. */
|
||||
if(!empty($app->user->admin)) return true;
|
||||
|
||||
/* If not super admin, check the rights. */
|
||||
$rights = $app->user->rights['rights'];
|
||||
$acls = $app->user->rights['acls'];
|
||||
|
||||
+18
-17
@@ -1,21 +1,22 @@
|
||||
<?php
|
||||
$lang->custom->common = 'Custom';
|
||||
$lang->custom->index = 'Home';
|
||||
$lang->custom->set = 'Customize';
|
||||
$lang->custom->restore = 'Reset to Default';
|
||||
$lang->custom->key = 'Key';
|
||||
$lang->custom->value = 'Value';
|
||||
$lang->custom->flow = 'Process';
|
||||
$lang->custom->working = 'Working';
|
||||
$lang->custom->select = 'Select Process';
|
||||
$lang->custom->branch = 'Multi Branch';
|
||||
$lang->custom->owner = 'Owner';
|
||||
$lang->custom->module = 'Module';
|
||||
$lang->custom->section = 'Section';
|
||||
$lang->custom->lang = 'Language';
|
||||
$lang->custom->setPublic = 'Set Public';
|
||||
$lang->custom->required = 'Required';
|
||||
$lang->custom->score = 'Score';
|
||||
$lang->custom->common = 'Custom';
|
||||
$lang->custom->index = 'Home';
|
||||
$lang->custom->set = 'Customize';
|
||||
$lang->custom->restore = 'Reset to Default';
|
||||
$lang->custom->key = 'Key';
|
||||
$lang->custom->value = 'Value';
|
||||
$lang->custom->flow = 'Process';
|
||||
$lang->custom->working = 'Working';
|
||||
$lang->custom->select = 'Select Process';
|
||||
$lang->custom->branch = 'Multi Branch';
|
||||
$lang->custom->owner = 'Owner';
|
||||
$lang->custom->module = 'Module';
|
||||
$lang->custom->section = 'Section';
|
||||
$lang->custom->lang = 'Language';
|
||||
$lang->custom->setPublic = 'Set Public';
|
||||
$lang->custom->required = 'Required';
|
||||
$lang->custom->score = 'Score';
|
||||
$lang->custom->scoreReset = 'Reset Score';
|
||||
|
||||
$lang->custom->object['story'] = 'Story';
|
||||
$lang->custom->object['task'] = 'Task';
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
<?php
|
||||
$lang->custom->common = '自定义';
|
||||
$lang->custom->index = '首页';
|
||||
$lang->custom->set = '自定义配置';
|
||||
$lang->custom->restore = '恢复默认';
|
||||
$lang->custom->key = '键';
|
||||
$lang->custom->value = '值';
|
||||
$lang->custom->flow = '流程';
|
||||
$lang->custom->working = '工作方式';
|
||||
$lang->custom->select = '请选择流程:';
|
||||
$lang->custom->branch = '多分支';
|
||||
$lang->custom->owner = '所有者';
|
||||
$lang->custom->module = '模块';
|
||||
$lang->custom->section = '附加部分';
|
||||
$lang->custom->lang = '所属语言';
|
||||
$lang->custom->setPublic = '设为公共';
|
||||
$lang->custom->required = '必填项';
|
||||
$lang->custom->score = '积分';
|
||||
$lang->custom->common = '自定义';
|
||||
$lang->custom->index = '首页';
|
||||
$lang->custom->set = '自定义配置';
|
||||
$lang->custom->restore = '恢复默认';
|
||||
$lang->custom->key = '键';
|
||||
$lang->custom->value = '值';
|
||||
$lang->custom->flow = '流程';
|
||||
$lang->custom->working = '工作方式';
|
||||
$lang->custom->select = '请选择流程:';
|
||||
$lang->custom->branch = '多分支';
|
||||
$lang->custom->owner = '所有者';
|
||||
$lang->custom->module = '模块';
|
||||
$lang->custom->section = '附加部分';
|
||||
$lang->custom->lang = '所属语言';
|
||||
$lang->custom->setPublic = '设为公共';
|
||||
$lang->custom->required = '必填项';
|
||||
$lang->custom->score = '积分';
|
||||
$lang->custom->scoreReset = '重置积分';
|
||||
|
||||
$lang->custom->object['story'] = '需求';
|
||||
$lang->custom->object['task'] = '任务';
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
<?php
|
||||
$lang->custom->common = '自定義';
|
||||
$lang->custom->index = '首頁';
|
||||
$lang->custom->set = '自定義配置';
|
||||
$lang->custom->restore = '恢復預設';
|
||||
$lang->custom->key = '鍵';
|
||||
$lang->custom->value = '值';
|
||||
$lang->custom->flow = '流程';
|
||||
$lang->custom->working = '工作方式';
|
||||
$lang->custom->select = '請選擇流程:';
|
||||
$lang->custom->branch = '多分支';
|
||||
$lang->custom->owner = '所有者';
|
||||
$lang->custom->module = '模組';
|
||||
$lang->custom->section = '附加部分';
|
||||
$lang->custom->lang = '所屬語言';
|
||||
$lang->custom->score = '積分';
|
||||
$lang->custom->common = '自定義';
|
||||
$lang->custom->index = '首頁';
|
||||
$lang->custom->set = '自定義配置';
|
||||
$lang->custom->restore = '恢復預設';
|
||||
$lang->custom->key = '鍵';
|
||||
$lang->custom->value = '值';
|
||||
$lang->custom->flow = '流程';
|
||||
$lang->custom->working = '工作方式';
|
||||
$lang->custom->select = '請選擇流程:';
|
||||
$lang->custom->branch = '多分支';
|
||||
$lang->custom->owner = '所有者';
|
||||
$lang->custom->module = '模組';
|
||||
$lang->custom->section = '附加部分';
|
||||
$lang->custom->lang = '所屬語言';
|
||||
$lang->custom->score = '積分';
|
||||
$lang->custom->scoreReset = '重置積分';
|
||||
|
||||
$lang->custom->object['story'] = '需求';
|
||||
$lang->custom->object['task'] = '任務';
|
||||
|
||||
@@ -282,12 +282,11 @@ class customModel extends model
|
||||
$allMenu = $module == 'main' ? $lang->menu : (isset($lang->$module->menu) ? $lang->$module->menu : $lang->my->menu);
|
||||
if($module == 'product' and isset($allMenu->branch)) $allMenu->branch = str_replace('@branch@', $lang->custom->branch, $allMenu->branch);
|
||||
if($module != 'main' and isset($lang->menugroup->$module)) $module = $lang->menugroup->$module;
|
||||
if($module == 'admin' and empty($config->global->score)) unset($allMenu->score);
|
||||
$flowModule = $config->global->flow . '_' . $module;
|
||||
$customMenu = isset($config->customMenu->$flowModule) ? $config->customMenu->$flowModule : array();
|
||||
if(commonModel::isTutorialMode() && $module === 'main')$customMenu = 'my,product,project,qa,company';
|
||||
if(!empty($customMenu) && is_string($customMenu) && substr($customMenu, 0, 1) === '[') $customMenu = json_decode($customMenu);
|
||||
|
||||
if($module == 'my' && empty($config->global->score)) unset($allMenu->score);
|
||||
$menu = self::setMenuByConfig($allMenu, $customMenu, $module);
|
||||
return $menu;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><?php echo html::submitButton() ?></td>
|
||||
<td><?php echo html::submitButton() ?> <?php echo html::a(inLink('resetScore'), "<i class='icon-refresh'></i> " . $lang->custom->scoreReset, '', "class='btn'");?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
@@ -1 +1,53 @@
|
||||
<?php
|
||||
$config->score = new stdClass();
|
||||
|
||||
$config->score->model['user']['login'] = array('num'=>3, 'time'=>24, 'score'=>1, 'other'=>'');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$config->score->model['tutorial']['keepAll'] = array(1, 0, 100, '');
|
||||
$config->score->model['my']['changePassword'] = array(1, 0, 10, array(1 => 2, 2 => 5));
|
||||
$config->score->model['my']['editProfile'] = array(1, 0, 10, '');
|
||||
|
||||
$config->score->model['block']['admin'] = array(1, 0, 20, '');
|
||||
|
||||
$config->score->model['ajax']['selectTheme'] = array(1, 0, 10, '');
|
||||
$config->score->model['ajax']['selectLang'] = array(1, 0, 10, '');
|
||||
$config->score->model['ajax']['showSearchMenu'] = array(1, 0, 10, '');
|
||||
$config->score->model['ajax']['dragSelected'] = array(1, 0, 20, '');
|
||||
$config->score->model['ajax']['lastNext'] = array(1, 0, 20, '');
|
||||
$config->score->model['ajax']['switchToDataTable'] = array(1, 0, 1, '');
|
||||
$config->score->model['ajax']['submitPage'] = array(1, 0, 1, '');
|
||||
|
||||
$config->score->model['bug']['saveTplModal'] = array(1, 0, 20, '');
|
||||
|
||||
$config->score->model['custom']['ajaxMenu'] = array(1, 0, 1, '');
|
||||
|
||||
$config->score->model['search']['saveQuery'] = array(1, 0, 1, '');
|
||||
$config->score->model['search']['saveQueryAdvanced'] = array(1, 0, 1, '');
|
||||
|
||||
|
||||
$config->score->model['my']['todo'] = array(5, 24, 1, '');
|
||||
|
||||
$config->score->model['story']['create'] = array(0, 0, 1, '');//需求
|
||||
$config->score->model['task']['create'] = array(0, 0, 1, '');//任务
|
||||
$config->score->model['bug']['create'] = array(0, 0, 1, '');//bug 有效之后,额外增加严重程度积分:s1 + 3, s2 + 2, s3 + 1
|
||||
$config->score->model['doc']['create'] = array(0, 0, 5, '');//文档
|
||||
$config->score->model['testcase']['create'] = array(0, 0, 1, '');//用例
|
||||
|
||||
//每完成一个任务,增加初始积分1 + 工时积分round(工时 /10 * 预计 / 消耗) + 优先级积分(p1 2, p2, 1) 如果任务取消了,没有积分。
|
||||
$config->score->model['task']['finish'] = array(0, 0, 1, array('time'=>'#time#/10 * #estimate# / #consumed#','pri'=>array(0=>0,1=>2,2=>1,3=>0)));//关闭一个任务,关闭者增加一个积分。
|
||||
$config->score->model['task']['close'] = array(0, 0, 1, '');//关闭一个任务,关闭者增加一个积分。
|
||||
$config->score->model['bug']['resolve'] = array(0, 0, 1, '');//解决一个bug,额外增加解决bug积分:s1 + 3, s2 + 2, s3 + 1
|
||||
$config->score->model['testcase']['runCase'] = array(0, 0, 1, '');//每执行一次用例,加1分
|
||||
$config->score->model['bug']['createFormCase'] = array(0, 0, 1, '');//从用例创建bug,用例的创建者加1分
|
||||
$config->score->model['project']['build'] = array(0, 0, 10, '');//创建一个build,创建者增加10个积分
|
||||
$config->score->model['project']['create'] = array(0, 0, 10, '');//创建一个项目,创建者增加10个积分
|
||||
$config->score->model['productplan']['create'] = array(0, 0, 10, '');//创建一个计划,创建者增加10个积分
|
||||
$config->score->model['release']['create'] = array(0, 0, 10, '');//创建一个发布,创建者增加10个积分
|
||||
$config->score->model['story']['close'] = array(0, 0, 1, array('createID'=>2));//每个需求被完成关闭,需求的创建者额外增加2分,关闭者增加1分
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of score module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @author Memory <lvtao@cnezsoft.com>
|
||||
* @package score
|
||||
@@ -11,20 +10,56 @@
|
||||
class score extends control
|
||||
{
|
||||
/**
|
||||
* score list
|
||||
* score constructor.
|
||||
*
|
||||
* @param string $module
|
||||
* @param string $method
|
||||
*
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function browse($recTotal = 0, $recPerPage = 100)
|
||||
public function __construct($module = '', $method = '')
|
||||
{
|
||||
parent::__construct($module, $method);
|
||||
$this->loadModel('my')->setMenu();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get score list
|
||||
*
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
*
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function browse($recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
$scores = $this->score->getScores($pager);
|
||||
|
||||
$this->loadModel('score')->score('user','login');
|
||||
|
||||
$this->view->title = $this->lang->score->common;
|
||||
$this->view->user = $this->loadModel('user')->getById($this->app->user->account);
|
||||
$this->view->pager = $pager;
|
||||
$this->view->scores = $scores;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax action score
|
||||
*
|
||||
* @param string $method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajax($method = '')
|
||||
{
|
||||
//处理由ajax提交过来的任务,主要是一次性任务 在请求模型的时候model=ajax,
|
||||
$this->loadModel('score')->score('ajax','login');
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,27 @@
|
||||
<?php
|
||||
$lang->score->common = '积分';
|
||||
$lang->score->record = '积分记录';
|
||||
$lang->score->reset = '重置积分';
|
||||
$lang->score->common = '积分';
|
||||
$lang->score->record = '积分记录';
|
||||
$lang->score->current = '当前积分';
|
||||
$lang->score->level = '等级积分';
|
||||
|
||||
$lang->score->id = '编号';
|
||||
$lang->score->userID = '用户ID';
|
||||
$lang->score->account = '用户';
|
||||
$lang->score->model = '模块';
|
||||
$lang->score->method = '方式';
|
||||
$lang->score->type = '类型';
|
||||
$lang->score->method = '动作';
|
||||
$lang->score->before = '之前';
|
||||
$lang->score->score = '分值';
|
||||
$lang->score->after = '之后';
|
||||
$lang->score->time = '时间';
|
||||
$lang->score->desc = '描述';
|
||||
|
||||
$lang->score->methods['login'] = '登录';
|
||||
$lang->score->methods['admin'] = '';
|
||||
$lang->score->methods['tutorial'] = '新手教程';
|
||||
|
||||
$lang->score->models['task'] = '任务';
|
||||
$lang->score->models['tutorial'] = '新手教程';
|
||||
$lang->score->models['system'] = '系统';
|
||||
$lang->score->models['user'] = '用户';
|
||||
|
||||
$lang->score->methods['task']['create'] = '创建任务';
|
||||
$lang->score->methods['tutorial']['finish'] = '任务完成';
|
||||
$lang->score->methods['system']['bug'] = '长得丑';
|
||||
$lang->score->methods['user']['login'] = '登录';
|
||||
+101
-2
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of score module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @author Memory <lvtao@cnezsoft.com>
|
||||
* @package score
|
||||
@@ -10,9 +9,109 @@
|
||||
*/
|
||||
class scoreModel extends model
|
||||
{
|
||||
/**
|
||||
* get user score logs
|
||||
*
|
||||
* @param $pager
|
||||
*
|
||||
* @access public
|
||||
* @return array|bool
|
||||
*/
|
||||
public function getScores($pager)
|
||||
{
|
||||
$scores = $this->dao->select('*')->from(TABLE_SCORE)->where('account')->eq($this->app->user->account)->orderBy('time_desc,id_desc')->page($pager)->fetchAll();
|
||||
return empty($scores) ? array() : $scores;
|
||||
}
|
||||
|
||||
/**
|
||||
* add score logs
|
||||
*
|
||||
* @param string $model
|
||||
* @param string $method
|
||||
* @param string $param
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function score($model = '', $method = '', $param = '')
|
||||
{
|
||||
if(empty($this->config->score->model[$model][$method])) return true;
|
||||
switch($model)
|
||||
{
|
||||
case 'user':
|
||||
$desc = $this->lang->score->methods[$model][$method].'IP:'.helper::getRemoteIp();
|
||||
$this->saveScore($this->app->user->account, $this->config->score->model[$model][$method], $model, $method, $desc);
|
||||
break;
|
||||
case 'ajax':
|
||||
break;
|
||||
case 'tutorial':
|
||||
break;
|
||||
case 'my':
|
||||
break;
|
||||
case 'all':
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* save user score
|
||||
*
|
||||
* @param string $account
|
||||
* @param array $rule
|
||||
* @param string $model
|
||||
* @param string $method
|
||||
* @param string $desc
|
||||
*
|
||||
* @access private
|
||||
* @return bool
|
||||
*/
|
||||
private function saveScore($account = '', $rule = array(), $model = '', $method = '', $desc = '')
|
||||
{
|
||||
if(!empty($rule['num']) || !empty($rule['time']))
|
||||
{
|
||||
if(empty($rule['time']))
|
||||
{
|
||||
$count = $this->dao->slect('id')->from(TABLE_SCORE)->where('account')->eq($account)->andWhere('model')->eq($model)->andWhere('method')->eq($method)->count('id');
|
||||
if($count >= $rule['num']) return true;
|
||||
}
|
||||
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('id');
|
||||
if($count >= $rule['num']) return true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->dao->begin();
|
||||
try
|
||||
{
|
||||
$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();
|
||||
$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();
|
||||
}
|
||||
catch(ErrorException $e)
|
||||
{
|
||||
$this->dao->rollBack();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* reset all user score and level score
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function resetScore()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse view file of score module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Memory <lvtao@cnezsoft.com>
|
||||
@@ -10,38 +9,45 @@
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='titlebar'>
|
||||
<div class='heading'><?php echo html::icon($lang->icons['score']);?> <?php echo $lang->score->record;?></div>
|
||||
<?php include '../../common/view/header.html.php'; ?>
|
||||
<div id='titlebar'>
|
||||
<div class='heading'><?php echo html::icon($lang->icons['score']); ?><?php echo $lang->score->record; ?></div>
|
||||
<div class='actions'>
|
||||
<?php echo html::a(inLink('reset'), "<i class='icon-refresh'></i> " . $lang->score->reset, '', "class='btn'");?>
|
||||
<span class='btn disabled'><label><?php echo $lang->score->current; ?>:</label><?php echo $user->score; ?></span>
|
||||
<span class='btn disabled'><label><?php echo $lang->score->level; ?>:</label><?php echo $user->score_level; ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<table class='table tablesorter'>
|
||||
</div>
|
||||
<table class='table tablesorter'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<th><?php echo $lang->score->id;?></th>
|
||||
<th><?php echo $lang->score->account;?></th>
|
||||
<th><?php echo $lang->score->model;?></th>
|
||||
<th><?php echo $lang->score->method;?></th>
|
||||
<th><?php echo $lang->score->type;?></th>
|
||||
<th><?php echo $lang->score->score;?></th>
|
||||
<th><?php echo $lang->score->time;?></th>
|
||||
<th class="w-200px"><?php echo $lang->score->time; ?></th>
|
||||
<th class="w-150px"><?php echo $lang->score->model; ?></th>
|
||||
<th class="w-150px"><?php echo $lang->score->method; ?></th>
|
||||
<th class="w-100px"><?php echo $lang->score->before; ?></th>
|
||||
<th class="w-100px"><?php echo $lang->score->score; ?></th>
|
||||
<th class="w-100px"><?php echo $lang->score->after; ?></th>
|
||||
<th><?php echo $lang->score->desc; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if(!empty($scores))foreach($scores as $score):?>
|
||||
<tr class='text-center'>
|
||||
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<?php if(!empty($scores)) foreach($scores as $score): ?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo $score->time; ?></td>
|
||||
<td><?php echo $lang->score->models[$score->model]; ?></td>
|
||||
<td><?php echo $lang->score->methods[$score->model][$score->method]; ?></td>
|
||||
<td><?php echo $score->before; ?></td>
|
||||
<td><?php echo $score->score; ?></td>
|
||||
<td><?php echo $score->after; ?></td>
|
||||
<td><?php echo $score->desc; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan='7'>
|
||||
<?php $pager->show();?>
|
||||
</td>
|
||||
<td colspan='7'>
|
||||
<?php $pager->show(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
</table>
|
||||
<?php include '../../common/view/footer.html.php'; ?>
|
||||
@@ -691,7 +691,7 @@ class user extends control
|
||||
$this->session->set('user', $user);
|
||||
$this->app->user = $this->session->user;
|
||||
$this->loadModel('action')->create('user', $user->id, 'login');
|
||||
|
||||
$this->loadModel('score')->score('user','login');
|
||||
/* Keep login. */
|
||||
if($this->post->keepLogin) $this->user->keepLogin($user);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user