fix redmine module

parent f73e4fef
......@@ -11,7 +11,6 @@ use League\HTMLToMarkdown\HtmlConverter;
use common\models\Settings;
use common\modules\support\models\redmine\Issue;
use common\modules\support\models\redmine\IssueSearch;
/**
* Default controller for the `support` module
......@@ -114,7 +113,12 @@ class SupportController extends Controller
$user = $client->user->getCurrentUser();
$model = $client->issue->show($id);
$model = $client->issue->show($id, [
'include' => [
'attachments',
'changesets'
]
]);
if(empty($model['issue']) || $model['issue']['author']['id'] != $user['user']['id'])
{
......@@ -122,7 +126,7 @@ class SupportController extends Controller
}
return $this->render('view', [
'model' => $model,
'model' => $model['issue'],
]);
}
......
......@@ -17,11 +17,12 @@ class RedmineHelper
],
[
'statuses' => explode(',', Settings::getValue('support-status-new')),
'title' => 'Задачи на оценке',
'title' => 'Задачи на оценке у менеджера',
'rating' => true,
],
[
'statuses' => explode(',', Settings::getValue('support-status-test')),
'title' => 'Задачи на тестировании',
'statuses' => explode(',', Settings::getValue('support-status-rework')),
'title' => 'Задачи на доработке',
],
[
'statuses' => explode(',', Settings::getValue('support-status-approve')),
......
......@@ -4,7 +4,7 @@ use yii\helpers\Html;
?>
<?php if($output) : ?>
<?php if($output['models']) : ?>
<div class="panel-group panel-group-2" id="accordion_2">
<div class="panel panel-default">
......@@ -16,7 +16,7 @@ use yii\helpers\Html;
<td>
<p class="panel-title2 pull-left">
<!-- <a href=""><span class="glyphicon glyphicon-align-justify"></span></a>&nbsp;&nbsp; -->
<a href=""><strong><?=$title?></strong></a>&nbsp;&nbsp;
<strong><?=$title?></strong>&nbsp;&nbsp;
</p>
</td>
<td class="box_td">
......@@ -35,7 +35,7 @@ use yii\helpers\Html;
</div>
<div id="collapse_1" class="panel-collapse collapse in">
<?php foreach ($output as $model) : ?>
<?php foreach ($output['models'] as $model) : ?>
<div class="panel-body panel-body-ex-1 color_on_cursor gray_box_2">
<table class="w100pr">
<tbody>
......@@ -54,10 +54,15 @@ use yii\helpers\Html;
<span><?=date('d.m.Y', strtotime($model['created_on']))?></span>
</td>
<td class="box_td">
<span><?=($model->due_date?date('d.m.Y', strtotime($model['due_date'])):'')?></span>
<span><?=($model->due_date?date('d.m.Y', strtotime($model['due_date'])):'Не установлено')?></span>
</td>
<td class="box_td">
<p class="pull-left"><strong><?=Yii::$app->formatter->asCurrency($model['price_for_customer'], 'RUR', [], [\NumberFormatter::CURRENCY_SYMBOL => '₽'])?></strong></p>
<?php if(!$output['rating'] && $model['price_for_customer'] == 0) : ?>
<p class="green_text align_right"><strong>Гарантия</strong></p>
<?php else : ?>
<p class="pull-left"><strong><?=($model['price_for_customer']!=0 ? Yii::$app->formatter->asCurrency($model['price_for_customer'], 'RUR', [], [\NumberFormatter::CURRENCY_SYMBOL => '₽']) : 'Не установлено')?></strong></p>
<?php endif; ?>
<!-- <div class="tooltip_wr pull-right">
<div class="tooltip_box">Счет был выставлен</div>
......
......@@ -74,3 +74,5 @@ use common\modules\support\models\redmine\RedmineHelper;
</div>
</div>
<?=$this->render('@app/views/layouts/footer');?>
\ No newline at end of file
......@@ -70,7 +70,7 @@ use common\modules\support\models\redmine\RedmineHelper;
{
if(!isset($issue['close']))
{
echo $this->render('_loop', ['output' => $issue['models'], 'title' => $issue['title']]);
echo $this->render('_loop', ['output' => $issue, 'title' => $issue['title']]);
}
else
{
......@@ -93,14 +93,10 @@ use common\modules\support\models\redmine\RedmineHelper;
<?php foreach ($accepteds as $model) : ?>
<div class="panel-body panel-body-ex-1 panel-body-ex-2">
<div data-toggle="buttons">
<label class="btn pull-left active">
<input type="checkbox">
</label>
<div>
<div class="text-mes">
<p><?=$model['subject']?></p>
<p><?=Html::a($model['subject'], ['/support/view/'.$model['id']])?></p>
</div>
</div>
</div>
......@@ -112,3 +108,5 @@ use common\modules\support\models\redmine\RedmineHelper;
</div>
</div>
<?=$this->render('@app/views/layouts/footer');?>
\ No newline at end of file
......@@ -215,7 +215,9 @@ color: #fff;
.box_td_cont p {
margin: 0;
}
.box_td_cont a {
color: #494949;
}
.green_text, .green_text strong {
color: #b2cf9b !important;
}
......@@ -314,6 +316,9 @@ color: #fff;
padding: 0;
margin: 0;
}
.panel-body-ex-2 .text-mes a {
color: #999999;
}
.panel-body-ex-1 label.btn.active {
background-image: url('../images/panel-body-label-bg-act.jpg');
background-repeat: no-repeat;
......
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