diff --git a/bin/ztcli b/bin/ztcli index 027219cfa1..c5e19828b1 100755 --- a/bin/ztcli +++ b/bin/ztcli @@ -19,7 +19,8 @@ if($argc != 2) die('Usage: ' . basename(__FILE__) . " \n"); /* Parse the request into params. */ $request = parse_url(trim($argv[1])); -$_SERVER['HTTP_HOST'] = $request['host']; +$_SERVER['HTTP_HOST'] = $request['host']; +$_SERVER['SCRIPT_NAME'] = $request['path']; /* Load the framework. */ chdir(dirname(dirname(__FILE__))); @@ -27,7 +28,10 @@ include './framework/router.class.php'; include './framework/control.class.php'; include './framework/model.class.php'; include './framework/helper.class.php'; -include realpath('./config/config.php'); + +/* Instance the app and run it. */ +$app = router::createApp('pms', dirname(dirname(__FILE__)), 'router'); +$common = $app->loadCommon(); /* Set the PATH_INFO variable. */ if($config->requestType == 'PATH_INFO') @@ -62,8 +66,5 @@ else $_SERVER['REQUEST_URI'] = isset($request['query']) ? $request['query'] : ''; } -/* Instance the app and run it. */ -$app = router::createApp('pms', dirname(dirname(__FILE__)), 'router'); -$common = $app->loadCommon(); $app->parseRequest(); $app->loadModule(); diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index 24c2f7c80b..def92f96c1 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -1924,6 +1924,8 @@ class baseSQL $pos = stripos($order, 'limit'); $orders = $pos ? substr($order, 0, $pos) : $order; $limit = $pos ? substr($order, $pos) : ''; + if($limit and !preg_match('/^[0-9]+ *(, *[0-9]+)?$/', $limit)) $limit = ''; + $orders = trim($orders); if(empty($orders)) return $this; if(!preg_match('/^(\w+\.)?(`\w+`|\w+)( +(desc|asc))?( *(, *(\w+\.)?(`\w+`|\w+)( +(desc|asc))?)?)*$/i', $orders)) die("Order is bad request, The order is $orders"); diff --git a/module/block/control.php b/module/block/control.php index 7373da8e12..3366454bf0 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -605,7 +605,7 @@ class block extends control public function printProductBlock() { $this->app->loadClass('pager', $static = true); - if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die(); + if(!empty($this->params->type) and preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die(); $num = isset($this->params->num) ? (int)$this->params->num : 0; $type = isset($this->params->type) ? $this->params->type : ''; $pager = pager::init(0, $num , 1); @@ -621,7 +621,7 @@ class block extends control public function printProjectBlock() { $this->app->loadClass('pager', $static = true); - if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die(); + if(!empty($this->params->type) and preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die(); $num = isset($this->params->num) ? (int)$this->params->num : 0; $type = isset($this->params->type) ? $this->params->type : 'all'; $pager = pager::init(0, $num, 1); diff --git a/module/build/control.php b/module/build/control.php index f4ec632ba7..cd9828f6b3 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -39,6 +39,7 @@ class build extends control $product = $this->loadModel('product')->getByID($projectID); $products = $this->product->getPairs(); $this->product->setMenu($products, $projectID); + $this->lang->build->menu = $this->lang->product->menu; $productGroups = array(); $product->branch = 0; @@ -112,6 +113,7 @@ class build extends control $product = $this->loadModel('product')->getById($build->product); $products = $this->product->getPairs(); $this->product->setMenu($products, $build->product); + $this->lang->build->menu = $this->lang->product->menu; $productGroups = array(); $product->branch = 0; @@ -193,6 +195,7 @@ class build extends control { $products = $this->loadModel('product')->getPairs(); $this->product->setMenu($products, $build->product); + $this->lang->build->menu = $this->lang->product->menu; $this->view->title = "BUILD #$build->id $build->name - " . $build->productName; $this->view->position[] = html::a($this->createLink('product', 'build', "productID=$build->product"), $build->productName); diff --git a/module/build/js/view.js b/module/build/js/view.js index f587ae6909..bb88ba4864 100644 --- a/module/build/js/view.js +++ b/module/build/js/view.js @@ -14,15 +14,18 @@ function showLink(buildID, type, param) } $(function() { - if(link == 'true') showLink(buildID, type, param); - fixedTfootAction($('#' + type + 'List').closest('form')); - $('.nav.nav-tabs a[data-toggle="tab"]').on('shown.zui.tab', function(e) + if(flow != 'onlyTest') { - var href = $(e.target).attr('href'); - var tabPane = $(href + '.tab-pane'); - if(tabPane.size() == 0) return; - var formID = tabPane.find('.linkBox').find('form:last'); - if(formID.size() == 0) formID = tabPane.find('form:last'); - setTimeout(function(){fixedTfootAction(formID)}, 100); - }); + if(link == 'true') showLink(buildID, type, param); + fixedTfootAction($('#' + type + 'List').closest('form')); + $('.nav.nav-tabs a[data-toggle="tab"]').on('shown.zui.tab', function(e) + { + var href = $(e.target).attr('href'); + var tabPane = $(href + '.tab-pane'); + if(tabPane.size() == 0) return; + var formID = tabPane.find('.linkBox').find('form:last'); + if(formID.size() == 0) formID = tabPane.find('form:last'); + setTimeout(function(){fixedTfootAction(formID)}, 100); + }); + } }) diff --git a/module/build/model.php b/module/build/model.php index 2d0c382285..c61c3cb791 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -200,6 +200,7 @@ class buildModel extends model ->stripTags($this->config->build->editor->create['id'], $this->config->allowedTags) ->remove('resolvedBy,allchecker,files,labels,uid') ->get(); + if($this->config->global->flow == 'onlyTest') $build->project = 0; $build = $this->loadModel('file')->processImgURL($build, $this->config->build->editor->create['id'], $this->post->uid); $this->dao->insert(TABLE_BUILD)->data($build) diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index e3c18e2d2b..c0a4059f57 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -13,6 +13,7 @@ build->confirmUnlinkStory)?> build->confirmUnlinkBug)?> +config->global->flow)?>