Fossil SCM
Change the default ticketing scripts to take advantage of TICKETCHNG.
Commit
fb3b0f66a352ae6bcf12c49359ceeed092dd2c95
Parent
7de5f6c05686ccb…
1 file changed
+79
-100
+79
-100
| --- src/tktsetup.c | ||
| +++ src/tktsetup.c | ||
| @@ -291,24 +291,19 @@ | ||
| 291 | 291 | static const char zDefaultNew[] = |
| 292 | 292 | @ <th1> |
| 293 | 293 | @ if {![info exists mutype]} {set mutype {[links only]}} |
| 294 | 294 | @ if {[info exists submit]} { |
| 295 | 295 | @ set status Open |
| 296 | -@ set ctxt "<i>By [htmlize $login] on [date] UTC:</i><br />" | |
| 297 | 296 | @ if {$mutype eq "HTML"} { |
| 298 | -@ set x "<nowiki>\n[string trimright $comment]\n</nowiki>" | |
| 299 | -@ } elseif {$mutype eq "Plain Text"} { | |
| 300 | -@ set r [randhex] | |
| 301 | -@ set x "<verbatim-$r>\n[string trimright $comment]\n</verbatim-$r>" | |
| 297 | +@ set mimetype "text/html" | |
| 298 | +@ } elseif {$mutype eq "Wiki"} { | |
| 299 | +@ set mimetype "text/x-fossil-wiki" | |
| 302 | 300 | @ } elseif {$mutype eq {[links only]}} { |
| 303 | -@ set r [randhex] | |
| 304 | -@ set x [string trimright $comment] | |
| 305 | -@ set x "<verbatim-$r links>\n$x\n</verbatim-$r>" | |
| 301 | +@ set mimetype "text/x-fossil-plain" | |
| 306 | 302 | @ } else { |
| 307 | -@ set x $comment | |
| 303 | +@ set mimetype "text/plain" | |
| 308 | 304 | @ } |
| 309 | -@ set comment "$ctxt\n$x" | |
| 310 | 305 | @ submit_ticket |
| 311 | 306 | @ } |
| 312 | 307 | @ </th1> |
| 313 | 308 | @ <h1 style="text-align: center;">Enter A New Ticket</h1> |
| 314 | 309 | @ <table cellpadding="5"> |
| @@ -358,49 +353,49 @@ | ||
| 358 | 353 | @ the problem can be reproduced. Provide as much detail as |
| 359 | 354 | @ possible. Format: |
| 360 | 355 | @ <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1> |
| 361 | 356 | @ <br /> |
| 362 | 357 | @ <th1>set nline [linecount $comment 50 10]</th1> |
| 363 | -@ <textarea name="comment" cols="80" rows="$nline" | |
| 364 | -@ wrap="virtual" class="wikiedit">$<comment></textarea><br /> | |
| 358 | +@ <textarea name="icomment" cols="80" rows="$nline" | |
| 359 | +@ wrap="virtual" class="wikiedit">$<icomment></textarea><br /> | |
| 365 | 360 | @ </tr> |
| 366 | 361 | @ |
| 367 | -@ <th1>enable_output A [info exists preview]</th1> | |
| 362 | +@ <th1>enable_output [info exists preview]</th1> | |
| 368 | 363 | @ <tr><td colspan="3"> |
| 369 | 364 | @ Description Preview:<br /><hr /> |
| 370 | 365 | @ <th1> |
| 371 | 366 | @ if {$mutype eq "Wiki"} { |
| 372 | -@ wiki $comment | |
| 367 | +@ wiki $icomment | |
| 373 | 368 | @ } elseif {$mutype eq "Plain Text"} { |
| 374 | 369 | @ set r [randhex] |
| 375 | -@ wiki "<verbatim-$r>\n[string trimright $comment]\n</verbatim-$r>" | |
| 370 | +@ wiki "<verbatim-$r>[string trimright $icomment]\n</verbatim-$r>" | |
| 376 | 371 | @ } elseif {$mutype eq {[links only]}} { |
| 377 | 372 | @ set r [randhex] |
| 378 | -@ wiki "<verbatim-$r links>\n[string trimright $comment]\n</verbatim-$r>" | |
| 373 | +@ wiki "<verbatim-$r links>[string trimright $icomment]\n</verbatim-$r>" | |
| 379 | 374 | @ } else { |
| 380 | -@ wiki "<nowiki>\n[string trimright $comment]\n</nowiki>" | |
| 375 | +@ wiki "<nowiki>$icomment\n</nowiki>" | |
| 381 | 376 | @ } |
| 382 | 377 | @ </th1> |
| 383 | 378 | @ <hr /></td></tr> |
| 384 | -@ <th1>enable_output B 1</th1> | |
| 379 | +@ <th1>enable_output 1</th1> | |
| 385 | 380 | @ |
| 386 | 381 | @ <tr> |
| 387 | 382 | @ <td><td align="left"> |
| 388 | 383 | @ <input type="submit" name="preview" value="Preview" /> |
| 389 | 384 | @ </td> |
| 390 | 385 | @ <td align="left">See how the description will appear after formatting.</td> |
| 391 | 386 | @ </tr> |
| 392 | 387 | @ |
| 393 | -@ <th1>enable_output C [info exists preview]</th1> | |
| 388 | +@ <th1>enable_output [info exists preview]</th1> | |
| 394 | 389 | @ <tr> |
| 395 | 390 | @ <td><td align="left"> |
| 396 | 391 | @ <input type="submit" name="submit" value="Submit" /> |
| 397 | 392 | @ </td> |
| 398 | 393 | @ <td align="left">After filling in the information above, press this |
| 399 | 394 | @ button to create the new ticket</td> |
| 400 | 395 | @ </tr> |
| 401 | -@ <th1>enable_output D 1</th1> | |
| 396 | +@ <th1>enable_output 1</th1> | |
| 402 | 397 | @ |
| 403 | 398 | @ <tr> |
| 404 | 399 | @ <td><td align="left"> |
| 405 | 400 | @ <input type="submit" name="cancel" value="Cancel" /> |
| 406 | 401 | @ </td> |
| @@ -436,11 +431,18 @@ | ||
| 436 | 431 | } |
| 437 | 432 | |
| 438 | 433 | static const char zDefaultView[] = |
| 439 | 434 | @ <table cellpadding="5"> |
| 440 | 435 | @ <tr><td class="tktDspLabel">Ticket UUID:</td> |
| 441 | -@ <td class="tktDspValue" colspan="3">$<tkt_uuid></td></tr> | |
| 436 | +@ <th1> | |
| 437 | +@ if {[hascap s]} { | |
| 438 | +@ html "<td class=''tktDspValue'' colspan=''3''>$tkt_uuid " | |
| 439 | +@ html "($tkt_id)</td></tr>\n" | |
| 440 | +@ } else { | |
| 441 | +@ html "<td class=''tktDspValue'' colspan=''3''>$tkt_uuid</td></tr>\n" | |
| 442 | +@ } | |
| 443 | +@ </th1> | |
| 442 | 444 | @ <tr><td class="tktDspLabel">Title:</td> |
| 443 | 445 | @ <td class="tktDspValue" colspan="3"> |
| 444 | 446 | @ $<title> |
| 445 | 447 | @ </td></tr> |
| 446 | 448 | @ <tr><td class="tktDspLabel">Status:</td><td class="tktDspValue"> |
| @@ -472,18 +474,49 @@ | ||
| 472 | 474 | @ </tr> |
| 473 | 475 | @ <tr><td class="tktDspLabel">Version Found In:</td> |
| 474 | 476 | @ <td colspan="3" valign="top" class="tktDspValue"> |
| 475 | 477 | @ $<foundin> |
| 476 | 478 | @ </td></tr> |
| 477 | -@ <tr><td>Description & Comments:</td></tr> | |
| 478 | -@ <tr><td colspan="5" class="tktDspValue"> | |
| 479 | +@ | |
| 479 | 480 | @ <th1> |
| 480 | -@ if {[info exists plaintext]} { | |
| 481 | -@ set r [randhex] | |
| 482 | -@ wiki "<verbatim-$r links>\n$comment\n</verbatim-$r>" | |
| 483 | -@ } else { | |
| 484 | -@ wiki $comment | |
| 481 | +@ if {[info exists comment] && [string length $comment]>10} { | |
| 482 | +@ html { | |
| 483 | +@ <tr><td colspan="5">Legacy Description & Comments:</td></tr> | |
| 484 | +@ <tr><td colspan="5" class="tktDspValue"> | |
| 485 | +@ } | |
| 486 | +@ if {[info exists plaintext]} { | |
| 487 | +@ set r [randhex] | |
| 488 | +@ wiki "<verbatim-$r links>\n$comment\n</verbatim-$r>" | |
| 489 | +@ } else { | |
| 490 | +@ wiki $comment | |
| 491 | +@ } | |
| 492 | +@ } | |
| 493 | +@ set seenRow 0 | |
| 494 | +@ set alwaysPlaintext [info exists plaintext] | |
| 495 | +@ query {SELECT datetime(tkt_mtime) AS xdate, login AS xlogin, | |
| 496 | +@ mimetype as xmimetype, icomment AS xcomment | |
| 497 | +@ FROM ticketchng | |
| 498 | +@ WHERE tkt_id=$tkt_id} { | |
| 499 | +@ if {$seenRow} { | |
| 500 | +@ html "<hr>\n" | |
| 501 | +@ } else { | |
| 502 | +@ html "<tr><th>User Comments:</td></tr>\n" | |
| 503 | +@ html "<tr><td colspan=''5'' class=''tktDspValue''>\n" | |
| 504 | +@ set seenRow 1 | |
| 505 | +@ } | |
| 506 | +@ html "[htmlize $xlogin] added on $xdate:\n" | |
| 507 | +@ if {$alwaysPlaintext || $xmimetype eq "text/plain"} { | |
| 508 | +@ set r [randhex] | |
| 509 | +@ wiki "<verbatim-$r>[string trimright $xcomment]</verbatim-$r>\n" | |
| 510 | +@ } elseif {$xmimetype eq "text/x-fossil-wiki"} { | |
| 511 | +@ wiki "<p>\n[string trimright $xcomment]\n</p>\n" | |
| 512 | +@ } elseif {$xmimetype eq "text/html"} { | |
| 513 | +@ wiki "<p><nowiki>\n[string trimright $xcomment]\n</nowiki>\n" | |
| 514 | +@ } else { | |
| 515 | +@ set r [randhex] | |
| 516 | +@ wiki "<verbatim-$r links>[string trimright $xcomment]</verbatim-$r>\n" | |
| 517 | +@ } | |
| 485 | 518 | @ } |
| 486 | 519 | @ </th1> |
| 487 | 520 | @ </td></tr> |
| 488 | 521 | @ </table> |
| 489 | 522 | ; |
| @@ -515,33 +548,21 @@ | ||
| 515 | 548 | } |
| 516 | 549 | |
| 517 | 550 | static const char zDefaultEdit[] = |
| 518 | 551 | @ <th1> |
| 519 | 552 | @ if {![info exists mutype]} {set mutype {[links only]}} |
| 553 | +@ if {![info exists icomment]} {set icomment {}} | |
| 520 | 554 | @ if {![info exists username]} {set username $login} |
| 521 | 555 | @ if {[info exists submit]} { |
| 522 | -@ if {[info exists cmappnd]} { | |
| 523 | -@ if {[string length $cmappnd]>0} { | |
| 524 | -@ set ctxt "\n\n<hr />\n<i>[htmlize $login]" | |
| 525 | -@ if {$username ne $login} { | |
| 526 | -@ set ctxt "$ctxt claiming to be [htmlize $username]" | |
| 527 | -@ } | |
| 528 | -@ set ctxt "$ctxt added on [date] UTC:</i><br />" | |
| 529 | -@ if {$mutype eq "Plain Text"} { | |
| 530 | -@ set r [randhex] | |
| 531 | -@ set x "<verbatim-$r>\n[string trimright $cmappnd]\n</verbatim-$r>" | |
| 532 | -@ } elseif {$mutype eq {[links only]}} { | |
| 533 | -@ set r [randhex] | |
| 534 | -@ set x [string trimright $cmappnd] | |
| 535 | -@ set x "<verbatim-$r links>\n$x\n</verbatim-$r>" | |
| 536 | -@ } elseif {$mutype eq "HTML"} { | |
| 537 | -@ set x "<nowiki>\n[string trimright $cmappnd]\n</nowiki>" | |
| 538 | -@ } else { | |
| 539 | -@ set x $cmappnd | |
| 540 | -@ } | |
| 541 | -@ append_field comment "$ctxt\n$x\n" | |
| 542 | -@ } | |
| 556 | +@ if {$mutype eq "Wiki"} { | |
| 557 | +@ set mimetype text/x-fossil-wiki | |
| 558 | +@ } elseif {$mutype eq "HTML"} { | |
| 559 | +@ set mimetype text/html | |
| 560 | +@ } elseif {$mutype eq {[links only]}} { | |
| 561 | +@ set mimetype text/x-fossil-plain | |
| 562 | +@ } else { | |
| 563 | +@ set mimetype text/plain | |
| 543 | 564 | @ } |
| 544 | 565 | @ submit_ticket |
| 545 | 566 | @ } |
| 546 | 567 | @ </th1> |
| 547 | 568 | @ <table cellpadding="5"> |
| @@ -582,81 +603,39 @@ | ||
| 582 | 603 | @ |
| 583 | 604 | @ <tr><td class="tktDspLabel">Version Found In:</td><td> |
| 584 | 605 | @ <input type="text" name="foundin" size="50" value="$<foundin>" /> |
| 585 | 606 | @ </td></tr> |
| 586 | 607 | @ |
| 587 | -@ <th1> | |
| 588 | -@ if {![info exists eall]} {set eall 0} | |
| 589 | -@ if {[info exists aonlybtn]} {set eall 0} | |
| 590 | -@ if {[info exists eallbtn]} {set eall 1} | |
| 591 | -@ if {![hascap w]} {set eall 0} | |
| 592 | -@ if {![info exists cmappnd]} {set cmappnd {}} | |
| 593 | -@ set nline [linecount $comment 15 10] | |
| 594 | -@ enable_output $eall | |
| 595 | -@ </th1> | |
| 596 | -@ | |
| 597 | -@ <tr><td colspan="2"> | |
| 598 | -@ Description And Comments: (Format is "Wiki" or text/x-fossil-wiki)<br /> | |
| 599 | -@ <textarea name="comment" cols="80" rows="$nline" | |
| 600 | -@ wrap="virtual" class="wikiedit">$<comment></textarea><br /> | |
| 601 | -@ <input type="hidden" name="eall" value="1" /> | |
| 602 | -@ <input type="hidden" name="mutype" value="$<mutype>" /> | |
| 603 | -@ </td></tr> | |
| 604 | -@ | |
| 605 | -@ <th1>enable_output [expr {!$eall}]</th1> | |
| 606 | -@ <tr><td colspan="2"> | |
| 607 | -@ Append Remark with format | |
| 608 | +@ <tr><td colspan="2"> | |
| 609 | +@ Append Remark with format | |
| 608 | 610 | @ <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1> |
| 609 | 611 | @ from |
| 610 | 612 | @ <input type="text" name="username" value="$<username>" size="30" />:<br /> |
| 611 | -@ <textarea name="cmappnd" cols="80" rows="15" | |
| 612 | -@ wrap="virtual" class="wikiedit">$<cmappnd></textarea> | |
| 613 | +@ <textarea name="icomment" cols="80" rows="15" | |
| 614 | +@ wrap="virtual" class="wikiedit">$<icomment></textarea> | |
| 613 | 615 | @ </td></tr> |
| 614 | -@ <th1>enable_output 1</th1> | |
| 615 | 616 | @ |
| 616 | 617 | @ <th1>enable_output [info exists preview]</th1> |
| 617 | 618 | @ <tr><td colspan="2"> |
| 618 | 619 | @ Description Preview:<br><hr> |
| 619 | 620 | @ <th1> |
| 620 | -@ if {$eall} { | |
| 621 | -@ wiki $comment | |
| 622 | -@ } elseif {$mutype eq "Wiki"} { | |
| 623 | -@ wiki $cmappnd | |
| 621 | +@ if {$mutype eq "Wiki"} { | |
| 622 | +@ wiki $icomment | |
| 624 | 623 | @ } elseif {$mutype eq "Plain Text"} { |
| 625 | 624 | @ set r [randhex] |
| 626 | -@ wiki "<verbatim-$r>\n[string trimright $cmappnd]\n</verbatim-$r>" | |
| 625 | +@ wiki "<verbatim-$r>\n[string trimright $icomment]\n</verbatim-$r>" | |
| 627 | 626 | @ } elseif {$mutype eq {[links only]}} { |
| 628 | 627 | @ set r [randhex] |
| 629 | -@ wiki "<verbatim-$r links>\n[string trimright $cmappnd]</verbatim-$r>" | |
| 628 | +@ wiki "<verbatim-$r links>\n[string trimright $icomment]</verbatim-$r>" | |
| 630 | 629 | @ } else { |
| 631 | -@ wiki "<nowiki>\n[string trimright $cmappnd]</nowiki>" | |
| 630 | +@ wiki "<nowiki>\n[string trimright $icomment]\n</nowiki>" | |
| 632 | 631 | @ } |
| 633 | 632 | @ </th1> |
| 634 | 633 | @ <hr> |
| 635 | 634 | @ </td></tr> |
| 636 | 635 | @ <th1>enable_output 1</th1> |
| 637 | 636 | @ |
| 638 | -@ | |
| 639 | -@ <th1>enable_output [expr {[hascap w] && !$eall}]</th1> | |
| 640 | -@ <tr> | |
| 641 | -@ <td align="right"> | |
| 642 | -@ <input type="submit" name="eallbtn" value="Edit All" /> | |
| 643 | -@ </td> | |
| 644 | -@ <td align="left">Edit the entire description history</td> | |
| 645 | -@ </tr> | |
| 646 | -@ | |
| 647 | -@ | |
| 648 | -@ <th1>enable_output $eall</th1> | |
| 649 | -@ <tr> | |
| 650 | -@ <td align="right"> | |
| 651 | -@ <input type="submit" name="aonlybtn" value="Append Only" /> | |
| 652 | -@ </td> | |
| 653 | -@ <td align="left">Append a remark to the end of the description, leaving | |
| 654 | -@ prior description text unchanged.</td> | |
| 655 | -@ </tr> | |
| 656 | -@ | |
| 657 | -@ <th1>enable_output 1</th1> | |
| 658 | 637 | @ <tr> |
| 659 | 638 | @ <td align="right"> |
| 660 | 639 | @ <input type="submit" name="preview" value="Preview" /> |
| 661 | 640 | @ </td> |
| 662 | 641 | @ <td align="left">See how the description will appear after formatting.</td> |
| 663 | 642 |
| --- src/tktsetup.c | |
| +++ src/tktsetup.c | |
| @@ -291,24 +291,19 @@ | |
| 291 | static const char zDefaultNew[] = |
| 292 | @ <th1> |
| 293 | @ if {![info exists mutype]} {set mutype {[links only]}} |
| 294 | @ if {[info exists submit]} { |
| 295 | @ set status Open |
| 296 | @ set ctxt "<i>By [htmlize $login] on [date] UTC:</i><br />" |
| 297 | @ if {$mutype eq "HTML"} { |
| 298 | @ set x "<nowiki>\n[string trimright $comment]\n</nowiki>" |
| 299 | @ } elseif {$mutype eq "Plain Text"} { |
| 300 | @ set r [randhex] |
| 301 | @ set x "<verbatim-$r>\n[string trimright $comment]\n</verbatim-$r>" |
| 302 | @ } elseif {$mutype eq {[links only]}} { |
| 303 | @ set r [randhex] |
| 304 | @ set x [string trimright $comment] |
| 305 | @ set x "<verbatim-$r links>\n$x\n</verbatim-$r>" |
| 306 | @ } else { |
| 307 | @ set x $comment |
| 308 | @ } |
| 309 | @ set comment "$ctxt\n$x" |
| 310 | @ submit_ticket |
| 311 | @ } |
| 312 | @ </th1> |
| 313 | @ <h1 style="text-align: center;">Enter A New Ticket</h1> |
| 314 | @ <table cellpadding="5"> |
| @@ -358,49 +353,49 @@ | |
| 358 | @ the problem can be reproduced. Provide as much detail as |
| 359 | @ possible. Format: |
| 360 | @ <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1> |
| 361 | @ <br /> |
| 362 | @ <th1>set nline [linecount $comment 50 10]</th1> |
| 363 | @ <textarea name="comment" cols="80" rows="$nline" |
| 364 | @ wrap="virtual" class="wikiedit">$<comment></textarea><br /> |
| 365 | @ </tr> |
| 366 | @ |
| 367 | @ <th1>enable_output A [info exists preview]</th1> |
| 368 | @ <tr><td colspan="3"> |
| 369 | @ Description Preview:<br /><hr /> |
| 370 | @ <th1> |
| 371 | @ if {$mutype eq "Wiki"} { |
| 372 | @ wiki $comment |
| 373 | @ } elseif {$mutype eq "Plain Text"} { |
| 374 | @ set r [randhex] |
| 375 | @ wiki "<verbatim-$r>\n[string trimright $comment]\n</verbatim-$r>" |
| 376 | @ } elseif {$mutype eq {[links only]}} { |
| 377 | @ set r [randhex] |
| 378 | @ wiki "<verbatim-$r links>\n[string trimright $comment]\n</verbatim-$r>" |
| 379 | @ } else { |
| 380 | @ wiki "<nowiki>\n[string trimright $comment]\n</nowiki>" |
| 381 | @ } |
| 382 | @ </th1> |
| 383 | @ <hr /></td></tr> |
| 384 | @ <th1>enable_output B 1</th1> |
| 385 | @ |
| 386 | @ <tr> |
| 387 | @ <td><td align="left"> |
| 388 | @ <input type="submit" name="preview" value="Preview" /> |
| 389 | @ </td> |
| 390 | @ <td align="left">See how the description will appear after formatting.</td> |
| 391 | @ </tr> |
| 392 | @ |
| 393 | @ <th1>enable_output C [info exists preview]</th1> |
| 394 | @ <tr> |
| 395 | @ <td><td align="left"> |
| 396 | @ <input type="submit" name="submit" value="Submit" /> |
| 397 | @ </td> |
| 398 | @ <td align="left">After filling in the information above, press this |
| 399 | @ button to create the new ticket</td> |
| 400 | @ </tr> |
| 401 | @ <th1>enable_output D 1</th1> |
| 402 | @ |
| 403 | @ <tr> |
| 404 | @ <td><td align="left"> |
| 405 | @ <input type="submit" name="cancel" value="Cancel" /> |
| 406 | @ </td> |
| @@ -436,11 +431,18 @@ | |
| 436 | } |
| 437 | |
| 438 | static const char zDefaultView[] = |
| 439 | @ <table cellpadding="5"> |
| 440 | @ <tr><td class="tktDspLabel">Ticket UUID:</td> |
| 441 | @ <td class="tktDspValue" colspan="3">$<tkt_uuid></td></tr> |
| 442 | @ <tr><td class="tktDspLabel">Title:</td> |
| 443 | @ <td class="tktDspValue" colspan="3"> |
| 444 | @ $<title> |
| 445 | @ </td></tr> |
| 446 | @ <tr><td class="tktDspLabel">Status:</td><td class="tktDspValue"> |
| @@ -472,18 +474,49 @@ | |
| 472 | @ </tr> |
| 473 | @ <tr><td class="tktDspLabel">Version Found In:</td> |
| 474 | @ <td colspan="3" valign="top" class="tktDspValue"> |
| 475 | @ $<foundin> |
| 476 | @ </td></tr> |
| 477 | @ <tr><td>Description & Comments:</td></tr> |
| 478 | @ <tr><td colspan="5" class="tktDspValue"> |
| 479 | @ <th1> |
| 480 | @ if {[info exists plaintext]} { |
| 481 | @ set r [randhex] |
| 482 | @ wiki "<verbatim-$r links>\n$comment\n</verbatim-$r>" |
| 483 | @ } else { |
| 484 | @ wiki $comment |
| 485 | @ } |
| 486 | @ </th1> |
| 487 | @ </td></tr> |
| 488 | @ </table> |
| 489 | ; |
| @@ -515,33 +548,21 @@ | |
| 515 | } |
| 516 | |
| 517 | static const char zDefaultEdit[] = |
| 518 | @ <th1> |
| 519 | @ if {![info exists mutype]} {set mutype {[links only]}} |
| 520 | @ if {![info exists username]} {set username $login} |
| 521 | @ if {[info exists submit]} { |
| 522 | @ if {[info exists cmappnd]} { |
| 523 | @ if {[string length $cmappnd]>0} { |
| 524 | @ set ctxt "\n\n<hr />\n<i>[htmlize $login]" |
| 525 | @ if {$username ne $login} { |
| 526 | @ set ctxt "$ctxt claiming to be [htmlize $username]" |
| 527 | @ } |
| 528 | @ set ctxt "$ctxt added on [date] UTC:</i><br />" |
| 529 | @ if {$mutype eq "Plain Text"} { |
| 530 | @ set r [randhex] |
| 531 | @ set x "<verbatim-$r>\n[string trimright $cmappnd]\n</verbatim-$r>" |
| 532 | @ } elseif {$mutype eq {[links only]}} { |
| 533 | @ set r [randhex] |
| 534 | @ set x [string trimright $cmappnd] |
| 535 | @ set x "<verbatim-$r links>\n$x\n</verbatim-$r>" |
| 536 | @ } elseif {$mutype eq "HTML"} { |
| 537 | @ set x "<nowiki>\n[string trimright $cmappnd]\n</nowiki>" |
| 538 | @ } else { |
| 539 | @ set x $cmappnd |
| 540 | @ } |
| 541 | @ append_field comment "$ctxt\n$x\n" |
| 542 | @ } |
| 543 | @ } |
| 544 | @ submit_ticket |
| 545 | @ } |
| 546 | @ </th1> |
| 547 | @ <table cellpadding="5"> |
| @@ -582,81 +603,39 @@ | |
| 582 | @ |
| 583 | @ <tr><td class="tktDspLabel">Version Found In:</td><td> |
| 584 | @ <input type="text" name="foundin" size="50" value="$<foundin>" /> |
| 585 | @ </td></tr> |
| 586 | @ |
| 587 | @ <th1> |
| 588 | @ if {![info exists eall]} {set eall 0} |
| 589 | @ if {[info exists aonlybtn]} {set eall 0} |
| 590 | @ if {[info exists eallbtn]} {set eall 1} |
| 591 | @ if {![hascap w]} {set eall 0} |
| 592 | @ if {![info exists cmappnd]} {set cmappnd {}} |
| 593 | @ set nline [linecount $comment 15 10] |
| 594 | @ enable_output $eall |
| 595 | @ </th1> |
| 596 | @ |
| 597 | @ <tr><td colspan="2"> |
| 598 | @ Description And Comments: (Format is "Wiki" or text/x-fossil-wiki)<br /> |
| 599 | @ <textarea name="comment" cols="80" rows="$nline" |
| 600 | @ wrap="virtual" class="wikiedit">$<comment></textarea><br /> |
| 601 | @ <input type="hidden" name="eall" value="1" /> |
| 602 | @ <input type="hidden" name="mutype" value="$<mutype>" /> |
| 603 | @ </td></tr> |
| 604 | @ |
| 605 | @ <th1>enable_output [expr {!$eall}]</th1> |
| 606 | @ <tr><td colspan="2"> |
| 607 | @ Append Remark with format |
| 608 | @ <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1> |
| 609 | @ from |
| 610 | @ <input type="text" name="username" value="$<username>" size="30" />:<br /> |
| 611 | @ <textarea name="cmappnd" cols="80" rows="15" |
| 612 | @ wrap="virtual" class="wikiedit">$<cmappnd></textarea> |
| 613 | @ </td></tr> |
| 614 | @ <th1>enable_output 1</th1> |
| 615 | @ |
| 616 | @ <th1>enable_output [info exists preview]</th1> |
| 617 | @ <tr><td colspan="2"> |
| 618 | @ Description Preview:<br><hr> |
| 619 | @ <th1> |
| 620 | @ if {$eall} { |
| 621 | @ wiki $comment |
| 622 | @ } elseif {$mutype eq "Wiki"} { |
| 623 | @ wiki $cmappnd |
| 624 | @ } elseif {$mutype eq "Plain Text"} { |
| 625 | @ set r [randhex] |
| 626 | @ wiki "<verbatim-$r>\n[string trimright $cmappnd]\n</verbatim-$r>" |
| 627 | @ } elseif {$mutype eq {[links only]}} { |
| 628 | @ set r [randhex] |
| 629 | @ wiki "<verbatim-$r links>\n[string trimright $cmappnd]</verbatim-$r>" |
| 630 | @ } else { |
| 631 | @ wiki "<nowiki>\n[string trimright $cmappnd]</nowiki>" |
| 632 | @ } |
| 633 | @ </th1> |
| 634 | @ <hr> |
| 635 | @ </td></tr> |
| 636 | @ <th1>enable_output 1</th1> |
| 637 | @ |
| 638 | @ |
| 639 | @ <th1>enable_output [expr {[hascap w] && !$eall}]</th1> |
| 640 | @ <tr> |
| 641 | @ <td align="right"> |
| 642 | @ <input type="submit" name="eallbtn" value="Edit All" /> |
| 643 | @ </td> |
| 644 | @ <td align="left">Edit the entire description history</td> |
| 645 | @ </tr> |
| 646 | @ |
| 647 | @ |
| 648 | @ <th1>enable_output $eall</th1> |
| 649 | @ <tr> |
| 650 | @ <td align="right"> |
| 651 | @ <input type="submit" name="aonlybtn" value="Append Only" /> |
| 652 | @ </td> |
| 653 | @ <td align="left">Append a remark to the end of the description, leaving |
| 654 | @ prior description text unchanged.</td> |
| 655 | @ </tr> |
| 656 | @ |
| 657 | @ <th1>enable_output 1</th1> |
| 658 | @ <tr> |
| 659 | @ <td align="right"> |
| 660 | @ <input type="submit" name="preview" value="Preview" /> |
| 661 | @ </td> |
| 662 | @ <td align="left">See how the description will appear after formatting.</td> |
| 663 |
| --- src/tktsetup.c | |
| +++ src/tktsetup.c | |
| @@ -291,24 +291,19 @@ | |
| 291 | static const char zDefaultNew[] = |
| 292 | @ <th1> |
| 293 | @ if {![info exists mutype]} {set mutype {[links only]}} |
| 294 | @ if {[info exists submit]} { |
| 295 | @ set status Open |
| 296 | @ if {$mutype eq "HTML"} { |
| 297 | @ set mimetype "text/html" |
| 298 | @ } elseif {$mutype eq "Wiki"} { |
| 299 | @ set mimetype "text/x-fossil-wiki" |
| 300 | @ } elseif {$mutype eq {[links only]}} { |
| 301 | @ set mimetype "text/x-fossil-plain" |
| 302 | @ } else { |
| 303 | @ set mimetype "text/plain" |
| 304 | @ } |
| 305 | @ submit_ticket |
| 306 | @ } |
| 307 | @ </th1> |
| 308 | @ <h1 style="text-align: center;">Enter A New Ticket</h1> |
| 309 | @ <table cellpadding="5"> |
| @@ -358,49 +353,49 @@ | |
| 353 | @ the problem can be reproduced. Provide as much detail as |
| 354 | @ possible. Format: |
| 355 | @ <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1> |
| 356 | @ <br /> |
| 357 | @ <th1>set nline [linecount $comment 50 10]</th1> |
| 358 | @ <textarea name="icomment" cols="80" rows="$nline" |
| 359 | @ wrap="virtual" class="wikiedit">$<icomment></textarea><br /> |
| 360 | @ </tr> |
| 361 | @ |
| 362 | @ <th1>enable_output [info exists preview]</th1> |
| 363 | @ <tr><td colspan="3"> |
| 364 | @ Description Preview:<br /><hr /> |
| 365 | @ <th1> |
| 366 | @ if {$mutype eq "Wiki"} { |
| 367 | @ wiki $icomment |
| 368 | @ } elseif {$mutype eq "Plain Text"} { |
| 369 | @ set r [randhex] |
| 370 | @ wiki "<verbatim-$r>[string trimright $icomment]\n</verbatim-$r>" |
| 371 | @ } elseif {$mutype eq {[links only]}} { |
| 372 | @ set r [randhex] |
| 373 | @ wiki "<verbatim-$r links>[string trimright $icomment]\n</verbatim-$r>" |
| 374 | @ } else { |
| 375 | @ wiki "<nowiki>$icomment\n</nowiki>" |
| 376 | @ } |
| 377 | @ </th1> |
| 378 | @ <hr /></td></tr> |
| 379 | @ <th1>enable_output 1</th1> |
| 380 | @ |
| 381 | @ <tr> |
| 382 | @ <td><td align="left"> |
| 383 | @ <input type="submit" name="preview" value="Preview" /> |
| 384 | @ </td> |
| 385 | @ <td align="left">See how the description will appear after formatting.</td> |
| 386 | @ </tr> |
| 387 | @ |
| 388 | @ <th1>enable_output [info exists preview]</th1> |
| 389 | @ <tr> |
| 390 | @ <td><td align="left"> |
| 391 | @ <input type="submit" name="submit" value="Submit" /> |
| 392 | @ </td> |
| 393 | @ <td align="left">After filling in the information above, press this |
| 394 | @ button to create the new ticket</td> |
| 395 | @ </tr> |
| 396 | @ <th1>enable_output 1</th1> |
| 397 | @ |
| 398 | @ <tr> |
| 399 | @ <td><td align="left"> |
| 400 | @ <input type="submit" name="cancel" value="Cancel" /> |
| 401 | @ </td> |
| @@ -436,11 +431,18 @@ | |
| 431 | } |
| 432 | |
| 433 | static const char zDefaultView[] = |
| 434 | @ <table cellpadding="5"> |
| 435 | @ <tr><td class="tktDspLabel">Ticket UUID:</td> |
| 436 | @ <th1> |
| 437 | @ if {[hascap s]} { |
| 438 | @ html "<td class=''tktDspValue'' colspan=''3''>$tkt_uuid " |
| 439 | @ html "($tkt_id)</td></tr>\n" |
| 440 | @ } else { |
| 441 | @ html "<td class=''tktDspValue'' colspan=''3''>$tkt_uuid</td></tr>\n" |
| 442 | @ } |
| 443 | @ </th1> |
| 444 | @ <tr><td class="tktDspLabel">Title:</td> |
| 445 | @ <td class="tktDspValue" colspan="3"> |
| 446 | @ $<title> |
| 447 | @ </td></tr> |
| 448 | @ <tr><td class="tktDspLabel">Status:</td><td class="tktDspValue"> |
| @@ -472,18 +474,49 @@ | |
| 474 | @ </tr> |
| 475 | @ <tr><td class="tktDspLabel">Version Found In:</td> |
| 476 | @ <td colspan="3" valign="top" class="tktDspValue"> |
| 477 | @ $<foundin> |
| 478 | @ </td></tr> |
| 479 | @ |
| 480 | @ <th1> |
| 481 | @ if {[info exists comment] && [string length $comment]>10} { |
| 482 | @ html { |
| 483 | @ <tr><td colspan="5">Legacy Description & Comments:</td></tr> |
| 484 | @ <tr><td colspan="5" class="tktDspValue"> |
| 485 | @ } |
| 486 | @ if {[info exists plaintext]} { |
| 487 | @ set r [randhex] |
| 488 | @ wiki "<verbatim-$r links>\n$comment\n</verbatim-$r>" |
| 489 | @ } else { |
| 490 | @ wiki $comment |
| 491 | @ } |
| 492 | @ } |
| 493 | @ set seenRow 0 |
| 494 | @ set alwaysPlaintext [info exists plaintext] |
| 495 | @ query {SELECT datetime(tkt_mtime) AS xdate, login AS xlogin, |
| 496 | @ mimetype as xmimetype, icomment AS xcomment |
| 497 | @ FROM ticketchng |
| 498 | @ WHERE tkt_id=$tkt_id} { |
| 499 | @ if {$seenRow} { |
| 500 | @ html "<hr>\n" |
| 501 | @ } else { |
| 502 | @ html "<tr><th>User Comments:</td></tr>\n" |
| 503 | @ html "<tr><td colspan=''5'' class=''tktDspValue''>\n" |
| 504 | @ set seenRow 1 |
| 505 | @ } |
| 506 | @ html "[htmlize $xlogin] added on $xdate:\n" |
| 507 | @ if {$alwaysPlaintext || $xmimetype eq "text/plain"} { |
| 508 | @ set r [randhex] |
| 509 | @ wiki "<verbatim-$r>[string trimright $xcomment]</verbatim-$r>\n" |
| 510 | @ } elseif {$xmimetype eq "text/x-fossil-wiki"} { |
| 511 | @ wiki "<p>\n[string trimright $xcomment]\n</p>\n" |
| 512 | @ } elseif {$xmimetype eq "text/html"} { |
| 513 | @ wiki "<p><nowiki>\n[string trimright $xcomment]\n</nowiki>\n" |
| 514 | @ } else { |
| 515 | @ set r [randhex] |
| 516 | @ wiki "<verbatim-$r links>[string trimright $xcomment]</verbatim-$r>\n" |
| 517 | @ } |
| 518 | @ } |
| 519 | @ </th1> |
| 520 | @ </td></tr> |
| 521 | @ </table> |
| 522 | ; |
| @@ -515,33 +548,21 @@ | |
| 548 | } |
| 549 | |
| 550 | static const char zDefaultEdit[] = |
| 551 | @ <th1> |
| 552 | @ if {![info exists mutype]} {set mutype {[links only]}} |
| 553 | @ if {![info exists icomment]} {set icomment {}} |
| 554 | @ if {![info exists username]} {set username $login} |
| 555 | @ if {[info exists submit]} { |
| 556 | @ if {$mutype eq "Wiki"} { |
| 557 | @ set mimetype text/x-fossil-wiki |
| 558 | @ } elseif {$mutype eq "HTML"} { |
| 559 | @ set mimetype text/html |
| 560 | @ } elseif {$mutype eq {[links only]}} { |
| 561 | @ set mimetype text/x-fossil-plain |
| 562 | @ } else { |
| 563 | @ set mimetype text/plain |
| 564 | @ } |
| 565 | @ submit_ticket |
| 566 | @ } |
| 567 | @ </th1> |
| 568 | @ <table cellpadding="5"> |
| @@ -582,81 +603,39 @@ | |
| 603 | @ |
| 604 | @ <tr><td class="tktDspLabel">Version Found In:</td><td> |
| 605 | @ <input type="text" name="foundin" size="50" value="$<foundin>" /> |
| 606 | @ </td></tr> |
| 607 | @ |
| 608 | @ <tr><td colspan="2"> |
| 609 | @ Append Remark with format |
| 610 | @ <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1> |
| 611 | @ from |
| 612 | @ <input type="text" name="username" value="$<username>" size="30" />:<br /> |
| 613 | @ <textarea name="icomment" cols="80" rows="15" |
| 614 | @ wrap="virtual" class="wikiedit">$<icomment></textarea> |
| 615 | @ </td></tr> |
| 616 | @ |
| 617 | @ <th1>enable_output [info exists preview]</th1> |
| 618 | @ <tr><td colspan="2"> |
| 619 | @ Description Preview:<br><hr> |
| 620 | @ <th1> |
| 621 | @ if {$mutype eq "Wiki"} { |
| 622 | @ wiki $icomment |
| 623 | @ } elseif {$mutype eq "Plain Text"} { |
| 624 | @ set r [randhex] |
| 625 | @ wiki "<verbatim-$r>\n[string trimright $icomment]\n</verbatim-$r>" |
| 626 | @ } elseif {$mutype eq {[links only]}} { |
| 627 | @ set r [randhex] |
| 628 | @ wiki "<verbatim-$r links>\n[string trimright $icomment]</verbatim-$r>" |
| 629 | @ } else { |
| 630 | @ wiki "<nowiki>\n[string trimright $icomment]\n</nowiki>" |
| 631 | @ } |
| 632 | @ </th1> |
| 633 | @ <hr> |
| 634 | @ </td></tr> |
| 635 | @ <th1>enable_output 1</th1> |
| 636 | @ |
| 637 | @ <tr> |
| 638 | @ <td align="right"> |
| 639 | @ <input type="submit" name="preview" value="Preview" /> |
| 640 | @ </td> |
| 641 | @ <td align="left">See how the description will appear after formatting.</td> |
| 642 |