# Conflicts:
#	backend/config/main.php
This commit is contained in:
2015-12-11 23:27:16 +01:00
14 changed files with 148 additions and 35 deletions

View File

@@ -0,0 +1,14 @@
<?php
return [
'Keys' => 'Kulcsok',
'Key' => 'Kulcs',
'Create Key' => 'Új kulcs',
'Search' => 'Keresés',
'Reset' => 'Mégsem',
'Update {modelClass}: ' => 'Szerkesztés {modelClass}: ',
'Update' => 'Szerkesztés',
'Update Save' => 'Mentés',
'Create Save' => 'Mentés',
];
?>

View File

@@ -37,4 +37,5 @@ return [
'Update' => 'Módosítás',
'Update {modelClass}: ' => '{modelClass} módosítása:',
'Updated At' => 'Módosítás ideje',
'OLD' => 'Régi Rendszer'
];

View File

@@ -0,0 +1,11 @@
<?php
return [
'Active' => 'Aktív',
'Inactive' => 'Inaktív',
'Number' => 'Név, szám',
'Status' => 'Státusz',
'Search' => 'Keresés',
'Type' => 'Típus',
'Created At' => 'Létrehozva',
];
?>

View File

@@ -23,6 +23,7 @@ class Card extends \common\models\BaseFitnessActiveRecord
const TYPE_RFID = 10;
const TYPE_QRCODE = 20;
const TYPE_BARCODE = 30;
const TYPE_OLD = 40;
/**
* @inheritdoc
@@ -82,6 +83,7 @@ class Card extends \common\models\BaseFitnessActiveRecord
self::TYPE_RFID => Yii::t('common/card', 'RFID'),
self::TYPE_QRCODE => Yii::t('common/card', 'QRCODE'),
self::TYPE_BARCODE => Yii::t('common/card', 'BARCODE'),
self::TYPE_OLD => Yii::t('common/card', 'OLD'),
];
}

View File

@@ -3,6 +3,7 @@
namespace common\models;
use Yii;
use yii\behaviors\TimestampBehavior;
/**
* This is the model class for table "key".
@@ -16,6 +17,10 @@ use Yii;
*/
class Key extends \yii\db\ActiveRecord
{
const STATUS_DELETED = 0;
const STATUS_ACTIVE = 10;
const TYPE_NORMAL = 10;
const TYPE_DEFAULT = self::TYPE_NORMAL;
/**
* @inheritdoc
*/
@@ -30,15 +35,26 @@ class Key extends \yii\db\ActiveRecord
public function rules()
{
return [
[['status', 'type'], 'integer'],
[['created_at', 'updated_at'], 'required'],
[['created_at', 'updated_at'], 'safe'],
[['number'], 'string', 'max' => 255]
[['status', 'type'], 'integer'], //csak szám
//[['created_at', 'updated_at'], 'required'],//kötelezőek
//[['created_at', 'updated_at'], 'safe'], //bármi lehet
[['number'], 'string', 'max' => 255],
[['number' ], 'unique'],
];
}
public function behaviors()
{
return [
[ 'class' => TimestampBehavior::className(), //mentés előtt kitölti a save methódus meghívása előtt kitölti a created... mezőket
'value' => function(){ return date('Y-m-d H:i:s' ); }
]
];
}
/**
* @inheritdoc
* @inheritdoc Minden modelnak van egy Attribut labels függvénye ami modelhez tartalmazza a fordítások
*/
public function attributeLabels()
{
@@ -51,4 +67,18 @@ class Key extends \yii\db\ActiveRecord
'updated_at' => Yii::t('common/key', 'Updated At'),
];
}
static function statuses() {
return [
self::STATUS_ACTIVE => Yii::t('common/key', 'Active'), // t - translate a key a kategoria common/messages/hu/common/key.php mappa (létre kell hozni a fájlt)
self::STATUS_DELETED => Yii::t('common/key', 'Inactive'),
];
}
public static function types(){
return [
self::TYPE_NORMAL => Yii::t('common/key', 'Key'),
];
}
}