From 784e153159bc427091f13b74a1405824b4fdbf09 Mon Sep 17 00:00:00 2001
From: zenggang
Date: Tue, 22 Mar 2022 07:11:57 +0000
Subject: [PATCH] * Finish task#51115,51116,51120,51121,51133
---
lib/base/filter/filter.class.php | 6 ++++++
module/bug/control.php | 2 +-
module/common/model.php | 12 +++++++++++-
module/execution/view/all.html.php | 2 +-
module/execution/view/task.html.php | 10 +++++++++-
module/task/view/create.html.php | 2 +-
module/tutorial/js/index.js | 7 ++++++-
7 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/lib/base/filter/filter.class.php b/lib/base/filter/filter.class.php
index c0bb4fed05..8db2523369 100644
--- a/lib/base/filter/filter.class.php
+++ b/lib/base/filter/filter.class.php
@@ -692,6 +692,12 @@ class baseValidater
$methodName = $app->getMethodName();
$params = $app->getParams();
+ if($moduleName == 'tutorial' and $methodName == 'wizard' and isset($params['module']) and isset($params['method']))
+ {
+ $moduleName = $params['module'];
+ $methodName = $params['method'];
+ }
+
if($type == 'cookie')
{
$pagerCookie = 'pager' . ucfirst($moduleName) . ucfirst($methodName);
diff --git a/module/bug/control.php b/module/bug/control.php
index 00e55cdb57..6c4e7b16ed 100644
--- a/module/bug/control.php
+++ b/module/bug/control.php
@@ -627,7 +627,7 @@ class bug extends control
$this->view->productName = isset($this->products[$productID]) ? $this->products[$productID] : '';
$this->view->moduleOptionMenu = $moduleOptionMenu;
$this->view->stories = $stories;
- $this->view->projects = defined('TUTORIAL') ? $this->loadModel('tutorial')->getProject() : $projects;
+ $this->view->projects = defined('TUTORIAL') ? $this->loadModel('tutorial')->getProjectPairs() : $projects;
$this->view->project = $project;
$this->view->executions = defined('TUTORIAL') ? $this->loadModel('tutorial')->getExecutionPairs() : $executions;
$this->view->builds = $builds;
diff --git a/module/common/model.php b/module/common/model.php
index c33873e3f0..123f2feb1d 100644
--- a/module/common/model.php
+++ b/module/common/model.php
@@ -957,7 +957,17 @@ class commonModel extends model
$item->moduleName = $currentModule;
$item->methodName = $currentMethod;
$item->vars = $vars;
- $item->url = helper::createLink($currentModule, $currentMethod, $vars, '', 0, 0, 1);
+
+ $isTutorialMode = commonModel::isTutorialMode();
+ if($isTutorialMode && $currentModule == 'project')
+ {
+ if(!empty($vars)) $vars = helper::safe64Encode($vars);
+ $item->url = helper::createLink('tutorial', 'wizard', "module={$currentModule}&method={$currentMethod}¶ms=$vars", '', 0, 0, 1);
+ }
+ else
+ {
+ $item->url = helper::createLink($currentModule, $currentMethod, $vars, '', 0, 0, 1);
+ }
$items[] = $item;
}
diff --git a/module/execution/view/all.html.php b/module/execution/view/all.html.php
index dedbc0c5ee..51054d063e 100644
--- a/module/execution/view/all.html.php
+++ b/module/execution/view/all.html.php
@@ -57,7 +57,7 @@
createLink('programplan', 'create', "projectID=$projectID&productID=$productID"), " " . $lang->programplan->create, '', "class='btn btn-info'");?>
- createLink('execution', 'create', "projectID=$projectID"), " " . ((($from == 'execution') and ($config->systemMode == 'new')) ? $lang->execution->createExec : $lang->execution->create), '', "class='btn btn-info' data-app='execution'");?>
+ createLink('execution', 'create', "projectID=$projectID"), " " . ((($from == 'execution') and ($config->systemMode == 'new')) ? $lang->execution->createExec : $lang->execution->create), '', "class='btn btn-info' data-app='execution' onclick='$(this).data(\"toggle\", \"\")'");?>
diff --git a/module/execution/view/task.html.php b/module/execution/view/task.html.php
index a45516db5d..b236d6092d 100644
--- a/module/execution/view/task.html.php
+++ b/module/execution/view/task.html.php
@@ -149,7 +149,15 @@ body {margin-bottom: 25px;}
createLink('task', 'create', "executionID=$executionID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : ""));
+ if(commonModel::isTutorialMode())
+ {
+ $wizardParams = helper::safe64Encode("executionID=$executionID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : ""));
+ $actionLink = $this->createLink('tutorial', 'wizard', "module=task&method=create¶ms=$wizardParams");
+ }
+ else
+ {
+ $actionLink = $this->createLink('task', 'create', "executionID=$executionID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : ""));
+ }
echo html::a($actionLink, "
{$lang->task->create}", '', "class='btn btn-primary'");
?>
diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php
index 7d5d499463..40de74c6e8 100644
--- a/module/task/view/create.html.php
+++ b/module/task/view/create.html.php
@@ -98,7 +98,7 @@
task->noticeLinkStory, html::a($this->createLink('execution', 'linkStory', "executionID=$execution->id"), $lang->execution->linkStory, '_blank', 'class="text-primary"'), html::a("javascript:loadStories($execution->id)", $lang->refresh, '', 'class="text-primary"'));?>
|
diff --git a/module/tutorial/js/index.js b/module/tutorial/js/index.js
index a62f772ac9..43e450fe1b 100644
--- a/module/tutorial/js/index.js
+++ b/module/tutorial/js/index.js
@@ -198,7 +198,7 @@ $(function()
if($e.css('display') !== 'none')
{
if(!$e.data('zui.tooltip')) $e.addClass('tooltip-tutorial').attr('data-toggle', 'tooltip').tooltip(options);
- $e.tooltip('show');
+ $e.tooltip('show', text);
if($e[0].getBoundingClientRect().top > $(window).height() || $e[0].getBoundingClientRect().top < 0) $e[0].scrollIntoView();
}
else if($e.parent().is('#menuMainNav'))
@@ -303,6 +303,7 @@ $(function()
{
if(status.waitField)
{
+ if(status.waitField.hasClass("chosen-controled")) status.waitField = status.waitField.next();
var fieldName = status.waitField.closest('td').prev('th').text();
if(!fieldName) fieldName = status.waitField.closest('.input-group').find('.input-group-addon:first').text();
if(fieldName) showToolTip(status.waitField, lang.requiredTip.replace('%s', fieldName));
@@ -544,6 +545,10 @@ $(function()
$(document).on('click', '.btn-task', function()
{
showTask($(this).data('name'));
+
+ /* Code for task #51133. */
+ var status = checkTask();
+ if(status.submitOK) window.location.reload();
}).on('click', '.btn-open-target-page', function()
{
appsWindow.$.apps.open(tasks[current].url);