* Add getUserIssuePairs method.
This commit is contained in:
@@ -23,7 +23,7 @@ $config->issue->search['fields']['severity'] = $lang->issue->severity;
|
||||
$config->issue->search['fields']['type'] = $lang->issue->type;
|
||||
$config->issue->search['fields']['ceratedBy'] = $lang->issue->createdBy;
|
||||
$config->issue->search['fields']['createdDate'] = $lang->issue->createdDate;
|
||||
$config->issue->search['fields']['closeBy'] = $lang->issue->closeBy;
|
||||
$config->issue->search['fields']['closedBy'] = $lang->issue->closedBy;
|
||||
$config->issue->search['fields']['closedDate'] = $lang->issue->closedDate;
|
||||
$config->issue->search['fields']['assignedTo'] = $lang->issue->assignedTo;
|
||||
$config->issue->search['fields']['assignedDate'] = $lang->issue->assignedDate;
|
||||
|
||||
+29
-1
@@ -25,6 +25,7 @@ class issueModel extends model
|
||||
$data = fixer::input('post')
|
||||
->add('createdBy', $this->app->user->account)
|
||||
->add('createdDate', $now)
|
||||
->add('status', 'unconfirmed')
|
||||
->add('PRJ', $this->session->PRJ)
|
||||
->remove('labels,files')
|
||||
->addIF($this->post->assignedTo, 'assignedBy', $this->app->user->account)
|
||||
@@ -180,6 +181,33 @@ class issueModel extends model
|
||||
return $this->dao->select('id,name')->from(TABLE_ACTIVITY)->where('deleted')->eq('0')->orderBy('id_desc')->fetchPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get issue pairs of a user.
|
||||
*
|
||||
* @param string $account
|
||||
* @param int $limit
|
||||
* @param string $status all|unconfirmed|active|suspended|resolved|closed|canceled
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUserIssuePairs($account, $limit = 10, $status = 'all')
|
||||
{
|
||||
$stmt = $this->dao->select('t1.id, t1.title, t2.name as project')
|
||||
->from(TABLE_ISSUE)->alias('t1')
|
||||
->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.PRJ = t2.id')
|
||||
->where('t1.assignedTo')->eq($account)
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi()
|
||||
->query();
|
||||
|
||||
$issues = array();
|
||||
while($issue = $stmt->fetch())
|
||||
{
|
||||
$issues[$issue->id] = $issue->project . ' / ' . $issue->title;
|
||||
}
|
||||
return $issues;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an issue.
|
||||
*
|
||||
@@ -242,7 +270,7 @@ class issueModel extends model
|
||||
{
|
||||
$oldIssue = $this->getByID($issueID);
|
||||
$data = fixer::input('post')
|
||||
->add('closeBy', $this->app->user->account)
|
||||
->add('closedBy', $this->app->user->account)
|
||||
->add('status', 'closed')
|
||||
->get();
|
||||
|
||||
|
||||
@@ -36,9 +36,11 @@ foreach($issue as $field => $value)
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(!isonlybody()):?>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php if(common::hasPriv('issue', 'create')) echo html::a($createLink, "<i class='icon icon-plus'></i> {$lang->issue->create}", '', "class='btn btn-primary'");?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div class="main-row" id="mainContent">
|
||||
<div class="main-col col-8">
|
||||
|
||||
Reference in New Issue
Block a user