* [task#127621,doing,1h] add methods.
This commit is contained in:
@@ -16,7 +16,7 @@ if($config->testcase->needReview || !empty($config->testcase->forceReview))
|
||||
$config->caselib->testcase->actionList['edit']['icon'] = 'edit';
|
||||
$config->caselib->testcase->actionList['edit']['hint'] = $lang->testcase->edit;
|
||||
$config->caselib->testcase->actionList['edit']['text'] = $lang->testcase->edit;
|
||||
$config->caselib->testcase->actionList['edit']['url'] = array('module' => 'testcase', 'method' => 'edit', 'params' => 'caseID={id}');
|
||||
$config->caselib->testcase->actionList['edit']['url'] = array('module' => 'caselib', 'method' => 'editCase', 'params' => 'caseID={id}');
|
||||
$config->caselib->testcase->actionList['edit']['order'] = 5;
|
||||
|
||||
$config->caselib->testcase->actionList['delete']['icon'] = 'trash';
|
||||
@@ -39,7 +39,7 @@ $config->caselib->dtable->fieldList['actions'] = $config->testcase->dtable->fie
|
||||
|
||||
$config->caselib->dtable->fieldList['id']['name'] = 'id';
|
||||
|
||||
$config->caselib->dtable->fieldList['title']['link'] = array('module' => 'testcase', 'method' => 'view', 'params' => "caseID={id}");
|
||||
$config->caselib->dtable->fieldList['title']['link'] = array('module' => 'caselib', 'method' => 'viewCase', 'params' => "caseID={id}");
|
||||
$config->caselib->dtable->fieldList['title']['nestedToggle'] = false;
|
||||
|
||||
$config->caselib->dtable->fieldList['type']['show'] = true;
|
||||
|
||||
@@ -96,6 +96,19 @@ class caselib extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑用例。
|
||||
* Edit a case.
|
||||
*
|
||||
* @param int $caseID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function editCase(int $caseID)
|
||||
{
|
||||
echo $this->fetch('testcase', 'edit', "caseID=$caseID");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除一个用例库。
|
||||
* Delete a case lib.
|
||||
@@ -281,6 +294,21 @@ class caselib extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量编辑用例。
|
||||
* Batch edit case.
|
||||
*
|
||||
* @param int $libID
|
||||
* @param string|int $branch
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchEditCase(int $libID, string|int $branch = '', string $type = '')
|
||||
{
|
||||
echo $this->fetch('testcase', 'batchEdit', "libID=$libID&branch=$branch&type=$type");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看用例库信息。
|
||||
* View a library.
|
||||
@@ -306,6 +334,20 @@ class caselib extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看用例。
|
||||
* View a case.
|
||||
*
|
||||
* @param int $caseID
|
||||
* @param int $version
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function viewCase(int $caseID, int $version = 0)
|
||||
{
|
||||
echo $this->fetch('testcase', 'view', "caseID=$caseID&version=$version");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过 AJAX 获取用例库的 1.5 级菜单。
|
||||
* Ajax get drop menu.
|
||||
|
||||
@@ -16,12 +16,15 @@ $lang->caselib->create = "Create Case Library";
|
||||
$lang->caselib->edit = 'Edit Case Library';
|
||||
$lang->caselib->browse = 'View Cases in Library';
|
||||
$lang->caselib->view = 'Library Detail';
|
||||
$lang->caselib->viewCase = 'Testcase detail';
|
||||
$lang->caselib->createCase = 'Create Case';
|
||||
$lang->caselib->editCase = 'Edit Case';
|
||||
$lang->caselib->delete = "Delete Suite";
|
||||
$lang->caselib->linkVersion = "Version";
|
||||
$lang->caselib->deleted = 'Deleted';
|
||||
$lang->caselib->exportTemplate = 'Export Template';
|
||||
$lang->caselib->batchCreateCase = 'Batch Create';
|
||||
$lang->caselib->batchCreateCase = 'Batch Create Case';
|
||||
$lang->caselib->batchEditCase = 'Batch Edit Case';
|
||||
$lang->caselib->import = 'Import';
|
||||
$lang->caselib->showImport = 'Imported Data';
|
||||
$lang->caselib->type = 'Type';
|
||||
|
||||
@@ -16,12 +16,15 @@ $lang->caselib->create = "Create Case Library";
|
||||
$lang->caselib->edit = 'Edit Case Library';
|
||||
$lang->caselib->browse = 'View Cases in Library';
|
||||
$lang->caselib->view = 'Library Detail';
|
||||
$lang->caselib->viewCase = 'Testcase detail';
|
||||
$lang->caselib->createCase = 'Create Case';
|
||||
$lang->caselib->editCase = 'Edit Case';
|
||||
$lang->caselib->delete = "Delete Suite";
|
||||
$lang->caselib->linkVersion = "Version";
|
||||
$lang->caselib->deleted = 'Deleted';
|
||||
$lang->caselib->exportTemplate = 'Export Template';
|
||||
$lang->caselib->batchCreateCase = 'Batch Create';
|
||||
$lang->caselib->batchCreateCase = 'Batch Create Case';
|
||||
$lang->caselib->batchEditCase = 'Batch Edit Case';
|
||||
$lang->caselib->import = 'Import';
|
||||
$lang->caselib->showImport = 'Imported Data';
|
||||
$lang->caselib->type = 'Type';
|
||||
|
||||
@@ -16,12 +16,15 @@ $lang->caselib->create = "Créer une Library";
|
||||
$lang->caselib->edit = 'Editer Library';
|
||||
$lang->caselib->browse = 'Voir CasTests dans Library';
|
||||
$lang->caselib->view = 'Détail Library';
|
||||
$lang->caselib->viewCase = 'Testcase detail';
|
||||
$lang->caselib->createCase = 'Créer CasTest';
|
||||
$lang->caselib->editCase = 'Editer CasTest';
|
||||
$lang->caselib->delete = "Supprimer Suite";
|
||||
$lang->caselib->linkVersion = "Version";
|
||||
$lang->caselib->deleted = 'Supprimé';
|
||||
$lang->caselib->exportTemplate = 'Exporter Modèle';
|
||||
$lang->caselib->batchCreateCase = 'Créer par lot';
|
||||
$lang->caselib->batchCreateEdit = 'Editer par lot';
|
||||
$lang->caselib->import = 'Importer';
|
||||
$lang->caselib->showImport = 'Données Importées';
|
||||
$lang->caselib->type = 'Type';
|
||||
|
||||
@@ -16,12 +16,15 @@ $lang->caselib->create = "创建用例库";
|
||||
$lang->caselib->edit = '编辑用例库';
|
||||
$lang->caselib->browse = '浏览用例库';
|
||||
$lang->caselib->view = '查看库概况';
|
||||
$lang->caselib->viewCase = '查看用例';
|
||||
$lang->caselib->createCase = '创建用例';
|
||||
$lang->caselib->editCase = '编辑用例';
|
||||
$lang->caselib->delete = "删除";
|
||||
$lang->caselib->linkVersion = "版本";
|
||||
$lang->caselib->deleted = '已删除';
|
||||
$lang->caselib->exportTemplate = '导出模板';
|
||||
$lang->caselib->batchCreateCase = '批量创建用例';
|
||||
$lang->caselib->batchEditCase = '批量编辑用例';
|
||||
$lang->caselib->import = '导入';
|
||||
$lang->caselib->showImport = '显示导入数据';
|
||||
$lang->caselib->type = '类型';
|
||||
|
||||
@@ -18,7 +18,7 @@ $canImport = common::hasPriv('caselib', 'import');
|
||||
$canCreateLib = common::hasPriv('caselib', 'create');
|
||||
$canCreateCase = common::hasPriv('caselib', 'createCase');
|
||||
$canBatchCreateCase = common::hasPriv('caselib', 'batchCreateCase');
|
||||
$canBatchEdit = common::hasPriv('testcase', 'batchEdit');
|
||||
$canBatchEdit = common::hasPriv('caselib', 'batchEditCase');
|
||||
$canBatchDelete = common::hasPriv('testcase', 'batchDelete');
|
||||
$canBatchReview = common::hasPriv('testcase', 'batchReview') and ($config->testcase->needReview or !empty($config->testcase->forceReview));
|
||||
$canBatchChangeModule = common::hasPriv('testcase', 'batchChangeModule');
|
||||
@@ -141,7 +141,7 @@ $footToolbar = $canBatchAction ? array('items' => array
|
||||
(
|
||||
array('type' => 'btn-group', 'items' => array
|
||||
(
|
||||
$canBatchEdit ? array('text' => $lang->edit, 'className' => 'batch-btn not-open-url', 'data-url' => helper::createLink('testcase', 'batchEdit', "libID=$libID&branch=0&type=lib")) : null,
|
||||
$canBatchEdit ? array('text' => $lang->edit, 'className' => 'batch-btn not-open-url', 'data-url' => helper::createLink('caselib', 'batchEditCase', "libID=$libID&branch=0&type=lib")) : null,
|
||||
!empty($navActions) ? array('caret' => 'up', 'btnType' => 'secondary', 'items' => $navActions, 'data-placement' => 'top-start') : null
|
||||
)),
|
||||
), 'btnProps' => array('btnType' => 'secondary')) : null;
|
||||
|
||||
Reference in New Issue
Block a user