From 55e85f39acac573f62fdec5b834cb08617775e7d Mon Sep 17 00:00:00 2001 From: chaideqing Date: Fri, 19 Nov 2021 10:44:01 +0800 Subject: [PATCH] * task #44634, optimize story card in xuanxuan --- module/story/css/x.view.css | 8 +- module/story/view/view.html.php | 870 ++++++++++++++++---------------- 2 files changed, 443 insertions(+), 435 deletions(-) diff --git a/module/story/css/x.view.css b/module/story/css/x.view.css index 7714760a97..78bea88bc5 100644 --- a/module/story/css/x.view.css +++ b/module/story/css/x.view.css @@ -2,7 +2,13 @@ #mainMenu .pull-left .divider {display: none;} #mainMenu .pull-right {display: none;} #mainContent .col-4 {display: none;} -#main {margin-bottom: 40px;} +#main {margin-bottom: 40px; min-width: unset;} .main-actions {display: none;} .col-8>.cell {min-height: 300px;} .modal-dialog {width: 90%;} +#mainMenu {position: fixed; width: 100%; z-index: 999;} +#wholeContent {margin-top: 35px; height: calc(100% - 75px); display: block; overflow-y: auto;} +html, body, #main, .container { height: 100%;} +#actionbox {display: none;} +body * {font-size: 13px !important; line-height: 1.42857143; color: rgb(51, 51, 51);} +.page-title > .label-id {min-width: 25px; line-height: 13px;} \ No newline at end of file diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 1ccd139784..7b0152607f 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -62,473 +62,475 @@ -
-
-
-
-
story->legendSpec;?>
-
spec;?>
-
-
-
story->legendVerify;?>
-
verify;?>
-
- - fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true', 'object' => $story));?> - createLink('action', 'comment', "objectType=story&objectID=$story->id"); - ?> - children)):?> -
-
lang->story->children;?>
-
- - - - - - - - - - - - - - children as $child):?> - - - - - - - - - - - -
story->id;?> priAB;?> story->title;?>story->assignedTo;?> story->estimate;?> story->status;?>actions;?>
id;?> - pri . "'>"; - echo $child->pri == '0' ? '' : zget($this->lang->story->priList, $child->pri, $child->pri); - echo ""; - ?> - id", '', true); ?>">title;?>assignedTo);?>estimate . $config->hourUnit;?>processStatus('story', $child);?> - id", $child, 'list', 'alter'); - common::printIcon('story', 'review', "storyID=$child->id", $child, 'list', 'search', '', 'iframe showinonlybody', true); - common::printIcon('story', 'assignTo', "storyID=$child->id", $child, 'list', '', '', 'iframe showinonlybody', true); - common::printIcon('story', 'close', "storyID=$child->id", $child, 'list', '', '', 'iframe showinonlybody', true); - common::printIcon('story', 'activate', "storyID=$child->id", $child, 'list', '', '', 'iframe showinonlybody', true); - common::printIcon('story', 'edit', "storyID=$child->id", $child, 'list'); - common::printIcon('story', 'createCase', "productID=$child->product&branch=$child->branch&module=0&from=¶m=0&story={$child->id}", $child, 'list', 'sitemap'); - ?> -
-
-
- -
- printExtendFields($story, 'div', "position=left&inForm=0&inCell=1");?> -
-
-
- -
";?> - deleted):?> + --> + fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true', 'object' => $story));?> id", $story, 'button', 'alter', '', 'showinonlybody'); - common::printIcon('story', 'review', "storyID=$story->id", $story, 'button', 'search', '', 'showinonlybody'); - if($story->status == 'active' and $story->stage == 'wait' and $story->parent <= 0 and !isonlybody()) - { - $divideLang = $lang->story->subdivide; - $misc = "class='btn divideStory' data-toggle='modal' data-type='iframe' data-width='95%'"; - $link = $this->createLink('story', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', true); - if(common::hasPriv('story', 'batchCreate', $story)) echo html::a($link, " " . $divideLang, '', $misc); - } - - common::printIcon('story', 'assignTo', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); - common::printIcon('story', 'close', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); - common::printIcon('story', 'activate', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); - if(isset($this->config->maxVersion) and $this->app->tab == 'project' and common::hasPriv('story', 'importToLib')) echo html::a('#importToLib', " " . $this->lang->story->importToLib, '', 'class="btn" data-toggle="modal"'); - - if($story->parent >= 0 and $story->type != 'requirement' and (common::hasPriv('testcase', 'create', $story) or common::hasPriv('testcase', 'batchCreate', $story))) - { - $this->app->loadLang('testcase'); - echo "
"; - echo ""; - echo ""; - echo "
"; - } - - if($from == 'execution' and strpos('draft,closed', $story->status) === false) common::printIcon('task', 'create', "execution=$param&storyID=$story->id&moduleID=$story->module", $story, 'button', 'plus', '', 'showinonlybody'); - - echo $this->buildOperateMenu($story, 'view'); - - echo "
"; - common::printIcon('story', 'edit', "storyID=$story->id", $story); - common::printIcon('story', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id&executionID=0&bugID=0&planID=0&todoID=0&extra=&type=$story->type", $story, 'button', 'copy', '', '', '', "data-width='1050'"); - common::printIcon('story', 'delete', "storyID=$story->id", $story, 'button', 'trash', 'hiddenwin'); + $canBeChanged = common::canBeChanged('story', $story); + if($canBeChanged) $actionFormLink = $this->createLink('action', 'comment', "objectType=story&objectID=$story->id"); ?> - -
-
-
-
-
-
- -
-
- + children)):?> +
+
lang->story->children;?>
+
+
+ + + + + + + + + + + - - - - - type != 'normal'):?> - - - - - - - - branch and isset($branches[$storyModule->branch])) - { - $moduleTitle .= $branches[$storyModule->branch] . '/'; - echo $branches[$storyModule->branch] . $lang->arrow; - } - - foreach($modulePath as $key => $module) - { - $moduleTitle .= $module->name; - if(!common::printLink('product', 'browse', "productID=$story->product&branch=$story->branch&browseType=byModule¶m=$module->id", $module->name, '', "data-app='product'")) echo $module->name; - if(isset($modulePath[$key + 1])) - { - $moduleTitle .= '/'; - echo $lang->arrow; - } - } - } - $printModule = ob_get_contents(); - ob_end_clean(); - ?> - - - type != 'requirement'):?> - - + children as $child):?> + + + + + + + - - - - - - - - - - - - - - type != 'requirement'):?> - - - - - - - - - - - - - - - - - - source, $config->story->feedbackSource)):?> - - - - - - - - - - - - - - - - - +
story->id;?> priAB;?> story->title;?>story->assignedTo;?> story->estimate;?> story->status;?>actions;?>
story->product;?>createLink('product', 'view', "productID=$story->product"), $product->name);?>
product->branch;?>product&branch=$story->branch", $branches[$story->branch]);?>
story->module;?>
story->plan;?>
id;?> - planTitle)) - { - foreach($story->planTitle as $planID => $planTitle) - { - if(!common::printLink('productplan', 'view', "planID=$planID", $planTitle, '', "data-app='product'")) echo $lanTitle; - echo '
'; - } - } - ?> + pri . "'>"; + echo $child->pri == '0' ? '' : zget($this->lang->story->priList, $child->pri, $child->pri); + echo ""; + ?> +
id", '', true); ?>">title;?>assignedTo);?>estimate . $config->hourUnit;?>processStatus('story', $child);?> + id", $child, 'list', 'alter'); + common::printIcon('story', 'review', "storyID=$child->id", $child, 'list', 'search', '', 'iframe showinonlybody', true); + common::printIcon('story', 'assignTo', "storyID=$child->id", $child, 'list', '', '', 'iframe showinonlybody', true); + common::printIcon('story', 'close', "storyID=$child->id", $child, 'list', '', '', 'iframe showinonlybody', true); + common::printIcon('story', 'activate', "storyID=$child->id", $child, 'list', '', '', 'iframe showinonlybody', true); + common::printIcon('story', 'edit', "storyID=$child->id", $child, 'list'); + common::printIcon('story', 'createCase', "productID=$child->product&branch=$child->branch&module=0&from=¶m=0&story={$child->id}", $child, 'list', 'sitemap'); + ?>
story->source;?>story->sourceList[$story->source];?>
story->sourceNote;?>sourceNote;?>
story->status;?> processStatus('story', $story);?>
story->stage;?> - stages and $branches) - { - foreach($story->stages as $branch => $stage) if(isset($branches[$branch])) echo $branches[$branch] . ' : ' . $lang->story->stageList[$stage] . '
'; - } - else - { - echo $lang->story->stageList[$story->stage]; - } - ?> -
story->category;?>story->categoryList[$story->category];?>
story->pri;?>pri;?>' title='story->priList, $story->pri)?>'>story->priList, $story->pri)?>
story->estimate;?>estimate . $config->hourUnit;?>
story->feedbackBy;?>feedbackBy;?>
story->notifyEmail;?>notifyEmail;?>
story->keywords;?>keywords;?>
story->legendMailto;?>mailto); foreach($mailto as $account) {if(empty($account)) continue; echo "" . zget($users, trim($account)) . '  '; }?>
-
- - - - - - - - - - - - - + + + + + + + + + + + + + + + source, $config->story->feedbackSource)):?> + + + + + + + + + + + + + + + + + + +
story->openedBy;?>openedBy) . $lang->at . $story->openedDate;?>
story->assignedTo;?>assignedTo) echo zget($users, $story->assignedTo) . $lang->at . $story->assignedDate;?>
story->reviewers;?> + + + + printExtendFields($story, 'div', "position=left&inForm=0&inCell=1");?> +
+
+
+ +
";?> + deleted):?> + id", $story, 'button', 'alter', '', 'showinonlybody'); + common::printIcon('story', 'review', "storyID=$story->id", $story, 'button', 'search', '', 'showinonlybody'); + if($story->status == 'active' and $story->stage == 'wait' and $story->parent <= 0 and !isonlybody()) + { + $divideLang = $lang->story->subdivide; + $misc = "class='btn divideStory' data-toggle='modal' data-type='iframe' data-width='95%'"; + $link = $this->createLink('story', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', true); + if(common::hasPriv('story', 'batchCreate', $story)) echo html::a($link, " " . $divideLang, '', $misc); + } + + common::printIcon('story', 'assignTo', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); + common::printIcon('story', 'close', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); + common::printIcon('story', 'activate', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); + if(isset($this->config->maxVersion) and $this->app->tab == 'project' and common::hasPriv('story', 'importToLib')) echo html::a('#importToLib', " " . $this->lang->story->importToLib, '', 'class="btn" data-toggle="modal"'); + + if($story->parent >= 0 and $story->type != 'requirement' and (common::hasPriv('testcase', 'create', $story) or common::hasPriv('testcase', 'batchCreate', $story))) + { + $this->app->loadLang('testcase'); + echo "
"; + echo ""; + echo ""; + echo "
"; + } + + if($from == 'execution' and strpos('draft,closed', $story->status) === false) common::printIcon('task', 'create', "execution=$param&storyID=$story->id&moduleID=$story->module", $story, 'button', 'plus', '', 'showinonlybody'); + + echo $this->buildOperateMenu($story, 'view'); + + echo "
"; + common::printIcon('story', 'edit', "storyID=$story->id", $story); + common::printIcon('story', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id&executionID=0&bugID=0&planID=0&todoID=0&extra=&type=$story->type", $story, 'button', 'copy', '', '', '', "data-width='1050'"); + common::printIcon('story', 'delete', "storyID=$story->id", $story, 'button', 'trash', 'hiddenwin'); + ?> + +
+ + +
+
+
+ +
+
+ + + + + + + type != 'normal'):?> + + + + + + + $result) + $moduleTitle .= '/'; + echo "/"; + } + else + { + if($storyModule->branch and isset($branches[$storyModule->branch])) { - echo !empty($result) ? ' ' . zget($users, $reviewer) . '' : ' ' . zget($users, $reviewer) . ''; + $moduleTitle .= $branches[$storyModule->branch] . '/'; + echo $branches[$storyModule->branch] . $lang->arrow; + } + + foreach($modulePath as $key => $module) + { + $moduleTitle .= $module->name; + if(!common::printLink('product', 'browse', "productID=$story->product&branch=$story->branch&browseType=byModule¶m=$module->id", $module->name, '', "data-app='product'")) echo $module->name; + if(isset($modulePath[$key + 1])) + { + $moduleTitle .= '/'; + echo $lang->arrow; + } + } + } + $printModule = ob_get_contents(); + ob_end_clean(); + ?> + + + type != 'requirement'):?> + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + type != 'requirement'):?> + + + - - - - - - -
story->product;?>createLink('product', 'view', "productID=$story->product"), $product->name);?>
product->branch;?>product&branch=$story->branch", $branches[$story->branch]);?>
story->module;?>
story->plan;?> + planTitle)) + { + foreach($story->planTitle as $planID => $planTitle) + { + if(!common::printLink('productplan', 'view', "planID=$planID", $planTitle, '', "data-app='product'")) echo $lanTitle; + echo '
'; } } ?> -
story->reviewedDate;?>reviewedBy) echo $story->reviewedDate;?>
story->closedBy;?>closedBy) echo zget($users, $story->closedBy) . $lang->at . $story->closedDate;?>
story->closedReason;?> +
story->source;?>story->sourceList[$story->source];?>
story->sourceNote;?>sourceNote;?>
story->status;?> processStatus('story', $story);?>
story->stage;?> closedReason) echo $lang->story->reasonList[$story->closedReason]; - if(isset($story->extraStories[$story->duplicateStory])) + if($story->stages and $branches) { - echo html::a(inlink('view', "storyID=$story->duplicateStory"), '#' . $story->duplicateStory . ' ' . $story->extraStories[$story->duplicateStory]); + foreach($story->stages as $branch => $stage) if(isset($branches[$branch])) echo $branches[$branch] . ' : ' . $lang->story->stageList[$stage] . '
'; + } + else + { + echo $lang->story->stageList[$story->stage]; } ?> -
story->lastEditedBy;?>lastEditedBy) echo zget($users, $story->lastEditedBy) . $lang->at . $story->lastEditedDate;?>
+
story->category;?>story->categoryList[$story->category];?>
story->pri;?>pri;?>' title='story->priList, $story->pri)?>'>story->priList, $story->pri)?>
story->estimate;?>estimate . $config->hourUnit;?>
story->feedbackBy;?>feedbackBy;?>
story->notifyEmail;?>notifyEmail;?>
story->keywords;?>keywords;?>
story->legendMailto;?>mailto); foreach($mailto as $account) {if(empty($account)) continue; echo "" . zget($users, trim($account)) . '  '; }?>
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
story->openedBy;?>openedBy) . $lang->at . $story->openedDate;?>
story->assignedTo;?>assignedTo) echo zget($users, $story->assignedTo) . $lang->at . $story->assignedDate;?>
story->reviewers;?> + $result) + { + echo !empty($result) ? ' ' . zget($users, $reviewer) . '' : ' ' . zget($users, $reviewer) . ''; + } + } + ?> +
story->reviewedDate;?>reviewedBy) echo $story->reviewedDate;?>
story->closedBy;?>closedBy) echo zget($users, $story->closedBy) . $lang->at . $story->closedDate;?>
story->closedReason;?> + closedReason) echo $lang->story->reasonList[$story->closedReason]; + if(isset($story->extraStories[$story->duplicateStory])) + { + echo html::a(inlink('view', "storyID=$story->duplicateStory"), '#' . $story->duplicateStory . ' ' . $story->extraStories[$story->duplicateStory]); + } + ?> +
story->lastEditedBy;?>lastEditedBy) echo zget($users, $story->lastEditedBy) . $lang->at . $story->lastEditedDate;?>
+
-
-
-
- -
- config->URAndSR):?> -
-
    - id] = $item->title; - foreach($relation as $id => $title) - { - echo "
  • " . html::a($this->createLink('story', 'view', "id=$id", '', true), "#$id $title", '', "class='iframe' data-width='80%'"); - echo html::a($this->createLink('story', 'linkStory', "storyID=$story->id&type=remove&linkedID=$id"), '', 'hiddenwin', "class='deleter hide removeButton'"); - } - ?> - type == 'story') ? $lang->story->requirement : $lang->story->story;?> -
  • createLink('story', 'linkStory', "storyID=$story->id", '', true), $lang->story->link . $linkLang, '', "class='btn btn-info iframe' data-width='95%' id='linkButton'");?> - story->unlink . $linkLang, '', "class='btn btn-info' id='unlinkStory'");?>
  • -
-
- +
+
+ +
+ config->URAndSR):?> +
+
    + id] = $item->title; + foreach($relation as $id => $title) + { + echo "
  • " . html::a($this->createLink('story', 'view', "id=$id", '', true), "#$id $title", '', "class='iframe' data-width='80%'"); + echo html::a($this->createLink('story', 'linkStory', "storyID=$story->id&type=remove&linkedID=$id"), '', 'hiddenwin', "class='deleter hide removeButton'"); + } + ?> + type == 'story') ? $lang->story->requirement : $lang->story->story;?> +
  • createLink('story', 'linkStory', "storyID=$story->id", '', true), $lang->story->link . $linkLang, '', "class='btn btn-info iframe' data-width='95%' id='linkButton'");?> + story->unlink . $linkLang, '', "class='btn btn-info' id='unlinkStory'");?>
  • +
+
+ - type == 'story'):?> -
-
    - tasks as $executionTasks) - { - foreach($executionTasks as $task) - { - if(!isset($executions[$task->execution])) continue; - $executionName = $executions[$task->execution]; - $class = isonlybody() ? 'showinonlybody' : 'iframe'; - echo "
  • " . html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), "[T]$task->id $task->name", '', "class=$class data-width='80%'"); - echo html::a($this->createLink('execution', 'browse', "executionID=$task->execution"), $executionName, '', "class='text-muted'") . '
  • '; - } - } - if(count($story->tasks) == 0) - { - foreach($story->executions as $executionID => $execution) - { - echo "
  • " . html::a($this->createLink('execution', 'browse', "executionID=$executionID"), $execution->name, '', "class='text-muted'") . '
  • '; - } - } - ?> -
-
- -
- - - - - - - - - - - - - - - + + +
story->legendFromBug;?> -
    - id $fromBug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$fromBug->id", '', true), "#$fromBug->id $fromBug->title", '', "class='iframe' data-width='80%'") . '';?> -
-
story->legendBugs;?> -
    - type == 'story'):?> +
    +
      + tasks as $executionTasks) + { + foreach($executionTasks as $task) { - echo "
    • " . html::a($this->createLink('bug', 'view', "bugID=$bug->id", '', true), "[B] #$bug->id $bug->title", '', "class='iframe' data-width='80%'") . '
    • '; + if(!isset($executions[$task->execution])) continue; + $executionName = $executions[$task->execution]; + $class = isonlybody() ? 'showinonlybody' : 'iframe'; + echo "
    • " . html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), "[T]$task->id $task->name", '', "class=$class data-width='80%'"); + echo html::a($this->createLink('execution', 'browse', "executionID=$task->execution"), $executionName, '', "class='text-muted'") . '
    • '; } - ?> -
    -
story->legendCases;?> -
    - tasks) == 0) + { + foreach($story->executions as $executionID => $execution) + { + echo "
  • " . html::a($this->createLink('execution', 'browse', "executionID=$executionID"), $execution->name, '', "class='text-muted'") . '
  • '; + } + } + ?> +
+ + +
+ + + + + + + + + + + + + + + - - -
story->legendFromBug;?> +
    + id $fromBug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$fromBug->id", '', true), "#$fromBug->id $fromBug->title", '', "class='iframe' data-width='80%'") . '';?> +
+
story->legendBugs;?> +
    + id $bug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$bug->id", '', true), "[B] #$bug->id $bug->title", '', "class='iframe' data-width='80%'") . ''; + } + ?> +
+
story->legendCases;?> +
    + id $case->title'>" . html::a($this->createLink('testcase', 'view', "caseID=$case->id", '', true), "[C] #$case->id $case->title", '', $misc) . ''; - } - ?> -
-
+ foreach($cases as $case) + { + echo "
  • " . html::a($this->createLink('testcase', 'view', "caseID=$case->id", '', true), "[C] #$case->id $case->title", '', $misc) . '
  • '; + } + ?> + +
    +
    + printExtendFields($story, 'div', "position=right&inForm=0&inCell=1");?>
    - printExtendFields($story, 'div', "position=right&inForm=0&inCell=1");?>