* Remove testcase-batchEdit as plugin.
This commit is contained in:
@@ -400,74 +400,6 @@ class testcase extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch edit case.
|
||||
*
|
||||
* @param string $from example:testcaseBrowse,testtaskCases,testcaseBatchEdit
|
||||
* @param int $productID
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchEdit($from = '', $productID = 0, $orderBy = '')
|
||||
{
|
||||
if($from == 'testcaseBrowse' or $from == 'testtaskCases')
|
||||
{
|
||||
/* Init vars. */
|
||||
$orderBy = $orderBy ? $orderBy : 'id_desc';
|
||||
$caseIDList = $this->post->caseIDList ? $this->post->caseIDList : array();
|
||||
$product = $this->product->getByID($productID);
|
||||
$editedCases = array();
|
||||
$columns = 7;
|
||||
$showSuhosinInfo = false;
|
||||
|
||||
/* Get all cases. */
|
||||
$allCases = $this->dao->select('*')->from(TABLE_CASE)->alias('t1')->where($this->session->testcaseReport)->orderBy($orderBy)->fetchAll('id');
|
||||
|
||||
/* Set product menu. */
|
||||
$this->testcase->setMenu($this->products, $productID);
|
||||
|
||||
/* Initialize the cases whose need to edited. */
|
||||
foreach($allCases as $case) if(in_array($case->id, $caseIDList)) $editedCases[$case->id] = $case;
|
||||
|
||||
/* Judge whether the editedTasks is too large. */
|
||||
$showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting(count($editedCases), $columns);
|
||||
|
||||
/* Set the sessions. */
|
||||
$this->app->session->set('showSuhosinInfo', $showSuhosinInfo);
|
||||
|
||||
/* Assign. */
|
||||
$this->view->header['title'] = $product->name . $this->lang->colon . $this->lang->testcase->batchEdit;
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$this->view->position[] = $this->lang->testcase->common;
|
||||
$this->view->position[] = $this->lang->testcase->batchEdit;
|
||||
|
||||
if($showSuhosinInfo) $this->view->suhosinInfo = $this->lang->suhosinInfo;
|
||||
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0);
|
||||
$this->view->productID = $productID;
|
||||
$this->view->editedCases = $editedCases;
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
elseif($from == 'testcaseBatchEdit')
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$allChanges = $this->testcase->batchUpdate();
|
||||
if($allChanges)
|
||||
{
|
||||
foreach($allChanges as $caseID => $changes )
|
||||
{
|
||||
$actionID = $this->loadModel('action')->create('case', $caseID, 'Edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
}
|
||||
}
|
||||
die(js::locate($this->session->caseList, 'parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a test case
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user