diff --git a/module/bug/js/batchedit.js b/module/bug/js/batchedit.js index 007112ffdf..77b77c2a6f 100644 --- a/module/bug/js/batchedit.js +++ b/module/bug/js/batchedit.js @@ -78,7 +78,8 @@ $(function() hiddenRequireFields(); }); - var maxAutoDropWidth = document.body.scrollWidth + (document.getElementById('resolutions1').offsetWidth / 2) - document.getElementById('resolutions1').getBoundingClientRect().right; + var firstResolution = $('select[id^="resolutions"]').eq(0); + var maxAutoDropWidth = document.body.scrollWidth + ($(firstResolution)[0].offsetWidth / 2) - $(firstResolution)[0].getBoundingClientRect().right; $('select[id^="duplicateBugs"]').picker( { disableEmptySearch : true, diff --git a/module/group/control.php b/module/group/control.php index e3a4ea2e33..4d8c411c83 100644 --- a/module/group/control.php +++ b/module/group/control.php @@ -152,7 +152,7 @@ class group extends control $this->view->title = $this->lang->company->common . $this->lang->colon . $group->name . $this->lang->colon . $this->lang->group->manageView; $this->view->group = $group; - $this->view->programs = $this->loadModel('program')->getPairs(true, 'order_desc'); + $this->view->programs = $this->loadModel('program')->getParentPairs('', '', false); $this->view->projects = $this->loadModel('project')->getPairsByProgram('', 'all', true, 'order_desc'); $this->view->executions = $this->loadModel('execution')->getPairs(0, 'all', 'all'); $this->view->products = $this->loadModel('product')->getPairs(); diff --git a/module/group/model.php b/module/group/model.php index b9cfd0ba1c..57f02b3fac 100644 --- a/module/group/model.php +++ b/module/group/model.php @@ -243,6 +243,7 @@ class groupModel extends model { $objects = $this->dao->select('id, name, path, type, project, grade, parent')->from(TABLE_PROJECT) ->where('vision')->eq($this->config->vision) + ->andWhere('type')->ne('program') ->andWhere('deleted')->eq(0) ->fetchAll('id'); @@ -251,7 +252,8 @@ class groupModel extends model ->andWhere('deleted')->eq(0) ->fetchAll('id'); - $programs = array(); + $programs = $this->loadModel('program')->getParentPairs('', '', false); + $projects = array(); $executions = array(); $products = array(); @@ -261,12 +263,7 @@ class groupModel extends model $path = explode(',', trim($object->path, ',')); $topID = $path[0]; - if($type == 'program') - { - if($topID != $object->id) $object->name = isset($objects[$topID]) ? $objects[$topID]->name . '/' . $object->name : $object->name; - $programs[$object->id] = $object->name; - } - elseif($type == 'project') + if($type == 'project') { if($topID != $object->id) $object->name = isset($objects[$topID]) ? $objects[$topID]->name . '/' . $object->name : $object->name; $projects[$object->id] = $object->name; diff --git a/module/program/model.php b/module/program/model.php index 1b50a9d93d..0116e8d633 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -1201,10 +1201,12 @@ class programModel extends model * Get program parent pairs * * @param string $model + * @param string $mode + * @param bool $showRoot * @access public * @return array */ - public function getParentPairs($model = '', $mode = 'noclosed') + public function getParentPairs($model = '', $mode = 'noclosed', $showRoot = true) { $modules = $this->dao->select('id,name,parent,path,grade')->from(TABLE_PROGRAM) ->where('type')->eq('program') @@ -1219,7 +1221,7 @@ class programModel extends model { if(strpos(",{$this->app->user->view->programs},", ",{$module->id},") === false and (!$this->app->user->admin)) continue; - $moduleName = '/'; + $moduleName = $showRoot ? '/' : ''; $parentModules = explode(',', $module->path); foreach($parentModules as $parentModuleID) { @@ -1240,7 +1242,7 @@ class programModel extends model $topMenu = array_shift($treeMenu); $topMenu = empty($topMenu) ? '' : $topMenu; $topMenu = explode("\n", trim($topMenu)); - $lastMenu[] = '/'; + $showRoot ? $lastMenu[] = '/' : $lastMenu = array(); foreach($topMenu as $menu) { if(strpos($menu, '|') === false) continue;