Hi All,

Found that I had a need to prepopulate the 'new ticket comment' field
with a template.
I considered inlining the text directly into the template page and
using a conditional, but
found that didn't quite work for my purposes (namely, that I wanted
non-administators to be
able to edit the template, if needed).

TH1 usage: 'wikicontent WIKIPAGE_NAME FALLBACK_TEXT'

The command returns the contents of a wiki page (presently, only real
wiki pages, not embedded docs),
or FALLBACK_TEXT, if the page doesn't exist.

A quick round of comments and criticism would be great before
committing to the main repository.
Also attached is example usage in the context of the ticket new template page.

-B
<th1>
  if {[info exists submit]} {
     set status Open
     submit_ticket
  }
  if {[string length $type]==0} {
     set type Code_Defect
  }
</th1>


<th1>set comment [wikicontent ${type}_Template ${type}_Template]</th1>
<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" />

Attachment: wikicontent.patch
Description: Binary data

_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to