Fossil SCM
extend tktnew to have a button 'Submit and New' that allows to chain creation of multiple tickets
Commit
e729e6b2028a4e5f93fbfb69806385f926f638063f20dc02e642f6990390714f
Parent
1b7033ffa5065b9…
2 files changed
+5
-1
+9
-1
+5
-1
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -1046,11 +1046,15 @@ | ||
| 1046 | 1046 | Th_Store("date", db_text(0, "SELECT datetime('now')")); |
| 1047 | 1047 | Th_CreateCommand(g.interp, "submit_ticket", submitTicketCmd, |
| 1048 | 1048 | (void*)&zNewUuid, 0); |
| 1049 | 1049 | if( g.thTrace ) Th_Trace("BEGIN_TKTNEW_SCRIPT<br>\n", -1); |
| 1050 | 1050 | 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 | + } | |
| 1052 | 1056 | return; |
| 1053 | 1057 | } |
| 1054 | 1058 | captcha_generate(0); |
| 1055 | 1059 | @ </form> |
| 1056 | 1060 | if( g.thTrace ) Th_Trace("END_TKTVIEW<br>\n", -1); |
| 1057 | 1061 |
| --- 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 @@ | ||
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | static const char zDefaultNew[] = |
| 304 | 304 | @ <th1> |
| 305 | 305 | @ if {![info exists mutype]} {set mutype Markdown} |
| 306 | -@ if {[info exists submit]} { | |
| 306 | +@ if {[info exists submit] || [info exists submitandnew]} { | |
| 307 | 307 | @ set status Open |
| 308 | 308 | @ if {$mutype eq "HTML"} { |
| 309 | 309 | @ set mimetype "text/html" |
| 310 | 310 | @ } elseif {$mutype eq "Wiki"} { |
| 311 | 311 | @ set mimetype "text/x-fossil-wiki" |
| @@ -425,10 +425,18 @@ | ||
| 425 | 425 | @ <input type="submit" name="submit" value="Submit"> |
| 426 | 426 | @ </td> |
| 427 | 427 | @ <td align="left">After filling in the information above, press this |
| 428 | 428 | @ button to create the new ticket</td> |
| 429 | 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> | |
| 430 | 438 | @ <th1>enable_output 1</th1> |
| 431 | 439 | @ |
| 432 | 440 | @ <tr> |
| 433 | 441 | @ <td><td align="left"> |
| 434 | 442 | @ <input type="submit" name="cancel" value="Cancel"> |
| 435 | 443 |
| --- 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 |