diff --git a/module/action/model.php b/module/action/model.php index 4aff2f30df..7392802e49 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -32,6 +32,7 @@ class actionModel extends model */ public function create($objectType, $objectID, $actionType, $comment = '', $extra = '', $actor = '', $autoDelete = true) { + if(empty($comment)) return false; $actor = $actor ? $actor : $this->app->user->account; $actionType = strtolower($actionType); if($actor == 'guest' and $actionType == 'logout') return false; diff --git a/module/api/control.php b/module/api/control.php index fd0a3ae46b..31a5822d87 100644 --- a/module/api/control.php +++ b/module/api/control.php @@ -37,7 +37,15 @@ class api extends control */ public function getModel($moduleName, $methodName, $params = '') { - parse_str(str_replace(',', '&', $params), $params); + $params = explode(',', $params); + $newParams = array_shift($params); + foreach($params as $param) + { + $sign = strpos($param, '=') !== false ? '&' : ','; + $newParams .= $sign . $param; + } + + parse_str($newParams, $params); $module = $this->loadModel($moduleName); $result = call_user_func_array(array(&$module, $methodName), $params); if(dao::isError()) die(json_encode(dao::getError())); diff --git a/module/branch/model.php b/module/branch/model.php index 111fa63718..2201ad1b8c 100644 --- a/module/branch/model.php +++ b/module/branch/model.php @@ -82,12 +82,14 @@ class branchModel extends model * * @param array $products * @param string $params + * @param array $appendBranch * @access public * @return array */ - public function getByProducts($products, $params = '') + public function getByProducts($products, $params = '', $appendBranch = '') { - $branches = $this->dao->select('*')->from(TABLE_BRANCH)->where('product')->in($products)->andWhere('deleted')->eq(0)->orderBy('`order`')->fetchAll(); + $branches = $this->dao->select('*')->from(TABLE_BRANCH)->where('product')->in($products)->andWhere('deleted')->eq(0)->orderBy('`order`')->fetchAll('id'); + if(!empty($appendBranch)) $branches += $this->dao->select('*')->from(TABLE_BRANCH)->where('id')->in($appendBranch)->orderBy('`order`')->fetchAll('id'); $products = $this->loadModel('product')->getByIdList($products); $branchGroups = array(); @@ -154,6 +156,12 @@ class branchModel extends model $case = $this->dao->select('id')->from(TABLE_CASE)->where('branch')->eq($branchID)->andWhere('deleted')->eq(0)->limit(1)->fetch(); $release = $this->dao->select('id')->from(TABLE_RELEASE)->where('branch')->eq($branchID)->andWhere('deleted')->eq(0)->limit(1)->fetch(); $build = $this->dao->select('id')->from(TABLE_BUILD)->where('branch')->eq($branchID)->andWhere('deleted')->eq(0)->limit(1)->fetch(); - return empty($module) and empty($story) and empty($bug) and empty($case) and empty($release) and empty($build) and empty($plan); + $project = $this->dao->select('t1.id')->from(TABLE_PROJECT)->alias('t1') + ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id=t2.project') + ->where('t2.branch')->eq($branchID) + ->andWhere('t1.deleted')->eq(0) + ->limit(1) + ->fetch(); + return empty($module) && empty($story) && empty($bug) && empty($case) && empty($release) && empty($build) && empty($plan) && empty($project); } } diff --git a/module/bug/config.php b/module/bug/config.php index 6ac9bc0717..4008b48e33 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -38,7 +38,7 @@ $config->bug->list->exportFields = 'id, product, branch, module, project, story, lastEditedDate, files'; $config->bug->list->customCreateFields = 'project,story,task,pri,severity,os,browser,deadline,mailto,keywords'; -$config->bug->list->customBatchCreateFields = 'module,project,steps,type,pri,severity,os,browser,keywords'; +$config->bug->list->customBatchCreateFields = 'module,project,steps,type,pri,deadline,severity,os,browser,keywords'; $config->bug->list->customBatchEditFields = 'type,severity,pri,productplan,assignedTo,deadline,status,resolvedBy,resolution,os,browser,keywords'; $config->bug->custom = new stdclass(); diff --git a/module/bug/model.php b/module/bug/model.php index d812de7b2d..4b84c3d816 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -163,6 +163,7 @@ class bugModel extends model $bug->openedBuild = implode(',', $data->openedBuilds[$i]); $bug->color = $data->color[$i]; $bug->title = $data->title[$i]; + $bug->deadline = $data->deadlines[$i]; $bug->steps = nl2br($data->stepses[$i]); $bug->type = $data->types[$i]; $bug->pri = $data->pris[$i]; diff --git a/module/bug/view/batchcreate.html.php b/module/bug/view/batchcreate.html.php index 8e61ff3e94..73bd313475 100644 --- a/module/bug/view/batchcreate.html.php +++ b/module/bug/view/batchcreate.html.php @@ -11,6 +11,7 @@ */ ?> +