def remember_changes(request, form, ticket): new, old = field_changes(form) h = tickets_history() h.ticket = ticket h.new = json.dumps(new) h.old = json.dumps(old) h.action = 4 h.save(user=request.user)
def add_history(request, ticket, typ, data): from yats.models import tickets_history if typ == 10: old = {'show_start': str(data[1])} new = {'show_start': str(data[0])} if typ == 9: old = {'todo': data[1]} new = {'todo': data[0]} if typ == 8: old = {'file': data} new = {'file': ''} elif typ == 5: old = {'file': ''} new = {'file': data} elif typ == 6: old = {'comment': ''} new = {'comment': data} elif typ == 7: old = { 'comment': '', 'assigned': data['old']['assigned'], 'state': data['old']['state'], 'priority': data['old']['priority'], } new = { 'comment': data['new']['comment'], 'assigned': data['new']['assigned'], 'state': data['new']['state'], 'priority': data['new']['priority'], } elif typ == 3: old = {'reference': ''} new = {'reference': '#%s' % data} elif typ == 2: old = {'closed': str(True)} new = {'closed': str(False)} if data: old['comment'] = '' new['comment'] = data elif typ == 1: old = {'closed': str(False)} new = {'closed': str(True)} h = tickets_history() h.ticket = ticket h.new = json.dumps(new) h.old = json.dumps(old) h.action = typ h.save(user=request.user)
def add_history(request, ticket, typ, data): from yats.models import tickets_history if typ == 10: old = {'show_start': unicode(data[1])} new = {'show_start': unicode(data[0])} if typ == 9: old = {'todo': data[1]} new = {'todo': data[0]} if typ == 8: old = {'file': data} new = {'file': ''} elif typ == 5: old = {'file': ''} new = {'file': data} elif typ == 6: old = {'comment': ''} new = {'comment': data} elif typ == 7: old = { 'comment': '', 'assigned': data['old']['assigned'], 'state': data['old']['state'] } new = { 'comment': data['new']['comment'], 'assigned': data['new']['assigned'], 'state': data['new']['state'] } elif typ == 3: old = {'reference': ''} new = {'reference': '#%s' % data} elif typ == 2: old = {'closed': unicode(True)} new = {'closed': unicode(False)} if data: old['comment'] = '' new['comment'] = data elif typ == 1: old = {'closed': unicode(False)} new = {'closed': unicode(True)} h = tickets_history() h.ticket = ticket h.new = json.dumps(new) h.old = json.dumps(old) h.action = typ h.save(user=request.user)
def add_history(request, ticket, typ, data): if typ == 5: old = {'file': ''} new = {'file': data} elif typ == 6: old = {'comment': ''} new = {'comment': data} elif typ == 7: old = { 'comment': '', 'assigned': data['old']['assigned'], 'state': data['old']['state'] } new = { 'comment': data['new']['comment'], 'assigned': data['new']['assigned'], 'state': data['new']['state'] } elif typ == 3: old = {'reference': ''} new = {'reference': '#%s' % data} elif typ == 2: old = {'closed': unicode(True)} new = {'closed': unicode(False)} if data: old['comment'] = '' new['comment'] = data elif typ == 1: old = {'closed': unicode(False)} new = {'closed': unicode(True)} h = tickets_history() h.ticket = ticket h.new = json.dumps(new) h.old = json.dumps(old) h.action = typ h.save(user=request.user)