diff --git a/admin/adminAppQueue.php b/admin/adminAppQueue.php index a24d58b..2128263 100644 --- a/admin/adminAppQueue.php +++ b/admin/adminAppQueue.php @@ -43,125 +43,170 @@ if ($sub) if ($sub == 'view' && $queueId) { $x = new TableVE("view"); - - //help - echo "
\n\n"; - 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 "
  1. 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.
  2. \n"; - echo "

  3. 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.
  4. \n"; - echo "
\n\n"; - - //view application details - echo html_frame_start("New Application Form",400,"",0); - echo "\n"; - - //type - echo '',"\n"; - - //category + If ($ob->queueCatId == -1) + { + //help + echo "
Type',"\n"; - echo '',"\n"; - echo '
',"\n"; - } else - { - echo '',"\n"; - } - //app parent - echo '',"\n"; - - //name - echo '',"\n"; - echo '',"\n"; + echo " App Version This type of application will be nested under the selected application parent.\n"; + echo "
\n\n"; + echo "

This is the full view of the application waiting to be approved. \n"; + echo "If you approve this application,\n"; + echo "an email will be sent to the author of the submission.

\n"; - $query = "select * from appCategory where catId = '$ob->queueCatId';"; - $result = mysql_query($query); - if($result) - { - - $ob2 = mysql_fetch_object($result); - - echo '

Category',"\n"; - $x->make_option_list("cat",stripslashes($ob2->catId),"appCategory","catId","catName"); - echo '
Category',"\n"; - $x->make_option_list("cat","","appCategory","catId","catName"); - echo '
App Parent',"\n"; - $x->make_option_list("appParent","","appFamily","appId","appName"); - echo '
App Name
\n\n"; + + echo '',"\n"; + + echo html_frame_start("New Application Form",400,"",0); + echo "\n"; + + //app parent + echo '',"\n"; + + //version + echo '',"\n"; + echo '',"\n"; + + //url + echo '',"\n"; + echo '',"\n"; + + //desc + echo '',"\n"; + echo '',"\n"; + + //echo ',"\n"; + //echo '',"\n"; + //echo ',"\n"; + //echo '',"\n"; + + echo '',"\n"; + echo '
App Parent',"\n"; + $x->make_option_list("appParent",stripslashes($ob->queueName),"appFamily","appId","appName"); + echo '
App Version
App URL
App Desc
Email
Image
' ,"\n"; + echo '
',"\n"; - //version - echo 'App Version',"\n"; - echo '',"\n"; - - //vendor/alt vendor fields - // 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 - $query = "select * from vendor where vendorname = '$ob->queueVendor';"; - $result = mysql_query($query); - $checkvendor = 0; - if($result) - { - $ob2 = mysql_fetch_object($result); - $checkvendor = $ob2->vendorId; } - if(!$checkvendor) - { - // try for a partial match - $query = "select * from vendor where vendorname like '%$ob->queueVendor%';"; + else + { + + //help + echo "
\n\n"; + 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 "
  1. 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.
  2. \n"; + echo "

  3. 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.
  4. \n"; + echo "
\n\n"; + + //view application details + echo html_frame_start("New Application Form",400,"",0); + echo "\n"; + + //type + echo '',"\n"; + + //category + + $query = "select * from appCategory where catId = '$ob->queueCatId';"; $result = mysql_query($query); if($result) + { + $ob2 = mysql_fetch_object($result); + + echo '',"\n"; + } else + { + echo '',"\n"; + } + //app parent + echo '',"\n"; + + //name + echo '',"\n"; + echo '',"\n"; + + //version + echo '',"\n"; + echo '',"\n"; + + //vendor/alt vendor fields + // 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 + $query = "select * from vendor where vendorname = '$ob->queueVendor';"; + $result = mysql_query($query); + $checkvendor = 0; + if($result) { $ob2 = mysql_fetch_object($result); $checkvendor = $ob2->vendorId; } - } - if(checkvendor) - { - $ob->queueVendor = ''; + if(!$checkvendor) + { + // try for a partial match + $query = "select * from vendor where vendorname like '%$ob->queueVendor%';"; + $result = mysql_query($query); + if($result) + { + $ob2 = mysql_fetch_object($result); + $checkvendor = $ob2->vendorId; + } + } + if(checkvendor) + { + $ob->queueVendor = ''; - //vendor field - echo '',"\n"; - echo '',"\n"; + //vendor field + echo '',"\n"; + echo '',"\n"; - echo '',"\n"; - } else - { - //vendor field - echo '',"\n"; - echo '',"\n"; + echo '',"\n"; + } else + { + //vendor field + echo '',"\n"; + echo '',"\n"; - echo '',"\n"; - } + echo '',"\n"; + } - //url - echo '',"\n"; - echo '',"\n"; + //url + echo '',"\n"; + echo '',"\n"; - //desc - echo '',"\n"; - echo '',"\n"; + //desc + echo '',"\n"; + echo '',"\n"; - //echo ',"\n"; - //echo '',"\n"; - //echo ',"\n"; - //echo '',"\n"; + //echo ',"\n"; + //echo '',"\n"; + //echo ',"\n"; + //echo '',"\n"; - echo '',"\n"; - echo '
Type',"\n"; + echo '',"\n"; + echo '
Category',"\n"; + $x->make_option_list("cat",stripslashes($ob2->catId),"appCategory","catId","catName"); + echo '
Category',"\n"; + $x->make_option_list("cat","","appCategory","catId","catName"); + echo '
App Parent',"\n"; + $x->make_option_list("appParent","","appFamily","appId","appName"); + echo '
App Name
App Version
App Vendor
App Vendor
 ',"\n"; - $x->make_option_list("altvendor", $checkvendor ,"vendor","vendorId","vendorName"); - echo '
App Vendor
 ',"\n"; + $x->make_option_list("altvendor", $checkvendor ,"vendor","vendorId","vendorName"); + echo '
App Vendor
 ',"\n"; - $x->make_option_list("altvendor","","vendor","vendorId","vendorName"); - echo '
 ',"\n"; + $x->make_option_list("altvendor","","vendor","vendorId","vendorName"); + echo '
App URL
App URL
App Desc
App Desc
Email
Image
Email
Image
' ,"\n"; - echo '
',"\n"; + echo '' ,"\n"; + echo ' ',"\n"; + echo '',"\n"; + } echo '',"\n"; echo '',"\n"; @@ -309,7 +354,7 @@ else { //get available apps $query = "SELECT queueId, queueName, queueVendor,". - "queueVersion, queueEmail,". + "queueVersion, queueEmail, queueCatId,". "UNIX_TIMESTAMP(submitTime) as submitTime ". "from appQueue;"; $result = mysql_query($query); @@ -351,7 +396,22 @@ else if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; } echo "\n"; echo " ".date("Y-n-t h:i:sa", $ob->submitTime)."  \n"; - echo " $ob->queueName\n"; + if ($ob->queueCatId == -1) + { + $query2 = "select * from appFamily where appId = '$ob->queueName';"; + $result2 = mysql_query($query2); + if($result2) + { + $ob2 = mysql_fetch_object($result2); + echo " $ob2->appName\n"; + } else + { + echo " App not found\n"; + } + } else + { + echo " $ob->queueName\n"; + } echo " ".stripslashes($ob->queueVersion)."  \n"; echo " ".stripslashes($ob->queueVendor)."  \n"; echo " ".stripslashes($ob->queueEmail)."  \n"; diff --git a/appsubmit.php b/appsubmit.php index 7700eb6..c2dcb68 100644 --- a/appsubmit.php +++ b/appsubmit.php @@ -35,7 +35,9 @@ function checkInput( $fields ) } // Not empty and an invalid e-mail address - if ( !empty( $fields['queueEmail']) AND !preg_match('/^[A-Za-z0-9\._-]+[@][A-Za-z0-9_-]+([.][A-Za-z0-9_-]+)+[A-Za-z]$/',$fields['queueEmail']) ) + if ( !empty( $fields['queueEmail']) + AND !preg_match('/^[A-Za-z0-9\._-]+[@][A-Za-z0-9_-]+([.][A-Za-z0-9_-]+)+[A-Za-z]$/', + $fields['queueEmail']) ) { $errors .= "
  • Please enter a valid e-mail address.
  • \n"; } @@ -107,7 +109,7 @@ if ($_REQUEST['queueName']) echo "soon about the status of your submission

    \n"; } } -else +else if ($_REQUEST['apptype']) { // set email field if logged in if ($current && loggedin()) @@ -133,38 +135,107 @@ else echo "

    To submit screenshots, please email them to "; echo "appdb@winehq.org

    \n"; + if ($apptype == 1) + { echo html_frame_start("New Application Form",400,"",0); - echo "\n"; - echo '',"\n"; - echo '',"\n"; - // app Category - $w = new TableVE("view"); - echo '',"\n"; + echo '',"\n"; + echo '',"\n"; - echo '',"\n"; + echo '',"\n"; + echo '',"\n"; + + // app Category + $w = new TableVE("view"); + echo '',"\n"; - //alt vendor - $x = new TableVE("view"); - echo '',"\n"; + echo '',"\n"; + echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; - echo '',"\n"; + + //alt vendor + $x = new TableVE("view"); + echo '',"\n"; + + echo '',"\n"; + echo '',"\n"; + + echo '',"\n"; + echo '',"\n"; + + echo '',"\n"; + echo '',"\n"; + + echo '',"\n"; echo '
    App Name
    App Version
    Category',"\n"; - $w->make_option_list("queueCatId","","appCategory","catId","catName"); - echo '
    App Name
    App Vendor
    App Version
    Category',"\n"; + $w->make_option_list("queueCatId","","appCategory","catId","catName"); + echo '
     ',"\n"; - $x->make_option_list("altvendor","","vendor","vendorId","vendorName"); - echo '
    App Vendor
    App URL
    App Desc
    Email
     ',"\n"; + $x->make_option_list("altvendor","","vendor","vendorId","vendorName"); + echo '
    App URL
    App Desc
    Email
    ',"\n"; + echo '
    ',"\n"; echo html_frame_end(); - echo ""; + echo ""; + } + else + { + echo html_frame_start("New Version Form",400,"",0); + + echo "\n"; + + //app parent + $x = new TableVE("view"); + echo '',"\n"; + + echo '',"\n"; + echo '',"\n"; + + echo '',"\n"; + echo '',"\n"; + + echo '',"\n"; + echo '',"\n"; + + echo '',"\n"; + echo '',"\n"; + + echo '',"\n"; + echo '',"\n"; + + + echo '',"\n"; + echo '
    App Parent',"\n"; + $x->make_option_list("queueName","","appFamily","appId","appName"); + echo '
    App Version
    App URL
    App Desc
    Email
    ',"\n"; + echo '
    ',"\n"; + + echo html_frame_end(); + + echo ""; + } } +else +{ + // choose type of app + apidb_header("Choose Application Type"); + + echo '
    ',"\n"; + echo "Please search through the database first. If you cannot find your application in the database select ","\n"; + echo "New Application.","\n"; + echo "If you have found your application but have not found your version then choose New Version.","\n"; + echo "\n"; + echo "","\n"; + echo "","\n"; + echo '
    New ApplicationNew Version
    ',"\n"; + + + echo "
    "; +} + apidb_footer();