From 37ffcf59d8ecd65e1a0cb4475fb276cc7b7517fe Mon Sep 17 00:00:00 2001 From: Catouse Date: Fri, 22 Apr 2016 18:04:15 +0800 Subject: [PATCH] * code for task #2562. --- module/bug/view/browse.html.php | 2 +- module/custom/control.php | 2 +- module/product/view/browse.html.php | 2 +- module/project/view/story.html.php | 4 +- module/tutorial/control.php | 22 +++++++- module/tutorial/css/index.css | 39 +++++++++++++ module/tutorial/lang/zh-cn.php | 45 ++++++++++++++- module/tutorial/view/index.html.php | 87 +++++++++++++++++++++++++++++ module/tutorial/view/start.html.php | 5 +- 9 files changed, 195 insertions(+), 13 deletions(-) create mode 100644 module/tutorial/css/index.css create mode 100644 module/tutorial/view/index.html.php diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 403ba46524..7755980999 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -65,7 +65,7 @@ js::set('bugBrowseType', ($browseType == 'bymodule' and $this->session->bugBrows
diff --git a/module/custom/control.php b/module/custom/control.php index 7d8f98adf4..01647fcb98 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -237,7 +237,7 @@ class custom extends control die(json_encode(array('result' => $menu ? 'success' : 'fail', 'menu' => $menu), JSON_HEX_QUOT | JSON_HEX_APOS)); } else - { + { $this->view->module = $module; $this->view->method = $method; $this->display(); diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 1348983bb8..c3d1277381 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -59,7 +59,7 @@
diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 4b50bc3de9..74756abc55 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -23,7 +23,7 @@ $this->lang->story->create = $this->lang->project->createStory; if($productID) common::printIcon('story', 'create', "productID=$productID&branch=&moduleID=0&story=0&project=$project->id"); - common::printIcon('project', 'linkStory', "project=$project->id", '', 'button', 'link'); + common::printIcon('project', 'linkStory', "project=$project->id", '', 'button', 'link', '', 'link-story-btn'); ?> @@ -97,7 +97,7 @@ $param = "projectID={$project->id}&story={$story->id}&moduleID={$story->module}"; $lang->task->create = $lang->project->wbs; - common::printIcon('task', 'create', $param, '', 'list', 'smile'); + common::printIcon('task', 'create', $param, '', 'list', 'list-ul', '', '.btn-task-create'); $lang->task->batchCreate = $lang->project->batchWBS; common::printIcon('task', 'batchCreate', "projectID={$project->id}&story={$story->id}", '', 'list', 'stack'); diff --git a/module/tutorial/control.php b/module/tutorial/control.php index edf2fbd8c2..84c15edd84 100644 --- a/module/tutorial/control.php +++ b/module/tutorial/control.php @@ -18,6 +18,7 @@ class tutorial extends control */ public function start() { + $this->view->title = $this->lang->tutorial->common; $this->display(); } @@ -26,8 +27,27 @@ class tutorial extends control * @access public * @return void */ - public function index() + public function index($task = '') { + if($_POST) + { + $account = $this->app->user->account; + $setting = $_POST['tasks']; + + if(empty($setting)) $this->send(array('result' => 'fail')); + $this->loadModel('setting')->setItem("$account.tutorial.tasks.setting", $setting); + $this->send(array('result' => 'success')); + } + $setting = $this->config->tasks->setting; + + if($this->viewType === 'json') + { + die(json_encode(array('result' => isset($setting) ? 'success' : 'fail', 'setting' => $setting), JSON_HEX_QUOT | JSON_HEX_APOS)); + } + + $this->view->title = $this->lang->tutorial->common; + $this->view->current = $task; + $this->view->setting = $setting; $this->display(); } } diff --git a/module/tutorial/css/index.css b/module/tutorial/css/index.css new file mode 100644 index 0000000000..f9e3a00685 --- /dev/null +++ b/module/tutorial/css/index.css @@ -0,0 +1,39 @@ +#pageContainer {position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden;} +#iframeWrapper {position: absolute; left: 0; top: 0; bottom: 0; right: 300px; display: block} +#sidebar {position: absolute; right: 0; top: 0; bottom: 0; width: 300px; background: #f5f5f5; overflow-y: auto; padding-top: 66px; border-left: 1px solid #ddd} +#sidebar > header {background: #EBF2F9; padding: 15px; position: fixed; top: 0; right: 0; z-index: 10; width: 300px; border-bottom: 1px solid #ddd} +#sidebar > header > h2 {margin: 0 0 0 40px; font-size: 18px; padding: 0; line-height: 36px;} +#sidebar > header .start-icon {position: absolute; left: 12px; top: 15px; width: 36px; height: 36px; text-align: center; margin-right: 5px;} +#sidebar > header .start-icon > .icon-front {color: #fff; position: absolute; width: 36px; height: 36px; line-height: 36px; top: 0; left: 0} +#sidebar > header .start-icon > .icon-back {font-size: 35px; color: #114f8e; line-height: 36px;} +#sidebar > header > .actions {position: absolute; right: 15px; top: 15px} +#sidebar > section {padding: 20px 10px; border-top: 1px solid #ddd} +#sidebar > section > h4 {margin: 0 0 10px 0; font-size: 14px; color: #808080; font-weight: normal} +#task {border: none} +#task > .panel-heading {padding: 10px; background: #114f8e; color: #fff; font-size: 15px; transition: background .4s;} +#task > .panel-heading > .pull-right {margin-top: 3px; opacity: 0; transition: opacity .4s, transform .4s; transform: scale(2.5, 2)} +#task > .panel-body {border: 1px solid #ddd; border-top: none; padding: 10px} +#task > .panel-body > ul, #task > .panel-body > p {margin: 0; line-height: 20px;} +#task.finish > .panel-heading {background: #38B03F} +#task.finish > .panel-heading .task-name {text-decoration: line-through;} +#task.finish.finish > .panel-heading > .pull-right {opacity: 1; transform: scale(1)} +#task .task-nav {color: #114f8e; display: inline-block; background: #EBF2F9; padding: 1px 5px 0; transition: all .2s} +#task .task-nav:hover {color: #fff; background: #114f8e; cursor: pointer} +#tasksProgress {background: #ccc;} +#tasksProgress > .progress-bar {background: #114f8e; height: 4px; margin-bottom: 15px; transition: background .4s, width .4s;} +#tasksProgress.finish > .progress-bar {width: 100%!important; background: #38B03F} +#tasks {background: #fff;} +#tasks > li > a > .pull-right {opacity: 0; transition: opacity .4s, transform .4s; transform: scale(2.5, 2); color: #38B03F} +#tasks > li.finish > a, #tasks > li.finish.active > a {box-shadow: inset 2px 0 0 #38B03F; border-left-color: #38B03F; color: #808080} +#tasks > li.finish > a > .pull-right {opacity: 1; transform: scale(1)} +#tasks > li.finish > a > .task-name {text-decoration: line-through;} +#tasks > li.active > a, #tasks > li.active.finish > a {box-shadow: inset 2px 0 0 #114f8e; border-color: #ddd; border-left-color: #114f8e; color: #114f8e; background: #EBF2F9} +#tasks > li.finish > a:hover, #tasks > li.active > a:hover {background-color: #f1f1f1} +#finish {background: #38B03F; color: #fff; text-align: center; overflow: hidden; height: 220px; margin-top: -220px; transform: scale(.5); transition: margin-top .4s, transform .4s, opacity .4s; opacity: 0; transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1)} +#finish.show {margin-top: 0; transform: scale(1); opacity: 1} +#finish > h3 {margin-bottom: 20px} +#finish .start-icon > .icon-spin {-moz-animation: spin 10s infinite linear;-o-animation: spin 10s infinite linear;-webkit-animation: spin 10s infinite linear;animation: spin 10s infinite linear;} +#finish .start-icon {width: 60px; height: 60px; text-align: center; margin: 10px auto; position: relative} +#finish .start-icon > .icon-front {color: #38B03F; width: 60px; height: 60px; line-height: 60px; position: absolute; left: 0; top: 0; font-size: 28px;} +#finish .start-icon > .icon-back {font-size: 56px; color: #fff; line-height: 60px;} +#finish .btn-success {border-color: #DDF4DF} diff --git a/module/tutorial/lang/zh-cn.php b/module/tutorial/lang/zh-cn.php index 7716a5a7b5..411a1786da 100644 --- a/module/tutorial/lang/zh-cn.php +++ b/module/tutorial/lang/zh-cn.php @@ -11,6 +11,45 @@ */ $lang->tutorial = new stdclass(); -$lang->tutorial->common = '新手教程'; -$lang->tutorial->desc = '通过完成一系列任务,快速了解禅道的基本使用方法。这可能会花费您10分钟,你可以随时退出任务。'; -$lang->tutorial->start = '立即开始'; +$lang->tutorial->common = '新手教程'; +$lang->tutorial->desc = '通过完成一系列任务,快速了解禅道的基本使用方法。这可能会花费您10分钟,你可以随时退出任务。'; +$lang->tutorial->start = '立即开始'; +$lang->tutorial->exit = '退出任务'; +$lang->tutorial->congratulation = '恭喜,你已完成了所有任务!'; +$lang->tutorial->restart = '重新开始'; +$lang->tutorial->currentTask = '当前任务'; +$lang->tutorial->allTasks = '所有任务'; +$lang->tutorial->previous = '上一个'; +$lang->tutorial->nextTask = '下一个任务'; + +$lang->tutorial->tasks = array(); + +$lang->tutorial->tasks['createAccount'] = array('title' => '创建账号'); +$lang->tutorial->tasks['createAccount']['nav'] = array('module' => 'company', 'method' => 'create', 'menu' => 'addUser', 'form' => '#dataform', 'submit' => '#submit'); +$lang->tutorial->tasks['createAccount']['desc'] = "

在系统创建一个新的用户账号:

"; + +$lang->tutorial->tasks['createProduct'] = array('title' => '创建产品'); +$lang->tutorial->tasks['createProduct']['nav'] = array('module' => 'product', 'method' => 'create', 'menu' => 'create', 'form' => '#dataform', 'submit' => '#submit'); +$lang->tutorial->tasks['createProduct']['desc'] = "

在系统创建一个新的产品:

"; + +$lang->tutorial->tasks['createStory'] = array('title' => '创建需求'); +$lang->tutorial->tasks['createStory']['nav'] = array('module' => 'story', 'method' => 'create', 'menu' => 'story', 'feature' => '.create-story-btn', 'form' => '#dataform', 'submit' => '#submit'); +$lang->tutorial->tasks['createStory']['desc'] = "

在系统创建一个新的需求:

"; + +$lang->tutorial->tasks['createProject'] = array('title' => '创建项目'); +$lang->tutorial->tasks['createProject']['nav'] = array('module' => 'project', 'method' => 'create', 'menu' => 'create', 'form' => '#dataform', 'submit' => '#submit'); +$lang->tutorial->tasks['createProject']['desc'] = "

在系统创建一个新的项目:

"; + +$lang->tutorial->tasks['linkStory'] = array('title' => '关联需求'); +$lang->tutorial->tasks['linkStory']['nav'] = array('module' => 'project', 'method' => 'linkStory', 'menu' => 'story', 'feature' => '.link-story-btn', 'form' => '#linkStoryForm', 'formType' => 'table', 'submit' => '#submit'); +$lang->tutorial->tasks['linkStory']['desc'] = "

将需求关联到项目:

"; + +$lang->tutorial->tasks['createTask'] = array('title' => '分解任务'); +$lang->tutorial->tasks['createTask']['nav'] = array('module' => 'task', 'method' => 'create', 'menu' => 'story', 'target' => '.btn-task-create', 'form' => '#dataform', 'submit' => '#submit'); +$lang->tutorial->tasks['createTask']['desc'] = "

将项目需求分解为任务:

"; + +$lang->tutorial->tasks['createBug'] = array('title' => '提Bug'); +$lang->tutorial->tasks['createBug']['nav'] = array('module' => 'bug', 'method' => 'create', 'menu' => 'bug', 'target' => '.btn-bug-create', 'form' => '#dataform', 'submit' => '#submit'); +$lang->tutorial->tasks['createBug']['desc'] = "

在系统中提交一个Bug:

"; + +foreach ($lang->tutorial->tasks as $name => $task) $lang->tutorial->tasks[$name]['name'] = $name; diff --git a/module/tutorial/view/index.html.php b/module/tutorial/view/index.html.php new file mode 100644 index 0000000000..1dac7af260 --- /dev/null +++ b/module/tutorial/view/index.html.php @@ -0,0 +1,87 @@ + + * @package tutorial + * @version $Id: browse.html.php 4728 2013-05-03 06:14:34Z sunhao@cnezsoft.com $ + * @link http://www.zentao.net + */ +?> + + +
+
+ +
+ +
+ + diff --git a/module/tutorial/view/start.html.php b/module/tutorial/view/start.html.php index a57d19d531..2d1d240256 100644 --- a/module/tutorial/view/start.html.php +++ b/module/tutorial/view/start.html.php @@ -12,10 +12,7 @@ ?>
-
- - -
+

tutorial->common ?>

tutorial->desc ?>

tutorial->start, '_top', "class='btn btn-primary btn-lg'");;?>