* [bug#58994,doing,0.5h] show tips if no data in doc block.
This commit is contained in:
@@ -146,7 +146,12 @@ class caselib extends control
|
||||
public function browse(int $libID = 0, string $browseType = 'all', int $param = 0, string $orderBy = 'id_desc', int $recTotal = 0, int $recPerPage = 20, int $pageID = 1, string $from = 'qa', int $blockID = 0)
|
||||
{
|
||||
$libraries = $this->caselib->getLibraries();
|
||||
if(empty($libraries)) $this->locate(inlink('create'));
|
||||
if(empty($libraries))
|
||||
{
|
||||
$this->app->loadLang('doc');
|
||||
if($from == 'doc') return $this->send(array('result' => 'fail', 'message' => $this->lang->doc->tips->noCaselib));
|
||||
$this->locate(inlink('create'));
|
||||
}
|
||||
|
||||
/* Set browse type. */
|
||||
$browseType = strtolower($browseType);
|
||||
|
||||
@@ -260,6 +260,10 @@ $lang->doc->emptyError = 'Not empty';
|
||||
$lang->doc->caselib = 'Case Library';
|
||||
$lang->doc->customSearch = 'Custom Search';
|
||||
|
||||
$lang->doc->tips = new stdclass();
|
||||
$lang->doc->tips->noCaselib = 'No case lib';
|
||||
$lang->doc->tips->noProduct = 'No product';
|
||||
|
||||
$lang->doc->zentaoList = array();
|
||||
$lang->doc->zentaoList['story'] = $lang->SRCommon;
|
||||
$lang->doc->zentaoList['productStory'] = $lang->productCommon . $lang->SRCommon;
|
||||
|
||||
@@ -260,6 +260,10 @@ $lang->doc->emptyError = 'Not empty';
|
||||
$lang->doc->caselib = 'Case Library';
|
||||
$lang->doc->customSearch = 'Custom Search';
|
||||
|
||||
$lang->doc->tips = new stdclass();
|
||||
$lang->doc->tips->noCaselib = 'No case lib';
|
||||
$lang->doc->tips->noProduct = 'No product';
|
||||
|
||||
$lang->doc->zentaoList = array();
|
||||
$lang->doc->zentaoList['story'] = $lang->SRCommon;
|
||||
$lang->doc->zentaoList['productStory'] = $lang->productCommon . $lang->SRCommon;
|
||||
|
||||
@@ -260,6 +260,10 @@ $lang->doc->emptyError = 'Not empty';
|
||||
$lang->doc->caselib = 'Case Library';
|
||||
$lang->doc->customSearch = 'Custom Search';
|
||||
|
||||
$lang->doc->tips = new stdclass();
|
||||
$lang->doc->tips->noCaselib = 'No case lib';
|
||||
$lang->doc->tips->noProduct = 'No product';
|
||||
|
||||
$lang->doc->zentaoList = array();
|
||||
$lang->doc->zentaoList['story'] = $lang->SRCommon;
|
||||
$lang->doc->zentaoList['productStory'] = $lang->productCommon . $lang->SRCommon;
|
||||
|
||||
@@ -260,6 +260,10 @@ $lang->doc->emptyError = '不能为空';
|
||||
$lang->doc->caselib = '用例库';
|
||||
$lang->doc->customSearch = '自定义搜索';
|
||||
|
||||
$lang->doc->tips = new stdclass();
|
||||
$lang->doc->tips->noCaselib = '没有用例库,请先创建用例库';
|
||||
$lang->doc->tips->noProduct = '没有产品,请先创建产品';
|
||||
|
||||
$lang->doc->zentaoList = array();
|
||||
$lang->doc->zentaoList['story'] = $lang->SRCommon;
|
||||
$lang->doc->zentaoList['productStory'] = $lang->productCommon . $lang->SRCommon;
|
||||
|
||||
@@ -21,11 +21,16 @@ class productplan extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function commonAction(int $productID, int $branch = 0)
|
||||
public function commonAction(int $productID, int $branch = 0, string $from = 'product')
|
||||
{
|
||||
$product = $this->loadModel('product')->getById($productID);
|
||||
$products = $this->product->getPairs('all', 0, '', 'all');
|
||||
if(empty($product)) $this->locate($this->createLink('product', 'create'));
|
||||
if(empty($product) && $from != 'doc') $this->locate($this->createLink('product', 'create'));
|
||||
if(empty($product) && $from == 'doc')
|
||||
{
|
||||
$this->app->loadLang('doc');
|
||||
return $this->send(array('result' => 'fail', 'messaage' => $this->lang->doc->tips->noProduct));
|
||||
}
|
||||
|
||||
$this->product->checkAccess($productID, $products);
|
||||
|
||||
@@ -314,7 +319,7 @@ class productplan extends control
|
||||
|
||||
$viewType = $this->cookie->viewType ? $this->cookie->viewType : 'list';
|
||||
|
||||
$this->commonAction($productID, (int)$branch);
|
||||
$this->commonAction($productID, (int)$branch, $from);
|
||||
$product = $this->view->product;
|
||||
$productName = empty($product) ? '' : $product->name;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user