Not logged in
Diff

Differences From Artifact [c567cf64e8]:

  • File src/tktconfig.c — part of check-in [5f3ddcc1b8] at 2007-11-25 21:11:33 on branch trunk — Add ticket configuration editing capability. (user: drh size: 11955) [more...]

To Artifact [60a45e0840]:

  • File src/tktconfig.c — part of check-in [ffe92f1a2f] at 2008-02-13 19:50:27 on branch trunk — The entire header, including the menu bar, is now generated by TH script. This allows the menu bar to be customized by editing the header script. (user: drh size: 10397)

31
32
33
34
35
36
37
38

39
40
41

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

121
122
123
124
125
126

127
128
129
130
131
132
133
134
135




136
137
138
139
140
141
142
143
144
145
146
147


148
149
150
151
152
153
154
155
156


157
158
159
160
161
162
163
164

165
166
167
168
169
170






171
172
173
174
175

176
177
178
179
180
181

182
183
184
185
186
187
188

189
190
191
192
193
194
195

196
197
198
199
200
201
202
203

204
205
206
207
208
209
210
211
212
213
214
215








216

217
218

219
220
221
222

223
224
225

226
227
228

229
230
231
232
233
234
235
236
237
238
239

240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259













260
261

262
263
264
265


266
267
268

269
270
271

272
273
274

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
31
32
33
34
35
36
37

38



39














































40
41
42
43
44
45
46
47
48
49
50
51

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

72
73
74
75
76
77

78
79
80
81
82
83




84
85
86
87
88
89
90
91
92
93
94
95
96
97


98
99
100
101
102
103
104
105
106


107
108
109
110
111
112
113
114
115

116
117
118




119
120
121
122
123
124
125
126
127
128

129
130
131
132
133
134

135
136
137
138
139
140
141

142
143
144
145
146
147
148

149
150
151
152
153
154
155
156

157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177

178


179
180
181
182

183
184
185

186
187
188

189
190
191
192
193
194
195
196
197
198
199

200
201
202
203
204
205
206
207
208












209
210
211
212
213
214
215
216
217
218
219
220
221


222

223


224
225
226
227

228
229
230

231
232
233

234
235
236

237
238
239

240
241
242

243
244
245

246
247

248
249

250
251

252
253

254
255
256
257
258
259
260
261







-
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-












-
+



















-
+





-
+





-
-
-
-
+
+
+
+










-
-
+
+







-
-
+
+







-
+


-
-
-
-
+
+
+
+
+
+




-
+





-
+






-
+






-
+







-
+












+
+
+
+
+
+
+
+
-
+
-
-
+



-
+


-
+


-
+










-
+








-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-

-
-
+
+


-
+


-
+


-
+


-
+


-
+


-
+


-
+

-
+

-
+

-
+

-
+







** This is a sample "ticket configuration" file for fossil.
**
** There is considerable flexibility in how tickets are defined
** in fossil.  Each repository can define its own ticket setup
** differently.  Each repository has an instance of a file, like
** this one that defines how that repository deals with tickets.
**
** This file is in the form of a script in an exceedingly 
** This file is in the form of a script in TH1 - a minimalist
** minimalist scripting language called "subscript".  Here are
** the rules:
**
** TCL clone.
** SYNTAX
**
**     *  The script consists of a sequence of whitespace
**        separated tokens.  Whitespace is ignored, except
**        as its role as a token separator.
**
**     *  Lines that begin with '#' are considered to be whitespace.
**
**     *  Text within matching {...} is consider to be a single "string"
**        token, even if the text spans multiple lines and includes
**        embedded whitespace.  The outermost {...} are not part of
**        the text of the token.
**
**     *  A token that begins with "/" is a string token.
**
**     *  A token that looks like a number is a string token.
**
**     *  Tokens that do not fall under the previous three rules
**        are "verb" tokens.
**
**  PROCESSING:
**
**     *  When a script is processed, the engine reads tokens
**        one by one.
**
**     *  String tokens are pushed onto the stack.
**
**     *  Verb tokens which correspond to the names of variables
**        cause the corresponding variable to be pushed onto the
**        stack.
**
**     *  Verb tokens which correspond to procedures cause the
**        procedures to run.  The procedures might push or pull 
**        values from the stack.
**
** There are just a handful of verbs.  For the purposes of this
** configuration script, there is only a single verb: "set".  The
** "set" verb pops two arguments from the stack.  The topmost is
** the name of a variable.  The second element is the value.  The
** "set" verb sets the value of the named variable.
**
**      VALUE NAME set
**
** This configuration file just sets the values of various variables.
** Some of the variables have special meanings.  The content of some
** of the variables are additional subscript scripts.
*/

/* @-comment: ** */
const char zDefaultTicketConfig[] = 
@ ############################################################################
@ # Every ticket configuration *must* define an SQL statement that creates
@ # the TICKET table.  This table must have three columns named
@ # tkt_id, tkt_uuid, and tkt_mtime.  tkt_id must be the integer primary
@ # key and tkt_uuid and tkt_mtime must be unique.  A configuration should
@ # define addition columns as necessary.  All columns should be in all
@ # lower-case letters and should not begin with "tkt".
@ #
@ {
@ set ticket_sql {
@    CREATE TABLE ticket(
@      -- Do not change any column that begins with tkt_
@      tkt_id INTEGER PRIMARY KEY,
@      tkt_uuid TEXT,
@      tkt_mtime DATE,
@      -- Add as many field as required below this line
@      type TEXT,
@      status TEXT,
@      subsystem TEXT,
@      priority TEXT,
@      severity TEXT,
@      foundin TEXT,
@      contact TEXT,
@      title TEXT,
@      comment TEXT,
@      -- Do not alter this UNIQUE clause:
@      UNIQUE(tkt_uuid, tkt_mtime)
@    );
@    -- Add indices as desired
@ } /ticket_sql set
@ }
@ 
@ ############################################################################
@ # You can define additional variables here.  These variables will be
@ # accessible to the page templates when they run.
@ #
@ {
@ set type_choices {
@    Code_Defect
@    Build_Problem
@    Documentation
@    Feature_Request
@    Incident
@ } /type_choices set
@ {Immediate High Medium Low Zero} /priority_choices set
@ {Critical Severe Important Minor Cosmetic} /severity_choices set
@ {
@ }
@ set priority_choices {Immediate High Medium Low Zero}
@ set severity_choices {Critical Severe Important Minor Cosmetic}
@ set resolution_choices {
@   Open
@   Fixed
@   Rejected
@   Unable_To_Reproduce
@   Works_As_Designed
@   External_Bug
@   Not_A_Bug
@   Duplicate
@   Overcome_By_Events
@   Drive_By_Patch
@ } /resolution_choices set
@ {
@ }
@ set status_choices {
@   Open
@   Verified
@   In_Process
@   Deferred
@   Fixed
@   Tested
@   Closed
@ } /status_choices set
@ {one two three} /subsystem_choices set
@ }
@ set subsystem_choices {one two three}
@ 
@ ##########################################################################
@ # The "tktnew_template" variable is set to text which is a template for
@ # the HTML of the "New Ticket" page.  Within this template, text contained
@ # within [...] is subscript.  That subscript runs when the page is
@ # rendered.
@ #
@ {
@ set tktnew_template {
@   <!-- load database field names not found in CGI with an empty string -->
@   <!-- start a form -->
@   [{
@      {Open} /status set
@       submit_ticket
@   } /submit exists if]
@   <th1>
@     if {[info exists submit]} {
@        set status Open
@        submit_ticket
@     }
@   </th1>
@   <table cellpadding="5">
@   <tr>
@   <td colspan="2">
@   Enter a one-line summary of the problem:<br>
@   <input type="text" name="title" size="60" value="[{} /title get html]">
@   <input type="text" name="title" size="60" value="$<title>">
@   </td>
@   </tr>
@   
@   <tr>
@   <td align="right">Type:
@   [/type type_choices 1 combobox]
@   <th1>combobox type $type_choices 1</th1>
@   </td>
@   <td>What type of ticket is this?</td>
@   </tr>
@   
@   <tr>
@   <td align="right">Version: 
@   <input type="text" name="foundin" size="20" value="[{} /foundin get html]">
@   <input type="text" name="foundin" size="20" value="$<foundin>">
@   </td>
@   <td>In what version or build number do you observer the problem?</td>
@   </tr>
@   
@   <tr>
@   <td align="right">Severity:
@   [/severity severity_choices 1 combobox]
@   <th1>comboboxy severity severity_choices 1</th1>
@   </td>
@   <td>How debilitating is the problem?  How badly does the problem
@   effect the operation of the product?</td>
@   </tr>
@   
@   <tr>
@   <td align="right">EMail:
@   <input type="text" name="contact" value="[{} /contact get html]" size="30">
@   <input type="text" name="contact" value="$<contact>" size="30">
@   </td>
@   <td>Not publically visible. 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>
@      if {![info exists comment]} {
@        set nline 10
@      } else {
@        set nline [linecount $comment]
@        if {$nline>50} {set nline 50}
@      }
@   </th1>
@   <textarea name="comment" cols="80"
@   <textarea name="comment" cols="80" rows="$nline"
@    rows="[{} /comment get linecount 50 max 10 min html]"
@    wrap="virtual" class="wikiedit">[{} /comment get html]</textarea><br>
@    wrap="virtual" class="wikiedit">$<comment></textarea><br>
@   <input type="submit" name="preview" value="Preview">
@   </tr>
@ 
@   [/preview exists enable_output]
@   <th1>enable_output [info exists preview]</th1>
@   <tr><td colspan="2">
@   Description Preview:<br><hr>
@   [{} /comment get wiki]
@   <th1>wiki $comment</th1>
@   <hr>
@   </td></tr>
@   [1 enable_output]
@   <th1>enable_output 1</th1>
@   
@   <tr>
@   <td align="right">
@   <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>
@   </table>
@   <!-- end of form -->
@ } /tktnew_template set
@ }
@ 
@ ##########################################################################
@ # The template for the "edit ticket" page
@ #
@ # Then generated text is inserted inside a form which feeds back to itself.
@ # All CGI parameters are loaded into variables.  All database files are
@ # loaded into variables if they have not previously been loaded by
@ # CGI parameters.
@ {
@   [
@     login /username get /username set
@     {
@       {
@         username login eq /samename set
@         {
@            "\n\n<hr><i>" login " added on " date ":</i><br>\n"
@            cmappnd 6 concat /comment append_field
@         } samename if
@         {
@            "\n\n<hr><i>" login " claiming to be " username " added on " date
@ set tktedit_template {
@   <th1>
@     if {![info exists username]} {set username $login}
@     if {[info exists submit]} {
@       if {[info exists $cmappnd] && [string length $cmappnd]>0} {
@         set ctxt "\n\n<hr><i>"
@         if {$username==$login} {
@           set usr "$ctxt[htmlize $login]"
@         } else {
@           set usr "[htmlize $login claimingn to be [htmlize $username]"
@         }
@         append_field comment \
@            "\n\n<hr><i>$usr added on [date]:</i><br>\n$comment"
@            "</i><br>\n" cmappnd 8 concat /comment append_field
@         } samename not if
@       }
@       } 0 {} /cmappnd get length lt if
@       submit_ticket
@     } /submit exists if
@   ]
@     }
@   </th1>
@   <table cellpadding="5">
@   <tr><td align="right">Title:</td><td>
@   <input type="text" name="title" value="[title html]" size="60">
@   <input type="text" name="title" value="$<title>" size="60">
@   </td></tr>
@   <tr><td align="right">Status:</td><td>
@   [/status status_choices 1 combobox]
@   <th1>combobox status $status_choices 1</th1>
@   </td></tr>
@   <tr><td align="right">Type:</td><td>
@   [/type type_choices 1 combobox]
@   <th1>combobox type $type_choices 1</th1>
@   </td></tr>
@   <tr><td align="right">Severity:</td><td>
@   [/severity severity_choices 1 combobox]
@   <th1>combobox severity $severity_choices 1</th1>
@   </td></tr>
@   <tr><td align="right">Priority:</td><td>
@   [/priority priority_choices 1 combobox]
@   <th1>combobox priority $priority_choices 1</th1>
@   </td></tr>
@   <tr><td align="right">Resolution:</td><td>
@   [/resolution resolution_choices 1 combobox]
@   <th1>combobox resolution $resolution_choices 1</th1>
@   </td></tr>
@   <tr><td align="right">Subsystem:</td><td>
@   [/subsystem subsystem_choices 1 combobox]
@   <th1>combobox subsystem $subsystem_choices 1</th1>
@   </td></tr>
@   [/e hascap enable_output]
@   <th1>enable_output [hascap e]</th1>
@     <tr><td align="right">Contact:</td><td>
@     <input type="text" name="contact" size="40" value="[contact html]">
@     <input type="text" name="contact" size="40" value="$<contact>">
@     </td></tr>
@   [1 enable_output]
@   <th1>enable_output 1</th1>
@   <tr><td align="right">Version&nbsp;Found&nbsp;In:</td><td>
@   <input type="text" name="foundin" size="50" value="[foundin html]">
@   <input type="text" name="foundin" size="50" value="$<foundin>">
@   </td></tr>
@   <tr><td colspan="2">
@
@   [
@      0 /eall get /eall set           # eall means "edit all".  default==no
@      /aonlybtn exists not /eall set  # Edit all if no aonlybtn CGI param
@      /eallbtn exists /eall set       # Edit all if eallbtn CGI param
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
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







-
+



-
+


-
+


-
+


-
+


-
+


-
+


-
+

-
+

-
+

-
+

-
+



-
+


-
+

@   <input type="submit" name="submit" value="Submit Changes">
@   </td></tr>
@   </table>
@ } /tktedit_template set
@ 
@ ##########################################################################
@ # The template for the "view ticket" page
@ {
@ set tktview_template {
@   <!-- load database fields automatically loaded into variables -->
@   <table cellpadding="5">
@   <tr><td align="right">Title:</td><td>
@   [title html]
@   $<title>
@   </td></tr>
@   <tr><td align="right">Status:</td><td>
@   [status html]
@   $<status>
@   </td></tr>
@   <tr><td align="right">Type:</td><td>
@   [type html]
@   $<type>
@   </td></tr>
@   <tr><td align="right">Severity:</td><td>
@   [severity html]
@   $<severity>
@   </td></tr>
@   <tr><td align="right">Priority:</td><td>
@   [priority html]
@   $<priority>
@   </td></tr>
@   <tr><td align="right">Resolution:</td><td>
@   [priority html]
@   $<resolution>
@   </td></tr>
@   <tr><td align="right">Subsystem:</td><td>
@   [subsystem html]
@   $<subsystem>
@   </td></tr>
@   [{e} hascap enable_output]
@   <th1>enable_output [hascap e]</th1>
@     <tr><td align="right">Contact:</td><td>
@     [contact html]
@     $<contact>
@     </td></tr>
@   [1 enable_output]
@   <th1>enable_output 1</th1>
@   <tr><td align="right">Version&nbsp;Found&nbsp;In:</td><td>
@   [foundin html]
@   $<foundin>
@   </td></tr>
@   <tr><td colspan="2">
@   Description And Comments:<br>
@   [comment wiki]
@   <th1>wiki $comment</th1>
@   </td></tr>
@   </table>
@ } /tktview_template set
@ }
;