* add insert param for cover or insert exist data.
This commit is contained in:
+17
-15
@@ -557,13 +557,14 @@ class caselib extends control
|
||||
/**
|
||||
* Show import case.
|
||||
*
|
||||
* @param int $libID
|
||||
* @param int $pagerID
|
||||
* @param int $maxImport
|
||||
* @param int $libID
|
||||
* @param int $pagerID
|
||||
* @param int $maxImport
|
||||
* @param string|int $insert 0 is covered old, 1 is insert new.
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function showImport($libID, $pagerID = 1, $maxImport = 0)
|
||||
public function showImport($libID, $pagerID = 1, $maxImport = 0, $insert = '')
|
||||
{
|
||||
$this->loadModel('testcase');
|
||||
|
||||
@@ -581,7 +582,7 @@ class caselib extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
die(js::locate(inlink('showImport', "libID=$libID&pagerID=" . ($this->post->pagerID + 1) . "&maxImport=$maxImport"), 'parent'));
|
||||
die(js::locate(inlink('showImport', "libID=$libID&pagerID=" . ($this->post->pagerID + 1) . "&maxImport=$maxImport&insert=" . zget($_POST, 'insert', '')), 'parent'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -775,16 +776,17 @@ class caselib extends control
|
||||
$this->view->title = $this->lang->caselib->common . $this->lang->colon . $this->lang->testcase->showImport;
|
||||
$this->view->position[] = $this->lang->testcase->showImport;
|
||||
|
||||
$this->view->modules = $modules;
|
||||
$this->view->cases = $this->dao->select('id,module,stage,status,pri,type')->from(TABLE_CASE)->where('lib')->eq($libID)->andWhere('deleted')->eq(0)->andWhere('product')->eq(0)->fetchAll('id');
|
||||
$this->view->caseData = $caseData;
|
||||
$this->view->stepData = $stepData;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->isEndPage = $pagerID >= $allPager;
|
||||
$this->view->allCount = $allCount;
|
||||
$this->view->allPager = $allPager;
|
||||
$this->view->pagerID = $pagerID;
|
||||
$this->view->maxImport = $maxImport;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->cases = $this->dao->select('id,module,stage,status,pri,type')->from(TABLE_CASE)->where('lib')->eq($libID)->andWhere('deleted')->eq(0)->andWhere('product')->eq(0)->fetchAll('id');
|
||||
$this->view->caseData = $caseData;
|
||||
$this->view->stepData = $stepData;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->isEndPage = $pagerID >= $allPager;
|
||||
$this->view->allCount = $allCount;
|
||||
$this->view->allPager = $allPager;
|
||||
$this->view->pagerID = $pagerID;
|
||||
$this->view->maxImport = $maxImport;
|
||||
$this->view->dataInsert = $insert;
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,13 +100,15 @@ $(function()
|
||||
<tr>
|
||||
<td colspan='9' class='text-center form-actions'>
|
||||
<?php
|
||||
if(!$insert)
|
||||
$submitText = $isEndPage ? $this->lang->save : $this->lang->file->saveAndNext;
|
||||
if(!$insert and $dataInsert === '')
|
||||
{
|
||||
echo "<button type='button' data-toggle='modal' data-target='#importNoticeModal' class='btn btn-primary btn-wide'>{$lang->save}</button>";
|
||||
echo "<button type='button' data-toggle='modal' data-target='#importNoticeModal' class='btn btn-primary btn-wide'>{$submitText}</button>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::submitButton($isEndPage ? $this->lang->save : $this->lang->file->saveAndNext);
|
||||
echo html::submitButton($submitText);
|
||||
if($dataInsert !== '') echo html::hidden('insert', $dataInsert);
|
||||
echo html::hidden('isEndPage', $isEndPage ? 1 : 0);
|
||||
echo html::hidden('pagerID', $pagerID);
|
||||
}
|
||||
@@ -117,7 +119,7 @@ $(function()
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<?php if(!$insert) include '../../common/view/noticeimport.html.php';?>
|
||||
<?php if(!$insert and $dataInsert === '') include '../../common/view/noticeimport.html.php';?>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
+22
-20
@@ -1500,14 +1500,15 @@ class testcase extends control
|
||||
/**
|
||||
* Show import data
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param int $pagerID
|
||||
* @param int $maxImport
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param int $pagerID
|
||||
* @param int $maxImport
|
||||
* @param string|int $insert 0 is covered old, 1 is insert new.
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function showImport($productID, $branch = 0, $pagerID = 1, $maxImport = 0)
|
||||
public function showImport($productID, $branch = 0, $pagerID = 1, $maxImport = 0, $insert = '')
|
||||
{
|
||||
$file = $this->session->fileImport;
|
||||
$tmpPath = $this->loadModel('file')->getPathOfImportedFile();
|
||||
@@ -1523,7 +1524,7 @@ class testcase extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
die(js::locate(inlink('showImport', "productID=$productID&branch=$branch&pagerID=" . ($this->post->pagerID + 1) . "&maxImport=$maxImport"), 'parent'));
|
||||
die(js::locate(inlink('showImport', "productID=$productID&branch=$branch&pagerID=" . ($this->post->pagerID + 1) . "&maxImport=$maxImport&insert=" . zget($_POST, 'insert', '')), 'parent'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1706,20 +1707,21 @@ class testcase extends control
|
||||
$this->view->title = $this->lang->testcase->common . $this->lang->colon . $this->lang->testcase->showImport;
|
||||
$this->view->position[] = $this->lang->testcase->showImport;
|
||||
|
||||
$this->view->stories = $stories;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->cases = $this->dao->select('id, module, story, stage, status, pri, type')->from(TABLE_CASE)->where('product')->eq($productID)->andWhere('deleted')->eq(0)->fetchAll('id');
|
||||
$this->view->caseData = $caseData;
|
||||
$this->view->stepData = $stepData;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
|
||||
$this->view->isEndPage = $pagerID >= $allPager;
|
||||
$this->view->allCount = $allCount;
|
||||
$this->view->allPager = $allPager;
|
||||
$this->view->pagerID = $pagerID;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->product = $this->products[$productID];
|
||||
$this->view->maxImport = $maxImport;
|
||||
$this->view->stories = $stories;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->cases = $this->dao->select('id, module, story, stage, status, pri, type')->from(TABLE_CASE)->where('product')->eq($productID)->andWhere('deleted')->eq(0)->fetchAll('id');
|
||||
$this->view->caseData = $caseData;
|
||||
$this->view->stepData = $stepData;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
|
||||
$this->view->isEndPage = $pagerID >= $allPager;
|
||||
$this->view->allCount = $allCount;
|
||||
$this->view->allPager = $allPager;
|
||||
$this->view->pagerID = $pagerID;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->product = $this->products[$productID];
|
||||
$this->view->maxImport = $maxImport;
|
||||
$this->view->dataInsert = $insert;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -125,13 +125,15 @@ $(function()
|
||||
<tr>
|
||||
<td colspan='10' class='text-center form-actions'>
|
||||
<?php
|
||||
if(!$insert)
|
||||
$submitText = $isEndPage ? $this->lang->save : $this->lang->file->saveAndNext;
|
||||
if(!$insert and $dataInsert === '')
|
||||
{
|
||||
echo "<button type='button' data-toggle='modal' data-target='#importNoticeModal' class='btn btn-primary btn-wide'>{$lang->save}</button>";
|
||||
echo "<button type='button' data-toggle='modal' data-target='#importNoticeModal' class='btn btn-primary btn-wide'>{$submitText}</button>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::submitButton($isEndPage ? $this->lang->save : $this->lang->file->saveAndNext);
|
||||
echo html::submitButton($submitText);
|
||||
if($dataInsert !== '') echo html::hidden('insert', $dataInsert);
|
||||
echo html::hidden('isEndPage', $isEndPage ? 1 : 0);
|
||||
echo html::hidden('pagerID', $pagerID);
|
||||
}
|
||||
@@ -142,7 +144,7 @@ $(function()
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<?php if(!$insert) include '../../common/view/noticeimport.html.php';?>
|
||||
<?php if(!$insert and $dataInsert === '') include '../../common/view/noticeimport.html.php';?>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
Reference in New Issue
Block a user