### Eclipse Workspace Patch 1.0
#P trunk
Index: plugins/Live/API.php
===================================================================
--- plugins/Live/API.php	(revision 2831)
+++ plugins/Live/API.php	(working copy)
@@ -134,15 +134,24 @@
 
 			$site = new Piwik_Site($idSite);
 			$timezone = $site->getTimezone();
+			
+			$visitorDetailsArray['siteCurrency'] = $site->getCurrency();
+
 			$dateTimeVisit = Piwik_Date::factory($visitorDetailsArray['firstActionTimestamp'], $timezone);
 			$visitorDetailsArray['serverDatePretty'] = $dateTimeVisit->getLocalized('%shortDay% %day% %shortMonth%');
 			$visitorDetailsArray['serverTimePretty'] = $dateTimeVisit->getLocalized('%time%');
 
-			// get Detail - 100 single SQL Statements - Performance Issue
+			if(!empty($visitorDetailsArray['goalTimePretty'])) {
+				$dateTimeConversion = Piwik_Date::factory($visitorDetailsArray['goalTimePretty'], $timezone);
+				$visitorDetailsArray['goalTimePretty'] = $dateTimeConversion->getLocalized('%shortDay% %day% %shortMonth% %time%');
+			}
+			
 			$idvisit = $visitorDetailsArray['idVisit'];
 
 			$sql = "
-				SELECT DISTINCT " .Piwik_Common::prefixTable('log_action').".name AS pageUrl
+				SELECT
+				" .Piwik_Common::prefixTable('log_action').".name AS pageUrl,
+				" .Piwik_Common::prefixTable('log_action').".idaction AS pageIdAction
 				FROM " .Piwik_Common::prefixTable('log_link_visit_action')."
 					INNER JOIN " .Piwik_Common::prefixTable('log_action')."
 					ON  " .Piwik_Common::prefixTable('log_link_visit_action').".idaction_url = " .Piwik_Common::prefixTable('log_action').".idaction
@@ -152,7 +161,9 @@
 			$visitorDetailsArray['actionDetails'] = Piwik_FetchAll($sql);
 
 			$sql = "
-				SELECT DISTINCT " .Piwik_Common::prefixTable('log_action').".name AS pageUrl
+				SELECT
+				" .Piwik_Common::prefixTable('log_action').".name AS pageTitle,
+				" .Piwik_Common::prefixTable('log_action').".idaction AS pageIdAction
 				FROM " .Piwik_Common::prefixTable('log_link_visit_action')."
 					INNER JOIN " .Piwik_Common::prefixTable('log_action')."
 					ON  " .Piwik_Common::prefixTable('log_link_visit_action').".idaction_name = " .Piwik_Common::prefixTable('log_action').".idaction
@@ -160,6 +171,7 @@
 				 ";
 
 			$visitorDetailsArray['actionDetailsTitle'] = Piwik_FetchAll($sql);
+			
 			$table->addRowFromArray( array(Piwik_DataTable_Row::COLUMNS => $visitorDetailsArray));
 		}
 
@@ -214,7 +226,11 @@
 		}
 
 		$sql = "SELECT 	" . Piwik_Common::prefixTable('log_visit') . ".* ,
-						" . Piwik_Common::prefixTable ( 'goal' ) . ".match_attribute
+						" . Piwik_Common::prefixTable ( 'goal' ) . ".match_attribute as goal_match_attribute,
+						" . Piwik_Common::prefixTable ( 'goal' ) . ".name as goal_name,
+						" . Piwik_Common::prefixTable ( 'goal' ) . ".revenue as goal_revenue,
+						" . Piwik_Common::prefixTable ( 'log_conversion' ) . ".idaction_url as goal_idaction_url,
+						" . Piwik_Common::prefixTable ( 'log_conversion' ) . ".server_time as goal_server_time
 				FROM " . Piwik_Common::prefixTable('log_visit') . "
 					LEFT JOIN ".Piwik_Common::prefixTable('log_conversion')."
 					ON " . Piwik_Common::prefixTable('log_visit') . ".idvisit = " . Piwik_Common::prefixTable('log_conversion') . ".idvisit
@@ -225,7 +241,6 @@
 					$sqlWhere
 				ORDER BY idvisit DESC
 				LIMIT ".(int)$limit;
-
 		return Piwik_FetchAll($sql, $whereBind);
 	}
 
Index: plugins/Live/templates/visitorLog.tpl
===================================================================
--- plugins/Live/templates/visitorLog.tpl	(revision 2831)
+++ plugins/Live/templates/visitorLog.tpl	(working copy)
@@ -108,6 +108,18 @@
 			{foreach from=$visitor.columns.actionDetails item=action}
 				<li>
 					<a href="{$action.pageUrl}" target="_blank" style="text-decoration:underline;" title="{$action.pageUrl}">{$action.pageUrl|truncate:80:"...":true}</a>
+					{if $visitor.columns.goalUrl eq $action.pageIdAction}
+						<ul class="actionGoalDetails">
+							<li>
+								<img src="{$visitor.columns.goalIcon}" title="{$visitor.columns.goalType}" /> <strong>{'Live_GoalMatch'|translate}</strong> |
+								{'Live_GoalType'|translate}: <strong>{$visitor.columns.goalType}</strong> |
+								{'Live_GoalName'|translate}: <strong>{$visitor.columns.goalName}</strong> |
+								{if $visitor.columns.goalRevenue > 0}{'Live_GoalRevenue'|translate}: <strong>{$visitor.columns.goalRevenue} {$visitor.columns.siteCurrency}</strong> |{/if}
+								{'Live_GoalTime'|translate}: <strong>{$visitor.columns.goalTimePretty}</strong>
+								
+							</li>
+						</ul>
+					{/if}
 				</li>
 			{/foreach}
 			</ol>
Index: lang/en.php
===================================================================
--- lang/en.php	(revision 2831)
+++ lang/en.php	(working copy)
@@ -587,6 +587,12 @@
 	'Live_Time' => 'Time',
 	'Live_Referrer_URL' => 'Referrer URL',
 	'Live_Last30Minutes' => 'Last 30 minutes',
+	'Live_GoalMatch' => 'Matching goal',
+	'Live_GoalType' => 'Type',
+	'Live_GoalName' => 'Name',
+	'Live_GoalTime' => '1st Conversion time',
+	'Live_GoalRevenue' => 'Revenue',
+	'Live_GoalDetails' => 'Details',
 	'Login_PluginDescription' => 'Login Authentication plugin, reading the credentials from the config/config.inc.php file for the Super User, and from the Database for the other users. Can be easily replaced to introduce a new Authentication mechanism (OpenID, htaccess, custom Auth, etc.).',
 	'Login_LoginPasswordNotCorrect' => 'Username &amp; Password not correct',
 	'Login_Password' => 'Password',
Index: plugins/Live/Visitor.php
===================================================================
--- plugins/Live/Visitor.php	(revision 2831)
+++ plugins/Live/Visitor.php	(working copy)
@@ -78,6 +78,10 @@
 			'isVisitorGoalConverted' => $this->isVisitorGoalConverted(),
 			'goalIcon' => $this->getGoalIcon(),
    			'goalType' => $this->getGoalType(),
+			'goalName' => $this->getGoalName(),
+   			'goalRevenue' => $this->getGoalRevenue(),
+			'goalUrl' => $this->getGoalUrl(),
+   			'goalTimePretty' => $this->getGoalTimePretty()
 		);
 	}
 
@@ -104,7 +108,7 @@
 	{
 		return $this->details['idsite'];
 	}
-
+	
 	function getNumberOfActions()
 	{
 		return $this->details['visit_total_actions'];
@@ -318,17 +322,17 @@
 
 	function getGoalType()
 	{
-		if(isset($this->details['match_attribute'])){
-			return $this->details['match_attribute'];
+		if(isset($this->details['goal_match_attribute'])){
+			return ucfirst($this->details['goal_match_attribute']);
 		}
 		return false;
 	}
 
 	function getGoalIcon()
 	{
-		if(isset($this->details['match_attribute'])){
+		if(isset($this->details['goal_match_attribute'])){
 			$goalicon = "";
-			switch ($this->details['match_attribute']) {
+			switch ($this->details['goal_match_attribute']) {
 				case "url":
 					$goalicon = "plugins/Live/templates/images/goal.png";
 					break;
@@ -343,4 +347,36 @@
 		}
 		return false;
 	}
+	
+	function getGoalName()
+	{
+		if(isset($this->details['goal_name'])){
+			return $this->details['goal_name'];
+		}
+		return false;
+	}
+	
+	function getGoalRevenue()
+	{
+		if(isset($this->details['goal_revenue'])){
+			return $this->details['goal_revenue'];
+		}
+		return false;
+	}
+
+	function getGoalUrl()
+	{
+		if(isset($this->details['goal_idaction_url'])){
+			return $this->details['goal_idaction_url'];
+		}
+		return false;
+	}
+
+	function getGoalTimePretty()
+	{
+		if(isset($this->details['goal_server_time'])){
+			return $this->details['goal_server_time'];
+		}
+		return false;
+	}
 }
Index: plugins/Live/templates/live.css
===================================================================
--- plugins/Live/templates/live.css	(revision 2831)
+++ plugins/Live/templates/live.css	(working copy)
@@ -57,4 +57,13 @@
  .visitsLiveFooter a.rightLink{
          float:right;
          padding-right:20px;
- }
\ No newline at end of file
+ }
+ .actionGoalDetails {
+	margin-left:20px;
+	padding-bottom:10px;
+	font-size:90%;
+}
+table.dataTable td.highlightField {
+	background-color:#FFFFCB !important;
+}
+ 
\ No newline at end of file

