Fossil SCM

Do not attempt to render empty description of a report. Also make hyperlinks in a report's submenu more robust. This amends [fcf17b28a902c0].

george 2022-11-20 01:58 trunk
Commit 04a01d066a84ba01b3afb215cd8022bd276646fc1106040ed82449b33471a7c1
1 file changed +17 -8
+17 -8
--- src/report.c
+++ src/report.c
@@ -586,13 +586,13 @@
586586
zTitle = mprintf("Copy Of %s", zTitle);
587587
zOwner = g.zLogin;
588588
}
589589
}
590590
if( zOwner==0 ) zOwner = g.zLogin;
591
- style_submenu_element("Cancel", "reportlist");
591
+ style_submenu_element("Cancel", "%R/reportlist");
592592
if( rn>0 ){
593
- style_submenu_element("Delete", "rptedit/%d?del1=1", rn);
593
+ style_submenu_element("Delete", "%R/rptedit/%d?del1=1", rn);
594594
}
595595
style_header("%s", rn>0 ? "Edit Report Format":"Create New Report Format");
596596
if( zErr ){
597597
@ <blockquote class="reportError">%h(zErr)</blockquote>
598598
}
@@ -1192,34 +1192,43 @@
11921192
db_multi_exec("PRAGMA empty_result_callbacks=ON");
11931193
style_set_current_feature("report");
11941194
if( pageWrap ) {
11951195
/* style_finish_page() should provide escaping via %h formatting */
11961196
if( zQS[0] ){
1197
- style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS);
1197
+ if( g.zExtra && g.zExtra[0] ){
1198
+ style_submenu_element("Raw","%R/%s/%s?tablist=1&%s",
1199
+ g.zPath, g.zExtra, zQS);
1200
+ }else{
1201
+ style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS);
1202
+ }
11981203
style_submenu_element("Reports","%R/reportlist?%s",zQS);
11991204
} else {
1200
- style_submenu_element("Raw","%R/%s?tablist=1",g.zPath);
1205
+ if( g.zExtra && g.zExtra[0] ){
1206
+ style_submenu_element("Raw","%R/%s/%s?tablist=1",g.zPath,g.zExtra);
1207
+ }else{
1208
+ style_submenu_element("Raw","%R/%s?tablist=1",g.zPath);
1209
+ }
12011210
style_submenu_element("Reports","%R/reportlist");
12021211
}
12031212
if( g.perm.Admin
12041213
|| (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
1205
- style_submenu_element("Edit", "rptedit/%d", rn);
1214
+ style_submenu_element("Edit", "%R/rptedit/%d", rn);
12061215
}
12071216
if( g.perm.TktFmt ){
1208
- style_submenu_element("SQL", "rptsql/%d",rn);
1217
+ style_submenu_element("SQL", "%R/rptsql/%d",rn);
12091218
}
12101219
if( g.perm.NewTkt ){
12111220
style_submenu_element("New Ticket", "%R/tktnew");
12121221
}
12131222
style_header("%s", zTitle);
12141223
}
1215
- if( zDesc && zMimetype ){
1224
+ if( zDesc && zDesc[0] && zMimetype ){
12161225
Blob src;
12171226
blob_init(&src, zDesc, -1);
12181227
wiki_render_by_mimetype(&src, zMimetype);
12191228
blob_reset(&src);
1220
- @ <p>
1229
+ @ <br>
12211230
}
12221231
output_color_key(zClrKey, 1,
12231232
"border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\"");
12241233
@ <table border="1" cellpadding="2" cellspacing="0" class="report sortable"
12251234
@ data-column-types='' data-init-sort='0'>
12261235
--- src/report.c
+++ src/report.c
@@ -586,13 +586,13 @@
586 zTitle = mprintf("Copy Of %s", zTitle);
587 zOwner = g.zLogin;
588 }
589 }
590 if( zOwner==0 ) zOwner = g.zLogin;
591 style_submenu_element("Cancel", "reportlist");
592 if( rn>0 ){
593 style_submenu_element("Delete", "rptedit/%d?del1=1", rn);
594 }
595 style_header("%s", rn>0 ? "Edit Report Format":"Create New Report Format");
596 if( zErr ){
597 @ <blockquote class="reportError">%h(zErr)</blockquote>
598 }
@@ -1192,34 +1192,43 @@
1192 db_multi_exec("PRAGMA empty_result_callbacks=ON");
1193 style_set_current_feature("report");
1194 if( pageWrap ) {
1195 /* style_finish_page() should provide escaping via %h formatting */
1196 if( zQS[0] ){
1197 style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS);
 
 
 
 
 
1198 style_submenu_element("Reports","%R/reportlist?%s",zQS);
1199 } else {
1200 style_submenu_element("Raw","%R/%s?tablist=1",g.zPath);
 
 
 
 
1201 style_submenu_element("Reports","%R/reportlist");
1202 }
1203 if( g.perm.Admin
1204 || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
1205 style_submenu_element("Edit", "rptedit/%d", rn);
1206 }
1207 if( g.perm.TktFmt ){
1208 style_submenu_element("SQL", "rptsql/%d",rn);
1209 }
1210 if( g.perm.NewTkt ){
1211 style_submenu_element("New Ticket", "%R/tktnew");
1212 }
1213 style_header("%s", zTitle);
1214 }
1215 if( zDesc && zMimetype ){
1216 Blob src;
1217 blob_init(&src, zDesc, -1);
1218 wiki_render_by_mimetype(&src, zMimetype);
1219 blob_reset(&src);
1220 @ <p>
1221 }
1222 output_color_key(zClrKey, 1,
1223 "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\"");
1224 @ <table border="1" cellpadding="2" cellspacing="0" class="report sortable"
1225 @ data-column-types='' data-init-sort='0'>
1226
--- src/report.c
+++ src/report.c
@@ -586,13 +586,13 @@
586 zTitle = mprintf("Copy Of %s", zTitle);
587 zOwner = g.zLogin;
588 }
589 }
590 if( zOwner==0 ) zOwner = g.zLogin;
591 style_submenu_element("Cancel", "%R/reportlist");
592 if( rn>0 ){
593 style_submenu_element("Delete", "%R/rptedit/%d?del1=1", rn);
594 }
595 style_header("%s", rn>0 ? "Edit Report Format":"Create New Report Format");
596 if( zErr ){
597 @ <blockquote class="reportError">%h(zErr)</blockquote>
598 }
@@ -1192,34 +1192,43 @@
1192 db_multi_exec("PRAGMA empty_result_callbacks=ON");
1193 style_set_current_feature("report");
1194 if( pageWrap ) {
1195 /* style_finish_page() should provide escaping via %h formatting */
1196 if( zQS[0] ){
1197 if( g.zExtra && g.zExtra[0] ){
1198 style_submenu_element("Raw","%R/%s/%s?tablist=1&%s",
1199 g.zPath, g.zExtra, zQS);
1200 }else{
1201 style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS);
1202 }
1203 style_submenu_element("Reports","%R/reportlist?%s",zQS);
1204 } else {
1205 if( g.zExtra && g.zExtra[0] ){
1206 style_submenu_element("Raw","%R/%s/%s?tablist=1",g.zPath,g.zExtra);
1207 }else{
1208 style_submenu_element("Raw","%R/%s?tablist=1",g.zPath);
1209 }
1210 style_submenu_element("Reports","%R/reportlist");
1211 }
1212 if( g.perm.Admin
1213 || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
1214 style_submenu_element("Edit", "%R/rptedit/%d", rn);
1215 }
1216 if( g.perm.TktFmt ){
1217 style_submenu_element("SQL", "%R/rptsql/%d",rn);
1218 }
1219 if( g.perm.NewTkt ){
1220 style_submenu_element("New Ticket", "%R/tktnew");
1221 }
1222 style_header("%s", zTitle);
1223 }
1224 if( zDesc && zDesc[0] && zMimetype ){
1225 Blob src;
1226 blob_init(&src, zDesc, -1);
1227 wiki_render_by_mimetype(&src, zMimetype);
1228 blob_reset(&src);
1229 @ <br>
1230 }
1231 output_color_key(zClrKey, 1,
1232 "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\"");
1233 @ <table border="1" cellpadding="2" cellspacing="0" class="report sortable"
1234 @ data-column-types='' data-init-sort='0'>
1235

Keyboard Shortcuts

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