Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed May 21, 2018
1 parent 95f130a commit e7892a9
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions src/controllers/AdminCurrencyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public function actions()
],
'grid' => [
'defaultOrder' => [
'is_active' => SORT_DESC,
'priority' => SORT_ASC,
'is_active' => SORT_DESC,
'priority' => SORT_ASC,
],
'visibleColumns' => [
'checkbox',
Expand All @@ -57,9 +57,9 @@ public function actions()
],
'columns' => [
'is_active' => [
'class' => BooleanColumn::class,
'class' => BooleanColumn::class,
'falseValue' => 0,
'trueValue' => 1,
'trueValue' => 1,
],
],
],
Expand All @@ -74,15 +74,15 @@ public function actions()
],

"activate-multi" => [
'class' => BackendModelMultiActivateAction::class,
'class' => BackendModelMultiActivateAction::class,
'attribute' => 'is_active',
'value' => 1
'value' => 1,
],

"deactivate-multi" => [
'class' => BackendModelMultiDeactivateAction::class,
'class' => BackendModelMultiDeactivateAction::class,
'attribute' => 'is_active',
'value' => 0
'value' => 0,
],


Expand All @@ -108,8 +108,8 @@ public function updateFields()
return [
'code',
'name',
'is_active' => [
'class' => BoolField::class,
'is_active' => [
'class' => BoolField::class,
],
'course',
'priority',
Expand All @@ -122,11 +122,11 @@ public function actionUpdateAll()
foreach (\skeeks\modules\cms\money\Currency::$currencies as $code => $data) {
$currency = new \skeeks\modules\cms\money\Currency($code);

if (!$currencyModel = Currency::find()->where(['code' => $code])->one()) {
$currencyModel = new Currency([
'code' => $code,
if (!$currencyModel = MoneyCurrency::find()->where(['code' => $code])->one()) {
$currencyModel = new MoneyCurrency([
'code' => $code,
'is_active' => 0,
'name' => $currency->getDisplayName(),
'name' => $currency->getDisplayName(),
]);

$currencyModel->save(false);
Expand All @@ -135,9 +135,7 @@ public function actionUpdateAll()
$currencyModel->name = $currency->getDisplayName();
}

if (!$currencyModel->name_full) {
$currencyModel->name_full = $currency->getDisplayName();
}

$currencyModel->save(false);
}
}
Expand Down

0 comments on commit e7892a9

Please sign in to comment.