2004-12-12 03:51:51 +00:00
|
|
|
<?php
|
2006-07-07 18:14:53 +00:00
|
|
|
require("path.php");
|
2005-01-30 00:57:34 +00:00
|
|
|
require(BASE."include/incl.php");
|
2006-07-07 18:14:53 +00:00
|
|
|
require_once(BASE."include/tableve.php");
|
|
|
|
|
require_once(BASE."include/application.php");
|
|
|
|
|
require_once(BASE."include/version.php");
|
2004-11-17 23:02:07 +00:00
|
|
|
|
2006-06-17 06:10:10 +00:00
|
|
|
$aClean = array(); //array of filtered user input
|
|
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
$aClean['iAppId'] = makeSafe($_REQUEST['iAppId']);
|
|
|
|
|
$aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
|
|
|
|
|
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
|
2006-06-17 06:10:10 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if(!is_numeric($aClean['iAppId']) OR !is_numeric($aClean['iVersionId']))
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit("Wrong ID");
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2005-01-30 23:12:48 +00:00
|
|
|
/* Check for admin privs */
|
2006-07-06 17:27:54 +00:00
|
|
|
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($aClean['iVersionId']) && !$_SESSION['current']->isSuperMaintainer($aClean['iAppId']))
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit("Insufficient Privileges!");
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2005-06-05 18:41:47 +00:00
|
|
|
/* process the changes the user entered into the web form */
|
2006-07-06 17:27:54 +00:00
|
|
|
if(!empty($aClean['sSubmit']))
|
2004-11-17 23:02:07 +00:00
|
|
|
{
|
2005-06-05 18:41:47 +00:00
|
|
|
process_app_version_changes(true);
|
2006-07-06 18:44:56 +00:00
|
|
|
util_redirect_and_exit(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId']));
|
2005-06-05 18:41:47 +00:00
|
|
|
} else /* or display the webform for making changes */
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2005-09-30 02:48:33 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
$oVersion = new Version($aClean['iVersionId']);
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-11-17 23:02:07 +00:00
|
|
|
apidb_header("Edit Application Version");
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-11-17 23:02:07 +00:00
|
|
|
echo "<form method=post action='editAppVersion.php'>\n";
|
2005-10-10 02:37:55 +00:00
|
|
|
|
2005-10-16 04:24:37 +00:00
|
|
|
if($_SESSION['current']->hasPriv("admin"))
|
|
|
|
|
$oVersion->OutputEditor(true, true); /* false = not allowing the user to modify the parent application */
|
|
|
|
|
else
|
|
|
|
|
$oVersion->OutputEditor(false, true); /* false = not allowing the user to modify the parent application */
|
|
|
|
|
|
|
|
|
|
echo '<table border=0 cellpadding=2 cellspacing=0 width="100%">',"\n";
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<tr><td colspan=2 align=center class=color2><input type="submit" name="sSubmit" value="Update Database" /></td></tr>',"\n";
|
2004-11-17 23:02:07 +00:00
|
|
|
echo html_table_end();
|
2005-10-16 04:24:37 +00:00
|
|
|
|
2005-02-02 00:35:49 +00:00
|
|
|
echo "</form>";
|
2004-11-17 23:02:07 +00:00
|
|
|
|
2005-10-16 04:24:37 +00:00
|
|
|
echo "<br/><br/>\n";
|
|
|
|
|
|
2005-02-02 00:35:49 +00:00
|
|
|
// url edit form
|
|
|
|
|
echo '<form enctype="multipart/form-data" action="editAppVersion.php" method="post">',"\n";
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<input type=hidden name="iAppId" value='.$oVersion->iAppId.'>';
|
|
|
|
|
echo '<input type=hidden name="iVersionId" value='.$oVersion->iVersionId.'>';
|
2005-02-02 00:35:49 +00:00
|
|
|
echo html_frame_start("Edit URL","90%","",0);
|
|
|
|
|
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">',"\n";
|
|
|
|
|
|
|
|
|
|
$i = 0;
|
2006-06-27 19:16:27 +00:00
|
|
|
$hResult = query_parameters("SELECT * FROM appData WHERE versionId = '?' AND type = 'url'",
|
|
|
|
|
$oVersion->iVersionId);
|
2006-06-21 01:04:12 +00:00
|
|
|
if($hResult && mysql_num_rows($hResult) > 0)
|
2005-02-02 00:35:49 +00:00
|
|
|
{
|
|
|
|
|
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";
|
2006-06-21 01:04:12 +00:00
|
|
|
while($oRow = mysql_fetch_object($hResult))
|
2005-02-02 00:35:49 +00:00
|
|
|
{
|
|
|
|
|
$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";
|
2006-06-21 01:04:12 +00:00
|
|
|
echo '<td class=color3><input size="45" type="text" name="'.$temp1.'" value ="'.stripslashes($oRow->description).'"</td>',"\n";
|
|
|
|
|
echo '<td class=color3><input size="45" type="text" name="'.$temp2.'" value="'.$oRow->url.'"></td></tr>',"\n";
|
|
|
|
|
echo '<input type="hidden" name="'.$temp3.'" value="'.$oRow->id.'" />';
|
|
|
|
|
echo '<input type="hidden" name="'.$temp4.'" value="'.stripslashes($oRow->description).'" />';
|
|
|
|
|
echo '<input type="hidden" name="'.$temp5.'" value="'.$oRow->url.'" />',"\n";
|
2005-02-02 00:35:49 +00:00
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
{
|
2005-02-07 23:21:33 +00:00
|
|
|
echo '<tr><td class="color1"></td><td class="color1"><b>Description</b></td>',"\n";
|
2005-02-02 00:35:49 +00:00
|
|
|
echo '<td class=color1><b>URL</b></td></tr>',"\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</td></tr>\n";
|
2006-07-06 17:27:54 +00:00
|
|
|
echo "<input type=hidden name='iRows' value='$i'>";
|
|
|
|
|
echo '<tr><td class=color1>New</td><td class=color1><input size="45" type="text" name="sUrlDesc"></td>',"\n";
|
|
|
|
|
echo '<td class=color1><input size=45% name="sUrl" type="text"></td></tr>',"\n";
|
2005-02-02 00:35:49 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<tr><td colspan=3 align=center class="color3"><input type="submit" name="sSubmit" value="Update URL"></td></tr>',"\n";
|
2005-02-02 00:35:49 +00:00
|
|
|
|
|
|
|
|
echo '</table>',"\n";
|
|
|
|
|
echo html_frame_end();
|
|
|
|
|
echo "</form>";
|
2005-06-05 21:26:07 +00:00
|
|
|
|
|
|
|
|
/* 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";
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<input type=hidden name="iAppId" value='.$oVersion->iAppId.'>';
|
|
|
|
|
echo '<input type=hidden name="iVersionId" value='.$oVersion->iVersionId.'>';
|
2005-06-05 21:26:07 +00:00
|
|
|
echo html_frame_start("Move version to another application","90%","",0);
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<center><input type="submit" name="sView" value="Move this version"></center>',"\n";
|
2005-06-05 21:26:07 +00:00
|
|
|
echo html_frame_end();
|
|
|
|
|
}
|
|
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
echo html_back_link(1,BASE."appview.php?iVersionId=".$oVersion->iVersionId);
|
2004-11-17 23:02:07 +00:00
|
|
|
apidb_footer();
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
?>
|