Merge branch 'sprint/scx_addUpdate2BI_func' into 'master'

Add func for update18_3.

See merge request easycorp/zentaopms!7436
This commit is contained in:
王怡栋
2023-04-17 07:34:35 +00:00
4 changed files with 48 additions and 19 deletions
+34 -16
View File
@@ -20,30 +20,48 @@ class screen extends control
*/
public function browse($dimensionID = 0)
{
$this->app->loadLang('admin');
$this->loadModel('setting');
$dimensionID = $this->loadModel('dimension')->setSwitcherMenu($dimensionID);
$this->checkShowGuide();
/* BI guide. */
$lang = (strpos($this->app->getClientLang(), 'zh') !== false) ? 'zh' : 'en';
$version = ($this->config->edition == 'biz' or $this->config->edition == 'max') ? 'biz' : 'pms';
$imageURL = "static/images/bi_guide_{$version}_{$lang}.png";
$currentUser = $this->app->user->account;
$moduleKey = $version . 'firstGuide';
$firstGuide = $this->setting->getItem("owner={$currentUser}&module=bi&key={$moduleKey}");
if(empty($firstGuide)) $this->setting->setItem("{$currentUser}.bi.{$moduleKey}", 1);
$this->view->firstGuide = !empty($firstGuide);
$this->view->imageURL = $imageURL;
$this->view->version = $version;
$this->view->title = $this->lang->screen->common;
$this->view->screens = $this->screen->getList($dimensionID);
$this->view->dimension = $dimensionID;
$this->display();
}
/**
* Check whether show guide.
*
* @access public
* @return void
*/
public function checkShowGuide()
{
$this->app->loadLang('admin');
$this->loadModel('setting');
$isUpdate = $this->setting->getItem("owner=system&module=bi&key=update2BI");
if(empty($isUpdate))
{
$this->view->showGuide = false;
return;
}
$lang = (strpos($this->app->getClientLang(), 'zh') !== false) ? 'zh' : 'en';
$version = ($this->config->edition == 'biz' or $this->config->edition == 'max') ? 'biz' : 'pms';
$imageURL = "static/images/bi_guide_{$version}_{$lang}.png";
$moduleKey = $version . 'Guide';
$guides = $this->setting->getItem("owner=system&module=bi&key={$moduleKey}");
$haveSeen = explode(',', $guides);
$afterSeen = array_merge($haveSeen, array($this->app->user->account));
$this->setting->setItem("system.bi.{$moduleKey}", implode(',', array_unique($afterSeen)));
$this->view->showGuide = in_array($this->app->user->account, $haveSeen) ? false : true;
$this->view->imageURL = $imageURL;
$this->view->version = $version;
}
/**
* View screen.
*
+1 -1
View File
@@ -1,5 +1,5 @@
$(function()
{
if(!firstGuide) $('#firstGuide').modal();
if(showGuide) $('#firstGuide').modal();
});
+1 -1
View File
@@ -1,5 +1,5 @@
<?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
<?php js::set('firstGuide', $firstGuide);?>
<?php js::set('showGuide', $showGuide ? 1 : 0);?>
<div id="mainContent">
<?php if(empty($screens)):?>
<div class="table-empty-tip">
+12 -1
View File
@@ -597,6 +597,7 @@ class upgradeModel extends model
$this->changeBookToCustomLib();
$this->createDefaultDimension();
$this->convertDocCollect();
$this->addBIUpdateMark();
break;
}
@@ -8204,7 +8205,6 @@ class upgradeModel extends model
/**
* Process report modules.
*
* @param array $modules
* @access public
* @return bool
*/
@@ -8231,6 +8231,17 @@ class upgradeModel extends model
return !dao::isError();
}
/**
* Add update2BI mark to zt_config.
*
* @access public
* @return bool
*/
public function addBIUpdateMark()
{
$this->loadModel('setting')->setItem("system.bi.update2BI", 1);
}
/**
* Xuan: Set mute and freeze for hidden groups.
*