Commit 6728c0f0745b6c27513f9d4e8341fd65b4d4a165

Authored by Anastasia
2 parents cda2afc4 25dd784d

Merge remote-tracking branch 'origin/master'

backend/controllers/VisitController.php
... ... @@ -59,7 +59,11 @@
59 59 ],
60 60 'created_at' => [
61 61 'type' => Index::DATETIME_COL,
62   - ]
  62 + ],
  63 + 'request_webpage' =>
  64 + [
  65 + 'type' => Index::STRING_COL
  66 + ]
63 67 ],
64 68 'model' => Visit::className(),
65 69 'hasLanguage' => false,
... ... @@ -99,6 +103,10 @@
99 103 'name' => 'created_at',
100 104 'type' => Form::STRING,
101 105 ],
  106 + [
  107 + 'name' => 'request_webpage',
  108 + 'type' => Form::STRING,
  109 + ],
102 110  
103 111 ],
104 112 ],
... ... @@ -183,6 +191,7 @@
183 191 'name' => 'updated_at',
184 192 'type' => Form::STRING,
185 193 ],
  194 +
186 195 ];
187 196 }
188 197  
... ...
backend/web/core/css/custom.css
... ... @@ -5402,4 +5402,40 @@ padding: 0 10px;
5402 5402 }
5403 5403 .has-success .help-block, .has-success .control-label, .has-success .radio, .has-success .checkbox, .has-success .radio-inline, .has-success .checkbox-inline, .has-success.radio label, .has-success.checkbox label, .has-success.radio-inline label, .has-success.checkbox-inline label {
5404 5404 color: #428442;
5405   -}
5406 5405 \ No newline at end of file
  5406 +}
  5407 +
  5408 +/********file input settings***********/
  5409 +
  5410 + .file-caption .file-caption-name {
  5411 + border: 0 !important;
  5412 + box-shadow: none !important;
  5413 + margin-top: -8px;
  5414 +
  5415 +}
  5416 +
  5417 +.file-caption-main .btn-file {
  5418 + margin-right: 0;
  5419 +}
  5420 +
  5421 +.file-caption-main .file-caption {
  5422 + height: 36px;
  5423 +}
  5424 +.file-caption-main {
  5425 + margin-top: 10px;
  5426 +}
  5427 +.file-caption-main .btn-file input[type=file] {
  5428 + margin-top: 0;
  5429 + cursor: pointer;
  5430 +}
  5431 +.file-caption-main .fileinput-remove-button {
  5432 + font-size: 0;
  5433 + margin: 0 15px !important;
  5434 +}
  5435 +.file-caption-main .btn-file, .file-caption-main .btn-file span, .file-caption-main .btn-file, .file-caption-main .btn-file input {cursor: pointer}
  5436 +#module-imagemanager a.delete-image-item {
  5437 + margin-top: 5px;
  5438 + font-size: 0;
  5439 + margin-bottom: 10px;
  5440 +}
  5441 +
  5442 +/********end file input settings***********/
... ...
common/messages/ru/app.php
... ... @@ -62,6 +62,7 @@ return [
62 62 'Send question' =>'ะžั‚ะฟั€ะฐะฒะธั‚ัŒ ะฒะพะฟั€ะพั',
63 63 'Department' =>'ะพั‚ะดะตะปะตะฝะธะต',
64 64 'General issues' =>'ะžะฑั‰ะธะต ะฒะพะฟั€ะพัั‹',
  65 + 'General callbacks' => 'ะžะฑั‰ะธะต ะพั‚ะทั‹ะฒั‹',
65 66 'Give feedback' =>'ะžัั‚ะฐะฒะธั‚ัŒ ะพั‚ะทั‹ะฒ',
66 67 'Callbacks' =>'ะžั‚ะทั‹ะฒั‹',
67 68 'Callback' =>'ะžะฑั€ะฐั‚ะฝะฐั ัะฒัะทัŒ',
... ... @@ -102,12 +103,12 @@ return [
102 103 'Price list description' =>'ะฆะตะฝั‹ ะฝะฐ ัƒัะปัƒะณะธ ะผะตะดะธั†ะธะฝัะบะพะน ะบะปะธะฝะธะบะธ ABClinik',
103 104  
104 105  
105   -
106   -
107   -
  106 + 'Request_webpage' => 'ะกั‚ั€ะฐะฝะธั†ะฐ ะฟะตั€ะตั…ะพะดะฐ',
108 107 'FIO' =>'ะคะ˜ะž',
109 108 'Email' =>'Email',
110 109 'Office address' =>'ะฃะบั€ะฐะธะฝะฐ, ะšะธะตะฒ, ัƒะป. ะšัƒะดั€ัะฒัะบะฐั, 31/33',
111 110 'Go to Homepage' =>'ะะฐ ะณะปะฐะฒะฝัƒัŽ',
112 111 'ABC short' =>'ABClinic โ€” ะผะตะดะธั†ะธะฝัะบะธะน ั†ะตะฝั‚ั€',
  112 + 'ABC short reverse' => 'ะผะตะดะธั†ะธะฝัะบะธะน ั†ะตะฝั‚ั€ ABClinic ',
  113 +
113 114 ];
114 115 \ No newline at end of file
... ...
common/models/Visit.php
... ... @@ -79,7 +79,8 @@
79 79 'name',
80 80 'phone',
81 81 'entity',
82   - 'email'
  82 + 'email',
  83 + 'request_webpage'
83 84 ],
84 85 'string',
85 86 'max' => 255,
... ... @@ -100,6 +101,7 @@
100 101 'entity' => Yii::t('app', 'Entity'),
101 102 'entity_id' => Yii::t('app', 'Entity ID'),
102 103 'email' => Yii::t('app', 'Email'),
  104 + 'request_webpage' => Yii::t('app', 'Request_webpage'),
103 105 ];
104 106 }
105 107  
... ...
console/migrations/m180623_131646_add_request_webpage_column_to_visit_table.php 0 โ†’ 100644
  1 +<?php
  2 +
  3 +use yii\db\Migration;
  4 +
  5 +/**
  6 + * Handles adding request_webpage to table `visit`.
  7 + */
  8 +class m180623_131646_add_request_webpage_column_to_visit_table extends Migration
  9 +{
  10 + /**
  11 + * {@inheritdoc}
  12 + */
  13 + public function safeUp()
  14 + {
  15 + $this->addColumn('visit', 'request_webpage', $this->string(255));
  16 + }
  17 +
  18 + /**
  19 + * {@inheritdoc}
  20 + */
  21 + public function safeDown()
  22 + {
  23 + $this->dropColumn('visit', 'request_webpage');
  24 + }
  25 +}
... ...
frontend/config/main.php
1 1 <?php
2 2 use common\models\SlashRedirect;
3 3 use frontend\components\UrlManager;
  4 +use yii\helpers\Url;
4 5  
5 6 $params = array_merge(
6 7 require( __DIR__ . '/../../common/config/params.php' ),
... ... @@ -28,6 +29,7 @@
28 29 'name',
29 30 'phone',
30 31 'message',
  32 +
31 33 ],
32 34 'rules' => [
33 35 [
... ... @@ -138,7 +140,8 @@
138 140 'email',
139 141 'comment',
140 142 'entity_id',
141   - 'entity'
  143 + 'entity',
  144 +
142 145 ],
143 146 'rules' => [
144 147 [
... ... @@ -154,7 +157,9 @@
154 157 'email' => 'Email',
155 158 'comment' => 'ะ’ะฐัˆ ะพั‚ะทั‹ะฒ',
156 159 'entity_id' => false,
157   - 'entity' => false
  160 + 'entity' => false,
  161 +
  162 +
158 163 ],
159 164  
160 165 'inputOptions' => [
... ... @@ -251,7 +256,8 @@
251 256 'message',
252 257  
253 258 'entity',
254   - 'entity_id'
  259 + 'entity_id',
  260 + 'request_webpage',
255 261 ],
256 262 'rules' => [
257 263 [
... ... @@ -267,7 +273,8 @@
267 273 'phone' => \Yii::t('app','Phone'),
268 274 'message' => \Yii::t('app','Message'),
269 275 'entity_id' => false,
270   - 'entity' => false
  276 + 'entity' => false,
  277 + 'request_webpage' => false
271 278 ],
272 279  
273 280 'inputOptions' => [
... ... @@ -277,6 +284,16 @@
277 284 'entity_id' => [
278 285 'type' => 'hiddenInput'
279 286 ],
  287 + 'request_webpage' => [
  288 + 'type' => 'hiddenInput',
  289 + 'options' =>
  290 + [
  291 + #'value' => \Yii::$app->homeUrl,
  292 + # 'value' => 'test 123',
  293 + 'value' => $_SERVER['REQUEST_URI'],
  294 + ],
  295 +
  296 + ],
280 297 'name' => [
281 298 'template' => '<div class="input-wr">{input}</div>'
282 299 ],
... ...
frontend/views/layouts/main.php
... ... @@ -33,10 +33,7 @@
33 33 use frontend\assets\MapAsset;
34 34  
35 35  
36   -
37   -
38   -
39   - AppAsset::register($this);
  36 +AppAsset::register($this);
40 37 SliderAsset::register($this);
41 38 MapAsset::register($this);
42 39 $user = \Yii::$app->user->identity;
... ... @@ -71,6 +68,22 @@
71 68 ->all();
72 69  
73 70  
  71 +# ะดะปั ะฐะฒั‚ะพะผะฐั‚ะธั‡ะตัะบะพะน ะณะตะฝะตั€ะฐั†ะธะธ SEO ะฟะฐั€ะฐะผะตั‚ั€ะพะฒ (title/description) ะฒ ัะธั‚ัƒะฐั†ะธัั…, ะบะพะณะดะฐ ัั‚ะธั… ะฟะฐั€ะฐะผะตั‚ั€ะพะฒ ะฝะตั‚ัƒ
  72 +# ะผะฝะต ะฝัƒะถะฝะพ ะฑัƒะดะตั‚ ะฐะฒั‚ะพะผะฐั‚ะธั‡ะตัะบะธ ะธั… ะฟะพะดะณะตะฝะตั€ะธะฒะฐั‚ัŒ, ะฟะพัั‚ะพะผัƒ ะฒะผะตัั‚ะพ $seo->title, ะบะพั‚ะพั€ั‹ะต ัะฒะปัะตั‚ัั readOnly ั ะธัะฟะพะปัŒะทัƒัŽ ัั‚ัƒ ะฟะตั€ะตะผะตะฝะฝัƒัŽ
  73 +$seoTitleName = $seo->title;
  74 +if ($seo->title == ''
  75 + && \Yii::$app->controller->id == 'site'
  76 + && \Yii::$app->controller->action->id == 'comments'
  77 +) {
  78 + $currentServiceId = (!empty(\Yii::$app->request->get('service_id'))) ? \Yii::$app->request->get('service_id') : 0;
  79 + $serviceModel = new Service(['id' => $currentServiceId]);
  80 + if ($currentServiceId !== 0) {
  81 + $serviceName = $serviceModel->language->title;
  82 + $seoTitleName = $this->params['breadcrumbs'][0] . ' - ' . $serviceName . ' - ' . \Yii::t('app', 'ABC short reverse');
  83 + } else $seoTitleName = $this->params['breadcrumbs'][0] . ' - ' . \Yii::t('app', 'General callbacks') . ' - ' . \Yii::t('app', 'ABC short reverse');
  84 +
  85 +}
  86 +
74 87  
75 88 //-----------------------------------------------------------------------------------------------------------------------
76 89 // ะ‘ะปะพะบ ั ะผะธะบั€ะพั€ะฐะทะผะตั‚ะบะพะน ะดะปั FB
... ... @@ -116,11 +129,10 @@ $this-&gt;registerMetaTag(
116 129 'content' =>$seo->title,
117 130 ]
118 131 );
119   -
120 132 $this->registerMetaTag(
121 133 [
122 134 'name' => 'description',
123   - 'content' => $seo->desc,
  135 + 'content' => (\Yii::$app->controller->id == 'site' && \Yii::$app->controller->action->id == 'comments' && $seo->desc == null) ? $seoTitleName : $seo->desc,
124 136 ]
125 137 );
126 138  
... ... @@ -136,6 +148,10 @@ $this-&gt;registerMetaTag(
136 148 );
137 149 $module = \Yii::$app->getModule('feedback');
138 150 $aliases = Alias::find()->where(['route' => '{"0":"site/questions"}'])->indexBy('route')->andWhere(['language_id' => Language::getCurrent()->id])->asArray()->all();
  151 +$commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id":0}'])->indexBy('route')->andWhere(['language_id' => Language::getCurrent()->id])->asArray()->all();
  152 +
  153 +
  154 +
139 155  
140 156 ?>
141 157  
... ... @@ -178,7 +194,11 @@ $this-&gt;registerMetaTag(
178 194 <meta name="viewport" content="width=device-width">
179 195 <link type="image/x-icon" href="favicon.ico" rel="icon">
180 196 <?= Html::csrfMetaTags() ?>
181   - <title><?=Html::encode($seo->title)?></title>
  197 +
  198 +
  199 +
  200 +
  201 + <title><?= Html::encode($seoTitleName); ?></title>
182 202 <?php $this->head() ?>
183 203 </head>
184 204 <body id="body">
... ... @@ -275,11 +295,15 @@ $this-&gt;registerMetaTag(
275 295 <div class="hidden-xs btn-header-wr">
276 296 <span class="btn_ modal-link" data-form="write-to"><?=\Yii::t('app', 'Make an appointment') ?></span>
277 297 </div>
278   -
  298 +
279 299 <ul class="hidden-xs hidden-sm">
280 300 <li><a href="/vtoroe-mnenie" class="new"><span> <?=\Yii::t('app','Second thing')?> </span></a></li>
281   - <li><a href="<?=(isset($aliases['{"0":"site/questions"}'])) ? Url::to(['alias' => $aliases['{"0":"site/questions"}']]) : Url::to(['site/questions'])?>"><?=\Yii::t('app','Quest/Answer')?></a></li>
282   - <li><a href="<?=Url::to(['site/comments'])?>"><?=\Yii::t('app','Callbacks')?></a></li>
  301 + <li>
  302 + <a href="<?= (isset($aliases['{"0":"site/questions"}'])) ? Url::to(['alias' => $aliases['{"0":"site/questions"}']]) :
  303 + Url::to(['site/questions']) ?>"><?= \Yii::t('app', 'Quest/Answer') ?></a></li>
  304 + <li>
  305 + <a href="<?= (isset($commentUrl)) ? Url::to(['/' . $commentUrl['{"0":"site/comments","service_id":0}']['value']]) :
  306 + Url::to(['site/comments']) ?>"><?= \Yii::t('app', 'Callbacks') ?></a></li>
283 307 </ul>
284 308 <!-- -->
285 309 <!-- <div class="lang-sep-wr hidden-xs hidden-sm">-->
... ...
frontend/views/service/view.php
... ... @@ -15,6 +15,7 @@
15 15 use yii\web\View;
16 16  
17 17 $seo = \Yii::$app->get('seo');
  18 +# die(var_dump($seo));
18 19 $this->params['entity'] = Service::className();
19 20 $this->params['entity_id'] = $model->id;
20 21  
... ... @@ -142,10 +143,11 @@ JS;
142 143 <a class="packages-page-link" href="<?=Url::to(['alias' => $package->language->alias])?>">
143 144 <div class="img-packages-page">
144 145 <!--555x344-->
145   - <?=ImageHelper::set(($package->image) ? $package->image->getPath() : null)
  146 + <?=
  147 + ImageHelper::set(($package->image) ? $package->image->getPath() : null)
146 148 ->cropResize(262, 185)
147 149 ->quality(84)
148   - ->renderImage()?>
  150 + ->renderImage(); ?>
149 151 </div>
150 152 <div class="table-packages-wr">
151 153 <table cellspacing="0" cellpadding="0" border="0">
... ...
frontend/views/site/comments.php
... ... @@ -26,7 +26,10 @@
26 26 <div class="container">
27 27 <div class="row">
28 28 <div class="col-xs-12 col-sm-12">
29   - <h1 class="title-pages"><?=\Yii::t('app','Callbacks')?></h1>
  29 + <h1 class="title-pages">
  30 + <?= ($service_id == 0) ? $data[''] . ' - ' . \Yii::t('app', 'Callbacks') :
  31 + $data[$service_id] . ' - ' . \Yii::t('app', 'Callbacks')
  32 + ?></h1>
30 33 </div>
31 34 </div>
32 35 <div class="row">
... ...