Fix redmine search

parent 2d5f1eca
......@@ -52,9 +52,20 @@ class SupportController extends Controller
$user = $client->user->getCurrentUser();
$models = $client->issue->all([
$params = [
'author_id' => $user['user']['id'],
];
if(Yii::$app->request->get('s'))
{
$params = ArrayHelper::merge($params, [
'f[]' => 'subject',
'op[subject]' => '~',
'v[subject][]' => Yii::$app->request->get('s'),
]);
}
$models = $client->issue->all($params);
return $this->render('index', [
'models' => $models,
......
......@@ -6,9 +6,10 @@ use common\models\Settings;
class IssueHelper
{
public static function sort($issues)
public static function sort($issues = null)
{
if($issues)
{
$settings = [
[
'statuses' => explode(',', Settings::getValue('support-status-work')),
......@@ -48,4 +49,7 @@ class IssueHelper
return $settings;
}
return null;
}
}
\ No newline at end of file
......@@ -64,8 +64,8 @@ use common\modules\support\models\redmine\IssueHelper;
<td class="no_pad">
<?php
$issues = IssueHelper::sort($models['issues']);
if($issues = IssueHelper::sort($models['issues']))
{
foreach ($issues as $issue)
{
if(!isset($issue['close']))
......@@ -77,6 +77,7 @@ use common\modules\support\models\redmine\IssueHelper;
$accepteds = $issue['models'];
}
}
}
?>
</td>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment