- use htmlarea when submitting a new version or application
- use htmlarea when reviewing a new version or application - don't let admin try to add keywords or webpage to an application version - improved templates and stylesheet to don't break appdb layout
This commit is contained in:
@@ -186,13 +186,20 @@ if ($_REQUEST['sub'])
|
||||
echo '</td></tr>',"\n";
|
||||
}
|
||||
}
|
||||
|
||||
//url
|
||||
// FIXME: don't display this field for appversion
|
||||
echo '<tr valign=top><td class=color0><b>App URL</b></td>',"\n";
|
||||
echo '<td><input type=text name="queueURL" value="'.stripslashes($ob->queueURL).'" size=20></td></tr>',"\n";
|
||||
|
||||
//desc
|
||||
?>
|
||||
<link rel="stylesheet" href="./application.css" type="text/css">
|
||||
<!-- load HTMLArea -->
|
||||
<script type="text/javascript" src="../htmlarea/htmlarea_loader.js"></script>
|
||||
<?php
|
||||
echo '<tr valign=top><td class=color0><b>App Desc</b></td>',"\n";
|
||||
echo '<td><textarea name="queueDesc" rows=10 cols=35>'.stripslashes($ob->queueDesc).'</textarea></td></tr>',"\n";
|
||||
echo '<td><p style="width:700px"><textarea cols="80" rows="20" id="editor" name="queueDesc">'.stripslashes($ob->queueDesc).'</textarea></p></td></tr>',"\n";
|
||||
|
||||
//email message text
|
||||
if ($ob->queueEmail)
|
||||
@@ -249,8 +256,6 @@ if ($_REQUEST['sub'])
|
||||
$aInsert = compile_insert_string( array('appId' => $_REQUEST['appParent'],
|
||||
'versionName' => $_REQUEST['queueVersion'],
|
||||
'description' => $_REQUEST['queueDesc'],
|
||||
'webPage' => $_REQUEST['queueURL'],
|
||||
'keywords' => "",
|
||||
'maintainer_rating' => "",
|
||||
'maintainer_release' => ""));
|
||||
if (query_appdb("INSERT INTO `appVersion` ({$aInsert['FIELDS']}) VALUES ({$aInsert['VALUES']})"))
|
||||
@@ -277,8 +282,6 @@ if ($_REQUEST['sub'])
|
||||
$aInsert = compile_insert_string( array('appId' => $_REQUEST['appParent'],
|
||||
'versionName' => $_REQUEST['queueVersion'],
|
||||
'description' => $_REQUEST['queueDesc'],
|
||||
'webPage' => $_REQUEST['queueURL'],
|
||||
'keywords' => "",
|
||||
'maintainer_rating' => "",
|
||||
'maintainer_release' => ""));
|
||||
|
||||
@@ -304,16 +307,20 @@ if ($_REQUEST['sub'])
|
||||
}
|
||||
|
||||
//Send Status Email
|
||||
if($_REQUEST['type'] == 'ver')
|
||||
{
|
||||
$sFullAppName = lookupAppName($_REQUEST['appParent'])." ".lookupVersionName($_REQUEST['appVersion']);
|
||||
$sUrl = APPDB_ROOT."appview.php?versionId=".$_REQUEST['appVersion'];
|
||||
} else
|
||||
{
|
||||
$sFullAppName = lookupAppName($_REQUEST['appParent']);
|
||||
$sUrl = APPDB_ROOT."appview.php?appId=".$_REQUEST['appParent'];
|
||||
}
|
||||
$sSubject = $sFullAppName." has been added into the AppDB";
|
||||
$sMsg = $sUrl."\n";
|
||||
if ($ob->queueEmail && $goodtogo)
|
||||
{
|
||||
$sFullAppName = lookupAppName($_REQUEST['appParent'])." Version: ".lookupVersionName($_REQUEST['appVersion']);
|
||||
|
||||
$sSubject = "Application Database Status Report";
|
||||
$sMsg = "Your application: ".$sFullAppName." has been entered ";
|
||||
$sMsg .= "into the application database.\r\n";
|
||||
$sMsg .= APPDB_ROOT."appview.php?appId=".$_REQUEST['appParent']."&versionId=".$_REQUEST['appVersion']."\r\n";
|
||||
$sMsg .= $emailtext;
|
||||
|
||||
mail_appdb($ob->queueEmail, $sSubject ,$sMsg);
|
||||
}
|
||||
if ($goodtogo)
|
||||
@@ -321,18 +328,11 @@ if ($_REQUEST['sub'])
|
||||
$sEmail = get_notify_email_address_list($_REQUEST['appParent'], $_REQUEST['appVersion']);
|
||||
if($sEmail)
|
||||
{
|
||||
$sFullAppName = "Application: ".lookupAppName($_REQUEST['appParent']).
|
||||
" Version: ".lookupVersionName($_REQUEST['appVersion']);
|
||||
$sSubject = "New ".$sFullAppName;
|
||||
$sMsg = APPDB_ROOT."appview.php?appId=".$_REQUEST['appParent']."&versionId=".$_REQUEST['appVersion']."\r\n";
|
||||
$sMsg .= "New Application added to database:\r\n";
|
||||
$sMsg .= $sFullAppName."\r\n";
|
||||
|
||||
mail_appdb($sEmail, $sSubject ,$sMsg);
|
||||
}
|
||||
}
|
||||
//done
|
||||
addmsg("<a href=".apidb_fullurl("appview.php")."?appId=".$_REQUEST['appParent']."&versionId=".$_REQUEST['appVersion'].">View App</a>", "green");
|
||||
addmsg("<a href=".apidb_fullurl("appview.php")."?appId=".$_REQUEST['appParent'].">View App</a>", "green");
|
||||
redirect(apidb_fullurl("admin/adminAppQueue.php"));
|
||||
exit;
|
||||
}
|
||||
@@ -348,22 +348,17 @@ if ($_REQUEST['sub'])
|
||||
else
|
||||
{
|
||||
//Send Status Email
|
||||
if($_REQUEST['type'] == 'ver')
|
||||
{
|
||||
$sFullAppName = lookupAppName($_REQUEST['appParent'])." ".lookupVersionName($_REQUEST['appVersion']);
|
||||
} else
|
||||
{
|
||||
$sFullAppName = lookupAppName($_REQUEST['appParent']);
|
||||
}
|
||||
$sSubject = $sFullAppName." has not been added into the AppDB";
|
||||
if ($ob->queueEmail)
|
||||
{
|
||||
if($ob->queueCatId == -1) //app version
|
||||
{
|
||||
$sFullAppName = lookupAppName($_REQUEST['appParent'])." Version: ".$ob->queueVersion;
|
||||
} else
|
||||
{
|
||||
$sFullAppName = $ob->queueName." Version: ".$ob->queueVersion;
|
||||
}
|
||||
|
||||
$sSubject = "Application Database Status Report";
|
||||
$sMsg .= "Your application: ".$sFullAppName." has not been entered ";
|
||||
$sMsg .= "into the application database.\r\n";
|
||||
$sMsg .= "Sorry!\r\n";
|
||||
$sMsg .= $emailtext;
|
||||
|
||||
$sMsg = $emailtext;
|
||||
mail_appdb($ob->queueEmail, $sSubject ,$sMsg);
|
||||
}
|
||||
//success
|
||||
|
||||
@@ -235,8 +235,8 @@ if(isset($_REQUEST['submit1']))
|
||||
<br /><span class=\"subtitle\">What was not tested:</span><br />
|
||||
- burning<br />
|
||||
</p>";
|
||||
$oRow->description .= "<p><span class=\"title\">Tested versions</span><br /><table width=\"90%\" border=\"1\">
|
||||
<thead><tr>
|
||||
$oRow->description .= "<p><span class=\"title\">Tested versions</span><br /><table class=\"historyTable\" width=\"90%\" border=\"1\">
|
||||
<thead class=\"historyHeader\"><tr>
|
||||
<td>App. version</td><td>Wine version</td><td>Installs?</td><td>Runs?</td><td>Rating</td>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
|
||||
@@ -2,25 +2,21 @@
|
||||
/* The following styles are used for application description and notes */
|
||||
/***********************************************************************/
|
||||
|
||||
BODY {
|
||||
background-color: #FFFFFF;
|
||||
color: #000000;
|
||||
font-family: "bitstream vera sans", "verdana", "arial", "helvetica", sans-serif;
|
||||
margin: 0px 10px 0px 0px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
thead { font-weight: bold }
|
||||
|
||||
.title { font-weight: bold; }
|
||||
|
||||
.subtitle { text-decoration: underline; font-style: italic; }
|
||||
|
||||
.code { font-family: fixed; font-size: 12px; }
|
||||
|
||||
table { border: 1px;
|
||||
font-family: "bitstream vera sans", "verdana", "arial", "helvetica", sans-serif;
|
||||
font-size: 12px; }
|
||||
p { color: #000000;
|
||||
font-family: "bitstream vera sans", "verdana", "arial", "helvetica", sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
thead.historyHeader { font-weight: bold }
|
||||
|
||||
table.historyTable { border: 1px;
|
||||
font-family: "bitstream vera sans", "verdana", "arial", "helvetica", sans-serif;
|
||||
font-size: 12px; }
|
||||
|
||||
td.gold { background-color: #fff600; }
|
||||
td.silver { background-color: silver; }
|
||||
|
||||
@@ -103,6 +103,38 @@ if (isset($_REQUEST['queueName']))
|
||||
#######################################
|
||||
else if (isset($_REQUEST['apptype']))
|
||||
{
|
||||
//FIXME: use absolute path in htmlarea_loader.js to avoid code duplication here
|
||||
?>
|
||||
<link rel="stylesheet" href="./application.css" type="text/css">
|
||||
<!-- load HTMLArea -->
|
||||
<script type="text/javascript">
|
||||
_editor_url = "./htmlarea/";
|
||||
_editor_lang = "en";
|
||||
function initDocument() {
|
||||
config = new HTMLArea.Config();
|
||||
config.toolbar = [
|
||||
[ "bold", "italic", "underline", "strikethrough", "separator",
|
||||
"copy", "cut", "paste", "space", "undo", "redo", "separator",
|
||||
"justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
|
||||
"orderedlist", "unorderedlist", "outdent", "indent", "separator",
|
||||
"forecolor", "hilitecolor", "separator",
|
||||
"inserthorizontalrule", "createlink", "inserttable" ]
|
||||
];
|
||||
config.width = 700;
|
||||
var editor = new HTMLArea("editor",config);
|
||||
editor.config.pageStyle = "@import url(./application.css);";
|
||||
editor.registerPlugin(DynamicCSS);
|
||||
editor.generate();
|
||||
}
|
||||
|
||||
onload = function() {
|
||||
HTMLArea.loadPlugin("DynamicCSS");
|
||||
HTMLArea.init();
|
||||
HTMLArea.onload = initDocument;
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="./htmlarea/htmlarea.js"></script>
|
||||
<?php
|
||||
// set email field if logged in
|
||||
if ($_SESSION['current']->isLoggedIn())
|
||||
$email = $_SESSION['current']->sEmail;
|
||||
@@ -149,9 +181,9 @@ else if (isset($_REQUEST['apptype']))
|
||||
|
||||
echo '<tr valign=top><td class=color0><b>App URL</b></td>',"\n";
|
||||
echo '<td><input type=text name="queueURL" value="" size=20></td></tr>',"\n";
|
||||
|
||||
echo '<tr valign=top><td class=color0><b>App Desc</b></td>',"\n";
|
||||
echo '<td><textarea name="queueDesc" rows=10 cols=35></textarea></td></tr>',"\n";
|
||||
$sDescription = "<p>Enter description here</p>";
|
||||
echo '<tr valign=top><td class=color0><b>Description</b></td>',"\n";
|
||||
echo '<td><p style="width:700px"><textarea cols="80" rows="20" id="editor" name="queueDesc">'.$sDescription.'</textarea></p></td></tr>',"\n";
|
||||
|
||||
echo '<tr valign=top><td class=color0><b>Email</b></td>',"\n";
|
||||
echo '<td><input type=text name="queueEmail" value="'.$email.'" size=20></td></tr>',"\n";
|
||||
@@ -182,12 +214,31 @@ else if (isset($_REQUEST['apptype']))
|
||||
|
||||
echo '<tr valign=top><td class=color0><b>App Version</b></td>',"\n";
|
||||
echo '<td><input type=text name="queueVersion" size=20></td></tr>',"\n";
|
||||
|
||||
echo '<tr valign=top><td class=color0><b>App URL</b></td>',"\n";
|
||||
echo '<td><input type=text name="queueURL" size=20></td></tr>',"\n";
|
||||
$sDescription = "<p>This is a template; enter version-specific description here</p>";
|
||||
$sDescription .= "<p>
|
||||
<span class=\"title\">Wine compatibility</span><br />
|
||||
<span class=\"subtitle\">What works:</span><br />
|
||||
- settings<br />
|
||||
- help<br />
|
||||
<br /><span class=\"subtitle\">What doesn't work:</span><br />
|
||||
- erasing<br />
|
||||
<br /><span class=\"subtitle\">What was not tested:</span><br />
|
||||
- burning<br />
|
||||
</p>";
|
||||
$oRow->description .= "<p><span class=\"title\">Tested versions</span><br /><table class=\"historyTable\" width=\"90%\" border=\"1\">
|
||||
<thead class=\"historyHeader\"><tr>
|
||||
<td>App. version</td><td>Wine version</td><td>Installs?</td><td>Runs?</td><td>Rating</td>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<td class=\"gold\">3.23</td><td class=\"gold\">20050111</td><td class=\"gold\">yes</td><td class=\"gold\">yes</td><td class=\"gold\">Gold</td>
|
||||
</tr><tr>
|
||||
<td class=\"silver\">3.23</td><td class=\"silver\">20041201</td><td class=\"silver\">yes</td><td class=\"silver\">yes</td><td class=\"silver\">Silver</td>
|
||||
</tr><tr>
|
||||
<td class=\"bronze\">3.21</td><td class=\"bronze\">20040615</td><td class=\"bronze\">yes</td><td class=\"bronze\">yes</td><td class=\"bronze\">Bronze</td>
|
||||
</tr></tbody></table></p><p> <br /> </p>";
|
||||
|
||||
echo '<tr valign=top><td class=color0><b>App Desc</b></td>',"\n";
|
||||
echo '<td><textarea name="queueDesc" rows=10 cols=35></textarea></td></tr>',"\n";
|
||||
echo '<td><p style="width:700px"><textarea cols="80" rows="20" id="editor" name="queueDesc">'.$sDescription.'</textarea></p></td></tr>',"\n";
|
||||
|
||||
echo '<tr valign=top><td class=color0><b>Email</b></td>',"\n";
|
||||
echo '<td><input type=text name="queueEmail" value="'.$email.'" size=20></td></tr>',"\n";
|
||||
|
||||
Reference in New Issue
Block a user