|
diff --git a/module/story/control.php b/module/story/control.php
index 79e1d7ec10..e749aaa095 100644
--- a/module/story/control.php
+++ b/module/story/control.php
@@ -1074,10 +1074,20 @@ class story extends control
{
if(!empty($_POST))
{
+ $response['result'] = 'success';
+ $response['message'] = $this->lang->story->successToTask;
+
$this->story->batchToTask($projectID);
- if(dao::isError()) die(js::error(dao::getError()) . js::locate('back'));
- die(js::alert($this->lang->story->successToTask) . js::locate($this->createLink('project', 'task', "projectID=$projectID"), 'parent'));
+ if(dao::isError())
+ {
+ $response['result'] = 'fail';
+ $response['message'] = dao::getError();
+ $this->send($response);
+ }
+
+ $response['locate'] = $this->createLink('project', 'task', "projectID=$projectID");
+ $this->send($response);
}
}
diff --git a/module/story/lang/de.php b/module/story/lang/de.php
index 09ec423fa3..22c7b13666 100644
--- a/module/story/lang/de.php
+++ b/module/story/lang/de.php
@@ -60,11 +60,12 @@ $lang->story->batchChangeModule = "Mehere Module ändern";
$lang->story->viewAll = "Alle";
$lang->story->toTask = 'Convert to Task';
$lang->story->batchToTask = 'Batch Convert to Task';
+$lang->story->convertRelations = 'Convert Relations';
$lang->story->skipStory = '%s is a parent story. It cannot be closed.';
$lang->story->closedStory = 'Story %s is closed and will not be closed.';
$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task. The closed {$lang->storyCommon} will not be converted into tasks.";
-$lang->story->successToTask = "Converted to task."
+$lang->story->successToTask = "Converted to task.";
$lang->story->common = 'Story';
$lang->story->id = 'ID';
@@ -126,7 +127,7 @@ $lang->story->allStories = 'Alle';
$lang->story->unclosed = 'Nicht geschlossen';
$lang->story->deleted = 'Gelöscht';
$lang->story->released = 'Released Linked Stories';
-$lang->story->oneUnit = 'One Unit';
+$lang->story->one = 'One';
$lang->story->field = 'Synchronized fields';
$lang->story->ditto = 'Dito';
diff --git a/module/story/lang/en.php b/module/story/lang/en.php
index d62f2c7b17..78eb8d33fe 100644
--- a/module/story/lang/en.php
+++ b/module/story/lang/en.php
@@ -60,11 +60,12 @@ $lang->story->batchChangeModule = "Batch Change Modules";
$lang->story->viewAll = "See All";
$lang->story->toTask = 'Convert to Task';
$lang->story->batchToTask = 'Batch Convert to Task';
+$lang->story->convertRelations = 'Convert Relations';
$lang->story->skipStory = '%s is a parent story. It cannot be closed.';
$lang->story->closedStory = 'Story %s is closed and will not be closed.';
$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task. The closed {$lang->storyCommon} will not be converted into tasks.";
-$lang->story->successToTask = "Converted to task."
+$lang->story->successToTask = "Converted to task.";
$lang->story->common = 'Story';
$lang->story->id = 'ID';
@@ -126,7 +127,7 @@ $lang->story->allStories = 'All Stories';
$lang->story->unclosed = 'Unclosed';
$lang->story->deleted = 'Deleted';
$lang->story->released = 'Released Stories';
-$lang->story->oneUnit = 'One Unit';
+$lang->story->one = 'One';
$lang->story->field = 'Synchronized fields';
$lang->story->ditto = 'Ditto';
diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php
index 115be96898..d5c3b08569 100644
--- a/module/story/lang/fr.php
+++ b/module/story/lang/fr.php
@@ -60,11 +60,12 @@ $lang->story->batchChangeModule = "Changer Modules par lot";
$lang->story->viewAll = "Voir Tout";
$lang->story->toTask = 'Convert to Task';
$lang->story->batchToTask = 'Batch Convert to Task';
+$lang->story->convertRelations = 'Convert Relations';
$lang->story->skipStory = '%s is a parent story. It cannot be closed.';
$lang->story->closedStory = 'Story %s is closed and will not be closed.';
$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task. The closed {$lang->storyCommon} will not be converted into tasks.";
-$lang->story->successToTask = "Converted to task."
+$lang->story->successToTask = "Converted to task.";
$lang->story->common = 'Story';
$lang->story->id = 'ID';
@@ -126,7 +127,7 @@ $lang->story->allStories = 'Toutes les Stories';
$lang->story->unclosed = 'Non Fermées';
$lang->story->deleted = 'Supprimée';
$lang->story->released = 'Stories Versionnées';
-$lang->story->oneUnit = 'One Unit';
+$lang->story->one = 'One';
$lang->story->field = 'Synchronized fields';
$lang->story->ditto = 'Idem';
diff --git a/module/story/lang/vi.php b/module/story/lang/vi.php
index 9b9a2b80e4..ac607bdfb3 100644
--- a/module/story/lang/vi.php
+++ b/module/story/lang/vi.php
@@ -60,11 +60,12 @@ $lang->story->batchChangeModule = "Thay đổi Module hàng loạt";
$lang->story->viewAll = "Xem tất cả";
$lang->story->toTask = 'Convert to Task';
$lang->story->batchToTask = 'Batch Convert to Task';
+$lang->story->convertRelations = 'Convert Relations';
$lang->story->skipStory = '%s is a parent story. It cannot be closed.';
$lang->story->closedStory = 'Story %s is closed and will not be closed.';
$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task. The closed {$lang->storyCommon} will not be converted into tasks.";
-$lang->story->successToTask = "Converted to task."
+$lang->story->successToTask = "Converted to task.";
$lang->story->common = 'Câu chuyện';
$lang->story->id = 'ID';
@@ -126,7 +127,7 @@ $lang->story->allStories = 'Tất cả câu chuyện';
$lang->story->unclosed = 'Chưa đóng';
$lang->story->deleted = 'Đã xóa';
$lang->story->released = 'Đã phát hành';
-$lang->story->oneUnit = 'One Unit';
+$lang->story->one = 'One';
$lang->story->field = 'Synchronized fields';
$lang->story->ditto = 'Như trên';
diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php
index c3d0b931e9..84b2c0c129 100644
--- a/module/story/lang/zh-cn.php
+++ b/module/story/lang/zh-cn.php
@@ -60,6 +60,7 @@ $lang->story->batchChangeModule = "批量修改模块";
$lang->story->viewAll = '查看全部';
$lang->story->toTask = '转任务';
$lang->story->batchToTask = '批量转任务';
+$lang->story->convertRelations = '换算关系';
$lang->story->skipStory = '需求:%s 为父需求,将不会被关闭。';
$lang->story->closedStory = '需求:%s 已关闭,将不会被关闭。';
@@ -126,7 +127,7 @@ $lang->story->allStories = "所有{$lang->storyCommon}";
$lang->story->unclosed = '未关闭';
$lang->story->deleted = '已删除';
$lang->story->released = "已发布{$lang->storyCommon}数";
-$lang->story->oneUnit = '一个单位';
+$lang->story->one = '一个';
$lang->story->field = '同步的字段';
$lang->story->ditto = '同上';
diff --git a/module/story/model.php b/module/story/model.php
index 46c0580e70..d30fcf4d36 100644
--- a/module/story/model.php
+++ b/module/story/model.php
@@ -1426,6 +1426,18 @@ class storyModel extends model
$data = fixer::input('post')->get();
$now = helper::now();
+ /* Judgment of required items. */
+ if(empty($data->type))
+ {
+ dao::$errors['type'] = sprintf($this->lang->error->notempty, $this->lang->task->type);
+ }
+
+ if(isset($data->hourPointValue) and empty($data->hourPointValue))
+ {
+ dao::$errors['hourPointValue'] = sprintf($this->lang->error->notempty, $this->lang->story->convertRelations);
+ }
+ if(dao::isError()) return false;
+
/* Create tasks. */
$stories = $this->getByList($data->storyIdList);
foreach($stories as $story)
@@ -1438,12 +1450,13 @@ class storyModel extends model
$task->story = $story->id;
$task->type = $data->type;
$task->estimate = isset($data->hourPointValue) ? ($story->estimate * $data->hourPointValue) : $story->estimate;
+ $task->left = $task->estimate;
$task->openedBy = $this->app->user->account;
$task->openedDate = $now;
- if(isset($data->field))
+ if(isset($data->fields))
{
- foreach($data->field as $field)
+ foreach($data->fields as $field)
{
$task->$field = $story->$field;
|