fix comments

parent 271b6012
...@@ -121,6 +121,8 @@ class SupportController extends Controller ...@@ -121,6 +121,8 @@ class SupportController extends Controller
public function actionView($id) public function actionView($id)
{ {
$this->view->registerJsFile('/js/support.js', ['position' => yii\web\View::POS_END ]);
$client = $this->getClient(); $client = $this->getClient();
$user = $client->user->getCurrentUser(); $user = $client->user->getCurrentUser();
...@@ -146,6 +148,24 @@ class SupportController extends Controller ...@@ -146,6 +148,24 @@ class SupportController extends Controller
'notes' => $issue->notes, 'notes' => $issue->notes,
]; ];
if($issue->files)
{
$uploads = [];
foreach ($issue->files as $file)
{
$uploads[] = [
'token' => $file['token'],
'filename' => $file['filename'],
'content_type' => $file['type'],
];
}
$params = ArrayHelper::merge($params, [
'uploads' => $uploads
]);
}
$client->issue->update($id, $params); $client->issue->update($id, $params);
return $this->refresh(); return $this->refresh();
......
...@@ -28,6 +28,8 @@ $parser = new \Netcarver\Textile\Parser(); ...@@ -28,6 +28,8 @@ $parser = new \Netcarver\Textile\Parser();
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<?php print_r($model['journals']); ?>
<div class="panel-body panel-body-ex-1 panel-body-ex-3 notifications_box color_on_cursor" <?=($model['priority']['id']==Issue::PRIORITY_SIMPLE?'style="border:0;"':'')?>> <div class="panel-body panel-body-ex-1 panel-body-ex-3 notifications_box color_on_cursor" <?=($model['priority']['id']==Issue::PRIORITY_SIMPLE?'style="border:0;"':'')?>>
<div> <div>
...@@ -96,29 +98,15 @@ $parser = new \Netcarver\Textile\Parser(); ...@@ -96,29 +98,15 @@ $parser = new \Netcarver\Textile\Parser();
</div> </div>
</div> </div>
<div id="file-container">
<!-- <div class="file_box_wr">
<span class="glyphicon glyphicon-file"></span>
<a href="">Error_window.jpg &nbsp;</a>
<span class="color_gray">&nbsp;50,6 кБ&nbsp;&nbsp;</span>
<a href=""><span class="glyphicon glyphicon-remove color_gray"></span></a>
</div>
<div class="file_box_wr">
<span class="glyphicon glyphicon-file"></span>
<a href="">Error_window.jpg &nbsp;</a>
<span class="color_gray">&nbsp;50,6 кБ&nbsp;&nbsp;</span>
<a href=""><span class="glyphicon glyphicon-remove color_gray"></span></a>
</div> </div>
<div class="file_box_wr">
<span class="glyphicon glyphicon-file"></span> <input type="file" id="file-attachment-input" style="display:none;" multiple="multiple">
<a href="">Error_window.jpg &nbsp;</a>
<span class="color_gray">&nbsp;50,6 кБ&nbsp;&nbsp;</span>
<a href=""><span class="glyphicon glyphicon-remove color_gray"></span></a>
</div> -->
<?= Html::submitButton('Отправить', ['class' => 'btn btn-success-2 gray_button_poz']) ?> <?= Html::submitButton('Отправить', ['class' => 'btn btn-success-2 gray_button_poz']) ?>
<!-- <button class="gray_button">Прикрепить файл<i class="glyphicon glyphicon-paperclip"></i></button> --> <div class="gray_button attachment-button">Прикрепить файл<i class="glyphicon glyphicon-paperclip"></i></div>
<?php ActiveForm::end(); ?> <?php ActiveForm::end(); ?>
...@@ -136,15 +124,26 @@ $parser = new \Netcarver\Textile\Parser(); ...@@ -136,15 +124,26 @@ $parser = new \Netcarver\Textile\Parser();
<?php foreach ($model['journals'] as $i => $journal) : ?> <?php foreach ($model['journals'] as $i => $journal) : ?>
<div class="commentary_box"> <div class="commentary_box">
<p><strong><?=$journal['user']['name']?></strong> <span class="color_gray"><?=Yii::$app->formatter->asDate($journal['created_on'], 'php:d F Y, H:i');?></span></p> <p><strong><?=$journal['user']['name']?></strong> <span class="color_gray"><?=Yii::$app->formatter->asDate($journal['created_on'], 'php:d F Y, H:i');?></span></p>
<p> <p>
<?=$parser->textileThis($journal['notes']);?> <?=$parser->textileThis($journal['notes']);?>
</p> </p>
<?php if(isset($journal['details'])) : ?>
<?php foreach ($journal['details'] as $detail) : ?>
<?php if($detail['property'] == 'attachment') : ?>
<span class="glyphicon glyphicon-file"></span><?=$detail['new_value']?>&nbsp;&nbsp;
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<br> <br>
<!-- <a href="" class="commentary_box_ok">Ответить</a> &nbsp;&nbsp;&nbsp; <a href="" class="commentary_box_dell">Удалить</a> -->
<?php if($i != count($model['journals']) - 1) : ?> <?php if($i != count($model['journals']) - 1) : ?>
<div class="line_3"></div> <div class="line_3"></div>
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
......
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