Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 28984 Details for
Bug 113717
Tool to help generate the Project Log from Bugzilla information
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Simple project picker UI / querystring support to wrap around your script to allow other projects to reuse your engine
ip.php (text/php), 3.32 KB, created by
Nick Boldt
on 2005-10-30 16:34:08 EST
(
hide
)
Description:
Simple project picker UI / querystring support to wrap around your script to allow other projects to reuse your engine
Filename:
MIME Type:
Creator:
Nick Boldt
Created:
2005-10-30 16:34:08 EST
Size:
3.32 KB
patch
obsolete
><?php > >require_once "/home/data/httpd/eclipse-php-classes/system/dbconnection_bugs_ro.class.php"; >ini_set("display_errors","1"); > >$prod_id = $_GET["prod_id"]; >$prod_name = $_GET["prod_name"]; > >if ($prod_name && !$prod_id) { > $prod_id = getProductIDFromName($prod_name); >} > >if (!$prod_id) { > doHeader("Choose your project"); > doSelectionForm(); > doFooter(); > exit; >} > >if (!$prod_name && $prod_id) { > $prod_name = getProductNameFromID($prod_id); >} >header("Content-type: text/csv"); >echo "Your report for $prod_name ($prod_id) goes here..."; >// etc. >doFooter(false); > > >/*******************************************************************/ > >function doSelectionForm() { > $dbc = new DBConnectionBugs(); > $dbh = $dbc->connect(); > $sql_info = "SELECT description,name,id FROM products order by name"; > $rs = mysql_query($sql_info, $dbh); > if(mysql_errno($dbh) > 0) { > echo "There was an error processing the query.\n". > $dbc->disconnect(); > $dbh = null; > $dbc = null; > } else { > echo ' > Choose the project for which to generate a report:<br/> > <form method="get"> > <select name="prod_id" onchange=\'document.forms[0].submit();\'>'."\n"; > while ($myrow = mysql_fetch_assoc($rs)) { > echo ' <option value="'.$myrow["id"].'">'.$myrow["name"].': '.$myrow["description"].'</option>'."\n"; > } > echo ' </select><br/> > <input type="submit"> > </form>'."\n"; > } > $dbc->disconnect(); > $rs = null; > $dbh = null; > $dbc = null; >} > >function getProductIDFromName($name) { > $dbc = new DBConnectionBugs(); > $dbh = $dbc->connect(); > if(mysql_errno($dbh) > 0) { > echo "There was an error processing the query.\n". > $dbc->disconnect(); > $dbh = null; > $dbc = null; > } else { > $sql_info = "SELECT id FROM products WHERE name = '".$name."'"; > $rs = mysql_query($sql_info, $dbh); > if ($rs) { > $myrow = mysql_fetch_assoc($rs); > } > if ($myrow && is_array($myrow) && array_key_exists("id",$myrow)) { > return $myrow["id"]; > } else { > return 0; > } > } > $dbc->disconnect(); > $rs = null; > $dbh = null; > $dbc = null; >} > >function getProductNameFromID($id) { > $dbc = new DBConnectionBugs(); > $dbh = $dbc->connect(); > if(mysql_errno($dbh) > 0) { > echo "There was an error processing the query.\n". > $dbc->disconnect(); > $dbh = null; > $dbc = null; > } else { > $sql_info = "SELECT name FROM products WHERE id = $id"; > $rs = mysql_query($sql_info, $dbh); > if ($rs) { > $myrow = mysql_fetch_assoc($rs); > } > if ($myrow && is_array($myrow) && array_key_exists("name",$myrow)) { > return $myrow["name"]; > } else { > return "?"; > } > } > $dbc->disconnect(); > $rs = null; > $dbh = null; > $dbc = null; >} > >function doHeader($name) { > echo ' ><html> ><head> > <title>Eclipse Project IP Log - '.$name.'</title> > <link REL="SHORTCUT ICON" HREF="http://http://eclipse.org/emf/images/eclipse-icons/eclipse32.ico"/> > <link rel="stylesheet" href="http://eclipse.org/emf/includes/style.css" type="text/css"/> ></head> ><body>'."\n"; >} > >function doFooter($isHTML=true) { > echo $isHTML ? "<pre><small><i>\n" : "\n"; > echo "--\n".'$Id: ip.php,v 1.1 2005/10/30 21:29:28 nickb Exp $'."\n"; > echo $isHTML ? "</i></small></pre>\n</body>\n</html>" : "\n"; >} > >?>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 113717
: 28984