diff --git a/admin/editAppFamily.php b/admin/editAppFamily.php index 8871e5a..deaaffe 100644 --- a/admin/editAppFamily.php +++ b/admin/editAppFamily.php @@ -99,13 +99,30 @@ if(isset($_REQUEST['submit'])) 'vendorId' => $_REQUEST['vendorId'], 'keywords' => $_REQUEST['keywords'], 'catId' => $_REQUEST['catId'] )); - + + // success if (query_appdb("UPDATE `appFamily` SET $sUpdate WHERE `appId` = {$_REQUEST['appId']}")) + { + $sEmail = get_notify_email_address_list($_REQUEST['appId']); + if($sEmail) + { + $sSubject = lookupAppName($_REQUEST['appId'])." has been modified 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); + } + addmsg("The application was successfully updated in the database", "green"); + redirect(apidb_fullurl("appview.php?appId=".$_REQUEST['appId'])); + } else { - - addmsg("Database Updated", "green"); - - } + //error + redirect(apidb_fullurl("admin/editAppVersion.php?appId=".$_REQUEST['appId']."&versionId=".$_REQUEST['versionId'])); + } } } else if($_REQUEST['submit'] == "Update URL") @@ -177,30 +194,33 @@ if(isset($_REQUEST['submit'])) } } } - } - if ($bAppChanged) - { - $sEmail = get_notify_email_address_list($_REQUEST['appId']); - if($sEmail) + if ($bAppChanged) { - $sFullAppName = "Application: ".lookupAppName($_REQUEST['appId']); - $sMsg = APPDB_ROOT."appview.php?appId=".$_REQUEST['appId']."\r\n"; - $sMsg .= "\r\n"; - $sMsg .= $_SESSION['current']->sRealname." changed ".$sFullAppName." \r\n"; - $sMsg .= "\r\n"; - $sMsg .= $sWhatChanged."\r\n"; - $sMsg .= "\r\n"; - - mail_appdb($sEmail, $sFullAppName ,$sMsg); + $sEmail = get_notify_email_address_list($_REQUEST['appId']); + if($sEmail) + { + $sFullAppName = "Links for ".lookupAppName($_REQUEST['appId'])." have been updated"; + $sMsg = APPDB_ROOT."appview.php?appId=".$_REQUEST['appId']."\r\n"; + $sMsg .= "\n"; + $sMsg .= $_SESSION['current']->sRealname." updated links for ".$sFullAppName." \r\n"; + $sMsg .= "\n"; + $sMsg .= $sWhatChanged."\n"; + mail_appdb($sEmail, $sFullAppName ,$sMsg); + } } - } - redirect(apidb_fullurl("appview.php?appId={$_REQUEST['appId']}")); - exit; + redirect(apidb_fullurl("appview.php?appId={$_REQUEST['appId']}")); + exit; + } } else // Show the form for editing the Application Family { +?> + + + +\n"; + echo "
"; - echo html_back_link(1,BASE."appview.php?appId=$ob->appId&versionId=$ob->versionId"); + echo html_back_link(1,BASE."appview.php?versionId=".$_REQUEST['versionId']); apidb_footer(); } ?> diff --git a/apidb.css b/apidb.css index bbae317..7a86e28 100644 --- a/apidb.css +++ b/apidb.css @@ -133,7 +133,7 @@ p.indent { padding-left: 1em; padding-right: 1em;} .committed { font-style: italic; color: gray; } /* App Support status */ -.gold { background-color: #8B7E66; } +.gold { background-color: #fff600; } .silver { background-color: silver; } @@ -224,3 +224,6 @@ TD.stub { color: #0000B1; font-style: italic; text-align: center } /* Banner div */ #banner { border: 1px solid black; } + +/* Editor textarea */ +#editor { height: 25em; width:700px; } diff --git a/application.css b/application.css new file mode 100644 index 0000000..10a55f8 --- /dev/null +++ b/application.css @@ -0,0 +1,29 @@ +/***********************************************************************/ +/* 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; } + +td.gold { background-color: #fff600; } +td.silver { background-color: silver; } +td.bronze { background-color: #fcba0a; } +td.garbage { background-color: #5c4f2a; } + diff --git a/include/application.php b/include/application.php index 57357c8..b0865de 100644 --- a/include/application.php +++ b/include/application.php @@ -116,4 +116,20 @@ function lookupAppName($appId) return $ob->appName; } + +/** + * Remove html formatting from description and extract the first part of the description only. + * This is to be used for search results, application summary tables, etc. + */ +function trim_description($sDescription) +{ + // 1) let's take the first line of the description: + $aDesc = explode("\n",trim($sDescription),2); + // 2) maybe it's an html description and lines are separated with
+ $aDesc = explode("
",$aDesc[0],2);
+ $aDesc = explode("
",$aDesc[0],2);
+ $aDesc = explode("
",$aDesc[0],2); + $aDesc = explode("
",$aDesc[0],2); + return trim(strip_tags($aDesc[0])); +} ?> diff --git a/index.php b/index.php index aa9ab57..2ec9af4 100644 --- a/index.php +++ b/index.php @@ -114,11 +114,10 @@ while($oRow = mysql_fetch_object($hResult)) $oApp = new Application($oRow->appId); // image $img = get_screenshot_img($oRow->appId); - $aDesc = explode("\n",$oApp->data->description,2); echo '