* adjust for tutorial.
This commit is contained in:
@@ -474,8 +474,8 @@ class commonModel extends model
|
||||
|
||||
/* get current module and method. */
|
||||
$isTutorialMode = commonModel::isTutorialMode();
|
||||
$currentModule = $isTutorialMode ? constant('WIZARD_MODULE') : $app->getModuleName();
|
||||
$currentMethod = $isTutorialMode ? constant('WIZARD_METHOD') : $app->getMethodName();
|
||||
$currentModule = ($isTutorialMode and defined('WIZARD_MODULE')) ? WIZARD_MODULE : $app->getModuleName();
|
||||
$currentMethod = ($isTutorialMode and defined('WIZARD_METHOD')) ? WIZARD_METHOD : $app->getMethodName();
|
||||
$menu = customModel::getModuleMenu($moduleName);
|
||||
|
||||
/* The beginning of the menu. */
|
||||
@@ -1006,6 +1006,8 @@ class commonModel extends model
|
||||
if($onlyCondition)
|
||||
{
|
||||
$queryCondition = explode('WHERE', $sql);
|
||||
if(!isset($queryCondition[1])) return true;
|
||||
|
||||
$queryCondition = explode('ORDER', $queryCondition[1]);
|
||||
$queryCondition = str_replace('t1.', '', $queryCondition[0]);
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ $clientTheme = $this->app->getClientTheme();
|
||||
|
||||
if(commonModel::isTutorialMode())
|
||||
{
|
||||
$wizardModule = constant('WIZARD_MODULE');
|
||||
$wizardMethod = constant('WIZARD_METHOD');
|
||||
$wizardModule = defined('WIZARD_MODULE') ? WIZARD_MODULE : '';
|
||||
$wizardMethod = defined('WIZARD_METHOD') ? WIZARD_METHOD : '';
|
||||
$requiredFields = '';
|
||||
if(isset($config->$wizardModule->$wizardMethod->requiredFields)) $requiredFields = str_replace(' ', '', $config->$wizardModule->$wizardMethod->requiredFields);
|
||||
echo "<script>window.TUTORIAL = {'module': '$wizardModule', 'method': '$wizardMethod'}; if(config) config.requiredFields = '$requiredFields';</script>";
|
||||
|
||||
@@ -17,9 +17,9 @@ class story extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct($module = '', $method = '')
|
||||
{
|
||||
parent::__construct();
|
||||
parent::__construct($module, $method);
|
||||
$this->loadModel('product');
|
||||
$this->loadModel('project');
|
||||
$this->loadModel('tree');
|
||||
|
||||
@@ -17,9 +17,9 @@ class task extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct($module = '', $method = '')
|
||||
{
|
||||
parent::__construct();
|
||||
parent::__construct($module, $method);
|
||||
$this->loadModel('project');
|
||||
$this->loadModel('story');
|
||||
$this->loadModel('tree');
|
||||
|
||||
@@ -80,12 +80,16 @@ class tutorial extends control
|
||||
*/
|
||||
public function wizard($module, $method, $params = '')
|
||||
{
|
||||
define('WIZARD', true);
|
||||
define('WIZARD_MODULE', $module);
|
||||
define('WIZARD_METHOD', $method);
|
||||
$params = helper::safe64Decode($params);
|
||||
if($_POST)
|
||||
{
|
||||
die(js::locate(helper::createLink('tutorial', 'wizard', "module=$module&method=$method¶ms=$params"), 'parent'));
|
||||
$target = 'parent';
|
||||
if(($module == 'story' or $module == 'task' or $module == 'bug') and $method == 'create') $target = 'self';
|
||||
if($module == 'project' and $method == 'linkStory') $target = 'self';
|
||||
die(js::locate(helper::createLink('tutorial', 'wizard', "module=$module&method=$method¶ms=" . helper::safe64Encode($params)), $target));
|
||||
}
|
||||
die($this->fetch($module, $method, $params));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user