Fossil SCM

allow to use tickets as templates, see [https://fossil-scm.org/forum/forumpost/c9982d733b94e1ac|this forum post] for details

jkosche 2025-04-02 21:00 trunk merge
Commit 271a6bd31d5087f29c4a89f36bff9dc74c734e164a96e4ce252c1dd29f94efeb
+7 -5
--- src/tkt.c
+++ src/tkt.c
@@ -1026,15 +1026,13 @@
10261026
form_begin(0, "%R/%s", g.zPath);
10271027
if( P("date_override") && g.perm.Setup ){
10281028
@ <input type="hidden" name="date_override" value="%h(P("date_override"))">
10291029
}
10301030
zScript = ticket_newpage_code();
1031
+ Th_Store("private_contact", "");
10311032
if( g.zLogin && g.zLogin[0] ){
1032
- int nEmail = 0;
1033
- (void)Th_MaybeGetVar(g.interp, "private_contact", &nEmail);
1034
- uid = nEmail>0
1035
- ? 0 : db_int(0, "SELECT uid FROM user WHERE login=%Q", g.zLogin);
1033
+ uid = db_int(0, "SELECT uid FROM user WHERE login=%Q", g.zLogin);
10361034
if( uid ){
10371035
char * zEmail =
10381036
db_text(0, "SELECT find_emailaddr(info) FROM user WHERE uid=%d",
10391037
uid);
10401038
if( zEmail ){
@@ -1047,11 +1045,15 @@
10471045
Th_Store("date", db_text(0, "SELECT datetime('now')"));
10481046
Th_CreateCommand(g.interp, "submit_ticket", submitTicketCmd,
10491047
(void*)&zNewUuid, 0);
10501048
if( g.thTrace ) Th_Trace("BEGIN_TKTNEW_SCRIPT<br>\n", -1);
10511049
if( Th_Render(zScript)==TH_RETURN && !g.thTrace && zNewUuid ){
1052
- cgi_redirect(mprintf("%R/tktview/%s", zNewUuid));
1050
+ if( P("submitandnew") ){
1051
+ cgi_redirect(mprintf("%R/tktnew/%s", zNewUuid));
1052
+ }else{
1053
+ cgi_redirect(mprintf("%R/tktview/%s", zNewUuid));
1054
+ }
10531055
return;
10541056
}
10551057
captcha_generate(0);
10561058
@ </form>
10571059
if( g.thTrace ) Th_Trace("END_TKTVIEW<br>\n", -1);
10581060
--- src/tkt.c
+++ src/tkt.c
@@ -1026,15 +1026,13 @@
1026 form_begin(0, "%R/%s", g.zPath);
1027 if( P("date_override") && g.perm.Setup ){
1028 @ <input type="hidden" name="date_override" value="%h(P("date_override"))">
1029 }
1030 zScript = ticket_newpage_code();
 
1031 if( g.zLogin && g.zLogin[0] ){
1032 int nEmail = 0;
1033 (void)Th_MaybeGetVar(g.interp, "private_contact", &nEmail);
1034 uid = nEmail>0
1035 ? 0 : db_int(0, "SELECT uid FROM user WHERE login=%Q", g.zLogin);
1036 if( uid ){
1037 char * zEmail =
1038 db_text(0, "SELECT find_emailaddr(info) FROM user WHERE uid=%d",
1039 uid);
1040 if( zEmail ){
@@ -1047,11 +1045,15 @@
1047 Th_Store("date", db_text(0, "SELECT datetime('now')"));
1048 Th_CreateCommand(g.interp, "submit_ticket", submitTicketCmd,
1049 (void*)&zNewUuid, 0);
1050 if( g.thTrace ) Th_Trace("BEGIN_TKTNEW_SCRIPT<br>\n", -1);
1051 if( Th_Render(zScript)==TH_RETURN && !g.thTrace && zNewUuid ){
1052 cgi_redirect(mprintf("%R/tktview/%s", zNewUuid));
 
 
 
 
1053 return;
1054 }
1055 captcha_generate(0);
1056 @ </form>
1057 if( g.thTrace ) Th_Trace("END_TKTVIEW<br>\n", -1);
1058
--- src/tkt.c
+++ src/tkt.c
@@ -1026,15 +1026,13 @@
1026 form_begin(0, "%R/%s", g.zPath);
1027 if( P("date_override") && g.perm.Setup ){
1028 @ <input type="hidden" name="date_override" value="%h(P("date_override"))">
1029 }
1030 zScript = ticket_newpage_code();
1031 Th_Store("private_contact", "");
1032 if( g.zLogin && g.zLogin[0] ){
1033 uid = db_int(0, "SELECT uid FROM user WHERE login=%Q", g.zLogin);
 
 
 
1034 if( uid ){
1035 char * zEmail =
1036 db_text(0, "SELECT find_emailaddr(info) FROM user WHERE uid=%d",
1037 uid);
1038 if( zEmail ){
@@ -1047,11 +1045,15 @@
1045 Th_Store("date", db_text(0, "SELECT datetime('now')"));
1046 Th_CreateCommand(g.interp, "submit_ticket", submitTicketCmd,
1047 (void*)&zNewUuid, 0);
1048 if( g.thTrace ) Th_Trace("BEGIN_TKTNEW_SCRIPT<br>\n", -1);
1049 if( Th_Render(zScript)==TH_RETURN && !g.thTrace && zNewUuid ){
1050 if( P("submitandnew") ){
1051 cgi_redirect(mprintf("%R/tktnew/%s", zNewUuid));
1052 }else{
1053 cgi_redirect(mprintf("%R/tktview/%s", zNewUuid));
1054 }
1055 return;
1056 }
1057 captcha_generate(0);
1058 @ </form>
1059 if( g.thTrace ) Th_Trace("END_TKTVIEW<br>\n", -1);
1060
+33 -3
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -301,11 +301,11 @@
301301
}
302302
303303
static const char zDefaultNew[] =
304304
@ <th1>
305305
@ if {![info exists mutype]} {set mutype Markdown}
306
-@ if {[info exists submit]} {
306
+@ if {[info exists submit] || [info exists submitandnew]} {
307307
@ set status Open
308308
@ if {$mutype eq "HTML"} {
309309
@ set mimetype "text/html"
310310
@ } elseif {$mutype eq "Wiki"} {
311311
@ set mimetype "text/x-fossil-wiki"
@@ -349,10 +349,28 @@
349349
@ <td align="left"><th1>combobox severity $severity_choices 1</th1></td>
350350
@ <td align="left">How debilitating is the problem? How badly does the problem
351351
@ affect the operation of the product?</td>
352352
@ </tr>
353353
@
354
+@ <th1>
355
+@ if {[capexpr {w}]} {
356
+@ html {<tr><td class="tktDspLabel">Priority:</td><td>}
357
+@ combobox priority $priority_choices 1
358
+@ html {
359
+@ <td align="left">How important is the affected functionality?</td>
360
+@ </td></tr>
361
+@ }
362
+@
363
+@ html {<tr><td class="tktDspLabel">Subsystem:</td><td>}
364
+@ combobox subsystem $subsystem_choices 1
365
+@ html {
366
+@ <td align="left">Which subsystem is affected?</td>
367
+@ </td></tr>
368
+@ }
369
+@ }
370
+@ </th1>
371
+@
354372
@ <tr>
355373
@ <td align="right">EMail:</td>
356374
@ <td align="left">
357375
@ <input name="private_contact" value="$<private_contact>" size="30">
358376
@ </td>
@@ -405,19 +423,27 @@
405423
@ <tr>
406424
@ <td><td align="left">
407425
@ <input type="submit" name="submit" value="Submit">
408426
@ </td>
409427
@ <td align="left">After filling in the information above, press this
410
-@ button to create the new ticket</td>
428
+@ button to create the new ticket.</td>
429
+@ </tr>
430
+@
431
+@ <tr>
432
+@ <td><td align="left">
433
+@ <input type="submit" name="submitandnew" value="Submit and New">
434
+@ </td>
435
+@ <td align="left">Create the new ticket and start another
436
+@ ticket form with the inputs.</td>
411437
@ </tr>
412438
@ <th1>enable_output 1</th1>
413439
@
414440
@ <tr>
415441
@ <td><td align="left">
416442
@ <input type="submit" name="cancel" value="Cancel">
417443
@ </td>
418
-@ <td>Abandon and forget this ticket</td>
444
+@ <td>Abandon and forget this ticket.</td>
419445
@ </tr>
420446
@ </table>
421447
;
422448
423449
/*
@@ -465,10 +491,14 @@
465491
@ html "(0)</td></tr>\n"
466492
@ } else {
467493
@ html "<td class='tktDspValue' colspan='3'>Deleted</td></tr>\n"
468494
@ }
469495
@ }
496
+@
497
+@ if {[capexpr {n}]} {
498
+@ submenu link "Copy Ticket" /tktnew/$tkt_uuid
499
+@ }
470500
@ </th1>
471501
@ <tr><td class="tktDspLabel">Title:</td>
472502
@ <td class="tktDspValue" colspan="3">
473503
@ $<title>
474504
@ </td></tr>
475505
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -301,11 +301,11 @@
301 }
302
303 static const char zDefaultNew[] =
304 @ <th1>
305 @ if {![info exists mutype]} {set mutype Markdown}
306 @ if {[info exists submit]} {
307 @ set status Open
308 @ if {$mutype eq "HTML"} {
309 @ set mimetype "text/html"
310 @ } elseif {$mutype eq "Wiki"} {
311 @ set mimetype "text/x-fossil-wiki"
@@ -349,10 +349,28 @@
349 @ <td align="left"><th1>combobox severity $severity_choices 1</th1></td>
350 @ <td align="left">How debilitating is the problem? How badly does the problem
351 @ affect the operation of the product?</td>
352 @ </tr>
353 @
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354 @ <tr>
355 @ <td align="right">EMail:</td>
356 @ <td align="left">
357 @ <input name="private_contact" value="$<private_contact>" size="30">
358 @ </td>
@@ -405,19 +423,27 @@
405 @ <tr>
406 @ <td><td align="left">
407 @ <input type="submit" name="submit" value="Submit">
408 @ </td>
409 @ <td align="left">After filling in the information above, press this
410 @ button to create the new ticket</td>
 
 
 
 
 
 
 
 
411 @ </tr>
412 @ <th1>enable_output 1</th1>
413 @
414 @ <tr>
415 @ <td><td align="left">
416 @ <input type="submit" name="cancel" value="Cancel">
417 @ </td>
418 @ <td>Abandon and forget this ticket</td>
419 @ </tr>
420 @ </table>
421 ;
422
423 /*
@@ -465,10 +491,14 @@
465 @ html "(0)</td></tr>\n"
466 @ } else {
467 @ html "<td class='tktDspValue' colspan='3'>Deleted</td></tr>\n"
468 @ }
469 @ }
 
 
 
 
470 @ </th1>
471 @ <tr><td class="tktDspLabel">Title:</td>
472 @ <td class="tktDspValue" colspan="3">
473 @ $<title>
474 @ </td></tr>
475
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -301,11 +301,11 @@
301 }
302
303 static const char zDefaultNew[] =
304 @ <th1>
305 @ if {![info exists mutype]} {set mutype Markdown}
306 @ if {[info exists submit] || [info exists submitandnew]} {
307 @ set status Open
308 @ if {$mutype eq "HTML"} {
309 @ set mimetype "text/html"
310 @ } elseif {$mutype eq "Wiki"} {
311 @ set mimetype "text/x-fossil-wiki"
@@ -349,10 +349,28 @@
349 @ <td align="left"><th1>combobox severity $severity_choices 1</th1></td>
350 @ <td align="left">How debilitating is the problem? How badly does the problem
351 @ affect the operation of the product?</td>
352 @ </tr>
353 @
354 @ <th1>
355 @ if {[capexpr {w}]} {
356 @ html {<tr><td class="tktDspLabel">Priority:</td><td>}
357 @ combobox priority $priority_choices 1
358 @ html {
359 @ <td align="left">How important is the affected functionality?</td>
360 @ </td></tr>
361 @ }
362 @
363 @ html {<tr><td class="tktDspLabel">Subsystem:</td><td>}
364 @ combobox subsystem $subsystem_choices 1
365 @ html {
366 @ <td align="left">Which subsystem is affected?</td>
367 @ </td></tr>
368 @ }
369 @ }
370 @ </th1>
371 @
372 @ <tr>
373 @ <td align="right">EMail:</td>
374 @ <td align="left">
375 @ <input name="private_contact" value="$<private_contact>" size="30">
376 @ </td>
@@ -405,19 +423,27 @@
423 @ <tr>
424 @ <td><td align="left">
425 @ <input type="submit" name="submit" value="Submit">
426 @ </td>
427 @ <td align="left">After filling in the information above, press this
428 @ button to create the new ticket.</td>
429 @ </tr>
430 @
431 @ <tr>
432 @ <td><td align="left">
433 @ <input type="submit" name="submitandnew" value="Submit and New">
434 @ </td>
435 @ <td align="left">Create the new ticket and start another
436 @ ticket form with the inputs.</td>
437 @ </tr>
438 @ <th1>enable_output 1</th1>
439 @
440 @ <tr>
441 @ <td><td align="left">
442 @ <input type="submit" name="cancel" value="Cancel">
443 @ </td>
444 @ <td>Abandon and forget this ticket.</td>
445 @ </tr>
446 @ </table>
447 ;
448
449 /*
@@ -465,10 +491,14 @@
491 @ html "(0)</td></tr>\n"
492 @ } else {
493 @ html "<td class='tktDspValue' colspan='3'>Deleted</td></tr>\n"
494 @ }
495 @ }
496 @
497 @ if {[capexpr {n}]} {
498 @ submenu link "Copy Ticket" /tktnew/$tkt_uuid
499 @ }
500 @ </th1>
501 @ <tr><td class="tktDspLabel">Title:</td>
502 @ <td class="tktDspValue" colspan="3">
503 @ $<title>
504 @ </td></tr>
505
+10 -3
--- www/changes.wiki
+++ www/changes.wiki
@@ -21,11 +21,11 @@
2121
<li> Defaults to using the new [/help?cmd=/ckout|/ckout page] as its
2222
start page. Or, if the new "--from PATH" option is present, the
2323
default start page becomes "/ckout?exbase=PATH".
2424
<li> The new "--extpage FILENAME" option opens the named file as if it
2525
where in a [./serverext.wiki|CGI extension]. Example usage: the
26
- person editing this change log has
26
+ person editing this change log has
2727
"fossil ui --extpage www/changes.wiki" running and hence can
2828
press "Reload" on the web browser to view edits.
2929
</ol>
3030
* Enhancements to [/help?cmd=merge|fossil merge]:
3131
<ol type="a">
@@ -116,12 +116,19 @@
116116
COMMAND argument and only shows results for the specified
117117
subcommand, not the entire command.
118118
<li> The -u (--usage) option shows only the command-line syntax
119119
<li> The -o (--options) option shows only the command-line options
120120
</ol>
121
- * Added the ability to attach wiki pages to a ticket for extended
122
- descriptions.
121
+ * Enhancements to the ticket system:
122
+ <ol type="a">
123
+ <li> Added the ability to attach wiki pages to a ticket for extended
124
+ descriptions.
125
+ <li> Added submenu to the 'View Ticket' page, to use it as
126
+ template for a new ticket.
127
+ <li> Added button 'Submit and New' to create multiple tickets
128
+ in a row.
129
+ </ol>
123130
* Added the "hash" query parameter to the
124131
[/help?cmd=/whatis|/whatis webpage].
125132
* Add a "user elevation" [/doc/trunk/www/alerts.md|subscription]
126133
which alerts subscribers when an admin creates a new user or
127134
adds new permissions to one.
128135
--- www/changes.wiki
+++ www/changes.wiki
@@ -21,11 +21,11 @@
21 <li> Defaults to using the new [/help?cmd=/ckout|/ckout page] as its
22 start page. Or, if the new "--from PATH" option is present, the
23 default start page becomes "/ckout?exbase=PATH".
24 <li> The new "--extpage FILENAME" option opens the named file as if it
25 where in a [./serverext.wiki|CGI extension]. Example usage: the
26 person editing this change log has
27 "fossil ui --extpage www/changes.wiki" running and hence can
28 press "Reload" on the web browser to view edits.
29 </ol>
30 * Enhancements to [/help?cmd=merge|fossil merge]:
31 <ol type="a">
@@ -116,12 +116,19 @@
116 COMMAND argument and only shows results for the specified
117 subcommand, not the entire command.
118 <li> The -u (--usage) option shows only the command-line syntax
119 <li> The -o (--options) option shows only the command-line options
120 </ol>
121 * Added the ability to attach wiki pages to a ticket for extended
122 descriptions.
 
 
 
 
 
 
 
123 * Added the "hash" query parameter to the
124 [/help?cmd=/whatis|/whatis webpage].
125 * Add a "user elevation" [/doc/trunk/www/alerts.md|subscription]
126 which alerts subscribers when an admin creates a new user or
127 adds new permissions to one.
128
--- www/changes.wiki
+++ www/changes.wiki
@@ -21,11 +21,11 @@
21 <li> Defaults to using the new [/help?cmd=/ckout|/ckout page] as its
22 start page. Or, if the new "--from PATH" option is present, the
23 default start page becomes "/ckout?exbase=PATH".
24 <li> The new "--extpage FILENAME" option opens the named file as if it
25 where in a [./serverext.wiki|CGI extension]. Example usage: the
26 person editing this change log has
27 "fossil ui --extpage www/changes.wiki" running and hence can
28 press "Reload" on the web browser to view edits.
29 </ol>
30 * Enhancements to [/help?cmd=merge|fossil merge]:
31 <ol type="a">
@@ -116,12 +116,19 @@
116 COMMAND argument and only shows results for the specified
117 subcommand, not the entire command.
118 <li> The -u (--usage) option shows only the command-line syntax
119 <li> The -o (--options) option shows only the command-line options
120 </ol>
121 * Enhancements to the ticket system:
122 <ol type="a">
123 <li> Added the ability to attach wiki pages to a ticket for extended
124 descriptions.
125 <li> Added submenu to the 'View Ticket' page, to use it as
126 template for a new ticket.
127 <li> Added button 'Submit and New' to create multiple tickets
128 in a row.
129 </ol>
130 * Added the "hash" query parameter to the
131 [/help?cmd=/whatis|/whatis webpage].
132 * Add a "user elevation" [/doc/trunk/www/alerts.md|subscription]
133 which alerts subscribers when an admin creates a new user or
134 adds new permissions to one.
135
+10 -3
--- www/changes.wiki
+++ www/changes.wiki
@@ -21,11 +21,11 @@
2121
<li> Defaults to using the new [/help?cmd=/ckout|/ckout page] as its
2222
start page. Or, if the new "--from PATH" option is present, the
2323
default start page becomes "/ckout?exbase=PATH".
2424
<li> The new "--extpage FILENAME" option opens the named file as if it
2525
where in a [./serverext.wiki|CGI extension]. Example usage: the
26
- person editing this change log has
26
+ person editing this change log has
2727
"fossil ui --extpage www/changes.wiki" running and hence can
2828
press "Reload" on the web browser to view edits.
2929
</ol>
3030
* Enhancements to [/help?cmd=merge|fossil merge]:
3131
<ol type="a">
@@ -116,12 +116,19 @@
116116
COMMAND argument and only shows results for the specified
117117
subcommand, not the entire command.
118118
<li> The -u (--usage) option shows only the command-line syntax
119119
<li> The -o (--options) option shows only the command-line options
120120
</ol>
121
- * Added the ability to attach wiki pages to a ticket for extended
122
- descriptions.
121
+ * Enhancements to the ticket system:
122
+ <ol type="a">
123
+ <li> Added the ability to attach wiki pages to a ticket for extended
124
+ descriptions.
125
+ <li> Added submenu to the 'View Ticket' page, to use it as
126
+ template for a new ticket.
127
+ <li> Added button 'Submit and New' to create multiple tickets
128
+ in a row.
129
+ </ol>
123130
* Added the "hash" query parameter to the
124131
[/help?cmd=/whatis|/whatis webpage].
125132
* Add a "user elevation" [/doc/trunk/www/alerts.md|subscription]
126133
which alerts subscribers when an admin creates a new user or
127134
adds new permissions to one.
128135
--- www/changes.wiki
+++ www/changes.wiki
@@ -21,11 +21,11 @@
21 <li> Defaults to using the new [/help?cmd=/ckout|/ckout page] as its
22 start page. Or, if the new "--from PATH" option is present, the
23 default start page becomes "/ckout?exbase=PATH".
24 <li> The new "--extpage FILENAME" option opens the named file as if it
25 where in a [./serverext.wiki|CGI extension]. Example usage: the
26 person editing this change log has
27 "fossil ui --extpage www/changes.wiki" running and hence can
28 press "Reload" on the web browser to view edits.
29 </ol>
30 * Enhancements to [/help?cmd=merge|fossil merge]:
31 <ol type="a">
@@ -116,12 +116,19 @@
116 COMMAND argument and only shows results for the specified
117 subcommand, not the entire command.
118 <li> The -u (--usage) option shows only the command-line syntax
119 <li> The -o (--options) option shows only the command-line options
120 </ol>
121 * Added the ability to attach wiki pages to a ticket for extended
122 descriptions.
 
 
 
 
 
 
 
123 * Added the "hash" query parameter to the
124 [/help?cmd=/whatis|/whatis webpage].
125 * Add a "user elevation" [/doc/trunk/www/alerts.md|subscription]
126 which alerts subscribers when an admin creates a new user or
127 adds new permissions to one.
128
--- www/changes.wiki
+++ www/changes.wiki
@@ -21,11 +21,11 @@
21 <li> Defaults to using the new [/help?cmd=/ckout|/ckout page] as its
22 start page. Or, if the new "--from PATH" option is present, the
23 default start page becomes "/ckout?exbase=PATH".
24 <li> The new "--extpage FILENAME" option opens the named file as if it
25 where in a [./serverext.wiki|CGI extension]. Example usage: the
26 person editing this change log has
27 "fossil ui --extpage www/changes.wiki" running and hence can
28 press "Reload" on the web browser to view edits.
29 </ol>
30 * Enhancements to [/help?cmd=merge|fossil merge]:
31 <ol type="a">
@@ -116,12 +116,19 @@
116 COMMAND argument and only shows results for the specified
117 subcommand, not the entire command.
118 <li> The -u (--usage) option shows only the command-line syntax
119 <li> The -o (--options) option shows only the command-line options
120 </ol>
121 * Enhancements to the ticket system:
122 <ol type="a">
123 <li> Added the ability to attach wiki pages to a ticket for extended
124 descriptions.
125 <li> Added submenu to the 'View Ticket' page, to use it as
126 template for a new ticket.
127 <li> Added button 'Submit and New' to create multiple tickets
128 in a row.
129 </ol>
130 * Added the "hash" query parameter to the
131 [/help?cmd=/whatis|/whatis webpage].
132 * Add a "user elevation" [/doc/trunk/www/alerts.md|subscription]
133 which alerts subscribers when an admin creates a new user or
134 adds new permissions to one.
135

Keyboard Shortcuts

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