This repository has been archived on 2025-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
qemudb/admin/editAppVersion.php

120 lines
5.1 KiB
PHP
Raw Normal View History

<?php
2004-03-15 16:22:00 +00:00
include("path.php");
require(BASE."include/incl.php");
2005-01-30 02:50:46 +00:00
require(BASE."include/tableve.php");
require(BASE."include/application.php");
require(BASE."include/mail.php");
2005-01-06 16:47:52 +00:00
if(!is_numeric($_REQUEST['appId']) OR !is_numeric($_REQUEST['versionId']))
{
errorpage("Wrong ID");
exit;
}
2004-03-15 16:22:00 +00:00
/* Check for admin privs */
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($_REQUEST['versionId']) && !$_SESSION['current']->isSuperMaintainer($_REQUEST['appId']))
2004-03-15 16:22:00 +00:00
{
errorpage("Insufficient Privileges!");
exit;
}
/* process the changes the user entered into the web form */
if(isset($_REQUEST['submit']))
{
process_app_version_changes(true);
redirect(apidb_fullurl("appview.php?versionId=".$_REQUEST['versionId']));
} else /* or display the webform for making changes */
2004-03-15 16:22:00 +00:00
{
$oVersion = new Version($_REQUEST['versionId']);
2004-03-15 16:22:00 +00:00
/* if the sDescription is empty, put the default in */
if(trim(strip_tags($oVersion->sDescription))=="")
$oVersion->sDescription = GetDefaultVersionDescription();
apidb_header("Edit Application Version");
2004-03-15 16:22:00 +00:00
echo "<form method=post action='editAppVersion.php'>\n";
$oVersion->OutputEditor(false); /* false = not allowing the user to modify the parent application */
echo '<input type="hidden" name="appId" value='.$oVersion->iAppId.' />';
echo '<input type="hidden" name="versionId" value='.$oVersion->iVersionId.' />';
echo html_frame_start("Info", "90%", "", 0);
echo "<table border=0 cellpadding=2 cellspacing=0>\n";
echo '<tr><td class="color4">Rating</td><td class="color0">',"\n";
make_maintainer_rating_list("maintainer_rating", $oVersion->sTestedRating);
2005-01-04 19:37:49 +00:00
echo '</td></tr>',"\n";
echo '<tr><td class=color1>Release</td><td class=color0>',"\n";
make_bugzilla_version_list("maintainer_release", $oVersion->sTestedRelease);
2005-01-04 19:37:49 +00:00
echo '</td></tr>',"\n";
2004-03-15 16:22:00 +00:00
echo '<tr><td colspan=2 align=center class=color3><input type="submit" name="submit" value="Update Database" /></td></tr>',"\n";
2004-03-15 16:22:00 +00:00
echo html_table_end();
echo html_frame_end();
echo "</form>";
// url edit form
echo '<form enctype="multipart/form-data" action="editAppVersion.php" method="post">',"\n";
echo '<input type=hidden name="appId" value='.$oVersion->iAppId.'>';
echo '<input type=hidden name="versionId" value='.$oVersion->iVersionId.'>';
echo html_frame_start("Edit URL","90%","",0);
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">',"\n";
$i = 0;
$result = query_appdb("SELECT * FROM appData WHERE versionId = ".$oVersion->iVersionId." AND type = 'url'");
if($result && mysql_num_rows($result) > 0)
{
echo '<tr><td class=color1><b>Delete</b></td><td class=color1>',"\n";
echo '<b>Description</b></td><td class=color1><b>URL</b></td></tr>',"\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 '<tr><td class=color3><input type="checkbox" name="'.$temp0.'"></td>',"\n";
echo '<td class=color3><input size="45" type="text" name="'.$temp1.'" value ="'.stripslashes($ob->description).'"</td>',"\n";
echo '<td class=color3><input size="45" type="text" name="'.$temp2.'" value="'.$ob->url.'"></td></tr>',"\n";
echo '<input type="hidden" name="'.$temp3.'" value="'.$ob->id.'" />';
echo '<input type="hidden" name="'.$temp4.'" value="'.stripslashes($ob->description).'" />';
echo '<input type="hidden" name="'.$temp5.'" value="'.$ob->url.'" />',"\n";
$i++;
}
} else
{
echo '<tr><td class="color1"></td><td class="color1"><b>Description</b></td>',"\n";
echo '<td class=color1><b>URL</b></td></tr>',"\n";
}
echo "</td></tr>\n";
echo "<input type=hidden name='rows' value='$i'>";
echo '<tr><td class=color1>New</td><td class=color1><input size="45" type="text" name="url_desc"></td>',"\n";
echo '<td class=color1><input size=45% name="url" type="text"></td></tr>',"\n";
echo '<tr><td colspan=3 align=center class="color3"><input type="submit" name="submit" value="Update URL"></td></tr>',"\n";
echo '</table>',"\n";
echo html_frame_end();
echo "</form>";
/* only admins can move versions */
if($_SESSION['current']->hasPriv("admin"))
{
// move version form
echo '<form enctype="multipart/form-data" action="moveAppVersion.php" method="post">',"\n";
echo '<input type=hidden name="appId" value='.$oVersion->iAppId.'>';
echo '<input type=hidden name="versionId" value='.$oVersion->iVersionId.'>';
echo html_frame_start("Move version to another application","90%","",0);
echo '<center><input type="submit" name="view" value="Move this version"></center>',"\n";
echo html_frame_end();
}
echo html_back_link(1,BASE."appview.php?versionId=".$oVersion->iVersionId);
apidb_footer();
}
2004-03-15 16:22:00 +00:00
?>