* @package execution * @link https://www.zentao.net */ namespace zin; /* zin: Define the productMenu on main menu. */ $productDropdown = ''; if($execution->hasProduct) { $productDropdown = productMenu( set::title($product ? $product->name : $productOption[$productID]), set::items($productOption), set::activeKey($productID), set::link(helper::createLink('execution', 'testcase', "executionID={$execution->id}&productID={key}")), ); } $branchDropdown = ''; if($showBranch) { $branchDropdown = productMenu( set::title($branchOption[$branchID]), set::items($branchOption), set::activeKey($branchID), set::link(helper::createLink('execution', 'testcase', "executionID={$execution->id}&productID={$productID}&branch=%s")), ); } /* zin: Define the set::module('testcase') feature bar on main menu. */ featureBar ( to::before($productDropdown), to::before($branchDropdown), set::current($type), set::linkParams("executionID={$executionID}&productID={$productID}&branchID={$branchID}&type={key}&moduleID={$moduleID}&orderBy={$orderBy}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"), li(searchToggle(set::module('testcase'))) ); /* zin: Define the toolbar on main menu. */ $canCreateTestcase = hasPriv('testcase', 'create') && common::canModify('execution', $execution); if($canCreateTestcase) $createItem = array('icon' => 'plus', 'class' => 'primary', 'text' => $lang->testcase->create, 'url' => $this->createLink('testcase', 'create', "productID={$productID}&branch=0&moduleID=0&from=execution¶m={$execution->id}")); toolbar ( !empty($createItem) ? item(set($createItem)) : null, ); /* zin: Define the sidebar in main content. */ sidebar ( moduleMenu(set(array( 'modules' => $moduleTree, 'activeKey' => $moduleID, 'closeLink' => $this->createLink('execution', 'testcase', "executionID={$executionID}") ))) ); if(isset($config->testcase->dtable->fieldList['branch'])) $config->testcase->dtable->fieldList['branch']['map'] = $branchTagOption; if(isset($config->testcase->dtable->fieldList['story'])) $config->testcase->dtable->fieldList['story']['map'] = $stories; $config->testcase->dtable->fieldList['actions']['list']['edit']['url'] = str_replace('%executionID%', (string)$executionID, $config->testcase->dtable->fieldList['actions']['list']['edit']['url']); $config->testcase->dtable->fieldList['actions']['menu'] = array(array('confirmStoryChange'), array('runCase', 'runResult', 'edit', 'createBug', 'create')); $this->loadModel('testcase'); foreach($cases as $case) { initTableData(array($case), $config->testcase->dtable->fieldList, $this->testcase); $stages = array_filter(explode(',', $case->stage)); foreach($stages as $key => $stage) $stages[$key] = zget($lang->testcase->stageList, $stage); $case->stage = implode($lang->comma, $stages); } dtable ( set::userMap($users), set::cols($config->testcase->dtable->fieldList), set::data($cases), set::orderBy($orderBy), set::sortLink(createLink('execution', 'testcase', "executionID={$executionID}&productID={$productID}&branchID={$branchID}&type={$type}&moduleID={$moduleID}&orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}")), set::footPager( usePager(array('linkCreator' => helper::createLink('execution', 'testcase', "executionID={$executionID}&productID={$productID}&branchID={$branchID}&type={$type}&moduleID={$moduleID}&orderBy={$orderBy}&recTotal={$pager->recTotal}&recPerPage={recPerPage}&pageID={page}"))), ), ); render();