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

<html>
<head>
<title>New 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() {
    newdefectform.action = "newdefect.php"; 
    newdefectform.submit();
}

</script>

<body bgcolor="#FFFFFF">
<?php include 'header.php'; ?>
<h1>Submit new defect</h1>
<p><?php ttdb_connect($db); ?> <?php $userInfo = ttus_getLoginUserInfo($db); ?> </p>

<form method="post" action="newpost.php" name="newdefectform">
  <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 
	    
	    if ($fProject == "") 
	        $selectedProject =  $userInfo['iiddefaultproject'];
	    else
	        $selectedProject =  $fProject;
	    
	    $selectedProject = gf_generateLookupFieldSelected($db, 
                                     'fProject', 
                                     '',
                                     'select * from project',
                                     'iid',
                                     'sname',
                                     $selectedProject,
                                     false,
                                     'fieldChanged()');
             // echo $selectedProject;
         ?>
     <?php 
        if ($userInfo['iiddefaultproject'] == "")
           echo " <font size=1>Note: you haven't set up your default project yet. You may want to do it in the options tab.</font>";
     ?>
      </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 $fHeadline; ?>">
      </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,
                                     false,
                                     'fieldChanged()');
               //echo $selectedSoftware;
         ?>
         
      </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,
                                     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,
                                     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,
                                     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,
                    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,
                                     false);
         ?>
      </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">
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Description</td>
    <td class="tableFieldContent" width="70%">
        <textarea name="fDescription" cols="80" rows="15"></textarea>
      </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