fix redmine module

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