Ticket #1120: #1120-#20100731-v2.patch
| File #1120-#20100731-v2.patch, 7.9 KB (added by peterb, 22 months ago) |
|---|
-
plugins/Live/API.php
### Eclipse Workspace Patch 1.0 #P trunk
134 134 135 135 $site = new Piwik_Site($idSite); 136 136 $timezone = $site->getTimezone(); 137 138 $visitorDetailsArray['siteCurrency'] = $site->getCurrency(); 139 137 140 $dateTimeVisit = Piwik_Date::factory($visitorDetailsArray['firstActionTimestamp'], $timezone); 138 141 $visitorDetailsArray['serverDatePretty'] = $dateTimeVisit->getLocalized('%shortDay% %day% %shortMonth%'); 139 142 $visitorDetailsArray['serverTimePretty'] = $dateTimeVisit->getLocalized('%time%'); 140 143 141 // get Detail - 100 single SQL Statements - Performance Issue 144 if(!empty($visitorDetailsArray['goalTimePretty'])) { 145 $dateTimeConversion = Piwik_Date::factory($visitorDetailsArray['goalTimePretty'], $timezone); 146 $visitorDetailsArray['goalTimePretty'] = $dateTimeConversion->getLocalized('%shortDay% %day% %shortMonth% %time%'); 147 } 148 142 149 $idvisit = $visitorDetailsArray['idVisit']; 143 150 144 151 $sql = " 145 SELECT DISTINCT " .Piwik_Common::prefixTable('log_action').".name AS pageUrl 152 SELECT 153 " .Piwik_Common::prefixTable('log_action').".name AS pageUrl, 154 " .Piwik_Common::prefixTable('log_action').".idaction AS pageIdAction 146 155 FROM " .Piwik_Common::prefixTable('log_link_visit_action')." 147 156 INNER JOIN " .Piwik_Common::prefixTable('log_action')." 148 157 ON " .Piwik_Common::prefixTable('log_link_visit_action').".idaction_url = " .Piwik_Common::prefixTable('log_action').".idaction … … 152 161 $visitorDetailsArray['actionDetails'] = Piwik_FetchAll($sql); 153 162 154 163 $sql = " 155 SELECT DISTINCT " .Piwik_Common::prefixTable('log_action').".name AS pageUrl 164 SELECT 165 " .Piwik_Common::prefixTable('log_action').".name AS pageTitle, 166 " .Piwik_Common::prefixTable('log_action').".idaction AS pageIdAction 156 167 FROM " .Piwik_Common::prefixTable('log_link_visit_action')." 157 168 INNER JOIN " .Piwik_Common::prefixTable('log_action')." 158 169 ON " .Piwik_Common::prefixTable('log_link_visit_action').".idaction_name = " .Piwik_Common::prefixTable('log_action').".idaction … … 160 171 "; 161 172 162 173 $visitorDetailsArray['actionDetailsTitle'] = Piwik_FetchAll($sql); 174 163 175 $table->addRowFromArray( array(Piwik_DataTable_Row::COLUMNS => $visitorDetailsArray)); 164 176 } 165 177 … … 214 226 } 215 227 216 228 $sql = "SELECT " . Piwik_Common::prefixTable('log_visit') . ".* , 217 " . Piwik_Common::prefixTable ( 'goal' ) . ".match_attribute 229 " . Piwik_Common::prefixTable ( 'goal' ) . ".match_attribute as goal_match_attribute, 230 " . Piwik_Common::prefixTable ( 'goal' ) . ".name as goal_name, 231 " . Piwik_Common::prefixTable ( 'goal' ) . ".revenue as goal_revenue, 232 " . Piwik_Common::prefixTable ( 'log_conversion' ) . ".idaction_url as goal_idaction_url, 233 " . Piwik_Common::prefixTable ( 'log_conversion' ) . ".server_time as goal_server_time 218 234 FROM " . Piwik_Common::prefixTable('log_visit') . " 219 235 LEFT JOIN ".Piwik_Common::prefixTable('log_conversion')." 220 236 ON " . Piwik_Common::prefixTable('log_visit') . ".idvisit = " . Piwik_Common::prefixTable('log_conversion') . ".idvisit … … 225 241 $sqlWhere 226 242 ORDER BY idvisit DESC 227 243 LIMIT ".(int)$limit; 228 229 244 return Piwik_FetchAll($sql, $whereBind); 230 245 } 231 246 -
plugins/Live/templates/visitorLog.tpl
108 108 {foreach from=$visitor.columns.actionDetails item=action} 109 109 <li> 110 110 <a href="{$action.pageUrl}" target="_blank" style="text-decoration:underline;" title="{$action.pageUrl}">{$action.pageUrl|truncate:80:"...":true}</a> 111 {if $visitor.columns.goalUrl eq $action.pageIdAction} 112 <ul class="actionGoalDetails"> 113 <li> 114 <img src="{$visitor.columns.goalIcon}" title="{$visitor.columns.goalType}" /> <strong>{'Live_GoalMatch'|translate}</strong> | 115 {'Live_GoalType'|translate}: <strong>{$visitor.columns.goalType}</strong> | 116 {'Live_GoalName'|translate}: <strong>{$visitor.columns.goalName}</strong> | 117 {if $visitor.columns.goalRevenue > 0}{'Live_GoalRevenue'|translate}: <strong>{$visitor.columns.goalRevenue} {$visitor.columns.siteCurrency}</strong> |{/if} 118 {'Live_GoalTime'|translate}: <strong>{$visitor.columns.goalTimePretty}</strong> 119 120 </li> 121 </ul> 122 {/if} 111 123 </li> 112 124 {/foreach} 113 125 </ol> -
lang/en.php
587 587 'Live_Time' => 'Time', 588 588 'Live_Referrer_URL' => 'Referrer URL', 589 589 'Live_Last30Minutes' => 'Last 30 minutes', 590 'Live_GoalMatch' => 'Matching goal', 591 'Live_GoalType' => 'Type', 592 'Live_GoalName' => 'Name', 593 'Live_GoalTime' => '1st Conversion time', 594 'Live_GoalRevenue' => 'Revenue', 595 'Live_GoalDetails' => 'Details', 590 596 '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.).', 591 597 'Login_LoginPasswordNotCorrect' => 'Username & Password not correct', 592 598 'Login_Password' => 'Password', -
plugins/Live/Visitor.php
78 78 'isVisitorGoalConverted' => $this->isVisitorGoalConverted(), 79 79 'goalIcon' => $this->getGoalIcon(), 80 80 'goalType' => $this->getGoalType(), 81 'goalName' => $this->getGoalName(), 82 'goalRevenue' => $this->getGoalRevenue(), 83 'goalUrl' => $this->getGoalUrl(), 84 'goalTimePretty' => $this->getGoalTimePretty() 81 85 ); 82 86 } 83 87 … … 104 108 { 105 109 return $this->details['idsite']; 106 110 } 107 111 108 112 function getNumberOfActions() 109 113 { 110 114 return $this->details['visit_total_actions']; … … 318 322 319 323 function getGoalType() 320 324 { 321 if(isset($this->details[' match_attribute'])){322 return $this->details['match_attribute'];325 if(isset($this->details['goal_match_attribute'])){ 326 return ucfirst($this->details['goal_match_attribute']); 323 327 } 324 328 return false; 325 329 } 326 330 327 331 function getGoalIcon() 328 332 { 329 if(isset($this->details[' match_attribute'])){333 if(isset($this->details['goal_match_attribute'])){ 330 334 $goalicon = ""; 331 switch ($this->details[' match_attribute']) {335 switch ($this->details['goal_match_attribute']) { 332 336 case "url": 333 337 $goalicon = "plugins/Live/templates/images/goal.png"; 334 338 break; … … 343 347 } 344 348 return false; 345 349 } 350 351 function getGoalName() 352 { 353 if(isset($this->details['goal_name'])){ 354 return $this->details['goal_name']; 355 } 356 return false; 357 } 358 359 function getGoalRevenue() 360 { 361 if(isset($this->details['goal_revenue'])){ 362 return $this->details['goal_revenue']; 363 } 364 return false; 365 } 366 367 function getGoalUrl() 368 { 369 if(isset($this->details['goal_idaction_url'])){ 370 return $this->details['goal_idaction_url']; 371 } 372 return false; 373 } 374 375 function getGoalTimePretty() 376 { 377 if(isset($this->details['goal_server_time'])){ 378 return $this->details['goal_server_time']; 379 } 380 return false; 381 } 346 382 } -
plugins/Live/templates/live.css
57 57 .visitsLiveFooter a.rightLink{ 58 58 float:right; 59 59 padding-right:20px; 60 } 61 No newline at end of file 60 } 61 .actionGoalDetails { 62 margin-left:20px; 63 padding-bottom:10px; 64 font-size:90%; 65 } 66 table.dataTable td.highlightField { 67 background-color:#FFFFCB !important; 68 } 69 70 No newline at end of file
