parent
147c35f0c6
commit
746be1d2d7
1 changed files with 13 additions and 1 deletions
|
|
@ -198,6 +198,7 @@ class osTicket(): # pylint: disable=invalid-name
|
||||||
|
|
||||||
def post_response(self, response, color='Normal'):
|
def post_response(self, response, color='Normal'):
|
||||||
"""Post a reply to a ticket in osTicket."""
|
"""Post a reply to a ticket in osTicket."""
|
||||||
|
cur_date_time = time.strftime('%Y-%m-%d %H:%M:%S')
|
||||||
lines = []
|
lines = []
|
||||||
test_station = get_test_station_name()
|
test_station = get_test_station_name()
|
||||||
self._connect(silent=True)
|
self._connect(silent=True)
|
||||||
|
|
@ -227,7 +228,7 @@ class osTicket(): # pylint: disable=invalid-name
|
||||||
f" '{STAFF['ID']}',"
|
f" '{STAFF['ID']}',"
|
||||||
f" '{STAFF['Name']}',"
|
f" '{STAFF['Name']}',"
|
||||||
f" '{response}',"
|
f" '{response}',"
|
||||||
f" '{time.strftime('%Y-%m-%d %H:%M:%S')}',"
|
f" '{cur_date_time}',"
|
||||||
f" '{RESPONSE_COLOR_CODES.get(color, 'Normal')}'"
|
f" '{RESPONSE_COLOR_CODES.get(color, 'Normal')}'"
|
||||||
f");"
|
f");"
|
||||||
)
|
)
|
||||||
|
|
@ -238,6 +239,17 @@ class osTicket(): # pylint: disable=invalid-name
|
||||||
except mariadb.errors.Error:
|
except mariadb.errors.Error:
|
||||||
self.errors = True
|
self.errors = True
|
||||||
|
|
||||||
|
# Update ticket last repsonse field
|
||||||
|
sql_cmd = (
|
||||||
|
f"UPDATE `{SQL['DB']}`.`{TABLE_TICKET}`"
|
||||||
|
f"SET `lastresponse` = '{cur_date_time}' "
|
||||||
|
f"WHERE `{TABLE_TICKET}`.`ticket_id` = {self.ticket_id};"
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
self.db_cursor.execute(sql_cmd)
|
||||||
|
except mariadb.errors.Error:
|
||||||
|
self.errors = True
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
self._disconnect()
|
self._disconnect()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue