Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| SHA1 Hash: | 931f8895c650aec132a9d0acd17bbf82d40b4d2f |
|---|---|
| Date: | 2010-03-17 23:49:55 |
| User: | drh |
| Comment: | Show artifact changes in ticket history. |
Tags And Properties
- bgcolor=#c0ffc0 inherited from [c3d7df650b]
- branch=experimental inherited from [c3d7df650b] branch timeline
- sym-experimental inherited from [c3d7df650b]
Changes
[hide diffs]Changes to src/tkt.c
@@ -725,37 +725,61 @@
@ No such ticket: %h(zUuid)
style_footer();
return;
}
db_prepare(&q,
- "SELECT objid, uuid FROM event, blob"
+ "SELECT datetime(mtime,'localtime'), objid, uuid, NULL, NULL, NULL"
+ " FROM event, blob"
" WHERE objid IN (SELECT rid FROM tagxref WHERE tagid=%d)"
" AND blob.rid=event.objid"
- " ORDER BY mtime DESC",
- tagid
+ " UNION "
+ "SELECT datetime(mtime,'localtime'), attachid, uuid, src, filename, user"
+ " FROM attachment, blob"
+ " WHERE isLatest AND target=(SELECT substr(tagname,5) FROM tag"
+ " WHERE tagid=%d)"
+ " AND blob.rid=attachid"
+ " ORDER BY 1 DESC",
+ tagid, tagid
);
while( db_step(&q)==SQLITE_ROW ){
Blob content;
Manifest m;
- int rid = db_column_int(&q, 0);
- const char *zChngUuid = db_column_text(&q, 1);
- content_get(rid, &content);
- if( manifest_parse(&m, &content) && m.type==CFTYPE_TICKET ){
- char *zDate = db_text(0, "SELECT datetime(%.12f)", m.rDate);
- char zUuid[12];
- memcpy(zUuid, zChngUuid, 10);
- zUuid[10] = 0;
- @
- @ Ticket change
- @ [<a href="%s(g.zTop)/artifact/%T(zChngUuid)">%s(zUuid)</a>]</a>
+ char zShort[12];
+ const char *zDate = db_column_text(&q, 0);
+ int rid = db_column_int(&q, 1);
+ const char *zChngUuid = db_column_text(&q, 2);
+ const char *zFile = db_column_text(&q, 4);
+ memcpy(zShort, zChngUuid, 10);
+ zShort[10] = 0;
+ if( zFile!=0 ){
+ const char *zSrc = db_column_text(&q, 3);
+ const char *zUser = db_column_text(&q, 5);
+ if( zSrc==0 ){
+ @
+ @ <p>Delete attachment "%h(zFile)"
+ }else{
+ @
+ @ <p>Add attachment "%h(zFile)"
+ }
+ @ [<a href="%s(g.zTop)/artifact/%T(zChngUuid)">%s(zShort)</a>]
@ (rid %d(rid)) by
- hyperlink_to_user(m.zUser,zDate," on");
- hyperlink_to_date(zDate, ":");
- free(zDate);
- ticket_output_change_artifact(&m);
+ hyperlink_to_user(zUser,zDate," on");
+ hyperlink_to_date(zDate, ".</p>");
+ }else{
+ content_get(rid, &content);
+ if( manifest_parse(&m, &content) && m.type==CFTYPE_TICKET ){
+ @
+ @ <p>Ticket change
+ @ [<a href="%s(g.zTop)/artifact/%T(zChngUuid)">%s(zShort)</a>]
+ @ (rid %d(rid)) by
+ hyperlink_to_user(m.zUser,zDate," on");
+ hyperlink_to_date(zDate, ":");
+ ticket_output_change_artifact(&m);
+ @ </p>
+ }
+ manifest_clear(&m);
}
- manifest_clear(&m);
}
db_finalize(&q);
style_footer();
}