Fossil SCM
In the submenu of the /rptview page: 1) add "Reports" that links to /reportlist page (see [forum:/forumpost/612170e31007|forumpost 612170e3]); 2) fix a "Raw" link, that was incorrect for the case when /rptview is accessed through an alias. The later was addressed in [bed4b0f7fc58], but the bugfix was incomplete. Both of these amendments used to live on 'rptview-submenu-paralink' branch - this check-in places them on trunk.
Commit
3e350682607068a76405dd8ee67306686e9ce0bdabca9d50baf73e818483b2e4
Parent
2cc7031dde4ed08…
2 files changed
+9
-1
+4
+9
-1
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -1033,14 +1033,22 @@ | ||
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | 1035 | count = 0; |
| 1036 | 1036 | if( !tabs ){ |
| 1037 | 1037 | struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
| 1038 | + const char *zQS = PD("QUERY_STRING",""); | |
| 1038 | 1039 | |
| 1039 | 1040 | db_multi_exec("PRAGMA empty_result_callbacks=ON"); |
| 1040 | 1041 | style_set_current_feature("report"); |
| 1041 | - style_submenu_element("Raw", "rptview?tablist=1&rn=%d&%h", rn, PD("QUERY_STRING","") ); | |
| 1042 | + /* style_finish_page() should provide escaping via %h formatting */ | |
| 1043 | + if( zQS[0] ){ | |
| 1044 | + style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS); | |
| 1045 | + style_submenu_element("Reports","%R/reportlist?%s",zQS); | |
| 1046 | + } else { | |
| 1047 | + style_submenu_element("Raw","%R/%s?tablist=1",g.zPath); | |
| 1048 | + style_submenu_element("Reports","%R/reportlist"); | |
| 1049 | + } | |
| 1042 | 1050 | if( g.perm.Admin |
| 1043 | 1051 | || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){ |
| 1044 | 1052 | style_submenu_element("Edit", "rptedit?rn=%d", rn); |
| 1045 | 1053 | } |
| 1046 | 1054 | if( g.perm.TktFmt ){ |
| 1047 | 1055 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -1033,14 +1033,22 @@ | |
| 1033 | } |
| 1034 | |
| 1035 | count = 0; |
| 1036 | if( !tabs ){ |
| 1037 | struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
| 1038 | |
| 1039 | db_multi_exec("PRAGMA empty_result_callbacks=ON"); |
| 1040 | style_set_current_feature("report"); |
| 1041 | style_submenu_element("Raw", "rptview?tablist=1&rn=%d&%h", rn, PD("QUERY_STRING","") ); |
| 1042 | if( g.perm.Admin |
| 1043 | || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){ |
| 1044 | style_submenu_element("Edit", "rptedit?rn=%d", rn); |
| 1045 | } |
| 1046 | if( g.perm.TktFmt ){ |
| 1047 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -1033,14 +1033,22 @@ | |
| 1033 | } |
| 1034 | |
| 1035 | count = 0; |
| 1036 | if( !tabs ){ |
| 1037 | struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
| 1038 | const char *zQS = PD("QUERY_STRING",""); |
| 1039 | |
| 1040 | db_multi_exec("PRAGMA empty_result_callbacks=ON"); |
| 1041 | style_set_current_feature("report"); |
| 1042 | /* style_finish_page() should provide escaping via %h formatting */ |
| 1043 | if( zQS[0] ){ |
| 1044 | style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS); |
| 1045 | style_submenu_element("Reports","%R/reportlist?%s",zQS); |
| 1046 | } else { |
| 1047 | style_submenu_element("Raw","%R/%s?tablist=1",g.zPath); |
| 1048 | style_submenu_element("Reports","%R/reportlist"); |
| 1049 | } |
| 1050 | if( g.perm.Admin |
| 1051 | || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){ |
| 1052 | style_submenu_element("Edit", "rptedit?rn=%d", rn); |
| 1053 | } |
| 1054 | if( g.perm.TktFmt ){ |
| 1055 |
+4
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -905,10 +905,14 @@ | ||
| 905 | 905 | @ <div class="submenu"> |
| 906 | 906 | if( nSubmenu>0 ){ |
| 907 | 907 | qsort(aSubmenu, nSubmenu, sizeof(aSubmenu[0]), submenuCompare); |
| 908 | 908 | for(i=0; i<nSubmenu; i++){ |
| 909 | 909 | struct Submenu *p = &aSubmenu[i]; |
| 910 | + /* switching away from the %h formatting below might be dangerous | |
| 911 | + ** because some places use %s to compose zLabel and zLink; | |
| 912 | + ** e.g. /rptview page | |
| 913 | + */ | |
| 910 | 914 | if( p->zLink==0 ){ |
| 911 | 915 | @ <span class="label">%h(p->zLabel)</span> |
| 912 | 916 | }else{ |
| 913 | 917 | @ <a class="label" href="%h(p->zLink)">%h(p->zLabel)</a> |
| 914 | 918 | } |
| 915 | 919 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -905,10 +905,14 @@ | |
| 905 | @ <div class="submenu"> |
| 906 | if( nSubmenu>0 ){ |
| 907 | qsort(aSubmenu, nSubmenu, sizeof(aSubmenu[0]), submenuCompare); |
| 908 | for(i=0; i<nSubmenu; i++){ |
| 909 | struct Submenu *p = &aSubmenu[i]; |
| 910 | if( p->zLink==0 ){ |
| 911 | @ <span class="label">%h(p->zLabel)</span> |
| 912 | }else{ |
| 913 | @ <a class="label" href="%h(p->zLink)">%h(p->zLabel)</a> |
| 914 | } |
| 915 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -905,10 +905,14 @@ | |
| 905 | @ <div class="submenu"> |
| 906 | if( nSubmenu>0 ){ |
| 907 | qsort(aSubmenu, nSubmenu, sizeof(aSubmenu[0]), submenuCompare); |
| 908 | for(i=0; i<nSubmenu; i++){ |
| 909 | struct Submenu *p = &aSubmenu[i]; |
| 910 | /* switching away from the %h formatting below might be dangerous |
| 911 | ** because some places use %s to compose zLabel and zLink; |
| 912 | ** e.g. /rptview page |
| 913 | */ |
| 914 | if( p->zLink==0 ){ |
| 915 | @ <span class="label">%h(p->zLabel)</span> |
| 916 | }else{ |
| 917 | @ <a class="label" href="%h(p->zLink)">%h(p->zLabel)</a> |
| 918 | } |
| 919 |