diff --git a/module/my/css/common.css b/module/my/css/common.css index 7f537d48f0..77ce1e6543 100644 --- a/module/my/css/common.css +++ b/module/my/css/common.css @@ -8,3 +8,4 @@ .dropdown-list > li > a:focus {color: #1a4f85; text-decoration: none; background-color: #ddd;} .btn-toolbar .nav-title {float: left; display: inline-block; padding: 6px 12px; margin-bottom: 0; font-size: 13px; font-weight: bolder; line-height: 18px; text-align: center; white-space: nowrap; vertical-align: middle;} +#myStoryForm table tbody tr td.c-actions .dividing-line {width: 1px; height: 16px; display: inline-block; vertical-align: middle; background: #EDEEF2; margin: 0 4px 0 0;} diff --git a/module/my/css/story.css b/module/my/css/story.css index 13919b8117..58b9c22c7d 100644 --- a/module/my/css/story.css +++ b/module/my/css/story.css @@ -10,3 +10,4 @@ .table td.c-hours {padding-right: 12px;} .main-table tbody > tr.table-children > td:first-child::before {width: 3px;} @-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;};} +.c-actions-6 {width: 185px;} diff --git a/module/my/view/requirement.html.php b/module/my/view/requirement.html.php index 37248276c6..b80649aea4 100644 --- a/module/my/view/requirement.html.php +++ b/module/my/view/requirement.html.php @@ -114,8 +114,15 @@ echo common::buildIconButton('story', 'review', "$vars&from=product&storyType=requirement", $story, 'list', 'search', '', 'iframe', true); } echo common::buildIconButton('story', 'recall', "$vars&from=list&storyType=requirement", $story, 'list', 'undo', 'hiddenwin', '', '', '', $lang->story->recall); - echo common::buildIconButton('story', 'close', "$vars&from=&storyType=requirement", $story, 'list', '', '', 'iframe', true); echo common::buildIconButton('story', 'edit', "$vars&from=default&storyType=requirement", $story, 'list', '', '', 'iframe', true, "data-width='95%'"); + + $storyType = 'storyType=requirement'; + if((common::hasPriv('story', 'change', '', $storyType) or (strpos('draft,changing', $story->status) !== false and common::hasPriv('story', 'submitReview', '', $storyType)) or (strpos('active,reviewing,closed', $story->status) !== false and common::hasPriv('story', 'review', '', $storyType)) or common::hasPriv('story', 'recall', '', $storyType) or common::hasPriv('story', 'edit', '', $storyType)) and common::hasPriv('story', 'close', '', $storyType)) + { + echo "
"; + } + + echo common::buildIconButton('story', 'close', "$vars&from=&storyType=requirement", $story, 'list', '', '', 'iframe', true); } ?> @@ -163,8 +170,13 @@ } common::printIcon('story', 'recall', "$vars&from=list&storyType=story", $child, 'list', 'undo', 'hiddenwin', '', '', '', $lang->story->recall); - common::printIcon('story', 'close', "$vars&from=&storyType=story", $child, 'list', '', '', 'iframe', true); common::printIcon('story', 'edit', "$vars&from=default&storyType=story", $child, 'list'); + $storyType = 'storyType=story'; + if((common::hasPriv('story', 'change', '', $storyType) or (strpos('draft,changing', $story->status) !== false and common::hasPriv('story', 'submitReview', '', $storyType)) or (strpos('active,reviewing,closed', $story->status) !== false and common::hasPriv('story', 'review', '', $storyType)) or common::hasPriv('story', 'recall', '', $storyType) or common::hasPriv('story', 'edit', '', $storyType)) and common::hasPriv('story', 'close', '', $storyType)) + { + echo "
"; + } + common::printIcon('story', 'close', "$vars&from=&storyType=story", $child, 'list', '', '', 'iframe', true); } } ?> diff --git a/module/my/view/story.html.php b/module/my/view/story.html.php index b309858436..da9019cbdb 100644 --- a/module/my/view/story.html.php +++ b/module/my/view/story.html.php @@ -116,9 +116,19 @@ } echo common::buildIconButton('story', 'recall', $vars, $story, 'list', 'undo', 'hiddenwin', '', '', '', $lang->story->recall); - echo common::buildIconButton('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); echo common::buildIconButton('story', 'edit', $vars, $story, 'list', '', '', 'iframe', true, "data-width='95%'"); - echo common::buildIconButton('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap', '', 'iframe', true, "data-width='95%'"); + + if((common::hasPriv('story', 'change') or (strpos('draft,changing', $story->status) !== false and common::hasPriv('story', 'submitReview')) or (strpos('active,reviewing,closed', $story->status) !== false and common::hasPriv('story', 'review')) or common::hasPriv('story', 'recall') or common::hasPriv('story', 'edit')) and (common::hasPriv('testcase', 'create') or common::hasPriv('story', 'close'))) + { + echo "
"; + } + + echo common::buildIconButton('testcase', 'create', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap', '', 'iframe', true, "data-width='95%'"); + if(common::hasPriv('testcase', 'create') and common::hasPriv('story', 'close') ) + { + echo "
"; + } + echo common::buildIconButton('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); } ?> @@ -165,9 +175,17 @@ common::printIcon('story', 'review', $vars, $child, 'list', 'search', '', 'iframe', true); } common::printIcon('story', 'recall', $vars, $child, 'list', 'undo', 'hiddenwin', '', '', '', $lang->story->recall); - common::printIcon('story', 'close', $vars, $child, 'list', '', '', 'iframe', true); common::printIcon('story', 'edit', $vars, $child, 'list', '', '', 'iframe', true, "data-width='95%'"); - common::printIcon('story', 'createCase', "productID=$child->product&branch=$child->branch&module=0&from=¶m=0&$vars", $child, 'list', 'sitemap', '', 'iframe', true, "data-width='95%'"); + if((common::hasPriv('story', 'change') or (strpos('draft,changing', $story->status) !== false and common::hasPriv('story', 'submitReview')) or (strpos('active,reviewing,closed', $story->status) !== false and common::hasPriv('story', 'review')) or common::hasPriv('story', 'recall') or common::hasPriv('story', 'edit')) and (common::hasPriv('testcase', 'create') or common::hasPriv('story', 'close'))) + { + echo "
"; + } + common::printIcon('testcase', 'create', "productID=$child->product&branch=$child->branch&module=0&from=¶m=0&$vars", $child, 'list', 'sitemap', '', 'iframe', true, "data-width='95%'"); + if(common::hasPriv('testcase', 'create') and common::hasPriv('story', 'close') ) + { + echo "
"; + } + common::printIcon('story', 'close', $vars, $child, 'list', '', '', 'iframe', true); } ?> diff --git a/module/story/model.php b/module/story/model.php index 135536c34e..5f2d5984aa 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -4193,7 +4193,6 @@ class storyModel extends model if($action == 'close') return $story->status != 'closed'; if($action == 'activate') return $story->status == 'closed'; if($action == 'assignto') return $story->status != 'closed'; - if($action == 'createcase') return $story->type != 'requirement'; if($action == 'batchcreate' and $story->parent > 0) return false; if($action == 'batchcreate' and $story->type == 'requirement' and $story->status != 'closed') return strpos('draft,reviewing,changing', $story->status) === false; if($action == 'batchcreate' and $config->vision == 'lite' and ($story->status == 'active' and ($story->stage == 'wait' or $story->stage == 'projected'))) return true; @@ -4260,9 +4259,10 @@ class storyModel extends model $menu .= $this->buildMenu('story', 'recall', $params . "&from=list&confirm=no&storyType=$story->type", $story, $type, 'undo', 'hiddenwin', 'showinonlybody', false, '', $title); $menu .= $this->buildMenu('story', 'edit', $params . "&kanbanGroup=default&storyType=$story->type", $story, $type, '', '', 'showinonlybody'); + $vars = "storyType={$story->type}"; if(in_array($this->app->tab, array('product', 'project'))) { - if((common::hasPriv('story', 'change') or common::hasPriv('story', 'recall') or (strpos('draft,changing', $story->status) !== false and common::hasPriv('story', 'submitReview')) or (strpos('active,reviewing,closed', $story->status) !== false and common::hasPriv('story', 'review')) or common::hasPriv('story', 'edit')) and ($storyType == 'story' and common::hasPriv('story', 'batchCreate') or common::hasPriv('testcase', 'create') or ($storyType == 'requirement' and common::hasPriv('story', 'close')))) + if((common::hasPriv('story', 'change', '', $vars) or common::hasPriv('story', 'recall', '', $vars) or (strpos('draft,changing', $story->status) !== false and common::hasPriv('story', 'submitReview', '', $vars)) or (strpos('active,reviewing,closed', $story->status) !== false and common::hasPriv('story', 'review', '', $vars)) or common::hasPriv('story', 'edit', '', $vars)) and ($this->app->tab == 'product' and (common::hasPriv('story', 'batchCreate', '', 'storyType=story')) or ($story->type == 'story' and common::hasPriv('testcase', 'create')) or common::hasPriv('story', 'close', '', $vars) or ($this->app->tab == 'project' and common::hasPriv('projectstory', 'unlinkStory')))) { $menu .= "
"; } @@ -4271,7 +4271,7 @@ class storyModel extends model if($this->app->tab == 'product' and $storyType == 'requirement') { $menu .= $this->buildMenu('story', 'close', $params . "&from=&storyType=$story->type", $story, $type, '', '', 'iframe', true); - if(common::hasPriv('story', 'close') and (common::hasPriv('testcase', 'create') or common::hasPriv('story', 'createCase'))) + if(common::hasPriv('story', 'close', '', $vars) and (common::hasPriv('story', 'batchCreate', '', 'storyType=story') or ($story->type == 'story' and common::hasPriv('testcase', 'create')))) { $menu .= "
"; } @@ -4432,26 +4432,32 @@ class storyModel extends model $this->lang->task->batchCreate = $this->lang->execution->batchWBS; if($hasDBPriv) $menu .= common::printIcon('task', 'batchCreate', "executionID=$executionID&story={$story->id}", '', 'list', 'pluses', '', $toTaskDisabled); - if(((strpos('draft,changing', $story->status) !== false and common::hasPriv('story', 'submitReview')) or (strpos('active,reviewing,closed', $story->status) !== false and common::hasPriv('story', 'review')) or common::hasPriv('story', 'recall') or common::hasPriv('task', 'create') or common::hasPriv('task', 'batchCreate')) and (($hasDBPriv and common::hasPriv('testcase', 'create')) or common::hasPriv('execution', 'storyEstimate', $execution) or common::hasPriv('execution', 'unlinkStory', $execution))) + if(((strpos('draft,changing', $story->status) !== false and common::hasPriv('story', 'submitReview')) or (strpos('active,reviewing,closed', $story->status) !== false and common::hasPriv('story', 'review')) or common::hasPriv('story', 'recall') or common::hasPriv('task', 'create') or common::hasPriv('task', 'batchCreate')) and (($hasDBPriv and common::hasPriv('testcase', 'create')) or common::hasPriv('execution', 'storyEstimate', $execution) or common::hasPriv('execution', 'unlinkStory', $execution) or common::hasPriv('execution', 'unlinkStory', $execution))) { $menu .= "
"; } if(common::hasPriv('execution', 'storyEstimate', $execution)) { - $menu .= $this->buildMenu('execution', 'storyEstimate', "executionID=$executionID&storyID=$story->id", $story, $type, 'estimate', '', 'iframe', true, "data-width='470px'"); - } - - if(common::hasPriv('execution', 'unlinkStory', $execution)) - { - $menu .= common::printIcon('execution', 'unlinkStory', "executionID=$executionID&storyID=$story->id&confirm=no", '', 'list', 'unlink', 'hiddenwin'); + $menu .= common::buildIconButton('execution', 'storyEstimate', "executionID=$executionID&storyID=$story->id", '', 'list', 'estimate', '', 'iframe', true, "data-width='470px'"); } $this->lang->testcase->batchCreate = $this->lang->testcase->create; if($hasDBPriv and common::hasPriv('testcase', 'create')) { - $menu .= html::a(helper::createLink('testcase', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&form=¶m=0&storyID=$story->id"), '', '', "class='btn' title='{$this->lang->testcase->create}' data-app='qa'"); + $menu .= common::buildIconButton('testcase', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&form=¶m=0&storyID=$story->id", '', 'list', 'sitemap', '', '', '', "data-app='qa'"); } + + if((common::hasPriv('execution', 'storyEstimate', $execution) or ($hasDBPriv and common::hasPriv('testcase', 'create'))) and common::hasPriv('execution', 'unlinkStory', $execution)) + { + $menu .= "
"; + } + + if(common::hasPriv('execution', 'unlinkStory', $execution)) + { + $menu .= common::buildIconButton('execution', 'unlinkStory', "executionID=$executionID&storyID=$story->id&confirm=no", '', 'list', 'unlink', 'hiddenwin'); + } + } } diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 09f8e1fa85..034e14830c 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -174,7 +174,7 @@ common::printIcon('story', 'close', "storyID=$child->id&from=&storyType=$child->type", $child, 'list', '', '', 'iframe showinonlybody', true); common::printIcon('story', 'activate', "storyID=$child->id&storyType=$child->type", $child, 'list', '', '', 'iframe showinonlybody', true); common::printIcon('story', 'edit', "storyID=$child->id&kanbanGroup=default&storyType=$child->type", $child, 'list'); - common::printIcon('story', 'createCase', "productID=$child->product&branch=$child->branch&module=0&from=¶m=0&story={$child->id}", $child, 'list', 'sitemap'); + common::printIcon('testcase', 'create', "productID=$child->product&branch=$child->branch&module=0&from=¶m=0&story={$child->id}", $child, 'list', 'sitemap'); ?>