From 34da9d3ddc214b0769bef9c920feeebc1c931174 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 3 Jun 2024 14:20:05 +0800 Subject: [PATCH] * [bug#50551,done,0.2h] change the mode of alert. --- framework/base/control.class.php | 5 +++++ module/task/control.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/base/control.class.php b/framework/base/control.class.php index 96c017fe89..e9be0aed43 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -1144,6 +1144,11 @@ class baseControl foreach($message as $item => $errors) $message[$item] = implode(',', $errors); return helper::end(js::alert(strip_tags(implode('\n', $message)))); } + elseif(!$_SERVER['HTTP_REFERER'] && !empty($data['load']['alert'])) + { + if(empty($data['load']['locate'])) return helper::end(js::alert($data['load']['alert'])); + return helper::end(js::alert($data['load']['alert']) . js::locate($data['load']['locate'])); + } return helper::end('fail'); } } diff --git a/module/task/control.php b/module/task/control.php index 606245b896..c002bf6a7a 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -337,7 +337,7 @@ class task extends control if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found')); return $this->sendError($this->lang->notFound, $this->config->vision == 'lite' ? $this->createLink('project', 'index') : $this->createLink('execution', 'all')); } - if(!$this->loadModel('common')->checkPrivByObject('execution', $task->execution)) return print(js::error($this->lang->execution->accessDenied) . js::locate($this->createLink('execution', 'all'))); + if(!$this->loadModel('common')->checkPrivByObject('execution', $task->execution)) return $this->sendError($this->lang->execution->accessDenied, $this->createLink('execution', 'all')); /* 为视图设置常用的公共变量和设置菜单为任务所属执行. Set common variables to view and set menu to the execution of the task. */ $this->taskZen->commonAction($taskID);