* Finish task #3224.

This commit is contained in:
pengjiangxiu
2017-09-14 11:07:28 +08:00
parent 33d1d0b2d0
commit 844ee7452f
10 changed files with 59 additions and 39 deletions
+19 -14
View File
@@ -29,14 +29,14 @@ class story extends control
/**
* Create a story.
*
* @param int $productID
* @param int $branch
* @param int $moduleID
* @param int $storyID
* @param int $projectID
* @param int $bugID
* @param int $planID
*
* @param int $productID
* @param int $branch
* @param int $moduleID
* @param int $storyID
* @param int $projectID
* @param int $bugID
* @param int $planID
* @access public
* @return void
*/
@@ -1259,15 +1259,20 @@ class story extends control
/**
* AJAX: get module of a story.
*
* @param int $storyID
*
* @param int $storyID
* @access public
* @return string
* @return string
*/
public function ajaxGetModule($storyID)
public function ajaxGetInfo($storyID)
{
$story = $this->story->getByID($storyID);
echo $story->module;
$story = $this->story->getByID($storyID);
$storyInfo['moduleID'] = $story->module;
$storyInfo['estimate'] = $story->estimate;
$storyInfo['pri'] = $story->pri;
$storyInfo['spec'] = $story->spec;
echo json_encode($storyInfo);
}
/**
+2 -2
View File
@@ -141,11 +141,11 @@
<?php endif;?>
</div>
</td>
</tr>
</tr>
<tr>
<th><?php echo $lang->story->spec;?></th>
<td colspan='2'><?php echo html::textarea('spec', $spec, "rows='9' class='form-control disabled-ie-placeholder' placeholder='" . htmlspecialchars($lang->story->specTemplate) . "'");?></td>
</tr>
</tr>
<?php if(strpos(",$showFields,", ',verify,') !== false):?>
<tr>
<th><?php echo $lang->story->verify;?></th>
+3 -3
View File
@@ -168,9 +168,9 @@ class task extends control
/**
* Batch create task.
*
* @param int $projectID
* @param int $storyID
*
* @param int $projectID
* @param int $storyID
* @access public
* @return void
*/
+14 -3
View File
@@ -38,7 +38,14 @@ function copyStoryTitle(num)
startPosition = storyTitle.indexOf(':') + 1;
endPosition = storyTitle.lastIndexOf('[');
storyTitle = storyTitle.substr(startPosition, endPosition - startPosition);
$('#name\\[' + num + '\\]').val(storyTitle);
$('#estimate\\[' + num + '\\]').val($('#storyEstimate' + num).val());
$('#desc\\[' + num + '\\]').val($('#storyDesc' + num).val());
var storyPri = $('#storyPri' + num).val();
if(storyPri == 0) $('#pri' + num ).val('3');
if(storyPri != 0) $('#pri' + num ).val(storyPri);
}
/* Set the story module. */
@@ -47,11 +54,15 @@ function setStoryRelated(num)
var storyID = $('#story' + num).val();
if(storyID)
{
var link = createLink('story', 'ajaxGetModule', 'storyID=' + storyID);
$.get(link, function(moduleID)
var link = createLink('story', 'ajaxGetInfo', 'storyID=' + storyID);
$.getJSON(link, function(storyInfo)
{
$('#module' + num).val(parseInt(moduleID));
$('#module' + num).val(parseInt(storyInfo.moduleID));
$('#module' + num).trigger("chosen:updated");
$('#storyEstimate' + num).val(storyInfo.estimate);
$('#storyPri' + num).val(storyInfo.pri);
$('#storyDesc' + num).val(storyInfo.spec);
});
}
}
+3 -3
View File
@@ -40,10 +40,10 @@ function setStoryModule()
var storyID = $('#story').val();
if(storyID)
{
var link = createLink('story', 'ajaxGetModule', 'storyID=' + storyID);
$.get(link, function(moduleID)
var link = createLink('story', 'ajaxGetInfo', 'storyID=' + storyID);
$.getJSON(link, function(storyInfo)
{
$('#module').val(moduleID);
$('#module').val(storyInfo.moduleID);
$("#module").trigger("chosen:updated");
});
}
+4 -4
View File
@@ -98,8 +98,8 @@ class taskModel extends model
/**
* Create a batch task.
*
* @param int $projectID
*
* @param int $projectID
* @access public
* @return void
*/
@@ -131,7 +131,7 @@ class taskModel extends model
for($i = 0; $i < $batchNum; $i++)
{
$story = $tasks->story[$i] == 'ditto' ? $story : $tasks->story[$i];
$module = $tasks->module[$i] == 'ditto' ? $module : $tasks->module[$i];
$module = $tasks->module[$i] == 'ditto' ? $module : $tasks->module[$i];
$type = $tasks->type[$i] == 'ditto' ? $type : $tasks->type[$i];
$assignedTo = $tasks->assignedTo[$i] == 'ditto' ? $assignedTo: $tasks->assignedTo[$i];
@@ -176,7 +176,7 @@ class taskModel extends model
$taskID = $this->dao->lastInsertID();
if($tasks->story[$i] != false) $this->story->setStage($tasks->story[$i]);
$actionID = $this->action->create('task', $taskID, 'Opened', '');
$mails[$i] = new stdclass();
$mails[$i]->taskID = $taskID;
$mails[$i]->actionID = $actionID;
+1
View File
@@ -80,6 +80,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
<?php echo html::select("story[$i]", $stories, $currentStory, "class='form-control chosen' onchange='setStoryRelated($i)'");?>
<span class='input-group-btn'>
<a href='javascript:copyStoryTitle(<?php echo $i;?>)' class='btn' title='<?php echo $lang->task->copyStoryTitle; ?>'><i class='icon-angle-right'></i></a>
<?php echo html::hidden("storyEstimate$i") . html::hidden("storyDesc$i") . html::hidden("storyPri$i");?>
</span>
</div>
</td>
+5 -2
View File
@@ -265,6 +265,7 @@ class testcase extends control
$precondition = '';
$keywords = '';
$steps = array();
$color = '';
/* If testcaseID large than 0, use this testcase as template. */
if($testcaseID > 0)
@@ -279,8 +280,9 @@ class testcase extends control
$precondition = $testcase->precondition;
$keywords = $testcase->keywords;
$steps = $testcase->steps;
$color = $testcase->color;
}
/* If bugID large than 0, use this bug as template. */
if($bugID > 0)
{
@@ -292,7 +294,7 @@ class testcase extends control
$keywords = $bug->keywords;
$steps = $this->testcase->createStepsFromBug($bug->steps);
}
/* Padding the steps to the default steps count. */
if(count($steps) < $this->config->testcase->defaultSteps)
{
@@ -332,6 +334,7 @@ class testcase extends control
$this->view->currentModuleID = $currentModuleID ? $currentModuleID : (isset($story->module) ? $story->module : 0);
$this->view->stories = $stories;
$this->view->caseTitle = $caseTitle;
$this->view->color = $color;
$this->view->type = $type;
$this->view->stage = $stage;
$this->view->pri = $pri;
+6 -6
View File
@@ -73,7 +73,7 @@ class testcaseModel extends model
/**
* Create a case.
*
*
* @param int $bugID
* @access public
* @return void
@@ -1224,11 +1224,11 @@ class testcaseModel extends model
/**
* Print cell data
*
* @param object $col
* @param object $case
* @param array $users
* @param array $branches
*
* @param object $col
* @param object $case
* @param array $users
* @param array $branches
* @access public
* @return void
*/
+2 -2
View File
@@ -38,7 +38,7 @@
<td style='padding-left:15px;'>
<div class='input-group' id='moduleIdBox'>
<span class="input-group-addon"><?php echo $lang->testcase->module?></span>
<?php
<?php
echo html::select('module', $moduleOptionMenu, $currentModuleID, "onchange='loadModuleRelated();' class='form-control chosen'");
if(count($moduleOptionMenu) == 1)
{
@@ -86,7 +86,7 @@
<div class='row-table'>
<div class='col-table w-p100'>
<div class='input-group w-p100'>
<input type='hidden' id='color' name='color' data-provide='colorpicker' data-wrapper='input-group-btn' data-pull-menu-right='false' data-btn-tip='<?php echo $lang->testcase->colorTag ?>' data-update-text='#title'>
<input type='hidden' id='color' name='color' data-provide='colorpicker' data-wrapper='input-group-btn' data-pull-menu-right='false' data-btn-tip='<?php echo $lang->testcase->colorTag ?>' data-update-text='#title' value='<?php echo $color;?>'>
<?php echo html::input('title', $caseTitle, "class='form-control' autocomplete='off'");?>
<?php if(!$this->testcase->forceNotReview()):?>
<span class='input-group-addon'><?php echo html::checkbox('forceNotReview', $lang->testcase->forceNotReview, '', "id='forceNotReview'");?></span>