* adjust for export word.

This commit is contained in:
wangyidong
2018-10-31 14:23:13 +08:00
parent fb9a368cea
commit 9687651633
2 changed files with 12 additions and 5 deletions
+2 -2
View File
@@ -14,8 +14,8 @@
<?php echo html::a($this->createLink('project', 'ajaxKanbanSetting', "projectID=$projectID"), "<i class='icon-cog muted'></i> " . $lang->project->kanbanSetting, '', "class='iframe btn btn-link'");?>
<?php if(common::hasPriv('project', 'printKanban')) echo html::a($this->createLink('project', 'printKanban', "projectID=$projectID"), "<i class='icon-printer muted'></i> " . $lang->project->printKanban, '', "class='iframe btn btn-link' id='printKanban' title='{$lang->project->printKanban}' data-width='500'");?>
<?php
$link = $this->createLink('task', 'export', "project=$projectID&orderBy=$orderBy&type=$browseType");
if(common::hasPriv('task', 'export')) echo html::a($link, "<i class='icon-import muted'></i> " . $lang->task->export, '', "class='btn btn-link iframe' data-width='700'");
$link = $this->createLink('task', 'export', "project=$projectID&orderBy=$orderBy&type=kanban");
if(common::hasPriv('task', 'export')) echo html::a($link, "<i class='icon-import muted'></i> " . $lang->task->export, '', "class='btn btn-link iframe export' data-width='700'");
?>
<div class='btn-group'>
<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown' id='importAction'>
+10 -3
View File
@@ -1278,7 +1278,7 @@ class task extends control
$task->progress .= '%';
}
}
else
elseif($this->session->taskQueryCondition)
{
$stmt = $this->dbh->query($this->session->taskQueryCondition . ($this->post->exportType == 'selected' ? " AND t1.id IN({$this->cookie->checkedItem})" : '') . " ORDER BY " . strtr($orderBy, '_', ' '));
while($row = $stmt->fetch()) $tasks[$row->id] = $row;
@@ -1307,7 +1307,7 @@ class task extends control
$relatedFiles = $this->dao->select('id, objectID, pathname, title')->from(TABLE_FILE)->where('objectType')->eq('task')->andWhere('objectID')->in(@array_keys($tasks))->andWhere('extra')->ne('editor')->fetchGroup('objectID');
$relatedModules = $this->loadModel('tree')->getTaskOptionMenu($projectID);
if(!$this->session->taskWithChildren)
if(!$this->session->taskWithChildren and $tasks)
{
$children = $this->dao->select('*')->from(TABLE_TASK)->where('deleted')->eq(0)
->andWhere('parent')->ne(0)
@@ -1359,8 +1359,14 @@ class task extends control
if($type == 'group')
{
$stories = $this->loadModel('story')->getProjectStories($projectID);
$groupTasks = array();
foreach($tasks as $task) $groupTasks[$task->$orderBy][] = $task;
foreach($tasks as $task)
{
$task->storyTitle = isset($stories[$task->story]) ? $stories[$task->story]->title : '';
$groupTasks[$task->$orderBy][] = $task;
}
$tasks = array();
foreach($groupTasks as $groupTask)
{
@@ -1424,6 +1430,7 @@ class task extends control
$this->view->allExportFields = $allExportFields;
$this->view->customExport = true;
$this->view->orderBy = $orderBy;
$this->view->type = $type;
$this->view->projectID = $projectID;
$this->display();