Jump to content

[SOLVED] Can someone Tell me whats wrong with this script?


bgbs

Recommended Posts

If you go towards the bottom and look at the

 

  <?php

            if ($_SESSION['group'] == "admin") {

              if ($value[11] == "") { echo "[<a href=\"#\" onClick=\"javascript:CloseBug('".date($dateformat)."')\">Close bug</a>]</td></tr>"; }

              else { echo "[<a href=\"#\" onClick=\"javascript:ReopenBug()\">Reopen bug</a>]</td></tr>"; }

            }

        ?>

 

When you click on the CLOSE BUG link it does not input date into the field.  It should be able to do that.

 

Your help is appreciated.  Thanks

 

 

 

 

 

 

 

<?php if (!$allowed) { include("./footer.php"); } ?>
<?php if ($_SESSION['user_id'] == "") { include("./footer.php"); } ?>
<?php if (!empty($_GET['bug_id']) && $_SESSION['group'] != "admin") { include("./footer.php"); } ?>
<?php
if (!empty($_GET['bug_id'])) { 
	echo "<h1>Edit bug</h1>";
	$bug_id = $_GET['bug_id'];
	$record = OpenRecord("bug", "*", "id+=".$bug_id, "", "false"); // read bug details
	$value = explode($delimiter, $record[0]);
	$value[12] = br2nl($value[12]);
}
else {
	echo "<h1>Add bug</h1>";
	$value[10] = date($dateformat);
	$value[8] = "1";
	$value[4] = $_SESSION['project_id'];
	$value[9] = $_SESSION['user_id'];
}		
?>
<form name="bugform" method="POST" action="index.php?page=bug_store">
	<table class="datatable" width="60%">
		<input type="hidden" name="bug_id" value="<?php echo $value[0]; ?>">
		<tr><th>Bug title*:</th><td><input name="name" type="text" size="40" maxlength="40" value="<?php echo $value[1]; ?>"></td></tr>
		<tr><th>Severity:</th><td><?php FillPulldown("severity", $value[2]); ?></td></tr>
		<tr><th>Priority:</th><td><?php FillPulldown("priority", $value[3]); ?></td></tr>
		<input type="hidden" name="project_id" value="<?php echo $value[4]; ?>">
		<tr><th>Type:</th><td><?php FillPulldown("type", $value[6]); ?></td></tr>
		<tr><th>Status:</th><td><?php FillPulldown("status", $value[8]); ?></td></tr>
		<input type="hidden" name="user_id" value="<?php echo $value[9]; ?>">
		<tr><th>Opened:</th><td><input name="opendate" type="text" size="40" maxlength="40" readonly value="<?php echo $value[10]; ?>"></td></tr>
		<tr><th>Closed:</th><td><input name="closedate" type="text" size="40" maxlength="40" readonly value="<?php echo $value[11]; ?>">
		<?php 
			if ($_SESSION['group'] == "admin") { 
				if ($value[11] == "") { echo "[<a href=\"#\" onClick=\"javascript:CloseBug('".date($dateformat)."')\">Close bug</a>]</td></tr>"; } 
				else { echo "[<a href=\"#\" onClick=\"javascript:ReopenBug()\">Reopen bug</a>]</td></tr>"; }
			}
		?>
		<tr><th>Description*:</th><td><textarea name="description" cols="50" rows="10" maxlength="200"><?php echo $value[12]; ?></textarea></td></tr>
		<?php if (!empty($_GET['bug_id'])) { echo "<tr><th>Message:</th><td><textarea name=\"message\" cols=\"50\" rows=\"10\" maxlength=\"200\"></textarea></td></tr>"; } ?>
	</table>
<br />
	<input type="submit" value="Save bug"> (* = fields you must fill in)
</form>	

Link to comment
Share on other sites

Well without seeing the JS function "CloseBug" its kinda hard to say where the problem, other than $dateformat hasn't been set!

 

First thing would be to view source and check the code from their, if its as expect then its a JS problem.

for example

If you got something like this (via view source)

onClick=\javascript:CloseBug('')">Close bug</a>

then its probably a PHP problem, (probably $dateformat is not set or wrong)

 

however this (maybe correct)

onClick=\javascript:CloseBug('10-20-2009')">Close bug</a>

then it would be a JS problem

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.