new: [audit log] behaviour tied into the appropriate models
parent
72bd564120
commit
2e1ee2d064
|
@ -12,6 +12,7 @@ class AlignmentsTable extends AppTable
|
|||
{
|
||||
parent::initialize($config);
|
||||
$this->belongsTo('Individuals');
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->belongsTo('Organisations');
|
||||
$this->addBehavior('Timestamp');
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ class AuditLogsTable extends AppTable
|
|||
}
|
||||
}
|
||||
if ($this->syslog) {
|
||||
$entry = $data['action'];
|
||||
$entry = $data['request_action'];
|
||||
$title = $entity->generateUserFriendlyTitle();
|
||||
if ($title) {
|
||||
$entry .= " -- $title";
|
||||
|
|
|
@ -19,10 +19,11 @@ class AuthKeysTable extends AppTable
|
|||
{
|
||||
parent::initialize($config);
|
||||
$this->addBehavior('UUID');
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->belongsTo(
|
||||
'Users'
|
||||
);
|
||||
$this->setDisplayField('authkey');
|
||||
$this->setDisplayField('comment');
|
||||
}
|
||||
|
||||
public function beforeMarshal(EventInterface $event, ArrayObject $data, ArrayObject $options)
|
||||
|
|
|
@ -19,6 +19,7 @@ class BroodsTable extends AppTable
|
|||
parent::initialize($config);
|
||||
$this->addBehavior('UUID');
|
||||
$this->addBehavior('Timestamp');
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->BelongsTo(
|
||||
'Organisations'
|
||||
);
|
||||
|
@ -278,7 +279,7 @@ class BroodsTable extends AppTable
|
|||
}
|
||||
return $jsonReply;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* handleSendingFailed - Handle the case if the request could not be sent or if the remote rejected the connection request
|
||||
*
|
||||
|
@ -302,7 +303,7 @@ class BroodsTable extends AppTable
|
|||
];
|
||||
return $creationResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* handleMessageNotCreated - Handle the case if the request was sent but the remote brood did not save the message in the inbox
|
||||
*
|
||||
|
|
|
@ -14,6 +14,7 @@ class EncryptionKeysTable extends AppTable
|
|||
{
|
||||
parent::initialize($config);
|
||||
$this->addBehavior('UUID');
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->addBehavior('Timestamp');
|
||||
$this->belongsTo(
|
||||
'Individuals',
|
||||
|
|
|
@ -19,7 +19,7 @@ class InboxTable extends AppTable
|
|||
parent::initialize($config);
|
||||
$this->addBehavior('UUID');
|
||||
$this->addBehavior('Timestamp');
|
||||
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->belongsTo('Users');
|
||||
$this->setDisplayField('title');
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class InboxTable extends AppTable
|
|||
if (empty($brood)) {
|
||||
$errors[] = __('Unkown brood `{0}`', $entryData['data']['cerebrateURL']);
|
||||
}
|
||||
|
||||
|
||||
// $found = false;
|
||||
// foreach ($user->individual->organisations as $organisations) {
|
||||
// if ($organisations->id == $brood->organisation_id) {
|
||||
|
|
|
@ -16,6 +16,7 @@ class IndividualsTable extends AppTable
|
|||
$this->addBehavior('UUID');
|
||||
$this->addBehavior('Timestamp');
|
||||
$this->addBehavior('Tags.Tag');
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->hasMany(
|
||||
'Alignments',
|
||||
[
|
||||
|
|
|
@ -18,6 +18,8 @@ class InstanceTable extends AppTable
|
|||
public function initialize(array $config): void
|
||||
{
|
||||
parent::initialize($config);
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->setDisplayField('name');
|
||||
}
|
||||
|
||||
public function validationDefault(Validator $validator): Validator
|
||||
|
@ -54,7 +56,7 @@ class InstanceTable extends AppTable
|
|||
$timeline[$entry->date]['count'] = $entry->count;
|
||||
}
|
||||
$statistics[$model]['timeline'] = array_values($timeline);
|
||||
|
||||
|
||||
$startCount = $table->find()->where(['modified <' => new \DateTime("-{$days} days")])->all()->count();
|
||||
$endCount = $statistics[$model]['amount'];
|
||||
$statistics[$model]['variation'] = $endCount - $startCount;
|
||||
|
|
|
@ -30,6 +30,7 @@ class LocalToolsTable extends AppTable
|
|||
public function initialize(array $config): void
|
||||
{
|
||||
parent::initialize($config);
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->addBehavior('Timestamp');
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ class MetaFieldsTable extends AppTable
|
|||
{
|
||||
parent::initialize($config);
|
||||
$this->addBehavior('UUID');
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->setDisplayField('field');
|
||||
$this->belongsTo('MetaTemplates');
|
||||
$this->belongsTo('MetaTemplateFields');
|
||||
|
|
|
@ -20,6 +20,7 @@ class OrganisationsTable extends AppTable
|
|||
parent::initialize($config);
|
||||
$this->addBehavior('Timestamp');
|
||||
$this->addBehavior('Tags.Tag');
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->hasMany(
|
||||
'Alignments',
|
||||
[
|
||||
|
|
|
@ -28,6 +28,7 @@ class OutboxProcessorsTable extends AppTable
|
|||
if (empty($this->outboxProcessors)) {
|
||||
$this->loadProcessors();
|
||||
}
|
||||
$this->addBehavior('AuditLog');
|
||||
}
|
||||
|
||||
public function getProcessor($scope, $action=null)
|
||||
|
@ -87,7 +88,7 @@ class OutboxProcessorsTable extends AppTable
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getProcessorClass
|
||||
*
|
||||
|
@ -112,7 +113,7 @@ class OutboxProcessorsTable extends AppTable
|
|||
return $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* createOutboxEntry
|
||||
*
|
||||
|
|
|
@ -19,8 +19,8 @@ class OutboxTable extends AppTable
|
|||
parent::initialize($config);
|
||||
$this->addBehavior('UUID');
|
||||
$this->addBehavior('Timestamp');
|
||||
|
||||
$this->belongsTo('Users');
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->setDisplayField('title');
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ class RemoteToolConnectionsTable extends AppTable
|
|||
'LocalTools'
|
||||
);
|
||||
$this->setDisplayField('id');
|
||||
$this->addBehavior('AuditLog');
|
||||
}
|
||||
|
||||
public function validationDefault(Validator $validator): Validator
|
||||
|
|
|
@ -12,6 +12,7 @@ class RolesTable extends AppTable
|
|||
{
|
||||
parent::initialize($config);
|
||||
$this->addBehavior('UUID');
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->hasMany(
|
||||
'Users',
|
||||
[
|
||||
|
|
|
@ -26,6 +26,7 @@ class SettingsTable extends AppTable
|
|||
parent::initialize($config);
|
||||
$this->setTable(false);
|
||||
$this->SettingsProvider = new CerebrateSettingsProvider();
|
||||
$this->addBehavior('AuditLog');
|
||||
}
|
||||
|
||||
public function getSettings($full=false): array
|
||||
|
|
|
@ -15,6 +15,7 @@ class SharingGroupsTable extends AppTable
|
|||
parent::initialize($config);
|
||||
$this->addBehavior('UUID');
|
||||
$this->addBehavior('Timestamp');
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->belongsTo(
|
||||
'Users'
|
||||
);
|
||||
|
|
|
@ -20,6 +20,7 @@ class UsersTable extends AppTable
|
|||
parent::initialize($config);
|
||||
$this->addBehavior('Timestamp');
|
||||
$this->addBehavior('UUID');
|
||||
$this->addBehavior('AuditLog');
|
||||
$this->initAuthBehaviors();
|
||||
$this->belongsTo(
|
||||
'Individuals',
|
||||
|
|
Loading…
Reference in New Issue