hasPriv("admin"))
{
errorpage("Insufficient privileges.");
exit;
}
if ($_REQUEST['sub'])
{
if(is_numeric($_REQUEST['appId']))
{
$oApp = new Application($_REQUEST['appId']);
} elseif(is_numeric($_REQUEST['versionId']))
{
$oVersion = new Version($_REQUEST['versionId']);
} else
{
//error no Id!
addmsg("Application Not Found!", "red");
redirect(apidb_fullurl("admin/adminAppQueue.php"));
}
//process according to sub flag
if ($_REQUEST['sub'] == 'view')
{
$x = new TableVE("view");
apidb_header("Admin App Queue");
?>
',"\n";
echo '',"\n";
if ($oVersion) //app version
{
//help
echo "
\n\n";
echo "
This is the full view of the application version waiting to be approved. \n";
echo "If you approve this application version an email will be sent to the author of the submission.
\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 email will automatically be sent to the\n";
echo "submitter to let him know the item was deleted.
\n\n";
echo "
\n\n";
echo html_frame_start("New Version Form",400,"",0);
echo "
This is the full view of the application waiting to be approved. \n";
echo "You need to pick a category before submitting \n";
echo "it into the database. If you approve this application,\n";
echo "an email will be sent to the author of the submission.
\n";
echo "
There are two kinds of applications in this database:
\n";
echo "\n";
echo "
App Family This is a parent group application, that will have multiple versions under it. \n";
echo " To add this submission as a Family, choose 'Application' from the type drop down. Then set the category.\n";
echo " The version and app parent fields will be ignored in this type. \n";
echo " If the vendor does not exist, leave the vendor drop down unset, and the field will be used.
\n";
echo "
App Version This type of application will be nested under the selected application parent.\n";
echo " The category, name, and vendor fields will be ignored.
\n";
echo "
Click delete to remove the selected item from the queue. An email will automatically be sent to the\n";
echo "submitter to let them know the item was deleted.
',"\n";
/*
* 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 = '".$sVendor."';";
$hResult = query_appdb($sQuery);
if($hResult)
{
$oRow = mysql_fetch_object($hResult);
$iVendorId = $oRow->vendorId;
}
}
/*
* try for a partial match
*/
if(!$iVendorId)
{
$sQuery = "select * from vendor where vendorname like '%$ob->queueVendor%';";
$hResult = query_appdb($sQuery);
if($hResult)
{
$oRow = mysql_fetch_object($hResult);
$iVendorId = $oRow->vendorId;
}
}
//vendor field
if($iVendorId)
$sVendor = "";
echo '