control.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * The control file of qa module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Chunsheng Wang <chunsheng@cnezsoft.com>
  8. * @package qa
  9. * @version $Id: control.php 4129 2013-01-18 01:58:14Z wwccss $
  10. * @link https://www.zentao.net
  11. */
  12. class qa extends control
  13. {
  14. /**
  15. * 测试应用仪表盘页面。
  16. * The index of qa, go to bug's browse page.
  17. *
  18. * @param string $locate
  19. * @param int $productID
  20. * @param int $projectID
  21. * @access public
  22. * @return void
  23. */
  24. public function index($locate = 'auto', $productID = 0, $projectID = 0)
  25. {
  26. $this->loadModel('product');
  27. $products = $projectID ? $this->product->getProductPairsByProject($projectID, 'noclosed') : $this->product->getPairs('noclosed', 0, '', 'all');
  28. if(empty($products)) $this->locate($this->createLink('product', 'showErrorNone', "moduleName=qa&activeMenu=index"));
  29. $productID = $this->product->checkAccess($productID, $products);
  30. $branch = (int)$this->cookie->preBranch;
  31. $this->qa->setMenu($productID, $branch);
  32. if($locate == 'yes') $this->locate($this->createLink('bug', 'browse', "product=$productID"));
  33. $this->view->title = $this->lang->qa->index;
  34. $this->view->products = $products;
  35. echo $this->fetch('block', 'dashboard', 'dashboard=qa');
  36. }
  37. }