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-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);
|
2007-01-06 01:08:35 +00:00
|
|
|
downloadurl::processForm($aClean);
|
2007-01-20 03:49:41 +00:00
|
|
|
url::processForm($aClean);
|
2007-04-08 23:04:31 +00:00
|
|
|
$oVersion = new version($aClean['iVersionId']);
|
|
|
|
|
util_redirect_and_exit($oVersion->objectMakeUrl());
|
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
|
|
|
|
2007-05-02 01:08:22 +00:00
|
|
|
echo "<div class='default_container'>\n";
|
|
|
|
|
|
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"))
|
2007-01-17 03:18:49 +00:00
|
|
|
$oVersion->outputEditor(true, true); /* false = not allowing the user to modify the parent application */
|
2005-10-16 04:24:37 +00:00
|
|
|
else
|
2007-01-17 03:18:49 +00:00
|
|
|
$oVersion->outputEditor(false, true); /* false = not allowing the user to modify the parent application */
|
2005-10-16 04:24:37 +00:00
|
|
|
|
|
|
|
|
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";
|
|
|
|
|
|
2007-01-20 03:49:41 +00:00
|
|
|
/* URL editor */
|
|
|
|
|
echo url::outputEditor("editAppVersion.php", $oVersion);
|
2005-06-05 21:26:07 +00:00
|
|
|
|
2007-04-27 23:02:47 +00:00
|
|
|
/* Display some text about download url usage */
|
|
|
|
|
echo "A place where this version can be downloaded for free. Other downloads, ";
|
|
|
|
|
echo "such as updates, should be added in the regular URL form\n";
|
|
|
|
|
|
2007-01-05 05:20:05 +00:00
|
|
|
/* Download URL editor */
|
2007-01-17 03:18:49 +00:00
|
|
|
echo downloadurl::outputEditor($oVersion, "editAppVersion.php");
|
2007-01-05 05:20:05 +00:00
|
|
|
|
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-12-02 05:10:11 +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();
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-08 23:04:31 +00:00
|
|
|
echo html_back_link(1,$oVersion->objectMakeUrl());
|
2007-05-02 01:08:22 +00:00
|
|
|
|
|
|
|
|
echo "</div>\n";
|
|
|
|
|
|
2004-11-17 23:02:07 +00:00
|
|
|
apidb_footer();
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
?>
|