Fossil

Check-in [340040a8]
Login

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

Overview
Comment:New and improved default ticket setup.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ticket-enhancements
Files: files | file ages | folders
SHA1:340040a8a547825f91302f7770318cf1c9fa5eb3
User & Date: drh 2012-11-23 22:29:43
Context
2012-11-23
23:00
Make timeline-plaintext the default for new repositories. check-in: ae63f485 user: drh tags: ticket-enhancements
22:29
New and improved default ticket setup. check-in: 340040a8 user: drh tags: ticket-enhancements
21:45
Add the [string trimleft] and [string trimright] commands to TH1. check-in: b28ae72e user: drh tags: ticket-enhancements
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/tktsetup.c.

275
276
277
278
279
280
281

282
283














284
285
286
287
288
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
317
318
319

320

321
322
323
324
325
326
327
328
329
330
331

332
333
334
335
336
337
338
339
340
341


342








343

344
345
346
347








...
348
349
350
351
352
353


354
355

356
357
358
359
360
361
362
...
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
...
422
423
424
425
426
427
428
429





430


431
432
433
434
435
436
437
...
456
457
458
459
460
461
462

463
464
465
466
467
468
469
470
471












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

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






550


551
552







553
554



555
556
557
558
559
560
561
    0,
    30
  );
}

static const char zDefaultNew[] =
@ <th1>

@   if {[info exists submit]} {
@      set status Open














@      submit_ticket
@   }
@ </th1>
@ <h1 style="text-align: center;">Enter A New Ticket</h1>
@ <table cellpadding="5">
@ <tr>
@ <td colspan="2">
@ Enter a one-line summary of the ticket:<br />
@ <input type="text" name="title" size="60" value="$<title>" />
@ </td>
@ </tr>
@ 
@ <tr>
@ <td style="text-align: center;">Type:
@ <th1>combobox type $type_choices 1</th1>
@ </td>
@ <td>What type of ticket is this?</td>
@ </tr>
@ 
@ <tr>
@ <td style="text-align: center;">Version: 

@ <input type="text" name="foundin" size="20" value="$<foundin>" />
@ </td>
@ <td>In what version or build number do you observe the problem?</td>

@ </tr>
@ 
@ <tr>
@ <td style="text-align: center;">Severity:
@ <th1>combobox severity $severity_choices 1</th1>
@ </td>
@ <td>How debilitating is the problem?  How badly does the problem
@ affect the operation of the product?</td>
@ </tr>
@ 
@ <tr>
@ <td style="text-align: center;">EMail:

@ <input type="text" name="private_contact" value="$<private_contact>" size="30" />

@ </td>
@ <td><span style="text-decoration: underline;">Not publicly visible</span>.
@ Used by developers to contact you with questions.</td>
@ </tr>
@ 
@ <tr>
@ <td colspan="2">
@ 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.

@ <br />
@ <th1>set nline [linecount $comment 50 10]</th1>
@ <textarea name="comment" cols="80" rows="$nline"
@  wrap="virtual" class="wikiedit">$<comment></textarea><br />
@ <input type="submit" name="preview" value="Preview" /></td>
@ </tr>
@
@ <th1>enable_output [info exists preview]</th1>
@ <tr><td colspan="2">
@ Description Preview:<br /><hr />


@ <th1>wiki $comment</th1>








@ <hr />

@ </td></tr>
@ <th1>enable_output 1</th1>
@ 
@ <tr>








................................................................................
@ <td style="text-align: center;">
@ <input type="submit" name="submit" value="Submit" />
@ </td>
@ <td>After filling in the information above, press this button to create
@ the new ticket</td>
@ </tr>


@ <tr>
@ <td style="text-align: center;">

@ <input type="submit" name="cancel" value="Cancel" />
@ </td>
@ <td>Abandon and forget this ticket</td>
@ </tr>
@ </table>
;

................................................................................

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">
@ <th1>wiki $title</th1>
@ </td></tr>
@ <tr><td class="tktDspLabel">Status:</td><td class="tktDspValue">
@ $<status>
@ </td>
@ <td class="tktDspLabel">Type:</td><td class="tktDspValue">
@ $<type>
@ </td></tr>
................................................................................
@ <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="4" class="tktDspValue">





@ <th1>wiki $comment</th1>


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


/*
** Return the code used to generate the view ticket page
................................................................................
    0,
    40
  );
}

static const char zDefaultEdit[] =
@ <th1>

@   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 /><i>[htmlize $login]"
@         if {$username ne $login} {
@           set ctxt "$ctxt claiming to be [htmlize $username]"
@         }
@         set ctxt "$ctxt added on [date] UTC:</i><br />\n$cmappnd"












@         append_field comment $ctxt
@       }
@     }
@     submit_ticket
@   }
@ </th1>
@ <table cellpadding="5">
@ <tr><td class="tktDspLabel">Title:</td><td>
@ <input type="text" name="title" value="$<title>" size="60" />
@ </td></tr>

@ <tr><td class="tktDspLabel">Status:</td><td>
@ <th1>combobox status $status_choices 1</th1>
@ </td></tr>

@ <tr><td class="tktDspLabel">Type:</td><td>
@ <th1>combobox type $type_choices 1</th1>
@ </td></tr>

@ <tr><td class="tktDspLabel">Severity:</td><td>
@ <th1>combobox severity $severity_choices 1</th1>
@ </td></tr>

@ <tr><td class="tktDspLabel">Priority:</td><td>
@ <th1>combobox priority $priority_choices 1</th1>
@ </td></tr>

@ <tr><td class="tktDspLabel">Resolution:</td><td>
@ <th1>combobox resolution $resolution_choices 1</th1>
@ </td></tr>

@ <tr><td class="tktDspLabel">Subsystem:</td><td>
@ <th1>combobox subsystem $subsystem_choices 1</th1>
@ </td></tr>

@ <th1>enable_output [hascap e]</th1>
@   <tr><td class="tktDspLabel">Contact:</td><td>
@   <input type="text" name="private_contact" size="40"
@    value="$<private_contact>" />
@   </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">
@ <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>


@   Description And Comments:<br />
@   <textarea name="comment" cols="80" rows="$nline"
@    wrap="virtual" class="wikiedit">$<comment></textarea><br />
@   <input type="hidden" name="eall" value="1" />
@   <input type="submit" name="aonlybtn" value="Append Remark" />
@   <input type="submit" name="preview1btn" value="Preview" />

@ <th1>enable_output [expr {!$eall}]</th1>

@   Append Remark from 


@   <input type="text" name="username" value="$<username>" size="30" />:<br />
@   <textarea name="cmappnd" cols="80" rows="15"
@    wrap="virtual" class="wikiedit">$<cmappnd></textarea><br />
@ <th1>enable_output [expr {[hascap w] && !$eall}]</th1>
@   <input type="submit" name="eallbtn" value="Edit All" />
@ <th1>enable_output [expr {!$eall}]</th1>
@   <input type="submit" name="preview2btn" value="Preview" />
@ <th1>enable_output 1</th1>
@ </td></tr>

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


@ <th1>wiki $comment</th1>












@ <hr />
@ </td></tr>
@ <th1>enable_output [info exists preview2btn]</th1>



@ <tr><td colspan="2">
@ Description Preview:<br /><hr />
@ <th1>wiki $cmappnd</th1>


@ <hr />








@ </td></tr>




@ <th1>enable_output 1</th1>






@


@ <tr><td align="right"></td><td>
@ <input type="submit" name="submit" value="Submit Changes" />







@ <input type="submit" name="cancel" value="Cancel" />
@ </td></tr>



@ </table>
;

/*
** Return the code used to generate the edit ticket page
*/
const char *ticket_editpage_code(void){







>


>
>
>
>
>
>
>
>
>
>
>
>
>
>






|






|
|
<
|



|
>


|
>



|
|
<
|




|
>
|
>

|




|



|
>




<

|
|
|

>
>
|
>
>
>
>
>
>
>
>
|
>
|
|


>
>
>
>
>
>
>
>
 
|


|
|

>
>

<
>







 







|







 







|
>
>
>
>
>
|
>
>







 







>




|



|
>
>
>
>
>
>
>
>
>
>
>
>
|









>



>



>



>



>



>



>






>



|









>
>
|



|
|
>

>
|
>
>


|
<
<
<
<
<

>
|
|

|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
|

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

>
>
>
>
>
>
|
>
>
|
|
>
>
>
>
>
>
>

|
>
>
>







275
276
277
278
279
280
281
282
283
284
285
286
287
288
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
317
318
319
320
321
322
323
324
325
326
327
328

329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
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
...
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
...
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
...
501
502
503
504
505
506
507
508
509
510
511
512
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
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
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
665
666
667
668
669
670
671
672
673
674
675
676
    0,
    30
  );
}

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 one-line summary of the ticket:<br />
@ <input type="text" name="title" size="60" value="$<title>" />
@ </td>
@ </tr>
@ 
@ <tr>
@ <td align="right">Type:</td>
@ <td align="left"><th1>combobox type $type_choices 1</th1></td>

@ <td align="left">What type of ticket is this?</td>
@ </tr>
@ 
@ <tr>
@ <td align="right">Version:</td>
@ <td align="left">
@ <input type="text" name="foundin" size="20" value="$<foundin>" />
@ </td>
@ <td align="left">In what version or build number do you observe
@ the problem?</td>
@ </tr>
@ 
@ <tr>
@ <td align="right">Severity:</td>
@ <td align="left"><th1>combobox severity $severity_choices 1</th1></td>

@ <td align="left">How debilitating is the problem?  How badly does the problem
@ affect the operation of the product?</td>
@ </tr>
@ 
@ <tr>
@ <td align="right">EMail:</td>
@ <td align="left">
@ <input type="text" name="private_contact" value="$<private_contact>"
@  size="30" />
@ </td>
@ <td align="left"><u>Not publicly visible</u>
@ Used by developers to contact you with questions.</td>
@ </tr>
@ 
@ <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>
@ </table>
;

................................................................................

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 class="tktDspLabel">Type:</td><td class="tktDspValue">
@ $<type>
@ </td></tr>
................................................................................
@ <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>
;


/*
** Return the code used to generate the view ticket page
................................................................................
    0,
    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>
@ 
@ <tr><td class="tktDspLabel">Status:</td><td>
@ <th1>combobox status $status_choices 1</th1>
@ </td></tr>
@ 
@ <tr><td class="tktDspLabel">Type:</td><td>
@ <th1>combobox type $type_choices 1</th1>
@ </td></tr>
@ 
@ <tr><td class="tktDspLabel">Severity:</td><td>
@ <th1>combobox severity $severity_choices 1</th1>
@ </td></tr>
@ 
@ <tr><td class="tktDspLabel">Priority:</td><td>
@ <th1>combobox priority $priority_choices 1</th1>
@ </td></tr>
@ 
@ <tr><td class="tktDspLabel">Resolution:</td><td>
@ <th1>combobox resolution $resolution_choices 1</th1>
@ </td></tr>
@ 
@ <tr><td class="tktDspLabel">Subsystem:</td><td>
@ <th1>combobox subsystem $subsystem_choices 1</th1>
@ </td></tr>
@ 
@ <th1>enable_output [hascap e]</th1>
@   <tr><td class="tktDspLabel">Contact:</td><td>
@   <input type="text" name="private_contact" size="40"
@    value="$<private_contact>" />
@   </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>
@ 
@ <th1>enable_output [info exists preview]</th1>
@ <tr>
@ <td align="right">
@ <input type="submit" name="submit" value="Submit" />
@ </td>
@ <td align="left">Apply the changes shown above</td>
@ </tr>
@ <th1>enable_output 1</th1>
@ 
@ <tr>
@ <td align="right">
@ <input type="submit" name="cancel" value="Cancel" />
@ </td>
@ <td>Abandon this edit</td>
@ </tr>
@ 
@ </table>
;

/*
** Return the code used to generate the edit ticket page
*/
const char *ticket_editpage_code(void){