Commit c20d5820761b45e113e6373c5d0ca28d0f0cd418

Authored by Yarik
1 parent d1721449

test

common/models/Job.php
@@ -40,7 +40,9 @@ @@ -40,7 +40,9 @@
40 40
41 public function beforeSave($insert) 41 public function beforeSave($insert)
42 { 42 {
43 - $this->date_start = \Yii::$app->formatter->asDatetime($this->date_start, 'Y-MM-d HH:mm:ss'); 43 + if($this->date_start) {
  44 + $this->date_start = \Yii::$app->formatter->asDatetime($this->date_start, 'Y-MM-d HH:mm:ss');
  45 + }
44 46
45 if($this->date_end) { 47 if($this->date_end) {
46 $this->date_end = \Yii::$app->formatter->asDatetime($this->date_end, 'Y-MM-d HH:mm:ss'); 48 $this->date_end = \Yii::$app->formatter->asDatetime($this->date_end, 'Y-MM-d HH:mm:ss');
@@ -173,16 +175,6 @@ @@ -173,16 +175,6 @@
173 return false; 175 return false;
174 } 176 }
175 return $result; 177 return $result;
176 -// if($this->date_end && $this->date_start) {  
177 -// $date = new \DateTime(date('Y-m-d H:i:s', $this->date_start));  
178 -// return \Yii::$app->formatter->asRelativeTime($date->diff(new \DateTime(date('Y-m-d H:i:s', $this->date_end))));  
179 -// } elseif($this->date_start) {  
180 -// $now = new \DateTime();  
181 -// $date = new \DateTime(date('Y-m-d H:i:s', strtotime($this->date_start)));  
182 -// return \Yii::$app->formatter->asRelativeTime($date->diff(new \DateTime()));  
183 -// } else {  
184 -// return 'неизвестна дата начала';  
185 -// }  
186 } 178 }
187 179
188 180
frontend/controllers/CompanyController.php
@@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
35 35
36 public function afterAction($action, $result) 36 public function afterAction($action, $result)
37 { 37 {
  38 + $result = parent::afterAction($action, $result);
38 if(!empty( $action->controller->actionParams[ 'company_id' ] )) { 39 if(!empty( $action->controller->actionParams[ 'company_id' ] )) {
39 $company_id = $action->controller->actionParams[ 'company_id' ]; 40 $company_id = $action->controller->actionParams[ 'company_id' ];
40 $user = User::findOne($company_id); 41 $user = User::findOne($company_id);
@@ -52,10 +53,12 @@ @@ -52,10 +53,12 @@
52 } 53 }
53 } 54 }
54 } 55 }
55 - $user->userInfo->updateCounters([ 'view_count' => 1 ]); 56 + if($user->id != \Yii::$app->user->id) {
  57 + $user->userInfo->updateCounters([ 'view_count' => 1 ]);
  58 + }
56 } 59 }
57 } 60 }
58 - return parent::afterAction($action, $result); 61 + return $result;
59 } 62 }
60 63
61 /** 64 /**
frontend/controllers/PerformerController.php
@@ -269,7 +269,7 @@ @@ -269,7 +269,7 @@
269 $blog = new ActiveDataProvider([ 269 $blog = new ActiveDataProvider([
270 'query' => $user->getBlog(), 270 'query' => $user->getBlog(),
271 'pagination' => new Pagination([ 271 'pagination' => new Pagination([
272 - 'pageSize' => 1, 272 + 'pageSize' => 5,
273 ]), 273 ]),
274 'sort' => new Sort([ 274 'sort' => new Sort([
275 'defaultOrder' => [ 275 'defaultOrder' => [
frontend/controllers/TenderController.php
@@ -6,26 +6,10 @@ @@ -6,26 +6,10 @@
6 use common\models\Project; 6 use common\models\Project;
7 use common\modules\comment\models\CommentProject; 7 use common\modules\comment\models\CommentProject;
8 use Yii; 8 use Yii;
9 - use common\models\LoginForm;  
10 - use frontend\models\PasswordResetRequestForm;  
11 - use frontend\models\ResetPasswordForm;  
12 - use frontend\models\SignupForm;  
13 - use frontend\models\ContactForm;  
14 - use frontend\models\Options;  
15 - use frontend\models\OptionValues;  
16 - use yii\base\InvalidParamException;  
17 use yii\helpers\Html; 9 use yii\helpers\Html;
18 - use yii\web\BadRequestHttpException;  
19 use yii\web\Controller; 10 use yii\web\Controller;
20 - use yii\filters\VerbFilter;  
21 use yii\filters\AccessControl; 11 use yii\filters\AccessControl;
22 - use frontend\models\OptionsToValues;  
23 - use yii\validators\EmailValidator;  
24 use common\models\User; 12 use common\models\User;
25 - use yii\helpers\VarDumper;  
26 - use common\models\Page;  
27 - use frontend\models\Option;  
28 - use common\models\Social;  
29 use yii\web\NotFoundHttpException; 13 use yii\web\NotFoundHttpException;
30 14
31 /** 15 /**
frontend/views/accounts/_job_form.php
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 * @var integer $index 3 * @var integer $index
4 */ 4 */
5 use common\models\Job; 5 use common\models\Job;
  6 + use mihaildev\ckeditor\CKEditor;
6 use yii\helpers\Html; 7 use yii\helpers\Html;
7 use yii\jui\DatePicker; 8 use yii\jui\DatePicker;
8 use yii\widgets\ActiveForm; 9 use yii\widgets\ActiveForm;
@@ -72,6 +73,14 @@ @@ -72,6 +73,14 @@
72 </div> 73 </div>
73 </div> 74 </div>
74 75
  76 + <div class="input-blocks-wrapper">
  77 + <div class="input-blocks">
  78 + <?= $form->field($model, '[' . $index . ']achievement')
  79 + ->label('Достижения')
  80 + ->widget(CKEditor::className(), [ 'editorOptions' => [ 'preset' => 'basic' ] ]); ?>
  81 + </div>
  82 + </div>
  83 +
75 <div class="input-blocks-wrapper admin-quantity-project"> 84 <div class="input-blocks-wrapper admin-quantity-project">
76 <div class="input-blocks"> 85 <div class="input-blocks">
77 <?= $form->field($model, '[' . $index . ']total_count') 86 <?= $form->field($model, '[' . $index . ']total_count')
frontend/views/accounts/general.php
@@ -274,6 +274,7 @@ @@ -274,6 +274,7 @@
274 'height' => 380, 274 'height' => 380,
275 ], 275 ],
276 ], 276 ],
  277 + 'remover' => true,
277 'multi' => false, 278 'multi' => false,
278 'gallery' => $user_info->poster, 279 'gallery' => $user_info->poster,
279 'name' => 'Выбрать файл', 280 'name' => 'Выбрать файл',
frontend/views/layouts/performer.php
@@ -80,7 +80,7 @@ @@ -80,7 +80,7 @@
80 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, 80 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
81 ], 81 ],
82 'visible' => ( empty( $this->params[ 'type' ] ) || $this->params[ 'type' ] == 'implementer' ) ? true : false, 82 'visible' => ( empty( $this->params[ 'type' ] ) || $this->params[ 'type' ] == 'implementer' ) ? true : false,
83 - 'active' => preg_match('/^portfolio.*$/', $this->context->action->id) ? true : false, 83 + 'active' => preg_match('/^portfolio.*$/', $this->context->action->id) ? true : false,
84 ], 84 ],
85 [ 85 [
86 'label' => 'Заказанные работы', 86 'label' => 'Заказанные работы',
@@ -90,15 +90,16 @@ @@ -90,15 +90,16 @@
90 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, 90 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
91 ], 91 ],
92 'visible' => ( !empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer' ) ? true : false, 92 'visible' => ( !empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer' ) ? true : false,
93 - 'active' => preg_match('/^projects.*$/', $this->context->action->id) ? true : false, 93 + 'active' => preg_match('/^projects.*$/', $this->context->action->id) ? true : false,
94 ], 94 ],
95 [ 95 [
96 - 'label' => 'Блог',  
97 - 'url' => [ 96 + 'label' => 'Блог',
  97 + 'url' => [
98 'performer/blog-list', 98 'performer/blog-list',
99 'performer_id' => $this->params[ 'user' ]->id, 99 'performer_id' => $this->params[ 'user' ]->id,
100 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, 100 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
101 ], 101 ],
  102 + 'visible' => ( empty( $this->params[ 'type' ] ) || $this->params[ 'type' ] == 'implementer' ) ? true : false,
102 'active' => preg_match('/^blog.*$/', $this->context->action->id) ? true : false, 103 'active' => preg_match('/^blog.*$/', $this->context->action->id) ? true : false,
103 ], 104 ],
104 [ 105 [
@@ -116,6 +117,7 @@ @@ -116,6 +117,7 @@
116 'performer_id' => $this->params[ 'user' ]->id, 117 'performer_id' => $this->params[ 'user' ]->id,
117 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, 118 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
118 ], 119 ],
  120 + 'visible' => ( empty( $this->params[ 'type' ] ) || $this->params[ 'type' ] == 'implementer' ) ? true : false,
119 ], 121 ],
120 [ 122 [
121 'label' => 'Галерея', 123 'label' => 'Галерея',
@@ -124,6 +126,7 @@ @@ -124,6 +126,7 @@
124 'performer_id' => $this->params[ 'user' ]->id, 126 'performer_id' => $this->params[ 'user' ]->id,
125 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, 127 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
126 ], 128 ],
  129 + 'visible' => ( empty( $this->params[ 'type' ] ) || $this->params[ 'type' ] == 'implementer' ) ? true : false,
127 ], 130 ],
128 ], 131 ],
129 ]); 132 ]);
@@ -143,7 +146,7 @@ @@ -143,7 +146,7 @@
143 <li class="activejob"> 146 <li class="activejob">
144 <?php 147 <?php
145 if($this->params[ 'user' ]->userInfo->is_freelancer xor $this->params[ 'user' ]->userInfo->is_customer) { 148 if($this->params[ 'user' ]->userInfo->is_freelancer xor $this->params[ 'user' ]->userInfo->is_customer) {
146 - if(!empty($this->params[ 'type' ]) && $this->params[ 'type' ] == 'customer') { 149 + if(!empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer') {
147 echo Html::tag('span', 'Заказчик', [ 'class' => 'activejob_span' ]); 150 echo Html::tag('span', 'Заказчик', [ 'class' => 'activejob_span' ]);
148 } else { 151 } else {
149 echo Html::tag('span', 'Исполнитель', [ 'class' => 'activejob_span' ]); 152 echo Html::tag('span', 'Исполнитель', [ 'class' => 'activejob_span' ]);
@@ -248,19 +251,21 @@ @@ -248,19 +251,21 @@
248 ?> 251 ?>
249 </div> 252 </div>
250 </li> 253 </li>
251 - <li>  
252 - <img src="/images/sidebar-ico/ico-10.png" alt=""/>  
253 - <div class="sidebarvievstxt">  
254 - <span class="sidebar-views-txt">Трудовой стаж:<br/></span>  
255 - <?php  
256 - if(!empty( $this->params[ 'user' ]->userInfo->experience )) {  
257 - echo 'С ' . $this->params[ 'user' ]->userInfo->experience . ' года';  
258 - } else {  
259 - echo 'Не указано';  
260 - } 254 + <?php
  255 + if(!empty( $this->params[ 'user' ]->userInfo->experience )) {
261 ?> 256 ?>
262 - </div>  
263 - </li> 257 + <li>
  258 + <img src="/images/sidebar-ico/ico-10.png" alt=""/>
  259 + <div class="sidebarvievstxt">
  260 + <span class="sidebar-views-txt">Трудовой стаж:<br/></span>
  261 + <?php
  262 + echo 'С ' . $this->params[ 'user' ]->userInfo->experience . ' года';
  263 + ?>
  264 + </div>
  265 + </li>
  266 + <?php
  267 + }
  268 + ?>
264 <?php 269 <?php
265 // Predefined in DB variable rank will be used further 270 // Predefined in DB variable rank will be used further
266 if(!empty( $this->params[ 'user' ]->userInfo->member )) { 271 if(!empty( $this->params[ 'user' ]->userInfo->member )) {
frontend/views/patrial/show_site.php
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <div class="style"> 3 <div class="style">
4 <div class="profile-site"> 4 <div class="profile-site">
5 <img src="/images/ico-site.png" alt=""/> 5 <img src="/images/ico-site.png" alt=""/>
6 - <a href="http://<?= $site['site']?>" target="_blank"><?= $site['site']?></a> 6 + <a href="<?= $site['site']?>" target="_blank"><?= $site['site']?></a>
7 </div> 7 </div>
8 </div> 8 </div>
9 <?php endif; ?> 9 <?php endif; ?>
frontend/views/performer/common.php
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
2 2
3 use common\models\User; 3 use common\models\User;
4 use kartik\rating\StarRating; 4 use kartik\rating\StarRating;
5 - use yii\helpers\ArrayHelper;  
6 use \yii\helpers\Html; 5 use \yii\helpers\Html;
7 6
8 /* @var yii\web\View $this 7 /* @var yii\web\View $this
frontend/views/performer/workplace.php
@@ -30,6 +30,10 @@ @@ -30,6 +30,10 @@
30 ?> 30 ?>
31 </div> 31 </div>
32 <div class="workplace-experience-post-vacancy"><?= $job->position ?></div> 32 <div class="workplace-experience-post-vacancy"><?= $job->position ?></div>
  33 + <div class="workplace-experience-post-vacancy">
  34 + <span>Достижения:</span>
  35 + <p><?=$job->achievement?></p>
  36 + </div>
33 </div> 37 </div>
34 <?php endforeach; ?> 38 <?php endforeach; ?>
35 </div> 39 </div>
frontend/web/css/style.css
@@ -8842,10 +8842,14 @@ ul.menu-admin li.logout-li, ul.menu-admin li.logout-li a, ul.menu-admin li:last- @@ -8842,10 +8842,14 @@ ul.menu-admin li.logout-li, ul.menu-admin li.logout-li a, ul.menu-admin li:last-
8842 text-align: center; 8842 text-align: center;
8843 } 8843 }
8844 8844
8845 -.admin-avatar-pattern .remover_image { 8845 +.admin-avatar-pattern .remover_image#image_remove_img {
8846 left: 180px !important; 8846 left: 180px !important;
8847 } 8847 }
8848 8848
  8849 +.admin-avatar-pattern .remover_image#poster_remove_img {
  8850 + left: 700px !important;
  8851 +}
  8852 +
8849 .admin-pattern .file-help-1 { 8853 .admin-pattern .file-help-1 {
8850 display: none 8854 display: none
8851 } 8855 }