Source

trac.plugins.ticketref / ticketref / model.py

Diff from to

ticketref/model.py

 ]
 TICKETREF = CUSTOM_FIELDS[0]["name"]
 
+UPDATE_TICKET = "UPDATE ticket SET changetime=%s WHERE id=%s"
+
 SELECT_TICKETREF = "SELECT value FROM ticket_custom "\
                    "WHERE ticket=%%s AND name='%s'" % TICKETREF
 INSERT_TICKETREF = "INSERT INTO ticket_custom (ticket, name, value) "\
                    "WHERE ticket=%%s AND name='%s'" % TICKETREF
 DELETE_TICKETREF = "DELETE FROM ticket_custom "\
                    "WHERE ticket=%%s AND name='%s'" % TICKETREF
+
 INSERT_TICKETCHG = "INSERT INTO ticket_change "\
                    "(ticket, time, author, field, oldvalue, newvalue) "\
                    "VALUES (%%s, %%s, '%%s', '%s', '%%s', '%%s')" % TICKETREF
                 c.execute(DELETE_TICKETREF % ref_id)
             c.execute(INSERT_TICKETCHG % (
                 ref_id, self.time_stamp, author, row.strip(), new_text))
+            c.execute(UPDATE_TICKET % (self.time_stamp, ref_id))
 
     def add_cross_reference(self, refs, author):
         c = self.cursor
                     c.execute(UPDATE_TICKETREF % (new_text, ref_id))
                     c.execute(INSERT_TICKETCHG % (ref_id, self.time_stamp,
                                 author, row[0].strip(), new_text))
+                    c.execute(UPDATE_TICKET % (self.time_stamp, ref_id))
             else:
                 c.execute(INSERT_TICKETREF % (ref_id, self.ticket.id))
                 c.execute(INSERT_TICKETCHG % (
                     ref_id, self.time_stamp, author, "", self.ticket.id))
+                c.execute(UPDATE_TICKET % (self.time_stamp, ref_id))
 
     def create(self):
         refs = cnv_text2list(self.ticket[TICKETREF])