* Finish task #5112.

This commit is contained in:
Yagami
2018-11-13 15:32:15 +08:00
parent 05cf1e5a34
commit 1c7e1a6ece
9 changed files with 64 additions and 16 deletions
+20 -2
View File
@@ -387,6 +387,22 @@ class doc extends control
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('doc', 'view', "docID=$docID")));
}
$libs = $this->doc->getLibs();
foreach($libs as $id => $libName)
{
$lib = $this->doc->getLibById($id);
if($lib->project != 0)
{
$project = $this->loadModel('project')->getByID($lib->project);
$libs[$id] = $project->name . '/' . $libName;
}
if($lib->product != 0)
{
$product = $this->loadModel('product')->getByID($lib->product);
$libs[$id] = $product->name . '/' . $libName;
}
}
/* Get doc and set menu. */
$doc = $this->doc->getById($docID);
$libID = $doc->lib;
@@ -404,6 +420,7 @@ class doc extends control
$this->view->doc = $doc;
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($libID, 'doc', $startModuleID = 0);
$this->view->type = $type;
$this->view->libs = $libs;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->user->getPairs('noletter', $doc->users);
$this->display();
@@ -617,10 +634,11 @@ class doc extends control
* @access public
* @return void
*/
public function ajaxGetChild($libID)
public function ajaxGetChild($libID, $type = 'module')
{
$childModules = $this->loadModel('tree')->getOptionMenu($libID, 'doc');
die(html::select('parent', $childModules, '', "class='form-control'"));
$select = ($type == 'module') ? html::select('module', $childModules, '', "class='form-control chosen'") : html::select('parent', $childModules, '', "class='form-control chosen'");
die($select);
}
/**
+11
View File
@@ -16,3 +16,14 @@ $(function()
}
})
})
function loadDocModule(libID)
{
link = createLink('doc', 'ajaxGetChild', 'libID=' + libID);
$.post(link, function(data)
{
$('#module').replaceWith(data);
$('#module_chosen').remove();
$('#module').chosen();
})
}
+1 -1
View File
@@ -658,7 +658,7 @@ class docModel extends model
$doc = $this->loadModel('file')->processImgURL($doc, $this->config->doc->editor->edit['id'], $this->post->uid);
$doc->product = $lib->product;
$doc->project = $lib->project;
if($doc->type == 'url') $doc->content = $doc->url;
if(isset($doc->type) and $doc->type == 'url') $doc->content = $doc->url;
unset($doc->url);
$files = $this->file->saveUpload('doc', $docID);
+4 -1
View File
@@ -24,10 +24,13 @@
</div>
<form class='load-indicator main-form form-ajax' method='post' enctype='multipart/form-data' id='dataform'>
<table class='table table-form'>
<tr>
<th><?php echo $lang->doc->lib;?></th>
<td> <?php echo html::select('lib', $libs, $doc->lib, "class='form-control chosen' onchange=loadDocModule(this.value)");?> </td><td></td>
</tr>
<tr>
<th><?php echo $lang->doc->module;?></th>
<td>
<?php echo html::hidden('lib', $doc->lib)?>
<span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $doc->module, "class='form-control chosen'");?></span>
</td><td></td>
</tr>
+1 -1
View File
@@ -337,7 +337,7 @@ $lang->resource->project->printKanban = 'printKanban';
$lang->resource->project->tree = 'tree';
$lang->resource->project->treeTask = 'treeTask';
$lang->resource->project->treeStory = 'treeStory';
$lang->resource->project->all = 'all';
$lang->resource->project->all = 'allProjects';
$lang->resource->project->kanbanHideCols = 'kanbanHideCols';
$lang->resource->project->kanbanColsColor = 'kanbanColsColor';
$lang->resource->project->export = 'export';
+8 -8
View File
@@ -60,12 +60,12 @@ $lang->project->readjustTask = '顺延任务的起止时间';
$lang->project->effort = '日志';
$lang->project->relatedMember = '相关成员';
$lang->project->start = '开始';
$lang->project->activate = '激活';
$lang->project->putoff = '延期';
$lang->project->suspend = '挂起';
$lang->project->close = '关闭';
$lang->project->export = '导出';
$lang->project->start = "开始$lang->projectCommon";
$lang->project->activate = "激活$lang->projectCommon";
$lang->project->putoff = "延期$lang->projectCommon";
$lang->project->suspend = "挂起$lang->projectCommon";
$lang->project->close = "关闭$lang->projectCommon";
$lang->project->export = "导出$lang->projectCommon";
$lang->project->typeList['sprint'] = "短期$lang->projectCommon";
$lang->project->typeList['waterfall'] = "长期$lang->projectCommon";
@@ -115,7 +115,7 @@ $lang->project->latestDynamic = '最新动态';
$lang->project->build = '所有版本';
$lang->project->testtask = '测试任务';
$lang->project->burn = '燃尽图';
$lang->project->computeBurn = '更新';
$lang->project->computeBurn = '更新燃尽图';
$lang->project->burnData = '燃尽图数据';
$lang->project->fixFirst = '修改首天工时';
$lang->project->team = '团队成员';
@@ -142,7 +142,7 @@ $lang->project->batchUnlinkStory = '批量移除需求';
$lang->project->importTask = '转入任务';
$lang->project->importPlanStories = '按计划关联需求';
$lang->project->importBug = '导入Bug';
$lang->project->updateOrder = '排序';
$lang->project->updateOrder = "{$lang->projectCommon}排序";
$lang->project->tree = '树状图';
$lang->project->treeTask = '只看任务';
$lang->project->treeStory = '只看需求';
+1 -1
View File
@@ -21,7 +21,7 @@ $lang->todo->close = "关闭";
$lang->todo->batchClose = "批量关闭";
$lang->todo->batchEdit = "批量编辑";
$lang->todo->view = "待办详情";
$lang->todo->finish = "完成";
$lang->todo->finish = "完成待办";
$lang->todo->batchFinish = "批量完成";
$lang->todo->export = "导出";
$lang->todo->delete = "删除";
+17 -1
View File
@@ -238,9 +238,25 @@ class tree extends control
$this->view->optionMenu = $this->tree->getOptionMenu($module->root, $module->type, 0, $branch);
}
$libs = $this->loadModel('doc')->getLibs();
foreach($libs as $id => $libName)
{
$lib = $this->doc->getLibById($id);
if($lib->project != 0)
{
$project = $this->loadModel('project')->getByID($lib->project);
$libs[$id] = $project->name . '/' . $libName;
}
if($lib->product != 0)
{
$product = $this->loadModel('product')->getByID($lib->product);
$libs[$id] = $product->name . '/' . $libName;
}
}
$this->view->module = $module;
$this->view->type = $type;
$this->view->libs = array('' => '') + $this->loadModel('doc')->getLibs();
$this->view->libs = $libs;
$this->view->branch = $branch;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted', $module->owner);
+1 -1
View File
@@ -96,7 +96,7 @@ $(function()
})
function loadDocModule(libID)
{
link = createLink('doc', 'ajaxGetChild', 'libID=' + libID);
link = createLink('doc', 'ajaxGetChild', 'libID=' + libID + '&type=parent');
$.post(link, function(data)
{
$('#parent').replaceWith(data);