diff --git a/changelog.txt b/changelog.txt index f676dd5..71a669a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,5 @@ +-0.0.83 + - add rfid ascii char fix to key save/update -0.0.82 - add rfid check to card package import -0.0.81 diff --git a/common/config/params.php b/common/config/params.php index 9b2302a..6a1eac3 100644 --- a/common/config/params.php +++ b/common/config/params.php @@ -5,7 +5,7 @@ return [ 'supportEmail' => 'rocho02@gmail.com', 'infoEmail' => 'info@rocho-net.hu', 'user.passwordResetTokenExpire' => 3600, - 'version' => 'v0.0.82', + 'version' => 'v0.0.83', 'company' => 'movar',//gyor 'company_name' => "Freimann Kft.", 'product_visiblity' => 'account',// on reception which products to display. account or global diff --git a/common/models/Key.php b/common/models/Key.php index a7d9445..afd941a 100644 --- a/common/models/Key.php +++ b/common/models/Key.php @@ -12,6 +12,7 @@ use common\components\Helper; * * @property integer $id_key * @property string $number + * @property string $rfid_key * @property integer $status * @property integer $type * @property string $created_at @@ -97,18 +98,30 @@ class Key extends \yii\db\ActiveRecord /** - * @param yii\db\Query $query + * @param \yii\db\Query $query * */ public static function addKeyCondition($query, $number , $fieldNumber = "key.number",$fieldRfid = "key.rfid_key"){ $number = Helper::fixAsciiChars($number); $query->andWhere( ['or' , [$fieldNumber =>$number ],[$fieldRfid =>$number ] ]); } /** - * @param yii\db\Query $query + * @param \yii\db\Query $query * */ public static function addKeyConditionOptional($query, $number , $fieldNumber = "key.number",$fieldRfid = "key.rfid_key"){ $number = Helper::fixAsciiChars($number); $query->andFilterWhere( ['or' , [$fieldNumber =>$number ],[$fieldRfid =>$number ] ]); } - + + public function beforeSave($insert) + { + if ( parent::beforeSave($insert) ){ + + $this->rfid_key = Helper::fixAsciiChars($this->rfid_key); + + return true; + } + return false; + } + + }