Fossil SCM

added some docs, removed an unused var, fixed formatting snafu caused by xemacs' confusion regarding the @ bits.

stephan 2013-07-15 22:45 UTC stats-report-weekly
Commit c43c3a7fd272ab9b6a8fb3003f2f3a867591022b
1 file changed +12 -8
+12 -8
--- src/timeline.c
+++ src/timeline.c
@@ -1829,13 +1829,16 @@
18291829
}
18301830
db_finalize(&q);
18311831
style_footer();
18321832
}
18331833
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
+*/
18351839
static void stats_report_output_week_links( char const * zTimeframe){
1836
- Blob sqlWeek = empty_blob;
18371840
Stmt stWeek = empty_Stmt;
18381841
db_prepare(&stWeek,
18391842
"SELECT DISTINCT strftime('%%W',mtime) AS wk, "
18401843
"count(*) AS n, "
18411844
"substr(date(mtime),1,%d) AS ym "
@@ -1842,17 +1845,18 @@
18421845
"FROM event "
18431846
"WHERE ym=%Q AND mtime < current_timestamp "
18441847
"GROUP BY wk ORDER BY wk",
18451848
strlen(zTimeframe),
18461849
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);
18531856
}
1857
+
18541858
/*
18551859
** Implements the "byyear" and "bymonth" reports for /stats_report.
18561860
** If includeMonth is true then it generates the "bymonth" report,
18571861
** else the "byyear" report. If zUserName is not NULL and not empty
18581862
** then the report is restricted to events created by the named user
18591863
--- 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

Keyboard Shortcuts

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