diff options
author | Michael Tänzer <neo@nhng.de> | 2014-04-29 18:07:01 +0200 |
---|---|---|
committer | Michael Tänzer <neo@nhng.de> | 2014-04-29 18:07:01 +0200 |
commit | 1b87c44562331f80143051608c4b784c4a1539a2 (patch) | |
tree | 274075b932c5d2af9e21205e84cf5869d4908abf | |
parent | 029baf4f3bc7d7d07100bf6eb9792fd28377616d (diff) | |
download | cacert-devel-1b87c44562331f80143051608c4b784c4a1539a2.tar.gz cacert-devel-1b87c44562331f80143051608c4b784c4a1539a2.tar.xz cacert-devel-1b87c44562331f80143051608c4b784c4a1539a2.zip |
bug 1138: Reduce number of parameters for output_assurances_row()
Signed-off-by: Michael Tänzer <neo@nhng.de>
-rw-r--r-- | includes/notary.inc.php | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php index 7b73e73..6d23cf5 100644 --- a/includes/notary.inc.php +++ b/includes/notary.inc.php @@ -402,23 +402,24 @@ define('THAWTE_REVOCATION_DATETIME', '2010-11-16 00:00:00'); /** * Render an assurance for a view - * @param int $assuranceid - id of the assurance - * @param string $date - When the assurance took place in user provided format - * @param string $when - When the assurance was entered (ISO format), only visible for support + * @param array $assurance - associative array containing the data from the `notary` table * @param string $email - Email address of the other party, only visible for support * @param string $name - Name of the other party * @param int $awarded - The points the Assurer wanted to issue (not rounded down) - * @param int $points - The points recognised by the system (rounded down) - * @param string $location - Where the assurance took place - * @param string $method - The method used to make the assurance (Face-to-Face, Administrative Increase, etc.) - * @param int $experience - Number of experience points the Assurer got for this assurance * @param int $userid - Id of the user whichs given/received assurances are displayed * @param int $support - set to 1 if the output is for the support interface - * @param bool $revoked - whether the assurance is already revoked * @param string $ticketno - ticket number currently set in the support interface */ - function output_assurances_row($assuranceid,$date,$when,$email,$name,$awarded,$points,$location,$method,$experience,$userid,$support,$revoked, $ticketno) + function output_assurances_row($assurance, $email, $name, $awarded, $userid, $support, $ticketno) { + $assuranceid = intval($assurance['id']); + $date = $assurance['date']; + $when = $assurance['when']; + $points = intval($assurance['points']); + $location = $assurance['location']; + $method = $assurance['method'] ? _($assurance['method']) : ''; + $experience = intval($assurance['experience']); + $revoked = $assurance['deleted'] !== NULL_DATETIME; $tdstyle=""; $emopen=""; @@ -531,7 +532,7 @@ define('THAWTE_REVOCATION_DATETIME', '2010-11-16 00:00:00'); $apoints = calc_experience($row, $sum_points, $sum_experience); $name = show_user_link ($assuree['fname']." ".$assuree['lname'],intval($row['to'])); $email = show_email_link ($assuree['email'],intval($row['to'])); - output_assurances_row (intval($row['id']),$row['date'],$row['when'],$email,$name,$apoints,intval($row['points']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$row['experience'],$userid,$support,$row['deleted']!==NULL_DATETIME, $ticketno); + output_assurances_row($row, $email, $name, $apoints, $userid, $support, $ticketno); } } @@ -556,7 +557,7 @@ define('THAWTE_REVOCATION_DATETIME', '2010-11-16 00:00:00'); $awarded = calc_assurances($row, $sum_points, $sum_experience); $name = show_user_link ($fromuser['fname']." ".$fromuser['lname'],intval($row['from'])); $email = show_email_link ($fromuser['email'],intval($row['from'])); - output_assurances_row (intval($row['id']),$row['date'],$row['when'],$email,$name,$awarded,intval($row['points']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$row['experience'],$userid,$support,$row['deleted']!==NULL_DATETIME, $ticketno); + output_assurances_row($row, $email, $name, $awarded, $userid, $support, $ticketno); } } |