Module: appdb
Branch: master
Commit: ad73b6445f9072893eb8387b019ac290699522c1
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=ad73b6445f9072893eb8387b…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
Date: Tue Oct 23 16:21:17 2007 +0200
Improve help text on the confirm deletion page
---
include/objectManager.php | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/include/objectManager.php b/include/objectManager.php
index 8c49d0c..b40a461 100644
--- a/include/objectManager.php
+++ b/include/objectManager.php
@@ -433,6 +433,22 @@ class ObjectManager
return;
}
+ /* Why the user should write an explanation for the deletion */
+ if($oObject->objectGetSubmitterId() != $_SESSION['current']->iUserId)
+ {
+ $shWhyComment = "Please enter a reason why so that you don’t hurt the submitter’s".
+ " feelings.";
+
+ $oUser = new user($oObject->objectGetSubmitterId());
+ $sSubmitter = " (submitted by ".$oUser->objectMakeLink().")";
+ } else
+ {
+ $shWhyComment = "Although you submitted it it might be useful for other users to know why ".
+ "you are deleting it.";
+
+ $sSubmitter = "";
+ }
+
$oTable = new Table();
$oTableRow = new TableRow();
$oTable->setAlign("center");
@@ -444,9 +460,8 @@ class ObjectManager
"Confirm deletion".
"</div>".
'<div class="info_contents">'.
- "Are you sure you wish to delete this entry?<br />".
- "Please enter a reason why so that you don’t hurt the submitter’s".
- " feelings.".
+ "Are you sure you wish to delete this entry".$sSubmitter."?<br />".
+ $shWhyComment.
"</div>".
"</div>".
Module: appdb
Branch: master
Commit: fb13cd7c13a9aaf2c3fef4ce468baabb73cad48b
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=fb13cd7c13a9aaf2c3fef4ce…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
Date: Tue Oct 23 14:16:00 2007 +0200
Support previewing applications
---
include/application.php | 13 ++++++++++++-
include/application_queue.php | 12 ++++++++++++
include/version.php | 7 +++----
3 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/include/application.php b/include/application.php
index 15bf660..386fd74 100644
--- a/include/application.php
+++ b/include/application.php
@@ -37,6 +37,7 @@ class Application {
var $sSubmitTime;
var $iSubmitterId;
var $aVersionsIds; // an array that contains the versionId of every version linked to this app.
+ var $aVersions; // Array of version objects belonging to this app
var $iMaintainerRequest; /* Temporary variable for tracking maintainer
requests on app submission. Value denotes type of request */
@@ -45,6 +46,8 @@ class Application {
*/
public function Application($iAppId = null, $oRow = null)
{
+ $this->aVersions = array(); // Should always be an array
+
// we are working on an existing application
if(!$iAppId && !$oRow)
return;
@@ -500,6 +503,10 @@ class Application {
mail_appdb($sEmail, $sSubject ,$sMsg);
}
+ public function objectShowPreview()
+ {
+ return TRUE;
+ }
/* output a html table and this applications values to the fields for editing */
public function outputEditor($sVendorName = "")
@@ -801,7 +808,7 @@ class Application {
echo html_frame_end("For more details and user comments, view the versions of this application.");
// display versions
- Version::displayList($this->aVersionsIds);
+ Version::displayList($this->getVersions());
// display bundle
$this->displayBundle();
@@ -1070,6 +1077,10 @@ class Application {
public function getVersions($bIncludeObsolete = TRUE)
{
+ /* If no id is set we cannot query for the versions, but perhaps objects are already cached? */
+ if(!$this->iAppId)
+ return $this->aVersions;
+
$aVersions = array();
$hResult = $this->_internal_retrieve_all_versions($bIncludeObsolete);
diff --git a/include/application_queue.php b/include/application_queue.php
index 3aa82cb..883e126 100644
--- a/include/application_queue.php
+++ b/include/application_queue.php
@@ -152,6 +152,14 @@ class application_queue
return $this->oApp->objectGetMail($sAction, $bMailSubmitter, $bParentAction);
}
+ public function objectShowPreview()
+ {
+ if($this->oApp->sName)
+ return TRUE;
+
+ return FALSE;
+ }
+
function outputEditor()
{
/* We ask the user for the application name first so as to avoid duplicate
@@ -291,6 +299,10 @@ class application_queue
function display()
{
+ /* Cache the version object if it is not in the database */
+ if(!$this->oVersionQueue->objectGetId())
+ $this->oApp->aVersions = array($this->oVersionQueue->oVersion);
+
$this->oApp->display();
}
diff --git a/include/version.php b/include/version.php
index 63a5e03..8d49bf3 100644
--- a/include/version.php
+++ b/include/version.php
@@ -1097,9 +1097,9 @@ class version {
}
// display the versions
- public static function displayList($aVersionsIds)
+ public static function displayList($aVersions)
{
- if ($aVersionsIds)
+ if ($aVersions)
{
echo html_frame_start("","98%","",0);
@@ -1137,9 +1137,8 @@ class version {
$oTable->SetHeader($oTableRow);
$c = 0;
- foreach($aVersionsIds as $iVersionId)
+ foreach($aVersions as $oVersion)
{
- $oVersion = new Version($iVersionId);
$oApp = new application($oVersion->iAppId);
if ($oVersion->sQueued == $oApp->sQueued)
{
Module: appdb
Branch: master
Commit: 0c47bd87a3ba556c794fb8e39926ae91f67b7aad
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=0c47bd87a3ba556c794fb8e3…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
Date: Tue Oct 23 13:35:06 2007 +0200
Allow users to view apps with no id
---
include/user.php | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/user.php b/include/user.php
index b30dee3..b23f005 100644
--- a/include/user.php
+++ b/include/user.php
@@ -632,6 +632,10 @@ class User {
/* application permissions */
function canViewApplication($oApp)
{
+ /* If there is no id the app is not in the database, which means the current user must have created the object */
+ if(!$oApp->iAppId)
+ return true;
+
/* if the application isn't queued */
if($oApp->sQueued == 'false')
return true;