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.

george 2021-05-22 12:40 trunk
Commit 3e350682607068a76405dd8ee67306686e9ce0bdabca9d50baf73e818483b2e4
2 files changed +9 -1 +4
+9 -1
--- src/report.c
+++ src/report.c
@@ -1033,14 +1033,22 @@
10331033
}
10341034
10351035
count = 0;
10361036
if( !tabs ){
10371037
struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
1038
+ const char *zQS = PD("QUERY_STRING","");
10381039
10391040
db_multi_exec("PRAGMA empty_result_callbacks=ON");
10401041
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
+ }
10421050
if( g.perm.Admin
10431051
|| (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
10441052
style_submenu_element("Edit", "rptedit?rn=%d", rn);
10451053
}
10461054
if( g.perm.TktFmt ){
10471055
--- 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
--- src/style.c
+++ src/style.c
@@ -905,10 +905,14 @@
905905
@ <div class="submenu">
906906
if( nSubmenu>0 ){
907907
qsort(aSubmenu, nSubmenu, sizeof(aSubmenu[0]), submenuCompare);
908908
for(i=0; i<nSubmenu; i++){
909909
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
+ */
910914
if( p->zLink==0 ){
911915
@ <span class="label">%h(p->zLabel)</span>
912916
}else{
913917
@ <a class="label" href="%h(p->zLink)">%h(p->zLabel)</a>
914918
}
915919
--- 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

Keyboard Shortcuts

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