Fossil SCM

extend tktnew to have a button 'Submit and New' that allows to chain creation of multiple tickets

jkosche 2025-03-23 10:45 tktnew-template
Commit e729e6b2028a4e5f93fbfb69806385f926f638063f20dc02e642f6990390714f
2 files changed +5 -1 +9 -1
+5 -1
--- src/tkt.c
+++ src/tkt.c
@@ -1046,11 +1046,15 @@
10461046
Th_Store("date", db_text(0, "SELECT datetime('now')"));
10471047
Th_CreateCommand(g.interp, "submit_ticket", submitTicketCmd,
10481048
(void*)&zNewUuid, 0);
10491049
if( g.thTrace ) Th_Trace("BEGIN_TKTNEW_SCRIPT<br>\n", -1);
10501050
if( Th_Render(zScript)==TH_RETURN && !g.thTrace && zNewUuid ){
1051
- cgi_redirect(mprintf("%R/tktview/%s", zNewUuid));
1051
+ if( P("submitandnew") ){
1052
+ cgi_redirect(mprintf("%R/tktnew/%s", zNewUuid));
1053
+ }else{
1054
+ cgi_redirect(mprintf("%R/tktview/%s", zNewUuid));
1055
+ }
10521056
return;
10531057
}
10541058
captcha_generate(0);
10551059
@ </form>
10561060
if( g.thTrace ) Th_Trace("END_TKTVIEW<br>\n", -1);
10571061
--- src/tkt.c
+++ src/tkt.c
@@ -1046,11 +1046,15 @@
1046 Th_Store("date", db_text(0, "SELECT datetime('now')"));
1047 Th_CreateCommand(g.interp, "submit_ticket", submitTicketCmd,
1048 (void*)&zNewUuid, 0);
1049 if( g.thTrace ) Th_Trace("BEGIN_TKTNEW_SCRIPT<br>\n", -1);
1050 if( Th_Render(zScript)==TH_RETURN && !g.thTrace && zNewUuid ){
1051 cgi_redirect(mprintf("%R/tktview/%s", zNewUuid));
 
 
 
 
1052 return;
1053 }
1054 captcha_generate(0);
1055 @ </form>
1056 if( g.thTrace ) Th_Trace("END_TKTVIEW<br>\n", -1);
1057
--- src/tkt.c
+++ src/tkt.c
@@ -1046,11 +1046,15 @@
1046 Th_Store("date", db_text(0, "SELECT datetime('now')"));
1047 Th_CreateCommand(g.interp, "submit_ticket", submitTicketCmd,
1048 (void*)&zNewUuid, 0);
1049 if( g.thTrace ) Th_Trace("BEGIN_TKTNEW_SCRIPT<br>\n", -1);
1050 if( Th_Render(zScript)==TH_RETURN && !g.thTrace && zNewUuid ){
1051 if( P("submitandnew") ){
1052 cgi_redirect(mprintf("%R/tktnew/%s", zNewUuid));
1053 }else{
1054 cgi_redirect(mprintf("%R/tktview/%s", zNewUuid));
1055 }
1056 return;
1057 }
1058 captcha_generate(0);
1059 @ </form>
1060 if( g.thTrace ) Th_Trace("END_TKTVIEW<br>\n", -1);
1061
+9 -1
--- 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"
@@ -425,10 +425,18 @@
425425
@ <input type="submit" name="submit" value="Submit">
426426
@ </td>
427427
@ <td align="left">After filling in the information above, press this
428428
@ button to create the new ticket</td>
429429
@ </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>
430438
@ <th1>enable_output 1</th1>
431439
@
432440
@ <tr>
433441
@ <td><td align="left">
434442
@ <input type="submit" name="cancel" value="Cancel">
435443
--- 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"
@@ -425,10 +425,18 @@
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 @ <th1>enable_output 1</th1>
431 @
432 @ <tr>
433 @ <td><td align="left">
434 @ <input type="submit" name="cancel" value="Cancel">
435
--- 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"
@@ -425,10 +425,18 @@
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

Keyboard Shortcuts

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