implement mobile devices in reception

This commit is contained in:
2022-02-19 14:51:58 +01:00
parent 9fb0485066
commit 34fca82e7d
13 changed files with 834 additions and 185 deletions

View File

@@ -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;
}
}