diff --git a/backend/views/request/update.php b/backend/views/request/update.php index 9d00c4b..04e2d0e 100755 --- a/backend/views/request/update.php +++ b/backend/views/request/update.php @@ -51,7 +51,18 @@ field($model, 'organization') ->textInput() ?> - field($model, 'email') + field($model, 'user_work_status') + ->dropDownList( + [ + 0 => \Yii::t('app',$model::WORK_STATUS_0), + 1 => \Yii::t('app',$model::WORK_STATUS_1), + 2 => \Yii::t('app',$model::WORK_STATUS_2), + 3 => \Yii::t('app',$model::WORK_STATUS_3), + 4 => \Yii::t('app',$model::WORK_STATUS_4), + + ] + ) ?> + field($model, 'email') ?> field($model, 'post_address') ->textInput() ?> @@ -61,6 +72,10 @@ ->textInput() ?> field($model, 'fax') ->textInput() ?> + field($model, 'nationality') + ->textInput() ?> + field($model, 'country_from') + ->textInput() ?> field($model, 'citizenship') ->textInput() ?> field($model, 'gender') diff --git a/common/mail/request.php b/common/mail/request.php index 1e06525..eb11a86 100755 --- a/common/mail/request.php +++ b/common/mail/request.php @@ -21,6 +21,11 @@ asText($model->organization) ?> + Рабочий статус делегата: : + asText(\Yii::t('app', + $model::WORK_STATUS_.$model->user_work_status)) ?> + + Официальный почтовый адресс : asText($model->post_address) ?> @@ -40,8 +45,18 @@ Факс : asText($model->fax) ?> + + + Национальность : + asText($model->nationality) ?> + + + + Страна : + asText($model->country_from) ?> + - Страна\организация : + Организация : asText($model->citizenship) ?> diff --git a/common/messages/en/app.php b/common/messages/en/app.php index aba1cfb..e483d46 100755 --- a/common/messages/en/app.php +++ b/common/messages/en/app.php @@ -7,7 +7,7 @@ return [ 'Dignity' => 'Title', 'Gender' => 'Gender', 'Birth' => 'Date of birth', - 'Citizenship' => 'Сountry/organization represented', + 'Citizenship' => 'Organization represented', 'Passport' => 'Series and passport number', 'Post address' => 'Official mailing address (for dispatch of documents)', 'Email' => 'E-mail', @@ -248,7 +248,16 @@ Direct link for booking:
'DearMs' => 'Dear ', + 'Nationality' => 'Nationality', + 'Country from' => 'Country', + 'Work status' => 'Delegate status:', + # customer ==> user_work_status + 'International organization' => 'International organization', + 'Official delegation' => 'Official delegation', + 'Non-government organization' => 'Non-government organization' , + 'Expert' => 'Expert', + 'Press' => 'Press', diff --git a/common/messages/fr/app.php b/common/messages/fr/app.php index 23d8046..69d8556 100755 --- a/common/messages/fr/app.php +++ b/common/messages/fr/app.php @@ -8,7 +8,7 @@ return [ 'Dignity' => 'Le titre', 'Gender' => 'Devenir', 'Birth' => 'Date de naissance', - 'Citizenship' => 'Pays / organisation representee', + 'Citizenship' => 'Organisation representee', 'Passport' => 'Série et numéro de passeport', 'Post address' => 'Adresse postale officielle (pour l\'envoi de documents)', 'Email' => 'E-mail', @@ -228,8 +228,16 @@ Affaires', + 'Nationality' => 'Nationalité', + 'Country from' => 'Le pays', + 'Work status' => 'Déléguer le statut', - +# customer ==> user_work_status + 'International organization' => 'Organisation internationale', + 'Official delegation' => 'Délégation officielle', + 'Non-government organization' => 'Organisation non gouvernementale', + 'Expert' => 'Expert', + 'Press' => 'La presse ', diff --git a/common/messages/ru/app.php b/common/messages/ru/app.php index 0947cad..f615f04 100755 --- a/common/messages/ru/app.php +++ b/common/messages/ru/app.php @@ -8,7 +8,7 @@ return [ 'Dignity' => 'Титул', 'Gender' => 'Пол', 'Birth' => 'Дата рождения', - 'Citizenship' => 'Страна\организация', + 'Citizenship' => 'Oрганизация', 'Passport' => 'Серия и номер паспорта', 'Post address' => 'Официальный почтовый адресс (для отправки документов)', 'Email' => 'Е-мейл', @@ -222,4 +222,20 @@ ENERGYU) 'DearMs' => 'Уважаемая', + + 'Nationality' => 'Национальность', + 'Country from' => 'Страна', + 'Work status' => 'Статус делегата:', + + # customer ==> user_work_status + 'International organization' => 'Международная организация', + 'Official delegation' => 'Официальная организация', + 'Non-government organization' => 'Неправительственная организация', + 'Expert' => 'Эксперт', + 'Press' => 'Пресса', + + + + + ]; \ No newline at end of file diff --git a/common/messages/ua/app.php b/common/messages/ua/app.php index 2cb7a76..259a8b3 100755 --- a/common/messages/ua/app.php +++ b/common/messages/ua/app.php @@ -8,7 +8,7 @@ return [ 'Dignity' => 'Титул', 'Gender' => 'Стать', 'Birth' => 'Дата народження', - 'Citizenship' => 'Країна/Організація', + 'Citizenship' => 'Організація', 'Passport' => 'Серія та номер паспорта', 'Post address' => 'Офіційна поштова адреса (для відправки документів)', 'Email' => 'Е-мейл', @@ -256,4 +256,44 @@ ENERGYU) 'studio-link' => 'Створення сайтів', + + 'Nationality' => 'Національність', + 'Country from' => 'Країна', + 'Work status' => 'Статус делегата:', + +# customer ==> user_work_status + 'International organization' => 'Міжнародна організація', + 'Official delegation' => 'Офіційна делегація', + 'Non-government organization' => 'Неурядова організація', + 'Expert' => 'Експерт', + 'Press' => 'Преса', + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]; \ No newline at end of file diff --git a/common/models/Customer.php b/common/models/Customer.php index 530894e..4d792b7 100755 --- a/common/models/Customer.php +++ b/common/models/Customer.php @@ -45,6 +45,15 @@ * @property integer $working_lang * @property string $post_address ==> официальный почтовый адрес * @property integer $created_at + * + * -- from 19.09 + * @property string $nationality + * @property string $country_from + * @property integer $user_work_status + * + * + * + * */ class Customer extends \yii\db\ActiveRecord { @@ -53,18 +62,42 @@ public $acceptance; const ADMIN_SCENARIO = 'admin'; - + + #---------------------------------------------------------------------- + # Текущий статус пользователя + #---------------------------------------------------------------------- const STATUS_NEW = 2; const STATUS_ACTIVE = 1; const STATUS_NO = 0; - + + #---------------------------------------------------------------------- + # Специальная еда + #---------------------------------------------------------------------- const MEAL_1 = 'Халяль'; const MEAL_2 = 'Кашрут'; const MEAL_3 = 'Вегитарианець'; const MEAL_NONE = 'Не выбрано'; - + + + #---------------------------------------------------------------------- + # Пол + #---------------------------------------------------------------------- const MALE = '1'; const FEMALE = '2'; + + + + #---------------------------------------------------------------------- + # Деловые статусы посетителя форума + #---------------------------------------------------------------------- + + const WORK_STATUS_0 = 'International organization'; + const WORK_STATUS_1 = 'Official delegation'; + const WORK_STATUS_2 = 'Non-government organization'; + const WORK_STATUS_3 = 'Expert'; + const WORK_STATUS_4 = 'Press'; + + /** * {@inheritdoc} */ @@ -145,6 +178,8 @@ 'passport_date', 'passport_valid', 'post_address', + 'nationality', + 'country_from', ], 'string', 'max' => 255, @@ -168,6 +203,14 @@ self::FEMALE, ], ], + [ + [ 'user_work_status' ], + 'in', + 'range' => [ + '0', + '4', + ], + ], [ [ 'gender', @@ -187,6 +230,9 @@ 'phone_office', 'phone_other', 'need_visa', + 'nationality', + 'country_from', + 'work_status', ], 'required', ], @@ -266,7 +312,11 @@ 'working_lang' => Yii::t('app', 'Working language'), 'special_meal' => Yii::t('app', 'Special meal'), 'post_address' => Yii::t('app', 'Post address'), - + + 'nationality' => Yii::t('app', 'Nationality'), + 'country_from' => Yii::t('app', 'Country from'), + 'user_work_status' => Yii::t('app', 'Work status'), + ]; } diff --git a/console/migrations/m180919_092511_customer_add_new_fields.php b/console/migrations/m180919_092511_customer_add_new_fields.php new file mode 100644 index 0000000..4f91d94 --- /dev/null +++ b/console/migrations/m180919_092511_customer_add_new_fields.php @@ -0,0 +1,44 @@ +addColumn( + 'customer', + 'nationality', + $this->string()->defaultValue(0) // не указано + ); + + $this->addColumn( + 'customer', + 'country_from', + $this->string() + ); + + $this->addColumn('customer','user_work_status', + $this->tinyInteger() + ); + + $this->addCommentOnColumn('customer', + 'country_from', + 'Страна, откуда приедет юзер'); + + + + } + + public function down() + { + $this->dropColumn('customer','nationality'); + $this->dropColumn('customer','country_from'); + $this->dropColumn('customer','user_work_status'); + + } +} diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 3ea8dd0..7f289a0 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -242,7 +242,7 @@ ->setTo( [ // 'kennen.md@gmail.com', - + 'alkhonko@gmail.com', 'energyforum@euromediacompany.com', ] ) diff --git a/frontend/views/site/signup.php b/frontend/views/site/signup.php index 5b93ded..1069d9a 100755 --- a/frontend/views/site/signup.php +++ b/frontend/views/site/signup.php @@ -39,6 +39,21 @@ $js=$dp->getDatepickerJs();
field($model, 'name')->textInput(['class' => ''])?>
+
+ +
+ + field($model, 'user_work_status')->dropDownList([ + null => \Yii::t('app', 'Choose'), + 0 => \Yii::t('app', Customer::WORK_STATUS_0), + 1 => \Yii::t('app', Customer::WORK_STATUS_1), + 2 => \Yii::t('app', Customer::WORK_STATUS_2), + 3 => \Yii::t('app', Customer::WORK_STATUS_3), + 4 => \Yii::t('app', Customer::WORK_STATUS_4), + ],['class' => '','template' => '{input}{label}',])?> +
+ +
field($model, 'organization')->textInput(['class' => ''])?>
@@ -62,6 +77,12 @@ $js=$dp->getDatepickerJs(); field($model, 'fax')->textInput(['class' => ''])?>
+ field($model, 'nationality')->textInput(['class' => ''])?> +
+
+ field($model, 'country_from')->textInput(['class' => ''])?> +
+
field($model, 'citizenship')->textInput(['class' => ''])?>
-- libgit2 0.21.4