* finish task 2016.

This commit is contained in:
ChuJilu
2014-10-24 14:08:27 +08:00
parent 71d329e28b
commit 067d69fc96
3 changed files with 54 additions and 6 deletions

View File

@@ -207,6 +207,14 @@ class project extends control
$this->config->project->search['params']['module']['values'] = $this->tree->getTaskOptionMenu($projectID, $startModuleID = 0);
$this->search->setSearchParams($this->config->project->search);
/* team member paors. */
$memberPairs = array();
$memberPairs[] = "";
foreach($this->view->teamMembers as $key => $member)
{
$memberPairs[$key] = $member->realname;
}
/* Assign. */
$this->view->tasks = $tasks;
$this->view->summary = $this->project->summary($tasks);
@@ -225,6 +233,7 @@ class project extends control
$this->view->moduleID = $moduleID;
$this->view->moduleTree = $this->tree->getTaskTreeMenu($projectID, $productID = 0, $startModuleID = 0, array('treeModel', 'createTaskLink'));
$this->view->projectTree = $this->project->tree();
$this->view->memberPairs = $memberPairs;
$this->display();
}
@@ -1513,12 +1522,14 @@ class project extends control
*/
public function batchUnlinkStory($projectID)
{
foreach($this->post->storyIDList as $storyID)
if(isset($_POST['storyIDList']))
{
$this->project->unlinkStory($projectID, $storyID);
foreach($this->post->storyIDList as $storyID)
{
$this->project->unlinkStory($projectID, $storyID);
}
}
echo js::locate($this->createLink('project', 'story', "projectID=$projectID"));
exit;
die(js::locate($this->createLink('project', 'story', "projectID=$projectID")));
}
/**

View File

@@ -140,8 +140,9 @@
<td colspan='<?php echo $columns;?>'>
<div class='table-actions clearfix'>
<?php
$canBatchEdit = common::hasPriv('task', 'batchEdit');
$canBatchClose = common::hasPriv('task', 'batchClose') and strtolower($browseType) != 'closedBy';
$canBatchEdit = common::hasPriv('task', 'batchEdit');
$canBatchClose = common::hasPriv('task', 'batchClose') and strtolower($browseType) != 'closedBy';
$canBatchAssignTo = common::hasPriv('task', 'batchAssignTo');
if(count($tasks))
{
echo "<div class='btn-group'>" . html::selectButton() . '</div>';
@@ -157,6 +158,16 @@
$misc = $canBatchClose ? "onclick=\"setFormAction('$actionLink','hiddenwin')\"" : "class='disabled'";
echo "<li>" . html::a('#', $lang->close, '', $misc) . "</li>";
echo "</ul></div>";
if($canBatchAssignTo)
{
$actionLink = $this->createLink('task', 'batchAssignTo', "projectID=$projectID");
echo "<div class='input-group w-150px'>";
echo html::select('assignedTo', $memberPairs, '', 'class="form-control chosen"');
echo "<span class='input-group-addon'>";
echo html::a("javascript:setFormAction(\"$actionLink\")", $lang->task->assign);
echo '</span></div>';
}
}
echo "<div class='text'>" . $summary . "</div>";
?>

View File

@@ -394,6 +394,32 @@ class task extends control
$this->display();
}
/**
* Batch update assign of task.
*
* @param int $project
* @access public
* @return void
*/
public function batchAssignTo($project)
{
if(!empty($_POST))
{
$taskIDList = $this->post->taskIDList;
unset($_POST['taskIDList']);
foreach($taskIDList as $taskID)
{
$this->loadModel('action');
$changes = $this->task->assign($taskID);
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->action->create('task', $taskID, 'Assigned', $this->post->comment, $this->post->assignedTo);
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
}
die(js::locate($this->createLink('project', 'task', "projectID=$project"), 'parent'));
}
}
/**
* View a task.
*