diff --git a/framework/control.class.php b/framework/control.class.php index e2fd9aa40a..61b1e704b7 100644 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -231,8 +231,8 @@ class control extends baseControl * Print extend fields. * * @param object $object bug | build | feedback | product | productplan | project | release | story | task | testcase | testsuite | testtask - * @param string $type - * @param string $extras + * @param string $type table | div + * @param string $extras columns=1,mode=value,position=right|right|all * @access public * @return void */ diff --git a/framework/router.class.php b/framework/router.class.php index 68ab4b8596..3879faeae1 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -38,6 +38,15 @@ class router extends baseRouter */ public $rawMethod; + /** + * 标记是否是工作流 + * Whether the tag is a workflow + * + * @var bool + * @access public + */ + public $isFlow = false; + /** * Merge system and translated langs. * @@ -287,6 +296,10 @@ class router extends baseRouter */ public function setControlFile($exitIfNone = true) { + /* Set raw module and method name for fetch control. */ + if(empty($this->rawModule)) $this->rawModule = $this->moduleName; + if(empty($this->rawMethod)) $this->rawMethod = $this->methodName; + /* If is not a biz version or is in install mode or in in upgrade mode, call parent method. */ if(!isset($this->config->bizVersion) or defined('IN_INSTALL') or defined('IN_UPGRADE')) return parent::setControlFile($exitIfNone); @@ -306,6 +319,7 @@ class router extends baseRouter { $this->rawModule = $this->moduleName; $this->rawMethod = 'browse'; + $this->isFlow = true; $moduleName = 'flow'; $methodName = 'browse'; @@ -319,6 +333,7 @@ class router extends baseRouter { $this->rawModule = $this->moduleName; $this->rawMethod = $this->methodName; + $this->isFlow = true; $this->loadModuleConfig('workflowaction'); @@ -435,8 +450,8 @@ class router extends baseRouter } /** - * 如果$this->rawModule和$this->rawMethod的值不为空,说明这个请求需要工作流引擎来处理,则要根据工作流引擎的需要重新设置参数。 - * If the values of $this->rawModule and $this->rawMethod are not empty, indicating that the request needs to be processed + * 如果$this->isFlow的值为true,说明这个请求需要工作流引擎来处理,则要根据工作流引擎的需要重新设置参数。 + * If the values of $this->isFlow is true, indicating that the request needs to be processed * by the workflow engine, the parameters are reset according to the needs of the workflow engine. * * @param array $defaultParams the default params defined by the method. @@ -446,14 +461,14 @@ class router extends baseRouter */ public function mergeParams($defaultParams, $passedParams) { - /* If the rawModule and rawMethod is not empty, reset the passed params. */ - if($this->rawModule && $this->rawMethod) + /* If the isFlow is true, reset the passed params. */ + if($this->isFlow) { $passedParams = array_reverse($passedParams); /* 如果请求的方法名不是browse、create、edit、view、delete、export中的任何一个,则需要添加action参数来传递请求的方法名。 */ /* If the requested method name is not any of browse, create, edit, view, delete, or export, you need to add an action parameter to pass the requested method name. */ - if(!in_array($this->rawMethod, $this->config->workflowaction->default->actions)) $passedParams['action'] = $this->rawMethod; + if(isset($this->config->workflowaction->default->actions) and !in_array($this->rawMethod, $this->config->workflowaction->default->actions)) $passedParams['action'] = $this->rawMethod; /* 添加module参数来传递请求的模块名。 */ /* Add the module parameter to pass the requested module name. */ $passedParams['module'] = $this->rawModule; diff --git a/module/backup/css/setting.css b/module/backup/css/setting.css new file mode 100644 index 0000000000..7d7535b0d6 --- /dev/null +++ b/module/backup/css/setting.css @@ -0,0 +1 @@ +.checkbox-primary label{height:auto;} diff --git a/module/bug/view/activate.html.php b/module/bug/view/activate.html.php index 51b56bc2f6..d3af8dcb37 100644 --- a/module/bug/view/activate.html.php +++ b/module/bug/view/activate.html.php @@ -27,14 +27,18 @@
- + + + + + + printExtendFields($bug, 'table', 'columns=1');?> - printExtendFields($bug, 'table', 'columns=2');?> diff --git a/module/bug/view/assignto.html.php b/module/bug/view/assignto.html.php index 47ee363e0f..3953004a00 100644 --- a/module/bug/view/assignto.html.php +++ b/module/bug/view/assignto.html.php @@ -34,11 +34,15 @@ js::set('page', 'assignedto'); + + + + + printExtendFields($bug, 'table', 'columns=1');?> - printExtendFields($bug, 'table', 'columns=2');?> diff --git a/module/bug/view/close.html.php b/module/bug/view/close.html.php index 18d796dd68..6ceb3f22a4 100644 --- a/module/bug/view/close.html.php +++ b/module/bug/view/close.html.php @@ -26,6 +26,10 @@
bug->assignedTo;?>bug->assignedTo;?> resolvedBy, "class='form-control chosen'");?>
bug->status;?>
bug->openedBuild;?> openedBuild, 'size=4 multiple=multiple class="form-control chosen"');?>
comment;?> bug->assignBug;?> assignedTo, "class='form-control chosen'");?>
bug->status;?>status);?>
bug->mailto;?> mailto), 'class="form-control chosen" multiple');?>
comment;?>
+ + + + printExtendFields($bug, 'table', 'columns=1');?> diff --git a/module/bug/view/confirmbug.html.php b/module/bug/view/confirmbug.html.php index ce927a4cda..e9b31fca17 100755 --- a/module/bug/view/confirmbug.html.php +++ b/module/bug/view/confirmbug.html.php @@ -45,11 +45,16 @@ js::set('page', 'confirmbug'); + + + + + + printExtendFields($bug, 'table', 'columns=1');?> - printExtendFields($bug, 'table', 'columns=2');?> diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 4774860a1d..1ab8b9d20e 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -288,7 +288,11 @@ js::set('flow', $config->global->flow); - printExtendFields('', 'table', 'columns=2');?> + + + + + printExtendFields('', 'table', 'columns=1');?> diff --git a/module/bug/view/resolve.html.php b/module/bug/view/resolve.html.php index d7ea3129ff..f2c2523579 100644 --- a/module/bug/view/resolve.html.php +++ b/module/bug/view/resolve.html.php @@ -73,6 +73,10 @@ js::set('productID' , $bug->product); + + + + printExtendFields($bug, 'table', 'columns=1');?> diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index e96b3900fe..1794eefb73 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -376,7 +376,7 @@ - printExtendFields($bug, 'div', "position=right&divCell=true");?> + printExtendFields($bug, 'div', "position=right&mode=value");?> diff --git a/module/common/model.php b/module/common/model.php index 3460942eb2..de2fab9091 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -553,6 +553,13 @@ class commonModel extends model $menu = customModel::getModuleMenu($moduleName); $isMobile = $app->viewType === 'mhtml'; + /* If this is not workflow then use rawModule and rawMethod to judge highlight. */ + if(!$app->isFlow) + { + $currentModule = $app->rawModule; + $currentMethod = $app->rawMethod; + } + /* The beginning of the menu. */ echo $isMobile ? '' : "
bug->status;?>
comment;?>bug->priList, $bug->pri, "class='form-control chosen'");?>
bug->status;?>status);?>
bug->mailto;?> mailto), 'class="form-control chosen" multiple');?>
comment;?>
bug->status;?>
bug->files;?> fetch('file', 'buildform', 'fileCount=1&percent=0.85');?>bug->assignedTo;?>
bug->status;?>
bug->files;?>
- printExtendFields($product, 'table', 'columns=2');?> + + + + + printExtendFields($product, 'table', 'columns=1');?> diff --git a/module/product/view/create.html.php b/module/product/view/create.html.php index 611576ddf4..b089804aec 100644 --- a/module/product/view/create.html.php +++ b/module/product/view/create.html.php @@ -61,6 +61,12 @@ + + + + + + printExtendFields('', 'table', 'columns=1');?> - printExtendFields('', 'table', 'columns=2');?> diff --git a/module/product/view/view.html.php b/module/product/view/view.html.php index 636dbf4c3e..7f3dba8890 100644 --- a/module/product/view/view.html.php +++ b/module/product/view/view.html.php @@ -236,7 +236,7 @@ - printExtendFields($product, 'div', "position=right&divCell=false");?> + printExtendFields($product, 'div', "position=right&mode=value");?> diff --git a/module/project/css/view.css b/module/project/css/view.css index 30864b2f22..25bd885c3e 100644 --- a/module/project/css/view.css +++ b/module/project/css/view.css @@ -10,3 +10,4 @@ .block-dynamic .panel-body {height: 230px; overflow: auto; position: relative;} .block-team div.col-xs-6{white-space: nowrap; overflow: hidden;} +html[lang^='zh-'] .thWidth {width: 80px !important;} diff --git a/module/project/view/activate.html.php b/module/project/view/activate.html.php index 47900bd92c..9696d5ea04 100644 --- a/module/project/view/activate.html.php +++ b/module/project/view/activate.html.php @@ -49,6 +49,10 @@ + + + + printExtendFields($project, 'table', 'columns=5');?> diff --git a/module/project/view/close.html.php b/module/project/view/close.html.php index 85ba9af2ff..984bd88366 100644 --- a/module/project/view/close.html.php +++ b/module/project/view/close.html.php @@ -25,7 +25,11 @@
product->status;?>status);?>
comment;?>
product->status;?>
product->desc;?> @@ -68,7 +74,6 @@
product->acl;?> product->aclList, 'open', "onclick='setWhite(this.value);'", 'block'));?>
project->status;?>
comment;?>
- printExtendFields($project, 'table', 'columns=2');?> + + + + + printExtendFields($project, 'table', 'columns=1');?> diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index 44a0878336..0eea960508 100644 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -82,6 +82,13 @@ + + + + + + + printExtendFields('', 'table', 'columns=1');?> global->flow == 'onlyTask') echo "class='hidden'";?>> - printExtendFields('', 'table', 'columns=3');?> diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index 0cceba831a..feaa6acb5b 100644 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -150,7 +150,7 @@ - printExtendFields($project, 'table', 'columns=3');?> + printExtendFields($project, 'table', 'columns=1');?> diff --git a/module/project/view/putoff.html.php b/module/project/view/putoff.html.php index 8a415c5bf3..2b1c26c28c 100644 --- a/module/project/view/putoff.html.php +++ b/module/project/view/putoff.html.php @@ -55,6 +55,10 @@ + + + + printExtendFields($project, 'table', 'columns=3');?> diff --git a/module/project/view/suspend.html.php b/module/project/view/suspend.html.php index 85245e4e3a..89ef1020c8 100644 --- a/module/project/view/suspend.html.php +++ b/module/project/view/suspend.html.php @@ -24,7 +24,11 @@
project->status;?>
comment;?> project->typeList, '', "class='form-control' onchange='showTypeTips()'");?>
project->typeDesc;?>
project->status;?>
project->manageProducts;?> @@ -135,7 +142,6 @@
project->acl;?> project->aclList, $acl, "onclick='setWhite(this.value);'", 'block'));?>project->desc;?> desc), "rows='6' class='form-control kindeditor' hidefocus='true'");?>
project->acl;?> project->aclList, $project->acl, "onclick='setWhite(this.value);'", 'block'));?>
project->status;?>status);?>
comment;?>
- printExtendFields($project, 'table', 'columns=2');?> + + + + + printExtendFields($project, 'table', 'columns=1');?> diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index 6854d0e7ee..d61c02ba17 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -295,7 +295,7 @@ - printExtendFields($project, 'div', "position=right&divCell=false");?> + printExtendFields($project, 'div', "position=right&mode=value");?> diff --git a/module/release/view/create.html.php b/module/release/view/create.html.php index 82fcd40458..115262cf60 100644 --- a/module/release/view/create.html.php +++ b/module/release/view/create.html.php @@ -30,20 +30,25 @@ release->last . ': ' . $lastRelease->name . ')';?> - + - + - + + + + + + + printExtendFields('', 'table', 'columns=1');?> - printExtendFields('', 'table', 'columns=2');?> diff --git a/module/story/control.php b/module/story/control.php index b6478e7346..5cc915f284 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1705,4 +1705,43 @@ class story extends control if($id) die(html::select("storys[$id]", $storys, '', 'class="form-control"')); die(html::select('story', $storys, '', 'class=form-control')); } + + /** + * Ajax get story status. + * + * @param string $method + * @param string $params + * @access public + * @return void + */ + public function ajaxGetStatus($method, $params = '') + { + parse_str(str_replace(',', '&', $params), $params); + $status = ''; + if($method == 'create') + { + $status = 'draft'; + if(!empty($params['needNotReview'])) $status = 'active'; + if(!empty($params['project'])) $status = 'active'; + if($this->story->checkForceReview()) $status = 'draft'; + } + elseif($method == 'change') + { + $oldStory = $this->dao->findById((int)$params['storyID'])->from(TABLE_STORY)->fetch(); + $status = $oldStory->status; + if($params['changed'] and $oldStory->status == 'active' and empty($params['needNotReview'])) $status = 'changed'; + if($params['changed'] and $oldStory->status == 'active' and $this->story->checkForceReview()) $status = 'changed'; + if($params['changed'] and $oldStory->status == 'draft' and $params['needNotReview']) $status = 'active'; + } + elseif($method == 'review') + { + $oldStory = $this->dao->findById((int)$params['storyID'])->from(TABLE_STORY)->fetch(); + $status = $oldStory->status; + if($params['result'] == 'pass' and $oldStory->status == 'draft') $status = 'active'; + if($params['result'] == 'pass' and $oldStory->status == 'changed') $status = 'active'; + if($params['result'] == 'revert') $status = 'active'; + if($params['result'] == 'reject') $status = 'closed'; + } + die($status); + } } diff --git a/module/story/js/change.js b/module/story/js/change.js index e4b512c5a8..b94ee6d026 100644 --- a/module/story/js/change.js +++ b/module/story/js/change.js @@ -3,8 +3,30 @@ $(function() $('#needNotReview').on('change', function() { $('#assignedTo').attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated'); + getStatus('change', "storyID=" + storyID + ",changed=" + changed + ",needNotReview=" + ($(this).prop('checked') ? 1 : 0)); }); $('#needNotReview').change(); + $specBox = $('#spec').closest('td').find('.ke-container iframe.ke-edit-iframe').contents().find('.article-content'); + $verifyBox = $('#verify').closest('td').find('.ke-container iframe.ke-edit-iframe').contents().find('.article-content'); + $('#title').change(function() + { + newChanged = ($(this).val() != oldStoryTitle || $specBox.html() != oldStorySpec || $verifyBox.html() != oldStoryVerify || $('.file-input-list .file-input.normal').length > 0) ? 1 : 0; + if(changed != newChanged) + { + changed = newChanged; + getStatus('change', "storyID=" + storyID + ",changed=" + changed + ",needNotReview=" + ($('#needNotReview').prop('checked') ? 1 : 0)); + } + }); + $('.ke-container iframe.ke-edit-iframe').contents().find('.article-content').keyup(function() + { + newChanged = ($('#title').val() != oldStoryTitle || $specBox.html() != oldStorySpec || $verifyBox.html() != oldStoryVerify || $('.file-input-list .file-input.normal').length > 0) ? 1 : 0; + if(changed != newChanged) + { + changed = newChanged; + getStatus('change', "storyID=" + storyID + ",changed=" + changed + ",needNotReview=" + ($('#needNotReview').prop('checked') ? 1 : 0)); + } + }); + if($('.tabs .tab-content .tab-pane.active').children().length == 0) $('.tabs .nav-tabs li.active').css('border-bottom', '1px solid #ccc'); }); diff --git a/module/story/js/common.js b/module/story/js/common.js new file mode 100644 index 0000000000..027eaae58b --- /dev/null +++ b/module/story/js/common.js @@ -0,0 +1,7 @@ +function getStatus(method, params) +{ + $.get(createLink('story', 'ajaxGetStatus', "method=" + method + '¶ms=' + params), function(status) + { + $('form #status').val(status).change(); + }); +} diff --git a/module/story/js/create.js b/module/story/js/create.js index 9c838d5288..c1f5f5bb8a 100644 --- a/module/story/js/create.js +++ b/module/story/js/create.js @@ -3,6 +3,7 @@ $(function() $('#needNotReview').on('change', function() { $('#assignedTo').attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated'); + getStatus('create', "product=" + $('#product').val() + ",project=" + projectID + ",needNotReview=" + ($(this).prop('checked') ? 1 : 0)); }); $('#needNotReview').change(); diff --git a/module/story/js/review.js b/module/story/js/review.js index 3f85da5153..a609560c51 100644 --- a/module/story/js/review.js +++ b/module/story/js/review.js @@ -33,6 +33,8 @@ function switchShow(result) $('#assignedTo').val(assignedTo); $('#assignedTo').trigger("chosen:updated"); } + + getStatus('review', "storyID=" + storyID + ",result=" + result); } function setStory(reason) diff --git a/module/story/view/activate.html.php b/module/story/view/activate.html.php index 4ebed040f0..aacb0bb91d 100644 --- a/module/story/view/activate.html.php +++ b/module/story/view/activate.html.php @@ -38,7 +38,7 @@ ?> - printExtendFields($story, 'table', 'columns=2');?> + printExtendFields($story, 'table', 'columns=1');?> diff --git a/module/story/view/assignto.html.php b/module/story/view/assignto.html.php index c298f7032b..ba8cc09ff1 100644 --- a/module/story/view/assignto.html.php +++ b/module/story/view/assignto.html.php @@ -29,7 +29,11 @@ - printExtendFields($story, 'table', 'columns=2');?> + + + + + printExtendFields($story, 'table', 'columns=1');?> diff --git a/module/story/view/change.html.php b/module/story/view/change.html.php index b8821e3f05..a828a4d006 100644 --- a/module/story/view/change.html.php +++ b/module/story/view/change.html.php @@ -24,8 +24,8 @@
project->status;?>
comment;?>
release->build;?>
release->date;?>
release->status;?>
release->desc;?>
files;?> fetch('file', 'buildform');?>
story->comment;?> story->assign;?> assignedTo, "class='form-control chosen'");?>
story->status;?>status);?>
comment;?>
- + - - - - - - - - - - - - - - - + + + printExtendFields($story, 'table', 'columns=1');?> + + + + + + + + + + + + + + + + - + - + - - printExtendFields($story, 'table', 'columns=2');?> + + + + + printExtendFields($story, 'table', 'columns=1');?> diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index f46123ae39..a630dbaf74 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -173,7 +173,11 @@ - printExtendFields('', 'table', 'columns=4');?> + + + + + printExtendFields('', 'table', 'columns=1');?> @@ -210,5 +214,6 @@ +story->module);?> diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 35d4d3f93b..7b29c31993 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -122,7 +122,10 @@ - + status != 'draft'):?> @@ -171,7 +174,7 @@
story->legendLifeTime;?>
story->reviewedBy;?> -
+
+
reviewedBy, 'class="form-control chosen"');?> story->checkForceReview()):?> @@ -34,35 +34,40 @@
story->title;?>title, 'class="form-control"');?>
story->spec;?>spec), 'rows=8 class="form-control"');?>story->specTemplate;?>
story->verify;?>verify), 'rows=6 class="form-control"');?>
story->comment;?>
story->status;?>status);?>
story->title;?>title, 'class="form-control"');?>
story->spec;?>spec), 'rows=8 class="form-control"');?>story->specTemplate;?>
story->verify;?>verify), 'rows=6 class="form-control"');?>
story->comment;?>
attatch;?>fetch('file', 'buildform');?>fetch('file', 'buildform');?>
story->checkAffection;?>
+ lastEditedDate); echo html::submitButton(); @@ -78,4 +83,9 @@ +id);?> +title);?> +spec);?> +verify);?> + diff --git a/module/story/view/close.html.php b/module/story/view/close.html.php index 3208de9fc9..872d185444 100644 --- a/module/story/view/close.html.php +++ b/module/story/view/close.html.php @@ -36,7 +36,11 @@ story->childStories;?>
story->status;?>
story->comment;?>
story->status;?>
story->legendAttatch;?> fetch('file', 'buildform');?>
story->status;?>processStatus('story', $story);?> + processStatus('story', $story);?> + status);?> +
- + diff --git a/module/story/view/review.html.php b/module/story/view/review.html.php index 7e548c22f8..fa3703d339 100644 --- a/module/story/view/review.html.php +++ b/module/story/view/review.html.php @@ -64,11 +64,15 @@ var assignedTo = 'lastEditedBy ? print($story->lastEditedBy) : pri + + + + + printExtendFields($story, 'table', 'columns=1');?> - printExtendFields($story, 'table', 'columns=2');?> @@ -89,4 +93,5 @@ var assignedTo = 'lastEditedBy ? print($story->lastEditedBy) : pri
+id);?> diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 8999f0e8ce..eb9982657b 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -387,7 +387,7 @@ - printExtendFields($story, 'div', "position=right&divCell=true");?> + printExtendFields($story, 'div', "position=right&mode=value");?> diff --git a/module/task/css/edit.css b/module/task/css/edit.css index ad2424880d..75a2ee6bcb 100644 --- a/module/task/css/edit.css +++ b/module/task/css/edit.css @@ -1,4 +1,4 @@ .thWidth{width:85px !important;} .lifeThWidth{width:120px !important;} -html[lang^='zh-'] .thWidth{width:70px !important;} -html[lang^='zh-'] .lifeThWidth{width:70px !important;} +html[lang^='zh-'] .thWidth{width:80px !important;} +html[lang^='zh-'] .lifeThWidth{width:80px !important;} diff --git a/module/task/css/view.css b/module/task/css/view.css index 1c67a36b94..b504eafd4b 100644 --- a/module/task/css/view.css +++ b/module/task/css/view.css @@ -6,3 +6,4 @@ .effortThWidth{width:90px !important;} html[lang^='zh-'] #legendLife .thWidth{width:70px !important;} html[lang^='zh-'] .effortThWidth{width:70px !important;} +html[lang^='zh-'] .thWidth{width:80px !important;} diff --git a/module/task/view/activate.html.php b/module/task/view/activate.html.php index 2732fada2f..05c7c97fd2 100644 --- a/module/task/view/activate.html.php +++ b/module/task/view/activate.html.php @@ -40,6 +40,10 @@ + + + + printExtendFields($task, 'table', 'columns=2');?> diff --git a/module/task/view/assignto.html.php b/module/task/view/assignto.html.php index cc49284cc9..4b8783160d 100644 --- a/module/task/view/assignto.html.php +++ b/module/task/view/assignto.html.php @@ -43,6 +43,10 @@ + + + + printExtendFields($task, 'table', 'columns=2');?> diff --git a/module/task/view/cancel.html.php b/module/task/view/cancel.html.php index dee2fd5f2f..d13a720294 100644 --- a/module/task/view/cancel.html.php +++ b/module/task/view/cancel.html.php @@ -26,6 +26,10 @@
story->openedBy;?>story->openedBy;?> openedBy);?>
story->assignedTo;?> lastEditedBy ? $story->lastEditedBy : $story->openedBy, "class='form-control chosen'");?>
story->status;?>status);?>
story->reviewedBy;?> user->account, "class='form-control' multiple data-placeholder='{$lang->story->chosen->reviewedBy}'");?>
story->comment;?>
task->status;?>
comment;?>
left, "class='form-control'");?> task->hour;?>
task->status;?>status);?>
comment;?>
+ + + + printExtendFields($task, 'table', 'columns=1');?> diff --git a/module/task/view/close.html.php b/module/task/view/close.html.php index 1341e7cd4b..8031ccfa13 100644 --- a/module/task/view/close.html.php +++ b/module/task/view/close.html.php @@ -26,6 +26,10 @@
task->status;?>
comment;?>
+ + + + printExtendFields($task, 'table', 'columns=1');?> diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index 289c7c5765..fda31fb51f 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -59,6 +59,11 @@ + + + + + printExtendFields('', 'table', 'columns=1');?> global->flow != 'onlyTask' and $project->type != 'ops'):?> @@ -205,7 +210,6 @@ desc, "rows='10' class='form-control'");?> - printExtendFields('', 'table', 'columns=3');?> diff --git a/module/task/view/finish.html.php b/module/task/view/finish.html.php index 1489dc40f0..e756408374 100644 --- a/module/task/view/finish.html.php +++ b/module/task/view/finish.html.php @@ -69,6 +69,10 @@ + + + + printExtendFields($task, 'table', 'columns=2');?> diff --git a/module/task/view/pause.html.php b/module/task/view/pause.html.php index 97a66e7377..6f1af85d72 100644 --- a/module/task/view/pause.html.php +++ b/module/task/view/pause.html.php @@ -34,6 +34,10 @@
task->status;?>
comment;?>
task->status;?>
task->story;?>
files;?> fetch('file', 'buildform');?>task->finishedDate;?>
task->status;?>
files;?>
+ + + + printExtendFields($task, 'table', 'columns=1');?> diff --git a/module/task/view/start.html.php b/module/task/view/start.html.php index 66f330cfce..78ed65c9ec 100644 --- a/module/task/view/start.html.php +++ b/module/task/view/start.html.php @@ -61,6 +61,10 @@ + + + + printExtendFields($task, 'table', 'columns=2');?> diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index 53ab880355..7c2ad104c9 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -376,7 +376,7 @@ - printExtendFields($task, 'div', "position=right&divCell=true");?> + printExtendFields($task, 'div', "position=right&mode=value");?> diff --git a/module/testcase/control.php b/module/testcase/control.php index ba21052bd7..2c825205d0 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -1665,4 +1665,19 @@ class testcase extends control $moduleID = !empty($story) ? $story->module : 0; die(json_encode(array('moduleID'=> $moduleID))); } + + /** + * Get status by ajax. + * + * @param string $methodName + * @param int $caseID + * @access public + * @return void + */ + public function ajaxGetStatus($methodName, $caseID = 0) + { + $status = $this->testcase->getStatus($methodName, $caseID); + + die($status); + } } diff --git a/module/testcase/js/create.js b/module/testcase/js/create.js index 0e9a809652..e3a0f6d06a 100644 --- a/module/testcase/js/create.js +++ b/module/testcase/js/create.js @@ -144,4 +144,9 @@ $(function() var value = $select.val(); $selector.find('.pri-text').html('' + value + ''); }); + + $.get(createLink('testcase', 'ajaxGetStatus', 'methodName=create'), function(status) + { + $('#status').val(status).change(); + }); }); diff --git a/module/testcase/js/edit.js b/module/testcase/js/edit.js index 9768a4ee9a..c3d8f439ac 100644 --- a/module/testcase/js/edit.js +++ b/module/testcase/js/edit.js @@ -16,6 +16,21 @@ function getList() $(document).ready(function() { $("#story").chosen(); + + $(document).on('change', '[name^=steps], [name^=expects]', function() + { + var steps = []; + var expects = []; + var status = $('#status').val(); + + $('[name^=steps]').each(function(){ steps.push($(this).val()); }); + $('[name^=expects]').each(function(){ expects.push($(this).val()); }); + + $.post(createLink('testcase', 'ajaxGetStatus', 'methodName=update&caseID=' + caseID), {status : status, steps : steps, expects : expects}, function(status) + { + $('#status').val(status).change(); + }); + }); initSteps(); }); diff --git a/module/testcase/js/review.js b/module/testcase/js/review.js new file mode 100644 index 0000000000..0fca8a6732 --- /dev/null +++ b/module/testcase/js/review.js @@ -0,0 +1,10 @@ +$(function() +{ + $('#result').change(function() + { + $.post(createLink('testcase', 'ajaxGetStatus', 'methodName=review&caseID=' + caseID), {result : $(this).val()}, function(status) + { + $('#status').val(status).change(); + }); + }); +}) diff --git a/module/testcase/model.php b/module/testcase/model.php index dfbe69b5a1..2fd95369eb 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -183,9 +183,10 @@ class testcaseModel extends model */ function create($bugID) { - $now = helper::now(); - $case = fixer::input('post') - ->add('status', $this->forceNotReview() || $this->post->forceNotReview ? 'normal' : 'wait') + $now = helper::now(); + $status = $this->getStatus('create'); + $case = fixer::input('post') + ->add('status', $status) ->add('version', 1) ->add('fromBug', $bugID) ->setDefault('openedBy', $this->app->user->account) @@ -608,12 +609,13 @@ class testcaseModel extends model * Update a case. * * @param int $caseID + * @param bool $getStatus * @access public * @return void */ - public function update($caseID) + public function update($caseID, $getStatus = false) { - $oldCase = $this->getById($caseID); + $oldCase = $this->getById($caseID); if(!empty($_POST['lastEditedDate']) and $oldCase->lastEditedDate != $this->post->lastEditedDate) { dao::$errors[] = $this->lang->error->editedByOther; @@ -659,12 +661,16 @@ class testcaseModel extends model ->setIF($this->post->story != false and $this->post->story != $oldCase->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) ->setDefault('lastEditedBy', $this->app->user->account) ->add('lastEditedDate', $now) - ->setDefault('story,branch', 0) + ->setDefault('story,branch', 0) ->join('stage', ',') ->join('linkCase', ',') ->remove('comment,steps,expects,files,labels,stepType') ->get(); if(!$this->forceNotReview() and $stepChanged) $case->status = 'wait'; + + /* Get status by ajax. */ + if($getStatus) return $case->status; + $this->dao->update(TABLE_CASE)->data($case)->autoCheck()->batchCheck($this->config->testcase->edit->requiredFields, 'notempty')->where('id')->eq((int)$caseID)->exec(); if(!$this->dao->isError()) { @@ -721,14 +727,14 @@ class testcaseModel extends model { if($this->post->result == false) die(js::alert($this->lang->testcase->mustChooseResult)); - $oldCase = $this->dao->findById($caseID)->from(TABLE_CASE)->fetch(); - $now = helper::now(); - $case = fixer::input('post') + $now = helper::now(); + $status = $this->getStatus('review', $caseID); + $case = fixer::input('post') ->remove('result,comment') ->setDefault('reviewedDate', substr($now, 0, 10)) ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) - ->setIF($this->post->result == 'pass', 'status', 'normal') + ->setForce('status', $status) ->join('reviewedBy', ',') ->get(); @@ -1571,4 +1577,28 @@ class testcaseModel extends model return sprintf($this->lang->testcase->summary, count($cases), $executed); } + + /** + * Get status for different method. + * + * @param string $methodName + * @param int $caseID + * @access public + * @return string + */ + public function getStatus($methodName, $caseID = 0) + { + $status = ''; + + if($methodName == 'create') $status = ($this->forceNotReview() || $this->post->forceNotReview) ? 'normal' : 'wait'; + if($methodName == 'update') $status = $this->update($caseID, $getStatus = true); + if($methodName == 'review') + { + $case = $this->dao->findById($caseID)->from(TABLE_CASE)->fetch(); + if($case) $status = $case->status; + if($this->post->result == 'pass') $status = 'normal'; + } + + return $status; + } } diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 4b5315191c..fd99d6d02d 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -206,7 +206,11 @@ - printExtendFields('', 'table', 'columns=2');?> + + + + + printExtendFields('', 'table', 'columns=1');?> diff --git a/module/testcase/view/edit.html.php b/module/testcase/view/edit.html.php index 0998ea6a33..f43d592c4a 100644 --- a/module/testcase/view/edit.html.php +++ b/module/testcase/view/edit.html.php @@ -15,6 +15,7 @@ testcase->deleteStep);?> testcase->insertBefore);?> testcase->insertAfter);?> +id);?>

diff --git a/module/testcase/view/review.html.php b/module/testcase/view/review.html.php index 5ea37f73e1..2f037d5cb1 100644 --- a/module/testcase/view/review.html.php +++ b/module/testcase/view/review.html.php @@ -14,6 +14,7 @@ +id);?>

@@ -31,11 +32,15 @@

+ + + + + printExtendFields($case, 'table', 'columns=1');?> - printExtendFields($case, 'table', 'columns=2');?> diff --git a/module/testtask/control.php b/module/testtask/control.php index 6fc6b9447c..c156c43c4d 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -230,7 +230,6 @@ class testtask extends control $this->view->build = $build; $this->view->stories = $stories; $this->view->bugs = $bugs; - $this->display(); } @@ -499,8 +498,6 @@ class testtask extends control */ public function start($taskID) { - $actions = $this->loadModel('action')->getList('testtask', $taskID); - if(!empty($_POST)) { $changes = $this->testtask->start($taskID); @@ -529,7 +526,8 @@ class testtask extends control $this->view->title = $testtask->name . $this->lang->colon . $this->lang->testtask->start; $this->view->position[] = $this->lang->testtask->common; $this->view->position[] = $this->lang->testtask->start; - $this->view->actions = $actions; + $this->view->users = $this->loadModel('user')->getPairs('nodeleted', $testtask->owner); + $this->view->actions = $this->loadModel('action')->getList('testtask', $taskID); $this->display(); } @@ -542,8 +540,6 @@ class testtask extends control */ public function activate($taskID) { - $actions = $this->loadModel('action')->getList('testtask', $taskID); - if(!empty($_POST)) { $changes = $this->testtask->activate($taskID); @@ -572,7 +568,8 @@ class testtask extends control $this->view->title = $testtask->name . $this->lang->colon . $this->lang->testtask->start; $this->view->position[] = $this->lang->testtask->common; $this->view->position[] = $this->lang->testtask->activate; - $this->view->actions = $actions; + $this->view->users = $this->loadModel('user')->getPairs('nodeleted', $testtask->owner); + $this->view->actions = $this->loadModel('action')->getList('testtask', $taskID); $this->display(); } @@ -585,8 +582,6 @@ class testtask extends control */ public function close($taskID) { - $actions = $this->loadModel('action')->getList('testtask', $taskID); - if(!empty($_POST)) { $changes = $this->testtask->close($taskID); @@ -615,7 +610,7 @@ class testtask extends control $this->view->title = $testtask->name . $this->lang->colon . $this->lang->close; $this->view->position[] = $this->lang->testtask->common; $this->view->position[] = $this->lang->close; - $this->view->actions = $actions; + $this->view->actions = $this->loadModel('action')->getList('testtask', $taskID); $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted|qdfirst'); $this->view->contactLists = $this->user->getContactLists($this->app->user->account, 'withnote'); $this->display(); @@ -630,8 +625,6 @@ class testtask extends control */ public function block($taskID) { - $actions = $this->loadModel('action')->getList('testtask', $taskID); - if(!empty($_POST)) { $changes = $this->testtask->block($taskID); @@ -660,7 +653,8 @@ class testtask extends control $this->view->title = $testtask->name . $this->lang->colon . $this->lang->testtask->start; $this->view->position[] = $this->lang->testtask->common; $this->view->position[] = $this->lang->testtask->block; - $this->view->actions = $actions; + $this->view->users = $this->loadModel('user')->getPairs('nodeleted', $testtask->owner); + $this->view->actions = $this->loadModel('action')->getList('testtask', $taskID); $this->display(); } diff --git a/module/testtask/view/activate.html.php b/module/testtask/view/activate.html.php index 097dbeef64..958cb7c25a 100644 --- a/module/testtask/view/activate.html.php +++ b/module/testtask/view/activate.html.php @@ -23,7 +23,11 @@
task->status;?>
comment;?>
task->status;?>
comment;?>
testcase->status;?>
testcase->files;?> fetch('file', 'buildform');?>testcase->reviewResultAB;?> testcase->reviewResultList, '', 'class=form-control');?>
testcase->status;?>status);?>
testcase->reviewedByAB;?> user->account, "class='form-control chosen' multiple");?>
comment;?>
- printExtendFields($task, 'table', 'columns=1');?> + + + + + printExtendFields($testtask, 'table', 'columns=1');?> diff --git a/module/testtask/view/block.html.php b/module/testtask/view/block.html.php index e7ec34fff1..05301610cf 100644 --- a/module/testtask/view/block.html.php +++ b/module/testtask/view/block.html.php @@ -24,7 +24,11 @@
testtask->status;?>
comment;?>
- printExtendFields($task, 'table', 'columns=1');?> + + + + + printExtendFields($testtask, 'table', 'columns=1');?> diff --git a/module/testtask/view/close.html.php b/module/testtask/view/close.html.php index 23758c500e..aa42a83333 100644 --- a/module/testtask/view/close.html.php +++ b/module/testtask/view/close.html.php @@ -23,7 +23,11 @@
testtask->status;?>
comment;?>
- printExtendFields($task, 'table', 'columns=1');?> + + + + + printExtendFields($testtask, 'table', 'columns=1');?> diff --git a/module/testtask/view/create.html.php b/module/testtask/view/create.html.php index 504dfdb255..788948a874 100644 --- a/module/testtask/view/create.html.php +++ b/module/testtask/view/create.html.php @@ -94,7 +94,7 @@ - printExtendFields('', 'table', 'columns=2');?> + printExtendFields('', 'table', 'columns=1');?> - printExtendFields($task, 'table', 'columns=2');?> + printExtendFields($task, 'table', 'columns=1');?>
testtask->status;?>
comment;?>
diff --git a/module/testtask/view/edit.html.php b/module/testtask/view/edit.html.php index 46a039505f..d920c5bc30 100644 --- a/module/testtask/view/edit.html.php +++ b/module/testtask/view/edit.html.php @@ -83,7 +83,7 @@
diff --git a/module/testtask/view/start.html.php b/module/testtask/view/start.html.php index 124b51940c..f43b5dc55f 100644 --- a/module/testtask/view/start.html.php +++ b/module/testtask/view/start.html.php @@ -25,7 +25,11 @@ - printExtendFields($task, 'table', 'columns=1');?> + + + + + printExtendFields($testtask, 'table', 'columns=1');?> diff --git a/module/testtask/view/view.html.php b/module/testtask/view/view.html.php index 60cbcbbf49..ab463683da 100644 --- a/module/testtask/view/view.html.php +++ b/module/testtask/view/view.html.php @@ -124,7 +124,7 @@ - printExtendFields($task, 'div', "position=right&divCell=true");?> + printExtendFields($task, 'div', "position=right&mode=value");?> diff --git a/module/translate/model.php b/module/translate/model.php index 932ec13f53..e990466815 100644 --- a/module/translate/model.php +++ b/module/translate/model.php @@ -640,7 +640,8 @@ class translateModel extends model $result = true; $tolowerValue = strtolower($value); if($tolowerValue == 'new stdclass()' or $tolowerValue == 'new stdclass') $result = false; - if(strpos($value, '$') === 0 and strpos($value, '$lang->productCommon') === false and strpos($value, '$lang->projectCommon') === false and strpos($value, '.') === false and !preg_match('/[^\$\-\>\w\'\"\[\]]/', $value)) $result = false; + /* Check for only php variable. */ + if(strpos($value, '$') === 0 and $value != '$' and strpos($value, '$lang->productCommon') === false and strpos($value, '$lang->projectCommon') === false and strpos($value, '.') === false and !preg_match('/[^\$\-\>\w\'\"\[\]]/', $value)) $result = false; if($value == '$lang->productCommon' or $value == '$lang->projectCommon') $result = false; return $result; diff --git a/module/tree/view/browse.html.php b/module/tree/view/browse.html.php index 1d2bc30d71..5327ed74b5 100644 --- a/module/tree/view/browse.html.php +++ b/module/tree/view/browse.html.php @@ -242,6 +242,8 @@ $(function() $('#modulesTree').find('li:not(.tree-action-item)').each(function() { var $li = $(this); + if($li.hasClass('tree-item-branch')) return; + var item = $li.data(); orders['orders[' + item.id + ']'] = $li.attr('data-order') || item.order; });
testtask->status;?>
comment;?>