Fossil

Check-in [46e6a032]
Login

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

Overview
Comment:Get rudimentary ticket editing working.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 46e6a032324baa69275a552deaae8410af8fe663
User & Date: drh 2008-05-16 18:57:59.000
Context
2008-05-17
08:53
Allow the check-in of files show names begin with ".". Add the "private" table to repository schema but do not yet do anything with it. ... (check-in: 525cc35b user: drh tags: trunk)
2008-05-16
18:57
Get rudimentary ticket editing working. ... (check-in: 46e6a032 user: drh tags: trunk)
18:11
Progress toward getting ticket handling to work. ... (check-in: 68c24b18 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/th_main.c.
135
136
137
138
139
140
141









































142
143
144
145
146
147
148
    Blob src;
    blob_init(&src, (char*)argv[1], argl[1]);
    wiki_convert(&src, 0, WIKI_INLINE);
    blob_reset(&src);
  }
  return TH_OK;
}










































/*
** TH command:     hascap STRING
**
** Return true if the user has all of the capabilities listed in STRING.
*/
static int hascapCmd(







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







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
    Blob src;
    blob_init(&src, (char*)argv[1], argl[1]);
    wiki_convert(&src, 0, WIKI_INLINE);
    blob_reset(&src);
  }
  return TH_OK;
}

/*
** TH command:      htmlize STRING
**
** Escape all characters of STRING which have special meaning in HTML.
** Return a new string result.
*/
static int htmlizeCmd(
  Th_Interp *interp, 
  void *p, 
  int argc, 
  const unsigned char **argv, 
  int *argl
){
  char *zOut;
  if( argc!=2 ){
    return Th_WrongNumArgs(interp, "htmlize STRING");
  }
  zOut = htmlize((char*)argv[1], argl[1]);
  Th_SetResult(interp, (unsigned char*)zOut, -1);
  free(zOut);
  return TH_OK;
}

/*
** TH command:      date
**
** Return a string which is the current time and date.
*/
static int dateCmd(
  Th_Interp *interp, 
  void *p, 
  int argc, 
  const unsigned char **argv, 
  int *argl
){
  char *zOut = db_text("??", "SELECT datetime('now')");
  Th_SetResult(interp, (unsigned char*)zOut, -1);
  free(zOut);
  return TH_OK;
}

/*
** TH command:     hascap STRING
**
** Return true if the user has all of the capabilities listed in STRING.
*/
static int hascapCmd(
257
258
259
260
261
262
263


264
265
266
267
268
269
270
    Th_CommandProc xProc;
    void *pContext;
  } aCommand[] = {
    {"combobox",      comboboxCmd,          0},
    {"enable_output", enableOutputCmd,      0},
    {"linecount",     linecntCmd,           0},
    {"hascap",        hascapCmd,            0},


    {"html",          putsCmd,              0},
    {"puts",          putsCmd,       (void*)1},
    {"wiki",          wikiCmd,              0},
  };
  if( g.interp==0 ){
    int i;
    g.interp = Th_CreateInterp(&vtab);







>
>







298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
    Th_CommandProc xProc;
    void *pContext;
  } aCommand[] = {
    {"combobox",      comboboxCmd,          0},
    {"enable_output", enableOutputCmd,      0},
    {"linecount",     linecntCmd,           0},
    {"hascap",        hascapCmd,            0},
    {"htmlize",       htmlizeCmd,           0},
    {"date",          dateCmd,              0},
    {"html",          putsCmd,              0},
    {"puts",          putsCmd,       (void*)1},
    {"wiki",          wikiCmd,              0},
  };
  if( g.interp==0 ){
    int i;
    g.interp = Th_CreateInterp(&vtab);
Changes to src/tktconfig.c.
200
201
202
203
204
205
206
207

208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
@ # All CGI parameters are loaded into variables.  All database files are
@ # loaded into variables if they have not previously been loaded by
@ # CGI parameters.
@ 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"
@       }
@       submit_ticket
@     }
@   </th1>
@   <table cellpadding="5">
@   <tr><td align="right">Title:</td><td>
@   <input type="text" name="title" value="$<title>" size="60">







|
>
|
|
|
|
|
|
|
<







200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215

216
217
218
219
220
221
222
@ # All CGI parameters are loaded into variables.  All database files are
@ # loaded into variables if they have not previously been loaded by
@ # CGI parameters.
@ set tktedit_template {
@   <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]:</i><br>\n$cmappnd"
@           append_field comment $ctxt
@         }

@       }
@       submit_ticket
@     }
@   </th1>
@   <table cellpadding="5">
@   <tr><td align="right">Title:</td><td>
@   <input type="text" name="title" value="$<title>" size="60">