Changeset 3356

Show
Ignore:
Timestamp:
03/13/08 12:48:36 (9 months ago)
Author:
coling
Message:

Add more fields/info into the detail of the changelog

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • clientsplugin/0.11/cron/send-client-email

    r3349 r3356  
    280280            # Load in any changes that have happend 
    281281            sql = ("""\ 
    282               SELECT t.id, t.summary, t.description, t.status, t.milestone, m.due, tchng.field, tchng.oldvalue, tchng.newvalue 
     282              SELECT t.id, t.summary, t.description, t.status, t.resolution, t.milestone, m.due, tchng.field, tchng.oldvalue, tchng.newvalue 
    283283              FROM ticket_custom tcust 
    284284              INNER JOIN ticket t ON tcust.ticket=t.id 
     
    287287              WHERE tcust.name = 'client' 
    288288                AND tcust.value = %s 
    289                 AND tchng.field IN ('comment', 'status', 'milestone') 
     289                AND tchng.field IN ('comment', 'status', 'resolution', 'milestone') 
    290290                AND tchng.time >= %s 
    291291                AND tchng.time < %s 
     
    296296            changes = etree.SubElement(xml, 'changes') 
    297297            lasttid = 0 
    298             for tid, summary, description, status, milestone, due, cgfield, oldvalue, newvalue in cur2: 
     298            for tid, summary, description, status, resolution, milestone, due, cgfield, oldvalue, newvalue in cur2: 
    299299              text = '' 
    300300              if 'status' == cgfield: 
     
    302302              elif 'milestone' == cgfield: 
    303303                text = 'Milestone changed from "%s" to "%s" - please check for revised delivery date.' % (oldvalue, newvalue) 
     304              elif 'resolution' == cgfield: 
     305                if oldvalue and not newvalue: 
     306                  text = 'Resolution removed' 
     307                elif not oldvalue and newvalue: 
     308                  text = 'Resolution set to "%s"' % (newvalue) 
     309                else: 
     310                  text = 'Resolution changed from "%s" to "%s"' % (oldvalue, newvalue) 
    304311              elif 'comment' == cgfield: 
    305312                # Todo - extract... 
     
    322329                ticket.append(etree.XML('<description>%s</description>' % wiki_to_html(extract_client_text(description), self.env, self.req))) 
    323330                etree.SubElement(ticket, 'status').text = status 
     331                etree.SubElement(ticket, 'resolution').text = resolution 
    324332                etree.SubElement(ticket, 'milestone').text = milestone 
    325333                etree.SubElement(ticket, 'due').text = myformat_date(due) 
    326334                changelog = etree.SubElement(ticket, 'changelog') 
    327335 
    328               changelog.append(etree.XML('<detail>%s</detail>' % wiki_to_html(text, self.env, self.req))) 
     336              detail = etree.XML('<detail>%s</detail>' % wiki_to_html(text, self.env, self.req)) 
     337              detail.set('field', cgfield) 
     338              if oldvalue: 
     339                detail.set('oldvalue', oldvalue) 
     340              if newvalue: 
     341                detail.set('newvalue', newvalue) 
     342              changelog.append(detail) 
    329343              lasttid = tid 
    330344