2004-03-15 16:22:00 +00:00
|
|
|
<?
|
|
|
|
|
|
|
|
|
|
/* code to Submit a new application */
|
|
|
|
|
|
2004-03-18 19:26:33 +00:00
|
|
|
// Check the input of a submitted form. And output with a list
|
|
|
|
|
// of errors. (<ul></ul>)
|
|
|
|
|
function checkInput( $fields )
|
|
|
|
|
{
|
|
|
|
|
$errors = "";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-03-18 19:26:33 +00:00
|
|
|
if ( strlen($fields['queueName']) > 200 )
|
|
|
|
|
{
|
|
|
|
|
$errors .= "<li>Your application name is too long.</li>\n";
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-03-18 19:26:33 +00:00
|
|
|
if ( empty( $fields['queueName']) )
|
|
|
|
|
{
|
|
|
|
|
$errors .= "<li>Please enter an application name.</li>\n";
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-03-18 19:26:33 +00:00
|
|
|
if ( empty( $fields['queueVersion']) )
|
|
|
|
|
{
|
|
|
|
|
$errors .= "<li>Please enter an application version.</li>\n";
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-04-06 21:26:10 +00:00
|
|
|
// No vendor entered, and nothing in the list is selected
|
|
|
|
|
if ( empty( $fields['queueVendor']) and $fields['altvendor'] == '0' )
|
2004-03-18 19:26:33 +00:00
|
|
|
{
|
|
|
|
|
$errors .= "<li>Please enter a vendor.</li>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( empty( $fields['queueDesc']) )
|
|
|
|
|
{
|
|
|
|
|
$errors .= "<li>Please enter a description of your application.</li>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Not empty and an invalid e-mail address
|
2004-11-09 22:34:49 +00:00
|
|
|
if ( !empty( $fields['queueEmail'])
|
|
|
|
|
AND !preg_match('/^[A-Za-z0-9\._-]+[@][A-Za-z0-9_-]+([.][A-Za-z0-9_-]+)+[A-Za-z]$/',
|
|
|
|
|
$fields['queueEmail']) )
|
2004-03-18 19:26:33 +00:00
|
|
|
{
|
|
|
|
|
$errors .= "<li>Please enter a valid e-mail address.</li>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( empty($errors) )
|
|
|
|
|
{
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return $errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
include("path.php");
|
|
|
|
|
require(BASE."include/"."incl.php");
|
2004-04-06 21:26:10 +00:00
|
|
|
require(BASE."include/"."tableve.php");
|
2004-03-18 19:26:33 +00:00
|
|
|
global $current;
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-03-18 19:26:33 +00:00
|
|
|
if ($_REQUEST['queueName'])
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2004-03-18 19:26:33 +00:00
|
|
|
// Check input and exit if we found errors
|
|
|
|
|
$errors = checkInput($_REQUEST);
|
|
|
|
|
if( !empty($errors) )
|
|
|
|
|
{
|
|
|
|
|
errorpage("We found the following errors:","<ul>$errors</ul><br>Please go back and correct them.");
|
|
|
|
|
exit;
|
|
|
|
|
}
|
2004-04-06 21:26:10 +00:00
|
|
|
|
|
|
|
|
/* if the user picked the vendor we need to retrieve the vendor name */
|
|
|
|
|
/* and store it into the $queueVendor */
|
|
|
|
|
if($_REQUEST['altvendor'])
|
|
|
|
|
{
|
|
|
|
|
/* retrieve the actual name here */
|
|
|
|
|
$query = "select * from vendor where vendorId = '$altvendor';";
|
|
|
|
|
$result = mysql_query($query);
|
|
|
|
|
if($result)
|
|
|
|
|
{
|
|
|
|
|
$ob = mysql_fetch_object($result);
|
|
|
|
|
$_REQUEST['queueVendor'] = $ob->vendorName;
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-03-18 19:26:33 +00:00
|
|
|
|
|
|
|
|
// header
|
|
|
|
|
apidb_header("Submit Application");
|
2004-04-06 21:26:10 +00:00
|
|
|
|
|
|
|
|
// add to queue
|
2004-03-18 19:26:33 +00:00
|
|
|
$query = "INSERT INTO appQueue VALUES (null, '".
|
|
|
|
|
addslashes($_REQUEST['queueName'])."', '".
|
|
|
|
|
addslashes($_REQUEST['queueVersion'])."', '".
|
|
|
|
|
addslashes($_REQUEST['queueVendor'])."', '".
|
|
|
|
|
addslashes($_REQUEST['queueDesc'])."', '".
|
|
|
|
|
addslashes($_REQUEST['queueEmail'])."', '".
|
|
|
|
|
addslashes($_REQUEST['queueURL'])."', '".
|
2004-04-20 16:19:48 +00:00
|
|
|
addslashes($_REQUEST['queueImage'])."',".
|
2004-10-12 21:11:59 +00:00
|
|
|
"NOW()".",".
|
|
|
|
|
addslashes($_REQUEST['queueCatId']).");";
|
|
|
|
|
|
2004-03-18 19:26:33 +00:00
|
|
|
mysql_query($query);
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-03-18 19:26:33 +00:00
|
|
|
if ($error = mysql_error())
|
|
|
|
|
{
|
|
|
|
|
echo "<p><font color=red><b>Error:</b></font></p>\n";
|
|
|
|
|
echo "<p>$error</p>\n";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo "<p>Your application has been submitted for Review. You should hear back\n";
|
|
|
|
|
echo "soon about the status of your submission</p>\n";
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
2004-11-09 22:34:49 +00:00
|
|
|
else if ($_REQUEST['apptype'])
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2004-03-18 19:26:33 +00:00
|
|
|
// set email field if logged in
|
|
|
|
|
if ($current && loggedin())
|
|
|
|
|
{
|
|
|
|
|
$email = $current->lookup_email($current->userid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// header
|
|
|
|
|
apidb_header("Submit Application");
|
|
|
|
|
|
|
|
|
|
// show add to queue form
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-03-18 19:26:33 +00:00
|
|
|
echo '<form name="newApp" action="appsubmit.php" method="post" enctype="multipart/form-data">',"\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
|
|
|
|
echo "<p>This page is for submitting new applications to be added to this\n";
|
|
|
|
|
echo "database. The application will be reviewed by the AppDB Administrator\n";
|
|
|
|
|
echo "and you will be notified via email if this application will be added to\n";
|
|
|
|
|
echo "the database.</p>\n";
|
2004-03-18 19:26:33 +00:00
|
|
|
echo "<p>Please don't forget to mention which Wine version you used, how well it worked\n";
|
|
|
|
|
echo "and if any workaround were needed. Haveing app descriptions just sponsoring the app\n";
|
|
|
|
|
echo "(Yes, some vendor want to use the appdb for this) or saying \"I haven't tried this app with wine\" ";
|
|
|
|
|
echo "won't help wine development or wine users.</p>\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
echo "<p>To submit screenshots, please email them to ";
|
2004-03-24 15:49:59 +00:00
|
|
|
echo "<a href='mailto:appdb@winehq.org'>appdb@winehq.org</a></p>\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-11-09 22:34:49 +00:00
|
|
|
if ($apptype == 1)
|
|
|
|
|
{
|
2004-03-15 16:22:00 +00:00
|
|
|
echo html_frame_start("New Application Form",400,"",0);
|
2004-11-09 22:34:49 +00:00
|
|
|
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
|
|
|
|
|
|
|
|
|
|
echo '<tr valign=top><td class=color0><b>App Name</b></td>',"\n";
|
|
|
|
|
echo '<td><input type=text name="queueName" value="" size=20></td></tr>',"\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<tr valign=top><td class=color0><b>App Version</b></td>',"\n";
|
|
|
|
|
echo '<td><input type=text name="queueVersion" value="" size=20></td></tr>',"\n";
|
|
|
|
|
|
|
|
|
|
// app Category
|
|
|
|
|
$w = new TableVE("view");
|
|
|
|
|
echo '<tr valign=top><td class=color0><b>Category</b></td><td>',"\n";
|
|
|
|
|
$w->make_option_list("queueCatId","","appCategory","catId","catName");
|
|
|
|
|
echo '</td></tr>',"\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<tr valign=top><td class=color0><b>App Vendor</b></td>',"\n";
|
|
|
|
|
echo '<td><input type=text name="queueVendor" value="" size=20></td></tr>',"\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//alt vendor
|
|
|
|
|
$x = new TableVE("view");
|
|
|
|
|
echo '<tr valign=top><td class=color0> </td><td>',"\n";
|
|
|
|
|
$x->make_option_list("altvendor","","vendor","vendorId","vendorName");
|
|
|
|
|
echo '</td></tr>',"\n";
|
|
|
|
|
|
|
|
|
|
echo '<tr valign=top><td class=color0><b>App URL</b></td>',"\n";
|
|
|
|
|
echo '<td><input type=text name="queueURL" value="" size=20></td></tr>',"\n";
|
|
|
|
|
|
|
|
|
|
echo '<tr valign=top><td class=color0><b>App Desc</b></td>',"\n";
|
|
|
|
|
echo '<td><textarea name="queueDesc" rows=10 cols=35></textarea></td></tr>',"\n";
|
|
|
|
|
|
|
|
|
|
echo '<tr valign=top><td class=color0><b>Email</b></td>',"\n";
|
|
|
|
|
echo '<td><input type=text name="queueEmail" value="'.$email.'" size=20></td></tr>',"\n";
|
|
|
|
|
|
|
|
|
|
echo '<tr valign=top><td class=color3 align=center colspan=2>',"\n";
|
|
|
|
|
echo '<input type=submit value=" Submit New Application " class=button> </td></tr>',"\n";
|
|
|
|
|
echo '</table>',"\n";
|
|
|
|
|
|
|
|
|
|
echo html_frame_end();
|
|
|
|
|
|
|
|
|
|
echo "</form>";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo html_frame_start("New Version Form",400,"",0);
|
2004-03-15 16:22:00 +00:00
|
|
|
|
|
|
|
|
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
|
2004-10-12 21:11:59 +00:00
|
|
|
|
2004-11-09 22:34:49 +00:00
|
|
|
//app parent
|
|
|
|
|
$x = new TableVE("view");
|
|
|
|
|
echo '<tr valign=top><td class=color0><b>App Parent</b></td><td>',"\n";
|
|
|
|
|
$x->make_option_list("queueName","","appFamily","appId","appName");
|
|
|
|
|
echo '</td></tr>',"\n";
|
2004-10-12 21:11:59 +00:00
|
|
|
|
2004-11-09 22:34:49 +00:00
|
|
|
echo '<tr valign=top><td class=color0><b>App Version</b></td>',"\n";
|
|
|
|
|
echo '<td><input type=text name="queueVersion" value="" size=20></td></tr>',"\n";
|
2004-10-12 21:11:59 +00:00
|
|
|
|
2004-11-09 22:34:49 +00:00
|
|
|
echo '<tr valign=top><td class=color0><b>App URL</b></td>',"\n";
|
|
|
|
|
echo '<td><input type=text name="queueURL" value="" size=20></td></tr>',"\n";
|
2004-04-06 21:26:10 +00:00
|
|
|
|
2004-11-09 22:34:49 +00:00
|
|
|
echo '<tr valign=top><td class=color0><b>App Desc</b></td>',"\n";
|
|
|
|
|
echo '<td><textarea name="queueDesc" rows=10 cols=35></textarea></td></tr>',"\n";
|
2004-10-12 21:11:59 +00:00
|
|
|
|
2004-11-09 22:34:49 +00:00
|
|
|
echo '<tr valign=top><td class=color0><b>Email</b></td>',"\n";
|
|
|
|
|
echo '<td><input type=text name="queueEmail" value="'.$email.'" size=20></td></tr>',"\n";
|
2004-04-06 21:26:10 +00:00
|
|
|
|
2004-11-09 22:34:49 +00:00
|
|
|
echo '<input type=hidden name="queueVendor" value="">',"\n";
|
|
|
|
|
echo '<input type=hidden name="queueCatId" value=-1>',"\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<tr valign=top><td class=color3 align=center colspan=2>',"\n";
|
|
|
|
|
echo '<input type=submit value=" Submit New Version" class=button> </td></tr>',"\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
echo '</table>',"\n";
|
|
|
|
|
|
|
|
|
|
echo html_frame_end();
|
|
|
|
|
|
2004-11-09 22:34:49 +00:00
|
|
|
echo "</form>";
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
2004-11-09 22:34:49 +00:00
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// choose type of app
|
|
|
|
|
apidb_header("Choose Application Type");
|
|
|
|
|
|
|
|
|
|
echo '<form name="ChooseApp" >',"\n";
|
|
|
|
|
echo "Please search through the database first. If you cannot find your application in the database select ","\n";
|
|
|
|
|
echo "<b>New Application</b>.","\n";
|
|
|
|
|
echo "If you have found your application but have not found your version then choose <b>New Version</b>.","\n";
|
|
|
|
|
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
|
|
|
|
|
echo "<tr valign=top><td class=color0 align=center><a href='appsubmit.php?apptype=1'>New Application</a></td>","\n";
|
|
|
|
|
echo "<td class=color0 align=center><a href='appsubmit.php?apptype=2'>New Version</a></td></tr>","\n";
|
|
|
|
|
echo '</table>',"\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "</form>";
|
|
|
|
|
}
|
|
|
|
|
|
2004-03-18 19:26:33 +00:00
|
|
|
|
2004-03-15 16:22:00 +00:00
|
|
|
apidb_footer();
|
|
|
|
|
|
|
|
|
|
?>
|