Posted to tcl by fvogel at Sun Nov 26 20:59:17 GMT 2017view raw

  1. <th1>
  2. query {SELECT datetime ($tkt_ctime) AS tkt_cdatetime} {}
  3. query {SELECT datetime ($closedate) AS fmt_closedate} {}
  4. query {SELECT rtrim($tkt_uuid,'f') AS tkt_uuidtrim} {}
  5.  
  6. if {![info exists mutype]} {set mutype {Plain Text}}
  7. if {![info exists icomment]} {set icomment {}}
  8. if {![info exists username]} {set username $login}
  9.  
  10. if {![info exists cmutype]} {
  11. if {$cmimetype eq "text/x-fossil-wiki"} {
  12. set cmutype "Wiki"
  13. } elseif {$cmimetype eq "text/x-fossil-plain"} {
  14. set cmutype {[links only]}
  15. } elseif {$cmimetype eq "text/html"} {
  16. set cmutype "HTML"
  17. } else {
  18. set cmutype {Plain Text}
  19. }
  20. }
  21. if {![info exists comment]} {set comment {}}
  22.  
  23. if {[info exists submit]} {
  24. if {$mutype eq "Wiki"} {
  25. set mimetype text/x-fossil-wiki
  26. } elseif {$mutype eq "HTML"} {
  27. set mimetype text/html
  28. } elseif {$mutype eq {[links only]}} {
  29. set mimetype text/x-fossil-plain
  30. } else {
  31. set mimetype text/plain
  32. }
  33. if {$status eq "Closed" || $status eq "Deleted"} {
  34. set closer $login
  35. query {SELECT julianday('now') AS closedate} {}
  36. } else {
  37. set closer nobody
  38. unset closedate
  39. }
  40.  
  41. submit_ticket
  42. set preview 1
  43. }
  44. </th1>
  45.  
  46. <table cellpadding="5">
  47. <tr><td class="tktDspLabel">Ticket&nbsp;UUID:</td>
  48. <th1>
  49. if {[hascap s]} {
  50. html "<td class='tktDspValue' colspan='3'>$tkt_uuidtrim ($tkt_id)</td>\n"
  51. } else {
  52. html "<td class='tktDspValue' colspan='3'>$tkt_uuidtrim</td>\n"
  53. }
  54. </th1>
  55. </tr>
  56. <tr>
  57. <td align="right">Title:</td>
  58. <td align="left" colspan="3"><input type="text" name="title" value="$<title>" size="60" /></td>
  59. </tr>
  60. <tr>
  61. <tr>
  62. <td align="right">Type:</td>
  63. <td align="left" ><th1>combobox type $type_choices 1</th1></td>
  64. <td align="right">Version:</td>
  65. <td align="left" ><input type="text" name="foundin" size="50" value="$<foundin>" /></td>
  66. </tr>
  67. <tr>
  68. <td class="tktDspLabel">Submitter:</td>
  69. <td class="tktDspValue">$<submitter></td>
  70. <td class="tktDspLabel">Created&nbsp;on:</td>
  71. <td class="tktDspValue">$<tkt_cdatetime></td>
  72. </tr>
  73. <tr>
  74. <td align="right">Subsystem:</td>
  75. <td align="left"><th1>combobox subsystem $subsystem_choices 1</th1></td>
  76. <td align="right">Assigned&nbsp;To:</td>
  77. <td align="left" ><th1>combobox assignee $assignee_choices 1</th1></td>
  78. </tr>
  79. <tr>
  80. <td align="right">Priority:</td>
  81. <td align="left" ><th1>combobox priority $priority_choices 1</th1></td>
  82. <td align="right">Severity:</td>
  83. <td align="left" ><th1>combobox severity $severity_choices 1</th1></td>
  84. </tr>
  85. <tr>
  86. <td align="right">Status:</td>
  87. <td align="left" ><th1>combobox status $status_choices 1</th1></td>
  88. <td class="tktDspLabel">Last&nbsp;Modified:</td>
  89. <td class="tktDspValue">$<tkt_datetime></td>
  90. </tr>
  91. <tr>
  92. <td align="right">Resolution:</td>
  93. <td align="left" ><th1>combobox resolution $resolution_choices 1</th1></td>
  94. <td class="tktDspLabel">Closed&nbsp;By:</td>
  95. <td class="tktDspValue">$<closer></td>
  96. </tr>
  97. <tr>
  98. <th1>enable_output [hascap e]</th1>
  99. <td align="right">Contact:</td>
  100. <td><input type="text" name="private_contact" size="40" value="$<private_contact>" /></td>
  101. <th1>enable_output [expr {![hascap e]}]</th1>
  102. <td>&nbsp;</td>
  103. <td>&nbsp;</td>
  104. <th1>enable_output 1</th1>
  105. <td class="tktDspLabel">Closed&nbsp;on:</td>
  106. <td class="tktDspValue">$<fmt_closedate></td>
  107. </tr>
  108. <tr>
  109. <td align="right">Description:</td>
  110. <td align="left" colspan="3"><th1>combobox cmutype {{Plain Text} HTML Wiki} 1</th1>:</td>
  111. </tr>
  112. <tr>
  113. <td>&nbsp;</td>
  114. <td align="left" colspan="4">
  115. <th1>set nline [linecount $comment 50 10]</th1>
  116. <textarea name="comment" cols="80" rows="$nline" wrap="virtual" class="wikiedit">$<comment></textarea>
  117. </td>
  118. </tr>
  119. <tr>
  120. <td>&nbsp;</td>
  121. <td colspan="2">Append Remark with format
  122. <th1>combobox mutype {{Plain Text} HTML Wiki} 1</th1>
  123. from
  124. <input type="text" name="username" value="$<username>" size="30" />:
  125. <br />
  126. <textarea name="icomment" cols="80" rows="15" wrap="virtual" class="wikiedit">$<icomment></textarea>
  127. </td>
  128. </tr>
  129.  
  130. <th1>enable_output [info exists preview]</th1>
  131. <tr><td colspan="2">
  132. Description Preview:<br><hr>
  133. <th1>
  134. if {$cmutype eq "Wiki"} {
  135. wiki $comment
  136. } elseif {$cmutype eq "Plain Text"} {
  137. set r [randhex]
  138. wiki "<verbatim-$r>\n[string trimright $comment]\n</verbatim-$r>"
  139. } else {
  140. wiki "<nowiki>\n[string trimright $comment]\n</nowiki>"
  141. }
  142. </th1>
  143. <hr>
  144. </td></tr>
  145. <tr><td colspan="2">
  146. Comment Preview:<br><hr>
  147. <th1>
  148. if {$mutype eq "Wiki"} {
  149. wiki $icomment
  150. } elseif {$mutype eq "Plain Text"} {
  151. set r [randhex]
  152. wiki "<verbatim-$r>\n[string trimright $icomment]\n</verbatim-$r>"
  153. } else {
  154. wiki "<nowiki>\n[string trimright $icomment]\n</nowiki>"
  155. }
  156. </th1>
  157. <hr>
  158. </td></tr>
  159. <th1>enable_output 1</th1>
  160.  
  161. <tr>
  162. <td align="right">
  163. <input type="submit" name="preview" value="Preview" />
  164. </td>
  165. <td align="left">See how the description will appear after formatting.</td>
  166. </tr>
  167.  
  168. <th1>enable_output 1</th1>
  169. <tr>
  170. <td align="right">
  171. <input type="submit" name="submit" value="Submit" />
  172. </td>
  173. <td align="left">Apply the changes shown above</td>
  174. </tr>
  175. <th1>enable_output 1</th1>
  176.  
  177. <tr>
  178. <td align="right">
  179. <input type="submit" name="cancel" value="Cancel" />
  180. </td>
  181. <td>Abandon this edit</td>
  182. </tr>
  183. <th1>
  184. set seenRow 0
  185. query {
  186. SELECT datetime(tkt_mtime) AS xdate,
  187. login AS xlogin,
  188. mimetype AS xmimetype,
  189. icomment AS xcomment,
  190. username AS xusername
  191. FROM ticketchng
  192. WHERE tkt_id = $tkt_id
  193. AND length(icomment) > 0
  194. ORDER BY tkt_mtime DESC
  195. } {
  196. if {$seenRow} {
  197. html "<hr>\n"
  198. } else {
  199. html "<tr><td class='tktDspLabel' valign='top'>User Comments:</td>\n"
  200. html " <td colspan='3' class='tktDspValue'>\n"
  201. set seenRow 1
  202. }
  203. if {[info exists showfields]} {
  204. html "<ul><p>date=$xdate<br>login=$xlogin<br>user=$xusername<br>mime=$xmimetype<br>comment=$xcomment</p></ul>"
  205. }
  206. html "[htmlize $xlogin]"
  207. if {$xlogin ne $xusername && [string length $xusername]>0} {
  208. html " (claiming to be [htmlize $xusername])"
  209. }
  210. html " added on $xdate:\n"
  211. if {$xmimetype eq "text/plain"} {
  212. set r [randhex]
  213. wiki "<verbatim-$r>[string trimright $xcomment]</verbatim-$r>\n"
  214. } elseif {$xmimetype eq "text/x-fossil-wiki"} {
  215. wiki "<p>\n[string trimright $xcomment]\n</p>\n"
  216. } elseif {$xmimetype eq "text/html"} {
  217. wiki "<p><nowiki>\n[string trimright $xcomment]\n</nowiki>\n"
  218. } else {
  219. set r [randhex]
  220. wiki "<verbatim-$r links>[string trimright $xcomment]</verbatim-$r>\n"
  221. }
  222. }
  223. if {$seenRow} {html "</td></tr>\n"}
  224. </th1>
  225. </table>