breadcrumbs=array( $this->module->id, ); ?>
This is the audit trail module. This module provides basic access to any changes performed via active record through any class that has the LoggableBehavior assigned. It is based off of . I've noticed I always do the same things with it, and I hoped to help others who probably do the same thing.
This module requires:
If you are looking at this page, you at least enabled the module in your main.php config. Good job! Now we can continue with the installation:
prompt:> php ./yiic.php migrate up --migrationPath=application.modules.auditTrail.migrations
Keep in mind that you may have to change the mirgrationPath to match where you installed the extension. My examples assumes you put it in MyWebApp/protected/modules
Please add the AuditTrail model to the import section of your main.php config file so that all models that need it can find the AR model:
'import'=>array(
'application.models.*',
'application.components.*',
'application.modules.auditTrail.models.AuditTrail',
.....
),
Here are the following options for your main.php configurations (the defaults for all of them should work, so you may not need to use any of them, but if you need to override them you can)
'modules'=>array(
'auditTrail'=>array(
'userClass' => 'User', // the class name for the user object
'userIdColumn' => 'id', // the column name of the primary key for the user
'userNameColumn' => 'username', // the column name of the primary key for the user
),
.......
You should make sure your ActiveRecord objects use the LoggableBehavior. If you installed AuditTrail to your modules directory, this would typically be referenced by adding this function to your AR model:
public function behaviors()
{
return array(
'LoggableBehavior'=>
'application.modules.auditTrail.behaviors.LoggableBehavior',
);
}
You can easily add the audit trail widget to any page that is specifcally about one row of one thing (ie: one instance of one model, like an update or view page, not like an admin or list page), and it will give you insight into changes for just that object.
$this->widget(
'application.modules.auditTrail.widgets.portlets.ShowAuditTrail',
array(
'model' => $model,
)
);
The manager is just a searchable table of all audits. You can find it here: