CVSTrac Legacy Code

Check-in [743d4611de]
Login

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

Overview
Comment:(#783) when dealing with remarks in the timeline, break them out separately and (try to) link directly to a new remark in the ticket. This won't work perfectly when dealing with direct edits to the remark field, but for normal use it should be fine.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 743d4611de0f3a351807d648d504cf62122104ac
User & Date: cpb 2009-02-19 03:38:49
Context
2009-02-25
02:04
(#786) ensure local attachments links from the {quote:{image:}} tags aren't broken in the RSS feed. This requires adding an appropriate page id to the formatting calls. check-in: 4149691655 user: cpb tags: trunk
2009-02-19
03:38
(#783) when dealing with remarks in the timeline, break them out separately and (try to) link directly to a new remark in the ticket. This won't work perfectly when dealing with direct edits to the remark field, but for normal use it should be fine. check-in: 743d4611de user: cpb tags: trunk
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to timeline.c.

379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
...
609
610
611
612
613
614
615






616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632


633
634
635
636
637
638
639
          "(newval NOT IN ('new','active') AND oldval IN ('new','active')))");
      }
    }
    if( showS==3 ){
      appendf(zSQL,&len,sizeof(zSQL),
         " UNION ALL "
         "SELECT chngtime AS 'time', 6 AS 'type', user, '' AS 'aux1', "
         "       '' AS 'aux2', tn AS 'ref', NULL as 'text' "
         "FROM tktchng "
         "WHERE fieldid!='status' AND fieldid!='assignedto'"
         "  AND chngtime<=%d AND chngtime>=%d ",
         (int)end, (int)begin);
    }
    if( showA ){
      appendf(zSQL,&len,sizeof(zSQL),
................................................................................
      case 6: {  /* Changes to a ticket other than status or assignment */
        bprintf(zSuffix, sizeof(zSuffix), " (By %z)", format_user(az[i+2]));
        zIcon = "ticket";
        /* Skip over subsequent lines of same text and display number 
        ** of edits if > 1. Only collapse items from same day.
        */
        nEdits = 1;






        nLastEdit = atoi(az[i]);
        while( az[i+7] && atoi(az[i+8])==6 && strcmp(az[i+5],az[i+12])==0 
               && strcmp(az[i+2],az[i+9])==0 ){
          if( divT && !same_day(atoi(az[i]), atoi(az[i+7])) ){
            break;
          }
          if( atoi(az[i+7])!=nLastEdit ){
            nLastEdit = atoi(az[i+7]);
            nEdits++;
          }
          i += 7;
        }
        if( nEdits>1 ){
          bprintf(zPrefix, sizeof(zPrefix), "%d changes to ticket #%.20s",
                  nEdits, az[i+5]);
        }else{
          bprintf(zPrefix, sizeof(zPrefix), "Changes to ticket #%.20s", az[i+5]);


        }
        break;
      }
      case 7: { /* Attachments */
        if( isdigit(az[i+3][0]) ){
          bprintf(zPrefix, sizeof(zPrefix), "Attachment to ticket #%.20s: ",
                  az[i+3]);







|







 







>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>







379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
...
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
          "(newval NOT IN ('new','active') AND oldval IN ('new','active')))");
      }
    }
    if( showS==3 ){
      appendf(zSQL,&len,sizeof(zSQL),
         " UNION ALL "
         "SELECT chngtime AS 'time', 6 AS 'type', user, '' AS 'aux1', "
         "       '' AS 'aux2', tn AS 'ref', fieldid as 'text' "
         "FROM tktchng "
         "WHERE fieldid!='status' AND fieldid!='assignedto'"
         "  AND chngtime<=%d AND chngtime>=%d ",
         (int)end, (int)begin);
    }
    if( showA ){
      appendf(zSQL,&len,sizeof(zSQL),
................................................................................
      case 6: {  /* Changes to a ticket other than status or assignment */
        bprintf(zSuffix, sizeof(zSuffix), " (By %z)", format_user(az[i+2]));
        zIcon = "ticket";
        /* Skip over subsequent lines of same text and display number 
        ** of edits if > 1. Only collapse items from same day.
        */
        nEdits = 1;
        if( 0==strcmp(az[i+6],"remarks") ){
          bprintf(zPrefix,sizeof(zPrefix),
                  "{link:tktview?tn=%.20s#tktchng%d Remark}",
                  az[i+5],(int)thisDate);
          appendf(zPrefix,0,sizeof(zPrefix), " to ticket #%.20s", az[i+5] );
        }else{
          nLastEdit = atoi(az[i]);
          while( az[i+7] && atoi(az[i+8])==6 && strcmp(az[i+5],az[i+12])==0 
                 && strcmp(az[i+2],az[i+9])==0 ){
            if( divT && !same_day(atoi(az[i]), atoi(az[i+7])) ){
              break;
            }
            if( atoi(az[i+7])!=nLastEdit ){
              nLastEdit = atoi(az[i+7]);
              nEdits++;
            }
            i += 7;
          }
          if( nEdits>1 ){
            bprintf(zPrefix, sizeof(zPrefix), "%d changes to ticket #%.20s",
                    nEdits, az[i+5]);
          }else{
            bprintf(zPrefix, sizeof(zPrefix), "Changes to ticket #%.20s",
              az[i+5]);
          }
        }
        break;
      }
      case 7: { /* Attachments */
        if( isdigit(az[i+3][0]) ){
          bprintf(zPrefix, sizeof(zPrefix), "Attachment to ticket #%.20s: ",
                  az[i+3]);