Fossil SCM
Permit --notfound and --repolist to be used together on "fossil server". Merge changes to always show a piechart for "By User" reports. Fix an uninitialized variable in "fossil rebuild".
Commit
434f7e17d91233a03b73c9aec19205a3655196b8
Parent
975600dd599fff8…
4 files changed
+3
-3
+3
-3
+23
-11
+23
-11
+3
-3
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1563,16 +1563,16 @@ | ||
| 1563 | 1563 | zRepo[j] = '.'; |
| 1564 | 1564 | } |
| 1565 | 1565 | |
| 1566 | 1566 | if( szFile<1024 ){ |
| 1567 | 1567 | set_base_url(0); |
| 1568 | - if( zNotFound ){ | |
| 1569 | - cgi_redirect(zNotFound); | |
| 1570 | - }else if( strcmp(zPathInfo,"/")==0 | |
| 1568 | + if( strcmp(zPathInfo,"/")==0 | |
| 1571 | 1569 | && allowRepoList |
| 1572 | 1570 | && repo_list_page() ){ |
| 1573 | 1571 | /* Will return a list of repositories */ |
| 1572 | + }else if( zNotFound ){ | |
| 1573 | + cgi_redirect(zNotFound); | |
| 1574 | 1574 | }else{ |
| 1575 | 1575 | #ifdef FOSSIL_ENABLE_JSON |
| 1576 | 1576 | if(g.json.isJsonMode){ |
| 1577 | 1577 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1); |
| 1578 | 1578 | return; |
| 1579 | 1579 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1563,16 +1563,16 @@ | |
| 1563 | zRepo[j] = '.'; |
| 1564 | } |
| 1565 | |
| 1566 | if( szFile<1024 ){ |
| 1567 | set_base_url(0); |
| 1568 | if( zNotFound ){ |
| 1569 | cgi_redirect(zNotFound); |
| 1570 | }else if( strcmp(zPathInfo,"/")==0 |
| 1571 | && allowRepoList |
| 1572 | && repo_list_page() ){ |
| 1573 | /* Will return a list of repositories */ |
| 1574 | }else{ |
| 1575 | #ifdef FOSSIL_ENABLE_JSON |
| 1576 | if(g.json.isJsonMode){ |
| 1577 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1); |
| 1578 | return; |
| 1579 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1563,16 +1563,16 @@ | |
| 1563 | zRepo[j] = '.'; |
| 1564 | } |
| 1565 | |
| 1566 | if( szFile<1024 ){ |
| 1567 | set_base_url(0); |
| 1568 | if( strcmp(zPathInfo,"/")==0 |
| 1569 | && allowRepoList |
| 1570 | && repo_list_page() ){ |
| 1571 | /* Will return a list of repositories */ |
| 1572 | }else if( zNotFound ){ |
| 1573 | cgi_redirect(zNotFound); |
| 1574 | }else{ |
| 1575 | #ifdef FOSSIL_ENABLE_JSON |
| 1576 | if(g.json.isJsonMode){ |
| 1577 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1); |
| 1578 | return; |
| 1579 |
+3
-3
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1563,16 +1563,16 @@ | ||
| 1563 | 1563 | zRepo[j] = '.'; |
| 1564 | 1564 | } |
| 1565 | 1565 | |
| 1566 | 1566 | if( szFile<1024 ){ |
| 1567 | 1567 | set_base_url(0); |
| 1568 | - if( zNotFound ){ | |
| 1569 | - cgi_redirect(zNotFound); | |
| 1570 | - }else if( strcmp(zPathInfo,"/")==0 | |
| 1568 | + if( strcmp(zPathInfo,"/")==0 | |
| 1571 | 1569 | && allowRepoList |
| 1572 | 1570 | && repo_list_page() ){ |
| 1573 | 1571 | /* Will return a list of repositories */ |
| 1572 | + }else if( zNotFound ){ | |
| 1573 | + cgi_redirect(zNotFound); | |
| 1574 | 1574 | }else{ |
| 1575 | 1575 | #ifdef FOSSIL_ENABLE_JSON |
| 1576 | 1576 | if(g.json.isJsonMode){ |
| 1577 | 1577 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1); |
| 1578 | 1578 | return; |
| 1579 | 1579 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1563,16 +1563,16 @@ | |
| 1563 | zRepo[j] = '.'; |
| 1564 | } |
| 1565 | |
| 1566 | if( szFile<1024 ){ |
| 1567 | set_base_url(0); |
| 1568 | if( zNotFound ){ |
| 1569 | cgi_redirect(zNotFound); |
| 1570 | }else if( strcmp(zPathInfo,"/")==0 |
| 1571 | && allowRepoList |
| 1572 | && repo_list_page() ){ |
| 1573 | /* Will return a list of repositories */ |
| 1574 | }else{ |
| 1575 | #ifdef FOSSIL_ENABLE_JSON |
| 1576 | if(g.json.isJsonMode){ |
| 1577 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1); |
| 1578 | return; |
| 1579 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1563,16 +1563,16 @@ | |
| 1563 | zRepo[j] = '.'; |
| 1564 | } |
| 1565 | |
| 1566 | if( szFile<1024 ){ |
| 1567 | set_base_url(0); |
| 1568 | if( strcmp(zPathInfo,"/")==0 |
| 1569 | && allowRepoList |
| 1570 | && repo_list_page() ){ |
| 1571 | /* Will return a list of repositories */ |
| 1572 | }else if( zNotFound ){ |
| 1573 | cgi_redirect(zNotFound); |
| 1574 | }else{ |
| 1575 | #ifdef FOSSIL_ENABLE_JSON |
| 1576 | if(g.json.isJsonMode){ |
| 1577 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1); |
| 1578 | return; |
| 1579 |
+23
-11
| --- src/statrep.c | ||
| +++ src/statrep.c | ||
| @@ -406,20 +406,19 @@ | ||
| 406 | 406 | all rows. */ |
| 407 | 407 | stats_report_init_view(); |
| 408 | 408 | stats_report_event_types_menu("byuser", NULL); |
| 409 | 409 | @ <h1>Timeline Events |
| 410 | 410 | @ (%s(stats_report_label_for_type())) by User</h1> |
| 411 | - if( PB("pie") ){ | |
| 412 | - db_multi_exec( | |
| 413 | - "CREATE TEMP TABLE piechart(amt,label);" | |
| 414 | - "INSERT INTO piechart SELECT count(*), user FROM v_reports" | |
| 415 | - " GROUP BY user ORDER BY count(*) DESC;" | |
| 416 | - ); | |
| 417 | - @ <svg width=800 height=600> | |
| 418 | - piechart_render(800, 600, PIE_OTHER); | |
| 419 | - @ </svg> | |
| 420 | - return; | |
| 411 | + db_multi_exec( | |
| 412 | + "CREATE TEMP TABLE piechart(amt,label);" | |
| 413 | + "INSERT INTO piechart SELECT count(*), user FROM v_reports" | |
| 414 | + " GROUP BY user ORDER BY count(*) DESC;" | |
| 415 | + ); | |
| 416 | + if( db_int(0, "SELECT count(*) FROM piechart")>=2 ){ | |
| 417 | + @ <center><svg width=700 height=400> | |
| 418 | + piechart_render(700, 400, PIE_OTHER|PIE_PERCENT); | |
| 419 | + @ </svg></centre><hr/> | |
| 421 | 420 | } |
| 422 | 421 | @ <table class='statistics-report-table-events' border='0' |
| 423 | 422 | @ cellpadding='2' cellspacing='0' id='statsTable'> |
| 424 | 423 | @ <thead><tr> |
| 425 | 424 | @ <th>User</th> |
| @@ -479,11 +478,11 @@ | ||
| 479 | 478 | "CREATE TEMP TABLE statrep(filename, cnt);" |
| 480 | 479 | "INSERT INTO statrep(filename, cnt)" |
| 481 | 480 | " SELECT filename.name, count(distinct mlink.mid)" |
| 482 | 481 | " FROM filename, mlink" |
| 483 | 482 | " WHERE filename.fnid=mlink.fnid" |
| 484 | - " GROUP BY 1" | |
| 483 | + " GROUP BY 1;" | |
| 485 | 484 | ); |
| 486 | 485 | db_prepare(&query, |
| 487 | 486 | "SELECT filename, cnt FROM statrep ORDER BY cnt DESC, filename /*sort*/" |
| 488 | 487 | ); |
| 489 | 488 | mxEvent = db_int(1, "SELECT max(cnt) FROM statrep"); |
| @@ -539,10 +538,23 @@ | ||
| 539 | 538 | "COUNT(*) AS eventCount " |
| 540 | 539 | "FROM v_reports " |
| 541 | 540 | "GROUP BY dow ORDER BY dow"); |
| 542 | 541 | @ <h1>Timeline Events |
| 543 | 542 | @ (%s(stats_report_label_for_type())) by Day of the Week</h1> |
| 543 | + db_multi_exec( | |
| 544 | + "CREATE TEMP TABLE piechart(amt,label);" | |
| 545 | + "INSERT INTO piechart SELECT count(*), cast(mtime %% 7 AS INT) FROM v_reports" | |
| 546 | + " GROUP BY 2 ORDER BY 2;" | |
| 547 | + "UPDATE piechart SET label = CASE label WHEN 0 THEN 'Monday' WHEN 1 THEN 'Tuesday'" | |
| 548 | + " WHEN 2 THEN 'Wednesday' WHEN 3 THEN 'Thursday' WHEN 4 THEN 'Friday'" | |
| 549 | + " WHEN 5 THEN 'Saturday' ELSE 'Sunday' END;" | |
| 550 | + ); | |
| 551 | + if( db_int(0, "SELECT count(*) FROM piechart")>=2 ){ | |
| 552 | + @ <center><svg width=700 height=400> | |
| 553 | + piechart_render(700, 400, PIE_OTHER|PIE_PERCENT); | |
| 554 | + @ </svg></centre><hr/> | |
| 555 | + } | |
| 544 | 556 | @ <table class='statistics-report-table-events' border='0' |
| 545 | 557 | @ cellpadding='2' cellspacing='0' id='statsTable'> |
| 546 | 558 | @ <thead><tr> |
| 547 | 559 | @ <th>DoW</th> |
| 548 | 560 | @ <th>Day</th> |
| 549 | 561 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -406,20 +406,19 @@ | |
| 406 | all rows. */ |
| 407 | stats_report_init_view(); |
| 408 | stats_report_event_types_menu("byuser", NULL); |
| 409 | @ <h1>Timeline Events |
| 410 | @ (%s(stats_report_label_for_type())) by User</h1> |
| 411 | if( PB("pie") ){ |
| 412 | db_multi_exec( |
| 413 | "CREATE TEMP TABLE piechart(amt,label);" |
| 414 | "INSERT INTO piechart SELECT count(*), user FROM v_reports" |
| 415 | " GROUP BY user ORDER BY count(*) DESC;" |
| 416 | ); |
| 417 | @ <svg width=800 height=600> |
| 418 | piechart_render(800, 600, PIE_OTHER); |
| 419 | @ </svg> |
| 420 | return; |
| 421 | } |
| 422 | @ <table class='statistics-report-table-events' border='0' |
| 423 | @ cellpadding='2' cellspacing='0' id='statsTable'> |
| 424 | @ <thead><tr> |
| 425 | @ <th>User</th> |
| @@ -479,11 +478,11 @@ | |
| 479 | "CREATE TEMP TABLE statrep(filename, cnt);" |
| 480 | "INSERT INTO statrep(filename, cnt)" |
| 481 | " SELECT filename.name, count(distinct mlink.mid)" |
| 482 | " FROM filename, mlink" |
| 483 | " WHERE filename.fnid=mlink.fnid" |
| 484 | " GROUP BY 1" |
| 485 | ); |
| 486 | db_prepare(&query, |
| 487 | "SELECT filename, cnt FROM statrep ORDER BY cnt DESC, filename /*sort*/" |
| 488 | ); |
| 489 | mxEvent = db_int(1, "SELECT max(cnt) FROM statrep"); |
| @@ -539,10 +538,23 @@ | |
| 539 | "COUNT(*) AS eventCount " |
| 540 | "FROM v_reports " |
| 541 | "GROUP BY dow ORDER BY dow"); |
| 542 | @ <h1>Timeline Events |
| 543 | @ (%s(stats_report_label_for_type())) by Day of the Week</h1> |
| 544 | @ <table class='statistics-report-table-events' border='0' |
| 545 | @ cellpadding='2' cellspacing='0' id='statsTable'> |
| 546 | @ <thead><tr> |
| 547 | @ <th>DoW</th> |
| 548 | @ <th>Day</th> |
| 549 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -406,20 +406,19 @@ | |
| 406 | all rows. */ |
| 407 | stats_report_init_view(); |
| 408 | stats_report_event_types_menu("byuser", NULL); |
| 409 | @ <h1>Timeline Events |
| 410 | @ (%s(stats_report_label_for_type())) by User</h1> |
| 411 | db_multi_exec( |
| 412 | "CREATE TEMP TABLE piechart(amt,label);" |
| 413 | "INSERT INTO piechart SELECT count(*), user FROM v_reports" |
| 414 | " GROUP BY user ORDER BY count(*) DESC;" |
| 415 | ); |
| 416 | if( db_int(0, "SELECT count(*) FROM piechart")>=2 ){ |
| 417 | @ <center><svg width=700 height=400> |
| 418 | piechart_render(700, 400, PIE_OTHER|PIE_PERCENT); |
| 419 | @ </svg></centre><hr/> |
| 420 | } |
| 421 | @ <table class='statistics-report-table-events' border='0' |
| 422 | @ cellpadding='2' cellspacing='0' id='statsTable'> |
| 423 | @ <thead><tr> |
| 424 | @ <th>User</th> |
| @@ -479,11 +478,11 @@ | |
| 478 | "CREATE TEMP TABLE statrep(filename, cnt);" |
| 479 | "INSERT INTO statrep(filename, cnt)" |
| 480 | " SELECT filename.name, count(distinct mlink.mid)" |
| 481 | " FROM filename, mlink" |
| 482 | " WHERE filename.fnid=mlink.fnid" |
| 483 | " GROUP BY 1;" |
| 484 | ); |
| 485 | db_prepare(&query, |
| 486 | "SELECT filename, cnt FROM statrep ORDER BY cnt DESC, filename /*sort*/" |
| 487 | ); |
| 488 | mxEvent = db_int(1, "SELECT max(cnt) FROM statrep"); |
| @@ -539,10 +538,23 @@ | |
| 538 | "COUNT(*) AS eventCount " |
| 539 | "FROM v_reports " |
| 540 | "GROUP BY dow ORDER BY dow"); |
| 541 | @ <h1>Timeline Events |
| 542 | @ (%s(stats_report_label_for_type())) by Day of the Week</h1> |
| 543 | db_multi_exec( |
| 544 | "CREATE TEMP TABLE piechart(amt,label);" |
| 545 | "INSERT INTO piechart SELECT count(*), cast(mtime %% 7 AS INT) FROM v_reports" |
| 546 | " GROUP BY 2 ORDER BY 2;" |
| 547 | "UPDATE piechart SET label = CASE label WHEN 0 THEN 'Monday' WHEN 1 THEN 'Tuesday'" |
| 548 | " WHEN 2 THEN 'Wednesday' WHEN 3 THEN 'Thursday' WHEN 4 THEN 'Friday'" |
| 549 | " WHEN 5 THEN 'Saturday' ELSE 'Sunday' END;" |
| 550 | ); |
| 551 | if( db_int(0, "SELECT count(*) FROM piechart")>=2 ){ |
| 552 | @ <center><svg width=700 height=400> |
| 553 | piechart_render(700, 400, PIE_OTHER|PIE_PERCENT); |
| 554 | @ </svg></centre><hr/> |
| 555 | } |
| 556 | @ <table class='statistics-report-table-events' border='0' |
| 557 | @ cellpadding='2' cellspacing='0' id='statsTable'> |
| 558 | @ <thead><tr> |
| 559 | @ <th>DoW</th> |
| 560 | @ <th>Day</th> |
| 561 |
+23
-11
| --- src/statrep.c | ||
| +++ src/statrep.c | ||
| @@ -406,20 +406,19 @@ | ||
| 406 | 406 | all rows. */ |
| 407 | 407 | stats_report_init_view(); |
| 408 | 408 | stats_report_event_types_menu("byuser", NULL); |
| 409 | 409 | @ <h1>Timeline Events |
| 410 | 410 | @ (%s(stats_report_label_for_type())) by User</h1> |
| 411 | - if( PB("pie") ){ | |
| 412 | - db_multi_exec( | |
| 413 | - "CREATE TEMP TABLE piechart(amt,label);" | |
| 414 | - "INSERT INTO piechart SELECT count(*), user FROM v_reports" | |
| 415 | - " GROUP BY user ORDER BY count(*) DESC;" | |
| 416 | - ); | |
| 417 | - @ <svg width=800 height=600> | |
| 418 | - piechart_render(800, 600, PIE_OTHER); | |
| 419 | - @ </svg> | |
| 420 | - return; | |
| 411 | + db_multi_exec( | |
| 412 | + "CREATE TEMP TABLE piechart(amt,label);" | |
| 413 | + "INSERT INTO piechart SELECT count(*), user FROM v_reports" | |
| 414 | + " GROUP BY user ORDER BY count(*) DESC;" | |
| 415 | + ); | |
| 416 | + if( db_int(0, "SELECT count(*) FROM piechart")>=2 ){ | |
| 417 | + @ <center><svg width=700 height=400> | |
| 418 | + piechart_render(700, 400, PIE_OTHER|PIE_PERCENT); | |
| 419 | + @ </svg></centre><hr/> | |
| 421 | 420 | } |
| 422 | 421 | @ <table class='statistics-report-table-events' border='0' |
| 423 | 422 | @ cellpadding='2' cellspacing='0' id='statsTable'> |
| 424 | 423 | @ <thead><tr> |
| 425 | 424 | @ <th>User</th> |
| @@ -479,11 +478,11 @@ | ||
| 479 | 478 | "CREATE TEMP TABLE statrep(filename, cnt);" |
| 480 | 479 | "INSERT INTO statrep(filename, cnt)" |
| 481 | 480 | " SELECT filename.name, count(distinct mlink.mid)" |
| 482 | 481 | " FROM filename, mlink" |
| 483 | 482 | " WHERE filename.fnid=mlink.fnid" |
| 484 | - " GROUP BY 1" | |
| 483 | + " GROUP BY 1;" | |
| 485 | 484 | ); |
| 486 | 485 | db_prepare(&query, |
| 487 | 486 | "SELECT filename, cnt FROM statrep ORDER BY cnt DESC, filename /*sort*/" |
| 488 | 487 | ); |
| 489 | 488 | mxEvent = db_int(1, "SELECT max(cnt) FROM statrep"); |
| @@ -539,10 +538,23 @@ | ||
| 539 | 538 | "COUNT(*) AS eventCount " |
| 540 | 539 | "FROM v_reports " |
| 541 | 540 | "GROUP BY dow ORDER BY dow"); |
| 542 | 541 | @ <h1>Timeline Events |
| 543 | 542 | @ (%s(stats_report_label_for_type())) by Day of the Week</h1> |
| 543 | + db_multi_exec( | |
| 544 | + "CREATE TEMP TABLE piechart(amt,label);" | |
| 545 | + "INSERT INTO piechart SELECT count(*), cast(mtime %% 7 AS INT) FROM v_reports" | |
| 546 | + " GROUP BY 2 ORDER BY 2;" | |
| 547 | + "UPDATE piechart SET label = CASE label WHEN 0 THEN 'Monday' WHEN 1 THEN 'Tuesday'" | |
| 548 | + " WHEN 2 THEN 'Wednesday' WHEN 3 THEN 'Thursday' WHEN 4 THEN 'Friday'" | |
| 549 | + " WHEN 5 THEN 'Saturday' ELSE 'Sunday' END;" | |
| 550 | + ); | |
| 551 | + if( db_int(0, "SELECT count(*) FROM piechart")>=2 ){ | |
| 552 | + @ <center><svg width=700 height=400> | |
| 553 | + piechart_render(700, 400, PIE_OTHER|PIE_PERCENT); | |
| 554 | + @ </svg></centre><hr/> | |
| 555 | + } | |
| 544 | 556 | @ <table class='statistics-report-table-events' border='0' |
| 545 | 557 | @ cellpadding='2' cellspacing='0' id='statsTable'> |
| 546 | 558 | @ <thead><tr> |
| 547 | 559 | @ <th>DoW</th> |
| 548 | 560 | @ <th>Day</th> |
| 549 | 561 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -406,20 +406,19 @@ | |
| 406 | all rows. */ |
| 407 | stats_report_init_view(); |
| 408 | stats_report_event_types_menu("byuser", NULL); |
| 409 | @ <h1>Timeline Events |
| 410 | @ (%s(stats_report_label_for_type())) by User</h1> |
| 411 | if( PB("pie") ){ |
| 412 | db_multi_exec( |
| 413 | "CREATE TEMP TABLE piechart(amt,label);" |
| 414 | "INSERT INTO piechart SELECT count(*), user FROM v_reports" |
| 415 | " GROUP BY user ORDER BY count(*) DESC;" |
| 416 | ); |
| 417 | @ <svg width=800 height=600> |
| 418 | piechart_render(800, 600, PIE_OTHER); |
| 419 | @ </svg> |
| 420 | return; |
| 421 | } |
| 422 | @ <table class='statistics-report-table-events' border='0' |
| 423 | @ cellpadding='2' cellspacing='0' id='statsTable'> |
| 424 | @ <thead><tr> |
| 425 | @ <th>User</th> |
| @@ -479,11 +478,11 @@ | |
| 479 | "CREATE TEMP TABLE statrep(filename, cnt);" |
| 480 | "INSERT INTO statrep(filename, cnt)" |
| 481 | " SELECT filename.name, count(distinct mlink.mid)" |
| 482 | " FROM filename, mlink" |
| 483 | " WHERE filename.fnid=mlink.fnid" |
| 484 | " GROUP BY 1" |
| 485 | ); |
| 486 | db_prepare(&query, |
| 487 | "SELECT filename, cnt FROM statrep ORDER BY cnt DESC, filename /*sort*/" |
| 488 | ); |
| 489 | mxEvent = db_int(1, "SELECT max(cnt) FROM statrep"); |
| @@ -539,10 +538,23 @@ | |
| 539 | "COUNT(*) AS eventCount " |
| 540 | "FROM v_reports " |
| 541 | "GROUP BY dow ORDER BY dow"); |
| 542 | @ <h1>Timeline Events |
| 543 | @ (%s(stats_report_label_for_type())) by Day of the Week</h1> |
| 544 | @ <table class='statistics-report-table-events' border='0' |
| 545 | @ cellpadding='2' cellspacing='0' id='statsTable'> |
| 546 | @ <thead><tr> |
| 547 | @ <th>DoW</th> |
| 548 | @ <th>Day</th> |
| 549 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -406,20 +406,19 @@ | |
| 406 | all rows. */ |
| 407 | stats_report_init_view(); |
| 408 | stats_report_event_types_menu("byuser", NULL); |
| 409 | @ <h1>Timeline Events |
| 410 | @ (%s(stats_report_label_for_type())) by User</h1> |
| 411 | db_multi_exec( |
| 412 | "CREATE TEMP TABLE piechart(amt,label);" |
| 413 | "INSERT INTO piechart SELECT count(*), user FROM v_reports" |
| 414 | " GROUP BY user ORDER BY count(*) DESC;" |
| 415 | ); |
| 416 | if( db_int(0, "SELECT count(*) FROM piechart")>=2 ){ |
| 417 | @ <center><svg width=700 height=400> |
| 418 | piechart_render(700, 400, PIE_OTHER|PIE_PERCENT); |
| 419 | @ </svg></centre><hr/> |
| 420 | } |
| 421 | @ <table class='statistics-report-table-events' border='0' |
| 422 | @ cellpadding='2' cellspacing='0' id='statsTable'> |
| 423 | @ <thead><tr> |
| 424 | @ <th>User</th> |
| @@ -479,11 +478,11 @@ | |
| 478 | "CREATE TEMP TABLE statrep(filename, cnt);" |
| 479 | "INSERT INTO statrep(filename, cnt)" |
| 480 | " SELECT filename.name, count(distinct mlink.mid)" |
| 481 | " FROM filename, mlink" |
| 482 | " WHERE filename.fnid=mlink.fnid" |
| 483 | " GROUP BY 1;" |
| 484 | ); |
| 485 | db_prepare(&query, |
| 486 | "SELECT filename, cnt FROM statrep ORDER BY cnt DESC, filename /*sort*/" |
| 487 | ); |
| 488 | mxEvent = db_int(1, "SELECT max(cnt) FROM statrep"); |
| @@ -539,10 +538,23 @@ | |
| 538 | "COUNT(*) AS eventCount " |
| 539 | "FROM v_reports " |
| 540 | "GROUP BY dow ORDER BY dow"); |
| 541 | @ <h1>Timeline Events |
| 542 | @ (%s(stats_report_label_for_type())) by Day of the Week</h1> |
| 543 | db_multi_exec( |
| 544 | "CREATE TEMP TABLE piechart(amt,label);" |
| 545 | "INSERT INTO piechart SELECT count(*), cast(mtime %% 7 AS INT) FROM v_reports" |
| 546 | " GROUP BY 2 ORDER BY 2;" |
| 547 | "UPDATE piechart SET label = CASE label WHEN 0 THEN 'Monday' WHEN 1 THEN 'Tuesday'" |
| 548 | " WHEN 2 THEN 'Wednesday' WHEN 3 THEN 'Thursday' WHEN 4 THEN 'Friday'" |
| 549 | " WHEN 5 THEN 'Saturday' ELSE 'Sunday' END;" |
| 550 | ); |
| 551 | if( db_int(0, "SELECT count(*) FROM piechart")>=2 ){ |
| 552 | @ <center><svg width=700 height=400> |
| 553 | piechart_render(700, 400, PIE_OTHER|PIE_PERCENT); |
| 554 | @ </svg></centre><hr/> |
| 555 | } |
| 556 | @ <table class='statistics-report-table-events' border='0' |
| 557 | @ cellpadding='2' cellspacing='0' id='statsTable'> |
| 558 | @ <thead><tr> |
| 559 | @ <th>DoW</th> |
| 560 | @ <th>Day</th> |
| 561 |