diff --git a/module/bug/control.php b/module/bug/control.php index 685340f81d..4b7b5632d0 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -147,7 +147,7 @@ class bug extends control $this->view->param = $param; $this->view->orderBy = $orderBy; $this->view->moduleID = $moduleID; - $this->view->memberPairs = $this->user->getPairs('noletter'); + $this->view->memberPairs = $this->user->getPairs('noletter|nodeleted'); $this->view->branch = $branch; $this->view->branches = $this->loadModel('branch')->getPairs($productID); $this->view->setShowModule = true; @@ -205,7 +205,7 @@ class bug extends control */ public function create($productID, $branch = '', $extras = '') { - $this->view->users = $this->user->getPairs('devfirst|noclosed'); + $this->view->users = $this->user->getPairs('devfirst|noclosed|nodeleted'); if(empty($this->products)) $this->locate($this->createLink('product', 'create')); $this->app->loadLang('release'); @@ -423,7 +423,7 @@ class bug extends control $this->view->productID = $productID; $this->view->stories = $stories; $this->view->builds = $builds; - $this->view->users = $this->user->getPairs('devfirst'); + $this->view->users = $this->user->getPairs('devfirst|nodeleted'); $this->view->projects = $this->product->getProjectPairs($productID, $branch ? "0,$branch" : 0, $params = 'nodeleted'); $this->view->projectID = $projectID; $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch); @@ -576,7 +576,7 @@ class bug extends control $this->view->stories = $bug->project ? $this->story->getProjectStoryPairs($bug->project) : $this->story->getProductStoryPairs($bug->product, $bug->branch); $this->view->branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product); $this->view->tasks = $this->task->getProjectTaskPairs($bug->project); - $this->view->users = $this->user->getPairs('', "$bug->assignedTo,$bug->resolvedBy,$bug->closedBy,$bug->openedBy"); + $this->view->users = $this->user->getPairs('nodeleted', "$bug->assignedTo,$bug->resolvedBy,$bug->closedBy,$bug->openedBy"); $this->view->openedBuilds = $openedBuilds; $this->view->resolvedBuilds = array('' => '') + $openedBuilds + $oldResolvedBuild; $this->view->actions = $this->action->getList('bug', $bugID); @@ -685,7 +685,7 @@ class bug extends control $appendUsers[$bug->assignedTo] = $bug->assignedTo; $appendUsers[$bug->resolvedBy] = $bug->resolvedBy; } - $users = $this->user->getPairs('devfirst', $appendUsers); + $users = $this->user->getPairs('devfirst|nodeleted', $appendUsers); $users = array('' => '', 'ditto' => $this->lang->bug->ditto) + $users; /* Assign. */ @@ -738,7 +738,7 @@ class bug extends control $this->view->title = $this->products[$bug->product] . $this->lang->colon . $this->lang->bug->assignedTo; $this->view->position[] = $this->lang->bug->assignedTo; - $this->view->users = $this->user->getPairs('', $bug->assignedTo); + $this->view->users = $this->user->getPairs('nodeleted', $bug->assignedTo); $this->view->bug = $bug; $this->view->bugID = $bugID; $this->view->actions = $this->action->getList('bug', $bugID); @@ -828,7 +828,7 @@ class bug extends control $this->view->position[] = $this->lang->bug->confirmBug; $this->view->bug = $bug; - $this->view->users = $this->user->getPairs('', $bug->assignedTo); + $this->view->users = $this->user->getPairs('nodeleted', $bug->assignedTo); $this->view->actions = $this->action->getList('bug', $bugID); $this->display(); } @@ -960,7 +960,7 @@ class bug extends control $this->view->position[] = $this->lang->bug->activate; $this->view->bug = $bug; - $this->view->users = $this->user->getPairs('', $bug->resolvedBy); + $this->view->users = $this->user->getPairs('nodeleted', $bug->resolvedBy); $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $bug->branch, 'noempty'); $this->view->actions = $this->action->getList('bug', $bugID); @@ -1283,6 +1283,7 @@ class bug extends control * AJAX: get team members of the latest project of a product as assignedTo list. * * @param int $productID + * x * @param string $selectedUser * @access public * @return string @@ -1296,7 +1297,7 @@ class bug extends control } else { - $projectMembers = $this->loadModel('user')->getPairs('devfirst|noclosed'); + $projectMembers = $this->loadModel('user')->getPairs('devfirst|noclosed|nodeleted'); } die(html::select('assignedTo', $projectMembers, $selectedUser, 'class="form-control"')); diff --git a/module/bug/model.php b/module/bug/model.php index afd6ecbeac..eb92324173 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -455,7 +455,7 @@ class bugModel extends model */ public function getModuleOwner($moduleID, $productID) { - $users = $this->loadModel('user')->getPairs(); + $users = $this->loadModel('user')->getPairs('nodeleted'); if($moduleID) { diff --git a/module/build/control.php b/module/build/control.php index cd9828f6b3..c8a5bd1fed 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -77,7 +77,7 @@ class build extends control $this->view->products = $products; $this->view->lastBuild = $this->build->getLast($projectID); $this->view->productGroups = $productGroups; - $this->view->users = $this->user->getPairs(); + $this->view->users = $this->user->getPairs('nodeleted'); $this->display(); } diff --git a/module/company/control.php b/module/company/control.php index 61a0c52f08..61da51076a 100644 --- a/module/company/control.php +++ b/module/company/control.php @@ -189,7 +189,7 @@ class company extends control $this->view->projects = $projects; /* Get users.*/ - $users = $this->loadModel('user')->getPairs('noclosed'); + $users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); $users[''] = $this->lang->company->user; $this->view->users = $users; diff --git a/module/custom/control.php b/module/custom/control.php index 5c1c67f003..df5c1f6192 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -49,7 +49,7 @@ class custom extends control if(($module == 'story' or $module == 'testcase') and $field == 'review') { $this->app->loadConfig($module); - $this->view->users = $this->loadModel('user')->getPairs('noclosed'); + $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); $this->view->needReview = zget($this->config->$module, 'needReview', 1); $this->view->forceReview = zget($this->config->$module, 'forceReview', ''); } @@ -72,6 +72,11 @@ class custom extends control $this->view->blockPairs = $this->block->getClosedBlockPairs($closedBlock); $this->view->closedBlock = $closedBlock; } + if($module == 'user' and $field == 'deleted') + { + $this->loadModel('user'); + $this->view->showDeleted = isset($this->config->user->showDeleted) ? $this->config->user->showDeleted : '0'; + } if(strtolower($_SERVER['REQUEST_METHOD']) == "post") { @@ -93,6 +98,11 @@ class custom extends control $data = fixer::input('post')->join('closed', ',')->get(); $this->loadModel('setting')->setItem('system.block.closed', zget($data, 'closed', '')); } + elseif($module == 'user' and $field == 'deleted') + { + $data = fixer::input('post')->get(); + $this->loadModel('setting')->setItem('system.user.showDeleted', $data->showDeleted); + } else { $lang = $_POST['lang']; diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index 06f5dab0e2..b3959833e4 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -67,8 +67,9 @@ $lang->custom->todo->fields['typeList'] = 'Type'; $lang->custom->todo->fields['statusList'] = 'Status'; $lang->custom->user = new stdClass(); -$lang->custom->user->fields['roleList'] = 'Role'; -$lang->custom->user->fields['statusList'] = 'Status'; +$lang->custom->user->fields['roleList'] = 'Role'; +$lang->custom->user->fields['statusList'] = 'Status'; +$lang->custom->user->fields['deleted'] = 'Show deleted user'; $lang->custom->block->fields['closed'] = 'Closed Block'; @@ -94,6 +95,9 @@ $lang->custom->forceReview = 'Review Required'; $lang->custom->reviewList[1] = 'On'; $lang->custom->reviewList[0] = 'Off'; +$lang->custom->deletedList[1] = 'Show'; +$lang->custom->deletedList[0] = 'Not Show'; + $lang->custom->workingHours = 'Man-Hour/Day'; $lang->custom->weekend = 'Weekend'; $lang->custom->weekendList[2] = '2-Day Off'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index b1520e59b0..0983985fdf 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -69,6 +69,7 @@ $lang->custom->todo->fields['statusList'] = '状态'; $lang->custom->user = new stdClass(); $lang->custom->user->fields['roleList'] = '职位'; $lang->custom->user->fields['statusList'] = '状态'; +$lang->custom->user->fields['deleted'] = '列出已删除用户'; $lang->custom->block->fields['closed'] = '关闭的区块'; @@ -94,6 +95,9 @@ $lang->custom->forceReview = '强制评审'; $lang->custom->reviewList[1] = '开启'; $lang->custom->reviewList[0] = '关闭'; +$lang->custom->deletedList[1] = '列出'; +$lang->custom->deletedList[0] = '不列出'; + $lang->custom->workingHours = '每天可用工时'; $lang->custom->weekend = '休息日'; $lang->custom->weekendList[2] = '双休'; diff --git a/module/custom/view/set.html.php b/module/custom/view/set.html.php index 5de05c4d01..f30a188cba 100644 --- a/module/custom/view/set.html.php +++ b/module/custom/view/set.html.php @@ -122,6 +122,17 @@ EOT; + + + + + + + + + + +
custom->user->fields['deleted'];?>custom->deletedList, $showDeleted);?>
diff --git a/module/dept/control.php b/module/dept/control.php index 2cbf52908f..65918fc764 100644 --- a/module/dept/control.php +++ b/module/dept/control.php @@ -91,7 +91,7 @@ class dept extends control } $dept = $this->dept->getById($deptID); - $users = $this->loadModel('user')->getPairs('noletter|noclosed'); + $users = $this->loadModel('user')->getPairs('noletter|noclosed|nodeleted'); $this->view->optionMenu = $this->dept->getOptionMenu(); diff --git a/module/dept/model.php b/module/dept/model.php index d1311aef2e..8c577fc42e 100644 --- a/module/dept/model.php +++ b/module/dept/model.php @@ -423,7 +423,7 @@ class deptModel extends model public function getDataStructure($rootDeptID = 0) { $tree = array_values($this->getSons($rootDeptID)); - $users = $this->loadModel('user')->getPairs('noletter|noclosed'); + $users = $this->loadModel('user')->getPairs('noletter|noclosed|nodeleted'); if(count($tree)) { foreach ($tree as $node) diff --git a/module/doc/model.php b/module/doc/model.php index 14d4c0da74..b28231f121 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -70,8 +70,8 @@ class docModel extends model $selectHtml .= "
"; $selectHtml .= "
"; $selectHtml .= "
"; - if($this->config->global->flow != 'onlyTask') $selectHtml .= "
{$this->lang->doc->libTypeList['product']}
"; - if($this->config->global->flow != 'onlyStory' and $this->config->global->flow != 'onlyTest') $selectHtml .= "
{$this->lang->doc->libTypeList['project']}
{$this->lang->project->statusList['done']}
"; + if($this->config->global->flow != 'onlyTask' and isset($this->lang->doc->libTypeList['product'])) $selectHtml .= "
{$this->lang->doc->libTypeList['product']}
"; + if($this->config->global->flow != 'onlyStory' and $this->config->global->flow != 'onlyTest' and isset($this->lang->doc->libTypeList['project'])) $selectHtml .= "
{$this->lang->doc->libTypeList['project']}
{$this->lang->project->statusList['done']}
"; $selectHtml .= "
{$this->lang->doc->libTypeList['custom']}
"; $selectHtml .= "
"; common::setMenuVars($this->lang->doc->menu, 'list', $selectHtml); diff --git a/module/mail/model.php b/module/mail/model.php index 4fde24dbbf..ba006f17e4 100644 --- a/module/mail/model.php +++ b/module/mail/model.php @@ -288,7 +288,7 @@ class mailModel extends model } /* Remove deleted users. */ - $users = $this->loadModel('user')->getPairs(); + $users = $this->loadModel('user')->getPairs('nodeleted'); 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]); diff --git a/module/my/control.php b/module/my/control.php index 2ad901ab3b..e532e89b17 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -200,7 +200,7 @@ class my extends control $this->view->position[] = $this->lang->my->bug; $this->view->bugs = $bugs; $this->view->users = $this->user->getPairs('noletter'); - $this->view->memberPairs = $this->user->getPairs('noletter'); + $this->view->memberPairs = $this->user->getPairs('noletter|nodeleted'); $this->view->tabID = 'bug'; $this->view->type = $type; $this->view->recTotal = $recTotal; @@ -411,7 +411,7 @@ class my extends control $this->view->mode = $mode; $this->view->lists = $lists; $this->view->listID = $listID; - $this->view->users = $this->user->getPairs('noletter|noempty|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noempty|noclosed|noclosed'); $this->display(); } diff --git a/module/my/view/testcase.html.php b/module/my/view/testcase.html.php index f591ff467b..3050e4c47d 100644 --- a/module/my/view/testcase.html.php +++ b/module/my/view/testcase.html.php @@ -57,7 +57,7 @@ createLink('testcase', 'view', "testcaseID=$caseID&version=$case->version"), sprintf('%03d', $caseID));?> - diff --git a/module/product/control.php b/module/product/control.php index e82a8fec4a..167c787b7f 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -189,7 +189,7 @@ class product extends control $this->view->moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'story', $startModuleID = 0, array('treeModel', 'createStoryLink'), '', $branch); $this->view->parentModules = $this->tree->getParents($moduleID); $this->view->pager = $pager; - $this->view->users = $this->user->getPairs('noletter|pofirst'); + $this->view->users = $this->user->getPairs('noletter|pofirst|nodeleted'); $this->view->orderBy = $orderBy; $this->view->browseType = $browseType; $this->view->modules = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch); @@ -228,9 +228,9 @@ class product extends control $this->view->title = $this->lang->product->create; $this->view->position[] = $this->view->title; $this->view->groups = $this->loadModel('group')->getPairs(); - $this->view->poUsers = $this->loadModel('user')->getPairs('pofirst|noclosed'); - $this->view->qdUsers = $this->loadModel('user')->getPairs('qdfirst|noclosed'); - $this->view->rdUsers = $this->loadModel('user')->getPairs('devfirst|noclosed'); + $this->view->poUsers = $this->loadModel('user')->getPairs('nodeleted|pofirst|noclosed'); + $this->view->qdUsers = $this->loadModel('user')->getPairs('nodeleted|qdfirst|noclosed'); + $this->view->rdUsers = $this->loadModel('user')->getPairs('nodeleted|devfirst|noclosed'); unset($this->lang->product->typeList['']); $this->display(); @@ -272,9 +272,9 @@ class product extends control $this->view->position[] = $this->lang->product->edit; $this->view->product = $product; $this->view->groups = $this->loadModel('group')->getPairs(); - $this->view->poUsers = $this->loadModel('user')->getPairs('pofirst', $product->PO); - $this->view->qdUsers = $this->loadModel('user')->getPairs('qdfirst', $product->QD); - $this->view->rdUsers = $this->loadModel('user')->getPairs('devfirst', $product->RD); + $this->view->poUsers = $this->loadModel('user')->getPairs('nodeleted|pofirst', $product->PO); + $this->view->qdUsers = $this->loadModel('user')->getPairs('nodeleted|qdfirst', $product->QD); + $this->view->rdUsers = $this->loadModel('user')->getPairs('nodeleted|devfirst', $product->RD); unset($this->lang->product->typeList['']); $this->display(); @@ -327,9 +327,9 @@ class product extends control $this->view->position[] = $this->lang->product->batchEdit; $this->view->productIDList = $productIDList; $this->view->products = $products; - $this->view->poUsers = $this->loadModel('user')->getPairs('pofirst', $appendPoUsers); - $this->view->qdUsers = $this->loadModel('user')->getPairs('qdfirst', $appendQdUsers); - $this->view->rdUsers = $this->loadModel('user')->getPairs('devfirst', $appendRdUsers); + $this->view->poUsers = $this->loadModel('user')->getPairs('nodeleted|pofirst', $appendPoUsers); + $this->view->qdUsers = $this->loadModel('user')->getPairs('nodeleted|qdfirst', $appendQdUsers); + $this->view->rdUsers = $this->loadModel('user')->getPairs('nodeleted|devfirst', $appendRdUsers); unset($this->lang->product->typeList['']); $this->display(); @@ -491,7 +491,7 @@ class product extends control /* Assign. */ $this->view->productID = $productID; $this->view->type = $type; - $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted'); $this->view->account = $account; $this->view->orderBy = $orderBy; $this->view->pager = $pager; diff --git a/module/project/control.php b/module/project/control.php index 1f41b50e47..7e342dd956 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -967,10 +967,10 @@ class project extends control $this->view->position = $position; $this->view->projects = $projects; $this->view->project = $project; - $this->view->poUsers = $this->loadModel('user')->getPairs('noclosed,pofirst', $project->PO); - $this->view->pmUsers = $this->user->getPairs('noclosed,pmfirst', $project->PM); - $this->view->qdUsers = $this->user->getPairs('noclosed,qdfirst', $project->QD); - $this->view->rdUsers = $this->user->getPairs('noclosed,devfirst', $project->RD); + $this->view->poUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pofirst', $project->PO); + $this->view->pmUsers = $this->user->getPairs('noclosed|nodeleted|pmfirst', $project->PM); + $this->view->qdUsers = $this->user->getPairs('noclosed|nodeleted|qdfirst', $project->QD); + $this->view->rdUsers = $this->user->getPairs('noclosed|nodeleted|devfirst', $project->RD); $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->allProducts = $allProducts; $this->view->linkedProducts = $linkedProducts; @@ -1027,10 +1027,10 @@ class project extends control $this->view->position[] = $this->lang->project->batchEdit; $this->view->projectIDList = $projectIDList; $this->view->projects = $projects; - $this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed,pmfirst', $appendPmUsers); - $this->view->poUsers = $this->user->getPairs('noclosed,pofirst', $appendPoUsers); - $this->view->qdUsers = $this->user->getPairs('noclosed,qdfirst', $appendQdUsers); - $this->view->rdUsers = $this->user->getPairs('noclosed,devfirst', $appendRdUsers); + $this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $appendPmUsers); + $this->view->poUsers = $this->user->getPairs('noclosed|nodeleted|pofirst', $appendPoUsers); + $this->view->qdUsers = $this->user->getPairs('noclosed|nodeleted|qdfirst', $appendQdUsers); + $this->view->rdUsers = $this->user->getPairs('noclosed|nodeleted|devfirst', $appendRdUsers); $this->display(); } @@ -1546,7 +1546,7 @@ class project extends control $this->loadModel('dept'); $project = $this->project->getById($projectID); - $users = $this->user->getPairs('noclosed,devfirst'); + $users = $this->user->getPairs('noclosed|nodeleted|devfirst'); $roles = $this->user->getUserRoles(array_keys($users)); $deptUsers = $dept === '' ? array() : $this->dept->getDeptUserPairs($dept); $currentMembers = $this->project->getTeamMembers($projectID); @@ -1825,7 +1825,7 @@ class project extends control /* Assign. */ $this->view->projectID = $projectID; $this->view->type = $type; - $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted'); $this->view->account = $account; $this->view->orderBy = $orderBy; $this->view->pager = $pager; diff --git a/module/project/model.php b/module/project/model.php index 8cc46c832f..42bd04c951 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1399,7 +1399,7 @@ class projectModel extends model $users = $this->dao->select('t1.account, t2.realname')->from(TABLE_TEAM)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2')->on('t1.account = t2.account') ->where('t1.project')->eq((int)$projectID) - ->beginIF($params == 'nodeleted') + ->beginIF($params == 'nodeleted' or empty($this->config->user->showDeleted)) ->andWhere('t2.deleted')->eq(0) ->fi() ->fetchPairs(); @@ -1623,6 +1623,12 @@ class projectModel extends model $endTime = strtotime($end); $preValue = 0; $todayTag = 0; + + foreach($sets as $date => $set) + { + if($begin > $date) unset($sets[$date]); + } + for($i = 0; $i < $period; $i++) { $currentTime = strtotime($current); diff --git a/module/report/control.php b/module/report/control.php index e946272610..022a508393 100644 --- a/module/report/control.php +++ b/module/report/control.php @@ -82,7 +82,7 @@ class report extends control $this->view->begin = $begin; $this->view->end = $end; $this->view->bugs = $this->report->getBugs($begin, $end, $product, $project); - $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed'); + $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed|nodeleted'); $this->view->projects = array('' => '') + $this->loadModel('project')->getPairs(); $this->view->products = array('' => '') + $this->loadModel('product')->getPairs(); $this->view->project = $project; @@ -103,7 +103,7 @@ class report extends control $this->view->position[] = $this->lang->report->bugAssign; $this->view->submenu = 'test'; $this->view->assigns = $this->report->getBugAssign(); - $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed'); + $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed|nodeleted'); $this->display(); } @@ -151,7 +151,7 @@ class report extends control $this->view->position[] = $this->lang->report->workload; $this->view->workload = $this->report->getWorkload($dept); - $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed'); + $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed|nodeleted'); $this->view->depts = $this->loadModel('dept')->getOptionMenu(); $this->view->begin = $begin; $this->view->end = date('Y-m-d', strtotime($end) - 24 * 3600); diff --git a/module/sso/control.php b/module/sso/control.php index 4fbe1994ea..2a9bb93d9e 100644 --- a/module/sso/control.php +++ b/module/sso/control.php @@ -191,7 +191,7 @@ class sso extends control die(js::locate(helper::safe64Decode($referer), 'parent')); } $this->view->title = $this->lang->sso->bind; - $this->view->users = $this->user->getPairs('noclosed'); + $this->view->users = $this->user->getPairs('noclosed|nodeleted'); $this->view->data = $ssoData; $this->display(); } @@ -205,7 +205,7 @@ class sso extends control public function getUserPairs() { if(!$this->sso->checkKey()) return false; - $users = $this->loadModel('user')->getPairs('noclosed'); + $users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); die(json_encode($users)); } diff --git a/module/story/control.php b/module/story/control.php index 9865defb61..5263c5713c 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -100,7 +100,7 @@ class story extends control if(!isset($products[$product->id])) $products[$product->id] = $product->name; } - $users = $this->user->getPairs('pdfirst|noclosed'); + $users = $this->user->getPairs('pdfirst|noclosed|nodeleted'); $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch); /* Set menu. */ @@ -358,7 +358,7 @@ class story extends control $this->view->title = $this->lang->story->edit . "STORY" . $this->lang->colon . $this->view->story->title; $this->view->position[] = $this->lang->story->edit; $this->view->story = $story; - $this->view->users = $this->user->getPairs('pofirst', "$story->assignedTo,$story->openedBy,$story->closedBy"); + $this->view->users = $this->user->getPairs('pofirst|nodeleted', "$story->assignedTo,$story->openedBy,$story->closedBy"); $this->view->product = $product; $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($story->product); $this->display(); @@ -471,7 +471,7 @@ class story extends control } /* Set ditto option for users. */ - $users = $this->loadModel('user')->getPairs(); + $users = $this->loadModel('user')->getPairs('nodeleted'); $users = array('' => '', 'ditto' => $this->lang->story->ditto) + $users; /* Set Custom*/ @@ -536,7 +536,7 @@ class story extends control /* Assign. */ $this->view->title = $this->lang->story->change . "STORY" . $this->lang->colon . $this->view->story->title; - $this->view->users = $this->user->getPairs('pofirst', $this->view->story->assignedTo); + $this->view->users = $this->user->getPairs('pofirst|nodeleted', $this->view->story->assignedTo); $this->view->position[] = $this->lang->story->change; $this->view->needReview = ($this->app->user->account == $this->view->product->PO || $this->config->story->needReview == 0) ? "checked='checked'" : ""; $this->display(); @@ -566,7 +566,7 @@ class story extends control /* Assign. */ $this->view->title = $this->lang->story->activate . "STORY" . $this->lang->colon . $this->view->story->title; - $this->view->users = $this->user->getPairs('pofirst', $this->view->story->closedBy); + $this->view->users = $this->user->getPairs('pofirst|nodeleted', $this->view->story->closedBy); $this->view->position[] = $this->lang->story->activate; $this->display(); } @@ -693,7 +693,7 @@ class story extends control $this->view->product = $product; $this->view->story = $story; $this->view->actions = $this->action->getList('story', $storyID); - $this->view->users = $this->loadModel('user')->getPairs('', "$story->lastEditedBy,$story->openedBy"); + $this->view->users = $this->loadModel('user')->getPairs('nodeleted', "$story->lastEditedBy,$story->openedBy"); /* Get the affcected things. */ $this->story->getAffectedScope($this->view->story); diff --git a/module/task/control.php b/module/task/control.php index d115cfd72b..80a39bd23f 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -138,7 +138,7 @@ class task extends control } } - $users = $this->loadModel('user')->getPairs('noclosed'); + $users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); $moduleIdList = $this->tree->getAllChildID($moduleID); $stories = $this->story->getProjectStoryPairs($projectID, 0, 0, $moduleIdList); $members = $this->project->getTeamMemberPairs($projectID, 'nodeleted'); @@ -295,7 +295,7 @@ class task extends control $this->view->position[] = $this->lang->task->common; $this->view->position[] = $this->lang->task->edit; $this->view->stories = $this->story->getProjectStoryPairs($this->view->project->id); - $this->view->users = $this->loadModel('user')->getPairs('', "{$this->view->task->openedBy},{$this->view->task->canceledBy},{$this->view->task->closedBy}"); + $this->view->users = $this->loadModel('user')->getPairs('nodeleted', "{$this->view->task->openedBy},{$this->view->task->canceledBy},{$this->view->task->closedBy}"); $this->view->modules = $this->tree->getTaskOptionMenu($this->view->task->project); $this->display(); } @@ -352,7 +352,7 @@ class task extends control /* Set modules and members. */ $modules = $this->tree->getTaskOptionMenu($projectID); $modules = array('ditto' => $this->lang->task->ditto) + $modules; - $members = $this->project->getTeamMemberPairs($projectID); + $members = $this->project->getTeamMemberPairs($projectID, 'nodeleted'); $members = array('' => '', 'ditto' => $this->lang->task->ditto) + $members; $members['closed'] = 'Closed'; diff --git a/module/testcase/control.php b/module/testcase/control.php index 41b2a8255e..4f4f602061 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -339,7 +339,7 @@ class testcase extends control $this->view->precondition = $precondition; $this->view->keywords = $keywords; $this->view->steps = $steps; - $this->view->users = $this->user->getPairs('noletter|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted'); $this->view->branch = $branch; $this->view->branches = $this->session->currentProductType != 'normal' ? $this->loadModel('branch')->getPairs($productID) : array(); @@ -756,7 +756,7 @@ class testcase extends control die(js::reload('parent.parent')); } - $this->view->users = $this->user->getPairs('noletter|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted'); $this->view->case = $this->testcase->getById($caseID); $this->view->actions = $this->loadModel('action')->getList('case', $caseID); $this->display(); diff --git a/module/testreport/control.php b/module/testreport/control.php index 2f4d85f24a..b699f63ab2 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -91,7 +91,7 @@ class testreport extends control $this->view->objectType = $objectType; $this->view->extra = $extra; $this->view->pager = $pager; - $this->view->users = $this->user->getPairs('noletter|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted'); $this->view->tasks = $tasks; $this->view->projects = $projects; $this->display(); @@ -197,7 +197,7 @@ class testreport extends control $this->view->storySummary = $this->product->summary($stories); $this->view->builds = $builds; - $this->view->users = $this->user->getPairs('noletter|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted'); $this->view->cases = $cases; $this->view->caseSummary = $this->testreport->getResultSummary($tasks, $cases); @@ -307,7 +307,7 @@ class testreport extends control $this->view->storySummary = $this->product->summary($stories); $this->view->builds = $builds; - $this->view->users = $this->user->getPairs('noletter|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted'); $this->view->cases = $cases; $this->view->caseSummary = $this->testreport->getResultSummary($tasks, $cases); @@ -373,7 +373,7 @@ class testreport extends control $this->view->bugs = $report->bugs ? $this->bug->getByList($report->bugs) : array(); $this->view->builds = $builds; $this->view->cases = $cases; - $this->view->users = $this->user->getPairs('noletter|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted'); $this->view->actions = $this->loadModel('action')->getList('testreport', $reportID); $this->view->storySummary = $this->product->summary($stories); diff --git a/module/testreport/model.php b/module/testreport/model.php index 00faf1d8f6..74fe5758bd 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -216,7 +216,7 @@ class testreportModel extends model $bugInfo['bugCreateByCaseRate'] = empty($byCaseNum) ? 0 : round($byCaseNum / count($newBugs) * 100, 2); $this->app->loadLang('bug'); - $users = $this->loadModel('user')->getPairs('noclosed|noletter'); + $users = $this->loadModel('user')->getPairs('noclosed|noletter|nodeleted'); $data = array(); foreach($severityGroups as $severity => $count) { diff --git a/module/testtask/control.php b/module/testtask/control.php index 4c8af44ce9..f6f3fcc08e 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -157,7 +157,7 @@ class testtask extends control $this->view->productID = $productID; $this->view->builds = $builds; $this->view->build = $build; - $this->view->users = $this->loadModel('user')->getPairs('noclosed|qdfirst'); + $this->view->users = $this->loadModel('user')->getPairs('noclosed|qdfirst|nodeleted'); $this->display(); } @@ -286,8 +286,8 @@ class testtask extends control $this->view->productName = $this->products[$productID]; $this->view->task = $task; $this->view->runs = $runs; - $this->view->users = $this->loadModel('user')->getPairs('noclosed,qafirst'); - $this->view->assignedTos = $this->loadModel('user')->getPairs('noclosed,qafirst'); + $this->view->users = $this->loadModel('user')->getPairs('noclosed|qafirst'); + $this->view->assignedTos = $this->loadModel('user')->getPairs('noclosed|nodeleted|qafirst'); $this->view->moduleTree = $this->loadModel('tree')->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createTestTaskLink'), $extra = $taskID); $this->view->browseType = $browseType; $this->view->param = $param; @@ -438,7 +438,7 @@ class testtask extends control $this->view->task = $task; $this->view->projects = $this->product->getProjectPairs($productID); $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, $params = ''); - $this->view->users = $this->loadModel('user')->getPairs('', $task->owner); + $this->view->users = $this->loadModel('user')->getPairs('nodeleted', $task->owner); $this->view->contactLists = $this->user->getContactLists($this->app->user->account, 'withnote'); $this->display(); @@ -565,7 +565,7 @@ class testtask extends control $this->view->position[] = $this->lang->testtask->common; $this->view->position[] = $this->lang->close; $this->view->actions = $actions; - $this->view->users = $this->loadModel('user')->getPairs('noclosed|qdfirst'); + $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted|qdfirst'); $this->view->contactLists = $this->user->getContactLists($this->app->user->account, 'withnote'); $this->display(); } diff --git a/module/tree/control.php b/module/tree/control.php index ec5bf6c6cb..6f76cf21d5 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -221,7 +221,7 @@ class tree extends control $this->view->module = $module; $this->view->type = $type; $this->view->branch = $branch; - $this->view->users = $this->loadModel('user')->getPairs('noclosed', $module->owner); + $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted', $module->owner); $showProduct = strpos('story|bug|case', $type) !== false ? true : false; $this->view->showProduct = $showProduct; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 93922771d2..0e19d7ea62 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -1752,7 +1752,7 @@ class upgradeModel extends model */ public function checkSafeFile() { - if($this->app->getModuleName() == 'upgrade' and $this->app->getMethodName() == 'ajaxupdatefile') return true; + if($this->app->getModuleName() == 'upgrade' and $this->app->getMethodName() == 'ajaxupdatefile') return false; $statusFile = $this->app->getAppRoot() . 'www' . DIRECTORY_SEPARATOR . 'ok.txt'; return (!file_exists($statusFile) or (time() - filemtime($statusFile)) > 3600) ? $statusFile : false; } diff --git a/module/user/config.php b/module/user/config.php index eedb75b09b..b4211a351f 100644 --- a/module/user/config.php +++ b/module/user/config.php @@ -16,3 +16,5 @@ $config->user->custom->batchEditFields = 'dept,join,email,commiter'; $config->user->failTimes = 6; $config->user->lockMinutes = 10; $config->user->batchCreate = 10; + +$config->user->showDeleted = 0; diff --git a/module/user/control.php b/module/user/control.php index 294ee90c2c..0d7eb13536 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -78,7 +78,7 @@ class user extends control /* set menus. */ $this->lang->set('menugroup.user', 'company'); - $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account); $this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->todo; $this->view->position[] = $this->lang->user->todo; @@ -117,7 +117,7 @@ class user extends control /* Set menu. */ $this->lang->set('menugroup.user', 'company'); - $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account); /* Assign. */ $this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->story; @@ -153,7 +153,7 @@ class user extends control /* Set the menu. */ $this->lang->set('menugroup.user', 'company'); - $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account); /* Assign. */ $this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->task; @@ -191,7 +191,7 @@ class user extends control /* Set menu. */ $this->lang->set('menugroup.user', 'company'); - $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account); /* Load the lang of bug module. */ $this->app->loadLang('bug'); @@ -228,7 +228,7 @@ class user extends control /* Set menu. */ $this->lang->set('menugroup.user', 'company'); - $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account); /* Save session. */ $this->session->set('testtaskList', $this->app->getURI(true)); @@ -278,7 +278,7 @@ class user extends control /* Set menu. */ $this->lang->set('menugroup.user', 'company'); - $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account); $cases = array(); if($type == 'case2Him') @@ -320,7 +320,7 @@ class user extends control /* Set the menus. */ $this->loadModel('project'); $this->lang->set('menugroup.user', 'company'); - $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclose'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclose|nodeleted'), $account); $this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->project; $this->view->position[] = $this->lang->user->project; @@ -344,7 +344,7 @@ class user extends control if(empty($account)) $account = $this->app->user->account; /* Set menu. */ - $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclose'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclose|nodeleted'), $account); $user = $this->user->getById($account); @@ -763,7 +763,7 @@ class user extends control { if(!empty($this->config->global->showDemoUsers)) { - $demoUsers = $this->user->getPairs('noletter,noempty,noclosed'); + $demoUsers = $this->user->getPairs('noletter|noempty|noclosed|nodeleted'); $this->view->demoUsers = $demoUsers; } @@ -873,7 +873,7 @@ class user extends control { /* set menus. */ $this->lang->set('menugroup.user', 'company'); - $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account); /* Save session. */ $uri = $this->app->getURI(true); @@ -933,7 +933,7 @@ class user extends control */ public function ajaxGetContactUsers($contactListID) { - $users = $this->user->getPairs('devfirst'); + $users = $this->user->getPairs('devfirst|nodeleted'); if(!$contactListID) return print(html::select('mailto[]', $users, '', "class='form-control' multiple data-placeholder='{$this->lang->chooseUsersToMail}'")); $list = $this->user->getContactListByID($contactListID); return print(html::select('mailto[]', $users, $list->userList, "class='form-control' multiple data-placeholder='{$this->lang->chooseUsersToMail}'")); diff --git a/module/user/model.php b/module/user/model.php index fae5d643c1..13d4e021f2 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -64,7 +64,7 @@ class userModel extends model /** * Get the account=>realname pairs. * - * @param string $params noletter|noempty|noclosed|withguest|pofirst|devfirst|qafirst|pmfirst|realname, can be sets of theme + * @param string $params noletter|noempty|nodeleted|noclosed|withguest|pofirst|devfirst|qafirst|pmfirst|realname, can be sets of theme * @param string $usersToAppended account1,account2 * @access public * @return array @@ -88,7 +88,8 @@ class userModel extends model /* Get raw records. */ $users = $this->dao->select($fields)->from(TABLE_USER) - ->where('deleted')->eq(0) + ->where('1') + ->beginIF(strpos($params, 'nodeleted') !== false or empty($this->config->user->showDeleted))->andWhere('deleted')->eq('0')->fi() ->orderBy($orderBy) ->fetchAll('account'); if($usersToAppended) $users += $this->dao->select($fields)->from(TABLE_USER)->where('account')->in($usersToAppended)->fetchAll('account'); diff --git a/module/user/view/testcase.html.php b/module/user/view/testcase.html.php index 2e2c2b6494..ddcbe69eb0 100755 --- a/module/user/view/testcase.html.php +++ b/module/user/view/testcase.html.php @@ -45,7 +45,7 @@ case : $case->id?> - diff --git a/www/js/jquery/form/zentao.js b/www/js/jquery/form/zentao.js index 3bedb27779..65fb8f6b5c 100644 --- a/www/js/jquery/form/zentao.js +++ b/www/js/jquery/form/zentao.js @@ -49,9 +49,65 @@ $.extend( /* The response.result is success. */ if(response.result == 'success') { - if(typeof(callback) == 'function') return callback(response); - if(response.message) alert(response.message); - if(response.locate) return location.href = response.locate; + if(response.message && response.message.length) + { + submitButton = $(formID).find(':submit'); + var placement = response.placement ? response.placement : 'right'; + submitButton.popover({trigger:'manual', content:response.message, placement:placement}).popover('show'); + submitButton.next('.popover').addClass('popover-success'); + function distroy(){submitButton.popover('destroy')} + setTimeout(distroy,2000); + } + + if($.isFunction(callback)) return callback(response); + + if($('#responser').length && response.message && response.message.length) + { + $('#responser').html(response.message).addClass('red f-12px').show().delay(3000).fadeOut(100); + } + + if(response.closeModal) setTimeout($.zui.closeModal, 1200); + + if(response.callback) + { + var rcall = window[response.callback]; + if($.isFunction(rcall)) + { + if(rcall() === false) return; + } + } + + if(response.locate) + { + if(response.locate == 'loadInModal') + { + var modal = $('.modal'); + setTimeout(function() + { + modal.load(modal.attr('ref'), function(){$(this).find('.modal-dialog').css('width', $(this).data('width')); $.zui.ajustModalPosition()}) + }, 1000); + } + else + { + var reloadUrl = response.locate == 'reload' ? location.href : response.locate; + setTimeout(function(){location.href = reloadUrl;}, 1200); + } + } + + if(response.ajaxReload) + { + var $target = $(response.ajaxReload); + if($target.length === 1) + { + $target.load(document.location.href + ' ' + response.ajaxReload, function() + { + $target.dataTable(); + $target.find('[data-toggle="modal"]').modalTrigger(); + }); + } + } + + return true; } /**
testcase->priList, $case->pri, $case->pri)?>'>testcase->priList, $case->pri, $case->pri)?> + testcase->priList, $case->pri, $case->pri)?>'>testcase->priList, $case->pri, $case->pri)?> createLink('testcase', 'view', "testcaseID=$caseID&version=$case->version"), $case->title, null, "style='color: $case->color'");?> testcase->typeList[$case->type];?> openedBy];?>
createLink('testcase', 'view', "testcaseID=$caseID&version=$case->version"), sprintf('%03d', $caseID));?>testcase->priList, $case->pri, $case->pri)?>'>testcase->priList, $case->pri, $case->pri)?> + testcase->priList, $case->pri, $case->pri)?>'>testcase->priList, $case->pri, $case->pri)?> createLink('testcase', 'view', "testcaseID=$caseID&version=$case->version"), $case->title);?> testcase->typeList[$case->type];?> openedBy];?>