Merge branch 'master' of https://github.com/easysoft/zentaopms
This commit is contained in:
@@ -800,6 +800,12 @@ class bugModel extends model
|
||||
*/
|
||||
public function resolve($bugID)
|
||||
{
|
||||
if(strpos($this->config->bug->resolve->requiredFields, 'comment') !== false and !$this->post->comment)
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->comment);
|
||||
return false;
|
||||
}
|
||||
|
||||
$now = helper::now();
|
||||
$oldBug = $this->getById($bugID);
|
||||
$bug = fixer::input('post')
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<strong><small class='text-muted'></small> <?php echo $lang->bug->common . $lang->colon . $lang->bug->batchActivate;?></strong>
|
||||
</div>
|
||||
</div>
|
||||
<form class='form-condensed' method='post' target='hiddenwin' action="<?php echo inLink('batchActivate', "productID=$productID");?>">
|
||||
<form class='form-condensed' method='post' target='hiddenwin'>
|
||||
<table class='table table-fixed with-border'>
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
+27
-17
@@ -9,8 +9,6 @@ $config->custom->canAdd['todo'] = 'priList,typeList';
|
||||
$config->custom->canAdd['user'] = 'roleList';
|
||||
$config->custom->canAdd['block'] = '';
|
||||
|
||||
$config->custom->requiredModules[10] = 'todo';
|
||||
|
||||
$config->custom->requiredModules[15] = 'product';
|
||||
$config->custom->requiredModules[20] = 'story';
|
||||
$config->custom->requiredModules[25] = 'productplan';
|
||||
@@ -28,20 +26,32 @@ $config->custom->requiredModules[70] = 'testtask';
|
||||
|
||||
$config->custom->requiredModules[75] = 'doc';
|
||||
|
||||
$config->custom->requiredModules[80] = 'group';
|
||||
$config->custom->requiredModules[85] = 'user';
|
||||
|
||||
$config->custom->requiredModules[95] = 'entry';
|
||||
$config->custom->requiredModules[100] = 'webhook';
|
||||
|
||||
$config->custom->fieldList['group'] = 'name,desc';
|
||||
|
||||
$config->custom->excludeFieldList['product'] = 'order';
|
||||
$config->custom->excludeFieldList['story'] = 'version,duplicateStory,linkStories,childStories,toBug,fromBug';
|
||||
$config->custom->excludeFieldList['project'] = 'order';
|
||||
$config->custom->excludeFieldList['task'] = 'fromBug';
|
||||
$config->custom->excludeFieldList['bug'] = 'storyVersion,toTask,toStory,hardware,found,confirmed,activatedCount,activatedDate,linkBug,case,caseVersion,result,testtask,repo';
|
||||
$config->custom->excludeFieldList['testcase'] = 'version,lastRunResult,lastRunDate,lastRunner,linkCase,fromBug';
|
||||
$config->custom->excludeFieldList['testreport'] = 'objectType';
|
||||
$config->custom->excludeFieldList['doc'] = 'version';
|
||||
$config->custom->excludeFieldList['user'] = 'ranzhi,visits,ip,last';
|
||||
$config->custom->fieldList['product']['create'] = 'name,code,line,PO,QD,RD,type,desc';
|
||||
$config->custom->fieldList['product']['edit'] = 'name,code,line,PO,QD,RD,type,desc,status';
|
||||
$config->custom->fieldList['story']['create'] = 'product,plan,source,sourceNote,title,pri,estimate,mailto,keywords,spec,verify';
|
||||
$config->custom->fieldList['story']['change'] = 'title,spec,verify,comment';
|
||||
$config->custom->fieldList['story']['close'] = 'closedReason,comment';
|
||||
$config->custom->fieldList['story']['review'] = 'reviewedDate,assignedTo,reviewedBy,comment';
|
||||
$config->custom->fieldList['productplan'] = 'title,begin,end,desc';
|
||||
$config->custom->fieldList['release'] = 'name,build,date,desc';
|
||||
$config->custom->fieldList['project']['create'] = 'name,code,begin,end,days,type,desc';
|
||||
$config->custom->fieldList['project']['edit'] = 'name,code,begin,end,days,type,desc,PO,PM,QD,RD';
|
||||
$config->custom->fieldList['task']['create'] = 'type,story,name,pri,estimate,desc,estStarted,deadline,mailto';
|
||||
$config->custom->fieldList['task']['edit'] = 'type,assignedTo,story,name,pri,estimate,desc,estStarted,deadline,mailto';
|
||||
$config->custom->fieldList['task']['finish'] = 'consumed,finishedDate,comment';
|
||||
$config->custom->fieldList['task']['activate'] = 'assignedTo,left,comment';
|
||||
$config->custom->fieldList['build'] = 'product,name,builder,date,scmPath,filePath,desc';
|
||||
$config->custom->fieldList['bug']['create'] = 'product,project,openedBuild,assignedTo,deadline,type,os,browser,title,severity,pri,steps,story,task,mailto,keywords';
|
||||
$config->custom->fieldList['bug']['edit'] = 'product,plan,project,openedBuild,assignedTo,deadline,type,os,browser,title,severity,pri,steps,story,task,mailto,keywords,status';
|
||||
$config->custom->fieldList['bug']['resolve'] = 'resolution,resolvedBuild,resolvedDate,assignedTo,comment';
|
||||
$config->custom->fieldList['testcase']['create'] = 'product,type,stage,story,title,pri,precondition,keywords';
|
||||
$config->custom->fieldList['testcase']['edit'] = 'product,type,stage,story,title,pri,precondition,keywords,status';
|
||||
$config->custom->fieldList['testsuite'] = 'name,desc';
|
||||
$config->custom->fieldList['testcase']['createcase'] = 'lib,type,stage,title,pri,precondition,keywords';
|
||||
$config->custom->fieldList['testreport'] = 'begin,end,owner,members,title,report';
|
||||
$config->custom->fieldList['testtask'] = 'project,build,,owner,pri,begin,end,status,name,desc';
|
||||
$config->custom->fieldList['doc'] = 'title,keywords,content';
|
||||
$config->custom->fieldList['user']['create'] = 'dept,account,realname,password,password1,password2,role,email,commiter,join';
|
||||
$config->custom->fieldList['user']['edit'] = 'dept,account,realname,role,email,commiter,join,skype,qq,mobile,phone,address,zipcode,wangwang,gtalk';
|
||||
|
||||
@@ -259,19 +259,11 @@ class custom extends control
|
||||
unset($requiredFields['editLib']);
|
||||
}
|
||||
|
||||
$fields = $this->custom->getDBFields($moduleName);
|
||||
if($moduleName == 'testsuite')
|
||||
{
|
||||
$this->app->loadLang('testcase');
|
||||
$this->view->caseFields = $this->custom->getDBFields('testcase');
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->custom->required;
|
||||
$this->view->position[] = $this->lang->custom->required;
|
||||
|
||||
$this->view->requiredFields = $requiredFields;
|
||||
$this->view->moduleName = $moduleName;
|
||||
$this->view->fields = $fields;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -126,3 +126,7 @@ $lang->custom->saveFail = 'Failed to save!';
|
||||
|
||||
$lang->custom->scoreList[0] = 'Off';
|
||||
$lang->custom->scoreList[1] = 'On';
|
||||
|
||||
$lang->custom->moduleName['product'] = $lang->productCommon;
|
||||
$lang->custom->moduleName['productplan'] = 'Plan';
|
||||
$lang->custom->moduleName['project'] = $lang->projectCommon;
|
||||
|
||||
@@ -125,4 +125,8 @@ $lang->custom->menuTip = '点击显示或隐藏导航条目,拖拽来更改
|
||||
$lang->custom->saveFail = '保存失败!';
|
||||
|
||||
$lang->custom->scoreList[0] = '关闭';
|
||||
$lang->custom->scoreList[1] = '开启';
|
||||
$lang->custom->scoreList[1] = '开启';
|
||||
|
||||
$lang->custom->moduleName['product'] = $lang->productCommon;
|
||||
$lang->custom->moduleName['productplan'] = '计划';
|
||||
$lang->custom->moduleName['project'] = $lang->projectCommon;
|
||||
|
||||
+3
-19
@@ -410,30 +410,14 @@ class customModel extends model
|
||||
if(isset($customFields[$moduleName]))
|
||||
{
|
||||
$fieldList = isset($customFields[$moduleName][$method]) ? $customFields[$moduleName][$method] : $customFields[$moduleName];
|
||||
if(!is_string($fieldList)) return $fields;
|
||||
|
||||
foreach(explode(',', $fieldList) as $fieldName)
|
||||
{
|
||||
if($fieldName == 'comment') $fields[$fieldName] = $this->lang->comment;
|
||||
if(isset($moduleLang->$fieldName) and is_string($moduleLang->$fieldName)) $fields[$fieldName] = $moduleLang->$fieldName;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$table = zget($this->config->objectTables, $moduleName, '');
|
||||
if($table)
|
||||
{
|
||||
$excludeFieldList = zget($this->config->custom->excludeFieldList, $moduleName, '');
|
||||
foreach($this->dao->query("DESC $table")->fetchAll() as $field)
|
||||
{
|
||||
$fieldName = $field->Field;
|
||||
if($fieldName == 'id' or $fieldName == 'deleted') continue;
|
||||
if($fieldName == 'openedBy' or $fieldName == 'createdBy' or $fieldName == 'addedBy') continue;
|
||||
if($fieldName == 'openedDate' or $fieldName == 'createdDate' or $fieldName == 'addedDate') continue;
|
||||
if($fieldName == 'lastEditedBy' or $fieldName == 'editedBy') continue;
|
||||
if($fieldName == 'lastEditedDate' or $fieldName == 'editedDate') continue;
|
||||
if(isset($excludeFieldList) and strpos(",{$excludeFieldList},", ",$fieldName,") !== false) continue;
|
||||
if(isset($moduleLang->$fieldName) and is_string($moduleLang->$fieldName)) $fields[$fieldName] = $moduleLang->$fieldName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
<?php
|
||||
foreach($config->custom->requiredModules as $requiredModule)
|
||||
{
|
||||
echo "<li class='list-group-item' id='{$requiredModule}Tab'>" . html::a(inlink('required', "module=$requiredModule"), $lang->$requiredModule->common) . "</li>";
|
||||
$requiredModuleName = zget($lang->custom->moduleName, $requiredModule, $lang->$requiredModule->common);
|
||||
echo "<li class='list-group-item' id='{$requiredModule}Tab'>" . html::a(inlink('required', "module=$requiredModule"), $requiredModuleName) . "</li>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -32,17 +33,19 @@
|
||||
<tr>
|
||||
<th class='w-100px'>
|
||||
<?php
|
||||
$fieldList = $fields;
|
||||
$fields = $this->custom->getDBFields($moduleName, $method);
|
||||
|
||||
if($moduleName == 'testsuite' and $method == 'createlib') $method = 'createLib';
|
||||
if($moduleName == 'testsuite' and $method == 'createcase')
|
||||
{
|
||||
$fieldList = $caseFields;
|
||||
$method = 'createCase';
|
||||
$this->app->loadLang('testcase');
|
||||
$fields = $this->custom->getDBFields('testcase', $method);
|
||||
$method = 'createCase';
|
||||
}
|
||||
echo $lang->$moduleName->$method;
|
||||
?>
|
||||
</th>
|
||||
<td><?php echo html::select("requiredFields[{$method}][]", $fieldList, $requiredField, "class='form-control chosen' multiple");?></td>
|
||||
<td><?php echo html::select("requiredFields[{$method}][]", $fields, $requiredField, "class='form-control chosen' multiple");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
|
||||
@@ -19,6 +19,7 @@ $lang->my->manageContacts = 'Maintain Contact';
|
||||
$lang->my->deleteContacts = 'Delete Contact';
|
||||
$lang->my->limited = 'Restricted operation (editing only content related to itself)';
|
||||
$lang->my->score = 'My Score';
|
||||
$lang->my->scoreRule = 'Score rule';
|
||||
|
||||
$lang->my->taskMenu = new stdclass();
|
||||
$lang->my->taskMenu->assignedToMe = 'Assigned to Me';
|
||||
|
||||
@@ -19,6 +19,7 @@ $lang->my->manageContacts = '维护联系人';
|
||||
$lang->my->deleteContacts = '删除联系人';
|
||||
$lang->my->limited = '受限操作(只能编辑与自己相关的内容)';
|
||||
$lang->my->score = '我的积分';
|
||||
$lang->my->scoreRule = '积分规则';
|
||||
|
||||
$lang->my->taskMenu = new stdclass();
|
||||
$lang->my->taskMenu->assignedToMe = '指派给我';
|
||||
|
||||
@@ -19,6 +19,7 @@ $lang->my->manageContacts = '維護聯繫人';
|
||||
$lang->my->deleteContacts = '刪除聯繫人';
|
||||
$lang->my->limited = '受限操作(只能編輯與自己相關的內容)';
|
||||
$lang->my->score = '我的積分';
|
||||
$lang->my->scoreRule = '積分規則';
|
||||
|
||||
$lang->my->taskMenu = new stdclass();
|
||||
$lang->my->taskMenu->assignedToMe = '指派給我';
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<div class='actions'>
|
||||
<span class='btn disabled'><label><?php echo $lang->score->current; ?>:</label><?php echo $user->score; ?></span>
|
||||
<span class='btn disabled hidden'><label><?php echo $lang->score->level; ?>:</label><?php echo $user->scoreLevel; ?></span>
|
||||
<?php if($this->app->user->admin == 1) echo html::a($this->createLink('score', 'rule'), $lang->my->scoreRule, '', "class='btn btn-primary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<table class='table tablesorter'>
|
||||
|
||||
@@ -302,7 +302,7 @@ class productModel extends model
|
||||
->get();
|
||||
$product = $this->loadModel('file')->processImgURL($product, $this->config->product->editor->create['id'], $this->post->uid);
|
||||
$this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck()
|
||||
->batchCheck('name,code', 'notempty')
|
||||
->batchCheck($this->config->product->edit->requiredFields, 'notempty')
|
||||
->check('name', 'unique', "deleted = '0'")
|
||||
->check('code', 'unique', "deleted = '0'")
|
||||
->exec();
|
||||
|
||||
@@ -2139,13 +2139,8 @@ class project extends control
|
||||
$data = fixer::input('post')->get();
|
||||
if(common::hasPriv('project', 'kanbanHideCols'))
|
||||
{
|
||||
$allCols = array();
|
||||
if(isset($this->config->project->kanbanSetting->allCols))
|
||||
{
|
||||
$allCols = json_decode($this->config->project->kanbanSetting->allCols, true);
|
||||
}
|
||||
$allCols[$projectID] = $data->allCols;
|
||||
$this->setting->setItem("system.project.kanbanSetting.allCols", json_encode($allCols));
|
||||
$allCols = $data->allCols;
|
||||
$this->setting->setItem("system.project.kanbanSetting.allCols", $allCols);
|
||||
}
|
||||
|
||||
$account = $this->app->user->account;
|
||||
|
||||
@@ -78,7 +78,7 @@ table th.col-closed {width:14%}
|
||||
.board-story.stage-tested {color:#827717; background-color: #F9FBE7}
|
||||
.board-story.stage-released {color:#9C27B0; background-color: #F3E5F5}
|
||||
|
||||
.board-story.inverse {background: #dd7503}
|
||||
.board-story.inverse {background: #dd7503; color:#f1f1f1}
|
||||
.board-story.stage-projected.inverse {background-color:#777;}
|
||||
.board-story.stage-developing.inverse {background-color:#D2322D;}
|
||||
.board-story.stage-developed.inverse {background-color:#229F24;}
|
||||
|
||||
@@ -2243,16 +2243,9 @@ class projectModel extends model
|
||||
{
|
||||
$allCols = '1';
|
||||
$showOption = '0';
|
||||
if(isset($this->config->project->kanbanSetting->allCols))
|
||||
{
|
||||
$allColPairs = json_decode($this->config->project->kanbanSetting->allCols, true);
|
||||
if(isset($allColPairs[$projectID])) $allCols = $allColPairs[$projectID];
|
||||
}
|
||||
if(isset($this->config->project->kanbanSetting->allCols)) $allCols = $this->config->project->kanbanSetting->allCols;
|
||||
|
||||
if(isset($this->config->project->kanbanSetting->showOption))
|
||||
{
|
||||
$showOption = $this->config->project->kanbanSetting->showOption;
|
||||
}
|
||||
if(isset($this->config->project->kanbanSetting->showOption)) $showOption = $this->config->project->kanbanSetting->showOption;
|
||||
|
||||
$colorList = $this->config->project->kanbanSetting->colorList;
|
||||
if(!is_array($colorList)) $colorList = json_decode($colorList, true);
|
||||
|
||||
@@ -54,18 +54,9 @@ $account = $this->app->user->account
|
||||
<div class='actions'>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn btn-mini btn-link dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="icon-ellipsis-v"></span>
|
||||
<span class="icon-ellipsis-h"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<?php
|
||||
echo "<li class='dropdown-submenu'>";
|
||||
echo "<a href='###'><i class='icon-group'></i> {$lang->project->groups['']}</a>";
|
||||
echo "<ul class='dropdown-menu pull-left' style='width:105px'>";
|
||||
echo "<li>" . html::a(inlink('kanban', "project=$projectID&type=story"), $lang->project->groups['story']) . "</li>";
|
||||
echo "<li>" . html::a(inlink('kanban', "project=$projectID&type=assignedTo"), $lang->project->groups['assignedTo']) . "</li>";
|
||||
echo "<li>" . html::a(inlink('kanban', "project=$projectID&type=finishedBy"), $lang->project->groups['finishedBy']) . "</li>";
|
||||
echo "</ul></li>";
|
||||
?>
|
||||
<?php echo '<li>' . html::a($this->createLink('project', 'ajaxKanbanSetting', "projectID=$projectID"), "<i class='icon-cog'></i> " . $lang->project->kanbanSetting, '', "class='iframe'") . '</li>';?>
|
||||
<?php if(common::hasPriv('project', 'printKanban')) echo '<li>' . html::a('###', "<i class='icon-print'></i> " . $lang->project->printKanban, '', "id='printKanban' title='" . $lang->project->printKanban . "'") . '</li>';?>
|
||||
</ul>
|
||||
@@ -102,7 +93,7 @@ $account = $this->app->user->account
|
||||
<button type='button' class='btn btn-mini btn-link btn-info-toggle'><i class='icon-angle-down'></i></button>
|
||||
<div class='dropdown'>
|
||||
<button type='button' class='btn btn-mini btn-link dropdown-toggle' data-toggle='dropdown'>
|
||||
<span class='icon-ellipsis-v'></span>
|
||||
<span class='icon-ellipsis-h'></span>
|
||||
</button>
|
||||
<div class='dropdown-menu' style='left:-30px;width:80px'>
|
||||
<?php
|
||||
@@ -152,7 +143,7 @@ $account = $this->app->user->account
|
||||
<button type='button' class='btn btn-mini btn-link btn-info-toggle'><i class='icon-angle-down'></i></button>
|
||||
<div class='dropdown'>
|
||||
<button type='button' class='btn btn-mini btn-link dropdown-toggle' data-toggle='dropdown'>
|
||||
<span class='icon-ellipsis-v'></span>
|
||||
<span class='icon-ellipsis-h'></span>
|
||||
</button>
|
||||
<div class='dropdown-menu' style='left:-15px'>
|
||||
<?php
|
||||
@@ -193,7 +184,7 @@ $account = $this->app->user->account
|
||||
<button type='button' class='btn btn-mini btn-link btn-info-toggle'><i class='icon-angle-down'></i></button>
|
||||
<div class='dropdown'>
|
||||
<button type='button' class='btn btn-mini btn-link dropdown-toggle' data-toggle='dropdown'>
|
||||
<span class='icon-ellipsis-v'></span>
|
||||
<span class='icon-ellipsis-h'></span>
|
||||
</button>
|
||||
<div class='dropdown-menu' style='left:-15px'>
|
||||
<?php
|
||||
|
||||
@@ -22,7 +22,7 @@ $config->score->user->login = array('times' => 3, 'hour' => 24, 'score'
|
||||
$config->score->user->changePassword = array('times' => 1, 'hour' => 0, 'score' => 10);
|
||||
$config->score->user->editProfile = array('times' => 1, 'hour' => 0, 'score' => 10);
|
||||
|
||||
$config->score->tutorial->keepAll = array('times' => 1, 'hour' => 0, 'score' => 100);
|
||||
$config->score->tutorial->finish = array('times' => 1, 'hour' => 0, 'score' => 100);
|
||||
|
||||
$config->score->ajax->selectTheme = array('times' => 1, 'hour' => 0, 'score' => 10);
|
||||
$config->score->ajax->selectLang = array('times' => 1, 'hour' => 0, 'score' => 10);
|
||||
|
||||
@@ -23,6 +23,18 @@ class score extends control
|
||||
$this->score->create('ajax', $method);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show score rule.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function rule()
|
||||
{
|
||||
$this->view->rule = $this->config->score;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize score.
|
||||
*
|
||||
|
||||
@@ -20,7 +20,9 @@ $lang->score->score = 'Score';
|
||||
$lang->score->after = 'After';
|
||||
$lang->score->time = 'Time';
|
||||
$lang->score->desc = 'Description';
|
||||
|
||||
$lang->score->noLimit = 'No limited';
|
||||
$lang->score->times = 'Times';
|
||||
$lang->score->hour = 'Hour';
|
||||
|
||||
$lang->score->models['task'] = 'Task';
|
||||
$lang->score->models['tutorial'] = 'Tutorial';
|
||||
@@ -42,7 +44,7 @@ $lang->score->models['search'] = 'Search';
|
||||
$lang->score->methods['task']['create'] = 'Create task';
|
||||
$lang->score->methods['task']['close'] = 'Close task';
|
||||
$lang->score->methods['task']['finish'] = 'Finish task';
|
||||
$lang->score->methods['tutorial']['keepAll'] = 'Finish tutorial';
|
||||
$lang->score->methods['tutorial']['finish'] = 'Finish tutorial';
|
||||
$lang->score->methods['user']['login'] = 'Login';
|
||||
$lang->score->methods['user']['changePassword'] = 'Change password';
|
||||
$lang->score->methods['user']['editProfile'] = 'Edit profile';
|
||||
@@ -77,3 +79,11 @@ $lang->score->methods['release']['create'] = 'Create release';
|
||||
$lang->score->methods['block']['set'] = 'Custom block';
|
||||
$lang->score->methods['search']['saveQuery'] = 'Save search query';
|
||||
$lang->score->methods['search']['saveQueryAdvanced'] = 'Advanced search';
|
||||
|
||||
$lang->score->extended = new stdClass();
|
||||
$lang->score->extended->userchangePassword = 'Password strength,medium:add extra score : #changePassword,strength,1#; Strong:add extra score : #changePassword,strength,2#.';
|
||||
$lang->score->extended->projectclose = 'Project closed,PM add extra score : #projectClose,manager,close#,Team member add extra score : #projectClose,member,close#. Completed on schedule or in advance,PM add extra score : #projectClose,manager,in#,Team member Add extra score : #projectClose,member,in#.';
|
||||
$lang->score->extended->bugresolve = 'Bug resolved,Add extra severity score :s1 + #bugResolve,severity,3#, s2 + #bugResolve,severity,2#, s3 + #bugResolve,severity,1#。';
|
||||
$lang->score->extended->bugconfirmBug = 'Bug confirmed,Add extra severity score :s1 + #bugConfirmBug,severity,3#, s2 + #bugConfirmBug,severity,2#, s3 + #bugConfirmBug,severity,1#。';
|
||||
$lang->score->extended->taskfinish = 'Task finished, Add extra score round(consumed /10 * estimate / consumed) + severity score(p1 #taskFinish,pri,1#, p2, #taskFinish,pri,2#)。';
|
||||
$lang->score->extended->storyclose = 'Add extra score for story creator : #storyClose,createID#.';
|
||||
@@ -20,7 +20,9 @@ $lang->score->score = '分值';
|
||||
$lang->score->after = '之后';
|
||||
$lang->score->time = '时间';
|
||||
$lang->score->desc = '描述';
|
||||
|
||||
$lang->score->noLimit = '不限制';
|
||||
$lang->score->times = '次数';
|
||||
$lang->score->hour = '时间间隔';
|
||||
|
||||
$lang->score->models['task'] = '任务';
|
||||
$lang->score->models['tutorial'] = '新手教程';
|
||||
@@ -42,7 +44,7 @@ $lang->score->models['search'] = '搜索';
|
||||
$lang->score->methods['task']['create'] = '创建任务';
|
||||
$lang->score->methods['task']['close'] = '关闭任务';
|
||||
$lang->score->methods['task']['finish'] = '完成任务';
|
||||
$lang->score->methods['tutorial']['keepAll'] = '学习完成';
|
||||
$lang->score->methods['tutorial']['finish'] = '学习完成';
|
||||
$lang->score->methods['user']['login'] = '登录';
|
||||
$lang->score->methods['user']['changePassword'] = '修改密码';
|
||||
$lang->score->methods['user']['editProfile'] = '修改个人资料';
|
||||
@@ -77,3 +79,11 @@ $lang->score->methods['release']['create'] = '创建发布';
|
||||
$lang->score->methods['block']['set'] = '区块自定义设置';
|
||||
$lang->score->methods['search']['saveQuery'] = '保存搜索条件';
|
||||
$lang->score->methods['search']['saveQueryAdvanced'] = '使用高级搜索';
|
||||
|
||||
$lang->score->extended = new stdClass();
|
||||
$lang->score->extended->userchangePassword = '密码强度中的,额外获得#changePassword,strength,1#个积分,强的,额外获得#changePassword,strength,2#个积分。';
|
||||
$lang->score->extended->projectclose = '项目经理增加#projectClose,manager,close#个积分,项目成员增加#projectClose,member,close#个积分。按期或者提前完成,项目经理额外增加#projectClose,manager,in#个积分,项目成员额外增加#projectClose,member,in#个积分。';
|
||||
$lang->score->extended->bugresolve = 'Bug解决后,额外增加严重程度积分:s1 + #bugResolve,severity,3#, s2 + #bugResolve,severity,2#, s3 + #bugResolve,severity,1#。';
|
||||
$lang->score->extended->bugconfirmBug = 'Bug确认后,额外增加严重程度积分:s1 + #bugConfirmBug,severity,3#, s2 + #bugConfirmBug,severity,2#, s3 + #bugConfirmBug,severity,1#。';
|
||||
$lang->score->extended->taskfinish = '额外增加工时积分 round(工时 /10 * 预计 / 消耗) + 优先级积分(p1 #taskFinish,pri,1#, p2, #taskFinish,pri,2#)。';
|
||||
$lang->score->extended->storyclose = '需求的创建者额外增加#storyClose,createID#分';
|
||||
@@ -20,7 +20,9 @@ $lang->score->score = '分值';
|
||||
$lang->score->after = '之後';
|
||||
$lang->score->time = '時間';
|
||||
$lang->score->desc = '描述';
|
||||
|
||||
$lang->score->noLimit = '不限制';
|
||||
$lang->score->times = '次数';
|
||||
$lang->score->hour = '时间间隔';
|
||||
|
||||
$lang->score->models['task'] = '任務';
|
||||
$lang->score->models['tutorial'] = '新手教程';
|
||||
@@ -42,7 +44,7 @@ $lang->score->models['search'] = '搜索';
|
||||
$lang->score->methods['task']['create'] = '創建任務';
|
||||
$lang->score->methods['task']['close'] = '關閉任務';
|
||||
$lang->score->methods['task']['finish'] = '完成任務';
|
||||
$lang->score->methods['tutorial']['keepAll'] = '學習完成';
|
||||
$lang->score->methods['tutorial']['finish'] = '學習完成';
|
||||
$lang->score->methods['user']['login'] = '登錄';
|
||||
$lang->score->methods['user']['changePassword'] = '修改密碼';
|
||||
$lang->score->methods['user']['editProfile'] = '修改個人資料';
|
||||
@@ -77,4 +79,12 @@ $lang->score->methods['productplan']['create'] = '創建計劃';
|
||||
$lang->score->methods['release']['create'] = '創建發布';
|
||||
$lang->score->methods['block']['set'] = '區塊自定義設置';
|
||||
$lang->score->methods['search']['saveQuery'] = '保存搜索條件';
|
||||
$lang->score->methods['search']['saveQueryAdvanced'] = '使用高級搜索';
|
||||
$lang->score->methods['search']['saveQueryAdvanced'] = '使用高級搜索';
|
||||
|
||||
$lang->score->extended = new stdClass();
|
||||
$lang->score->extended->userchangePassword = '密碼強度中的,額外獲得#changePassword,strength,1#個積分,強的,額外獲得#changePassword,strength,2#個積分。';
|
||||
$lang->score->extended->projectclose = '項目經理增加#projectClose,manager,close#個積分,項目成員增加#projectClose,member,close#個積分。按期或者提前完成,項目經理額外增加#projectClose,manager,in#個積分,項目成員額外增加#projectClose,member,in#個積分。';
|
||||
$lang->score->extended->bugresolve = 'Bug解決後,額外增加嚴重程度積分:s1 + #bugResolve,severity,3#, s2 + #bugResolve,severity,2#, s3 + #bugResolve,severity,1#。';
|
||||
$lang->score->extended->bugconfirmBug = 'Bug確認後,額外增加嚴重程度積分:s1 + #bugConfirmBug,severity,3#, s2 + #bugConfirmBug,severity,2#, s3 + #bugConfirmBug,severity,1#。';
|
||||
$lang->score->extended->taskfinish = '額外增加工時積分 round(工時/ 10 * 預計/消耗) + 優先級積分(p1 #taskFinish,pri,1#, p2, #taskFinish,pri,2#)。';
|
||||
$lang->score->extended->storyclose = '需要的創建者額外增加#storyClose,createID#分';
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* The reset 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>
|
||||
* @package score
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php'; ?>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-150px"><?php echo $this->lang->score->module;?></th>
|
||||
<th class="w-150px"><?php echo $this->lang->score->method;?></th>
|
||||
<th class="w-150px"><?php echo $this->lang->score->times;?></th>
|
||||
<th class="w-150px"><?php echo $this->lang->score->hour;?></th>
|
||||
<th class="w-150px"><?php echo $this->lang->score->score;?></th>
|
||||
<th>备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($rule as $key => $value):?>
|
||||
<?php if($key == 'extended') break;?>
|
||||
<?php foreach($value as $oneKey => $oneValue):?>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $this->lang->score->models[$key];?></td>
|
||||
<td class="text-center"><?php echo $this->lang->score->methods[$key][$oneKey];?></td>
|
||||
<td class="text-center"><?php echo empty($oneValue['times']) ? $this->lang->score->noLimit : $oneValue['times'];?></td>
|
||||
<td class="text-center"><?php echo empty($oneValue['hour']) ? $this->lang->score->noLimit : $oneValue['hour'];?></td>
|
||||
<td class="text-center"><?php echo $oneValue['score'];?></td>
|
||||
<td>
|
||||
<?php
|
||||
if(isset($this->lang->score->extended->{$key . $oneKey}))
|
||||
{
|
||||
$str = $this->lang->score->extended->{$key . $oneKey};
|
||||
$strArray = explode('#', $str);
|
||||
if(!empty($strArray)) foreach($strArray as $strKey => $strVal)
|
||||
{
|
||||
if($strKey % 2 == 1)
|
||||
{
|
||||
$ab = explode(',', $strVal);
|
||||
$score = count($ab) == 3 ? $rule->extended->{$ab[0]}[$ab[1]][$ab[2]] : $rule->extended->{$ab[0]}[$ab[1]];
|
||||
$str = str_replace('#' . $strVal . '#', $score, $str);
|
||||
}
|
||||
}
|
||||
echo $str;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<?php endforeach;?>
|
||||
</tfoot>
|
||||
</table>
|
||||
<?php include '../../common/view/footer.html.php'; ?>
|
||||
@@ -387,6 +387,12 @@ class storyModel extends model
|
||||
return false;
|
||||
}
|
||||
|
||||
if(strpos($this->config->story->change->requiredFields, 'comment') !== false and !$this->post->comment)
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->comment);
|
||||
return false;
|
||||
}
|
||||
|
||||
$story = fixer::input('post')->stripTags($this->config->story->editor->change['id'], $this->config->allowedTags)->get();
|
||||
if($story->spec != $oldStory->spec or $story->verify != $oldStory->verify or $story->title != $oldStory->title or $this->loadModel('file')->getCount()) $specChanged = true;
|
||||
|
||||
@@ -629,6 +635,12 @@ class storyModel extends model
|
||||
if($this->post->result == false) die(js::alert($this->lang->story->mustChooseResult));
|
||||
if($this->post->result == 'revert' and $this->post->preVersion == false) die(js::alert($this->lang->story->mustChoosePreVersion));
|
||||
|
||||
if(strpos($this->config->story->review->requiredFields, 'comment') !== false and !$this->post->comment)
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->comment);
|
||||
return false;
|
||||
}
|
||||
|
||||
$oldStory = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch();
|
||||
$now = helper::now();
|
||||
$date = helper::today();
|
||||
@@ -768,6 +780,12 @@ class storyModel extends model
|
||||
*/
|
||||
public function close($storyID)
|
||||
{
|
||||
if(strpos($this->config->story->close->requiredFields, 'comment') !== false and !$this->post->comment)
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->comment);
|
||||
return false;
|
||||
}
|
||||
|
||||
$oldStory = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch();
|
||||
$now = helper::now();
|
||||
$story = fixer::input('post')
|
||||
@@ -784,6 +802,7 @@ class storyModel extends model
|
||||
->setIF($this->post->closedReason != 'done', 'plan', 0)
|
||||
->remove('comment')
|
||||
->get();
|
||||
|
||||
$this->dao->update(TABLE_STORY)->data($story)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->story->close->requiredFields, 'notempty')
|
||||
|
||||
@@ -10,7 +10,6 @@ $config->task->activate = new stdclass();
|
||||
|
||||
$config->task->create->requiredFields = 'name,type';
|
||||
$config->task->edit->requiredFields = $config->task->create->requiredFields;
|
||||
$config->task->start->requiredFields = 'estimate';
|
||||
$config->task->finish->requiredFields = 'consumed';
|
||||
$config->task->activate->requiredFields = 'left';
|
||||
|
||||
|
||||
@@ -780,8 +780,9 @@ class task extends control
|
||||
|
||||
if(!empty($task->team))
|
||||
{
|
||||
$task->openedBy = $this->task->getNextUser(array_keys($task->team), $task->assignedTo);
|
||||
$members = $this->task->getMemberPairs($task);
|
||||
$task->openedBy = $this->task->getNextUser(array_keys($task->team), $task->assignedTo);
|
||||
$members = $this->task->getMemberPairs($task);
|
||||
$task->myConsumed = $this->dao->select('consumed')->from(TABLE_TEAM)->where('task')->eq($taskID)->andWhere('account')->eq($task->assignedTo)->fetch('consumed');
|
||||
}
|
||||
|
||||
$this->view->title = $this->view->project->name . $this->lang->colon .$this->lang->task->finish;
|
||||
|
||||
@@ -107,7 +107,7 @@ $lang->task->parent = 'Parent Task';
|
||||
$lang->task->unfinished = 'Unfinished';
|
||||
$lang->task->lblPri = 'P';
|
||||
$lang->task->lblHour = '(h)';
|
||||
$lang->task->deniedNotice = 'This task only starting from <strong>% s </ strong>.';
|
||||
$lang->task->deniedNotice = 'This task can only be started by the first user in the team.';
|
||||
|
||||
$lang->task->ditto = 'Ditto';
|
||||
$lang->task->dittoNotice = "This Task does not belong to the Project as the previous one does!";
|
||||
|
||||
@@ -106,7 +106,7 @@ $lang->task->childrenAB = '子';
|
||||
$lang->task->parent = '父任务';
|
||||
$lang->task->lblPri = 'P';
|
||||
$lang->task->lblHour = '(h)';
|
||||
$lang->task->deniedNotice = '此任务只允许由<strong>%s</strong>开始。';
|
||||
$lang->task->deniedNotice = '此任务只允许由团队第一人开始。';
|
||||
|
||||
$lang->task->ditto = '同上';
|
||||
$lang->task->dittoNotice = "该任务与上一任务不属于同一项目!";
|
||||
|
||||
@@ -107,7 +107,7 @@ $lang->task->parent = '父任務';
|
||||
$lang->task->unfinished = '未完成';
|
||||
$lang->task->lblPri = 'P';
|
||||
$lang->task->lblHour = '(h)';
|
||||
$lang->task->deniedNotice = '此任務只允許由<strong>%s</strong>開始。';
|
||||
$lang->task->deniedNotice = '此任務只允許由團隊第一人開始。';
|
||||
|
||||
$lang->task->ditto = '同上';
|
||||
$lang->task->dittoNotice = "該任務與上一任務不屬於同一項目!";
|
||||
|
||||
+77
-34
@@ -28,11 +28,11 @@ class taskModel extends model
|
||||
$task = fixer::input('post')
|
||||
->add('project', (int)$projectID)
|
||||
->setDefault('estimate, left, story', 0)
|
||||
->setDefault('estStarted', '0000-00-00')
|
||||
->setDefault('deadline', '0000-00-00')
|
||||
->setDefault('status', 'wait')
|
||||
->setIF($this->post->estimate != false, 'left', $this->post->estimate)
|
||||
->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story))
|
||||
->setIF(strpos($this->config->task->create->requiredFields, 'estStarted') === false, 'estStarted', '0000-00-00')
|
||||
->setIF(strpos($this->config->task->create->requiredFields, 'deadline') === false, 'deadline', '0000-00-00')
|
||||
->setDefault('openedBy', $this->app->user->account)
|
||||
->setDefault('openedDate', helper::now())
|
||||
->stripTags($this->config->task->editor->create['id'], $this->config->allowedTags)
|
||||
@@ -313,7 +313,8 @@ class taskModel extends model
|
||||
$now = helper::now();
|
||||
$task = fixer::input('post')
|
||||
->setDefault('story, estimate, left, consumed', 0)
|
||||
->setDefault('deadline', '0000-00-00')
|
||||
->setIF(strpos($this->config->task->edit->requiredFields, 'estStarted') === false, 'estStarted', '0000-00-00')
|
||||
->setIF(strpos($this->config->task->edit->requiredFields, 'deadline') === false, 'deadline', '0000-00-00')
|
||||
->setIF($this->post->story != false and $this->post->story != $oldTask->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story))
|
||||
|
||||
->setIF($this->post->status == 'done', 'left', 0)
|
||||
@@ -686,6 +687,7 @@ class taskModel extends model
|
||||
->setDefault('lastEditedDate', $now)
|
||||
->setIF($oldTask->assignedTo != $this->app->user->account, 'assignedDate', $now)
|
||||
->remove('comment')->get();
|
||||
|
||||
if($this->post->left == 0)
|
||||
{
|
||||
$task->status = 'done';
|
||||
@@ -706,6 +708,27 @@ class taskModel extends model
|
||||
$estimate->consumed = $estimate->consumed - $oldTask->consumed;
|
||||
$this->addTaskEstimate($estimate);
|
||||
|
||||
if(!empty($oldTask->team) && $task->status == 'done')
|
||||
{
|
||||
$teams = array_keys($oldTask->team);
|
||||
if(empty($oldTask->assignedTo)) $oldTask->assignedTo = $teams[0];
|
||||
|
||||
$newTeamInfo = new stdClass();
|
||||
$newTeamInfo->consumed = $task->consumed;
|
||||
$newTeamInfo->left = 0;
|
||||
$this->dao->update(TABLE_TEAM)->data($newTeamInfo)->where('task')->eq($taskID)->andWhere('account')->eq($oldTask->assignedTo)->exec();
|
||||
|
||||
$newTask = new stdClass();
|
||||
$newTask->left = 0;
|
||||
$newTask->status = 'doing';
|
||||
$newTask->consumed = $task->consumed;
|
||||
$newTask->assignedTo = $this->getNextUser($teams, $oldTask->assignedTo);
|
||||
$newTask->assignedDate = $now;
|
||||
$this->dao->update(TABLE_TASK)->data($newTask)->where('id')->eq((int)$taskID)->exec();
|
||||
|
||||
if($task->assignedTo != $teams[count($teams) - 1]) return common::createChanges($oldTask, $newTask);
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($task)
|
||||
->autoCheck()
|
||||
->check('consumed,left', 'float')
|
||||
@@ -825,22 +848,31 @@ class taskModel extends model
|
||||
$data->assignedDate = $now;
|
||||
}
|
||||
|
||||
|
||||
if(!empty($task->team))
|
||||
{
|
||||
if(in_array($this->app->user->account,array_keys($task->team)))
|
||||
{
|
||||
$myTeamInfo = $this->dao->select('`consumed`,`left`')->from(TABLE_TEAM)->where('task')->eq($taskID)->andWhere('account')->eq($this->app->user->account)->fetch();
|
||||
if(!empty($myTeamInfo))
|
||||
{
|
||||
$newTeamInfo = new stdClass();
|
||||
$newTeamInfo->consumed = $myTeamInfo->consumed + $consumed;
|
||||
$newTeamInfo->left = $left;
|
||||
$this->dao->update(TABLE_TEAM)->data($newTeamInfo)->where('task')->eq($taskID)->andWhere('account')->eq($this->app->user->account)->exec();
|
||||
}
|
||||
}
|
||||
$teams = array_keys($task->team);
|
||||
|
||||
$data->left = $this->dao->select("sum(`left`) as leftTime")->from(TABLE_TEAM)->where('task')->eq((int)$taskID)->andWhere('account')->in(array_keys($task->team))->fetch('leftTime');
|
||||
$myConsumed = $this->dao->select('`consumed`')->from(TABLE_TEAM)->where('task')->eq($taskID)->andWhere('account')->eq($task->assignedTo)->fetch('consumed');
|
||||
|
||||
$newTeamInfo = new stdClass();
|
||||
$newTeamInfo->consumed = $myConsumed + $consumed;
|
||||
$newTeamInfo->left = $left;
|
||||
$this->dao->update(TABLE_TEAM)->data($newTeamInfo)->where('task')->eq($taskID)->andWhere('account')->eq($task->assignedTo)->exec();
|
||||
|
||||
$teamTime = $this->dao->select("sum(`consumed`) as consumed,sum(`left`) as leftTime")->from(TABLE_TEAM)->where('task')->eq((int)$taskID)->andWhere('account')->in($teams)->fetch();
|
||||
$data->consumed = $teamTime->consumed;
|
||||
$data->left = $teamTime->leftTime;
|
||||
|
||||
if($task->status == 'done')
|
||||
{
|
||||
$newTask = new stdClass();
|
||||
$newTask->left = $data->left;
|
||||
$newTask->consumed = $data->consumed;
|
||||
$newTask->assignedTo = $this->getNextUser($teams, $task->assignedTo);
|
||||
$this->dao->update(TABLE_TASK)->data($newTask)->where('id')->eq((int)$taskID)->exec();
|
||||
|
||||
if($task->assignedTo != $teams[count($teams) - 1]) return common::createChanges($task, $newTask);
|
||||
}
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($data)->where('id')->eq($taskID)->exec();
|
||||
@@ -880,6 +912,12 @@ class taskModel extends model
|
||||
$oldTask = $this->getById($taskID);
|
||||
$now = helper::now();
|
||||
|
||||
if(strpos($this->config->task->finish->requiredFields, 'comment') !== false and !$this->post->comment)
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->comment);
|
||||
return false;
|
||||
}
|
||||
|
||||
$task = fixer::input('post')
|
||||
->setDefault('left', 0)
|
||||
->setDefault('assignedTo', $oldTask->openedBy)
|
||||
@@ -895,26 +933,25 @@ class taskModel extends model
|
||||
if(!empty($oldTask->team))
|
||||
{
|
||||
$teams = array_keys($oldTask->team);
|
||||
if(in_array($this->app->user->account, $teams))
|
||||
{
|
||||
$myLeft = $this->dao->select("`left`")->from(TABLE_TEAM)->where('task')->eq((int)$taskID)->andWhere('account')->in($this->app->user->account)->fetch('left');
|
||||
if($myLeft <= 0) die(js::error($this->lang->task->error->isFinish));
|
||||
|
||||
$data = new stdClass();
|
||||
$data->left = 0;
|
||||
$data->consumed = $task->consumed;
|
||||
$this->dao->update(TABLE_TEAM)->data($data)->where('task')->eq((int)$taskID)->andWhere('account')->eq($this->app->user->account)->exec();
|
||||
$myConsumed = $this->dao->select("`consumed`")->from(TABLE_TEAM)->where('task')->eq((int)$taskID)->andWhere('account')->eq($oldTask->assignedTo)->fetch('consumed');
|
||||
if($task->consumed < $myConsumed) die(js::error($this->lang->task->error->consumedSmall));
|
||||
|
||||
$left = $this->dao->select("sum(`left`) as leftTime")->from(TABLE_TEAM)->where('task')->eq((int)$taskID)->andWhere('account')->in($teams)->fetch('leftTime');
|
||||
$data = new stdClass();
|
||||
$data->left = 0;
|
||||
$data->consumed = $task->consumed;
|
||||
$this->dao->update(TABLE_TEAM)->data($data)->where('task')->eq((int)$taskID)->andWhere('account')->eq($oldTask->assignedTo)->exec();
|
||||
|
||||
$newTask = new stdClass();
|
||||
$newTask->left = $left;
|
||||
$newTask->consumed = $oldTask->consumed + $task->consumed;
|
||||
$newTask->assignedTo = $task->assignedTo;
|
||||
$this->dao->update(TABLE_TASK)->data($newTask)->where('id')->eq((int)$taskID)->exec();
|
||||
$myTime = $this->dao->select("sum(`left`) as leftTime,sum(`consumed`) as consumed")->from(TABLE_TEAM)->where('task')->eq((int)$taskID)->andWhere('account')->in($teams)->fetch();
|
||||
|
||||
if($this->app->user->account != $teams[count($teams)]) return common::createChanges($oldTask, $newTask);
|
||||
}
|
||||
$newTask = new stdClass();
|
||||
$newTask->left = $myTime->leftTime;
|
||||
$newTask->consumed = $myTime->consumed;
|
||||
$newTask->assignedTo = $task->assignedTo;
|
||||
$this->dao->update(TABLE_TASK)->data($newTask)->where('id')->eq((int)$taskID)->exec();
|
||||
|
||||
if($oldTask->assignedTo != $teams[count($teams) - 1]) return common::createChanges($oldTask, $newTask);
|
||||
$task->consumed = $myTime->consumed;
|
||||
}
|
||||
|
||||
if($task->finishedDate == substr($now, 0, 10)) $task->finishedDate = $now;
|
||||
@@ -933,7 +970,7 @@ class taskModel extends model
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($task)
|
||||
->autoCheck()
|
||||
->check('consumed', 'notempty')
|
||||
->batchCheck($this->config->task->finish->requiredFields, 'notempty')
|
||||
->where('id')->eq((int)$taskID)->exec();
|
||||
|
||||
if($task->status == 'done') $this->parentStatus($oldTask->parent, 'done');
|
||||
@@ -1036,6 +1073,12 @@ class taskModel extends model
|
||||
*/
|
||||
public function activate($taskID)
|
||||
{
|
||||
if(strpos($this->config->task->activate->requiredFields, 'comment') !== false and !$this->post->comment)
|
||||
{
|
||||
dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->comment);
|
||||
return false;
|
||||
}
|
||||
|
||||
$oldTask = $this->getById($taskID);
|
||||
$task = fixer::input('post')
|
||||
->setDefault('left', 0)
|
||||
@@ -1048,7 +1091,7 @@ class taskModel extends model
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($task)
|
||||
->autoCheck()
|
||||
->check('left', 'notempty')
|
||||
->batchCheck($this->config->task->activate->requiredFields, 'notempty')
|
||||
->where('id')->eq((int)$taskID)->exec();
|
||||
|
||||
$this->countTime($oldTask->parent);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<form class='form-condensed' method='post' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->task->assignedTo;?></th>
|
||||
<th class='w-70px'><?php echo $lang->task->assignedTo;?></th>
|
||||
<td class='w-p25-f'><?php echo html::select('assignedTo', $members, $task->finishedBy, "class='form-control chosen'");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -23,9 +23,15 @@
|
||||
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->task->hasConsumed;?></th>
|
||||
<th class='w-80px'><?php echo !empty($task->team) ? $lang->task->common.$lang->task->consumed : $lang->task->hasConsumed;?></th>
|
||||
<td class='w-p25-f'> <?php echo $task->consumed;?> <?php echo $lang->workingHour;?></td><td></td>
|
||||
</tr>
|
||||
<?php if(!empty($task->team)):?>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->task->hasConsumed;?></th>
|
||||
<td class='w-p25-f'> <?php echo $task->myConsumed;?> <?php echo $lang->workingHour;?></td><td></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->task->consumed;?></th>
|
||||
<td><div class='input-group'><?php echo html::input('consumed', $task->consumed, "class='form-control' autocomplete='off'");?> <span class='input-group-addon'><?php echo $lang->task->hour;?></span></div></td>
|
||||
|
||||
@@ -54,7 +54,8 @@
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
<?php if($task->status == 'wait' or $task->status =='pause' or $task->status == 'doing'):?>
|
||||
<?php if(in_array($task->status, array('wait', 'pause', 'doing'))):?>
|
||||
<?php if(empty($task->team) || (!empty($task->team) && $task->assignedTo == $this->app->user->account)) :?>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th class="w-id"><?php echo $lang->idAB;?></th>
|
||||
@@ -80,6 +81,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
<?php include '../../common/view/datepicker.html.php';?>
|
||||
<?php js::set('confirmFinish', $lang->task->confirmFinish);?>
|
||||
<?php if(!empty($task->team) && array_keys($task->team)[0] != $this->app->user->account):?>
|
||||
<div class="alert alert-info with-icon">
|
||||
<div class="alert with-icon">
|
||||
<i class="icon-info-sign"></i>
|
||||
<div class="content">
|
||||
<p><?php echo sprintf($lang->task->deniedNotice, array_keys($task->team)[0]);?></p>
|
||||
<p><?php echo $lang->task->deniedNotice;?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php exit;?>
|
||||
|
||||
@@ -486,7 +486,9 @@ class testsuite extends control
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$caseResult = $this->loadModel('testcase')->create($bugID = 0);
|
||||
$this->loadModel('testcase');
|
||||
$this->config->testcase->create->requiredFields = $this->config->testsuite->createcase->requiredFields;
|
||||
$caseResult = $this->testcase->create($bugID = 0);
|
||||
if(!$caseResult or dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
$caseID = $caseResult['id'];
|
||||
|
||||
@@ -612,7 +612,7 @@ class testsuiteModel extends model
|
||||
$cases[$key] = $caseData;
|
||||
}
|
||||
|
||||
$forceReview = $this->testcase->forceReview();
|
||||
$forceNotReview = $this->testcase->forceNotReview();
|
||||
foreach($cases as $key => $caseData)
|
||||
{
|
||||
if(!empty($_POST['id'][$key]) and empty($_POST['insert']))
|
||||
@@ -667,7 +667,7 @@ class testsuiteModel extends model
|
||||
{
|
||||
$caseData->lastEditedBy = $this->app->user->account;
|
||||
$caseData->lastEditedDate = $now;
|
||||
if($stepChanged and $forceReview) $caseData->status = 'wait';
|
||||
if($stepChanged and !$forceNotReview) $caseData->status = 'wait';
|
||||
$this->dao->update(TABLE_CASE)->data($caseData)->where('id')->eq($caseID)->autoCheck()->exec();
|
||||
if($stepChanged)
|
||||
{
|
||||
@@ -700,7 +700,7 @@ class testsuiteModel extends model
|
||||
$caseData->version = 1;
|
||||
$caseData->openedBy = $this->app->user->account;
|
||||
$caseData->openedDate = $now;
|
||||
$caseData->status = $forceReview ? 'wait' : 'normal';
|
||||
$caseData->status = $forceNotReview ? 'normal' : 'wait';
|
||||
$this->dao->insert(TABLE_CASE)->data($caseData)->autoCheck()->exec();
|
||||
|
||||
if(!dao::isError())
|
||||
@@ -768,7 +768,7 @@ class testsuiteModel extends model
|
||||
$cases->pri[$i] = $pri;
|
||||
}
|
||||
|
||||
$forceReview = $this->testcase->forceReview();
|
||||
$forceNotReview = $this->testcase->forceNotReview();
|
||||
for($i = 0; $i < $batchNum; $i++)
|
||||
{
|
||||
if($cases->type[$i] != '' and $cases->title[$i] != '')
|
||||
@@ -785,7 +785,7 @@ class testsuiteModel extends model
|
||||
$data[$i]->keywords = $cases->keywords[$i];
|
||||
$data[$i]->openedBy = $this->app->user->account;
|
||||
$data[$i]->openedDate = $now;
|
||||
$data[$i]->status = $forceReview ? 'wait' : 'normal';
|
||||
$data[$i]->status = $forceNotReview ? 'normal' : 'wait';
|
||||
$data[$i]->version = 1;
|
||||
|
||||
$this->dao->insert(TABLE_CASE)->data($data[$i])
|
||||
|
||||
@@ -66,6 +66,9 @@
|
||||
<div class='input-group w-p100'>
|
||||
<input type='hidden' id='color' name='color' data-provide='colorpicker' data-wrapper='input-group-btn' data-pull-menu-right='false' data-btn-tip='<?php echo $lang->testcase->colorTag ?>' data-update-text='#title'>
|
||||
<?php echo html::input('title', $caseTitle, "class='form-control' autocomplete='off'");?>
|
||||
<?php if(!$this->loadModel('testcase')->forceNotReview()):?>
|
||||
<span class='input-group-addon'><?php echo html::checkbox('forceNotReview', $lang->testcase->forceNotReview, '', "id='forceNotReview'");?></span>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-table'>
|
||||
|
||||
@@ -53,7 +53,6 @@ class tutorial extends control
|
||||
if($_POST && isset($_POST['finish'])) $finish = $_POST['finish'];
|
||||
|
||||
if($finish == 'keepAll') $this->send(array('result' => 'fail', 'message' => $this->lang->tutorial->ajaxSetError));
|
||||
|
||||
$account = $this->app->user->account;
|
||||
$this->session->set('tutorialMode', false);
|
||||
$this->loadModel('setting')->setItem("$account.tutorial.tasks.setting", $finish);
|
||||
@@ -87,6 +86,7 @@ class tutorial extends control
|
||||
{
|
||||
$this->session->set('tutorialMode', false);
|
||||
$this->loadModel('setting')->setItem($this->app->user->account . '.common.global.novice', 0);
|
||||
$this->loadModel('score')->create('tutorial', 'finish');
|
||||
die(json_encode(array('result' => 'success')));
|
||||
}
|
||||
|
||||
@@ -120,12 +120,13 @@ class tutorial extends control
|
||||
* Ajax save novice result.
|
||||
*
|
||||
* @param string $novice
|
||||
* @param string $reload
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxSaveNovice($novice = 'true', $reload = 'false')
|
||||
{
|
||||
if($novice == true) $this->loadModel('score')->create('tutorial','keepAll');
|
||||
$this->loadModel('setting')->setItem($this->app->user->account . '.common.global.novice', $novice == true ? 1 : 0);
|
||||
if($reload == 'true') die(js::reload('parent'));
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ class tutorialModel extends model
|
||||
$member->hours = 7.0;
|
||||
$member->totalHours = 70.0;
|
||||
$member->realname = $this->app->user->realname;
|
||||
$member->limitedUser = 0;
|
||||
$member->limitedUser = 'no';
|
||||
return array($member->account => $member);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ $(function()
|
||||
$modal.addClass('in');
|
||||
$modalBack.addClass('in');
|
||||
}, 10);
|
||||
$.getJSON(createLink('tutorial', 'ajaxQuit'));
|
||||
};
|
||||
|
||||
var hideModal = function()
|
||||
|
||||
Reference in New Issue
Block a user