Module: appdb
Branch: master
Commit: 4cb6ec56406dfca98556f4f559ed3bf9eed51c6e
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=4cb6ec56406dfca98556f4f5…
Author: Jeremy Newman <jnewman(a)codeweavers.com>
Date: Fri Nov 18 13:44:33 2016 -0600
comments disabled when no maintainers
We are no longer going to allow comments when the application
does not have maintainers.
Based on a patch from: "Andre Hentschel" <nerv(a)dawncrow.de>
---
include/version.php | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/include/version.php b/include/version.php
index 1ee7a26..60b14df 100644
--- a/include/version.php
+++ b/include/version.php
@@ -1165,8 +1165,17 @@ EOT;
// Comments Section
echo "<h2 id=\"viewComments\" class=\"whq-app-title\">Comments</h2>\n";
- if($this->iVersionId)
- Comment::view_app_comments($this->iVersionId);
+ if(sizeof($aMaintainers)>0)
+ {
+ if($this->iVersionId)
+ Comment::view_app_comments($this->iVersionId);
+ }
+ else
+ {
+ echo html_note('<i class="fa fa-exclamation-circle"></i> <b>Comments Disabled</b><br><br> '.
+ 'Comments for this application have be disabled becuase there are no maintainers.',
+ "","","warning");
+ }
}
public static function lookup_name($versionId)
Module: appdb
Branch: master
Commit: 317b055108618d1532ef75aa9f41d08bb58514e5
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=317b055108618d1532ef75aa…
Author: Jeremy Newman <jnewman(a)codeweavers.com>
Date: Fri Nov 18 13:24:13 2016 -0600
dracionian rules for coding standards aren't needed here
just look at the code, and keep with what you see
---
CODING_STANDARD | 115 --------------------------------------------------------
1 file changed, 115 deletions(-)
diff --git a/CODING_STANDARD b/CODING_STANDARD
deleted file mode 100644
index 463140e..0000000
--- a/CODING_STANDARD
+++ /dev/null
@@ -1,115 +0,0 @@
-WineHQ Application Database Coding Practice
-
-/**
- * HTML
- */
-- Respect html coding standards. The current doctype is HTML 4.01 transitional (http://www.w3.org/TR/REC-html40/)
-Try to make your content validate nicely (http://validator.w3.org/)
-
-Avoid using implicitly closed elements eg. <br/> in HTML 4.01 transitional, as it can lead to validation errors.
-http://www.w3.org/TR/html401/struct/text.html#edef-BR
-
-/**
- * Variables naming
- */
-variables that don't come from outside your script (i.e. that aren't fetched from superglobals) should be named this way
-(a.k.a hungarian notation):
-prefix + var_name
-
-Where prefix is one of:
-Scalar types:
-i for integers
-f for floats
-s for strings
-sh for html strings
-b for booleans
-Compound types:
-a for arrays
-o for objects
-Special type:
-h for handles
-
-the rest of the variable's name is using camel style
-examples:
-$aUsers
-$iTopicId
-$hRecordSet
-$sQuery
-$hResult
-
-
-/**
- * Functions naming
- */
-1)functions name should be declarative and be prefixed with the name of the module (=file) where it is stored (for example image_show_thumbnail())
-2)methods (functions inside a class) are named like this: setMyName() (i.e. words separated with an upper case character)
-3)normal functions (outside a class) are named like this: query_appdb() (i.e. words separated with an underscore)
-
-
-/**
- * general coding guidelines
- */
-1) functions, loops and if's are written this way (look at the way {}'s are lined up):
-<?php
-function do_foo($sVar)
-{
- if(isset($sVar))
- {
- echo "bar";
- } else
- {
- echo "foo";
- }
-}
-?>
-
-2) indentation is made of 4 spaces (no tabs please)
-
-3) line length should be no more than 130 characters, preferably < 80
-
-4) use long php tags (<?php ?>) instead of short ones (<? ?>) as :
- a) it could be removed from future versions of php
- b) if conflicts with tags like <?xml version=1.0 ?> that are used in xhtml
-
-5) do not use vars that require register_globals to be on as:
- a) it is off by default in php 4.1+
- b) it is more secure
- c) it makes it easier to understand where your vars are coming from (forms, session, etc.)
-
-
-/**
- * comments
- */
-1) function, method, header and multiline comments:
-/**
- * This functions does nothing interesing.
- * More comments to come here...
- */
-function bar()
-{
- foo();
-}
-
-2) one-line comments
-// This is a one line comment
-
-3) always put a single space after the comment mark
-
-4) never use # for commenting as it will become obsolete in the future
-
-/**
- * string quotes
- */
-There are two different ways to quote strings in PHP - single quotes or double quotes.
-The difference is that the parser does variable interpolation in double-quoted strings, but not in single quoted strings.
-Because of this, always use single quotes unless the string contains a variable that needs to be parsed.
-
-Also if the string contains a variable put it inside double quotes instead of using 'bla' . $var . 'bla';
-To increase readability of the code.
-Wrong:
-$str = "This is a long string without any variables";
-$str = 'This string contains a variable ' . $var . ' enough said.';
-
-Right:
-$str = 'This is a long string without any variables';
-$str = "This string contains a variable $var enough said";
Module: appdb
Branch: master
Commit: 008816f6ef04b9e0866d2d5032f8f3b0b20732b2
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=008816f6ef04b9e0866d2d50…
Author: Jeremy Newman <jnewman(a)codeweavers.com>
Date: Fri Nov 18 12:03:09 2016 -0600
set rating color on column
---
include/testData.php | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/include/testData.php b/include/testData.php
index aed90c0..352428f 100644
--- a/include/testData.php
+++ b/include/testData.php
@@ -544,6 +544,7 @@ class testData{
$oTableRowHeader->AddTextCell("Runs?");
$oTableRowHeader->AddTextCell("Rating");
$oTableRowHeader->AddTextCell("Submitter");
+ $oTableRowHeader->AddTextCell("");
$oTable->SetHeader($oTableRowHeader);
return $oTable;
}
@@ -567,18 +568,15 @@ class testData{
if ($this->iTestingId == $iCurrentId)
{
$sTRClass = $bgcolor;
-
$oTableCell = new TableCell("<b>Current</b>");
$oTableCell->SetAlign("center");
- } else /* make all non-current rows clickable so clicking on them selects the test as current */
+ }
+ else
{
- $sTRClass = $bgcolor;
-
+ /* make all non-current rows clickable so clicking on them selects the test as current */
$sUrl = $sLink.$this->iTestingId;
-
if($bShowAll)
$sUrl .= '&bShowAll=true';
-
$oTableRowClick = new TableRowClick($sUrl);
// add the table element indicating that the user can show the row by clicking on it
@@ -588,29 +586,29 @@ class testData{
}
$oTableRow->AddCell($oTableCell);
- $oTableRow->SetClass($sTRClass);
-
$oTableRow->AddTextCell($oDistribution->objectMakeLink());
$oTableRow->AddTextCell(date("M d Y", mysqldatetime_to_unixtimestamp($this->sTestedDate)));
$oTableRow->AddTextCell($this->sTestedRelease.' ');
$oTableRow->AddTextCell($this->sInstalls.' ');
$oTableRow->AddTextCell($this->sRuns.' ');
- $oTableRow->AddTextCell($this->sTestedRating.' ');
+ $oTableCell = new TableCell($this->sTestedRating);
+ $oTableCell->SetClass($bgcolor);
+ $oTableRow->AddCell($oTableCell);
$oTableRow->AddTextCell($oSubmitter->objectMakeLink().' ');
if ($this->iTestingId && $_SESSION['current']->hasAppVersionModifyPermission($oVersion))
{
$oObject = new objectManager('testData');
if($oApp->canEdit())
- $shChangeParentLink = '<a href="'.$oObject->makeUrl('showChangeParent', $this->iTestingId, 'Move test report to another version').'&sReturnTo='.urlencode($_SERVER['REQUEST_URI']).'">Move</a>'."\n";
+ $shChangeParentLink = '<a href="'.$oObject->makeUrl('showChangeParent', $this->iTestingId, 'Move test report to another version').'&sReturnTo='.urlencode($_SERVER['REQUEST_URI']).'" class="btn btn-default button-xs">Move</a>'."\n";
else
$shChangeParentLink = '';
$oTableRow->AddTextCell('<a href="'.$oObject->makeUrl('edit', $this->iTestingId,
- 'Edit Test Results').'&sReturnTo='.urlencode($_SERVER['REQUEST_URI']).'">'.
- 'Edit</a> '."\n".
+ 'Edit Test Results').'&sReturnTo='.urlencode($_SERVER['REQUEST_URI']).'" class="btn btn-default button-xs">'.
+ 'Edit</a> '."\n".
$shChangeParentLink.
'<a href="'.$oObject->makeUrl('delete', $this->iTestingId, 'Delete+Test+Results').
- '&sReturnTo='.urlencode($_SERVER['REQUEST_URI']).'">Delete</a></td>'."\n");
+ '&sReturnTo='.urlencode($_SERVER['REQUEST_URI']).'" class="btn btn-default button-xs">Delete</a></td>'."\n");
}
// if this is a clickable row, set the appropriate property