Use 'k' as objtype in audit trail when delete kvp frames.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5703 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-10-19 22:13:54 +00:00
parent ed94d8b79b
commit c9fa81578c
4 changed files with 11 additions and 16 deletions

View File

@ -132,7 +132,7 @@ pgendStoreAccountNoLock (PGBackend *be, Account *acct,
if (acct->idata)
{
pgendKVPDelete (be, acct->idata, 'a');
pgendKVPDelete (be, acct->idata);
pgendKVPStore (be, acct->idata, acct->kvp_data);
}
LEAVE(" ");
@ -471,7 +471,7 @@ pgend_account_commit_edit (Backend * bend,
{
const GUID *guid = xaccAccountGetGUID(acct);
pgendStoreAuditAccount (be, acct, SQL_DELETE);
pgendKVPDelete (be, acct->idata, 'a');
pgendKVPDelete (be, acct->idata);
p = be->buff; *p = 0;
p = stpcpy (p, "DELETE FROM gncAccount WHERE accountGuid='");

View File

@ -519,25 +519,20 @@ pgendKVPFetch (PGBackend *be, guint32 iguid, kvp_frame *kf)
p = stpcpy (p, "INSERT INTO gncKVPValue" TYPE "Trail SELECT '"); \
p = stpcpy (p, sess_str); \
p = stpcpy (p, "' as sessionGuid, datetime('NOW') as date_changed, " \
"'d' as change, '"); \
p = stpcpy (p, objtype); \
p = stpcpy (p, "' as objtype, "); \
"'d' as change, 'k' as objtype, "); \
p = stpcpy (p, "* from gncKVPValue" TYPE " WHERE iguid="); \
p = stpcpy (p, iguid_str); \
}
void
pgendKVPDelete (PGBackend *be, guint32 iguid, char objtype_char)
pgendKVPDelete (PGBackend *be, guint32 iguid)
{
char iguid_str[80], sess_str[80], objtype[2];
char iguid_str[80], sess_str[80];
char * p;
if (!be || 0 == iguid)
return;
objtype[0] = objtype_char;
objtype[1] = '\0';
sprintf (iguid_str, "%d;\n", iguid);
guid_to_string_buff (be->sessionGuid, sess_str);

View File

@ -65,7 +65,7 @@ void pgendKVPInit (PGBackend *);
*/
void pgendKVPStore (PGBackend *, guint32 iguid, kvp_frame *);
void pgendKVPDelete (PGBackend *, guint32 iguid, char objtype);
void pgendKVPDelete (PGBackend *, guint32 iguid);
kvp_frame * pgendKVPFetch (PGBackend *, guint32 iguid, kvp_frame *);

View File

@ -196,7 +196,7 @@ pgendStoreTransactionNoLock (PGBackend *be, Transaction *trans,
{
DeleteTransInfo *dti = node->data;
pgendKVPDelete (be, dti->iguid, 'e');
pgendKVPDelete (be, dti->iguid);
}
}
@ -228,7 +228,7 @@ pgendStoreTransactionNoLock (PGBackend *be, Transaction *trans,
pgendPutOneSplitOnly (be, s);
if (s->idata)
{
pgendKVPDelete (be, s->idata, 'e');
pgendKVPDelete (be, s->idata);
pgendKVPStore (be, s->idata, s->kvp_data);
}
}
@ -248,7 +248,7 @@ pgendStoreTransactionNoLock (PGBackend *be, Transaction *trans,
if (trans->idata)
{
pgendKVPDelete (be, trans->idata, 't');
pgendKVPDelete (be, trans->idata);
pgendKVPStore (be, trans->idata, trans->kvp_data);
}
}
@ -282,9 +282,9 @@ pgendStoreTransactionNoLock (PGBackend *be, Transaction *trans,
for (node=start; node; node=node->next)
{
Split * s = node->data;
if (0 != s->idata) pgendKVPDelete (be, s->idata, 'e');
if (0 != s->idata) pgendKVPDelete (be, s->idata);
}
if (0 != trans->idata) pgendKVPDelete (be, trans->idata, 't');
if (0 != trans->idata) pgendKVPDelete (be, trans->idata);
}
LEAVE(" ");