implement mobile devices in reception
This commit is contained in:
@@ -13,6 +13,7 @@ use yii\helpers\ArrayHelper;
|
||||
* @property integer $id_card
|
||||
* @property string $status
|
||||
* @property string $device_identifier
|
||||
* @property string $device_name
|
||||
* @property string $activated_at
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
@@ -22,7 +23,8 @@ class MobileDevice extends \yii\db\ActiveRecord
|
||||
|
||||
const STATUS_ACTIVE = 'active';
|
||||
const STATUS_INACTIVE = 'inactive';
|
||||
const STATUS_DELETED = 'deleted';
|
||||
const STATUS_DELETED_MANUAL = 'deleted_manual';
|
||||
const STATUS_DELETED_SYSTEM = 'deleted_system';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
@@ -38,11 +40,11 @@ class MobileDevice extends \yii\db\ActiveRecord
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id_card'], 'integer'],
|
||||
[['activated_at', 'created_at', 'updated_at'], 'safe'],
|
||||
[['created_at', 'updated_at'], 'required'],
|
||||
[['status'], 'string', 'max' => 20],
|
||||
[['device_identifier'], 'string', 'max' => 255]
|
||||
// [['id_card'], 'integer'],
|
||||
// [['activated_at', 'created_at', 'updated_at'], 'safe'],
|
||||
// [['created_at', 'updated_at'], 'required'],
|
||||
// [['status'], 'string', 'max' => 20],
|
||||
// [['device_identifier'], 'string', 'max' => 255]
|
||||
];
|
||||
}
|
||||
|
||||
@@ -56,6 +58,7 @@ class MobileDevice extends \yii\db\ActiveRecord
|
||||
'id_card' => Yii::t('common/mobiledevice', 'Id Card'),
|
||||
'status' => Yii::t('common/mobiledevice', 'Status'),
|
||||
'device_identifier' => Yii::t('common/mobiledevice', 'Device Identifier'),
|
||||
'device_name' => Yii::t('common/mobiledevice', 'Device Name'),
|
||||
'activated_at' => Yii::t('common/mobiledevice', 'Activated At'),
|
||||
'created_at' => Yii::t('common/mobiledevice', 'Created At'),
|
||||
'updated_at' => Yii::t('common/mobiledevice', 'Updated At'),
|
||||
@@ -72,4 +75,24 @@ class MobileDevice extends \yii\db\ActiveRecord
|
||||
],
|
||||
parent::behaviors());
|
||||
}
|
||||
|
||||
public static function toStatusHumanReadable($status){
|
||||
$result = "";
|
||||
switch ($status){
|
||||
case self::STATUS_ACTIVE:
|
||||
$result ='Aktív';
|
||||
break;
|
||||
case self::STATUS_DELETED_MANUAL:
|
||||
$result ='Törölve (m)';
|
||||
break;
|
||||
case self::STATUS_DELETED_SYSTEM:
|
||||
$result ='Törölve (r)';
|
||||
break;
|
||||
case self::STATUS_INACTIVE:
|
||||
$result ='Inaktív';
|
||||
break;
|
||||
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user