* adjust code.
This commit is contained in:
@@ -68,6 +68,7 @@ class tutorial extends control
|
||||
public function quit($referer = '')
|
||||
{
|
||||
$this->session->set('tutorialMode', false);
|
||||
$this->loadModel('setting')->setItem($this->app->user->account . '.common.global.novice', false);
|
||||
|
||||
if(empty($referer)) $referer = $this->createLink('index');
|
||||
die(js::locate($referer, 'parent'));
|
||||
@@ -82,6 +83,7 @@ class tutorial extends control
|
||||
public function ajaxQuit()
|
||||
{
|
||||
$this->session->set('tutorialMode', false);
|
||||
$this->loadModel('setting')->setItem($this->app->user->account . '.common.global.novice', false);
|
||||
die(json_encode(array('result' => 'success')));
|
||||
}
|
||||
|
||||
@@ -109,4 +111,17 @@ class tutorial extends control
|
||||
}
|
||||
die($this->fetch($module, $method, $params));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax save novice result.
|
||||
*
|
||||
* @param string $novice
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxSaveNovice($novice = 'true', $reload = 'false')
|
||||
{
|
||||
$this->loadModel('setting')->setItem($this->app->user->account . '.common.global.novice', $novice);
|
||||
if($reload == 'true') die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ $lang->tutorial->requiredTip = '【%s】is necessary';
|
||||
$lang->tutorial->congratulateTask = 'Congratulations!You have finished task【<span class="task-name-current"></span>】!';
|
||||
$lang->tutorial->serverErrorTip = 'Some error has occurred.';
|
||||
$lang->tutorial->ajaxSetError = 'Finished task must be defined. Set empty value to reset tasks.';
|
||||
$lang->tutorial->novice = "You may use the ZenTao first, whether to enter the novice tutorial?";
|
||||
|
||||
$lang->tutorial->tasks = array();
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ $lang->tutorial->requiredTip = '【%s】为必填项';
|
||||
$lang->tutorial->congratulateTask = '恭喜,你完成了任务 【<span class="task-name-current"></span>】!';
|
||||
$lang->tutorial->serverErrorTip = '发生了一些错误。';
|
||||
$lang->tutorial->ajaxSetError = '必须指定已完成的任务,如果要重置任务,请设置值为空。';
|
||||
$lang->tutorial->novice = "您可能初次使用禅道,是否进入新手教程";
|
||||
|
||||
$lang->tutorial->tasks = array();
|
||||
|
||||
|
||||
@@ -11,6 +11,25 @@
|
||||
*/
|
||||
class tutorialModel extends model
|
||||
{
|
||||
/**
|
||||
* Check novice.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function checkNovice()
|
||||
{
|
||||
$account = $this->app->user->account;
|
||||
if($account == 'guest') return false;
|
||||
|
||||
$count = $this->dao->select('count(*) as count')->from(TABLE_ACTION)->where('actor')->eq($account)->fetch('count');
|
||||
if($count < 10) return true;
|
||||
|
||||
$this->loadModel('setting')->setItem($account . '.common.global.nevice', 'false');
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tutorial product pairs.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user