Giter Site home page Giter Site logo

silbinarywolf / silverstripe-datachange-tracker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from symbiote/silverstripe-datachange-tracker

0.0 1.0 0.0 47 KB

Record and track changes to any dataobjects

License: BSD 3-Clause "New" or "Revised" License

PHP 98.45% CSS 1.55%

silverstripe-datachange-tracker's Introduction

SilverStripe Data Change Tracker

Requirements

  • SilverStripe 3

Maintainers

Description

Record and track changes and deletes of any dataobjects. View changes/diffs in model admin.

Installation

Install via composer, run dev/build

composer require silverstripe-australia/datachange-tracker

Usage

Add the ChangeRecordable extension to the dataobjects you wish to track

MyDataObject:
  extensions:
    - ChangeRecordable

If you are applying the extension to the SiteTree, use the SiteTreeChangeRecordable extension to record publish/unpublish actions

Capturing URL parameters

Set the save_request_vars option to 1, and GET and POST vars will be recorded too.

DataChangeRecord:
  save_request_vars: 1

Ignoring fields

In some cases it may not be desirable to track changes to all fields of an object. You can define ignored fields in your yml config like so:

ChangeRecordable:
  ignored_fields:
    NameOfObjectClass:
      - NameOfField

Or, for the same field name across all objects

DataChangeRecord:
  field_blacklist:
    - Password
    - Email

Also, you may wish to blacklist some request variables from being stored

DataChangeRecord:
  request_vars_blacklist:
    - url
    - SecurityID

Significant Change tracking

Sometimes reporting changes to certain fields to CMS users is desirable (e.g seeing the last time a field was updated). This is handled by SignificantChangeRecordable, which looks for a list of significant_fields.

Example:

TeamMember:
  significant_fields:
    - 'Name'
    - 'Address'
    - 'OfficeNumber'
    - 'Position'
    - 'Mobile'
  extensions:
    - 'ChangeRecordable'
    - 'SignificantChangeRecordable'

Version details

3.0.0

  • Removed static DataChangeRecord::track() method

silverstripe-datachange-tracker's People

Contributors

sheadawson avatar nyeholt avatar nathanbrauer avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.