Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#8 Add app ID information #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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