Fossil SCM
added some docs, removed an unused var, fixed formatting snafu caused by xemacs' confusion regarding the @ bits.
Commit
c43c3a7fd272ab9b6a8fb3003f2f3a867591022b
Parent
37c4fb2249997c1…
1 file changed
+12
-8
+12
-8
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1829,13 +1829,16 @@ | ||
| 1829 | 1829 | } |
| 1830 | 1830 | db_finalize(&q); |
| 1831 | 1831 | style_footer(); |
| 1832 | 1832 | } |
| 1833 | 1833 | |
| 1834 | - | |
| 1834 | +/* | |
| 1835 | +** Helper for stats_report_by_month_year(), which generates a list of | |
| 1836 | +** week numbers. zTimeframe should be either a timeframe in the form YYYY | |
| 1837 | +** or YYYY-MM. | |
| 1838 | +*/ | |
| 1835 | 1839 | static void stats_report_output_week_links( char const * zTimeframe){ |
| 1836 | - Blob sqlWeek = empty_blob; | |
| 1837 | 1840 | Stmt stWeek = empty_Stmt; |
| 1838 | 1841 | db_prepare(&stWeek, |
| 1839 | 1842 | "SELECT DISTINCT strftime('%%W',mtime) AS wk, " |
| 1840 | 1843 | "count(*) AS n, " |
| 1841 | 1844 | "substr(date(mtime),1,%d) AS ym " |
| @@ -1842,17 +1845,18 @@ | ||
| 1842 | 1845 | "FROM event " |
| 1843 | 1846 | "WHERE ym=%Q AND mtime < current_timestamp " |
| 1844 | 1847 | "GROUP BY wk ORDER BY wk", |
| 1845 | 1848 | strlen(zTimeframe), |
| 1846 | 1849 | zTimeframe); |
| 1847 | - while( SQLITE_ROW == db_step(&stWeek) ){ | |
| 1848 | - zTimeframe = db_column_text(&stWeek,0); | |
| 1849 | - @ %s(zTimeframe) | |
| 1850 | - } | |
| 1851 | - db_finalize(&stWeek); | |
| 1852 | - | |
| 1850 | + while( SQLITE_ROW == db_step(&stWeek) ){ | |
| 1851 | + zTimeframe = db_column_text(&stWeek,0); | |
| 1852 | + /* TODO: link to... what? Maybe add /timeline?yw=YYYY-WW (week #)? */ | |
| 1853 | + @ %s(zTimeframe) | |
| 1854 | + } | |
| 1855 | + db_finalize(&stWeek); | |
| 1853 | 1856 | } |
| 1857 | + | |
| 1854 | 1858 | /* |
| 1855 | 1859 | ** Implements the "byyear" and "bymonth" reports for /stats_report. |
| 1856 | 1860 | ** If includeMonth is true then it generates the "bymonth" report, |
| 1857 | 1861 | ** else the "byyear" report. If zUserName is not NULL and not empty |
| 1858 | 1862 | ** then the report is restricted to events created by the named user |
| 1859 | 1863 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1829,13 +1829,16 @@ | |
| 1829 | } |
| 1830 | db_finalize(&q); |
| 1831 | style_footer(); |
| 1832 | } |
| 1833 | |
| 1834 | |
| 1835 | static void stats_report_output_week_links( char const * zTimeframe){ |
| 1836 | Blob sqlWeek = empty_blob; |
| 1837 | Stmt stWeek = empty_Stmt; |
| 1838 | db_prepare(&stWeek, |
| 1839 | "SELECT DISTINCT strftime('%%W',mtime) AS wk, " |
| 1840 | "count(*) AS n, " |
| 1841 | "substr(date(mtime),1,%d) AS ym " |
| @@ -1842,17 +1845,18 @@ | |
| 1842 | "FROM event " |
| 1843 | "WHERE ym=%Q AND mtime < current_timestamp " |
| 1844 | "GROUP BY wk ORDER BY wk", |
| 1845 | strlen(zTimeframe), |
| 1846 | zTimeframe); |
| 1847 | while( SQLITE_ROW == db_step(&stWeek) ){ |
| 1848 | zTimeframe = db_column_text(&stWeek,0); |
| 1849 | @ %s(zTimeframe) |
| 1850 | } |
| 1851 | db_finalize(&stWeek); |
| 1852 | |
| 1853 | } |
| 1854 | /* |
| 1855 | ** Implements the "byyear" and "bymonth" reports for /stats_report. |
| 1856 | ** If includeMonth is true then it generates the "bymonth" report, |
| 1857 | ** else the "byyear" report. If zUserName is not NULL and not empty |
| 1858 | ** then the report is restricted to events created by the named user |
| 1859 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1829,13 +1829,16 @@ | |
| 1829 | } |
| 1830 | db_finalize(&q); |
| 1831 | style_footer(); |
| 1832 | } |
| 1833 | |
| 1834 | /* |
| 1835 | ** Helper for stats_report_by_month_year(), which generates a list of |
| 1836 | ** week numbers. zTimeframe should be either a timeframe in the form YYYY |
| 1837 | ** or YYYY-MM. |
| 1838 | */ |
| 1839 | static void stats_report_output_week_links( char const * zTimeframe){ |
| 1840 | Stmt stWeek = empty_Stmt; |
| 1841 | db_prepare(&stWeek, |
| 1842 | "SELECT DISTINCT strftime('%%W',mtime) AS wk, " |
| 1843 | "count(*) AS n, " |
| 1844 | "substr(date(mtime),1,%d) AS ym " |
| @@ -1842,17 +1845,18 @@ | |
| 1845 | "FROM event " |
| 1846 | "WHERE ym=%Q AND mtime < current_timestamp " |
| 1847 | "GROUP BY wk ORDER BY wk", |
| 1848 | strlen(zTimeframe), |
| 1849 | zTimeframe); |
| 1850 | while( SQLITE_ROW == db_step(&stWeek) ){ |
| 1851 | zTimeframe = db_column_text(&stWeek,0); |
| 1852 | /* TODO: link to... what? Maybe add /timeline?yw=YYYY-WW (week #)? */ |
| 1853 | @ %s(zTimeframe) |
| 1854 | } |
| 1855 | db_finalize(&stWeek); |
| 1856 | } |
| 1857 | |
| 1858 | /* |
| 1859 | ** Implements the "byyear" and "bymonth" reports for /stats_report. |
| 1860 | ** If includeMonth is true then it generates the "bymonth" report, |
| 1861 | ** else the "byyear" report. If zUserName is not NULL and not empty |
| 1862 | ** then the report is restricted to events created by the named user |
| 1863 |