<?php ob_start();
require_once 'database.php';
require_once 'history.php';
require_once 'usercheck.php';
require_once 'errors.php';
define ("NEW_DEFECT_CODE",0);
define ("PROBLEM_ENCLOSURE_TITLE","Problem");
if ($fNotifyChanges == 'fNotify')
$fNotify = "'true'";
else
$fNotify = "'false'";
// connect to the db
ttdb_connect($connection);
ttdb_beginTransaction($connection);
$usernameId = ttus_getLoginUserId($connection);
$date = date('Y-m-d H:i:s');
$updatesql = "update defect set ".
"iidproject = $fProject,".
"iidsoftware =$fSoftware,".
"sheadline = '$fHeadline',".
"iidrepeat = $fRepeat,".
"iiddefecttype = $fDefectType,".
"iiddetectionmethod = $fDetectionMethod,".
"iidpriority = $fPriority,".
"bnotifychanges = $fNotify,".
"iiddetectedinrelease = $fDetectedInRelease,".
"iidintegratedinrelease = $fIntegratedOnRelease,".
"iidresolutiontype = $fResolutionType".
" WHERE iid = $iddefect";
// execute it
$result= ttdb_execQuery($connection,$updatesql);
if(!$result){
tter_errorWithBackButton("An error occurred updating the database. [$updatesql]</br>");
ttdb_rollbackTransaction($connection);
exit;
}
tt_historyEntry($connection, $iddefect, "Fields updated by $ddts_username");
// go to the VisualizeForm page
ttdb_commitTransaction($connection);
ttdb_close($connection);
header("Location: visualize.php?iddefect=$iddefect");
ob_end_flush();
?>