hasPriv("admin") || $_SESSION['current']->isMaintainer($_REQUEST['appId'],$_REQUEST['versionId']))) { errorpage("Insufficient Privileges!"); exit; } if(isset($_REQUEST['submit1'])) { $oVersion = new Version($_REQUEST['versionId']); $oApp = new Application($_REQUEST['appId']); if($_REQUEST['submit1'] == "Update Database") { $oVersion->update($_REQUEST['versionName'], $_REQUEST['description'], $_REQUEST['maintainer_release'], $_REQUEST['maintainer_rating']); } else if($_REQUEST['submit1'] == "Update URL") { $sWhatChanged = ""; $bAppChanged = false; if (!empty($_REQUEST['url_desc']) && !empty($_REQUEST['url']) ) { // process added URL $aInsert = compile_insert_string( array('versionId' => $_REQUEST['versionId'], 'type' => 'url', 'description' => $_REQUEST['url_desc'], 'url' => $_REQUEST['url'])); $sQuery = "INSERT INTO appData ({$aInsert['FIELDS']}) VALUES ({$aInsert['VALUES']})"; if (query_appdb($sQuery)) { addmsg("The URL was successfully added into the database", "green"); $sWhatChanged .= " Added Url: Description: ".stripslashes($_REQUEST['url_desc'])."\n"; $sWhatChanged .= " Url: ".stripslashes($_REQUEST['url'])."\n"; $bAppChanged = true; } } // Process changed URLs for($i = 0; $i < $_REQUEST['rows']; $i++) { if ($_REQUEST['adelete'][$i] == "on") { $hResult = query_appdb("DELETE FROM appData WHERE id = '{$_REQUEST['aId'][$i]}'"); if($hResult) { addmsg("Successfully deleted URL ".$_REQUEST['aOldDesc'][$i]." (".$_REQUEST['aOldURL'][$i].").","green"); $sWhatChanged .= "Deleted Url: Description: ".stripslashes($_REQUEST['aOldDesc'][$i])."\n"; $sWhatChanged .= " url: ".stripslashes($_REQUEST['aOldURL'][$i])."\n"; $bAppChanged = true; } } else if( $_REQUEST['aURL'][$i] != $_REQUEST['aOldURL'][$i] || $_REQUEST['adescription'][$i] != $_REQUEST['aOldDesc'][$i]) { if(empty($_REQUEST['aURL'][$i]) || empty($_REQUEST['adescription'][$i])) addmsg("The URL or description was blank. URL not changed in the database", "red"); else { $sUpdate = compile_update_string( array( 'description' => $_REQUEST['adescription'][$i], 'url' => $_REQUEST['aURL'][$i])); if (query_appdb("UPDATE appData SET $sUpdate WHERE id = '{$_REQUEST['aId'][$i]}'")) { addmsg("

Successfully updated ".$_REQUEST['aOldDesc'][$i]." (".$_REQUEST['aOldURL'][$i].")

\n",'green'); $sWhatChanged .= "Changed Url: Old Description: ".stripslashes($_REQUEST['aOldDesc'][$i])."\n"; $sWhatChanged .= " Old Url: ".stripslashes($_REQUEST['aOldURL'][$i])."\n"; $sWhatChanged .= " New Description: ".stripslashes($_REQUEST['adescription'][$i])."\n"; $sWhatChanged .= " New url: ".stripslashes($_REQUEST['aURL'][$i])."\n"; $bAppChanged = true; } } } } if ($bAppChanged) { $sEmail = get_notify_email_address_list($_REQUEST['appId']); if($sEmail) { $sSubject = "Links for ".$oApp->sName." ".$oVersion->sName." have been updated by ".$_SESSION['current']->sRealname; $sMsg = APPDB_ROOT."appview.php?appId=".$_REQUEST['appId']."\n"; $sMsg .= "\n"; $sMsg .= "The following changes have been made:"; $sMsg .= "\n"; $sMsg .= $sWhatChanged."\n"; $sMsg .= "\n"; mail_appdb($sEmail, $sSubject ,$sMsg); } } } redirect(apidb_fullurl("appview.php?versionId=".$_REQUEST['versionId'])); } else { ?> \n"; echo html_frame_start("Data for Application ID: ".$oVersion->iAppId." Version ID: ".$oVersion->iVersionId, "90%","",0); echo html_table_begin("width='100%' border=0 align=left cellpadding=6 cellspacing=0 class='box-body'"); echo ''; echo ''; echo 'Name'.lookup_app_name($oVersion->iAppId).'',"\n"; echo 'Version',"\n"; echo 'Version specific description', "\n"; // FIXME: put templates in config file or somewhere else. if(trim(strip_tags($oVersion->sDescription))=="") { $oVersion->sDescription = "

This is a template; enter version-specific description here

"; $oVersion->sDescription .= "

Wine compatibility
What works:
- settings
- help

What doesn't work:
- erasing

What was not tested:
- burning

"; $oVersion->sDescription .= "

Tested versions
App. versionWine versionInstalls?Runs?Rating
3.2320050111yesyesGold
3.2320041201yesyesSilver
3.2120040615yesyesBronze


"; } echo '

', "\n"; echo '',"\n"; echo '

'; echo 'Rating',"\n"; make_maintainer_rating_list("maintainer_rating", $oVersion->sTestedRating); echo '',"\n"; echo 'Release',"\n"; make_bugzilla_version_list("maintainer_release", $oVersion->sTestedRelease); echo '',"\n"; echo '',"\n"; echo html_table_end(); echo html_frame_end(); echo ""; // url edit form echo '
',"\n"; echo ''; echo ''; echo html_frame_start("Edit URL","90%","",0); echo '',"\n"; $i = 0; $result = query_appdb("SELECT * FROM appData WHERE versionId = ".$oVersion->iVersionId." AND type = 'url'"); if($result && mysql_num_rows($result) > 0) { echo '',"\n"; while($ob = mysql_fetch_object($result)) { $temp0 = "adelete[".$i."]"; $temp1 = "adescription[".$i."]"; $temp2 = "aURL[".$i."]"; $temp3 = "aId[".$i."]"; $temp4 = "aOldDesc[".$i."]"; $temp5 = "aOldURL[".$i."]"; echo '',"\n"; echo '',"\n"; echo ''; echo ''; echo '',"\n"; $i++; } } else { echo '',"\n"; echo '',"\n"; } echo "\n"; echo ""; echo '',"\n"; echo '',"\n"; echo '',"\n"; echo '
Delete',"\n"; echo 'DescriptionURL
',"\n"; echo '
DescriptionURL
New
',"\n"; echo html_frame_end(); echo "
"; echo html_back_link(1,BASE."appview.php?versionId=".$oVersion->iVersionId); apidb_footer(); } ?>