Fossil SCM

Add a new form of ticket timeline that shows only the check-ins associated with the ticket.

drh 2010-03-15 20:54 trunk
Commit dec136484819edfcb01c88a97270ed14009e1cf1
1 file changed +37 -8
+37 -8
--- src/tkt.c
+++ src/tkt.c
@@ -308,10 +308,12 @@
308308
const char *zUuid = PD("name","");
309309
style_submenu_element("History", "History Of This Ticket",
310310
"%s/tkthistory/%T", g.zTop, zUuid);
311311
style_submenu_element("Timeline", "Timeline Of This Ticket",
312312
"%s/tkttimeline/%T", g.zTop, zUuid);
313
+ style_submenu_element("Check-ins", "Check-ins Of This Ticket",
314
+ "%s/tkttimeline/%T?y=ci", g.zTop, zUuid);
313315
}
314316
if( g.okNewTkt ){
315317
style_submenu_element("New Ticket", "Create a new ticket",
316318
"%s/tktnew", g.zTop);
317319
}
@@ -581,11 +583,11 @@
581583
return 0;
582584
}
583585
584586
/*
585587
** WEBPAGE: tkttimeline
586
-** URL: /tkttimeline?name=TICKETUUID
588
+** URL: /tkttimeline?name=TICKETUUID&y=TYPE
587589
**
588590
** Show the change history for a single ticket in timeline format.
589591
*/
590592
void tkttimeline_page(void){
591593
Stmt q;
@@ -593,19 +595,32 @@
593595
char *zSQL;
594596
const char *zUuid;
595597
char *zFullUuid;
596598
int tagid;
597599
char zGlobPattern[50];
600
+ const char *zType;
598601
599602
login_check_credentials();
600603
if( !g.okHistory || !g.okRdTkt ){ login_needed(); return; }
601604
zUuid = PD("name","");
605
+ zType = PD("y","a");
606
+ if( zType[0]!='c' ){
607
+ style_submenu_element("Check-ins", "Check-ins",
608
+ "%s/tkttimeline?name=%T&y=ci", g.zTop, zUuid);
609
+ }else{
610
+ style_submenu_element("Timeline", "Timeline",
611
+ "%s/tkttimeline?name=%T", g.zTop, zUuid);
612
+ }
602613
style_submenu_element("History", "History",
603614
"%s/tkthistory/%s", g.zTop, zUuid);
604615
style_submenu_element("Status", "Status",
605616
"%s/info/%s", g.zTop, zUuid);
606
- zTitle = mprintf("Timeline Of Ticket %h", zUuid);
617
+ if( zType[0]=='c' ){
618
+ zTitle = mprintf("Check-Ins Associated With Ticket %h", zUuid);
619
+ }else{
620
+ zTitle = mprintf("Timeline Of Ticket %h", zUuid);
621
+ }
607622
style_header(zTitle);
608623
free(zTitle);
609624
610625
sqlite3_snprintf(6, zGlobPattern, "%s", zUuid);
611626
canonical16(zGlobPattern, strlen(zGlobPattern));
@@ -615,16 +630,28 @@
615630
style_footer();
616631
return;
617632
}
618633
zFullUuid = db_text(0, "SELECT substr(tagname, 5) FROM tag WHERE tagid=%d",
619634
tagid);
620
- zSQL = mprintf("%s AND event.objid IN "
621
- " (SELECT rid FROM tagxref WHERE tagid=%d UNION"
622
- " SELECT srcid FROM backlink WHERE target GLOB '%.4s*' "
623
- "AND '%s' GLOB (target||'*')) "
624
- "ORDER BY mtime DESC",
625
- timeline_query_for_www(), tagid, zFullUuid, zFullUuid);
635
+ if( zType[0]=='c' ){
636
+ zSQL = mprintf(
637
+ "%s AND event.objid IN "
638
+ " (SELECT srcid FROM backlink WHERE target GLOB '%.4s*' "
639
+ "AND '%s' GLOB (target||'*')) "
640
+ "ORDER BY mtime DESC",
641
+ timeline_query_for_www(), zFullUuid, zFullUuid
642
+ );
643
+ }else{
644
+ zSQL = mprintf(
645
+ "%s AND event.objid IN "
646
+ " (SELECT rid FROM tagxref WHERE tagid=%d UNION"
647
+ " SELECT srcid FROM backlink WHERE target GLOB '%.4s*' "
648
+ "AND '%s' GLOB (target||'*')) "
649
+ "ORDER BY mtime DESC",
650
+ timeline_query_for_www(), tagid, zFullUuid, zFullUuid
651
+ );
652
+ }
626653
db_prepare(&q, zSQL);
627654
free(zSQL);
628655
www_print_timeline(&q, TIMELINE_ARTID, 0);
629656
db_finalize(&q);
630657
style_footer();
@@ -646,10 +673,12 @@
646673
if( !g.okHistory || !g.okRdTkt ){ login_needed(); return; }
647674
zUuid = PD("name","");
648675
zTitle = mprintf("History Of Ticket %h", zUuid);
649676
style_submenu_element("Status", "Status",
650677
"%s/info/%s", g.zTop, zUuid);
678
+ style_submenu_element("Check-ins", "Check-ins",
679
+ "%s/tkttimeline?name=%s?y=ci", g.zTop, zUuid);
651680
style_submenu_element("Timeline", "Timeline",
652681
"%s/tkttimeline?name=%s", g.zTop, zUuid);
653682
style_header(zTitle);
654683
free(zTitle);
655684
656685
--- src/tkt.c
+++ src/tkt.c
@@ -308,10 +308,12 @@
308 const char *zUuid = PD("name","");
309 style_submenu_element("History", "History Of This Ticket",
310 "%s/tkthistory/%T", g.zTop, zUuid);
311 style_submenu_element("Timeline", "Timeline Of This Ticket",
312 "%s/tkttimeline/%T", g.zTop, zUuid);
 
 
313 }
314 if( g.okNewTkt ){
315 style_submenu_element("New Ticket", "Create a new ticket",
316 "%s/tktnew", g.zTop);
317 }
@@ -581,11 +583,11 @@
581 return 0;
582 }
583
584 /*
585 ** WEBPAGE: tkttimeline
586 ** URL: /tkttimeline?name=TICKETUUID
587 **
588 ** Show the change history for a single ticket in timeline format.
589 */
590 void tkttimeline_page(void){
591 Stmt q;
@@ -593,19 +595,32 @@
593 char *zSQL;
594 const char *zUuid;
595 char *zFullUuid;
596 int tagid;
597 char zGlobPattern[50];
 
598
599 login_check_credentials();
600 if( !g.okHistory || !g.okRdTkt ){ login_needed(); return; }
601 zUuid = PD("name","");
 
 
 
 
 
 
 
 
602 style_submenu_element("History", "History",
603 "%s/tkthistory/%s", g.zTop, zUuid);
604 style_submenu_element("Status", "Status",
605 "%s/info/%s", g.zTop, zUuid);
606 zTitle = mprintf("Timeline Of Ticket %h", zUuid);
 
 
 
 
607 style_header(zTitle);
608 free(zTitle);
609
610 sqlite3_snprintf(6, zGlobPattern, "%s", zUuid);
611 canonical16(zGlobPattern, strlen(zGlobPattern));
@@ -615,16 +630,28 @@
615 style_footer();
616 return;
617 }
618 zFullUuid = db_text(0, "SELECT substr(tagname, 5) FROM tag WHERE tagid=%d",
619 tagid);
620 zSQL = mprintf("%s AND event.objid IN "
621 " (SELECT rid FROM tagxref WHERE tagid=%d UNION"
622 " SELECT srcid FROM backlink WHERE target GLOB '%.4s*' "
623 "AND '%s' GLOB (target||'*')) "
624 "ORDER BY mtime DESC",
625 timeline_query_for_www(), tagid, zFullUuid, zFullUuid);
 
 
 
 
 
 
 
 
 
 
 
 
626 db_prepare(&q, zSQL);
627 free(zSQL);
628 www_print_timeline(&q, TIMELINE_ARTID, 0);
629 db_finalize(&q);
630 style_footer();
@@ -646,10 +673,12 @@
646 if( !g.okHistory || !g.okRdTkt ){ login_needed(); return; }
647 zUuid = PD("name","");
648 zTitle = mprintf("History Of Ticket %h", zUuid);
649 style_submenu_element("Status", "Status",
650 "%s/info/%s", g.zTop, zUuid);
 
 
651 style_submenu_element("Timeline", "Timeline",
652 "%s/tkttimeline?name=%s", g.zTop, zUuid);
653 style_header(zTitle);
654 free(zTitle);
655
656
--- src/tkt.c
+++ src/tkt.c
@@ -308,10 +308,12 @@
308 const char *zUuid = PD("name","");
309 style_submenu_element("History", "History Of This Ticket",
310 "%s/tkthistory/%T", g.zTop, zUuid);
311 style_submenu_element("Timeline", "Timeline Of This Ticket",
312 "%s/tkttimeline/%T", g.zTop, zUuid);
313 style_submenu_element("Check-ins", "Check-ins Of This Ticket",
314 "%s/tkttimeline/%T?y=ci", g.zTop, zUuid);
315 }
316 if( g.okNewTkt ){
317 style_submenu_element("New Ticket", "Create a new ticket",
318 "%s/tktnew", g.zTop);
319 }
@@ -581,11 +583,11 @@
583 return 0;
584 }
585
586 /*
587 ** WEBPAGE: tkttimeline
588 ** URL: /tkttimeline?name=TICKETUUID&y=TYPE
589 **
590 ** Show the change history for a single ticket in timeline format.
591 */
592 void tkttimeline_page(void){
593 Stmt q;
@@ -593,19 +595,32 @@
595 char *zSQL;
596 const char *zUuid;
597 char *zFullUuid;
598 int tagid;
599 char zGlobPattern[50];
600 const char *zType;
601
602 login_check_credentials();
603 if( !g.okHistory || !g.okRdTkt ){ login_needed(); return; }
604 zUuid = PD("name","");
605 zType = PD("y","a");
606 if( zType[0]!='c' ){
607 style_submenu_element("Check-ins", "Check-ins",
608 "%s/tkttimeline?name=%T&y=ci", g.zTop, zUuid);
609 }else{
610 style_submenu_element("Timeline", "Timeline",
611 "%s/tkttimeline?name=%T", g.zTop, zUuid);
612 }
613 style_submenu_element("History", "History",
614 "%s/tkthistory/%s", g.zTop, zUuid);
615 style_submenu_element("Status", "Status",
616 "%s/info/%s", g.zTop, zUuid);
617 if( zType[0]=='c' ){
618 zTitle = mprintf("Check-Ins Associated With Ticket %h", zUuid);
619 }else{
620 zTitle = mprintf("Timeline Of Ticket %h", zUuid);
621 }
622 style_header(zTitle);
623 free(zTitle);
624
625 sqlite3_snprintf(6, zGlobPattern, "%s", zUuid);
626 canonical16(zGlobPattern, strlen(zGlobPattern));
@@ -615,16 +630,28 @@
630 style_footer();
631 return;
632 }
633 zFullUuid = db_text(0, "SELECT substr(tagname, 5) FROM tag WHERE tagid=%d",
634 tagid);
635 if( zType[0]=='c' ){
636 zSQL = mprintf(
637 "%s AND event.objid IN "
638 " (SELECT srcid FROM backlink WHERE target GLOB '%.4s*' "
639 "AND '%s' GLOB (target||'*')) "
640 "ORDER BY mtime DESC",
641 timeline_query_for_www(), zFullUuid, zFullUuid
642 );
643 }else{
644 zSQL = mprintf(
645 "%s AND event.objid IN "
646 " (SELECT rid FROM tagxref WHERE tagid=%d UNION"
647 " SELECT srcid FROM backlink WHERE target GLOB '%.4s*' "
648 "AND '%s' GLOB (target||'*')) "
649 "ORDER BY mtime DESC",
650 timeline_query_for_www(), tagid, zFullUuid, zFullUuid
651 );
652 }
653 db_prepare(&q, zSQL);
654 free(zSQL);
655 www_print_timeline(&q, TIMELINE_ARTID, 0);
656 db_finalize(&q);
657 style_footer();
@@ -646,10 +673,12 @@
673 if( !g.okHistory || !g.okRdTkt ){ login_needed(); return; }
674 zUuid = PD("name","");
675 zTitle = mprintf("History Of Ticket %h", zUuid);
676 style_submenu_element("Status", "Status",
677 "%s/info/%s", g.zTop, zUuid);
678 style_submenu_element("Check-ins", "Check-ins",
679 "%s/tkttimeline?name=%s?y=ci", g.zTop, zUuid);
680 style_submenu_element("Timeline", "Timeline",
681 "%s/tkttimeline?name=%s", g.zTop, zUuid);
682 style_header(zTitle);
683 free(zTitle);
684
685

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button