* Fix Bug

This commit is contained in:
滔哥
2017-12-14 15:12:05 +08:00
parent b4517c9945
commit 24366d4e54
6 changed files with 26 additions and 8 deletions
+6 -2
View File
@@ -857,6 +857,9 @@ class project extends control
/**
* Create a project.
*
* @param string $projectID
* @param string $copyProjectID
*
* @access public
* @return void
*/
@@ -1305,8 +1308,8 @@ class project extends control
public function tree($projectID, $type = '')
{
$this->project->setMenu($this->projects, $projectID);
$project = $this->loadModel('project')->getById($projectID);
$tree = $this->project->getProjectTree($projectID);
$project = $this->loadModel('project')->getById($projectID);
$tree = $this->project->getProjectTree($projectID);
/* Save to session. */
$uri = $this->app->getURI(true);
@@ -1946,6 +1949,7 @@ class project extends control
*/
public function tips($projectID)
{
$this->view->project = $this->project->getById($projectID);
$this->view->projectID = $projectID;
$this->display('project', 'tips');
}
+7
View File
@@ -49,6 +49,13 @@ js::set('browseType', $browseType);
if($useDatatable) include '../../common/view/datatable.html.php';
$customFields = $this->datatable->getSetting('project');
if($project->type == 'ops')
{
foreach($customFields as $id => $customField)
{
if($customField->id == 'story') unset($customFields[$id]);
}
}
$widths = $this->datatable->setFixedFieldWidth($customFields);
$columns = 0;
?>
+2
View File
@@ -28,6 +28,7 @@
foreach(customModel::getFeatureMenu('project', 'task') as $menuItem)
{
if($project->type == 'ops' && $menuItem->name == 'needconfirm') continue;
if(isset($menuItem->hidden)) continue;
$menuType = $menuItem->name;
if(strpos($menuType, 'QUERY') === 0)
@@ -73,6 +74,7 @@
foreach ($lang->project->groups as $key => $value)
{
if($key == '') continue;
if($project->type == 'ops' && $key == 'story') continue;
echo '<li' . ($key == $groupBy ? " class='active'" : '') . '>';
common::printLink('project', 'groupTask', "project=$projectID&groupBy=$key", $value);
}
+1 -1
View File
@@ -2,7 +2,7 @@
<h6><?php echo $lang->project->afterInfo;?></h6>
<div class='pdb-20'>
<?php echo html::a($this->createLink('project', 'team', "projectID=$projectID"), $lang->project->setTeam, '', "class='btn'");?>
<?php if($this->config->global->flow != 'onlyTask') echo html::a($this->createLink('project', 'linkstory', "projectID=$projectID"), $lang->project->linkStory, '', "class='btn'");?>
<?php if($this->config->global->flow != 'onlyTask' && $project->type != 'ops') echo html::a($this->createLink('project', 'linkstory', "projectID=$projectID"), $lang->project->linkStory, '', "class='btn'");?>
<?php echo html::a($this->createLink('task', 'create', "project=$projectID"), $lang->project->createTask, '', "class='btn'");?>
<?php echo html::a($this->createLink('project', 'task', "projectID=$projectID"), $lang->project->goback, '', "class='btn'");?>
</div>
+9 -4
View File
@@ -152,6 +152,8 @@ class task extends control
/* Set Custom*/
foreach(explode(',', $this->config->task->customCreateFields) as $field) $customFields[$field] = $this->lang->task->$field;
if($project->type == 'ops') unset($customFields['story']);
$this->view->customFields = $customFields;
$this->view->showFields = $this->config->task->custom->createFields;
@@ -1172,14 +1174,17 @@ class task extends control
*/
public function export($projectID, $orderBy)
{
$project = $this->project->getById($projectID);
$allExportFields = $this->config->task->exportFields;
if($project->type == 'ops') $allExportFields = str_replace(' story,', '', $allExportFields);
if($_POST)
{
$this->loadModel('file');
$taskLang = $this->lang->task;
$taskConfig = $this->config->task;
$taskLang = $this->lang->task;
/* Create field lists. */
$fields = $this->post->exportFields ? $this->post->exportFields : explode(',', $taskConfig->exportFields);
$fields = $this->post->exportFields ? $this->post->exportFields : explode(',', $allExportFields);
foreach($fields as $key => $fieldName)
{
$fieldName = trim($fieldName);
@@ -1286,7 +1291,7 @@ class task extends control
$this->fetch('file', 'export2' . $this->post->fileType, $_POST);
}
$this->view->allExportFields = $this->config->task->exportFields;
$this->view->allExportFields = $allExportFields;
$this->view->customExport = true;
$this->display();
}
+1 -1
View File
@@ -16,7 +16,7 @@
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['task']);?></span>
<strong><small class='text-muted'><?php echo html::icon($lang->icons['batchCreate']);?></small> <?php echo $lang->task->batchCreate;?></strong>
<span><small><a href='javascript:toggleZeroTaskStory();' id='zeroTaskStory'><?php echo $lang->story->zeroTask;?><i class='icon icon-remove'></i></a></small></span>
<?php if($project->type != 'ops'):?><span><small><a href='javascript:toggleZeroTaskStory();' id='zeroTaskStory'><?php echo $lang->story->zeroTask;?><i class='icon icon-remove'></i></a></small></span><?php endif;?>
<div class='actions'>
<?php echo html::commonButton($lang->pasteText, "data-toggle='myModal'", 'btn btn-primary')?>
<button type="button" class="btn btn-default" data-toggle="customModal"><i class='icon icon-cog'></i> </button>