|
From: Mattias T. <mth...@ac...> - 2007-11-30 22:17:49
|
Hi all, I thought I'd provide a hopefully more readable version of my latest commit message (the lines wrapped badly). Cheers, Mattias There are two large improvements this commit. The first improvement is the Transaction log functionality, which is an extension and improvement of the existing audit trail functionality. It provides for a centralized log of all changes to all data anywhere in the database (provided that data is not manipilated manually but through the application interfaces). The visible changes may be small for now, but you may inspect the records in the trx and trxr modules to see the changes as they are being logged. We will add more ways to access and make use of this data as the interface evolves. On the radar are: a better audit log screen (to inspect modifications to a particular record), a dashboard grid (latest changes: what records, by what user), and possibly a log of what changes a particular user has made (as a view grid in the Users module). Needless to say, the transaction log will grow over time and at some point we will probably need a system that can archive audit trail info to files (or elsewhere) and purge older info. The other improvement is the patch management system, which came about because of the need to convert the present audit trail data into the transaction modules. The patches issued with this commit will perform that conversion as you run s2a.php the first time. The patch system is designed to check whether it actually needs to be applied before making any changes. It will also check for any requirements necessary before a patch can be applied, and patches can install requirements if needed. This system will also evolve with time. Currently, there's no checking of dependencies between patches, but their numbering indicate the order in which they will be checked and applied. Also note that the currently issued patches assume that you have a fairly recently updated 0.8.2 database (not a fresh install straight from the release). For the release of 0.8.3 I hope to issue more patches that will migrate the data all the way from the 0.8.2 release. s2a-apply-patches.php * New command-line utility to apply upgrade patches to the database or the application itself. This command can be run by itself, but is also invoked every time s2a.php is run. lib/classes/data_handler.class.php * Implemented a centralized audit trail log, saved in the new tables trx and trxr. When saving data, _ModDate and _ModBy are saved to trx, module/record references (and _Deleted) are saved to trxr. The transaction ID (PK of trx) is also saved to the new _TransactionID field of tables. - Improvements to the transaction tracking/handling (startTransaction() endTransaction()) - New method trackDataChange() to log audit trail info into trxr. lib/classes/module.class.php * Added new system field _TransactionID, to be included in all tables. * Submodule::Factory(): Converted to use PEAR MDB2. active_agenda/xml/trxModuleDef.xml * New system module to track transactions within the database. A transaction is when a user saves or deletes records, or when data is inserted/updated through import. active_agenda/xml/trxrModuleDef.xml * New system module for Transaction Records (reference to what records were changed in a transaction). active_agenda/xml/verModuleDef.xml * New system module to track Active Agenda releases. This supports the upgrade patch functionality. active_agenda/xml/uppModuleDef.xml * New system module to track installed patches. s2a.php * Added new command line parameter 'export-metadata'. * Replaced the tentative "upgrade path" implementation with a more definitive solution, upgrade patches. * Passing command line parameters to s2a-generate-module.php according to the new format. * Added some more info messages about what's happening. util/patches/0.8.2/patch_105_fix_mod_log.php * Patch to update the RecordID field of the `mod_l` table. - Also includes a checkRequirements() method to check that there is actually a RecordID field, and if needed the applyRequirements() method can add it. util/patches/0.8.2/patch_106_fix_cod_log.php * Patch to update the RecordID field of the `cod_l` table. - Also includes a checkRequirements() method to check that there is actually a RecordID field, and if needed the applyRequirements() method can add it. util/patches/0.8.2/patch_110_migrate_audit_trail.php * Patch to migrate audit trail data into the new trx and trxr modules. - The patch will check all tables for a _TransactionID field and offer to add it where missing. s2a-generate-module.php * Added PEAR Console_Getargs for better handling of command line parameters. This means there's a new syntax for command line arguments to this script, adjusted in s2a.php. lib/includes/general_util.php * Cosmetics: fixed a line ending with ;; * mdb2ErrorCheck(): avoiding a notice about undefined variable. lib/includes/parse_util.php * GetModule(): Avoiding a notice when not returning an object. -- Mattias Thorslund Active Agenda, Inc. mth...@ac... Company: http://www.activeagenda.net Weblog: http://activeagenda.net/blog/ |