[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: faking an append-only field
From: |
Mike Hoolehan |
Subject: |
Re: faking an append-only field |
Date: |
Thu, 1 Aug 2002 15:29:58 -0400 |
User-agent: |
Mutt/1.2.5.1i |
Perfect! Thanks, that was a good idea. For anyone else interested then,
the following changes to a dbconfig file will make a nice bugzilla-ish
appending audit trail.
First, set the Audit-Trail field to read-only. Then add this:
field "Add-To-Audit-Trail" {
description "Add a log entry to Audit Trail"
multitext { default "\n" }
on-change {
add-audit-trail
audit-trail-format {
format "---- Comments by %s on %s ----\n %s\n\n" #whatever you like
fields { "$EditUserEmailAddr" "$CurrentDate" "$NewValue" }
}
}
on-change {
set-field "Add-To-Audit-Trail" { "\n" }
}
}
Mike
On (01/08/02 11:54), Dirk Bergstrom wrote:
> On 8/1/2002 11:27 AM, Mike Hoolehan expounded at length upon:
> > With the gnats 4 beta, I'm attempting to mimic the audit trail behavior I'm
> > used to in bugzilla (basically an append-only field). Here's my attempt,
> > that works mostly:
> > field "Add-To-Audit-Trail" {
> [snip]
> > }
> > Then I just made the original Audit-Trail field 'read-only'.
>
> man, that's pretty slick!
>
> > This strategy works correctly except after the PR has just been created
> > and the PR is edited the first time. Even if the user doesn't change the
> > "Add-To-Audit-Trail" field on the gnatsweb interface, the on-change
> > stuff is being run. I've experimented with conditional 'on-change' using
> > regexes, but nothing seemed to help.
>
> i'm pretty sure that the problem arises because add-to-audit-trail is
> not actually in the PR after it's created (ie. it's not an initial-entry
> field). this means that after the first edit, the value in the field
> has "changed", because it's gone from the empty string to a single
> newline (or something like that).
>
> you might be able to fix this by setting a default value of " " for the
> field, or whatever value gnatsweb seems to be sticking in there. adding
> it to the initial-entry list might also solve the problem, but that's an
> ugly fix.
>
> hope this helps.
>
> --
> Dirk Bergstrom address@hidden
> Computer Geek v: 707.433.0564
> Juniper Networks Inc. f: 707.433.0769
>
> "it *looks* like a nail; lemme grab my hammer..."
>
>
> _______________________________________________
> Help-gnats mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-gnats