'."\n"; echo "

This page is for submitting new applications to be added to the\n"; echo "database. The application will be reviewed by an AppDB Administrator,\n"; echo "and you will be notified via e-mail if it is added to the database or rejected.

\n"; echo "

Before continuing, please ensure that you have

\n"; echo "

"; echo "

Please do not forget to mention which Wine version you used, how well it worked\n"; echo "and if any workarounds were needed. Having app descriptions just sponsoring the app\n"; echo "(yes, some vendors want to use the appdb for this) or saying ‘I haven’t tried this app with Wine’ "; echo "will not help Wine development or Wine users.

\n"; echo "Please only submit applications/versions that you have tested.\n"; echo "Submissions without testing information or not using the provided template will be rejected.\n"; echo "If you are unable to see the in-browser editors below, please try Firefox, Mozilla or Opera browsers.\n"; echo "

After your application has been added, you will be able to submit screenshots for it, post"; echo " messages in its forums or become a maintainer to help others trying to run the application.

"; } //deny access if not logged on if(!$_SESSION['current']->isLoggedIn()) util_show_error_page_and_exit("Insufficient privileges to create application. Are you sure you are logged in?"); if ($aClean['sSub']) { if($aClean['sAppType'] == 'application') { $oApp = new Application( $aClean['iAppId']); if($oApp->iAppId) { // if we are processing a queued application there MUST be an implicitly queued // version to go along with it. Find this version so we can display its information // during application processing so the admin can make a better choice about // whether to accept or reject the overall application $hResult = query_parameters("Select versionId from appVersion where appId='?'", $aClean['iAppId']); $oRow = mysql_fetch_object($hResult); // make sure the user has permission to view this version if(!$_SESSION['current']->hasPriv("admin") && (($oApp->queued=="false")?true:false) && !$_SESSION['current']->isVersionSubmitter($oApp->AppId)) { util_show_error_page_and_exit("Insufficient privileges."); } $oVersion = new Version($oRow->versionId); } else { $oVersion = new Version(); } } else if($aClean['sAppType'] == 'version') { $oVersion = new Version($aClean['iVersionId']); // make sure the user has permission to view this version if(!$_SESSION['current']->hasAppVersionModifyPermission($oVersion) && (($oVersion->queued=="false")?true:false) && !$_SESSION['current']->isVersionSubmitter($oVersion->versionId)) { util_show_error_page_and_exit("Insufficient privileges."); } } else { //error no Id! addmsg("Application Not Found!", "red"); util_redirect_and_exit($_SERVER['PHP_SELF']); } // Get the Testing results if they exist $hResult = query_parameters("Select testingId from testResults where versionId = '?'", $oVersion->iVersionId); if($hResult) { $oRow = mysql_fetch_object($hResult); $oTest = new testData($oRow->testingId); } else { $oTest = new testData(); } //process according to sub flag if ($aClean['sSub'] == 'Submit') { $errors = ""; $oVersion = new Version($aClean['iVersionId']); $oTest = new testData($aClean['iTestingId']); $errors .= $oVersion->CheckOutputEditorInput(); $errors .= $oTest->CheckOutputEditorInput(); $oVersion->GetOutputEditorValues(); $oTest->GetOutputEditorValues(); if ($aClean['sAppType'] == "application") // application { $oApp = new Application($aClean['iAppId']); $errors .= $oApp->CheckOutputEditorInput(); $oApp->GetOutputEditorValues(); // load the values from $_REQUEST if(empty($errors)) { if($aClean['sAppVendorName']) { $aClean['iVendorId']=""; //FIXME: fix this when we fix vendor submission if($_SESSION['current']->hasPriv("admin")) { $oVendor = new Vendor(); $oVendor->create($aClean['sAppVendorName'],$aClean['sAppWebpage']); } } //FIXME: remove this when we fix vendor submission $oApp->sKeywords = $aClean['sAppKeywords']." *** ".$aClean['sAppVendorName']; if(is_numeric($oApp->iAppId)) { $oApp->update(); $oApp->ReQueue(); } else { $oApp->create(); } $oVersion->iAppId = $oApp->iAppId; } } /* if we have errors go back to 'view' mode */ if(!empty($errors)) { $aClean['sSub'] = 'view'; } else { if(is_numeric($oVersion->iVersionId)) { $oVersion->update(); $oVersion->ReQueue(); } else { $oVersion->create(); } if(!$aClean['iDistributionId']) { $sDistribution = $aClean['sDistribution']; if( !empty($sDistribution) ) { $oDistribution = new distribution(); $oDistribution->sName = $sDistribution; $oDistribution->create(); $oTest->iDistributionId = $oDistribution->iDistributionId; } } $oTest->iVersionId = $oVersion->iVersionId; if(is_numeric($oTest->iTestingId)) { $oTest->update(true); $oTest->ReQueue(); } else { $oTest->create(); } util_redirect_and_exit($_SERVER['PHP_SELF']); } } if ($aClean['sSub'] == 'Delete') { if (($aClean['sAppType'] == "application") && is_numeric($aClean['iAppId'])) // application { // get the queued versions that refers to the application entry we just removed // and delete them as we implicitly added a version entry when adding a new application $hResult = query_parameters("SELECT versionId FROM appVersion WHERE appVersion.appId = '?' AND appVersion.queued = 'rejected';", $aClean['iAppId']); if($hResult) { while($oRow = mysql_fetch_object($hResult)) { $oVersion = new Version($oRow->versionId); $oVersion->delete(); } } // delete the application entry $oApp = new Application($aClean['iAppId']); $oApp->delete(); } else if(($aClean['sAppType'] == "version") && is_numeric($aClean['iVersionId'])) // version { $oVersion = new Version($aClean['iVersionId']); $oVersion->delete(); } util_redirect_and_exit($_SERVER['PHP_SELF']); } if ($aClean['sSub'] == 'view') { $x = new TableVE("view"); apidb_header("Application Queue"); echo '
',"\n"; echo '',"\n"; echo html_back_link(1,$_SERVER['PHP_SELF']); if($aClean['sAppType'] == 'application') // application { if ($oApp->sName != "") { echo html_frame_start("Potential duplicate applications in the database","90%","",0); perform_search_and_output_results($oApp->sName); echo html_frame_end(" "); } if(is_numeric($oApp->iAppId)) { //help echo "
\n\n"; echo "

This is the full view of the rejected application. \n"; echo "You need to pick a category before submitting \n"; echo "it into the database.\n"; echo "

Click delete to remove the selected item from the queue. An e-mail will automatically be sent to the\n"; echo "submitter to let them know the item was deleted.

\n\n"; echo "
\n\n"; } else { newSubmition(''); } // vendor/alt vendor fields // if user selected a predefined vendorId: $iVendorId = $oApp->iVendorId; // If not, try for an exact match // Use the first match if we found one and clear out the vendor field, // otherwise don't pick a vendor // N.B. The vendor string is the last word of the keywords field ! if(!$iVendorId) { $sVendor = get_vendor_from_keywords($oApp->sKeywords); $sQuery = "SELECT vendorId FROM vendor WHERE vendorname = '".$aClean['sAppVendorName']."';"; $hResult = query_appdb($sQuery); if($hResult) { $oRow = mysql_fetch_object($hResult); $iVendorId = $oRow->vendorId; } } // try for a partial match if(!$iVendorId) { $hResult = query_parameters("select * from vendor where vendorname like '%?%'", $aClean['sAppVendorName']); if($hResult) { $oRow = mysql_fetch_object($hResult); $iVendorId = $oRow->vendorId; } } //vendor field if($iVendorId) $aClean['sAppVendorName'] = ""; } else //app version { if(is_numeric($oVersion->iVersionId)) { $oAppForVersion = new Application($oVersion->iAppId); echo html_frame_start("Potential duplicate versions in the database for application: ".$oAppForVersion->sName,"90%","",0); Version::display_approved($oAppForVersion->aVersionsIds); echo html_frame_end(" "); //help echo "
\n\n"; echo "

This is the full view of the application version that has been Rejected. \n"; echo "App Version This type of application will be nested under the selected application parent.\n"; echo "

Click delete to remove the selected item from the queue. An e-mail will automatically be sent to the\n"; echo "submitter to let him know the item was deleted.

\n\n"; echo "
\n\n"; } else { newSubmition($errors); } } if(!empty($errors)) { echo '',"\n"; echo '

We found the following errors:

Please correct them.'; echo '

',"\n"; echo '

',"\n"; } if(!($oTest->sTestedDate)) $oTest->sTestedDate = date('Y-m-d H:i:s'); if($aClean['sAppType'] == 'application') { $oApp->OutputEditor($aClean['sAppVendorName']); $oVersion->OutputEditor(false, false); } else { $oVersion->OutputEditor(false, false); } $oTest->OutputEditor($aClean['sDistribution'],true); echo "\n"; if($aClean['sAppType'] == 'application') // application { echo ''; if(is_numeric($oApp->iAppId)) { echo '',"\n"; } } else // version { echo ''; echo ''; if(is_numeric($oVersion->iVersionId)) { echo '',"\n"; } else { echo '',"\n"; } } echo '
' ,"\n"; echo ' ',"\n"; echo '',"\n"; } else { echo '
',"\n"; echo '
' ,"\n"; echo ' ',"\n"; echo '
',"\n"; echo '
',"\n"; echo html_back_link(1, $_SERVER['PHP_SELF']); echo html_frame_end(" "); apidb_footer(); } else { // error no sub! addmsg("Internal Routine Not Found!!", "red"); util_redirect_and_exit($_SERVER['PHP_SELF']); } } else // if ($aClean['sSub']) is not defined, display the main app queue page { apidb_header("Resubmit application"); // get queued apps that the current user should see $hResult = $_SESSION['current']->getAppRejectQueueQuery(true); // query for the app family if(!$hResult || !mysql_num_rows($hResult)) { //no apps in queue echo html_frame_start("Application Queue","90%"); echo '

The Resubmit Application Queue is empty.

',"\n"; echo html_frame_end(" "); } else { //help echo "
\n\n"; echo "

This is the list of applications waiting for re-submission, or to be deleted.

\n"; echo "

To view a submission, click on its name. From that page you can delete or edit and\n"; echo "re-submit it into the AppDB .
\n"; echo "

\n\n"; //show applist Application::showList($hResult); } // get queued versions (only versions where application are not queued already) $hResult = $_SESSION['current']->getAppRejectQueueQuery(false); // query for the app version if(!$hResult || !mysql_num_rows($hResult)) { //no apps in queue echo html_frame_start("Version Queue","90%"); echo '

The Resubmit Version Queue is empty.

',"\n"; echo html_frame_end(" "); } else { //help echo "
\n\n"; echo "

This is the list of versions waiting for re-submission or deletion.

\n"; echo "

To view a submission, click on its name. From that page you can delete or edit and re-submit it into \n"; echo "the AppDB .
\n"; echo "

Note that versions linked to application that have not been approved yet are not displayed in this list.

\n"; echo "the AppDB.
\n"; echo "
\n\n"; //show Version list showVersionList($hResult); } apidb_footer(); } ?>