Diff
Not logged in

Differences From:

File src/tkt.c part of check-in [8f423ad438] - Fix a bug in wiki rendering that caused an extra paragraph end tag following a hyperlink. by drh on 2007-10-21 11:11:02. [view]

To:

File src/tkt.c part of check-in [8ffd32c2b7] - Add the ability to edit the CSS for all pages in the Setup menu. Other miscellaneous changes toward getting ticketing to work. by drh on 2007-10-28 20:52:52. [view]

@@ -142,9 +142,9 @@
   int i;
   char *zSep = "SELECT ";
   blob_zero(&sql);
   for(i=0; i<nField; i++){
-    blob_appendf(&sql, "%s%s", zSep, azField[i]);
+    blob_appendf(&sql, "%stkt_%s", zSep, azField[i]);
     zSep = ", ";
   }
   blob_appendf(" FROM ticket WHERE uuid=%Q", PD("name",""));
   db_prepare(&q, "%b", &sql);
@@ -240,9 +240,11 @@
   SbS_AddVerb(pInterp, "setfields", setFieldsCmd, 0);
   zConfig = db_get("ticket-config","");
   SbS_Eval(pInter, zConfig, -1);
   for(i=0; i<sizeof(aVerb)/sizeof(aVerb[0]); i++){
-    SbS_AddVerb(pInterp, aVerb[i].zName, aVerb[i].xVerb, 0);
+    if( flags & aVerb[i].mask ){
+      SbS_AddVerb(pInterp, aVerb[i].zName, aVerb[i].xVerb, 0);
+    }
   }
   /* Extract appropriate template */
   return pInterp;
 }
@@ -255,8 +257,17 @@
   const char *zPage;
   int nPage;
 
   tkt_screen_init(M_NEW);
+  if( P("submit")!=0 ){
+    // * Construct the ticket artifact
+    //    + Prefix
+    //    + Field/Value pairs in sorted order
+    //    + Suffix
+    // * Register the artifact
+    // * Update the ticket table
+    // * redirect to the ticket viewer
+  }
   style_header("New Ticket");
   @ This will become a page for entering new tickets.
   style_footer();
 }
@@ -265,15 +276,40 @@
 ** PAGE: tktview
 ** URL: tktview?name=UUID
 **
 */
-void tktnew_page(void){
+void tktedit_page(void){
+  struct Subscript *pInterp;
+  const char *zPage;
+  int nPage;
+
+  tkt_screen_init(M_VIEW);
+  style_header("View Ticket");
+  @ This will become a page for entering new tickets.
+  style_footer();
+}
+
+/*
+** PAGE: tktedit
+** URL: tktedit?name=UUID
+**
+*/
+void tktedit_page(void){
   struct Subscript *pInterp;
   const char *zPage;
   int nPage;
 
-  tkt_screen_init(M_NEW);
-  style_header("New Ticket");
+  tkt_screen_init(M_EDIT);
+  if( P("submit") ){
+    // * Construct ticket change artifact
+    //   +  Prefix
+    //   +  Modified field/value pairs in sorted order
+    //   +  Suffix
+    // * Register the artifact
+    // * Update the ticket table
+    // * redirect to the ticket viewer
+  }
+  style_header("Edit Ticket");
   @ This will become a page for entering new tickets.
   style_footer();
 }
 #endif