Fix customer backend forms , fix site\index

backend create\update customer forms must display the same as the frontend
forms

site\index action should be friendly and related to this app
This commit is contained in:
2015-11-02 18:41:36 +01:00
parent ed1e0b6c2a
commit b6b5193120
10 changed files with 53 additions and 113 deletions

View File

@@ -68,6 +68,16 @@ class CustomerUpdate extends \common\models\Customer
[['email'], 'email' ],
[['email'], 'unique' ],
[['email'], 'required', 'when' => function($model) {
return !isset( $model->email ) || empty($model->phone) ;
} ,
'whenClient' => "function (attribute, value) {
return false;
}",
'message' => Yii::t('customer/backend','E-mail or phone number required!')
],
[['password_plain','password_repeat'], 'string', 'max' => 32],
[['sex'], 'integer'],
@@ -79,6 +89,15 @@ class CustomerUpdate extends \common\models\Customer
[['phone', 'tax_number', 'country'], 'string', 'max' => 20],
[['phone'], 'required', 'when' => function($model) {
return !isset( $model->email ) || empty( $model->email ) ;
} ,
'whenClient' => "function (attribute, value) {
return false;
}",
'message' => Yii::t('customer/backend','E-mail or phone number required!')
],
[['zip'], 'string', 'max' => 8],
[['city'], 'string', 'max' => 30]