diff --git a/module/common/model.php b/module/common/model.php index a10deb00ff..5340fac145 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -794,7 +794,7 @@ class commonModel extends model substr_count((string)$old->$key, "\n") > 1 or strpos('name,title,desc,spec,steps,content,digest,verify,report,definition,analysis,summary,prevention,resolution,outline,schedule,minutes', strtolower($key)) !== false) { - $diff = commonModel::diff($old->$key, $value); + $diff = commonModel::diff((string)$old->$key, (string)$value); } $changes[] = array('field' => $key, 'old' => $old->$key, 'new' => $value, 'diff' => $diff); } diff --git a/module/product/control.php b/module/product/control.php index b78761befc..60fef39cf9 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -270,7 +270,7 @@ class product extends control /* 获取要修改的产品ID列表。*/ $productIdList = $this->post->productIDList; - if(empty($productIdList)) return print(js::locate($this->session->productList, 'parent')); + if(empty($productIdList)) return $this->locate($this->session->productList); /* Set menu when page come from program. */ if($this->app->tab == 'program') common::setMenuVars('program', 0); diff --git a/module/product/zen.php b/module/product/zen.php index 9d84445a87..a72f02d255 100644 --- a/module/product/zen.php +++ b/module/product/zen.php @@ -541,8 +541,8 @@ class productZen extends product * 编辑完成后,做页面跳转。 * Locate after edit product. * - * @param int $productID - * @param int $programID + * @param int $productID + * @param int $programID * @access private * @return array */ @@ -749,6 +749,7 @@ class productZen extends product { /* Get location. */ $location = $this->createLink('program', 'product', "programID=$programID"); + if(empty($programID)) $location = $this->createLink('program', 'productView'); if($this->app->tab == 'product') $location = $this->createLink('product', 'all'); return array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => $location); } diff --git a/module/program/control.php b/module/program/control.php index 0acb12d2aa..f41f1eefca 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -98,10 +98,10 @@ class program extends control public function product(int $programID = 0, string $browseType = 'noclosed', string $orderBy = 'order_asc', int $recTotal = 0, int $recPerPage = 15, int $pageID = 1) { $programPairs = $this->program->getPairs(); - if(!isset($programPairs[$programID])) + if($programID && !isset($programPairs[$programID])) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => '404 Not found')); - return print(js::error($this->lang->notFound) . js::locate($this->createLink('program', 'browse'))); + return $this->send(array('result' => 'fail', 'message' => $this->lang->notFound, 'load' => $this->createLink('program', 'browse'))); } $programID = $this->program->checkAccess($programID, $programPairs);