public static function boot() { parent::boot(); static::created(function ($record) { $kitTypeID = $record->KitType; $kitID = $record->ID; Logs::LogMsg(4, $kitTypeID, $kitID, null, "Created Kit: " . $record->Name); return true; }); static::updating(function ($record) { $kitTypeID = $record->KitType; $kitID = $record->ID; $dirty = $record->getDirty(); foreach ($dirty as $field => $newdata) { $olddata = $record->getOriginal($field); if ($olddata != $newdata) { Logs::LogMsg(5, $kitTypeID, $kitID, null, "Changed Kit field: " . $field . " From:" . $olddata . " To:" . $newdata); } } return true; }); static::deleting(function ($record) { $kitTypeID = $record->KitType; $kitID = $record->ID; Logs::LogMsg(6, $kitTypeID, $kitID, null, "Deleted Kit: " . $record->Name); return true; }); }
public static function boot() { parent::boot(); static::created(function ($record) { $kitTypeID = $record->kit->KitType; $kitID = $record->kit->ID; Logs::LogMsg(10, $kitTypeID, $kitID, $record->ID, "Added content: " . $record->Name); return true; }); static::updating(function ($record) { $kitTypeID = $record->kit->KitType; $kitID = $record->kit->ID; $dirty = $record->getDirty(); foreach ($dirty as $field => $newdata) { $olddata = $record->getOriginal($field); if ($olddata != $newdata) { Logs::LogMsg(11, $kitTypeID, $kitID, $record->ID, "Changed " . $field . " From:" . $olddata . " To:" . $newdata); } } return true; }); static::deleting(function ($record) { $kitTypeID = $record->kit->KitType; $kitID = $record->kit->ID; Logs::LogMsg(12, $kitTypeID, $kitID, $record->ID, "Removed Contents: " . $record->Name); return true; }); }
public static function boot() { parent::boot(); static::created(function ($record) { $userName = ""; if (isset($record->UserID)) { $userName = User::find($record->UserID)->username; } else { $userName = $record->Email; } $primaryBooker = " as primary booker"; if (!$record->Booker) { $primaryBooker = " as secondary contact"; } Logs::LogMsg(18, $record->booking->kit->KitType, $record->booking->kit->ID, $record->booking->branch->ID, "Added user:"******" changed From:" . $olddata . " To:" . $newdata); } } return true; }); static::deleting(function ($record) { Logs::LogMsg(20, $record->booking->kit->KitType, $record->booking->kit->ID, $record->booking->branch->ID, "Detail deleted by:" . Auth::user()->username); return true; }); }
public static function boot() { parent::boot(); static::created(function ($record) { Logs::LogMsg(13, $record->kit->KitType, $record->kit->ID, $record->branch->ID, "Booking for:" . $record->branch->BranchID . " from:" . $record->StartDate . " To:" . $record->EndDate); return true; }); static::updating(function ($record) { $dirty = $record->getDirty(); foreach ($dirty as $field => $newdata) { $olddata = $record->getOriginal($field); if ($olddata != $newdata) { Logs::LogMsg(15, $record->kit->KitType, $record->kit->ID, $record->branch->ID, "Changed booking " . $field . " From:" . $olddata . " To:" . $newdata); } } return true; }); static::deleting(function ($record) { Logs::LogMsg(14, $record->kit->KitType, $record->kit->ID, $record->branch->ID, "Booking Deleted by:" . Auth::user()->username); return true; }); }
public static function boot() { parent::boot(); static::created(function ($record) { Logs::LogMsg(7, $record->ID, null, null, "Type Created"); return true; }); static::updating(function ($record) { $dirty = $record->getDirty(); foreach ($dirty as $field => $newdata) { $olddata = $record->getOriginal($field); if ($olddata != $newdata) { Logs::LogMsg(19, $record->ID, null, null, $field . " changed From:" . $olddata . " To:" . $newdata); } } return true; }); static::deleting(function ($record) { Logs::LogMsg(20, $record->ID, null, null, "Kit type deleted by:" . Auth::user()->username); return true; }); }
public static function Note($KityTypeID, $KitID, $ContentsID, $Message) { return Logs::LogMsg(3, $KityTypeID, $KitID, $ContentsID, $Message); }