Location: PHPKode > projects > Druid Defect Control > defectcontrol_0.9.4/tts/editfields.php
<?php include 'usercheck.php' ?>
<?php include 'genform.php' ?>
<?php include 'errors.php' ?>

<html>
<head>
<title>Edit defect</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css">
</head>

<script language="javascript">

function fieldChanged() {
    editdefectform.action = "editfields.php"; 
    editdefectform.submit();
}

</script>

<body bgcolor="#FFFFFF">
<?php include 'header.php'; ?>

<?php 

    ttdb_connect($db); 

    if ($iddefect == "") {
        tter_errorWithBackButton("No defect has been specified.");
        exit;
    }

    $query = "select * from defect where iid = $iddefect";
    $res = ttdb_execQuery($db, $query);
    
    $fields = ttdb_getArray($res);
    
    if (!is_array($fields)) {
        tter_errorWithBackButton("Defect not found ($iddefect)");
        exit;    
    }

?>

<h1>Edit fields for defect <?php echo $iddefect?></h1>

<form method="post" action="editfieldspost.php" name="editdefectform">
  <input type="hidden" name="iddefect" value="<?php print($iddefect); ?>">
  <p>&nbsp;</p>
  <table width="100%" border="0" cellpadding="2" class="tableFieldContent" cellspacing="2">
    <tr> 
      <td class="tableFieldName" width="30%">Project</td>
      <td class="tableFieldContent" width="70%"> 
	<?php $selectedProject = $fProject == "" ? $fields['iidproject'] : $fProject;
	
	    gf_generateLookupFieldSelected($db, 
                                     'fProject', 
                                     '',
                                     'select * from project',
                                     'iid',
                                     'sname',
                                     $selectedProject,
                                     false,
                                     'fieldChanged()');
         ?>
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Headline</td>
    <td class="tableFieldContent" width="70%">
        <input type="text" name="fHeadline" size="60" maxlength="50" 
            value="<?php echo htmlspecialchars($fields['sheadline'])?>">
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Software</td>
    <td class="tableFieldContent" width="70%">
	<?php $selectedSoftware = gf_generateLookupFieldSelected($db, 
                                     'fSoftware', 
                                     '',
                                     'select * from software where iidproject = '.$selectedProject,
                                     'iid',
                                     'sname',
                                     $fSoftware == "" ? $fields['iidsoftware'] : $fSoftware,
                                     false,
                                     'fieldChanged()');
         ?>
      </td>
  </tr>
  <tr> 
      <td class="tableFieldName" width="30%">Repeatability</td>
      <td class="tableFieldContent" width="70%"> 
	<?php gf_generateLookupFieldSelected($db, 
                                     'fRepeat', 
                                     '',
                                     'select * from repeat order by iid',
                                     'iid',
                                     'sname',
                                     $fRepeat == "" ? $fields['iidrepeat'] : $fRepeat,
                                     false);
         ?>
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Defect type</td>
    <td class="tableFieldContent" width="70%">
	<?php gf_generateLookupFieldSelected($db, 
                                     'fDefectType', 
                                     '',
                                     'select * from defecttype order by iid',
                                     'iid',
                                     'sname',
                                     $fDefectType == "" ? $fields['iiddefecttype'] : $fDefectType,
                                     false);
         ?>
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Detection method</td>
    <td class="tableFieldContent" width="70%">
	<?php gf_generateLookupFieldSelected($db, 
                                     'fDetectionMethod', 
                                     '',
                                     'select * from detectionmethod order by iid',
                                     'iid',
                                     'sname',
                                     $fDetectionMethod ? $fields['iiddetectionmethod'] : $fDetectionMethod,
                                     false);
         ?>
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Found on release</td>
    <td class="tableFieldContent" width="70%">
	<?php gf_generateLookupFieldSelected($db, 
                'fDetectedInRelease', 
                '',
                "select * from releases where iidsoftware = $selectedSoftware order by sname",
                'iid',
                'sname',
                $fDetectedInRelease == "" ? $fields['iiddetectedinrelease'] : $fDetectedInRelease,
                false);
         ?>
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Priority</td>
    <td class="tableFieldContent" width="70%">
	<?php gf_generateLookupFieldSelected($db, 
                                     'fPriority', 
                                     '',
                                     'select * from priority order by iid',
                                     'iid',
                                     'sname',
                                     $fPriority == "" ? $fields['iidpriority'] : $fPriority,
                                     false);
         ?>
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Integrated on release</td>
    <td class="tableFieldContent" width="70%">
	<?php gf_generateLookupFieldSelected($db, 
                'fIntegratedOnRelease',
                '',
                "select * from releases where iidsoftware = $selectedSoftware order by sname",
                'iid',
                'sname',
                $fIntegratedOnRelease == "" ? $fields['iidintegratedinrelease'] : $fIntegratedOnRelease,
                true,
                '');
         ?>
      </td>
  </tr>  <tr> 
    <td class="tableFieldName" width="30%">Notify submitter of changes</td>
    <td class="tableFieldContent" width="70%">
        <input type="checkbox" name="fNotifyChanges" value="fNotify" <?php
            if ($fields['bnotifychanges'] == "t")
                echo "checked";?> >
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Resolution type</td>
    <td class="tableFieldContent" width="70%">
	<?php gf_generateLookupFieldSelected($db, 
                                     'fResolutionType',
                                     '',
                                     'select * from resolution',
                                     'iid',
                                     'sname',
                                     $fResolutionType == "" ? $fields['iidresolutiontype'] : $fResolutionType);
         ?>
      </td>
  </tr>
  <tr>
      <td class="tableFieldName" width="30%">&nbsp; </td>
      <td class="tableFieldContent" width="70%">&nbsp; </td>
  </tr>
</table>

  <div align="center">
    <p><input type="submit" name="Submit" value="Accept">
    <input type="button" name="cancel" value="Cancel">
  </p></div>
</form>
<?php ttdb_close($db); ?>
</body>
<?php include 'footer.php'; ?>
</html>
Return current item: Druid Defect Control