Check-in [dec1364848]
Not logged in

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

Overview
SHA1 Hash:dec136484819edfcb01c88a97270ed14009e1cf1
Date: 2010-03-15 20:54:12
User: drh
Comment:Add a new form of ticket timeline that shows only the check-ins associated with the ticket.
Tags And Properties
Changes

Changes to src/tkt.c

Old (26c5d6f1c68ffa4c) New (999883ee1ca4b38a)
1 /* 1 /*
2 ** Copyright (c) 2007 D. Richard Hipp 2 ** Copyright (c) 2007 D. Richard Hipp
3 ** 3 **
4 ** This program is free software; you can redistribute it and/or 4 ** This program is free software; you can redistribute it and/or
5 ** modify it under the terms of the GNU General Public 5 ** modify it under the terms of the GNU General Public
302 hidden lines
308 const char *zUuid = PD("name",""); 308 const char *zUuid = PD("name","");
309 style_submenu_element("History", "History Of This Ticket", 309 style_submenu_element("History", "History Of This Ticket",
310 "%s/tkthistory/%T", g.zTop, zUuid); 310 "%s/tkthistory/%T", g.zTop, zUuid);
311 style_submenu_element("Timeline", "Timeline Of This Ticket", 311 style_submenu_element("Timeline", "Timeline Of This Ticket",
312 "%s/tkttimeline/%T", g.zTop, zUuid); 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);
313 } 315 }
314 if( g.okNewTkt ){ 316 if( g.okNewTkt ){
315 style_submenu_element("New Ticket", "Create a new ticket", 317 style_submenu_element("New Ticket", "Create a new ticket",
316 "%s/tktnew", g.zTop); 318 "%s/tktnew", g.zTop);
317 } 319 }
263 hidden lines
581 return 0; 583 return 0;
582 } 584 }
583 585
584 /* 586 /*
585 ** WEBPAGE: tkttimeline 587 ** WEBPAGE: tkttimeline
586 ** URL: /tkttimeline?name=TICKETUUID | 588 ** URL: /tkttimeline?name=TICKETUUID&y=TYPE
587 ** 589 **
588 ** Show the change history for a single ticket in timeline format. 590 ** Show the change history for a single ticket in timeline format.
589 */ 591 */
590 void tkttimeline_page(void){ 592 void tkttimeline_page(void){
591 Stmt q; 593 Stmt q;
593 char *zSQL; 595 char *zSQL;
594 const char *zUuid; 596 const char *zUuid;
595 char *zFullUuid; 597 char *zFullUuid;
596 int tagid; 598 int tagid;
597 char zGlobPattern[50]; 599 char zGlobPattern[50];
> 600 const char *zType;
598 601
599 login_check_credentials(); 602 login_check_credentials();
600 if( !g.okHistory || !g.okRdTkt ){ login_needed(); return; } 603 if( !g.okHistory || !g.okRdTkt ){ login_needed(); return; }
601 zUuid = PD("name",""); 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 }
602 style_submenu_element("History", "History", 613 style_submenu_element("History", "History",
603 "%s/tkthistory/%s", g.zTop, zUuid); 614 "%s/tkthistory/%s", g.zTop, zUuid);
604 style_submenu_element("Status", "Status", 615 style_submenu_element("Status", "Status",
605 "%s/info/%s", g.zTop, zUuid); 616 "%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 }
607 style_header(zTitle); 622 style_header(zTitle);
608 free(zTitle); 623 free(zTitle);
609 624
610 sqlite3_snprintf(6, zGlobPattern, "%s", zUuid); 625 sqlite3_snprintf(6, zGlobPattern, "%s", zUuid);
611 canonical16(zGlobPattern, strlen(zGlobPattern)); 626 canonical16(zGlobPattern, strlen(zGlobPattern));
3 hidden lines
615 style_footer(); 630 style_footer();
616 return; 631 return;
617 } 632 }
618 zFullUuid = db_text(0, "SELECT substr(tagname, 5) FROM tag WHERE tagid=%d", 633 zFullUuid = db_text(0, "SELECT substr(tagname, 5) FROM tag WHERE tagid=%d",
619 tagid); 634 tagid);
620 zSQL = mprintf("%s AND event.objid IN " | 635 if( zType[0]=='c' ){
621 " (SELECT rid FROM tagxref WHERE tagid=%d UNION" | 636 zSQL = mprintf(
622 " SELECT srcid FROM backlink WHERE target GLOB '%.4s*' " | 637 "%s AND event.objid IN "
623 "AND '%s' GLOB (target||'*')) " | 638 " (SELECT srcid FROM backlink WHERE target GLOB '%.4s*' "
624 "ORDER BY mtime DESC", | 639 "AND '%s' GLOB (target||'*')) "
625 timeline_query_for_www(), tagid, zFullUuid, zFullUuid); | 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 }
626 db_prepare(&q, zSQL); 653 db_prepare(&q, zSQL);
627 free(zSQL); 654 free(zSQL);
628 www_print_timeline(&q, TIMELINE_ARTID, 0); 655 www_print_timeline(&q, TIMELINE_ARTID, 0);
629 db_finalize(&q); 656 db_finalize(&q);
630 style_footer(); 657 style_footer();
15 hidden lines
646 if( !g.okHistory || !g.okRdTkt ){ login_needed(); return; } 673 if( !g.okHistory || !g.okRdTkt ){ login_needed(); return; }
647 zUuid = PD("name",""); 674 zUuid = PD("name","");
648 zTitle = mprintf("History Of Ticket %h", zUuid); 675 zTitle = mprintf("History Of Ticket %h", zUuid);
649 style_submenu_element("Status", "Status", 676 style_submenu_element("Status", "Status",
650 "%s/info/%s", g.zTop, zUuid); 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);
651 style_submenu_element("Timeline", "Timeline", 680 style_submenu_element("Timeline", "Timeline",
652 "%s/tkttimeline?name=%s", g.zTop, zUuid); 681 "%s/tkttimeline?name=%s", g.zTop, zUuid);
653 style_header(zTitle); 682 style_header(zTitle);
654 free(zTitle); 683 free(zTitle);
655 684
73 hidden lines
729 } 758 }
730 blob_reset(&val); 759 blob_reset(&val);
731 } 760 }
732 @ </ol> 761 @ </ol>
733 } 762 }