From deee41345d8d1903c0cfa33d4dd7517f9778466e Mon Sep 17 00:00:00 2001 From: Leorne Date: Fri, 6 Dec 2019 15:39:19 +0300 Subject: [PATCH 1/3] spaces and symbolse in files names --- backend/modules/card/models/UserCard.php | 2 ++ backend/modules/notes/models/Note.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/backend/modules/card/models/UserCard.php b/backend/modules/card/models/UserCard.php index 302e32b..9365b92 100755 --- a/backend/modules/card/models/UserCard.php +++ b/backend/modules/card/models/UserCard.php @@ -71,6 +71,8 @@ class UserCard extends \common\models\UserCard if ($post['fields']) { FieldsValueNew::deleteAll(['item_id' => $this->id, 'item_type' => FieldsValueNew::TYPE_PROFILE]); foreach ($post['fields'] as $item) { + $item['value'] = urldecode($item['value']); + $fieldsValue = new FieldsValueNew(); $fieldsValue->field_id = $item['field_id']; $fieldsValue->value = $item['value']; diff --git a/backend/modules/notes/models/Note.php b/backend/modules/notes/models/Note.php index e1d320c..a5522af 100755 --- a/backend/modules/notes/models/Note.php +++ b/backend/modules/notes/models/Note.php @@ -51,6 +51,8 @@ class Note extends \common\models\Note FieldsValueNew::deleteAll(['item_id' => $this->id, 'item_type' => FieldsValueNew::TYPE_NOTE]); foreach ( $post['fields'] as $item) { + $item['value'] = urldecode($item['value']); + $fieldsValue = new FieldsValueNew(); $fieldsValue->field_id = $item['field_id']; $fieldsValue->item_id = $this->id; From 7b7fa6c51de41f5a1f476abd3486c33f7d89618a Mon Sep 17 00:00:00 2001 From: Leorne Date: Fri, 6 Dec 2019 15:40:41 +0300 Subject: [PATCH 2/3] spaces and symbols in files names --- backend/modules/notes/models/Note.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/modules/notes/models/Note.php b/backend/modules/notes/models/Note.php index a5522af..4dc2258 100755 --- a/backend/modules/notes/models/Note.php +++ b/backend/modules/notes/models/Note.php @@ -52,7 +52,7 @@ class Note extends \common\models\Note foreach ( $post['fields'] as $item) { $item['value'] = urldecode($item['value']); - + $fieldsValue = new FieldsValueNew(); $fieldsValue->field_id = $item['field_id']; $fieldsValue->item_id = $this->id; From 86b547699817b08fbcb395f439bc2196ea021ed1 Mon Sep 17 00:00:00 2001 From: Leorne Date: Fri, 6 Dec 2019 15:40:57 +0300 Subject: [PATCH 3/3] default file image --- common/models/FieldsValueNew.php | 9 +++++---- frontend/web/media/file.png | Bin 0 -> 11681 bytes 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 frontend/web/media/file.png diff --git a/common/models/FieldsValueNew.php b/common/models/FieldsValueNew.php index ffaf54a..ca60f82 100644 --- a/common/models/FieldsValueNew.php +++ b/common/models/FieldsValueNew.php @@ -70,8 +70,7 @@ class FieldsValueNew extends \yii\db\ActiveRecord { return $this->hasOne(AdditionalFields::class, ['id' => 'field_id']); } - - + /** * get value for view * @return string @@ -94,7 +93,9 @@ class FieldsValueNew extends \yii\db\ActiveRecord $downloadLinkHTML = ' (' . Html::a('Скачать', $this->value, ['target' => '_blank', 'download' => $filename]) . ')'; $result = $imageHTML . $downloadLinkHTML; } else { - $result = $filename . ' (' . Html::a('Скачать', $this->value, ['target' => '_blank', 'download' => $filename]) . ')'; + $imageHTML = Html::img('/media/file.png', ['width' => '100px', 'alt' => $filename]); + $downloadLinkHTML = ' (' . Html::a('Скачать', $this->value, ['target' => '_blank', 'download' => $filename]) . ')';; + $result = $imageHTML . $filename . $downloadLinkHTML; } return $result; } @@ -137,7 +138,7 @@ class FieldsValueNew extends \yii\db\ActiveRecord } $extension = explode('/', $mime)['0']; - if (($extension === 'image') || $extension === 'application') { + if ($extension === 'image') { return true; } else { return false; diff --git a/frontend/web/media/file.png b/frontend/web/media/file.png new file mode 100644 index 0000000000000000000000000000000000000000..b14b639931c18e35bee09275e54f2caef955c16a GIT binary patch literal 11681 zcmeHti93|t|L{F`w;D@~Z1o7^kx(%rOHw8!WiNZOB|>LdY7! zOrex)*^+&iC1e}S@H@Bf_x-*9!h2nBuFJ(a_c@>aoX>JTcT9|Qw{!i)1wqj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