From d027d65d53b1d16e9d1b0bb14231c2e2186b1399 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 14 Sep 2023 13:34:02 +0800 Subject: [PATCH] + Add comment and params type. --- module/program/control.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/module/program/control.php b/module/program/control.php index bfb5d8992f..c99de0ed97 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -629,6 +629,7 @@ class program extends control } /** + * 更新项目集排序。 * Update program order. * * @access public @@ -649,45 +650,45 @@ class program extends control } /* + * 移除项目集白名单成员。 * Removing users from the white list. * - * @param int $id - * @param string $confirm + * @param int $aclID * @access public * @return void */ - public function unbindWhitelist($id = 0, $confirm = 'no') + public function unbindWhitelist(int $aclID) { - echo $this->fetch('personnel', 'unbindWhitelist', "id=$id&confirm=$confirm"); + echo $this->fetch('personnel', 'unbindWhitelist', "id={$aclID}&confirm=yes"); } /** - * View a program. + * 查看项目集详情。 + * View program detail. * - * @param int $programID + * @param int $programID * @access public * @return void */ public function view(int $programID) { - $programID = (int)$programID; - $program = $this->program->getByID($programID); - if(!$program) return print(js::error($this->lang->notFound) . js::locate('back')); + $program = $this->program->getByID($programID); + if(!$program) return $this->sendError($this->lang->notFound, true); if(common::hasPriv('program', 'product')) $this->locate(inlink('product', "programID=$programID")); if(common::hasPriv('program', 'project')) $this->locate(inlink('project', "programID=$programID")); } /** - * Ajax set show setting. + * 设置显示非当前项目集的项目信息。 + * Set to display project information other than the current project set. * * @access public * @return void */ public function ajaxSetShowSetting() { - $data = fixer::input('post')->get(); - $this->loadModel('setting')->updateItem("{$this->app->user->account}.program.showAllProjects", $data->showAllProjects); + if($this->post->showAllProjects !== false) $this->loadModel('setting')->updateItem("{$this->app->user->account}.program.showAllProjects", $this->post->showAllProjects); } /**