* adjust code for task.
This commit is contained in:
@@ -367,6 +367,7 @@ class productModel extends model
|
||||
$lib = new stdclass();
|
||||
$lib->product = $productID;
|
||||
$lib->name = $this->lang->doclib->main['product'];
|
||||
$lib->type = 'product';
|
||||
$lib->main = '1';
|
||||
$lib->acl = $product->acl == 'open' ? 'open' : 'private';
|
||||
$this->dao->insert(TABLE_DOCLIB)->data($lib)->exec();
|
||||
|
||||
@@ -345,6 +345,7 @@ class projectModel extends model
|
||||
$lib = new stdclass();
|
||||
$lib->project = $projectID;
|
||||
$lib->name = $this->lang->doclib->main['project'];
|
||||
$lib->type = 'project';
|
||||
$lib->main = '1';
|
||||
$lib->acl = $project->acl == 'open' ? 'open' : 'private';
|
||||
$this->dao->insert(TABLE_DOCLIB)->data($lib)->exec();
|
||||
@@ -2012,6 +2013,12 @@ class projectModel extends model
|
||||
->fetchAll('id');
|
||||
|
||||
if(empty($tasks)) return array();
|
||||
|
||||
$taskTeam = $this->dao->select('*')->from(TABLE_TEAM)->where('root')->in(array_keys($tasks))->andWhere('type')->eq('task')->fetchGroup('root');
|
||||
if(!empty($taskTeam))
|
||||
{
|
||||
foreach($taskTeam as $taskID => $team) $tasks[$taskID]->team = $team;
|
||||
}
|
||||
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent'>
|
||||
<form class='main-table' method='post' id='teamForm'>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<form class='main-form' method='post' id='teamForm'>
|
||||
<table class='table table-form'>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
|
||||
@@ -47,6 +47,10 @@
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
$misc = "class='btn btn-link iframe" . (common::hasPriv('task', 'export', $project) ? '' : ' dissabled') . "' data-width='700'";
|
||||
$link = common::hasPriv('task', 'export') ? $this->createLink('task', 'export', "project=$projectID&orderBy=$orderBy&type=tree") : '#';
|
||||
echo html::a($link, "<i class='icon icon-export muted'></i> <span class='text'>{$lang->export}</span>", '', $misc);
|
||||
|
||||
$checkObject = new stdclass();
|
||||
$checkObject->project = $projectID;
|
||||
$misc = common::hasPriv('task', 'create', $checkObject) ? "class='btn btn-primary'" : "class='btn btn-primary disabled'";
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
.col-side .chosen-container .chosen-drop {width: 216px!important}
|
||||
.col-side .chosen-container {width: 218px!important}
|
||||
.table-form>tbody>tr>th{padding-top:7px;}
|
||||
#product_chosen .chosen-single{border-right-width:1px}
|
||||
|
||||
@@ -1424,6 +1424,7 @@ class task extends control
|
||||
|
||||
$this->view->allExportFields = $allExportFields;
|
||||
$this->view->customExport = true;
|
||||
$this->view->type = $type;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
+14
-3
@@ -672,7 +672,7 @@ class taskModel extends model
|
||||
->batchCheckIF($task->closedReason == 'cancel', 'finishedBy, finishedDate', 'empty')
|
||||
->where('id')->eq((int)$taskID)->exec();
|
||||
|
||||
if($oldTask->parent)
|
||||
if($oldTask->parent > 0)
|
||||
{
|
||||
$this->updateParentStatus($taskID);
|
||||
$this->computeBeginAndEnd($oldTask->parent);
|
||||
@@ -1618,14 +1618,25 @@ class taskModel extends model
|
||||
->leftjoin(TABLE_STORY)->alias('t3')->on('t1.story = t3.id')
|
||||
->where('t1.deleted')->eq(0)
|
||||
->beginIF($type == 'assignedTo')->andWhere('t1.status')->ne('closed')->fi()
|
||||
->beginIF($type != 'all')->andWhere("t1.`$type`")->eq($account)->fi()
|
||||
->beginIF($type == 'finishedBy')
|
||||
->andWhere('t1.finishedby', 1)->eq($this->app->user->account)
|
||||
->orWhere('t1.finishedList')->like("%,{$this->app->user->account},%")
|
||||
->markRight(1)
|
||||
->fi()
|
||||
->beginIF($type != 'all' and $type != 'finishedBy')->andWhere("t1.`$type`")->eq($account)->fi()
|
||||
->orderBy($orderBy)
|
||||
->beginIF($limit > 0)->limit($limit)->fi()
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
->fetchAll('id');
|
||||
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'task');
|
||||
|
||||
$taskTeam = $this->dao->select('*')->from(TABLE_TEAM)->where('root')->in(array_keys($tasks))->andWhere('type')->eq('task')->fetchGroup('root');
|
||||
if(!empty($taskTeam))
|
||||
{
|
||||
foreach($taskTeam as $taskID => $team) $tasks[$taskID]->team = $team;
|
||||
}
|
||||
|
||||
if($tasks) return $this->processTasks($tasks);
|
||||
return array();
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
<div class='detail'>
|
||||
<div class='detail-title'><?php echo $lang->task->legendBasic;?></div>
|
||||
<table class='table table-form'>
|
||||
<?php if(empty($task->parent)):?>
|
||||
<?php if($task->parent <= 0):?>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->task->project;?></th>
|
||||
<td><?php echo html::select('project', $projects, $task->project, 'class="form-control chosen" onchange="loadAll(this.value)"');?></td>
|
||||
|
||||
@@ -55,8 +55,12 @@
|
||||
<tr class='text-center'>
|
||||
<td><?php echo html::a($this->createLink('task', 'view', "taskID=$task->id"), sprintf('%03d', $task->id));?></td>
|
||||
<td><span class='<?php echo 'pri' . zget($lang->task->priList, $task->pri, $task->pri);?>'><?php echo $task->pri == '0' ? '' : zget($lang->task->priList, $task->pri, $task->pri)?></span></td>
|
||||
<td class='nobr'><?php echo html::a($this->createLink('project', 'browse', "projectid=$task->projectID"), $task->projectName);?></td>
|
||||
<td class='text-left nobr'><?php echo html::a($this->createLink('task', 'view', "taskID=$task->id"), $task->name);?></td>
|
||||
<td class='text-left nobr'><?php echo html::a($this->createLink('project', 'browse', "projectid=$task->projectID"), $task->projectName);?></td>
|
||||
<td class='text-left nobr'>
|
||||
<?php if(!empty($task->team)) echo '<span class="label label-badge label-light">' . $this->lang->task->multipleAB . '</span> ';?>
|
||||
<?php if($task->parent > 0) echo '<span class="label label-badge label-light">' . $this->lang->task->childrenAB . '</span> ';?>
|
||||
<?php echo html::a($this->createLink('task', 'view', "taskID=$task->id"), $task->name, null, "style='color: $task->color'");?>
|
||||
</td>
|
||||
<td><?php echo $task->estimate;?></td>
|
||||
<td><?php echo $task->consumed;?></td>
|
||||
<td><?php echo $task->left;?></td>
|
||||
|
||||
Reference in New Issue
Block a user