diff --git a/module/story/control.php b/module/story/control.php
index 192504e807..9bf05c02f1 100644
--- a/module/story/control.php
+++ b/module/story/control.php
@@ -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);
}
/**
diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php
index 22400d33a2..3a9fffac93 100644
--- a/module/story/view/create.html.php
+++ b/module/story/view/create.html.php
@@ -141,11 +141,11 @@
-
+
| story->spec;?> |
story->specTemplate) . "'");?> |
-
+
| story->verify;?> |
diff --git a/module/task/control.php b/module/task/control.php
index 997f42859a..d30168efcf 100644
--- a/module/task/control.php
+++ b/module/task/control.php
@@ -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
*/
diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js
index 932bf12594..08f5aaa5ab 100755
--- a/module/task/js/batchcreate.js
+++ b/module/task/js/batchcreate.js
@@ -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);
});
}
}
diff --git a/module/task/js/create.js b/module/task/js/create.js
index 15e1321932..4057a21e75 100644
--- a/module/task/js/create.js
+++ b/module/task/js/create.js
@@ -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");
});
}
diff --git a/module/task/model.php b/module/task/model.php
index 74205b959c..3e4294abd6 100644
--- a/module/task/model.php
+++ b/module/task/model.php
@@ -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;
diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php
index 7606501067..778732a8ce 100644
--- a/module/task/view/batchcreate.html.php
+++ b/module/task/view/batchcreate.html.php
@@ -80,6 +80,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
+
diff --git a/module/testcase/control.php b/module/testcase/control.php
index 05d1b5b4a8..ff5e4773c5 100644
--- a/module/testcase/control.php
+++ b/module/testcase/control.php
@@ -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;
diff --git a/module/testcase/model.php b/module/testcase/model.php
index 7958db676f..d677682bb0 100644
--- a/module/testcase/model.php
+++ b/module/testcase/model.php
@@ -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
*/
diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php
index fec4b76e06..0de4f1996e 100644
--- a/module/testcase/view/create.html.php
+++ b/module/testcase/view/create.html.php
@@ -38,7 +38,7 @@
|