Diff
Not logged in

Differences From:

File src/tkt.c part of check-in [580d6ad8c7] - Suppress the display of the artificate ID on the timeline which showing changes to wiki or tickets. by drh on 2009-01-21 01:23:40. [view]

To:

File src/tkt.c part of check-in [7a2c37063a] - merge trunk into creole branch by bob on 2009-09-22 07:49:39. Also file src/tkt.c part of check-in [0b76ce7b6b] - Treat NULL ticket fields as empty strings when appending new text. Ticket f6747f854ba62b3 by drh on 2009-09-19 14:33:04. [view]

@@ -198,9 +198,9 @@
 **
 ** Return TRUE if a new TICKET entry was created and FALSE if an
 ** existing entry was revised.
 */
-int ticket_insert(Manifest *p, int createFlag, int checkTime){
+int ticket_insert(const Manifest *p, int createFlag, int checkTime){
   Blob sql;
   Stmt q;
   int i;
   const char *zSep;
@@ -219,9 +219,10 @@
     const char *zName = p->aField[i].zName;
     if( zName[0]=='+' ){
       zName++;
       if( fieldId(zName)<0 ) continue;
-      blob_appendf(&sql,", %s=%s || %Q", zName, zName, p->aField[i].zValue);
+      blob_appendf(&sql,", %s=coalesce(%s,'') || %Q",
+                   zName, zName, p->aField[i].zValue);
     }else{
       if( fieldId(zName)<0 ) continue;
       blob_appendf(&sql,", %s=%Q", zName, p->aField[i].zValue);
     }
@@ -265,8 +266,9 @@
     int rid = db_column_int(&q, 0);
     content_get(rid, &content);
     manifest_parse(&manifest, &content);
     ticket_insert(&manifest, createFlag, 0);
+    manifest_ticket_event(rid, &manifest, createFlag, tagid);
     manifest_clear(&manifest);
     createFlag = 0;
   }
   db_finalize(&q);
@@ -457,9 +459,11 @@
     rid = content_put(&tktchng, 0, 0);
     if( rid==0 ){
       fossil_panic("trouble committing ticket: %s", g.zErrMsg);
     }
+    manifest_crosslink_begin();
     manifest_crosslink(rid, &tktchng);
+    manifest_crosslink_end();
   }
   return TH_RETURN;
 }
 
@@ -690,12 +694,13 @@
       char zUuid[12];
       memcpy(zUuid, zChngUuid, 10);
       zUuid[10] = 0;
       @
-      @ <p>%s(zDate)
+      @ Ticket change
       @ [<a href="%s(g.zTop)/artifact/%T(zChngUuid)">%s(zUuid)</a>]</a>
-      @ by %h(m.zUser):</p>
-      @
+      @ (rid %d(rid)) by
+      hyperlink_to_user(m.zUser,zDate," on");
+      hyperlink_to_date(zDate, ":");
       free(zDate);
       ticket_output_change_artifact(&m);
     }
     manifest_clear(&m);