Finish version/v.0.0.15

This commit is contained in:
Roland Schneider 2016-01-04 08:59:50 +01:00
commit 4b0d891e46
3 changed files with 13 additions and 2 deletions

View File

@ -99,7 +99,8 @@ class CardController extends \backend\controllers\BackendController
$model = $this->findModel($id); $model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) { if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id_card]); return $this->redirect(['index']);
// return $this->redirect(Yii::$app->request->referrer);
} else { } else {
return $this->render('update', [ return $this->render('update', [
'model' => $model, 'model' => $model,

View File

@ -1,3 +1,6 @@
-0.0.15
- backend on card saving replace ö to 0
- backend on card saving redirect to index
-0.0.14 -0.0.14
- add hidden account - add hidden account
- add cart payout/delete per row - add cart payout/delete per row

View File

@ -43,7 +43,8 @@ class Card extends \common\models\BaseFitnessActiveRecord
[['status', 'type'], 'integer'], [['status', 'type'], 'integer'],
[['number'], 'string', 'max' => 20], [['number'], 'string', 'max' => 20],
[['rfid_key'], 'string', 'max' => 25], [['rfid_key'], 'string', 'max' => 25],
[['number'], 'unique' ] [['number'], 'unique' ],
[['rfid_key','number'] , 'validateAscii']
]; ];
} }
@ -64,6 +65,12 @@ class Card extends \common\models\BaseFitnessActiveRecord
} }
public function validateAscii($attribute,$params){
if ( !$this->hasErrors($this->$attribute)){
$this->$attribute = str_replace("ö", "0", $this->$attribute);
}
}
static function statuses() { static function statuses() {
return [ return [
self::STATUS_ACTIVE => Yii::t('common/card', 'Active'), self::STATUS_ACTIVE => Yii::t('common/card', 'Active'),