Fossil

Check-in [fb3b0f66]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change the default ticketing scripts to take advantage of TICKETCHNG.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ticket-enhancements
Files: files | file ages | folders
SHA1:fb3b0f66a352ae6bcf12c49359ceeed092dd2c95
User & Date: drh 2012-11-26 19:32:30
Context
2012-11-26
21:30
Fix a string-quoting error in the previous commit. check-in: 3c8195c8 user: drh tags: ticket-enhancements
19:32
Change the default ticketing scripts to take advantage of TICKETCHNG. check-in: fb3b0f66 user: drh tags: ticket-enhancements
19:16
More trouble-shooting and debugging aids for ticket processing: With debug_tktnew and debug_tktedit or with tktview?showfields, a listing of the aField[] data structure in ticket handling code is shown at the top of the screen. check-in: 7de5f6c0 user: drh tags: ticket-enhancements
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/tktsetup.c.

289
290
291
292
293
294
295
296
297
298

299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
...
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
...
434
435
436
437
438
439
440
441







442
443
444
445
446
447
448
...
470
471
472
473
474
475
476




477
478
479

480
481
482
483
484



























485
486
487
488
489
490
491
...
513
514
515
516
517
518
519

520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537

538
539
540
541
542
543
544
545
546
547
548
549
...
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
}

static const char zDefaultNew[] =
@ <th1>
@   if {![info exists mutype]} {set mutype {[links only]}}
@   if {[info exists submit]} {
@      set status Open
@      set ctxt "<i>By [htmlize $login] on [date] UTC:</i><br />"
@      if {$mutype eq "HTML"} {
@        set x "<nowiki>\n[string trimright $comment]\n</nowiki>"

@      } elseif {$mutype eq "Plain Text"} {
@        set r [randhex]
@        set x "<verbatim-$r>\n[string trimright $comment]\n</verbatim-$r>"
@      } elseif {$mutype eq {[links only]}} {
@        set r [randhex]
@        set x [string trimright $comment]
@        set x "<verbatim-$r links>\n$x\n</verbatim-$r>"
@      } else {
@        set x $comment
@      }
@      set comment "$ctxt\n$x"
@      submit_ticket
@   }
@ </th1>
@ <h1 style="text-align: center;">Enter A New Ticket</h1>
@ <table cellpadding="5">
@ <tr>
@ <td colspan="3">
................................................................................
@ Enter a detailed description of the problem.
@ For code defects, be sure to provide details on exactly how
@ the problem can be reproduced.  Provide as much detail as
@ possible.  Format:
@ <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1>
@ <br />
@ <th1>set nline [linecount $comment 50 10]</th1>
@ <textarea name="comment" cols="80" rows="$nline"
@  wrap="virtual" class="wikiedit">$<comment></textarea><br />
@ </tr>
@ 
@ <th1>enable_output A [info exists preview]</th1>
@ <tr><td colspan="3">
@ Description Preview:<br /><hr />
@ <th1>
@ if {$mutype eq "Wiki"} {
@   wiki $comment
@ } elseif {$mutype eq "Plain Text"} {
@   set r [randhex]
@   wiki "<verbatim-$r>\n[string trimright $comment]\n</verbatim-$r>"
@ } elseif {$mutype eq {[links only]}} {
@   set r [randhex]
@   wiki "<verbatim-$r links>\n[string trimright $comment]\n</verbatim-$r>"
@ } else {
@   wiki "<nowiki>\n[string trimright $comment]\n</nowiki>"
@ }
@ </th1>
@ <hr /></td></tr>
@ <th1>enable_output B 1</th1>
@ 
@ <tr>
@ <td><td align="left">
@ <input type="submit" name="preview" value="Preview" />
@ </td>
@ <td align="left">See how the description will appear after formatting.</td>
@ </tr>
@ 
@ <th1>enable_output C [info exists preview]</th1>
@ <tr>
@ <td><td align="left">
@ <input type="submit" name="submit" value="Submit" />
@ </td>
@ <td align="left">After filling in the information above, press this 
@ button to create the new ticket</td>
@ </tr>
@ <th1>enable_output D 1</th1>
@ 
@ <tr>
@ <td><td align="left">
@ <input type="submit" name="cancel" value="Cancel" />
@ </td>
@ <td>Abandon and forget this ticket</td>
@ </tr>
................................................................................
    40
  );
}

static const char zDefaultView[] =
@ <table cellpadding="5">
@ <tr><td class="tktDspLabel">Ticket&nbsp;UUID:</td>
@ <td class="tktDspValue" colspan="3">$<tkt_uuid></td></tr>







@ <tr><td class="tktDspLabel">Title:</td>
@ <td class="tktDspValue" colspan="3">
@ $<title>
@ </td></tr>
@ <tr><td class="tktDspLabel">Status:</td><td class="tktDspValue">
@ $<status>
@ </td>
................................................................................
@   </td>
@ <th1>enable_output 1</th1>
@ </tr>
@ <tr><td class="tktDspLabel">Version&nbsp;Found&nbsp;In:</td>
@ <td colspan="3" valign="top" class="tktDspValue">
@ $<foundin>
@ </td></tr>




@ <tr><td>Description &amp; Comments:</td></tr>
@ <tr><td colspan="5" class="tktDspValue">
@ <th1>

@ if {[info exists plaintext]} {
@   set r [randhex]
@   wiki "<verbatim-$r links>\n$comment\n</verbatim-$r>"
@ } else {
@   wiki $comment



























@ }
@ </th1>
@ </td></tr>
@ </table>
;


................................................................................
    40
  );
}

static const char zDefaultEdit[] =
@ <th1>
@   if {![info exists mutype]} {set mutype {[links only]}}

@   if {![info exists username]} {set username $login}
@   if {[info exists submit]} {
@     if {[info exists cmappnd]} {
@       if {[string length $cmappnd]>0} {
@         set ctxt "\n\n<hr />\n<i>[htmlize $login]"
@         if {$username ne $login} {
@           set ctxt "$ctxt claiming to be [htmlize $username]"
@         }
@         set ctxt "$ctxt added on [date] UTC:</i><br />"
@         if {$mutype eq "Plain Text"} {
@           set r [randhex]
@           set x "<verbatim-$r>\n[string trimright $cmappnd]\n</verbatim-$r>"
@         } elseif {$mutype eq {[links only]}} {
@           set r [randhex]
@           set x [string trimright $cmappnd]
@           set x "<verbatim-$r links>\n$x\n</verbatim-$r>"
@         } elseif {$mutype eq "HTML"} {
@           set x "<nowiki>\n[string trimright $cmappnd]\n</nowiki>"

@         } else {
@           set x $cmappnd
@         }
@         append_field comment "$ctxt\n$x\n"
@       }
@     }
@     submit_ticket
@   }
@ </th1>
@ <table cellpadding="5">
@ <tr><td class="tktDspLabel">Title:</td><td>
@ <input type="text" name="title" value="$<title>" size="60" />
................................................................................
@   </td></tr>
@ <th1>enable_output 1</th1>
@ 
@ <tr><td class="tktDspLabel">Version&nbsp;Found&nbsp;In:</td><td>
@ <input type="text" name="foundin" size="50" value="$<foundin>" />
@ </td></tr>
@ 
@ <th1>
@   if {![info exists eall]} {set eall 0}
@   if {[info exists aonlybtn]} {set eall 0}
@   if {[info exists eallbtn]} {set eall 1}
@   if {![hascap w]} {set eall 0}
@   if {![info exists cmappnd]} {set cmappnd {}}
@   set nline [linecount $comment 15 10]
@   enable_output $eall
@ </th1>
@ 
@ <tr><td colspan="2">
@   Description And Comments:  (Format is "Wiki" or text/x-fossil-wiki)<br />
@   <textarea name="comment" cols="80" rows="$nline"
@    wrap="virtual" class="wikiedit">$<comment></textarea><br />
@   <input type="hidden" name="eall" value="1" />
@   <input type="hidden" name="mutype" value="$<mutype>" />
@ </td></tr>
@ 
@ <th1>enable_output [expr {!$eall}]</th1>
@ <tr><td colspan="2">
@   Append Remark with format 
@   <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1>
@   from
@   <input type="text" name="username" value="$<username>" size="30" />:<br />
@   <textarea name="cmappnd" cols="80" rows="15"
@    wrap="virtual" class="wikiedit">$<cmappnd></textarea>
@ </td></tr>
@ <th1>enable_output 1</th1>
@ 
@ <th1>enable_output [info exists preview]</th1>
@ <tr><td colspan="2">
@ Description Preview:<br><hr>
@ <th1>
@ if {$eall} {
@   wiki $comment
@ } elseif {$mutype eq "Wiki"} {
@   wiki $cmappnd
@ } elseif {$mutype eq "Plain Text"} {
@   set r [randhex]
@   wiki "<verbatim-$r>\n[string trimright $cmappnd]\n</verbatim-$r>"
@ } elseif {$mutype eq {[links only]}} {
@   set r [randhex]
@   wiki "<verbatim-$r links>\n[string trimright $cmappnd]</verbatim-$r>"
@ } else {
@   wiki "<nowiki>\n[string trimright $cmappnd]</nowiki>"
@ }
@ </th1>
@ <hr>
@ </td></tr>
@ <th1>enable_output 1</th1>
@ 
@ 
@ <th1>enable_output [expr {[hascap w] && !$eall}]</th1>
@ <tr>
@ <td align="right">
@   <input type="submit" name="eallbtn" value="Edit All" />
@ </td>
@ <td align="left">Edit the entire description history</td>
@ </tr>
@ 
@ 
@ <th1>enable_output $eall</th1>
@ <tr>
@ <td align="right">
@   <input type="submit" name="aonlybtn" value="Append Only" />
@ </td>
@ <td align="left">Append a remark to the end of the description, leaving
@ prior description text unchanged.</td>
@ </tr>
@ 
@ <th1>enable_output 1</th1>
@ <tr>
@ <td align="right">
@ <input type="submit" name="preview" value="Preview" />
@ </td>
@ <td align="left">See how the description will appear after formatting.</td>
@ </tr>
@ 







<

<
>
|
|
<

|
<
<

|

<







 







|
|


|




|


|


|

|



|








|







|







 







|
>
>
>
>
>
>
>







 







>
>
>
>
|
|
<
>
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>


<
|
|
<
<
<
<
|
|
<
|
<
<
<
<
<
>
|
|
<
<
<







 







<
<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<
|



|
|

<





<
<
|
|


|


|

|






<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







289
290
291
292
293
294
295

296

297
298
299

300
301


302
303
304

305
306
307
308
309
310
311
...
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
...
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
...
472
473
474
475
476
477
478
479
480
481
482
483
484

485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
...
546
547
548
549
550
551
552
553
554
555

556
557




558
559

560





561
562
563



564
565
566
567
568
569
570
...
601
602
603
604
605
606
607










608









609
610
611
612
613
614
615

616
617
618
619
620


621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636




















637
638
639
640
641
642
643
}

static const char zDefaultNew[] =
@ <th1>
@   if {![info exists mutype]} {set mutype {[links only]}}
@   if {[info exists submit]} {
@      set status Open

@      if {$mutype eq "HTML"} {

@        set mimetype "text/html"
@      } elseif {$mutype eq "Wiki"} {
@        set mimetype "text/x-fossil-wiki"

@      } elseif {$mutype eq {[links only]}} {
@        set mimetype "text/x-fossil-plain"


@      } else {
@        set mimetype "text/plain"
@      }

@      submit_ticket
@   }
@ </th1>
@ <h1 style="text-align: center;">Enter A New Ticket</h1>
@ <table cellpadding="5">
@ <tr>
@ <td colspan="3">
................................................................................
@ Enter a detailed description of the problem.
@ For code defects, be sure to provide details on exactly how
@ the problem can be reproduced.  Provide as much detail as
@ possible.  Format:
@ <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1>
@ <br />
@ <th1>set nline [linecount $comment 50 10]</th1>
@ <textarea name="icomment" cols="80" rows="$nline"
@  wrap="virtual" class="wikiedit">$<icomment></textarea><br />
@ </tr>
@ 
@ <th1>enable_output [info exists preview]</th1>
@ <tr><td colspan="3">
@ Description Preview:<br /><hr />
@ <th1>
@ if {$mutype eq "Wiki"} {
@   wiki $icomment
@ } elseif {$mutype eq "Plain Text"} {
@   set r [randhex]
@   wiki "<verbatim-$r>[string trimright $icomment]\n</verbatim-$r>"
@ } elseif {$mutype eq {[links only]}} {
@   set r [randhex]
@   wiki "<verbatim-$r links>[string trimright $icomment]\n</verbatim-$r>"
@ } else {
@   wiki "<nowiki>$icomment\n</nowiki>"
@ }
@ </th1>
@ <hr /></td></tr>
@ <th1>enable_output 1</th1>
@ 
@ <tr>
@ <td><td align="left">
@ <input type="submit" name="preview" value="Preview" />
@ </td>
@ <td align="left">See how the description will appear after formatting.</td>
@ </tr>
@ 
@ <th1>enable_output [info exists preview]</th1>
@ <tr>
@ <td><td align="left">
@ <input type="submit" name="submit" value="Submit" />
@ </td>
@ <td align="left">After filling in the information above, press this 
@ button to create the new ticket</td>
@ </tr>
@ <th1>enable_output 1</th1>
@ 
@ <tr>
@ <td><td align="left">
@ <input type="submit" name="cancel" value="Cancel" />
@ </td>
@ <td>Abandon and forget this ticket</td>
@ </tr>
................................................................................
    40
  );
}

static const char zDefaultView[] =
@ <table cellpadding="5">
@ <tr><td class="tktDspLabel">Ticket&nbsp;UUID:</td>
@ <th1>
@ if {[hascap s]} {
@   html "<td class=''tktDspValue'' colspan=''3''>$tkt_uuid "
@   html "($tkt_id)</td></tr>\n"
@ } else {
@   html "<td class=''tktDspValue'' colspan=''3''>$tkt_uuid</td></tr>\n"
@ }
@ </th1>
@ <tr><td class="tktDspLabel">Title:</td>
@ <td class="tktDspValue" colspan="3">
@ $<title>
@ </td></tr>
@ <tr><td class="tktDspLabel">Status:</td><td class="tktDspValue">
@ $<status>
@ </td>
................................................................................
@   </td>
@ <th1>enable_output 1</th1>
@ </tr>
@ <tr><td class="tktDspLabel">Version&nbsp;Found&nbsp;In:</td>
@ <td colspan="3" valign="top" class="tktDspValue">
@ $<foundin>
@ </td></tr>
@ 
@ <th1>
@ if {[info exists comment] && [string length $comment]>10} {
@   html {
@     <tr><td colspan="5">Legacy Description &amp; Comments:</td></tr>
@     <tr><td colspan="5" class="tktDspValue">

@   }
@   if {[info exists plaintext]} {
@     set r [randhex]
@     wiki "<verbatim-$r links>\n$comment\n</verbatim-$r>"
@   } else {
@     wiki $comment
@   }
@ }
@ set seenRow 0
@ set alwaysPlaintext [info exists plaintext]
@ query {SELECT datetime(tkt_mtime) AS xdate, login AS xlogin,
@               mimetype as xmimetype, icomment AS xcomment
@          FROM ticketchng
@         WHERE tkt_id=$tkt_id} {
@   if {$seenRow} {
@     html "<hr>\n"
@   } else {
@     html "<tr><th>User Comments:</td></tr>\n"
@     html "<tr><td colspan=''5'' class=''tktDspValue''>\n"
@     set seenRow 1
@   }
@   html "[htmlize $xlogin] added on $xdate:\n"
@   if {$alwaysPlaintext || $xmimetype eq "text/plain"} {
@     set r [randhex]
@     wiki "<verbatim-$r>[string trimright $xcomment]</verbatim-$r>\n"
@   } elseif {$xmimetype eq "text/x-fossil-wiki"} {
@     wiki "<p>\n[string trimright $xcomment]\n</p>\n"
@   } elseif {$xmimetype eq "text/html"} {
@     wiki "<p><nowiki>\n[string trimright $xcomment]\n</nowiki>\n"
@   } else {
@     set r [randhex]
@     wiki "<verbatim-$r links>[string trimright $xcomment]</verbatim-$r>\n"
@   }
@ }
@ </th1>
@ </td></tr>
@ </table>
;


................................................................................
    40
  );
}

static const char zDefaultEdit[] =
@ <th1>
@   if {![info exists mutype]} {set mutype {[links only]}}
@   if {![info exists icomment]} {set icomment {}}
@   if {![info exists username]} {set username $login}
@   if {[info exists submit]} {

@     if {$mutype eq "Wiki"} {
@       set mimetype text/x-fossil-wiki




@     } elseif {$mutype eq "HTML"} {
@       set mimetype text/html

@     } elseif {$mutype eq {[links only]}} {





@       set mimetype text/x-fossil-plain
@     } else {
@       set mimetype text/plain



@     }
@     submit_ticket
@   }
@ </th1>
@ <table cellpadding="5">
@ <tr><td class="tktDspLabel">Title:</td><td>
@ <input type="text" name="title" value="$<title>" size="60" />
................................................................................
@   </td></tr>
@ <th1>enable_output 1</th1>
@ 
@ <tr><td class="tktDspLabel">Version&nbsp;Found&nbsp;In:</td><td>
@ <input type="text" name="foundin" size="50" value="$<foundin>" />
@ </td></tr>
@ 










@ <tr><td colspan="2">









@   Append Remark with format
@   <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1>
@   from
@   <input type="text" name="username" value="$<username>" size="30" />:<br />
@   <textarea name="icomment" cols="80" rows="15"
@    wrap="virtual" class="wikiedit">$<icomment></textarea>
@ </td></tr>

@ 
@ <th1>enable_output [info exists preview]</th1>
@ <tr><td colspan="2">
@ Description Preview:<br><hr>
@ <th1>


@ if {$mutype eq "Wiki"} {
@   wiki $icomment
@ } elseif {$mutype eq "Plain Text"} {
@   set r [randhex]
@   wiki "<verbatim-$r>\n[string trimright $icomment]\n</verbatim-$r>"
@ } elseif {$mutype eq {[links only]}} {
@   set r [randhex]
@   wiki "<verbatim-$r links>\n[string trimright $icomment]</verbatim-$r>"
@ } else {
@   wiki "<nowiki>\n[string trimright $icomment]\n</nowiki>"
@ }
@ </th1>
@ <hr>
@ </td></tr>
@ <th1>enable_output 1</th1>
@ 




















@ <tr>
@ <td align="right">
@ <input type="submit" name="preview" value="Preview" />
@ </td>
@ <td align="left">See how the description will appear after formatting.</td>
@ </tr>
@