From a42987c2b5ef397f3877675c99857d37b35b0dab Mon Sep 17 00:00:00 2001 From: Phuoc Cao Date: Tue, 25 Apr 2017 21:30:00 +0200 Subject: [PATCH] correction creation d'un rdv --- mondumas/models/agenda.py | 5 +++-- mondumas/templates/agenda/rdv_edit.pt | 6 +++--- mondumas/views/agenda.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mondumas/models/agenda.py b/mondumas/models/agenda.py index 8b87d06..19452d4 100644 --- a/mondumas/models/agenda.py +++ b/mondumas/models/agenda.py @@ -113,9 +113,10 @@ def update_rdv(request, nodossier, nolig, comment, commentvi, date_rdv): ddate = datetime.strptime(date_rdv, '%d-%m-%Y %H:%M') datevi = ddate.strftime("%Y-%m-%d") heurevi = date_rdv[-5:] - + auj = date.today().strftime("%Y-%m-%d") + if nolig == '0': - query = "INSERT INTO %s SET societe='%s', datevi='%s', heurevi='%s', comment='%s', commentvi='%s'" % (table, societe, datevi, heurevi, comment, commentvi) + query = "INSERT INTO %s SET societe='%s',no_id=%s,date='%s',datevi='%s',heurevi='%s',comment='%s',commentvi='%s'" % (table, societe, no_id,auj,datevi, heurevi, comment, commentvi) else: query = "UPDATE %s SET datevi='%s', heurevi='%s', comment='%s', commentvi='%s' where societe = '%s' and no_id=%s and nolig=%s;" % (table, datevi, heurevi, comment, commentvi, societe, no_id, nolig) diff --git a/mondumas/templates/agenda/rdv_edit.pt b/mondumas/templates/agenda/rdv_edit.pt index 80c2a1e..1634c77 100644 --- a/mondumas/templates/agenda/rdv_edit.pt +++ b/mondumas/templates/agenda/rdv_edit.pt @@ -70,14 +70,14 @@