From: J. P. H. I. <how...@vo...> - 2003-01-24 03:34:50
|
Hi, I desperately needed working trouble tickets for tomorrow morning, and I went with MoreGroupware. Imagine my surprise when I saw the TTS system did not work quite right. So I threw together a quick hack that makes it somewhat reasonable (time formatting is not implemented, but that's another story entirely). Included is a diff to at least (1) properly insert updates into the database and (2) display the updates in the detail. Let me know if I am on the right track here for this, and if so, I will clean it up, and get time-formatting fixed over the weekend. Attached below is the diff. Thank you, Jamie --- index.php.old 2003-01-23 22:26:57.000000000 -0500 +++ index.php 2003-01-23 22:26:49.000000000 -0500 @@ -88,7 +88,7 @@ $assigneduser=(int)$_POST["_assigned"]; $shortdescription=$conn->quote($_POST["short_desc"]); $longdescription=$conn->quote($_POST["long_desc"]); - $info=(int)$_POST["_infoval"]; + $info=$_POST["_infoval"]; $idtts=(int)$_POST["_idtts"]; $state=(int)$_POST["_status"]; @@ -115,7 +115,7 @@ $id = $conn->GenID('mgw__seq_tts_history'); $sql="INSERT INTO mgw_tts_history (id, id_tts, id_owner, start_date,end_date,lu_date, info, state) - VALUES (".$id.",".$idtts." , ".$_SESSION["MGW"]->userid.", ".$conn->DBTimeStamp(time()).",'', ".$conn->DBTimeStamp(time()).", ".$info.", ".$state.")"; + VALUES (".$id.",".$idtts." , ".$_SESSION["MGW"]->userid.", ".$conn->DBTimeStamp(time()).",'', ".$conn->DBTimeStamp(time()).", '".$info."', ".$state.")"; if(!$conn->Execute($sql)) exit(showSQLerror($sql, $conn->ErrorMsg(), __LINE__, __FILE__)); @@ -181,7 +181,16 @@ $smarty->assign("short_descval", $row["short_desc"]); - $smarty->assign("long_descval", $row["long_desc"]); + $descdata = $row["long_desc"]; + $sql="SELECT * from mgw_tts_history,mgw_users WHERE mgw_tts_history.id_owner=mgw_users.id AND id_tts=".(int)$_GET["id"]." ORDER by mgw_tts_history.id"; + if(!$res = $conn->Execute($sql)) exit(showSQLerror($sql, $conn->ErrorMsg(), __LINE__, __FILE__)); + $row = $res->FetchRow(); + while ($row = $res->FetchRow()) { + $descdata .= "<br><br><u>Update at ". $row["lu_date"]." by ".$row["lastname"].", ".$row["firstname"].":</u><br>"; + + $descdata .= $row["info"]; + } + $smarty->assign("long_descval", $descdata); $smarty->assign("idtxt", getLanguageString("id")); $smarty->assign("idval", (int)$_GET["id"]); |