fix comments

parent 271b6012
......@@ -121,6 +121,8 @@ class SupportController extends Controller
public function actionView($id)
{
$this->view->registerJsFile('/js/support.js', ['position' => yii\web\View::POS_END ]);
$client = $this->getClient();
$user = $client->user->getCurrentUser();
......@@ -146,6 +148,24 @@ class SupportController extends Controller
'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);
return $this->refresh();
......
......@@ -29,6 +29,8 @@ $parser = new \Netcarver\Textile\Parser();
<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>
......@@ -96,29 +98,15 @@ $parser = new \Netcarver\Textile\Parser();
</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 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> -->
<input type="file" id="file-attachment-input" style="display:none;" multiple="multiple">
<?= 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(); ?>
......@@ -136,15 +124,26 @@ $parser = new \Netcarver\Textile\Parser();
<?php foreach ($model['journals'] as $i => $journal) : ?>
<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>
<?=$parser->textileThis($journal['notes']);?>
</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>
<!-- <a href="" class="commentary_box_ok">Ответить</a> &nbsp;&nbsp;&nbsp; <a href="" class="commentary_box_dell">Удалить</a> -->
<?php if($i != count($model['journals']) - 1) : ?>
<div class="line_3"></div>
<?php endif; ?>
</div>
<?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