diff --git a/module/bug/control.php b/module/bug/control.php index da4c5cf675..433955d5e4 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|nodeleted'); + $this->view->memberPairs = $this->user->getPairs('noletter'); $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('nodeleted|devfirst|noclosed'); + $this->view->users = $this->user->getPairs('devfirst|noclosed'); 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('nodeleted,devfirst'); + $this->view->users = $this->user->getPairs('devfirst'); $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('nodeleted', "$bug->assignedTo,$bug->resolvedBy,$bug->closedBy,$bug->openedBy"); + $this->view->users = $this->user->getPairs('', "$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); @@ -679,7 +679,13 @@ class bug extends control $this->view->showFields = $this->config->bug->custom->batchEditFields; /* Set users. */ - $users = $this->user->getPairs('nodeleted,devfirst'); + $appendUsers = array(); + foreach($bugs as $bug) + { + $appendUsers[$bug->assignedTo] = $bug->assignedTo; + $appendUsers[$bug->resolvedBy] = $bug->resolvedBy; + } + $users = $this->user->getPairs('devfirst', $appendUsers); $users = array('' => '', 'ditto' => $this->lang->bug->ditto) + $users; /* Assign. */ @@ -732,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('nodeleted', $bug->assignedTo); + $this->view->users = $this->user->getPairs('', $bug->assignedTo); $this->view->bug = $bug; $this->view->bugID = $bugID; $this->view->actions = $this->action->getList('bug', $bugID); @@ -822,7 +828,7 @@ class bug extends control $this->view->position[] = $this->lang->bug->confirmBug; $this->view->bug = $bug; - $this->view->users = $this->user->getPairs('nodeleted', $bug->assignedTo); + $this->view->users = $this->user->getPairs('', $bug->assignedTo); $this->view->actions = $this->action->getList('bug', $bugID); $this->display(); } @@ -884,7 +890,7 @@ class bug extends control $bug = $this->bug->getById($bugID); $productID = $bug->product; - $users = $this->user->getPairs('nodeleted'); + $users = $this->user->getPairs(); $assignedTo = $bug->openedBy; if(!isset($users[$assignedTo])) $assignedTo = $this->bug->getModuleOwner($bug->module, $productID); unset($this->lang->bug->resolutionList['tostory']); @@ -954,7 +960,7 @@ class bug extends control $this->view->position[] = $this->lang->bug->activate; $this->view->bug = $bug; - $this->view->users = $this->user->getPairs('nodeleted', $bug->resolvedBy); + $this->view->users = $this->user->getPairs('', $bug->resolvedBy); $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $bug->branch, 'noempty'); $this->view->actions = $this->action->getList('bug', $bugID); @@ -1254,7 +1260,7 @@ class bug extends control } else { - $projectMembers = $this->loadModel('user')->getPairs('nodeleted|devfirst|noclosed'); + $projectMembers = $this->loadModel('user')->getPairs('devfirst|noclosed'); } die(html::select('assignedTo', $projectMembers, $selectedUser, 'class="form-control"')); @@ -1269,7 +1275,7 @@ class bug extends control */ public function ajaxLoadAllUsers($selectedUser = '') { - $allUsers = $this->loadModel('user')->getPairs('nodeleted|devfirst|noclosed'); + $allUsers = $this->loadModel('user')->getPairs('devfirst|noclosed'); die(html::select('assignedTo', $allUsers, $selectedUser, 'class="form-control"')); } diff --git a/module/bug/model.php b/module/bug/model.php index e2dc03de56..6eecd56864 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('nodeleted'); + $users = $this->loadModel('user')->getPairs(); if($moduleID) { @@ -845,7 +845,7 @@ class bugModel extends model $bug = reset($bugs); $productID = $bug->product; - $users = $this->loadModel('user')->getPairs('nodeleted'); + $users = $this->loadModel('user')->getPairs(); $product = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch(); $stmt = $this->dao->query($this->loadModel('tree')->buildMenuQuery($productID, 'bug')); $modules = array(); @@ -921,6 +921,8 @@ class bugModel extends model ->add('closedBy', '') ->add('closedDate', '0000-00-00') ->add('duplicateBug', 0) + ->add('toTask', 0) + ->add('toStory', 0) ->add('lastEditedBy', $this->app->user->account) ->add('lastEditedDate', $now) ->join('openedBuild', ',') diff --git a/module/build/control.php b/module/build/control.php index 0dea72eb45..f4ec632ba7 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -76,7 +76,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('nodeleted'); + $this->view->users = $this->user->getPairs(); $this->display(); } @@ -160,7 +160,7 @@ class build extends control $this->view->productGroups = $productGroups; $this->view->products = $products; - $this->view->users = $this->loadModel('user')->getPairs(); + $this->view->users = $this->loadModel('user')->getPairs('noletter', $build->builder); $this->view->build = $build; $this->display(); } diff --git a/module/company/control.php b/module/company/control.php index 743ec8d076..61a0c52f08 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('nodeleted|noclosed'); + $users = $this->loadModel('user')->getPairs('noclosed'); $users[''] = $this->lang->company->user; $this->view->users = $users; diff --git a/module/cron/model.php b/module/cron/model.php index 26ad7dfc15..1296b676d5 100644 --- a/module/cron/model.php +++ b/module/cron/model.php @@ -215,11 +215,11 @@ class cronModel extends model */ public function checkRule($cron) { - if($cron->m === '' or preg_match('/[^0-9\*\-\/]/', $cron->m)) return sprintf($this->lang->cron->notice->errorRule, $this->lang->cron->m); - if($cron->h === '' or preg_match('/[^0-9\*\-\/]/', $cron->h)) return sprintf($this->lang->cron->notice->errorRule, $this->lang->cron->h); - if($cron->dom === '' or preg_match('/[^0-9\*\-\/]/', $cron->dom))return sprintf($this->lang->cron->notice->errorRule, $this->lang->cron->dom); - if($cron->mon === '' or preg_match('/[^0-9\*\-\/]/', $cron->mon))return sprintf($this->lang->cron->notice->errorRule, $this->lang->cron->mon); - if($cron->dow === '' or preg_match('/[^0-9\*\-|,\/]/', $cron->dow))return sprintf($this->lang->cron->notice->errorRule, $this->lang->cron->dow); + if($cron->m === '' or preg_match('/[^0-9\*\-\/,]/', $cron->m)) return sprintf($this->lang->cron->notice->errorRule, $this->lang->cron->m); + if($cron->h === '' or preg_match('/[^0-9\*\-\/,]/', $cron->h)) return sprintf($this->lang->cron->notice->errorRule, $this->lang->cron->h); + if($cron->dom === '' or preg_match('/[^0-9\*\-\/,\?LWC]/', $cron->dom))return sprintf($this->lang->cron->notice->errorRule, $this->lang->cron->dom); + if($cron->mon === '' or preg_match('/[^0-9\*\-\/,]/', $cron->mon)) return sprintf($this->lang->cron->notice->errorRule, $this->lang->cron->mon); + if($cron->dow === '' or preg_match('/[^0-9\*\-\/,\?LC#]/', $cron->dow))return sprintf($this->lang->cron->notice->errorRule, $this->lang->cron->dow); if(empty($cron->command))return sprintf($this->lang->error->notempty, $this->lang->cron->command); return null; } diff --git a/module/custom/control.php b/module/custom/control.php index 9a1e19388a..913d29c976 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('nodeleted|noclosed'); + $this->view->users = $this->loadModel('user')->getPairs('noclosed'); $this->view->needReview = zget($this->config->$module, 'needReview', 1); $this->view->forceReview = zget($this->config->$module, 'forceReview', ''); } diff --git a/module/dept/control.php b/module/dept/control.php index 4445d0373e..2cbf52908f 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('nodeleted|noletter|noclosed'); + $users = $this->loadModel('user')->getPairs('noletter|noclosed'); $this->view->optionMenu = $this->dept->getOptionMenu(); diff --git a/module/dept/model.php b/module/dept/model.php index 584116a32d..d1311aef2e 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('nodeleted|noletter|noclosed'); + $users = $this->loadModel('user')->getPairs('noletter|noclosed'); if(count($tree)) { foreach ($tree as $node) diff --git a/module/doc/control.php b/module/doc/control.php index e6319595b7..59b50826b9 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -229,7 +229,7 @@ class doc extends control if(!empty($lib->project)) $this->view->project = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->eq($lib->project)->fetch(); $this->view->lib = $lib; $this->view->groups = $this->loadModel('group')->getPairs(); - $this->view->users = $this->user->getPairs('nocode'); + $this->view->users = $this->user->getPairs('noletter', $lib->users); $this->view->libID = $libID; die($this->display()); @@ -376,7 +376,7 @@ class doc extends control $this->view->moduleOptionMenu = $this->tree->getOptionMenu($libID, 'doc', $startModuleID = 0); $this->view->type = $type; $this->view->groups = $this->loadModel('group')->getPairs(); - $this->view->users = $this->user->getPairs('nocode'); + $this->view->users = $this->user->getPairs('noletter', $doc->users); $this->display(); } diff --git a/module/mail/model.php b/module/mail/model.php index 1cb6b912fa..a3b23995bf 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('nodeleted'); + $users = $this->loadModel('user')->getPairs(); 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 3717ac50a8..bd390d6af1 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -194,7 +194,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|nodeleted'); + $this->view->memberPairs = $this->user->getPairs('noletter'); $this->view->tabID = 'bug'; $this->view->type = $type; $this->view->recTotal = $recTotal; @@ -404,7 +404,7 @@ class my extends control $this->view->mode = $mode; $this->view->lists = $lists; $this->view->listID = $listID; - $this->view->users = $this->user->getPairs('noletter|nodeleted|noempty|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noempty|noclosed'); $this->display(); } diff --git a/module/product/control.php b/module/product/control.php index e863c7a2d9..0041c9fe51 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('nodeleted|noletter|pofirst'); + $this->view->users = $this->user->getPairs('noletter|pofirst'); $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('nodeleted|pofirst|noclosed'); - $this->view->qdUsers = $this->loadModel('user')->getPairs('nodeleted|qdfirst|noclosed'); - $this->view->rdUsers = $this->loadModel('user')->getPairs('nodeleted|devfirst|noclosed'); + $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'); 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('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); + $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); unset($this->lang->product->typeList['']); $this->display(); @@ -314,13 +314,22 @@ class product extends control $this->view->customFields = $customFields; $this->view->showFields = $this->config->product->custom->batchEditFields; + $products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in($productIDList)->fetchAll('id'); + $appendPoUsers = $appendQdUsers = $appendRdUsers = array(); + foreach($products as $product) + { + $appendPoUsers[$product->PO] = $product->PO; + $appendQdUsers[$product->QD] = $product->QD; + $appendRdUsers[$product->RD] = $product->RD; + } + $this->view->title = $this->lang->product->batchEdit; $this->view->position[] = $this->lang->product->batchEdit; $this->view->productIDList = $productIDList; - $this->view->products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in($productIDList)->fetchAll('id'); - $this->view->poUsers = $this->loadModel('user')->getPairs('nodeleted|pofirst'); - $this->view->qdUsers = $this->loadModel('user')->getPairs('nodeleted|qdfirst'); - $this->view->rdUsers = $this->loadModel('user')->getPairs('nodeleted|devfirst'); + $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); unset($this->lang->product->typeList['']); $this->display(); @@ -482,7 +491,7 @@ class product extends control /* Assign. */ $this->view->productID = $productID; $this->view->type = $type; - $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noletter'); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); $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 be761ebfdc..1f41b50e47 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,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->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->groups = $this->loadModel('group')->getPairs(); $this->view->allProducts = $allProducts; $this->view->linkedProducts = $linkedProducts; @@ -1007,6 +1007,16 @@ class project extends control $this->project->setMenu($this->projects, $projectID); $projectIDList = $this->post->projectIDList ? $this->post->projectIDList : die(js::locate($this->session->projectList, 'parent')); + $projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($projectIDList)->fetchAll('id'); + + $appendPoUsers = $appendPmUsers = $appendQdUsers = $appendRdUsers = array(); + foreach($projects as $project) + { + $appendPoUsers[$project->PO] = $project->PO; + $appendPmUsers[$project->PM] = $project->PM; + $appendQdUsers[$project->QD] = $project->QD; + $appendRdUsers[$project->RD] = $project->RD; + } /* Set custom. */ foreach(explode(',', $this->config->project->customBatchEditFields) as $field) $customFields[$field] = $this->lang->project->$field; @@ -1016,11 +1026,11 @@ class project extends control $this->view->title = $this->lang->project->batchEdit; $this->view->position[] = $this->lang->project->batchEdit; $this->view->projectIDList = $projectIDList; - $this->view->projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($projectIDList)->fetchAll('id'); - $this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed,nodeleted,pmfirst'); - $this->view->poUsers = $this->user->getPairs('noclosed,nodeleted,pofirst'); - $this->view->qdUsers = $this->user->getPairs('noclosed,nodeleted,qdfirst'); - $this->view->rdUsers = $this->user->getPairs('noclosed,nodeleted,devfirst'); + $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->display(); } @@ -1536,7 +1546,7 @@ class project extends control $this->loadModel('dept'); $project = $this->project->getById($projectID); - $users = $this->user->getPairs('noclosed, nodeleted, devfirst'); + $users = $this->user->getPairs('noclosed,devfirst'); $roles = $this->user->getUserRoles(array_keys($users)); $deptUsers = $dept === '' ? array() : $this->dept->getDeptUserPairs($dept); $currentMembers = $this->project->getTeamMembers($projectID); @@ -1815,7 +1825,7 @@ class project extends control /* Assign. */ $this->view->projectID = $projectID; $this->view->type = $type; - $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noletter'); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->account = $account; $this->view->orderBy = $orderBy; $this->view->pager = $pager; diff --git a/module/report/control.php b/module/report/control.php index 022a508393..e946272610 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|nodeleted'); + $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed'); $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|nodeleted'); + $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed'); $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|nodeleted'); + $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed'); $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 541b04298c..5661eb1dda 100644 --- a/module/sso/control.php +++ b/module/sso/control.php @@ -187,7 +187,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('nodeleted|noclosed'); + $this->view->users = $this->user->getPairs('noclosed'); $this->view->data = $ssoData; $this->display(); } @@ -201,7 +201,7 @@ class sso extends control public function getUserPairs() { if(!$this->sso->checkKey()) return false; - $users = $this->loadModel('user')->getPairs('noclosed,nodeleted'); + $users = $this->loadModel('user')->getPairs('noclosed'); die(json_encode($users)); } diff --git a/module/story/control.php b/module/story/control.php index 534d8c3cf3..b41b9dc3b7 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('nodeleted|pdfirst|noclosed'); + $users = $this->user->getPairs('pdfirst|noclosed'); $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('nodeleted|pofirst', "$story->assignedTo,$story->openedBy,$story->closedBy"); + $this->view->users = $this->user->getPairs('pofirst', "$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('nodeleted'); + $users = $this->loadModel('user')->getPairs(); $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('nodeleted|pofirst', $this->view->story->assignedTo); + $this->view->users = $this->user->getPairs('pofirst', $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('nodeleted|pofirst', $this->view->story->closedBy); + $this->view->users = $this->user->getPairs('pofirst', $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('nodeleted', "$story->lastEditedBy,$story->openedBy"); + $this->view->users = $this->loadModel('user')->getPairs('', "$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 f242bc5a6f..0fc6c9e2f2 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -138,7 +138,7 @@ class task extends control } } - $users = $this->loadModel('user')->getPairs('nodeleted|noclosed'); + $users = $this->loadModel('user')->getPairs('noclosed'); $stories = $this->story->getProjectStoryPairs($projectID); $members = $this->project->getTeamMemberPairs($projectID, 'nodeleted'); $moduleOptionMenu = $this->tree->getTaskOptionMenu($projectID); @@ -294,7 +294,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('nodeleted', "{$this->view->task->openedBy},{$this->view->task->canceledBy},{$this->view->task->closedBy}"); + $this->view->users = $this->loadModel('user')->getPairs('', "{$this->view->task->openedBy},{$this->view->task->canceledBy},{$this->view->task->closedBy}"); $this->view->modules = $this->tree->getTaskOptionMenu($this->view->task->project); $this->display(); } @@ -351,7 +351,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, 'nodeleted'); + $members = $this->project->getTeamMemberPairs($projectID); $members = array('' => '', 'ditto' => $this->lang->task->ditto) + $members; $members['closed'] = 'Closed'; @@ -427,7 +427,7 @@ class task extends control $this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->task->assign; $this->view->position[] = $this->lang->task->assign; - $this->view->users = $this->project->getTeamMemberPairs($projectID); + $this->view->users = $this->project->getTeamMemberPairs($projectID, 'nodeleted'); $this->display(); } diff --git a/module/testcase/control.php b/module/testcase/control.php index 865a61af20..7291df6b3c 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|nodeleted|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noclosed'); $this->view->branch = $branch; $this->view->branches = $this->session->currentProductType != 'normal' ? $this->loadModel('branch')->getPairs($productID) : array(); @@ -755,7 +755,7 @@ class testcase extends control die(js::reload('parent.parent')); } - $this->view->users = $this->user->getPairs('noletter|nodeleted|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noclosed'); $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 86c8436f8b..2f4d85f24a 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|nodeleted|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noclosed'); $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|nodeleted|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noclosed'); $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|nodeleted|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noclosed'); $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|nodeleted|noclosed'); + $this->view->users = $this->user->getPairs('noletter|noclosed'); $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 65e3bba769..89553f60b7 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -217,7 +217,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|nodeleted|noletter'); + $users = $this->loadModel('user')->getPairs('noclosed|noletter'); $data = array(); foreach($severityGroups as $severity => $count) { diff --git a/module/testtask/control.php b/module/testtask/control.php index b96dea600a..efac3ea574 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -156,7 +156,7 @@ class testtask extends control $this->view->projects = $projects; $this->view->productID = $productID; $this->view->builds = $builds; - $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted|qdfirst'); + $this->view->users = $this->loadModel('user')->getPairs('noclosed|qdfirst'); $this->display(); } @@ -286,7 +286,7 @@ class testtask extends control $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,nodeleted,qafirst'); + $this->view->assignedTos = $this->loadModel('user')->getPairs('noclosed,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; @@ -437,7 +437,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('nodeleted', $task->owner); + $this->view->users = $this->loadModel('user')->getPairs('', $task->owner); $this->view->contactLists = $this->user->getContactLists($this->app->user->account, 'withnote'); $this->display(); @@ -564,7 +564,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|nodeleted|qdfirst'); + $this->view->users = $this->loadModel('user')->getPairs('noclosed|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 6f76cf21d5..ec5bf6c6cb 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|nodeleted', $module->owner); + $this->view->users = $this->loadModel('user')->getPairs('noclosed', $module->owner); $showProduct = strpos('story|bug|case', $type) !== false ? true : false; $this->view->showProduct = $showProduct; diff --git a/module/user/control.php b/module/user/control.php index 9949bbcc02..294ee90c2c 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|nodeleted'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $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|nodeleted'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $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|nodeleted'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $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|nodeleted'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $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|nodeleted'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $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|nodeleted'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $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|nodeleted'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclose'), $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|nodeleted'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclose'), $account); $user = $this->user->getById($account); @@ -763,7 +763,7 @@ class user extends control { if(!empty($this->config->global->showDemoUsers)) { - $demoUsers = $this->user->getPairs('nodeleted, noletter, noempty, noclosed'); + $demoUsers = $this->user->getPairs('noletter,noempty,noclosed'); $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|nodeleted'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); /* Save session. */ $uri = $this->app->getURI(true); @@ -899,7 +899,7 @@ class user extends control /* Assign. */ $this->view->period = $period; - $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noletter'); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->account = $account; $this->view->user = $this->user->getById($account); $this->view->actions = $this->loadModel('action')->getDynamic($account, $period, $orderBy, $pager); @@ -933,7 +933,7 @@ class user extends control */ public function ajaxGetContactUsers($contactListID) { - $users = $this->user->getPairs('nodeleted,devfirst'); + $users = $this->user->getPairs('devfirst'); 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 d8838e3466..03f971818a 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|nodeleted|withguest|pofirst|devfirst|qafirst|pmfirst|realname, can be sets of theme + * @param string $params noletter|noempty|noclosed|withguest|pofirst|devfirst|qafirst|pmfirst|realname, can be sets of theme * @param string $usersToAppended account1,account2 * @access public * @return array @@ -88,7 +88,7 @@ class userModel extends model /* Get raw records. */ $users = $this->dao->select($fields)->from(TABLE_USER) - ->beginIF(strpos($params, 'nodeleted') !== false)->where('deleted')->eq(0)->fi() + ->where('deleted')->eq(0) ->orderBy($orderBy) ->fetchAll('account'); if($usersToAppended) $users += $this->dao->select($fields)->from(TABLE_USER)->where('account')->in($usersToAppended)->fetchAll('account');