diff --git a/module/bug/control.php b/module/bug/control.php index cbf9ff90ed..3b3dab575a 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -106,7 +106,7 @@ class bug extends control elseif($browseType == 'longlifebugs') $bugs = $this->bug->getByLonglifebugs($productID, $projects, $sort, $pager); elseif($browseType == 'postponedbugs') $bugs = $this->bug->getByPostponedbugs($productID, $projects, $sort, $pager); elseif($browseType == 'needconfirm') $bugs = $this->bug->getByNeedconfirm($productID, $projects, $sort, $pager); - elseif($browseType == 'bysearch') $bugs = $this->bug->getBySearch($productID, $projects, $queryID, $sort, $pager); + elseif($browseType == 'bysearch') $bugs = $this->bug->getBySearch($productID, $queryID, $sort, $pager); /* Process the sql, get the conditon partion, save it to session. */ $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug', $browseType == 'needconfirm' ? false : true); diff --git a/module/bug/model.php b/module/bug/model.php index 88df516bfd..fc73d899e6 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -820,7 +820,7 @@ class bugModel extends model */ public function getReleaseBugs($buildID, $productID) { - $project = $this->dao->select('t1.begin') + $project = $this->dao->select('t1.id,t1.begin') ->from(TABLE_PROJECT)->alias('t1') ->leftJoin(TABLE_BUILD)->alias('t2') ->on('t1.id = t2.project') @@ -830,6 +830,7 @@ class bugModel extends model ->where('resolvedDate')->ge($project->begin) ->andWhere('resolution')->ne('postponed') ->andWhere('product')->eq($productID) + ->andWhere("(project != '$project->id' OR (project = '$project->id' and openedDate < '$project->begin'))") ->andWhere('deleted')->eq(0) ->orderBy('openedDate ASC') ->fetchAll(); @@ -1455,14 +1456,13 @@ class bugModel extends model * Get bugs by search. * * @param int $productID - * @param array $projects * @param int $queryID * @param string $orderBy * @param object $pager * @access public * @return array */ - public function getBySearch($productID, $projects, $queryID, $orderBy, $pager = null) + public function getBySearch($productID, $queryID, $orderBy, $pager = null) { if($queryID) { @@ -1482,12 +1482,6 @@ class bugModel extends model if($this->session->bugQuery == false) $this->session->set('bugQuery', ' 1 = 1'); } - /* check the purview of projects.*/ - if(strpos($this->session->bugQuery, '`project`') === false) - { - $var = $this->session->bugQuery . ' AND `project`' . helper::dbIN(array_keys($projects)); - $this->session->set('bugQuery', "$var"); - } if(strpos($this->session->bugQuery, '`product`') === false) { $var = $this->session->bugQuery . ' AND `product` = ' . $productID; diff --git a/module/build/control.php b/module/build/control.php index 6d61cf67c6..f868cddfac 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -342,7 +342,7 @@ class build extends control /* Build the search form. */ $this->loadModel('bug'); - $this->config->product->search['actionURL'] = $this->createLink('build', 'view', "buildID=$buildID&type=bug&link=true¶m=" . helper::safe64Encode("&browseType=bySearch&queryID=myQueryID")); + $this->config->bug->search['actionURL'] = $this->createLink('build', 'view', "buildID=$buildID&type=bug&link=true¶m=" . helper::safe64Encode("&browseType=bySearch&queryID=myQueryID")); $this->config->bug->search['queryID'] = $queryID; $this->config->bug->search['style'] = 'simple'; $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($build->product => $build->product)); @@ -354,7 +354,7 @@ class build extends control if($browseType == 'bySearch') { - $allBugs = $this->bug->getBySearch($build->product, array($build->project => $build->project), $queryID, 'id_desc'); + $allBugs = $this->bug->getBySearch($build->product, $queryID, 'id_desc'); } else { diff --git a/module/build/css/common.css b/module/build/css/common.css index e4a533c43c..376a2a9b6d 100644 --- a/module/build/css/common.css +++ b/module/build/css/common.css @@ -3,3 +3,4 @@ .red {color:red} .green {color:green} #unlinkBugList, #unlinkStoryList{margin-bottom:5px;} +input[type=checkbox].ml-10px{margin-left:10px;} diff --git a/module/productplan/control.php b/module/productplan/control.php index eed25f2228..2bf4e712ee 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -362,7 +362,7 @@ class productplan extends control if($browseType == 'bySearch') { - $allBugs = $this->bug->getBySearch($plan->product, $projects, $queryID, 'id_desc'); + $allBugs = $this->bug->getBySearch($plan->product, $queryID, 'id_desc'); foreach($allBugs as $key => $bug) { if($bug->status != 'active') unset($allBugs[$key]); diff --git a/module/productplan/css/view.css b/module/productplan/css/view.css index 77a2c1b4a5..027f553b05 100644 --- a/module/productplan/css/view.css +++ b/module/productplan/css/view.css @@ -4,3 +4,4 @@ .tabs .tab-content .tab-pane #querybox form{padding-left:0px;} #unlinkBugList, #unlinkStoryList{margin-bottom:5px;} +input[type=checkbox].ml-10px{margin-left:10px;} diff --git a/module/release/control.php b/module/release/control.php index 2058347435..d16e71269f 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -467,7 +467,7 @@ class release extends control if($browseType == 'bySearch') { - $allBugs = $this->bug->getBySearch($release->product, $build->project ? array($build->project => $build->project) : array(), $queryID, 'id_desc'); + $allBugs = $this->bug->getBySearch($release->product, $queryID, 'id_desc'); } else { diff --git a/module/release/css/common.css b/module/release/css/common.css index e4a533c43c..376a2a9b6d 100755 --- a/module/release/css/common.css +++ b/module/release/css/common.css @@ -3,3 +3,4 @@ .red {color:red} .green {color:green} #unlinkBugList, #unlinkStoryList{margin-bottom:5px;} +input[type=checkbox].ml-10px{margin-left:10px;} diff --git a/module/release/css/view.css b/module/release/css/view.css index 83b77b6ce9..421db625b6 100644 --- a/module/release/css/view.css +++ b/module/release/css/view.css @@ -1,4 +1,3 @@ .tabs{position:relative;} -.tabs .tab-content .tab-pane .action{position: absolute; right: 110px; top: 0px;} .tabs .tab-content .tab-pane #querybox{margin:0px} .tabs .tab-content .tab-pane #querybox form{padding-left:0px;} diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index 3c64a8f0f8..5655ba3d9c 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -271,6 +271,9 @@ + id)?> diff --git a/module/search/view/buildform.html.php b/module/search/view/buildform.html.php index 0f4c541b06..31ccfa4975 100644 --- a/module/search/view/buildform.html.php +++ b/module/search/view/buildform.html.php @@ -80,7 +80,7 @@ $(function() setDateField('.date'); }); -var params = ; +var = ; var groupItems = search->groupItems;?>; var setQueryTitle = 'search->setQueryTitle;?>'; var module = ''; @@ -100,11 +100,11 @@ function setDateField(query, fieldNO) $period = $("
").appendTo('body'); $period.find('li > a').click(function(event) { - var target = $('#' + $period.data('target')); + var target = $(query).parents('form').find('#' + $period.data('target')); if(target.length) { target.val($(this).attr('href').replace('#', '$')); - $('#operator' + $period.data('fieldNO')).val('between'); + $(query).parents('form').find('#operator' + $period.data('fieldNO')).val('between'); $period.hide(); } event.stopPropagation(); @@ -119,7 +119,7 @@ function setDateField(query, fieldNO) $period.find("li > a[href='" + $e.val().replace('$', '#') + "']").closest('li').addClass('active'); }).on('changeDate', function() { - var opt = $('#operator' + $period.data('fieldNO')); + var opt = $(query).parents('form').find('#operator' + $period.data('fieldNO')); if(opt.val() == 'between') opt.val('<='); $period.hide(); }).on('hide', function(){setTimeout(function(){$period.hide();}, 200);}); @@ -128,33 +128,35 @@ function setDateField(query, fieldNO) /** * When the value of the fields select changed, set the operator and value of the new field. * - * @param string $fieldName + * @param string $obj * @param int $fieldNO * @access public * @return void */ -function setField(fieldName, fieldNO) +function setField(obj, fieldNO, moduleparams) { - $('#operator' + fieldNO).val(params[fieldName]['operator']); // Set the operator according the param setting. - $('#valueBox' + fieldNO).html($('#box' + fieldName).children().clone()); - $('#valueBox' + fieldNO).children().attr({name : 'value' + fieldNO, id : 'value' + fieldNO}); + var params = moduleparams; + var fieldName = $(obj).val(); + $(obj).parents('form').find('#operator' + fieldNO).val(params[fieldName]['operator']); // Set the operator according the param setting. + $(obj).parents('form').find('#valueBox' + fieldNO).html($(obj).parents('form').find('#box' + fieldName).children().clone()); + $(obj).parents('form').find('#valueBox' + fieldNO).children().attr({name : 'value' + fieldNO, id : 'value' + fieldNO}); if(typeof(params[fieldName]['class']) != undefined && params[fieldName]['class'] == 'date') { - setDateField("#value" + fieldNO, fieldNO); - $("#value" + fieldNO).addClass('date'); // Shortcut the width of the datepicker to make sure align with others. + setDateField($(obj).parents('form').find("#value" + fieldNO), fieldNO); + $(obj).parents('form').find("#value" + fieldNO).addClass('date'); // Shortcut the width of the datepicker to make sure align with others. var groupItems = search->groupItems?>; var maxNO = 2 * groupItems; var nextNO = fieldNO > groupItems ? fieldNO - groupItems + 1 : fieldNO + groupItems; - var nextValue = $('#value' + nextNO).val(); + var nextValue = $(obj).parents('form').find('#value' + nextNO).val(); if(nextNO <= maxNO && fieldNO < maxNO && (nextValue == '' || nextValue == 0)) { - $('#field' + nextNO).val($('#field' + fieldNO).val()); - $('#operator' + nextNO).val('<='); - $('#valueBox' + nextNO).html($('#box' + fieldName).children().clone()); - $('#valueBox' + nextNO).children().attr({name : 'value' + nextNO, id : 'value' + nextNO}); - setDateField("#value" + nextNO, nextNO); - $("#value" + nextNO).addClass('date'); + $(obj).parents('form').find('#field' + nextNO).val($(obj).parents('form').find('#field' + fieldNO).val()); + $(obj).parents('form').find('#operator' + nextNO).val('<='); + $(obj).parents('form').find('#valueBox' + nextNO).html($(obj).parents('form').find('#box' + fieldName).children().clone()); + $(obj).parents('form').find('#valueBox' + nextNO).children().attr({name : 'value' + nextNO, id : 'value' + nextNO}); + setDateField($(obj).parents('form').find("#value" + nextNO), nextNO); + $(obj).parents('form').find("#value" + nextNO).addClass('date'); } } } @@ -165,11 +167,11 @@ function setField(fieldName, fieldNO) * @access public * @return void */ -function resetForm() +function resetForm(obj) { for(i = 1; i <= groupItems * 2; i ++) { - $('#value' + i).val(''); + $(obj).parents('form').find('#value' + i).val(''); } } @@ -179,18 +181,18 @@ function resetForm() * @access public * @return void */ -function showmore() +function showmore(obj) { for(i = 1; i <= groupItems * 2; i ++) { if(i != 1 && i != groupItems + 1 ) { - $('#searchbox' + i).removeClass('hidden'); + $(obj).parents('form').find('#searchbox' + i).removeClass('hidden'); } } - $('#formType').val('more'); - $('#searchform').addClass('showmore'); + $(obj).parents('form').find('#formType').val('more'); + $(obj).parents('form').addClass('showmore'); } /** @@ -199,18 +201,18 @@ function showmore() * @access public * @return void */ -function showlite() +function showlite(obj) { for(i = 1; i <= groupItems * 2; i ++) { if(i != 1 && i != groupItems + 1) { - $('#value' + i).val(''); - $('#searchbox' + i).addClass('hidden'); + $(obj).parents('form').find('#value' + i).val(''); + $(obj).parents('form').find('#searchbox' + i).addClass('hidden'); } } - $('#searchform').removeClass('showmore'); - $('#formType').val('lite'); + $(obj).parents('form').removeClass('showmore'); + $(obj).parents('form').find('#formType').val('lite'); } /** @@ -259,6 +261,7 @@ function deleteQuery() } + diff --git a/www/index.php b/www/index.php index 2f5281560e..96bb36ec5b 100644 --- a/www/index.php +++ b/www/index.php @@ -34,7 +34,7 @@ if(!isset($config->installed) or !$config->installed) die(header('location: inst /* Detect mobile. */ $mobile = $app->loadClass('mobile'); -if(!$mobile->isTablet() and $mobile->isMobile()) +if(!$mobile->isTablet() and $mobile->isMobile() and $config->default->view == 'html') { $config->default->view = 'mhtml'; helper::setViewType();