Author: pwang Date: 2011-12-29 14:55:27 -0800 (Thu, 29 Dec 2011) New Revision: 27883
Modified: new_cytoscape_website/bugreport/bugreport.php Log: updated Modified: new_cytoscape_website/bugreport/bugreport.php =================================================================== --- new_cytoscape_website/bugreport/bugreport.php 2011-12-29 22:53:39 UTC (rev 27882) +++ new_cytoscape_website/bugreport/bugreport.php 2011-12-29 22:55:27 UTC (rev 27883) @@ -1,3 +1,10 @@ +<?php + //include "logininfo.inc"; + + include "functions.php"; +?> + + <?php // mode = 'new', Data is submited by user @@ -72,14 +79,14 @@ } ?> -<script src="http://cytoscape.org/js/footer.js"></script> -</body> -</html> +<?php + showPageTail(); + ///////////////////// End of page //////////////////////////////////// +?> - <?php function isUserInputValid($userInput) { @@ -146,16 +153,17 @@ $cyversion = $bugReport['cyversion']; $os = $bugReport['os']; + $subject = $bugReport['subject']; $description = $bugReport['description']; $dbQuery = ""; if ($reporter_auto_id == NULL){ - $dbQuery = "INSERT INTO bugs (cyversion, os, description, sysdat) Values ('". - $dbQuery .= "'$cyversion',"."'$os',"."'$description'".",now())"; + $dbQuery = "INSERT INTO bugs (cyversion, os, subject, description, sysdat) Values ('". + $dbQuery .= "'$cyversion',"."'$os',"."'$subject',"."'$description'".",now())"; } else { - $dbQuery = "INSERT INTO bugs (reporter_id, cyversion, os, description, sysdat) Values (". - $dbQuery .= "$reporter_auto_id".","."'$cyversion',"."'$os',"."'$description'".",now())"; + $dbQuery = "INSERT INTO bugs (reporter_id, cyversion, os,subject, description, sysdat) Values (". + $dbQuery .= "$reporter_auto_id".","."'$cyversion',"."'$os',"."'$subject',"."'$description'".",now())"; } // Run the query @@ -246,6 +254,12 @@ </div> --> + <div> + <label for="cysubject">Subject</label> + <input name="tfSubject" type="text" id="cysubject" value="<?php if (isset($userInput['cysubject'])) echo $userInput['cysubject']; ?>" /> Optional + </div> + + <div> <label for="taDescription">Problem description</label> </div> @@ -300,7 +314,11 @@ if (isset ($_POST['tfCyversion'])) { $bugReport['cyversion'] = addslashes($_POST['tfCyversion']); } - + + if (isset ($_POST['tfSubject'])) { + $bugReport['cysubject'] = addslashes($_POST['tfSubject']); + } + $bugReport['os'] = getOSFromUserAgent($_SERVER); if (isset ($_POST['taDescription'])) { @@ -360,29 +378,6 @@ } -function getDBConnection($mode) { - // Include the DBMS credentials - include 'db.inc'; - - // Connect to the MySQL DBMS - if ($mode == 'edit') { - if (!($connection = @ mysql_pconnect($dbServer, $cytostaff, $cytostaffPass))) - showerror(); - } - else // $mode == 'new' - { - if (!($connection = @ mysql_pconnect($dbServer, $dbUser, $dbPass))) - showerror(); - } - - // Use the bugs database - if (!mysql_select_db($dbName, $connection)) { - showerror(); - } - return $connection; -} - - function getPageTitle($mode) { // Set the page title based on the mode if ($mode == 'new') { @@ -399,28 +394,6 @@ return $pageTitle; } - -function showPageHeader($pageTitle) { ?> - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - <html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <link href="http://cytoscape.org/css/main.css" type="text/css" rel="stylesheet" media="screen"> - <title><?php echo $pageTitle;?></title> - <script type="text/javascript" - src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> - <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script> - <script type="text/javascript" src="http://cytoscape.org/js/menu_generator.js"></script> - - </head> - - <body> - <div id="container"> - <script src="http://cytoscape.org/js/header.js"></script> -<?php -} -?> - -- You received this message because you are subscribed to the Google Groups "cytoscape-cvs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/cytoscape-cvs?hl=en.
