CVSTrac Legacy Code

Check-in [7c22978975]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:(#783) when appending a ticket comment, write an HTML anchor based on the change time so we can find it later.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7c22978975418e942fd2bee5cf5e20bd6345d121
User & Date: cpb 2009-02-19 02:59:18
Context
2009-02-19
03:23
(#783) generate the link to appended remarks by targetting what should be the anchor. Doing so from the timeline will be a little more complicated. check-in: 52ecfd6559 user: cpb tags: trunk
02:59
(#783) when appending a ticket comment, write an HTML anchor based on the change time so we can find it later. check-in: 7c22978975 user: cpb tags: trunk
02:33
(#781) don't run the external diff filter if the output is supposed to be _raw_ check-in: 488fc0db1e user: cpb tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ticket.c.

1557
1558
1559
1560
1561
1562
1563

1564
1565
1566
1567

1568
1569
1570



1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
      time_t now;
      struct tm *pTm;
      char zDate[200];
      const char *zOrig;
      char *zNew;
      char *zSpacer = " {linebreak}\n";
      char *zHLine = "\n\n----\n";

      char **az;
      int change;
      zOrig = db_short_query("SELECT remarks FROM ticket WHERE tn=%d", tn);
      zOrig = remove_blank_lines(zOrig);

      time(&now); 
      pTm = localtime(&now);
      strftime(zDate, sizeof(zDate), "%Y-%b-%d %H:%M:%S", pTm);



      if( isspace(zText[0]) && isspace(zText[1]) ) zSpacer = "\n\n";
      if( zOrig[0]==0 ) zHLine = "";
      zNew = mprintf("%s_%s by %s:_%s%s",
                     zHLine, zDate, g.zUser, zSpacer, zText);
      db_execute(
        "BEGIN;"
        "UPDATE ticket SET remarks='%q%q', changetime=%d WHERE tn=%d;"
        "INSERT INTO tktchng(tn,user,chngtime,fieldid,oldval,newval) "
           "VALUES(%d,'%q',%d,'remarks','%q','%q%q');"
        "COMMIT;",
        zOrig, zNew, now, tn,







>




>



>
>
>


|
|







1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
      time_t now;
      struct tm *pTm;
      char zDate[200];
      const char *zOrig;
      char *zNew;
      char *zSpacer = " {linebreak}\n";
      char *zHLine = "\n\n----\n";
      char *zAnchor;
      char **az;
      int change;
      zOrig = db_short_query("SELECT remarks FROM ticket WHERE tn=%d", tn);
      zOrig = remove_blank_lines(zOrig);

      time(&now); 
      pTm = localtime(&now);
      strftime(zDate, sizeof(zDate), "%Y-%b-%d %H:%M:%S", pTm);

      zAnchor = mprintf("<html><a name=\"tktchng%d\" /></html>", (int)now);

      if( isspace(zText[0]) && isspace(zText[1]) ) zSpacer = "\n\n";
      if( zOrig[0]==0 ) zHLine = "";
      zNew = mprintf("%s%s_%s by %s:_%s%s",
                     zHLine, zAnchor, zDate, g.zUser, zSpacer, zText);
      db_execute(
        "BEGIN;"
        "UPDATE ticket SET remarks='%q%q', changetime=%d WHERE tn=%d;"
        "INSERT INTO tktchng(tn,user,chngtime,fieldid,oldval,newval) "
           "VALUES(%d,'%q',%d,'remarks','%q','%q%q');"
        "COMMIT;",
        zOrig, zNew, now, tn,