diff --git a/module/bug/control.php b/module/bug/control.php index b6c817bafd..17f2f522a5 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -36,7 +36,11 @@ class bug extends control $this->loadModel('story'); $this->loadModel('task'); $this->products = $this->product->getPairs(); - if(empty($this->products)) $this->locate($this->createLink('product', 'create')); + if(empty($this->products)) + { + echo js::alert($this->lang->product->errorNoProduct); + die(js::locate($this->createLink('product', 'create'))); + } $this->view->products = $this->products; } diff --git a/module/product/lang/en.php b/module/product/lang/en.php index c0a4e3ee27..ce10202ba0 100644 --- a/module/product/lang/en.php +++ b/module/product/lang/en.php @@ -41,6 +41,7 @@ $lang->product->ajaxGetPlans = "API: plans of product"; $lang->product->errorFormat = 'Error format.'; $lang->product->errorEmptyName = 'Name can not be empty.'; $lang->product->errorEmptyCode = 'Code can not be empty'; +$lang->product->errorNoProduct = 'No product in system yet.'; $lang->product->accessDenied = 'Access to this product denined.'; $lang->product->id = 'ID'; diff --git a/module/product/lang/zh-cn.php b/module/product/lang/zh-cn.php index 26519bae38..b9f637fb8b 100644 --- a/module/product/lang/zh-cn.php +++ b/module/product/lang/zh-cn.php @@ -43,6 +43,7 @@ $lang->product->ajaxGetPlans = "接口:计划列表"; $lang->product->errorFormat = '产品数据格式不正确'; $lang->product->errorEmptyName = '产品名称不能为空'; $lang->product->errorEmptyCode = '产品代号不能为空'; +$lang->product->errorNoProduct = '还没有创建产品!'; $lang->product->accessDenied = '您无权访问该产品'; $lang->product->id = '编号';