diff --git a/module/api/config.php b/module/api/config.php index ca85343f71..eafeafb804 100644 --- a/module/api/config.php +++ b/module/api/config.php @@ -51,6 +51,6 @@ $config->api->search['params']['addedDate'] = array('operator' => '=', 'control $config->api->search['params']['editedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); $config->api->search['params']['editedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); $config->api->search['params']['path'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); -$config->api->search['params']['method'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $lang->api->methodOptions); -$config->api->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $lang->api->statusOptions); +$config->api->search['params']['method'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->api->methodOptions); +$config->api->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->api->statusOptions); $config->api->search['params']['version'] = array('operator' => '>=', 'control' => 'input', 'values' => ''); diff --git a/module/api/v1/entries/productissues.php b/module/api/v1/entries/productissues.php index 9f8214bc8e..5a5f3d35e3 100644 --- a/module/api/v1/entries/productissues.php +++ b/module/api/v1/entries/productissues.php @@ -24,17 +24,17 @@ class productIssuesEntry extends entry if(!is_numeric($productID)) $this->sendError(400, 'The product_id is not supported'); $taskFields = 'id,status'; - $taskStatus = array('' => ''); + $taskStatus = array(); $taskStatus['opened'] = 'wait,doing,done,pause'; $taskStatus['closed'] = 'closed'; $storyFields = 'id,status'; - $storyStatus = array('' => ''); + $storyStatus = array(); $storyStatus['opened'] = 'draft,reviewing,active,changing'; $storyStatus['closed'] = 'closed'; $bugFields = 'id,status'; - $bugStatus = array('' => ''); + $bugStatus = array(); $bugStatus['opened'] = 'active,resolved'; $bugStatus['closed'] = 'closed'; diff --git a/module/block/zen.php b/module/block/zen.php index 2235e6be54..98d45dd7a5 100644 --- a/module/block/zen.php +++ b/module/block/zen.php @@ -51,7 +51,7 @@ class blockZen extends block if(strpos(",$closedBlock,", ",$moduleKey|$moduleKey,") !== false) unset($modules[$moduleKey]); } - return array('' => '') + $modules; + return $modules; } /** diff --git a/module/bug/model.php b/module/bug/model.php index f6c85612c0..6dc7059f00 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1098,7 +1098,7 @@ class bugModel extends model */ public function getProductBugPairs($productID, $branch = '') { - $bugs = array('' => ''); + $bugs = array(); $data = $this->dao->select('id, title')->from(TABLE_BUG) ->where('product')->eq((int)$productID) ->beginIF(!$this->app->user->admin)->andWhere('execution')->in('0,' . $this->app->user->view->sprints)->fi() diff --git a/module/bug/zen.php b/module/bug/zen.php index de4b1eeeef..a17c11992e 100644 --- a/module/bug/zen.php +++ b/module/bug/zen.php @@ -1346,10 +1346,10 @@ class bugZen extends bug if(!$project) $project = new stdclass(); $this->assignVarsForBatchCreate($product, $project, $bugImagesFile); - $this->view->projects = array('' => '') + $this->product->getProjectPairsByProduct($product->id, $branch ? "0,{$branch}" : '0'); + $this->view->projects = $this->product->getProjectPairsByProduct($product->id, $branch ? "0,{$branch}" : '0'); $this->view->project = $project; $this->view->projectID = $projectID; - $this->view->executions = array('' => '') + $this->product->getExecutionPairsByProduct($product->id, $branch ? "0,{$branch}" : '0', (string)$projectID, 'multiple,stagefilter'); + $this->view->executions = $this->product->getExecutionPairsByProduct($product->id, $branch ? "0,{$branch}" : '0', (string)$projectID, 'multiple,stagefilter'); $this->view->executionID = $executionID; $this->view->stories = $stories; $this->view->builds = $builds; diff --git a/module/build/model.php b/module/build/model.php index f5b123ddef..7ca73f32a0 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -273,7 +273,6 @@ class buildModel extends model { $sysBuilds = array(); $selectedBuilds = array(); - if(strpos($params, 'noempty') === false) $sysBuilds = array('' => ''); if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => $this->lang->trunk); $productIdList = is_array($products) ? array_keys($products) : $products; if($buildIdList) diff --git a/module/chart/control.php b/module/chart/control.php index 086af795ac..1bffc6e9f1 100644 --- a/module/chart/control.php +++ b/module/chart/control.php @@ -142,7 +142,7 @@ class chart extends control $filterHtml['item'] .= ""; $filterHtml['item'] .= ''; } - if($type == 'select') $filterHtml['item'] .= html::select('default', array('' => '') + $options, $default, "class='form-control picker-select' multiple"); + if($type == 'select') $filterHtml['item'] .= html::select('default', $options, $default, "class='form-control picker-select' multiple"); if($type == 'condition') { $operator = isset($filter['operator']) ? $filter['operator'] : ''; diff --git a/module/chart/model.php b/module/chart/model.php index fb59266356..827463b7a0 100644 --- a/module/chart/model.php +++ b/module/chart/model.php @@ -599,7 +599,7 @@ class chartModel extends model */ public function getSysOptions($type, $object = '', $field = '', $sql = '') { - $options = array('' => ''); + $options = array(); switch($type) { case 'user': diff --git a/module/company/model.php b/module/company/model.php index 846189ccac..43432683e2 100644 --- a/module/company/model.php +++ b/module/company/model.php @@ -111,7 +111,7 @@ class companyModel extends model public function getOutsideCompanies() { $companies = $this->dao->select('id, name')->from(TABLE_COMPANY)->where('id')->ne(1)->fetchPairs(); - return array('' => '') + $companies; + return $companies; } /** @@ -162,7 +162,7 @@ class companyModel extends model { $this->config->company->browse->search['actionURL'] = $actionURL; $this->config->company->browse->search['queryID'] = $queryID; - $this->config->company->browse->search['params']['dept']['values'] = array('' => '') + $this->loadModel('dept')->getOptionMenu(); + $this->config->company->browse->search['params']['dept']['values'] = $this->loadModel('dept')->getOptionMenu(); $this->config->company->browse->search['params']['visions']['values'] = $this->loadModel('user')->getVisionList(); $this->loadModel('search')->setSearchParams($this->config->company->browse->search); diff --git a/module/dept/control.php b/module/dept/control.php index 598a6d9085..047473b5b2 100644 --- a/module/dept/control.php +++ b/module/dept/control.php @@ -154,7 +154,7 @@ class dept extends control */ public function ajaxGetUsers($dept, $user = '', $key = 'account') { - $users = array('' => '') + $this->dept->getDeptUserPairs($dept, $key); + $users = $this->dept->getDeptUserPairs($dept, $key); return print(html::select('user', $users, $user, "class='form-control chosen'")); } } diff --git a/module/doc/control.php b/module/doc/control.php index 381484ba5d..e0876f93e3 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -945,7 +945,7 @@ class doc extends control ->orderBy('`order` asc') ->fetchPairs(); - return print(html::select('doc', array('' => '') + $docs, '', "class='form-control chosen'")); + return print(html::select('doc', $docs, '', "class='form-control chosen'")); } /** diff --git a/module/doc/model.php b/module/doc/model.php index 4914af5434..abfeb60335 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1104,10 +1104,10 @@ class docModel extends model $this->config->doc->search['module'] = 'contributeDoc'; $products = $this->product->getPairs(); - $this->config->doc->search['params']['project']['values'] = array('' => '') + $this->loadModel('project')->getPairsByProgram('', 'all', false, 'order_asc', $this->config->vision == 'rnd' ? 'kanban' : '') + array('all' => $this->lang->doc->allProjects); - $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs(0, 'sprint,stage', 'multiple,leaf,noprefix,withobject') + array('all' => $this->lang->doc->allExecutions); - $this->config->doc->search['params']['lib']['values'] = array('' => '') + $this->loadModel('doc')->getLibs('all', 'withObject') + array('all' => $this->lang->doclib->all); - $this->config->doc->search['params']['product']['values'] = array('' => '') + $products + array('all' => $this->lang->doc->allProduct); + $this->config->doc->search['params']['project']['values'] = $this->loadModel('project')->getPairsByProgram('', 'all', false, 'order_asc', $this->config->vision == 'rnd' ? 'kanban' : '') + array('all' => $this->lang->doc->allProjects); + $this->config->doc->search['params']['execution']['values'] = $this->loadModel('execution')->getPairs(0, 'sprint,stage', 'multiple,leaf,noprefix,withobject') + array('all' => $this->lang->doc->allExecutions); + $this->config->doc->search['params']['lib']['values'] = $this->loadModel('doc')->getLibs('all', 'withObject') + array('all' => $this->lang->doclib->all); + $this->config->doc->search['params']['product']['values'] = $products + array('all' => $this->lang->doc->allProduct); unset($this->config->doc->search['fields']['module']); } @@ -1115,7 +1115,7 @@ class docModel extends model { if(!isset($libs[$libID])) $libs[$libID] = $this->getLibById($libID); - $libPairs = array('' => ''); + $libPairs = array(); $queryName = $type . 'libDoc'; foreach($libs as $lib) { @@ -1126,7 +1126,7 @@ class docModel extends model if($type == 'project') { - $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'sprint,stage', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); + $this->config->doc->search['params']['execution']['values'] = $this->loadModel('execution')->getPairs($this->session->project, 'sprint,stage', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); } else { @@ -1138,7 +1138,7 @@ class docModel extends model unset($this->config->doc->search['fields']['execution']); } - if(in_array($type, array('view', 'collect', 'createdby', 'editedby'))) $libPairs = array('' => '') + $this->getLibs('all', 'withObject'); + if(in_array($type, array('view', 'collect', 'createdby', 'editedby'))) $libPairs = $this->getLibs('all', 'withObject'); $this->config->doc->search['module'] = $queryName; $this->config->doc->search['params']['lib']['values'] = $libPairs + array('all' => $this->lang->doclib->all); diff --git a/module/execution/control.php b/module/execution/control.php index 8439bbb8e9..e16562e42a 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -618,7 +618,7 @@ class execution extends control $this->config->bug->search['params']['execution']['values'] = array(''=>'') + $executions + array('all'=>$this->lang->execution->aboveAllExecution); $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs(array_keys($products)); $this->config->bug->search['module'] = 'importBug'; - $this->config->bug->search['params']['confirmed']['values'] = array('' => '') + $this->lang->bug->confirmedList; + $this->config->bug->search['params']['confirmed']['values'] = $this->lang->bug->confirmedList; $this->loadModel('tree'); $bugModules = array(); @@ -852,7 +852,7 @@ class execution extends control $storyCases = $this->loadModel('testcase')->getStoryCaseCounts($storyIdList); $plans = $this->execution->getPlans($products, 'skipParent|withMainPlan|unexpired|noclosed|sortedByDate', $executionID); - $allPlans = array('' => ''); + $allPlans = array(); if(!empty($plans)) { foreach($plans as $plan) $allPlans += $plan; @@ -1232,7 +1232,6 @@ class execution extends control /* Get products' list. */ $products = $this->product->getProducts($executionID, 'all', '', false); - $products = array('' => '') + $products; /* Build the search form. */ $type = strtolower($type); @@ -1953,7 +1952,7 @@ class execution extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => inlink('view', "executionID=$executionID"))); } - $executions = array('' => '') + $this->executions; + $executions = $this->executions; /* Remove current execution from the executions. */ unset($executions[$executionID]); @@ -2533,7 +2532,7 @@ class execution extends control foreach($products as $product) $productNames[$product->id] = $product->name; $plans = $this->execution->getPlans($products, 'skipParent', $executionID); - $allPlans = array('' => ''); + $allPlans = array(); if(!empty($plans)) { foreach($plans as $plan) $allPlans += $plan; @@ -2629,7 +2628,7 @@ class execution extends control foreach($products as $product) $productNames[$product->id] = $product->name; $plans = $this->execution->getPlans($products); - $allPlans = array('' => ''); + $allPlans = array(); if(!empty($plans)) { foreach($plans as $plan) $allPlans += $plan; @@ -3143,7 +3142,6 @@ class execution extends control $currentMembers = $this->execution->getTeamMembers($executionID); $members2Import = $this->execution->getMembers2Import($team2Import, array_keys($currentMembers)); $teams2Import = $this->loadModel('personnel')->getCopiedObjects($executionID, 'sprint', true); - $teams2Import = array('' => '') + $teams2Import; /* Append users for get users. */ $appendUsers = array(); @@ -3162,7 +3160,7 @@ class execution extends control $this->view->users = $this->user->getPairs('noclosed|nodeleted|devfirst', $appendUsers); $this->view->roles = $this->user->getUserRoles(array_keys($this->view->users)); $this->view->dept = $dept; - $this->view->depts = array('' => '') + $this->loadModel('dept')->getOptionMenu(); + $this->view->depts = $this->loadModel('dept')->getOptionMenu(); $this->view->teams2Import = $teams2Import; $this->view->team2Import = $team2Import; $this->view->teamMembers = $this->executionZen->buildMembers($currentMembers, $members2Import, $deptUsers, $execution->days); diff --git a/module/execution/model.php b/module/execution/model.php index b15d116e2f..c146a88bd1 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2669,14 +2669,14 @@ class executionModel extends model $this->loadModel('productplan'); $plans = array(); - $planPairs = array('' => ''); + $planPairs = array(); foreach($products as $productID => $product) { $plans = $this->productplan->getBranchPlanPairs($productID, array(BRANCH_MAIN) + $product->branches, 'unexpired', true); foreach($plans as $plan) $planPairs += $plan; } $this->config->product->search['params']['plan']['values'] = $planPairs; - $this->config->product->search['params']['module']['values'] = array('' => '') + $modules; + $this->config->product->search['params']['module']['values'] = $modules; if($productType == 'normal') { unset($this->config->product->search['fields']['branch']); @@ -2685,7 +2685,7 @@ class executionModel extends model else { $this->config->product->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$productType]); - $this->config->product->search['params']['branch']['values'] = array('' => '') + $branchPairs; + $this->config->product->search['params']['branch']['values'] = $branchPairs; } $this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList); @@ -4479,7 +4479,7 @@ class executionModel extends model else { $this->config->bug->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$productType]); - $this->config->bug->search['params']['branch']['values'] = array('' => '') + $branchPairs; + $this->config->bug->search['params']['branch']['values'] = $branchPairs; } $this->config->bug->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->bug->statusList); diff --git a/module/execution/ui/testcase.html.php b/module/execution/ui/testcase.html.php index 44392e840f..df41b65a6d 100644 --- a/module/execution/ui/testcase.html.php +++ b/module/execution/ui/testcase.html.php @@ -62,7 +62,7 @@ sidebar ); $config->testcase->dtable->fieldList['story']['map'] = $stories; -$config->testcase->dtable->fieldList['actions']['list']['edit']['url'] = str_replace('%executionID%', $executionID, $config->testcase->dtable->fieldList['actions']['list']['edit']['url']); +$config->testcase->dtable->fieldList['actions']['list']['edit']['url'] = str_replace('%executionID%', (string)$executionID, $config->testcase->dtable->fieldList['actions']['list']['edit']['url']); $config->testcase->dtable->fieldList['actions']['menu'] = array(array('confirmStoryChange'), array('runCase', 'runResult', 'edit', 'createBug', 'create')); foreach($cases as $case) { diff --git a/module/gitlab/control.php b/module/gitlab/control.php index 7d8643ba2f..b6efc3b3c3 100644 --- a/module/gitlab/control.php +++ b/module/gitlab/control.php @@ -234,7 +234,7 @@ class gitlab extends control $this->app->loadClass('pager', true); $pager = new pager(count($gitlabUsers), 10000, 1); - + $this->view->pager = $pager; $this->view->title = $this->lang->gitlab->bindUser; $this->view->zentaoUsers = $zentaoUsers; @@ -634,7 +634,7 @@ class gitlab extends control $users = $this->loadModel('user')->getList(); $bindedUsers = $this->gitlab->getUserAccountIdPairs($gitlabID); - $userPairs = array('' => ''); + $userPairs = array(); $userInfos = array(); foreach($users as $key => $user) { @@ -675,7 +675,7 @@ class gitlab extends control $users = $this->loadModel('user')->getList(); $bindedUsers = $this->gitlab->getUserAccountIdPairs($gitlabID); - $userPairs = array('' => ''); + $userPairs = array(); foreach($users as $user) { if(!isset($bindedUsers[$user->account]) or $user->account == $zentaoBindAccount) $userPairs[$user->account] = $user->realname; @@ -1091,7 +1091,7 @@ class gitlab extends control $this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->importIssue; $this->view->importable = empty($gitlabIssues) ? false : true; - $this->view->products = array('' => '') + $products; + $this->view->products = $products; $this->view->gitlabID = $gitlabID; $this->view->gitlabProjectID = $projectID; $this->view->objectTypes = $this->config->gitlab->objectTypes; diff --git a/module/group/control.php b/module/group/control.php index 33b2b4ef17..0c2d261ca9 100644 --- a/module/group/control.php +++ b/module/group/control.php @@ -446,7 +446,7 @@ class group extends control $this->view->title = $title; $this->view->position = $position; - $this->view->allUsers = array('' => '') + $groupUsers + $this->loadModel('dept')->getDeptUserPairs($deptID); + $this->view->allUsers = $groupUsers + $this->loadModel('dept')->getDeptUserPairs($deptID); $this->view->groupID = $groupID; $this->view->deptID = $deptID; $this->view->deptName = $deptID ? $this->dao->findById($deptID)->from(TABLE_DEPT)->fetch('name') : ''; @@ -853,9 +853,9 @@ class group extends control } $this->view->title = $this->lang->group->createPriv; - $this->view->views = array('' => '') + $this->group->getPrivManagerPairs('view'); - $this->view->modules = array('' => '') + $this->group->getPrivManagerPairs('module'); - $this->view->packages = array('' => '') + $this->group->getPrivPackagePairs(); + $this->view->views = $this->group->getPrivManagerPairs('view'); + $this->view->modules = $this->group->getPrivManagerPairs('module'); + $this->view->packages = $this->group->getPrivPackagePairs(); $this->view->moduleViewPairs = $this->group->getPrivModuleViewPairs(); $this->view->packageModulePairs = $this->group->getPrivPackagePairs('', '', 't3.code'); $this->display(); @@ -898,9 +898,9 @@ class group extends control $priv->package = isset($packageModulePairs[$priv->parent]) ? $priv->parent : 0; $this->view->title = $this->lang->group->editPriv; - $this->view->views = array('' => '') + $this->group->getPrivManagerPairs('view'); - $this->view->modules = array('' => '') + $this->group->getPrivManagerPairs('module'); - $this->view->packages = array('' => '') + $this->group->getPrivPackagePairs(); + $this->view->views = $this->group->getPrivManagerPairs('view'); + $this->view->modules = $this->group->getPrivManagerPairs('module'); + $this->view->packages = $this->group->getPrivPackagePairs(); $this->view->moduleViewPairs = $moduleViewPairs; $this->view->packageModulePairs = $packageModulePairs; $this->view->priv = $priv; @@ -942,7 +942,7 @@ class group extends control public function ajaxGetPrivModules($viewName = '') { $modules = $this->group->getPrivModules($viewName, 'noViewName'); - echo html::select('module', array('' => '') + $modules, '', "class='form-control picker-select' onchange='loadPackages(this.value, \"module\")'"); + echo html::select('module', $modules, '', "class='form-control picker-select' onchange='loadPackages(this.value, \"module\")'"); } /** @@ -958,7 +958,7 @@ class group extends control $packages = array(); if($type == 'view') $packages = $this->group->getPrivPackagePairs($object); if($type == 'module') $packages = $this->group->getPrivPackagePairs('', $object); - echo html::select('package', array('' => '') + $packages, '', "class='form-control picker-select' onchange='changeViewAndModule(this.value)'"); + echo html::select('package', $packages, '', "class='form-control picker-select' onchange='changeViewAndModule(this.value)'"); } /** diff --git a/module/group/model.php b/module/group/model.php index 6abdec3af1..909126ef18 100644 --- a/module/group/model.php +++ b/module/group/model.php @@ -2106,11 +2106,11 @@ class groupModel extends model $privs[$privID] = (isset($packages[$priv->parent]) ? $packages[$priv->parent] : $modules[$priv->parentCode]) . '/' . $priv->name; } - $this->config->group->priv->search['params']['view']['values'] = array('' => '') + $this->getPrivManagerPairs('view'); - $this->config->group->priv->search['params']['module']['values'] = array('' => '') + $modules; - $this->config->group->priv->search['params']['package']['values'] = array('' => '') + $packages; - $this->config->group->priv->search['params']['recommendPrivs']['values'] = array('' => '') + $privs; - $this->config->group->priv->search['params']['dependPrivs']['values'] = array('' => '') + $privs; + $this->config->group->priv->search['params']['view']['values'] = $this->getPrivManagerPairs('view'); + $this->config->group->priv->search['params']['module']['values'] = $modules; + $this->config->group->priv->search['params']['package']['values'] = $packages; + $this->config->group->priv->search['params']['recommendPrivs']['values'] = $privs; + $this->config->group->priv->search['params']['dependPrivs']['values'] = $privs; $this->loadModel('search')->setSearchParams($this->config->group->priv->search); } diff --git a/module/job/control.php b/module/job/control.php index c2f085b7e1..1c0e19580e 100644 --- a/module/job/control.php +++ b/module/job/control.php @@ -156,7 +156,7 @@ class job extends control $this->view->repoTypes = $repoTypes; $this->view->products = array(0 => '') + $this->loadModel('product')->getProductPairsByProject($this->projectID); - $this->view->jenkinsServerList = array('' => '') + $this->loadModel('jenkins')->getPairs(); + $this->view->jenkinsServerList = $this->loadModel('jenkins')->getPairs(); $this->view->sonarqubeServerList = array('') + $this->loadModel('pipeline')->getPairs('sonarqube'); $this->display(); diff --git a/module/kanban/control.php b/module/kanban/control.php index ec0cc9e2c4..cbb3863c1b 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -246,7 +246,7 @@ class kanban extends control $this->view->spacePairs = $spacePairs; $this->view->type = $type; $this->view->typeList = $this->lang->kanban->featureBar['space']; - $this->view->kanbans = array('' => '') + $this->kanban->getPairs(); + $this->view->kanbans = $this->kanban->getPairs(); $this->view->copyKanbanID = $copyKanbanID; $this->view->copyKanban = $copyKanbanID ? $copyKanban : ''; $this->view->enableImport = $enableImport; diff --git a/module/measurement/model.php b/module/measurement/model.php index f15ebd4bec..58a6ed5774 100644 --- a/module/measurement/model.php +++ b/module/measurement/model.php @@ -92,8 +92,7 @@ class measurementModel extends model */ public function getPairs(): array { - $pairs = $this->dao->select('id, name')->from(TABLE_BASICMEAS)->where('deleted')->eq(0)->orderBy('purpose, `order` desc')->fetchPairs(); - return array('' => '') + $pairs; + return $this->dao->select('id, name')->from(TABLE_BASICMEAS)->where('deleted')->eq(0)->orderBy('purpose, `order` desc')->fetchPairs(); } /** @@ -144,7 +143,7 @@ class measurementModel extends model if($type == 'pairs') $pairs[$report->id] = $reportName; } - if($type == 'pairs') return array('' => '') + $pairs; + if($type == 'pairs') return $pairs; return $reports; } @@ -211,7 +210,7 @@ class measurementModel extends model } } - return array('' => '') + $pairs; + return $pairs; } /** @@ -774,15 +773,15 @@ class measurementModel extends model { if($optionType == 'project') { - $options = array('' => '') + $this->loadModel('project')->getPairsByProgram(); + $options = $this->loadModel('project')->getPairsByProgram(); } elseif($optionType == 'product') { - $options = array('' => '') + $this->loadModel('product')->getPairs('nocode'); + $options = $this->loadModel('product')->getPairs('nocode'); } elseif($optionType == 'sprint') { - $options = array('' => '') + $this->loadModel('execution')->getPairs(); + $options = $this->loadModel('execution')->getPairs(); } elseif($optionType == 'user') { @@ -796,11 +795,6 @@ class measurementModel extends model $options = $this->lang->$moduleName->$varListName; unset($options[0]); unset($options['']); - $options = array('' => '') + $options; - } - else - { - $options = array('' => ''); } $optionList[$optionType] = $options; diff --git a/module/mr/control.php b/module/mr/control.php index 127a9842ba..21cd247327 100644 --- a/module/mr/control.php +++ b/module/mr/control.php @@ -659,8 +659,7 @@ class mr extends control { $this->product->setMenu($productID, 0); $this->config->product->search['fields']['branch'] = $this->lang->product->branch; - $branches = array('' => '') + $this->loadModel('branch')->getPairs($productID, 'noempty'); - $this->config->product->search['params']['branch']['values'] = $branches; + $this->config->product->search['params']['branch']['values'] = $this->loadModel('branch')->getPairs($productID, 'noempty'); } $this->loadModel('search')->setSearchParams($this->config->product->search); @@ -747,7 +746,7 @@ class mr extends control { $this->product->setMenu($productID, 0); $this->config->bug->search['fields']['branch'] = $this->lang->product->branch; - $this->config->bug->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($productID, 'noempty'); + $this->config->bug->search['params']['branch']['values'] = $this->loadModel('branch')->getPairs($productID, 'noempty'); } $this->loadModel('search')->setSearchParams($this->config->bug->search); diff --git a/module/mr/model.php b/module/mr/model.php index c5c1d8391a..00ae43cebb 100644 --- a/module/mr/model.php +++ b/module/mr/model.php @@ -92,7 +92,7 @@ class mrModel extends model ->where('deleted')->eq('0') ->andWhere('repoID')->eq($repoID) ->orderBy('id')->fetchPairs('id', 'title'); - return array('' => '') + $MR; + return $MR; } /** diff --git a/module/my/control.php b/module/my/control.php index cdc347feb4..0970e16ab9 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -1128,7 +1128,7 @@ EOF; $this->view->mode = 'myMeeting'; $this->view->projects = array(0 => '') + $this->loadModel('project')->getPairsByProgram('', 'all', true); $this->view->executions = array(0 => '') + $this->loadModel('execution')->getPairs(0, 'all', 'nocode'); - $this->view->rooms = array('' => '') + $this->loadModel('meetingroom')->getPairs(); + $this->view->rooms = $this->loadModel('meetingroom')->getPairs(); $this->display(); } @@ -1192,9 +1192,9 @@ EOF; $this->config->feedback->search['actionURL'] = inlink('work', "mode=feedback&browseType=bysearch¶m=myQueryID&orderBy=$orderBy"); $this->config->feedback->search['queryID'] = $queryID; $this->config->feedback->search['onMenuBar'] = 'no'; - $this->config->feedback->search['params']['product']['values'] = array('' => '') + $products; - $this->config->feedback->search['params']['module']['values'] = array('' => '') + $this->loadModel('tree')->getOptionMenu(0, $viewType = 'feedback', $startModuleID = 0); - $this->config->feedback->search['params']['processedBy']['values'] = array('' => '') + $this->feedback->getFeedbackPairs('admin'); + $this->config->feedback->search['params']['product']['values'] = $products; + $this->config->feedback->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu(0, $viewType = 'feedback', $startModuleID = 0); + $this->config->feedback->search['params']['processedBy']['values'] = $this->feedback->getFeedbackPairs('admin'); unset($this->config->feedback->search['fields']['assignedTo']); unset($this->config->feedback->search['fields']['closedBy']); diff --git a/module/my/model.php b/module/my/model.php index 89f087c991..ab733ce6dd 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -423,9 +423,9 @@ class myModel extends model $this->config->testcase->search['module'] = $queryName; $this->config->testcase->search['queryID'] = $queryID; $this->config->testcase->search['actionURL'] = $actionURL; - $this->config->testcase->search['params']['product']['values'] = array('' => '') + $products; - $this->config->testcase->search['params']['scene']['values'] = array('' => '') + $scene; - $this->config->testcase->search['params']['lib']['values'] = array('' => '') + $this->loadModel('caselib')->getLibraries(); + $this->config->testcase->search['params']['product']['values'] = $products; + $this->config->testcase->search['params']['scene']['values'] = $scene; + $this->config->testcase->search['params']['lib']['values'] = $this->loadModel('caselib')->getLibraries(); unset($this->config->testcase->search['fields']['module']); @@ -653,9 +653,9 @@ class myModel extends model unset($this->config->bug->search['fields']['closedBy']); } - $this->config->bug->search['params']['project']['values'] = $this->loadModel('project')->getPairsByProgram() + array('all' => $this->lang->bug->allProject) + array('' => ''); + $this->config->bug->search['params']['project']['values'] = $this->loadModel('project')->getPairsByProgram() + array('all' => $this->lang->bug->allProject); $this->config->bug->search['params']['execution']['values'] = $this->loadModel('execution')->getPairs(0, 'all', 'multiple'); - $this->config->bug->search['params']['product']['values'] = $products + array('' => ''); + $this->config->bug->search['params']['product']['values'] = $products; $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs(); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getAllModulePairs(); $this->config->bug->search['params']['severity']['values'] = array(0 => '') + $this->lang->bug->severityList; @@ -783,8 +783,8 @@ class myModel extends model $this->config->product->search['module'] = $queryName; $this->config->product->search['queryID'] = $queryID; $this->config->product->search['actionURL'] = $actionURL; - $this->config->product->search['params']['product']['values'] = array('' => '') + $products; - $this->config->product->search['params']['plan']['values'] = array('' => '') + $this->loadModel('productplan')->getPairs($productIdList, $branchParam); + $this->config->product->search['params']['product']['values'] = $products; + $this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productIdList, $branchParam); $this->config->product->search['fields']['title'] = $this->lang->story->title; unset($this->config->product->search['fields']['module']); @@ -897,8 +897,8 @@ class myModel extends model $this->config->product->search['module'] = $queryName; $this->config->product->search['queryID'] = $queryID; $this->config->product->search['actionURL'] = $actionURL; - $this->config->product->search['params']['product']['values'] = array('' => '') + $products; - $this->config->product->search['params']['plan']['values'] = array('' => '') + $this->loadModel('productplan')->getPairs($productIdList, $branchParam); + $this->config->product->search['params']['product']['values'] = $products; + $this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productIdList, $branchParam); $this->lang->story->title = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->story->title); $this->lang->story->create = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->story->create); @@ -927,8 +927,8 @@ class myModel extends model $this->config->ticket->search['module'] = 'workTicket'; $this->config->ticket->search['queryID'] = $queryID; $this->config->ticket->search['actionURL'] = $actionURL; - $this->config->ticket->search['params']['product']['values'] = array('' => '') + $this->loadModel('feedback')->getGrantProducts(); - $this->config->ticket->search['params']['module']['values'] = array('' => '') + $this->loadModel('tree')->getAllModulePairs(); + $this->config->ticket->search['params']['product']['values'] = $this->loadModel('feedback')->getGrantProducts(); + $this->config->ticket->search['params']['module']['values'] = $this->loadModel('tree')->getAllModulePairs(); $grantProducts = $this->loadModel('feedback')->getGrantProducts(); $productIDlist = array_keys($grantProducts); $this->config->ticket->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($productIDlist, 'all', 'releasetag'); diff --git a/module/personnel/control.php b/module/personnel/control.php index 0261b91d7d..2c224f079a 100644 --- a/module/personnel/control.php +++ b/module/personnel/control.php @@ -194,7 +194,7 @@ class personnel extends control $this->view->objectID = $objectID; $this->view->objectType = $objectType; $this->view->objectName = $objectName; - $this->view->objects = array('' => '') + $this->personnel->getCopiedObjects($objectID, $objectType); + $this->view->objects = $this->personnel->getCopiedObjects($objectID, $objectType); $this->view->module = $module; $this->view->deptID = $deptID; $this->view->appendUsers = $appendUsers; diff --git a/module/pivot/control.php b/module/pivot/control.php index 259dd91122..6e94a4e3af 100644 --- a/module/pivot/control.php +++ b/module/pivot/control.php @@ -154,8 +154,8 @@ class pivot extends control $this->view->end = $end; $this->view->bugs = $this->pivot->getBugs($begin, $end, $product, $execution); $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed'); - $this->view->executions = array('' => '') + $this->pivot->getProjectExecutions(); - $this->view->products = array('' => '') + $this->loadModel('product')->getPairs('', 0, '', 'all'); + $this->view->executions = $this->pivot->getProjectExecutions(); + $this->view->products = $this->loadModel('product')->getPairs('', 0, '', 'all'); $this->view->execution = $execution; $this->view->product = $product; $this->view->submenu = 'test'; @@ -261,7 +261,7 @@ class pivot extends control $sql = $this->loadModel('chart')->parseSqlVars($sql, $filters); $options = $this->pivot->getSysOptions($type, $object, $field, $sql); - return print(html::select('default[]', array('' => '') + $options, '', "class='form-control form-select picker-select' multiple")); + return print(html::select('default[]', $options, '', "class='form-control form-select picker-select' multiple")); } /** diff --git a/module/pivot/model.php b/module/pivot/model.php index f8e8b41665..17aed8a67c 100644 --- a/module/pivot/model.php +++ b/module/pivot/model.php @@ -1893,7 +1893,7 @@ class pivotModel extends model */ public function getSysOptions($type, $object = '', $field = '', $sql = '') { - $options = array('' => ''); + $options = array(); switch($type) { case 'user': diff --git a/module/product/config/search.php b/module/product/config/search.php index 29670238eb..d815ca2b27 100644 --- a/module/product/config/search.php +++ b/module/product/config/search.php @@ -54,7 +54,7 @@ $config->product->search['params']['estimate'] = array('operator' => '=', $config->product->search['params']['source'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->story->sourceList); $config->product->search['params']['sourceNote'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); $config->product->search['params']['fromBug'] = array('operator' => '=', 'control' => 'input', 'values' => ''); -$config->product->search['params']['category'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $lang->story->categoryList); +$config->product->search['params']['category'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->story->categoryList); $config->product->search['params']['openedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); $config->product->search['params']['reviewedBy'] = array('operator' => 'include', 'control' => 'select', 'values' => 'users'); diff --git a/module/product/control.php b/module/product/control.php index 9386a95ae6..eeb6ac55e7 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -909,8 +909,7 @@ class product extends control */ public function ajaxGetProjects(int $productID, string $branch = '', int $projectID = 0) { - $projects = array('' => ''); - $projects += $this->product->getProjectPairsByProduct($productID, $branch); + $projects = $this->product->getProjectPairsByProduct($productID, $branch); if($this->app->getViewType() == 'json') return print(json_encode($projects)); return print(html::select('project', $projects, $projectID, "class='form-control' onchange='loadProductExecutions({$productID}, this.value)'")); @@ -926,8 +925,7 @@ class product extends control */ public function ajaxGetProjectsByBranch(int $productID, string $branch = '') { - $projects = array('' => ''); - $projects += $this->product->getProjectPairsByProduct($productID, $branch); + $projects = $this->product->getProjectPairsByProduct($productID, $branch); $projectList = array(); foreach($projects as $projectID => $projectName) $projectList[] = array('value' => $projectID, 'text' => $projectName); @@ -963,7 +961,7 @@ class product extends control if($pageType == 'batch') { - $executions = array('' => '') + $executions; + $executions = $executions; $executionList = array(); foreach($executions as $executionID => $executionName) $executionList[] = array('value' => $executionID, 'text' => $executionName); return $this->send($executionList); @@ -971,7 +969,7 @@ class product extends control else { $datamultiple = !empty($project) ? "data-multiple={$project->multiple}" : ''; - return print(html::select('execution', array('' => '') + $executions, $executionID, "class='form-control' $datamultiple")); + return print(html::select('execution', $executions, $executionID, "class='form-control' $datamultiple")); } } @@ -987,7 +985,7 @@ class product extends control public function ajaxGetExecutionsByProject(int $productID, int $projectID = 0, string $branch = '') { $noMultipleExecutionID = $projectID ? $this->loadModel('execution')->getNoMultipleID($projectID) : ''; - $executions = array('' => '') + $this->product->getExecutionPairsByProduct($productID, $branch, (string)$projectID, 'multiple,stagefilter'); + $executions = $this->product->getExecutionPairsByProduct($productID, $branch, (string)$projectID, 'multiple,stagefilter'); $executionList = array(); foreach($executions as $executionID => $executionName) $executionList[] = array('value' => $executionID, 'text' => $executionName); @@ -1055,8 +1053,8 @@ class product extends control $lines = array(); if(empty($productID) or $programID) $lines = $this->product->getLinePairs($programID); - if($productID) return print(html::select("lines[$productID]", array('' => '') + $lines, '', "class='form-control picker-select'")); - if(!$productID) return print(html::select('line', array('' => '') + $lines, '', "class='form-control picker-select'")); + if($productID) return print(html::select("lines[$productID]", $lines, '', "class='form-control picker-select'")); + if(!$productID) return print(html::select('line', $lines, '', "class='form-control picker-select'")); } /** diff --git a/module/product/model.php b/module/product/model.php index 2f2025a80f..fe9adb5981 100755 --- a/module/product/model.php +++ b/module/product/model.php @@ -843,7 +843,7 @@ class productModel extends model /* Get module data. */ $projectID = ($this->app->tab == 'project' && empty($projectID)) ? $this->session->project : $projectID; - $searchConfig['params']['module']['values'] = array('' => '') + $this->productTao->getModulesForSearchForm($productID, $products, $branch, $projectID); + $searchConfig['params']['module']['values'] = $this->productTao->getModulesForSearchForm($productID, $products, $branch, $projectID); /* Get branch data. */ if($productID) @@ -881,8 +881,8 @@ class productModel extends model if($this->config->systemMode == 'ALM') { - $this->config->product->all->search['params']['program']['values'] = array('' => '') + $this->loadModel('program')->getTopPairs('', 'noclosed'); - $this->config->product->all->search['params']['line']['values'] = array('' => '') + $this->getLinePairs(); + $this->config->product->all->search['params']['program']['values'] = $this->loadModel('program')->getTopPairs('', 'noclosed'); + $this->config->product->all->search['params']['line']['values'] = $this->getLinePairs(); } $this->loadModel('search')->setSearchParams($this->config->product->all->search); diff --git a/module/product/zen.php b/module/product/zen.php index 94787b2be6..c79a5a261a 100644 --- a/module/product/zen.php +++ b/module/product/zen.php @@ -573,7 +573,7 @@ class productZen extends product $this->view->products = $products; $this->view->fields = $this->getFormFields4BatchEdit(); $this->view->programID = $programID; - $this->view->authPrograms = array('' => '') + $authPrograms; + $this->view->authPrograms = $authPrograms; $this->view->unauthPrograms = $unauthPrograms; unset($this->lang->product->typeList['']); diff --git a/module/productplan/config.php b/module/productplan/config.php index 618327e8c4..1a92f127d2 100644 --- a/module/productplan/config.php +++ b/module/productplan/config.php @@ -31,7 +31,7 @@ $config->productplan->search['fields']['end'] = $lang->productplan->end; $config->productplan->search['params']['id'] = array('operator' => '=', 'control' => 'input', 'values' => ''); $config->productplan->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); $config->productplan->search['params']['branch'] = array('operator' => 'include', 'control' => 'select', 'values' => ''); -$config->productplan->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $lang->productplan->statusList); +$config->productplan->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->productplan->statusList); $config->productplan->search['params']['begin'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); $config->productplan->search['params']['end'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); diff --git a/module/productplan/control.php b/module/productplan/control.php index f94434fa89..29cc8ef1db 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -580,7 +580,7 @@ class productplan extends control { $plans = $this->productplan->getPairs($productID, empty($branch) ? '' : $branch, $expired, true); $planName = $number === '' ? 'plan' : "plan[$number]"; - $plans = empty($plans) ? array('' => '') : $plans; + $plans = empty($plans) ? array() : $plans; echo html::select($planName, $plans, '', "class='form-control'"); } diff --git a/module/productplan/model.php b/module/productplan/model.php index 309a961f8b..b437257c72 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -274,7 +274,7 @@ class productplanModel extends model if($plan->begin == $this->config->productplan->future and $plan->end == $this->config->productplan->future) $planPairs[$plan->id] = $plan->title . ' ' . $this->lang->productplan->future; if($plan->productType != 'normal') $planPairs[$plan->id] = $planPairs[$plan->id] . ' / ' . ($plan->branchName ? $plan->branchName : $this->lang->branch->main); } - return array('' => '') + $planPairs; + return $planPairs; } /** @@ -330,7 +330,7 @@ class productplanModel extends model if($plan->begin == $this->config->productplan->future and $plan->end == $this->config->productplan->future) $planPairs[$plan->id] = $plan->title . ' ' . $this->lang->productplan->future; } - return array('' => '') + $planPairs; + return $planPairs; } /** @@ -357,7 +357,7 @@ class productplanModel extends model if($plan->parent > 0 and isset($parentTitle[$plan->parent])) $plan->title = $parentTitle[$plan->parent] . ' /' . $plan->title; $planPairs[$plan->id] = $plan->title; } - return array('' => '') + $planPairs; + return $planPairs; } /** @@ -391,7 +391,7 @@ class productplanModel extends model { foreach(explode(',', $plan->branch) as $branch) { - if(!isset($planGroup[$plan->product][$branch])) $planGroup[$plan->product][$branch] = array('' => ''); + if(!isset($planGroup[$plan->product][$branch])) $planGroup[$plan->product][$branch] = array(); if($plan->parent == '-1' and strpos($param, 'skipparent') !== false) continue 2; diff --git a/module/program/config/search.php b/module/program/config/search.php index 0e5525901e..5c520181ab 100644 --- a/module/program/config/search.php +++ b/module/program/config/search.php @@ -16,7 +16,7 @@ $config->program->search['fields']['desc'] = $lang->program->desc; /* This is an ordered array. */ $config->program->search['params']['name'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); -$config->program->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $lang->program->statusList); +$config->program->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->program->statusList); $config->program->search['params']['PM'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); $config->program->search['params']['openedDate'] = array('operator' => '=', 'control' => 'date', 'values' => ''); $config->program->search['params']['openedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); diff --git a/module/program/model.php b/module/program/model.php index 0e52d97561..6c490b7015 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -1606,7 +1606,7 @@ class programModel extends model public function getTeamMemberPairs($programID = 0) { $projectList = $this->getProjectList($programID); - if(!$projectList) return array('' => ''); + if(!$projectList) return array(); $users = $this->dao->select("t2.id, t2.account, t2.realname")->from(TABLE_TEAM)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2')->on('t1.account = t2.account') @@ -1614,7 +1614,7 @@ class programModel extends model ->andWhere('t1.type')->eq('project') ->andWhere('t2.deleted')->eq(0) ->fetchAll('account'); - if(!$users) return array('' => ''); + if(!$users) return array(); foreach($users as $account => $user) { @@ -1623,7 +1623,7 @@ class programModel extends model $users[$account] = $firstLetter . ($user->realname ? $user->realname : $user->account); } - return array('' => '') + $users; + return $users; } /* diff --git a/module/project/config.php b/module/project/config.php index 3cf7a5ba88..5337a09ae6 100644 --- a/module/project/config.php +++ b/module/project/config.php @@ -82,7 +82,7 @@ $config->project->search['params']['name'] = array('operator' => 'incl $config->project->search['params']['code'] = array('operator' => '=' , 'control' => 'input' , 'values' => ''); $config->project->search['params']['id'] = array('operator' => '=' , 'control' => 'input' , 'values' => ''); $config->project->search['params']['model'] = array('operator' => '=' , 'control' => 'select', 'values' => $lang->project->modelList); -$config->project->search['params']['hasProduct'] = array('operator' => '=' , 'control' => 'select', 'values' => array('' => '') + $lang->project->projectTypeList); +$config->project->search['params']['hasProduct'] = array('operator' => '=' , 'control' => 'select', 'values' => $lang->project->projectTypeList); $config->project->search['params']['parent'] = array('operator' => '=' , 'control' => 'select', 'values' => ''); $config->project->search['params']['status'] = array('operator' => '=' , 'control' => 'select', 'values' => $lang->project->statusList); $config->project->search['params']['desc'] = array('operator' => 'include', 'control' => 'input' , 'values' => ''); diff --git a/module/project/control.php b/module/project/control.php index 764ac6876b..87a1127561 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1385,8 +1385,8 @@ class project extends control $this->view->userInfoList = $userInfoList; $this->view->roles = $roles; $this->view->dept = $dept; - $this->view->depts = array('' => '') + $this->dept->getOptionMenu(); - $this->view->teams2Import = array('' => '') + $this->loadModel('personnel')->getCopiedObjects($projectID, 'project', true); + $this->view->depts = $this->dept->getOptionMenu(); + $this->view->teams2Import = $this->loadModel('personnel')->getCopiedObjects($projectID, 'project', true); $this->view->currentMembers = $currentMembers; $this->view->copyProjectID = $copyProjectID; $this->view->teamMembers = $this->projectZen->buildMembers($currentMembers, $members2Import, $deptUsers, $project->days); @@ -1796,7 +1796,7 @@ class project extends control public function ajaxGetExecutions(string $projectID, string $executionID = '0', string $mode = '', string $type = 'all'): string { $disabled = ''; - $executions = array('' => ''); + $executions = array(); $projectID = (int)$projectID; if($projectID) diff --git a/module/project/model.php b/module/project/model.php index 6716af416d..2b5754abee 100755 --- a/module/project/model.php +++ b/module/project/model.php @@ -2210,7 +2210,7 @@ class projectModel extends model ->beginIF($this->config->vision)->andWhere("CONCAT(',', t2.visions, ',')")->like("%,{$this->config->vision},%")->fi() ->fetchPairs('account', 'realname'); - return array('' => '') + $members; + return $members; } /** diff --git a/module/project/zen.php b/module/project/zen.php index b48ae0a9bc..c965dcb363 100644 --- a/module/project/zen.php +++ b/module/project/zen.php @@ -256,7 +256,7 @@ class projectZen extends project } $withProgram = $this->config->systemMode == 'ALM'; - $allProducts = array('0' => '') + $this->program->getProductPairs($programID, 'all', 'noclosed', '', $shadow, $withProgram); + $allProducts = $this->program->getProductPairs($programID, 'all', 'noclosed', '', $shadow, $withProgram); $parentProgram = $this->loadModel('program')->getByID($programID); $this->view->title = $this->lang->project->create; @@ -343,7 +343,7 @@ class projectZen extends project $this->view->programList = $this->program->getParentPairs(); $this->view->program = $this->program->getByID($project->parent); $this->view->projectID = $projectID; - $this->view->allProducts = array('0' => '') + $allProducts; + $this->view->allProducts = $allProducts; $this->view->multiBranchProducts = $this->product->getMultiBranchPairs(); $this->view->productPlans = array_filter($productPlansOrder); $this->view->linkedProducts = $linkedProducts; diff --git a/module/repo/control.php b/module/repo/control.php index 5a7d2fec2b..a1367f6f34 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -222,7 +222,7 @@ class repo extends control $this->view->users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted|noclosed'); $this->view->products = $products; $this->view->relatedProjects = $this->repo->filterProject(explode(',', $repo->product), explode(',', $repo->projects)); - $this->view->serviceHosts = array('' => '') + $this->loadModel('pipeline')->getPairs($repo->SCM); + $this->view->serviceHosts = $this->loadModel('pipeline')->getPairs($repo->SCM); $this->display(); @@ -1095,7 +1095,7 @@ class repo extends control else { $this->config->product->search['fields']['branch'] = $this->lang->product->branch; - $this->config->product->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($product->id, 'noempty'); + $this->config->product->search['params']['branch']['values'] = $this->loadModel('branch')->getPairs($product->id, 'noempty'); } session_start(); @@ -1181,7 +1181,7 @@ class repo extends control else { $this->config->bug->search['fields']['branch'] = $this->lang->product->branch; - $this->config->bug->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($product->id, 'noempty'); + $this->config->bug->search['params']['branch']['values'] = $this->loadModel('branch')->getPairs($product->id, 'noempty'); } session_start(); $this->loadModel('search')->setSearchParams($this->config->bug->search); @@ -1892,7 +1892,7 @@ class repo extends control public function ajaxGetExecutions($productID, $branch = 0) { $executions = $this->repo->getExecutionPairs($productID, $branch); - echo html::select('execution', array('' => '') + $executions, '', 'class="form-control chosen"'); + echo html::select('execution', $executions, '', 'class="form-control chosen"'); } /** diff --git a/module/search/model.php b/module/search/model.php index 4be52047d2..ebe5d7f58b 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -332,8 +332,8 @@ class searchModel extends model $users = $this->loadModel('user')->getPairs('realname|noclosed', $appendUsers, $this->config->maxCount); $users['$@me'] = $this->lang->search->me; } - if($hasProduct) $products = array('' => '') + $this->loadModel('product')->getPairs('', $this->session->project); - if($hasExecution) $executions = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project); + if($hasProduct) $products = $this->loadModel('product')->getPairs('', $this->session->project); + if($hasExecution) $executions = $this->loadModel('execution')->getPairs($this->session->project); foreach($fields as $fieldName) { @@ -596,7 +596,7 @@ class searchModel extends model { /* Get title field. */ $title = ($module == 'story') ? 'title' : 'name'; - $resultPairs = array('' => ''); + $resultPairs = array(); foreach($results as $result) $resultPairs[$result->id] = $result->id . ':' . $result->$title; return $resultPairs; } diff --git a/module/sonarqube/control.php b/module/sonarqube/control.php index 4c0f278e39..58f7fef492 100644 --- a/module/sonarqube/control.php +++ b/module/sonarqube/control.php @@ -106,7 +106,7 @@ class sonarqube extends control $projectList = $this->sonarqube->apiGetProjects($sonarqubeID); - $projectPairs = array('' => ''); + $projectPairs = array(); foreach($projectList as $project) { if(!empty($project) and !in_array($project->key, $existsProject)) $projectPairs[$project->key] = $project->name; diff --git a/module/stakeholder/control.php b/module/stakeholder/control.php index b53ec2e4e0..ec12c8d702 100644 --- a/module/stakeholder/control.php +++ b/module/stakeholder/control.php @@ -137,7 +137,7 @@ class stakeholder extends control $this->view->deptUsers = $deptUsers; $this->view->dept = $dept; $this->view->projectID = $projectID; - $this->view->depts = array('' => '') + $this->dept->getOptionMenu(); + $this->view->depts = $this->dept->getOptionMenu(); $this->view->stakeholders = $this->stakeholder->getStakeholders($projectID, 'all', 'id_desc'); $this->view->parentStakeholders = $this->loadModel('program')->getStakeholders($parentID, 't1.id_desc'); @@ -176,13 +176,13 @@ class stakeholder extends control return $this->send($response); } - $users = array('' => ''); + $users = array(); if($stakeholder->from == 'team') $users = $this->loadModel('user')->getTeamMemberPairs($this->session->project, 'project'); elseif($stakeholder->from == 'company') { $members = $this->loadModel('user')->getTeamMemberPairs($this->session->project, 'project'); $users = $this->user->getPairs('noclosed'); - $users = array('' => '') + array_diff($users, $members); + $users = array_diff($users, $members); } $this->view->title = $this->lang->stakeholder->edit; @@ -242,7 +242,7 @@ class stakeholder extends control } $users = $this->loadModel('user')->getPairs('noclosed'); - $companyUsers = array('' => '') + array_diff($users, $members); + $companyUsers = array_diff($users, $members); $stakeholders = $this->loadModel('stakeholder')->getStakeHolderPairs($programID ? $programID : $projectID); foreach($companyUsers as $account => $realname) { diff --git a/module/story/control.php b/module/story/control.php index feb7c046cb..7b51215442 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1527,7 +1527,7 @@ class story extends control $this->view->cases = $this->testcase->getStoryCases($storyID); $this->view->users = $this->user->getPairs('noletter'); - $this->view->resultList = array('' => '') + $this->lang->testcase->resultList; + $this->view->resultList = $this->lang->testcase->resultList; $this->view->story = $this->story->getById($storyID); $this->display(); } @@ -1744,7 +1744,7 @@ class story extends control } elseif($this->app->getViewType() == 'mhtml') { - return print(html::select('story', empty($stories) ? array('' => '') : $stories, $storyID, 'onchange=setStoryRelated()')); + return print(html::select('story', empty($stories) ? array() : $stories, $storyID, 'onchange=setStoryRelated()')); } elseif($pageType == 'batch') { @@ -1754,7 +1754,7 @@ class story extends control } else { - return print(html::select('story', empty($stories) ? array('' => '') : $stories, $storyID, 'class=form-control')); + return print(html::select('story', empty($stories) ? array() : $stories, $storyID, 'class=form-control')); } } @@ -1812,7 +1812,7 @@ class story extends control } $storyID = isset($stories[$storyID]) ? $storyID : 0; - $select = html::select('story', empty($stories) ? array('' => '') : $stories, $storyID, "class='form-control'"); + $select = html::select('story', empty($stories) ? array() : $stories, $storyID, "class='form-control'"); /* If only need options, remove select wrap. */ if($onlyOption == 'true') return print(substr($select, strpos($select, '>') + 1, -10)); diff --git a/module/task/control.php b/module/task/control.php index 049f478adb..ab1611e235 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -974,7 +974,7 @@ class task extends control public function ajaxGetExecutionTasks($executionID, $taskID = 0) { $tasks = $this->task->getExecutionTaskPairs((int)$executionID); - echo html::select('task', empty($tasks) ? array('' => '') : $tasks, $taskID, "class='form-control'"); + echo html::select('task', empty($tasks) ? array() : $tasks, $taskID, "class='form-control'"); } /** diff --git a/module/testcase/control.php b/module/testcase/control.php index 279c374024..3acc854fa4 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -2604,7 +2604,7 @@ class testcase extends control public function ajaxGetModuleScenes($productID, $branch = 0, $moduleID = 0, $stype = 1, $storyID = 0, $onlyOption = 'false', $status = '', $limit = 0, $type = 'full', $hasParent = 1, $number = '', $currentScene = 0) { $optionMenu = $this->testcase->getSceneMenu($productID, $moduleID, 'case', 0, $branch, $currentScene); - $output = ($stype == 1) ? html::select("parent", $optionMenu, "", "class='form-control'") : $output = html::select("scene".$number, $optionMenu, array('' => ''), "class='form-control'"); + $output = ($stype == 1) ? html::select("parent", $optionMenu, "", "class='form-control'") : $output = html::select("scene".$number, $optionMenu, array(), "class='form-control'"); die($output); } diff --git a/module/testsuite/control.php b/module/testsuite/control.php index 19e8a8d6f0..19ac2cf234 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -340,7 +340,7 @@ class testsuite extends control $this->config->testcase->search['actionURL'] = inlink('linkCase', "suiteID=$suiteID¶m=myQueryID"); $scene = $this->testcase->getSceneMenu($productID, 0, '', 0, 0,0); - $this->config->testcase->search['params']['scene']['values'] = array('' => '') + $scene; + $this->config->testcase->search['params']['scene']['values'] = $scene; unset($this->config->testcase->search['fields']['product']); unset($this->config->testcase->search['params']['product']); diff --git a/module/testtask/control.php b/module/testtask/control.php index 49530b9a50..65b686a919 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -550,7 +550,7 @@ class testtask extends control $this->config->testcase->search['module'] = 'testtask'; $this->config->testcase->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct); $this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case'); - $this->config->testcase->search['params']['status']['values'] = array('' => '') + $this->lang->testcase->statusList; + $this->config->testcase->search['params']['status']['values'] = $this->lang->testcase->statusList; $this->config->testcase->search['params']['lib']['values'] = $this->loadModel('caselib')->getLibraries(); $this->config->testcase->search['params']['scene']['values'] = $this->testcase->getSceneMenu($productID, $moduleID, 'case', 0, 0); diff --git a/module/upgrade/control.php b/module/upgrade/control.php index d923fca4c1..609b0b5b31 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -651,8 +651,8 @@ class upgrade extends control $this->view->title = $this->lang->upgrade->mergeProgram; $this->view->programs = $programs; $this->view->programID = $programID; - $this->view->projects = array('' => '') + $this->upgrade->getProjectPairsByProgram($currentProgramID); - $this->view->lines = $currentProgramID ? array('' => '') + $this->loadModel('product')->getLinePairs($currentProgramID) : array('' => ''); + $this->view->projects = $this->upgrade->getProjectPairsByProgram($currentProgramID); + $this->view->lines = $currentProgramID ? $this->loadModel('product')->getLinePairs($currentProgramID) : array('' => ''); $this->view->users = $this->loadModel('user')->getPairs('noclosed|noempty'); $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->systemMode = $systemMode; @@ -779,7 +779,7 @@ class upgrade extends control */ public function ajaxGetProjectPairsByProgram($programID = 0) { - $projects = array('' => '') + $this->upgrade->getProjectPairsByProgram($programID); + $projects = $this->upgrade->getProjectPairsByProgram($programID); echo html::select('projects', $projects, '', 'class="form-control prj-exist" onchange="getProgramStatus(\'project\', this.value)"'); } diff --git a/module/user/control.php b/module/user/control.php index 4546f6fa6b..52c7950e33 100755 --- a/module/user/control.php +++ b/module/user/control.php @@ -532,7 +532,7 @@ class user extends control $groups = $this->dao->select('id, name, role') ->from(TABLE_GROUP) ->fetchAll(); - $groupList = array('' => ''); + $groupList = array(); $roleGroup = array(); foreach($groups as $group) { @@ -576,7 +576,7 @@ class user extends control ->from(TABLE_GROUP) ->where('vision')->eq($this->config->vision) ->fetchAll(); - $groupList = array('' => ''); + $groupList = array(); $roleGroup = array(); foreach($groups as $group) { diff --git a/module/user/model.php b/module/user/model.php index d0ed338bc4..a567d5356e 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -141,7 +141,6 @@ class userModel extends model $users = $this->processAccountSort($users); /* Append empty, closed, and guest users. */ - if(strpos($params, 'noempty') === false) $users = array('' => '') + $users; if(strpos($params, 'noclosed') === false) $users = $users + array('closed' => 'Closed'); if(strpos($params, 'withguest') !== false) $users = $users + array('guest' => 'Guest'); @@ -1456,7 +1455,7 @@ class userModel extends model $contacts = $mode == 'pairs' ? $this->dao->fetchPairs('id', 'listName') : $this->dao->fetchAll(); if(empty($contacts)) return array(); - if(strpos($params, 'withempty') !== false) $contacts = array('' => '') + $contacts; + if(strpos($params, 'withempty') !== false) $contacts = $contacts; if(strpos($params, 'withnote') !== false) $contacts = array('' => $this->lang->user->contacts->common) + $contacts; return $contacts; @@ -2760,7 +2759,7 @@ class userModel extends model if($usersToAppended) $users += $this->dao->select("id, account, realname")->from(TABLE_USER)->where('account')->in($usersToAppended)->fetchAll($keyField); - if(!$users) return array('' => ''); + if(!$users) return array(); foreach($users as $account => $user) { @@ -2770,9 +2769,7 @@ class userModel extends model } /* Put the current user first. */ - $users = $this->processAccountSort($users); - - return array('' => '') + $users; + return $this->processAccountSort($users); } /** diff --git a/module/webhook/control.php b/module/webhook/control.php index 921bb53f63..82cc9bab5b 100644 --- a/module/webhook/control.php +++ b/module/webhook/control.php @@ -226,7 +226,7 @@ class webhook extends control $oauthUsers = $response['data']; $bindedPairs = $this->webhook->getBoundUsers($id); - $useridPairs = array('' => ''); + $useridPairs = array(); foreach($oauthUsers as $name => $userid) $useridPairs[$userid] = $name; $this->app->loadClass('pager', $static = true); diff --git a/module/zanode/config.php b/module/zanode/config.php index 447e580967..84295bfb0c 100644 --- a/module/zanode/config.php +++ b/module/zanode/config.php @@ -42,8 +42,8 @@ $config->zanode->search['fields']['extranet'] = $lang->zanode->extranet; $config->zanode->search['params']['name'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); $config->zanode->search['params']['osName'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); $config->zanode->search['params']['host'] = array('operator' => '=', 'control' => 'select', 'values' => ''); -$config->zanode->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $lang->zanode->statusList); -$config->zanode->search['params']['cpuCores'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $config->zanode->os->cpuCores); +$config->zanode->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->zanode->statusList); +$config->zanode->search['params']['cpuCores'] = array('operator' => '=', 'control' => 'select', 'values' => $config->zanode->os->cpuCores); $config->zanode->search['params']['memory'] = array('operator' => '=', 'control' => 'input', 'values' => ''); $config->zanode->search['params']['diskSize'] = array('operator' => '=', 'control' => 'input', 'values' => ''); diff --git a/module/zanode/control.php b/module/zanode/control.php index 6ab9ceb3a8..a348f49c45 100644 --- a/module/zanode/control.php +++ b/module/zanode/control.php @@ -40,7 +40,7 @@ class zanode extends control $this->config->zanode->search['actionURL'] = $actionURL; $this->config->zanode->search['queryID'] = $queryID; $this->config->zanode->search['onMenuBar'] = 'no'; - $this->config->zanode->search['params']['host']['values'] = array('' => '') + $hosts; + $this->config->zanode->search['params']['host']['values'] = $hosts; $this->loadModel('search')->setSearchParams($this->config->zanode->search); $showFeature = false; @@ -107,7 +107,7 @@ class zanode extends control } $this->view->title = $this->lang->zanode->create; - $this->view->hostPairs = array('' => '') + $this->loadModel('zahost')->getPairs('host'); + $this->view->hostPairs = $this->loadModel('zahost')->getPairs('host'); $this->view->hostID = $hostID; return $this->display();