Fossil

Check-in [c43c3a7fd2]
Login

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

Overview
Comment:added some docs, removed an unused var, fixed formatting snafu caused by xemacs' confusion regarding the @ bits.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | stats-report-weekly
Files: files | file ages | folders
SHA1: c43c3a7fd272ab9b6a8fb3003f2f3a867591022b
User & Date: stephan 2013-07-15 22:45:19.180
Context
2013-07-16
15:49
Added /timeline?yw=YYYY-WW (year/week-of-year). Added links to /stats_report. Disabled year/week links for the year/month view because the current approach is way too slow. ... (check-in: 0019550a03 user: stephan tags: stats-report-weekly)
2013-07-15
22:45
added some docs, removed an unused var, fixed formatting snafu caused by xemacs' confusion regarding the @ bits. ... (check-in: c43c3a7fd2 user: stephan tags: stats-report-weekly)
22:41
More work on the by-week report, but it is (A) way too slow for the by year/month view (4.5 sec on my machine) and (B) bed time again. ... (check-in: 37c4fb2249 user: stephan tags: stats-report-weekly)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/timeline.c.
1827
1828
1829
1830
1831
1832
1833
1834




1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848

1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
    @ <li>
    @ <a href="%s(g.zTop)/timeline?p=%S(zUuid)&amp;d=%S(zUuid)">%S(zUuid)</a>
  }
  db_finalize(&q);
  style_footer();
}






static void stats_report_output_week_links( char const * zTimeframe){
  Blob sqlWeek = empty_blob;
  Stmt stWeek = empty_Stmt;
  db_prepare(&stWeek,
             "SELECT DISTINCT strftime('%%W',mtime) AS wk, "
             "count(*) AS n, "
             "substr(date(mtime),1,%d) AS ym "
             "FROM event "
             "WHERE ym=%Q AND mtime < current_timestamp "
             "GROUP BY wk ORDER BY wk",
             strlen(zTimeframe),
             zTimeframe);
      while( SQLITE_ROW == db_step(&stWeek) ){
        zTimeframe = db_column_text(&stWeek,0);

        @ %s(zTimeframe)
      }
      db_finalize(&stWeek);

}
/*
** Implements the "byyear" and "bymonth" reports for /stats_report.
** If includeMonth is true then it generates the "bymonth" report,
** else the "byyear" report. If zUserName is not NULL and not empty
** then the report is restricted to events created by the named user
** account.
*/







|
>
>
>
>

<










|
|
>
|
|
|
|
|







1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839

1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
    @ <li>
    @ <a href="%s(g.zTop)/timeline?p=%S(zUuid)&amp;d=%S(zUuid)">%S(zUuid)</a>
  }
  db_finalize(&q);
  style_footer();
}

/*
** Helper for stats_report_by_month_year(), which generates a list of
** week numbers. zTimeframe should be either a timeframe in the form YYYY
** or YYYY-MM.
*/
static void stats_report_output_week_links( char const * zTimeframe){

  Stmt stWeek = empty_Stmt;
  db_prepare(&stWeek,
             "SELECT DISTINCT strftime('%%W',mtime) AS wk, "
             "count(*) AS n, "
             "substr(date(mtime),1,%d) AS ym "
             "FROM event "
             "WHERE ym=%Q AND mtime < current_timestamp "
             "GROUP BY wk ORDER BY wk",
             strlen(zTimeframe),
             zTimeframe);
  while( SQLITE_ROW == db_step(&stWeek) ){
    zTimeframe = db_column_text(&stWeek,0);
    /* TODO: link to... what? Maybe add /timeline?yw=YYYY-WW (week #)? */
    @ %s(zTimeframe)
  }
  db_finalize(&stWeek);
}

/*
** Implements the "byyear" and "bymonth" reports for /stats_report.
** If includeMonth is true then it generates the "bymonth" report,
** else the "byyear" report. If zUserName is not NULL and not empty
** then the report is restricted to events created by the named user
** account.
*/