Fossil SCM
Added a 's' parameter to the web timeline view. This will search the comment and brief fields for the given text via LIKE '%value%'.
Commit
1e2ec3ff8746f9fdfb98557d6d1ee1ff15565335
Parent
97789f0a928d11a…
1 file changed
+7
+7
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -417,10 +417,11 @@ | ||
| 417 | 417 | ** p=RID artifact RID and up to COUNT parents and ancestors |
| 418 | 418 | ** d=RID artifact RID and up to COUNT descendants |
| 419 | 419 | ** t=TAGID show only check-ins with the given tagid |
| 420 | 420 | ** u=USER only if belonging to this user |
| 421 | 421 | ** y=TYPE 'ci', 'w', 't' |
| 422 | +** s=TEXT string search (comment and brief) | |
| 422 | 423 | ** |
| 423 | 424 | ** p= and d= can appear individually or together. If either p= or d= |
| 424 | 425 | ** appear, then u=, y=, a=, and b= are ignored. |
| 425 | 426 | ** |
| 426 | 427 | ** If a= and b= appear, only a= is used. If neither appear, the most |
| @@ -439,10 +440,11 @@ | ||
| 439 | 440 | const char *zType = PD("y","all"); /* Type of events. All if NULL */ |
| 440 | 441 | const char *zAfter = P("a"); /* Events after this time */ |
| 441 | 442 | const char *zBefore = P("b"); /* Events before this time */ |
| 442 | 443 | const char *zCirca = P("c"); /* Events near this time */ |
| 443 | 444 | const char *zTagName = P("t"); /* Show events with this tag */ |
| 445 | + const char *zString = P("s"); /* String text search of comment and brief */ | |
| 444 | 446 | HQuery url; /* URL for various branch links */ |
| 445 | 447 | int tagid; /* Tag ID */ |
| 446 | 448 | int tmFlags; /* Timeline flags */ |
| 447 | 449 | |
| 448 | 450 | /* To view the timeline, must have permission to read project data. |
| @@ -544,10 +546,15 @@ | ||
| 544 | 546 | } |
| 545 | 547 | if( zUser ){ |
| 546 | 548 | blob_appendf(&sql, " AND event.user=%Q", zUser); |
| 547 | 549 | url_add_parameter(&url, "u", zUser); |
| 548 | 550 | } |
| 551 | + if ( zString ){ | |
| 552 | + blob_appendf(&sql, " AND (event.comment LIKE '%%%q%%' OR event.brief LIKE '%%%q%%')", | |
| 553 | + zString, zString); | |
| 554 | + url_add_parameter(&url, "s", zString); | |
| 555 | + } | |
| 549 | 556 | if( zAfter ){ |
| 550 | 557 | while( isspace(zAfter[0]) ){ zAfter++; } |
| 551 | 558 | if( zAfter[0] ){ |
| 552 | 559 | blob_appendf(&sql, |
| 553 | 560 | " AND event.mtime>=(SELECT julianday(%Q, 'utc'))" |
| 554 | 561 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -417,10 +417,11 @@ | |
| 417 | ** p=RID artifact RID and up to COUNT parents and ancestors |
| 418 | ** d=RID artifact RID and up to COUNT descendants |
| 419 | ** t=TAGID show only check-ins with the given tagid |
| 420 | ** u=USER only if belonging to this user |
| 421 | ** y=TYPE 'ci', 'w', 't' |
| 422 | ** |
| 423 | ** p= and d= can appear individually or together. If either p= or d= |
| 424 | ** appear, then u=, y=, a=, and b= are ignored. |
| 425 | ** |
| 426 | ** If a= and b= appear, only a= is used. If neither appear, the most |
| @@ -439,10 +440,11 @@ | |
| 439 | const char *zType = PD("y","all"); /* Type of events. All if NULL */ |
| 440 | const char *zAfter = P("a"); /* Events after this time */ |
| 441 | const char *zBefore = P("b"); /* Events before this time */ |
| 442 | const char *zCirca = P("c"); /* Events near this time */ |
| 443 | const char *zTagName = P("t"); /* Show events with this tag */ |
| 444 | HQuery url; /* URL for various branch links */ |
| 445 | int tagid; /* Tag ID */ |
| 446 | int tmFlags; /* Timeline flags */ |
| 447 | |
| 448 | /* To view the timeline, must have permission to read project data. |
| @@ -544,10 +546,15 @@ | |
| 544 | } |
| 545 | if( zUser ){ |
| 546 | blob_appendf(&sql, " AND event.user=%Q", zUser); |
| 547 | url_add_parameter(&url, "u", zUser); |
| 548 | } |
| 549 | if( zAfter ){ |
| 550 | while( isspace(zAfter[0]) ){ zAfter++; } |
| 551 | if( zAfter[0] ){ |
| 552 | blob_appendf(&sql, |
| 553 | " AND event.mtime>=(SELECT julianday(%Q, 'utc'))" |
| 554 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -417,10 +417,11 @@ | |
| 417 | ** p=RID artifact RID and up to COUNT parents and ancestors |
| 418 | ** d=RID artifact RID and up to COUNT descendants |
| 419 | ** t=TAGID show only check-ins with the given tagid |
| 420 | ** u=USER only if belonging to this user |
| 421 | ** y=TYPE 'ci', 'w', 't' |
| 422 | ** s=TEXT string search (comment and brief) |
| 423 | ** |
| 424 | ** p= and d= can appear individually or together. If either p= or d= |
| 425 | ** appear, then u=, y=, a=, and b= are ignored. |
| 426 | ** |
| 427 | ** If a= and b= appear, only a= is used. If neither appear, the most |
| @@ -439,10 +440,11 @@ | |
| 440 | const char *zType = PD("y","all"); /* Type of events. All if NULL */ |
| 441 | const char *zAfter = P("a"); /* Events after this time */ |
| 442 | const char *zBefore = P("b"); /* Events before this time */ |
| 443 | const char *zCirca = P("c"); /* Events near this time */ |
| 444 | const char *zTagName = P("t"); /* Show events with this tag */ |
| 445 | const char *zString = P("s"); /* String text search of comment and brief */ |
| 446 | HQuery url; /* URL for various branch links */ |
| 447 | int tagid; /* Tag ID */ |
| 448 | int tmFlags; /* Timeline flags */ |
| 449 | |
| 450 | /* To view the timeline, must have permission to read project data. |
| @@ -544,10 +546,15 @@ | |
| 546 | } |
| 547 | if( zUser ){ |
| 548 | blob_appendf(&sql, " AND event.user=%Q", zUser); |
| 549 | url_add_parameter(&url, "u", zUser); |
| 550 | } |
| 551 | if ( zString ){ |
| 552 | blob_appendf(&sql, " AND (event.comment LIKE '%%%q%%' OR event.brief LIKE '%%%q%%')", |
| 553 | zString, zString); |
| 554 | url_add_parameter(&url, "s", zString); |
| 555 | } |
| 556 | if( zAfter ){ |
| 557 | while( isspace(zAfter[0]) ){ zAfter++; } |
| 558 | if( zAfter[0] ){ |
| 559 | blob_appendf(&sql, |
| 560 | " AND event.mtime>=(SELECT julianday(%Q, 'utc'))" |
| 561 |