From 16adebed5e0eac050f0afb736220b995a7b95034 Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Thu, 17 Jun 2021 17:21:56 +0800 Subject: [PATCH] * fix remind in dashboard page not show after refresh. --- module/block/view/dashboard.html.php | 28 +++++++++++++++---- module/misc/control.php | 42 ++++++++++++++++++---------- module/misc/model.php | 4 +-- 3 files changed, 51 insertions(+), 23 deletions(-) diff --git a/module/block/view/dashboard.html.php b/module/block/view/dashboard.html.php index 6a80927b69..d4f432eca2 100644 --- a/module/block/view/dashboard.html.php +++ b/module/block/view/dashboard.html.php @@ -105,12 +105,28 @@ config.ordersSaved = 'block->ordersSaved; ?>'; config.confirmRemoveBlock = 'block->confirmRemoveBlock; ?>'; var module = ''; var useGuest = ; -loadModel('misc')->getRemind();?> - -var myModalTrigger = new $.zui.ModalTrigger({title:'misc->remind;?>', custom: function(){return }, width:'600px'}); -var result = myModalTrigger.show(); -$('#showAnnual').click(function(){myModalTrigger.close()}); - + + +$(function() +{ + function checkRemind() + { + $.getJSON(createLink('misc', 'getRemind'), function(response) + { + if(!response || !response.data) return; + + var myModalTrigger = new $.zui.ModalTrigger( + { + title: response.data.title, + custom: response.data.content, + width: 600 + }); + myModalTrigger.show(); + $('#showAnnual').click(function(){myModalTrigger.close()}); + }); + } + setTimeout(checkRemind, 1000); +}); getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> diff --git a/module/misc/control.php b/module/misc/control.php index d925b086c9..2736f69ed8 100644 --- a/module/misc/control.php +++ b/module/misc/control.php @@ -13,7 +13,7 @@ class misc extends control { /** * Ping the server every 5 minutes to keep the session. - * + * * @access public * @return void */ @@ -25,7 +25,7 @@ class misc extends control /** * Show php info. - * + * * @access public * @return void */ @@ -36,7 +36,7 @@ class misc extends control /** * Show about info of zentao. - * + * * @access public * @return void */ @@ -47,7 +47,7 @@ class misc extends control /** * Update nl. - * + * * @access public * @return void */ @@ -58,8 +58,8 @@ class misc extends control /** * Check current version is latest or not. - * - * @param string $sn + * + * @param string $sn * @access public * @return void */ @@ -83,7 +83,7 @@ class misc extends control /** * Check model extension logic - * + * * @access public * @return void */ @@ -95,7 +95,7 @@ class misc extends control /** * Down notify. - * + * * @access public * @return void */ @@ -134,7 +134,7 @@ class misc extends control $result = $archive->add($loginFile, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_ADD_PATH, 'notify'); if($result == 0) die("Error : " . $archive->errorInfo(true)); - + $zipContent = file_get_contents($packageFile); unlink($loginFile); unlink($packageFile); @@ -143,7 +143,7 @@ class misc extends control /** * Create qrcode for mobile login. - * + * * @access public * @return void */ @@ -164,7 +164,7 @@ class misc extends control /** * Ajax ignore browser. - * + * * @access public * @return void */ @@ -206,7 +206,7 @@ class misc extends control /** * Check net connect. - * + * * @access public * @return void */ @@ -219,9 +219,9 @@ class misc extends control /** * Show captcha and save to session. - * - * @param string $sessionVar - * @param string $uuid + * + * @param string $sessionVar + * @param string $uuid * @access public * @return void */ @@ -235,4 +235,16 @@ class misc extends control $this->session->set($sessionVar, $captcha->getPhrase()); $captcha->build()->output(); } + + /** + * Get annual remind. + * + * @access public + * @return void + */ + public function getRemind() + { + $data = array('content' => $this->misc->getRemind(), 'title' => $this->lang->misc->remind); + $this->send(array('result' => 'success', 'data' => $data)); + } } diff --git a/module/misc/model.php b/module/misc/model.php index 48427f94ba..1bd918af09 100644 --- a/module/misc/model.php +++ b/module/misc/model.php @@ -45,7 +45,7 @@ class miscModel extends model /** * Get remind. - * + * * @access public * @return string */ @@ -63,7 +63,7 @@ class miscModel extends model /** * Check one click package. - * + * * @access public * @return array */