Skip to content

Commit

Permalink
#8 Add app ID information
Browse files Browse the repository at this point in the history
  • Loading branch information
yetopen-stage committed Jun 12, 2023
1 parent 9d7150e commit e392697
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

use yii\db\Migration;

/**
* Class m230612_142900_add_column_app_id_to_table_modelhistory
*/
class m230612_142900_add_column_app_id_to_table_modelhistory extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('modelhistory', 'app_id', $this->string(25));
}

/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('modelhistory', 'app_id');
}
}
1 change: 1 addition & 0 deletions src/managers/BaseManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public function run($type, $object)
'type' => $type,
'date' => date('Y-m-d H:i:s', time()),
'action' => Yii::$app->requestedRoute,
'app_id' => Yii::$app->id,
];

if ($this->saveUserId)
Expand Down
1 change: 1 addition & 0 deletions src/messages/it-IT/arh.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
'Update' => 'Modifica',
'Update ID' => 'Modifica ID',
'Delete' => 'Cancellazione',
'Application' => 'Applicazione',
];
4 changes: 4 additions & 0 deletions src/views/active-record-history/model-changes.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@
'attribute' => 'action',
'label' => Yii::t('arh', 'Action'),
],
'app_id' => [
'attribute' => 'app_id',
'label' => Yii::t('arh', 'App ID'),
],
];

if($module->changesHistoryColumns) {
Expand Down

0 comments on commit e392697

Please sign in to comment.