diff --git a/config/zentaopms.php b/config/zentaopms.php index 4b8f72d147..8bf7fdc792 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -280,5 +280,5 @@ $config->newFeatures = array('introduction', 'tutorial', 'youngBlueTheme'); /* Program privs.*/ $config->programPriv = new stdclass(); -$config->programPriv->scrum = array('projectstory', 'projectrelease', 'project', 'build', 'bug', 'testcase', 'testreport', 'caselib', 'doc', 'repo', 'meeting'); +$config->programPriv->scrum = array('projectstory', 'projectrelease', 'project', 'build', 'bug', 'testcase', 'testreport', 'caselib', 'doc', 'repo', 'meeting', 'stakeholder'); $config->programPriv->waterfall = array_merge($config->programPriv->scrum, array('workestimation', 'durationestimation', 'budget', 'programplan', 'review', 'reviewissue', 'weekly', 'milestone', 'design', 'issue', 'risk', 'opportunity', 'measrecord', 'auditplan', 'trainplan', 'gapanalysis', 'pssp')); diff --git a/module/action/lang/en.php b/module/action/lang/en.php index d8f8cdd729..9767de0ddb 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -498,7 +498,7 @@ $lang->action->label->testtask = 'Request|testtask|view|caseID=%s'; $lang->action->label->testsuite = 'Test Suite|testsuite|view|suiteID=%s'; $lang->action->label->caselib = 'Case Library|caselib|view|libID=%s'; $lang->action->label->todo = 'Todo|todo|view|todoID=%s'; -$lang->action->label->doclib = 'Doc Library|doc|objectLibs|type=%s&objectID=%s&libID=%s&docID=&version=&appendLib=%s'; +$lang->action->label->doclib = 'Doc Library|doc|objectLibs|type=%s&objectID=%s&libID=%s'; $lang->action->label->doc = 'Doc|doc|view|docID=%s'; $lang->action->label->user = 'User|user|view|account=%s'; $lang->action->label->testreport = 'Report|testreport|view|report=%s'; diff --git a/module/action/model.php b/module/action/model.php index 8c289f283e..f665e432e9 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1424,10 +1424,11 @@ class actionModel extends model * @param array $actions * @param string $direction * @param string $type all|today|yesterday|thisweek|lastweek|thismonth|lastmonth + * @param string $orderBy date_desc|date_asc * @access public * @return array */ - public function buildDateGroup($actions, $direction = 'next', $type = 'today') + public function buildDateGroup($actions, $direction = 'next', $type = 'today', $orderBy = 'date_desc') { $dateGroup = array(); foreach($actions as $action) @@ -1455,7 +1456,17 @@ class actionModel extends model } } - if($direction != 'next') $dateGroup = array_reverse($dateGroup); + /* Modify date to the corrret order. */ + if($this->app->rawModule != 'company' and $direction != 'next') + { + $dateGroup = array_reverse($dateGroup); + } + elseif($this->app->rawModule == 'company' and (($direction == 'next' and $orderBy == 'date_asc') or ($direction == 'pre' and $orderBy == 'date_desc'))) + { + $dateGroup = array_reverse($dateGroup); + foreach($dateGroup as $key => $dateItem) $dateGroup[$key] = array_reverse($dateItem); + } + return $dateGroup; } diff --git a/module/backup/lang/en.php b/module/backup/lang/en.php index a0139051a0..2b5109c58b 100644 --- a/module/backup/lang/en.php +++ b/module/backup/lang/en.php @@ -8,14 +8,14 @@ $lang->backup->restore = 'Restore'; $lang->backup->change = 'Edit Expiration'; $lang->backup->changeAB = 'Edit'; $lang->backup->rmPHPHeader = 'Remove PHP header'; -$lang->backup->setting = 'Setting'; +$lang->backup->setting = 'Settings'; -$lang->backup->settingAction = 'Backup Setting'; +$lang->backup->settingAction = 'Backup Settings'; $lang->backup->time = 'Date'; $lang->backup->files = 'Files'; -$lang->backup->allCount = 'All Count'; -$lang->backup->count = 'Backup Count'; +$lang->backup->allCount = 'All Files'; +$lang->backup->count = 'Backup Files'; $lang->backup->size = 'Size'; $lang->backup->status = 'Status'; diff --git a/module/block/model.php b/module/block/model.php index ab34ff2761..6c2acd1c37 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -173,7 +173,7 @@ class blockModel extends model ->andWhere('t2.status')->ne('suspended') ->andWhere('t3.status')->ne('suspended') ->andWhere('t2.type')->eq('project') - ->andWhere('t3.type')->eq('sprint') + ->andWhere('t3.type')->in('sprint,stage') ->andWhere('t1.deleted')->eq(0) ->andWhere('t2.deleted')->eq(0) ->andWhere('t3.deleted')->eq(0) diff --git a/module/company/control.php b/module/company/control.php index ca4c93f11c..1ce38f6366 100644 --- a/module/company/control.php +++ b/module/company/control.php @@ -167,7 +167,7 @@ class company extends control * @param int $productID * @param int $projectID * @param int $executionID - * @param string $orderBy + * @param string $orderBy date_deac|date_asc * @access public * @return void */ @@ -204,7 +204,8 @@ class company extends control $pager = new pager($recTotal, $recPerPage = 50, $pageID = 1); /* Append id for secend sort. */ - $sort = $this->loadModel('common')->appendOrder($orderBy); + $order = $direction == 'next' ? 'date_desc' : 'date_asc'; + $sort = $this->loadModel('common')->appendOrder($order); $queryID = ($browseType == 'bysearch') ? (int)$param : 0; $date = empty($date) ? '' : date('Y-m-d', $date); @@ -289,7 +290,7 @@ class company extends control $this->view->userID = $userID; $this->view->param = $param; $this->view->browseType = $browseType; - $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction, $browseType); + $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction, $browseType, $orderBy); $this->view->direction = $direction; $this->display(); } diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index 3c5bc77f7e..65620af0ed 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -96,8 +96,8 @@ $firstDate = date('Y-m-d', strtotime($firstAction->originalDate) + 24 * 3600); $lastDate = substr($action->originalDate, 0, 10); $hasPre = $this->action->hasPreOrNext($firstDate, 'pre'); $hasNext = $this->action->hasPreOrNext($lastDate, 'next'); -$preLink = $hasPre ? inlink('dynamic', "browseType=$browseType¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . '&direction=pre') : 'javascript:;'; -$nextLink = $hasNext ? inlink('dynamic', "browseType=$browseType¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($lastDate) . '&direction=next') : 'javascript:;'; +$preLink = $hasPre ? inlink('dynamic', "browseType=$browseType¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . "&direction=pre&userID=$userID&productID=$productID&projectID=$projectID&executionID=$executionID&orderBy=$orderBy") : 'javascript:;'; +$nextLink = $hasNext ? inlink('dynamic', "browseType=$browseType¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($lastDate) . "&direction=next&userID=$userID&productID=$productID&projectID=$projectID&executionID=$executionID&orderBy=$orderBy") : 'javascript:;'; ?>
diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index 5ff823d2c8..34e75a84cf 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -31,15 +31,17 @@ $lang->execution->canceledDate = 'CanceledDate'; $lang->execution->begin = 'Begin'; $lang->execution->end = 'End'; $lang->execution->dateRange = 'Duration'; -$lang->execution->realBegan = 'Actual start'; -$lang->execution->realEnd = 'Actual end'; +$lang->execution->realBeganAB = 'Actual Begin'; +$lang->execution->realEndAB = 'Actual End'; +$lang->execution->realBegan = 'Actual Begin'; +$lang->execution->realEnd = 'Actual End'; $lang->execution->to = 'To'; -$lang->execution->days = 'Available Days'; +$lang->execution->days = ' Days'; $lang->execution->day = ' Days'; $lang->execution->workHour = ' Hours'; $lang->execution->workHourUnit = 'H'; -$lang->execution->totalHours = 'Available Hours'; -$lang->execution->totalDays = 'Available Days'; +$lang->execution->totalHours = ' Hours'; +$lang->execution->totalDays = ' Days'; $lang->execution->status = $lang->executionCommon . 'Status'; $lang->execution->execStatus = 'Status'; $lang->execution->subStatus = 'Sub Status'; @@ -351,6 +353,10 @@ $lang->execution->unfinishedExecution = "This {$lang->executionCommon} h $lang->execution->unfinishedTask = "[%s] unfinished tasks. "; $lang->execution->unresolvedBug = "[%s] unresolved bugs. "; $lang->execution->projectNotEmpty = 'Project cannot be empty.'; +$lang->execution->realBeganNotEmpty = 'Actual Begin should not be empty.'; +$lang->execution->realBeganNotFuture = 'Actual Begin should be < = today.'; +$lang->execution->realEndNotEmpty = 'Actual End should not be empty.'; +$lang->execution->realEndNotFuture = 'Actual End should be < = today.'; /* Statistics. */ $lang->execution->charts = new stdclass(); diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 6213a08bf4..2e1a39d7ef 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -31,8 +31,10 @@ $lang->execution->canceledDate = '取消日期'; $lang->execution->begin = '计划开始'; $lang->execution->end = '计划完成'; $lang->execution->dateRange = '起始日期'; -$lang->execution->realBegan = '实际开始'; -$lang->execution->realEnd = '实际完成'; +$lang->execution->realBeganAB = '实际开始'; +$lang->execution->realEndAB = '实际完成'; +$lang->execution->realBegan = '实际开始日期'; +$lang->execution->realEnd = '实际完成日期'; $lang->execution->to = '至'; $lang->execution->days = '可用工作日'; $lang->execution->day = '天'; @@ -351,6 +353,11 @@ $lang->execution->unfinishedExecution = "该{$lang->executionCommon}下 $lang->execution->unfinishedTask = "[%s]个未完成的任务,"; $lang->execution->unresolvedBug = "[%s]个未解决的bug,"; $lang->execution->projectNotEmpty = '所属项目不能为空。'; +$lang->execution->realBeganNotEmpty = "实际开始不能为空。"; +$lang->execution->realBeganNotFuture = "实际开始不能大于当前日期。"; +$lang->execution->realEndNotEmpty = "实际完成不能为空。"; +$lang->execution->realEndNotFuture = "实际完成不能大于当前日期。"; + /* 统计。*/ $lang->execution->charts = new stdclass(); diff --git a/module/execution/model.php b/module/execution/model.php index b9bfe0d9f1..b31e98d682 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -700,14 +700,24 @@ class executionModel extends model $now = helper::now(); $execution = fixer::input('post') - ->add('realBegan', helper::today()) ->setDefault('status', 'doing') ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) ->remove('comment')->get(); + + if($execution->realBegan == '') + { + dao::$errors['realBegan'] = $this->lang->execution->realBeganNotEmpty; + return false; + } + if($execution->realBegan > helper::today()) + { + dao::$errors['realBegan'] = $this->lang->execution->realBeganNotFuture; + return false; + } $this->dao->update(TABLE_EXECUTION)->data($execution)->autoCheck()->where('id')->eq((int)$executionID)->exec(); - + if(!dao::isError()) return common::createChanges($oldExecution, $execution); } @@ -779,6 +789,7 @@ class executionModel extends model $now = helper::now(); $execution = fixer::input('post') + ->setDefault('realEnd', '') ->setDefault('status', 'doing') ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) @@ -848,18 +859,30 @@ class executionModel extends model $execution = fixer::input('post') ->setDefault('status', 'closed') - ->setDefault('realEnd', helper::today()) ->setDefault('closedBy', $this->app->user->account) ->setDefault('closedDate', $now) ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) ->remove('comment') ->get(); + + if($execution->realEnd == '') + { + dao::$errors['realEnd'] = $this->lang->execution->realEndNotEmpty; + return false; + } + + if($execution->realEnd > helper::today()) + { + dao::$errors['realEnd'] = $this->lang->execution->realEndNotFuture; + return false; + } $this->dao->update(TABLE_EXECUTION)->data($execution) ->autoCheck() ->where('id')->eq((int)$executionID) ->exec(); + if(!dao::isError()) { $this->loadModel('score')->create('execution', 'close', $oldExecution); diff --git a/module/execution/view/close.html.php b/module/execution/view/close.html.php index cd2f0062bf..11ebcd1ed4 100644 --- a/module/execution/view/close.html.php +++ b/module/execution/view/close.html.php @@ -30,6 +30,14 @@ printExtendFields($execution, 'table');?> + + execution->realEnd;?> + +
+ realEnd) && $execution->realEnd != '0000-00-00' ? $execution->realEnd : date('Y-m-d')), "class='form-control form-date' required");?> +
+ + comment;?> diff --git a/module/execution/view/start.html.php b/module/execution/view/start.html.php index b45485f913..8a67e8954b 100644 --- a/module/execution/view/start.html.php +++ b/module/execution/view/start.html.php @@ -26,6 +26,14 @@ printExtendFields($execution, 'table', 'columns=2');?> + + + + diff --git a/module/execution/view/view.html.php b/module/execution/view/view.html.php index 4b1a0b8932..99bc17355d 100644 --- a/module/execution/view/view.html.php +++ b/module/execution/view/view.html.php @@ -238,13 +238,13 @@ - + - + diff --git a/module/mail/model.php b/module/mail/model.php index 35d893a5f2..4204f67953 100644 --- a/module/mail/model.php +++ b/module/mail/model.php @@ -292,9 +292,10 @@ class mailModel extends model } /* Remove deleted users. */ - $users = $this->loadModel('user')->getPairs('nodeleted|all'); - foreach($toList as $key => $to) if(!isset($users[trim($to)])) unset($toList[$key]); - foreach($ccList as $key => $cc) if(!isset($users[trim($cc)])) unset($ccList[$key]); + $users = $this->loadModel('user')->getPairs('nodeleted|all'); + $blockUsers = isset($this->config->message->blockUser) ? explode(',', $this->config->message->blockUser) : array(); + foreach($toList as $key => $to) if(!isset($users[trim($to)]) or in_array(trim($to), $blockUsers)) unset($toList[$key]); + foreach($ccList as $key => $cc) if(!isset($users[trim($cc)]) or in_array(trim($cc), $blockUsers)) unset($ccList[$key]); if(!$toList and !$ccList) return; if(!$toList and $ccList) $toList = array(array_shift($ccList)); diff --git a/module/message/control.php b/module/message/control.php index dc63edc9d6..f791f5e9aa 100644 --- a/module/message/control.php +++ b/module/message/control.php @@ -84,7 +84,9 @@ class message extends control { $data = fixer::input('post')->get(); $data->messageSetting = !empty($data->messageSetting) ? json_encode($data->messageSetting) : ''; + $data->blockUser = !empty($data->blockUser) ? implode(',', $data->blockUser) : ''; $this->loadModel('setting')->setItem('system.message.setting', $data->messageSetting); + $this->loadModel('setting')->setItem('system.message.blockUser', $data->blockUser); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload')); } @@ -95,7 +97,7 @@ class message extends control $this->view->position[] = $this->lang->message->common; $this->view->position[] = $this->lang->message->setting; - $users = $this->loadModel('user')->getPairs('noletter'); + $users = $this->loadModel('user')->getPairs('noletter,noclosed'); unset($users['']); $this->view->users = $users; diff --git a/module/message/lang/en.php b/module/message/lang/en.php index 1614a1243b..88fa9bf34e 100644 --- a/module/message/lang/en.php +++ b/module/message/lang/en.php @@ -1,8 +1,9 @@ message->common = 'Notification'; -$lang->message->index = 'Home'; -$lang->message->setting = 'Settings'; -$lang->message->browser = 'Browser Notification'; +$lang->message->common = 'Notification'; +$lang->message->index = 'Home'; +$lang->message->setting = 'Settings'; +$lang->message->browser = 'Browser Notification'; +$lang->message->blockUser = 'Block User'; $lang->message->typeList['mail'] = 'Email'; $lang->message->typeList['message'] = 'Browser Notifications'; diff --git a/module/message/lang/zh-cn.php b/module/message/lang/zh-cn.php index eb458ddb64..600d5ff70c 100644 --- a/module/message/lang/zh-cn.php +++ b/module/message/lang/zh-cn.php @@ -1,8 +1,9 @@ message->common = '消息'; -$lang->message->index = '首页'; -$lang->message->setting = '设置'; -$lang->message->browser = '浏览器通知'; +$lang->message->common = '消息'; +$lang->message->index = '首页'; +$lang->message->setting = '设置'; +$lang->message->browser = '浏览器通知'; +$lang->message->blockUser = '不通知人员'; $lang->message->typeList['mail'] = '邮件'; $lang->message->typeList['message'] = '浏览器通知'; diff --git a/module/message/view/setting.html.php b/module/message/view/setting.html.php index 6b062ae12d..d059b229d7 100644 --- a/module/message/view/setting.html.php +++ b/module/message/view/setting.html.php @@ -74,6 +74,10 @@ + + + + diff --git a/module/my/view/dynamic.html.php b/module/my/view/dynamic.html.php index de3a76491f..5546dd3f2b 100644 --- a/module/my/view/dynamic.html.php +++ b/module/my/view/dynamic.html.php @@ -60,7 +60,7 @@ objectType == 'meeting') $tab = $action->project ? "data-app='project'" : "data-app='my'";?> maxVersion) and strpos($config->action->assetType, $action->objectType) !== false) or empty($action->objectName)) + if((isset($config->maxVersion) and strpos($config->action->assetType, $action->objectType) !== false) and empty($action->objectName)) { echo '#' . $action->objectID; } diff --git a/module/program/lang/en.php b/module/program/lang/en.php index 34135a8a11..bf56083fe5 100644 --- a/module/program/lang/en.php +++ b/module/program/lang/en.php @@ -24,7 +24,7 @@ $lang->program->canceledBy = 'CanceledBy'; $lang->program->canceledDate = 'CanceledDate'; $lang->program->team = 'Team'; $lang->program->order = 'Rank'; -$lang->program->days = 'Available Days'; +$lang->program->days = 'Days'; $lang->program->acl = 'Access Control'; $lang->program->whitelist = 'WhiteList'; $lang->program->deleted = 'Deleted'; diff --git a/module/programplan/lang/en.php b/module/programplan/lang/en.php index ab774d4154..de70969dc4 100644 --- a/module/programplan/lang/en.php +++ b/module/programplan/lang/en.php @@ -23,17 +23,17 @@ $lang->programplan->emptyParent = 'N/A'; $lang->programplan->name = 'Stage Name'; $lang->programplan->subStageName = 'Sub Stage Name'; $lang->programplan->percent = 'Workload Ratio'; -$lang->programplan->percentAB = 'Workload Ratio'; +$lang->programplan->percentAB = 'Ratio'; $lang->programplan->planPercent = 'Workload'; -$lang->programplan->attribute = 'Stage Type'; +$lang->programplan->attribute = 'Type'; $lang->programplan->milestone = 'Milestone'; $lang->programplan->taskProgress = 'Task Progress'; $lang->programplan->task = 'Task'; $lang->programplan->begin = 'Begin'; $lang->programplan->end = 'End'; -$lang->programplan->realBegan = 'Actual Started'; +$lang->programplan->realBegan = 'Actual Start'; $lang->programplan->realEnd = 'Actual End'; -$lang->programplan->ac = 'Actual cost'; +$lang->programplan->ac = 'Actual Cost'; $lang->programplan->sv = 'Schedule Variance'; $lang->programplan->cv = 'Cost Variance'; $lang->programplan->planDateRange = 'Planned Start'; @@ -48,7 +48,7 @@ $lang->programplan->version = 'Version'; $lang->programplan->full = 'Full Screen'; $lang->programplan->today = 'Today'; $lang->programplan->exporting = 'Exporting'; -$lang->programplan->exportFail = 'Export failed'; +$lang->programplan->exportFail = 'Failed'; $lang->programplan->hideCriticalPath = 'Hide Critical Path'; $lang->programplan->showCriticalPath = 'Show Critical Path'; $lang->programplan->errorEnd = "Project end date: %s, end date should be <= project end date."; @@ -61,7 +61,7 @@ $lang->programplan->noData = 'No Data'; $lang->programplan->children = 'Sub Plan'; $lang->programplan->childrenAB = 'Child'; $lang->programplan->confirmDelete = 'Do you want to delete the current plan?'; -$lang->programplan->workloadTips = 'The proportion of the sub stage workload is divided by 100%.'; +$lang->programplan->workloadTips = 'The workload of the sub stage is divided by 100%.'; $lang->programplan->stageCustom = new stdClass(); $lang->programplan->stageCustom->date = 'Show Date'; @@ -71,5 +71,5 @@ $lang->programplan->error = new stdclass(); $lang->programplan->error->percentNumber = '"Workload %" must be digits.'; $lang->programplan->error->planFinishSmall = 'The "End" date must be > the "Begin" date.'; $lang->programplan->error->percentOver = 'The sum of "Workload %" cannot exceed 100%.'; -$lang->programplan->error->createdTask = 'The task has been decomposed. Sub phases cannot be added.'; -$lang->programplan->error->parentWorkload = 'The sum of the workload of the child phase cannot be greater than that of the parent phase: %s.'; +$lang->programplan->error->createdTask = 'The task is decomposed. Sub stages cannot be added.'; +$lang->programplan->error->parentWorkload = 'The sum of the workload in the sub stage cannot be > that in the parent stage: %s.'; diff --git a/module/project/config.php b/module/project/config.php index 0ef78e1687..86c1da61db 100644 --- a/module/project/config.php +++ b/module/project/config.php @@ -112,4 +112,5 @@ $config->project->datatable->fieldList['actions']['required'] = 'yes'; $config->project->datatable->fieldList['actions']['pri'] = '1'; $config->project->removePriv['project'] = array('browse', 'kanban', 'create', 'batchEdit', 'qa', 'updateOrder', 'createGuide', 'programTitle'); +$config->project->removePriv['bug'] = array('batchChangePlan'); $config->project->removePriv['doc'] = array('catalog', 'index'); diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 26995676bb..95e4c82b59 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -108,8 +108,10 @@ $lang->project->surplus = 'Left'; $lang->project->progress = 'Progress'; $lang->project->dateRange = 'Duration'; $lang->project->to = ' to '; +$lang->project->realBeganAB = 'Actual Begin'; +$lang->project->realEndAB = 'Actual End'; +$lang->project->realBegan = 'Actual Begin'; $lang->project->realEnd = 'Actual End'; -$lang->project->realBegan = 'Actual Began'; $lang->project->bygrid = 'Kanban'; $lang->project->bylist = 'List'; $lang->project->bycard = 'Card'; @@ -146,7 +148,7 @@ $lang->project->teamSumCount = '%s people in total'; $lang->project->longTime = 'Long-Term Program'; $lang->project->future = 'TBD'; $lang->project->moreProject = 'More Project'; -$lang->project->days = 'Available Days'; +$lang->project->days = 'Days'; $lang->project->mailto = 'Mailto'; $lang->project->etc = " , etc"; $lang->project->product = 'Product'; @@ -177,6 +179,9 @@ $lang->project->createExecution = "There is no {$lang->executionCommon} u $lang->project->unlinkExecutionMember = "The user participated in %s executions such as %s%s. Do you want to remove the user from those executions as well? (The data related to this user will not be deleted.)"; $lang->project->unlinkExecutionMembers = "The team members you are removing are also in the execution team of this project. Do you want to remove them from the execution team too?"; +$lang->project->realEndNotEmpty = 'Actual End should not be empty.'; +$lang->project->realEndNotFuture = 'Actual End should be < = today.'; + $lang->project->tenThousand = ''; $lang->project->unitList['CNY'] = 'RMB'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 4c83291870..ddc6701344 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -108,8 +108,10 @@ $lang->project->surplus = '剩余'; $lang->project->progress = '进度'; $lang->project->dateRange = '起止日期'; $lang->project->to = '至'; -$lang->project->realEnd = '实际完成日期'; +$lang->project->realBeganAB = '实际开始'; +$lang->project->realEndAB = '实际完成'; $lang->project->realBegan = '实际开始日期'; +$lang->project->realEnd = '实际完成日期'; $lang->project->bygrid = '看板'; $lang->project->bylist = '列表'; $lang->project->bycard = '卡片'; @@ -177,6 +179,9 @@ $lang->project->createExecution = "该项目下没有{$lang->executionCom $lang->project->unlinkExecutionMember = "该用户参与了%s%s%s个{$lang->execution->common},是否同时将其移除?(该用户所产生的数据不会受影响。)"; $lang->project->unlinkExecutionMembers = "移除的团队成员还参与了项目下的执行,是否同步从执行团队中移除?"; +$lang->project->realEndNotEmpty = "实际完成不能为空。"; +$lang->project->realEndNotFuture = "实际完成不能大于当前日期。"; + $lang->project->tenThousand = '万'; $lang->project->unitList['CNY'] = '人民币'; diff --git a/module/project/model.php b/module/project/model.php index 429042aef1..55c01170be 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1206,6 +1206,7 @@ class projectModel extends model $now = helper::now(); $project = fixer::input('post') + ->setDefault('realEnd','') ->setDefault('status', 'doing') ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) @@ -1282,10 +1283,22 @@ class projectModel extends model ->remove('comment') ->get(); + if($project->realEnd == '') + { + dao::$errors['realEnd'] = $this->lang->project->realEndNotEmpty; + return false; + } + if($project->realEnd > helper::today()) + { + dao::$errors['realEnd'] = $this->lang->project->realEndNotFuture; + return false; + } + $this->dao->update(TABLE_PROJECT)->data($project) ->autoCheck() ->where('id')->eq((int)$projectID) ->exec(); + if(!dao::isError()) { $this->loadModel('score')->create('project', 'close', $oldProject); diff --git a/module/project/view/close.html.php b/module/project/view/close.html.php index 9cdb9c957e..0fd52dabdd 100644 --- a/module/project/view/close.html.php +++ b/module/project/view/close.html.php @@ -30,6 +30,14 @@ printExtendFields($project, 'table');?> + + + + diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index 9d938a30fd..7c10b7262d 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -178,25 +178,31 @@ - - + + - - + + + + - - + + + + + +
execution->realBegan;?> +
+ realBeganDate) && $execution->realBegan != '0000-00-00' ? $execution->realBegan : date('Y-m-d')), "class='form-control form-date' required");?> +
+
comment;?>
execution->begin;?> begin;?>execution->realBegan;?>execution->realBeganAB;?> realBegan == '0000-00-00' ? '' : $execution->realBegan;?>
execution->end;?> end;?>execution->realEnd;?>execution->realEndAB;?> realEnd == '0000-00-00' ? '' : $execution->realEnd;?>
message->blockUser;?>message->blockUser) ? $config->message->blockUser: '', "class='form-control chosen' multiple");?>
project->realEnd;?> +
+ realEnd) && $project->realEnd != '0000-00-00' ? $project->realEnd : date('Y-m-d')), "class='form-control form-date' required");?> +
+
comment;?>
project->begin;?> begin;?>execution->totalEstimate;?>totalEstimate . $lang->execution->workHour;?>project->realBeganAB;?>realBegan == '0000-00-00' ? '' : $project->realBegan;?>
project->end;?> end;?>execution->totalConsumed;?>totalConsumed . $lang->execution->workHour;?>project->realEndAB;?>realEnd == '0000-00-00' ? '' : $project->realEnd;?>
execution->totalEstimate;?>totalEstimate . $lang->execution->workHour;?> execution->totalDays;?> days;?>execution->totalLeft;?>totalLeft . $lang->execution->workHour;?>
execution->totalConsumed;?>totalConsumed . $lang->execution->workHour;?> execution->totalHours;?> totalHours . $lang->execution->workHour;?>
execution->totalLeft;?>totalLeft . $lang->execution->workHour;?>
diff --git a/module/repo/lang/en.php b/module/repo/lang/en.php index da7c51712f..1c58036410 100644 --- a/module/repo/lang/en.php +++ b/module/repo/lang/en.php @@ -133,7 +133,7 @@ $lang->repo->scmList['Subversion'] = 'SVN'; $lang->repo->gitlabHost = 'Gitlab Host'; $lang->repo->gitlabToken = 'Gitlab Token'; -$lang->repo->gitlabProject = 'Projects'; +$lang->repo->gitlabProject = 'Project'; $lang->repo->placeholder = new stdclass; $lang->repo->placeholder->gitlabHost = 'Input url of gitlab'; diff --git a/module/tree/lang/en.php b/module/tree/lang/en.php index 2da5813be5..9b8e08da48 100644 --- a/module/tree/lang/en.php +++ b/module/tree/lang/en.php @@ -29,7 +29,7 @@ $lang->tree->updateOrder = 'Rank Module'; $lang->tree->manageChild = 'Manage Child Modules'; $lang->tree->manageStoryChild = 'Manage Child Modules'; $lang->tree->manageLineChild = "Manage {$lang->productCommon} Line"; -$lang->tree->manageBugChild = 'Manage Child Bugs'; +$lang->tree->manageBugChild = 'Manage Child Modules of Bugs'; $lang->tree->manageCaseChild = 'Manage Child Cases'; $lang->tree->manageCaselibChild = 'Manage Child Libraries'; $lang->tree->manageTaskChild = "Manage Child {$lang->executionCommon} Modules";