From 3dd003f4c045eaaada02636853676ead34471181 Mon Sep 17 00:00:00 2001 From: Chenjianyu Date: Wed, 9 Aug 2023 15:26:13 +0800 Subject: [PATCH] * add ai prompt tour. --- config/zentaopms.php | 2 +- module/index/control.php | 8 ++++ module/index/css/index.css | 1 - module/index/js/index.js | 6 +++ module/index/view/index.html.php | 1 + module/misc/css/features.css | 1 + module/misc/js/features.js | 11 +++-- module/misc/lang/en.php | 7 +++ module/misc/lang/zh-cn.php | 37 +++++++++------ module/misc/view/features.html.php | 44 +++++++----------- www/theme/default/images/main/ai_prompts.png | Bin 0 -> 278048 bytes .../default/images/main/ai_prompts_en.png | Bin 0 -> 92118 bytes .../default/images/main/prompt_design.png | Bin 0 -> 222250 bytes .../default/images/main/prompt_design_en.png | Bin 0 -> 88530 bytes www/theme/default/images/main/prompt_exec.png | Bin 0 -> 221105 bytes .../default/images/main/prompt_exec_en.png | Bin 0 -> 87819 bytes 16 files changed, 70 insertions(+), 48 deletions(-) create mode 100644 www/theme/default/images/main/ai_prompts.png create mode 100644 www/theme/default/images/main/ai_prompts_en.png create mode 100644 www/theme/default/images/main/prompt_design.png create mode 100644 www/theme/default/images/main/prompt_design_en.png create mode 100644 www/theme/default/images/main/prompt_exec.png create mode 100644 www/theme/default/images/main/prompt_exec_en.png diff --git a/config/zentaopms.php b/config/zentaopms.php index aac06dcc4f..e70d6e42df 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -442,7 +442,7 @@ $config->objectTables['privrelation'] = TABLE_PRIVRELATION; $config->objectTables['scene'] = TABLE_SCENE; $config->objectTables['prompt'] = TABLE_PROMPT; -$config->newFeatures = array('introduction', 'tutorial', 'youngBlueTheme', 'visions'); +$config->newFeatures = array('aiPrompts', 'promptDesign', 'promptExec'); $config->disabledFeatures = ''; $config->closedFeatures = ''; diff --git a/module/index/control.php b/module/index/control.php index b4f6cef1e2..d7b1d4dd70 100644 --- a/module/index/control.php +++ b/module/index/control.php @@ -39,8 +39,16 @@ class index extends control $latestVersionList = array(); if(isset($this->config->global->latestVersionList)) $latestVersionList = json_decode($this->config->global->latestVersionList); + $showFeatures = false; + foreach($this->config->newFeatures as $feature) + { + $accounts = zget($this->config->global, 'skip' . ucfirst($feature), ''); + if(strpos(",$accounts,", $this->app->user->account) === false) $showFeatures = true; + } + $this->view->title = $this->lang->index->common; $this->view->open = helper::safe64Decode($open); + $this->view->showFeatures = $showFeatures; $this->view->latestVersionList = $latestVersionList; $this->display(); diff --git a/module/index/css/index.css b/module/index/css/index.css index c01012df2e..46676464f1 100644 --- a/module/index/css/index.css +++ b/module/index/css/index.css @@ -114,7 +114,6 @@ body.menu-hide {padding-left: 0;} .version-detail {color: #8a8a8a;} .upgrade-now {float: right;} .color-primary {color: #3280fc;} -.showFeatures .modal-body{max-height: 550px !important;} @media screen and (max-height: 768px) { diff --git a/module/index/js/index.js b/module/index/js/index.js index 78e30a1286..168429df9d 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -1,5 +1,11 @@ (function() { + if(showFeatures && vision == 'rnd') + { + /* Show features dialog. */ + new $.zui.ModalTrigger({url: $.createLink('misc', 'features'), type: 'iframe', width: 900, className: 'showFeatures', showHeader: false, backdrop: 'static'}).show(); + } + /* Init variables */ var openedApps = {}; // Key-value to save appCode-app pairs var appsMap = {}; // Key-value to save opened appCode-app pairs diff --git a/module/index/view/index.html.php b/module/index/view/index.html.php index e67c0e8787..2e754e0cc6 100644 --- a/module/index/view/index.html.php +++ b/module/index/view/index.html.php @@ -23,6 +23,7 @@ js::set('manualText', $lang->manual); js::set('manualUrl', ((!empty($config->isINT)) ? $config->manualUrl['int'] : $config->manualUrl['home']) . '&theme=' . $_COOKIE['theme']); js::set('isAdminUser', $this->app->user->admin); js::set('isIntranet', helper::isIntranet()); +js::set('showFeatures', $showFeatures); ?>