From 4c1b27e15dfee227d433a1ae15484731fba7fc0f Mon Sep 17 00:00:00 2001
From: mattpiwik <matthieu.aubry@gmail.com>
Date: Mon, 31 Oct 2011 09:37:13 +0000
Subject: [PATCH] Build

git-svn-id: http://dev.piwik.org/svn/trunk@5397 59fd770c-687e-43c8-a1e3-f5a4ff64c105
---
 plugins/PDFReports/Controller.php             |  2 +-
 plugins/PDFReports/templates/add.tpl          |  2 +-
 ...t_OneVisitorTwoVisits__Actions.get_day.xml |  9 ++++
 ...its_withCookieSupport__Actions.get_day.xml |  9 ++++
 ..._noVisit_PeriodIsLast__Actions.get_day.xml | 10 ++++
 ...noVisit_PeriodIsLast__Actions.get_week.xml | 10 ++++
 .../test_noVisit__Actions.get_day.xml         |  9 ++++
 ...stomVariables.getCustomVariables_range.xml | 48 +++++++++----------
 8 files changed, 73 insertions(+), 26 deletions(-)
 create mode 100644 tests/integration/expected/test_OneVisitorTwoVisits__Actions.get_day.xml
 create mode 100644 tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.get_day.xml
 create mode 100644 tests/integration/expected/test_noVisit_PeriodIsLast__Actions.get_day.xml
 create mode 100644 tests/integration/expected/test_noVisit_PeriodIsLast__Actions.get_week.xml
 create mode 100644 tests/integration/expected/test_noVisit__Actions.get_day.xml

diff --git a/plugins/PDFReports/Controller.php b/plugins/PDFReports/Controller.php
index 887a662b07..8150e5e86e 100644
--- a/plugins/PDFReports/Controller.php
+++ b/plugins/PDFReports/Controller.php
@@ -40,7 +40,7 @@ class Piwik_PDFReports_Controller extends Piwik_Controller
 
 		$view->downloadOutputType = Piwik_PDFReports_API::OUTPUT_DOWNLOAD;
 		$columnsCount = 2;
-		$view->newColumnAfter = round(count($availableReports) / $columnsCount);
+		$view->newColumnAfter = ceil(count($reportsByCategory) / $columnsCount);
 		$view->reportsByCategory = $reportsByCategory;
 		$view->reportsJSON = json_encode($reportsById);
 		$view->periods = array_merge(array('never' => Piwik_Translate('General_Never')),
diff --git a/plugins/PDFReports/templates/add.tpl b/plugins/PDFReports/templates/add.tpl
index 9c08a3e5c4..e7cfe2f564 100644
--- a/plugins/PDFReports/templates/add.tpl
+++ b/plugins/PDFReports/templates/add.tpl
@@ -78,8 +78,8 @@
 					<div class='reportCategory'>{$category}</div><ul class='listReports'>
 					{foreach from=$reports item=report}
 						<li><input type="checkbox" id="{$report.uniqueId}" /><label for="{$report.uniqueId}">{$report.name|escape:"html"}</label></li>
-						{assign var=countReports value=$countReports+1}
 					{/foreach}
+					{assign var=countReports value=$countReports+1}
 					</ul>
 					<br/>
 				{/foreach}
diff --git a/tests/integration/expected/test_OneVisitorTwoVisits__Actions.get_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits__Actions.get_day.xml
new file mode 100644
index 0000000000..c8ea778d2d
--- /dev/null
+++ b/tests/integration/expected/test_OneVisitorTwoVisits__Actions.get_day.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<nb_pageviews>4</nb_pageviews>
+	<nb_uniq_pageviews>4</nb_uniq_pageviews>
+	<nb_downloads>1</nb_downloads>
+	<nb_uniq_downloads>1</nb_uniq_downloads>
+	<nb_outlinks>1</nb_outlinks>
+	<nb_uniq_outlinks>1</nb_uniq_outlinks>
+</result>
\ No newline at end of file
diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.get_day.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.get_day.xml
new file mode 100644
index 0000000000..c8ea778d2d
--- /dev/null
+++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.get_day.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<nb_pageviews>4</nb_pageviews>
+	<nb_uniq_pageviews>4</nb_uniq_pageviews>
+	<nb_downloads>1</nb_downloads>
+	<nb_uniq_downloads>1</nb_uniq_downloads>
+	<nb_outlinks>1</nb_outlinks>
+	<nb_uniq_outlinks>1</nb_uniq_outlinks>
+</result>
\ No newline at end of file
diff --git a/tests/integration/expected/test_noVisit_PeriodIsLast__Actions.get_day.xml b/tests/integration/expected/test_noVisit_PeriodIsLast__Actions.get_day.xml
new file mode 100644
index 0000000000..106f23f16b
--- /dev/null
+++ b/tests/integration/expected/test_noVisit_PeriodIsLast__Actions.get_day.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<results>
+	<result date="2009-01-04" />
+	<result date="2009-01-05" />
+	<result date="2009-01-06" />
+	<result date="2009-01-07" />
+	<result date="2009-01-08" />
+	<result date="2009-01-09" />
+	<result date="2009-01-10" />
+</results>
\ No newline at end of file
diff --git a/tests/integration/expected/test_noVisit_PeriodIsLast__Actions.get_week.xml b/tests/integration/expected/test_noVisit_PeriodIsLast__Actions.get_week.xml
new file mode 100644
index 0000000000..915e319c6e
--- /dev/null
+++ b/tests/integration/expected/test_noVisit_PeriodIsLast__Actions.get_week.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<results>
+	<result date="2008-12-29 to 2009-01-04" />
+	<result date="2009-01-05 to 2009-01-11" />
+	<result date="2009-01-12 to 2009-01-18" />
+	<result date="2009-01-19 to 2009-01-25" />
+	<result date="2009-01-26 to 2009-02-01" />
+	<result date="2009-02-02 to 2009-02-08" />
+	<result date="2009-02-09 to 2009-02-15" />
+</results>
\ No newline at end of file
diff --git a/tests/integration/expected/test_noVisit__Actions.get_day.xml b/tests/integration/expected/test_noVisit__Actions.get_day.xml
new file mode 100644
index 0000000000..4a78de72f1
--- /dev/null
+++ b/tests/integration/expected/test_noVisit__Actions.get_day.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<nb_pageviews>0</nb_pageviews>
+	<nb_uniq_pageviews>0</nb_uniq_pageviews>
+	<nb_downloads>0</nb_downloads>
+	<nb_uniq_downloads>0</nb_uniq_downloads>
+	<nb_outlinks>0</nb_outlinks>
+	<nb_uniq_outlinks>0</nb_uniq_outlinks>
+</result>
\ No newline at end of file
diff --git a/tests/integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml b/tests/integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml
index f220f4ef87..b022124bce 100644
--- a/tests/integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml
+++ b/tests/integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml
@@ -10,18 +10,18 @@
 		<goals>
 			<row idgoal='1'>
 				<nb_conversions>2</nb_conversions>
-				<nb_visits_converted>2</nb_visits_converted>
+				
 				<revenue>1000</revenue>
 			</row>
 			<row idgoal='2'>
 				<nb_conversions>1</nb_conversions>
-				<nb_visits_converted>1</nb_visits_converted>
+				
 				<revenue>0</revenue>
 			</row>
 		</goals>
 		<nb_conversions>3</nb_conversions>
 		<revenue>1000</revenue>
-		<sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
+		
 		<subtable>
 			<row>
 				<label>LoggedOut</label>
@@ -33,18 +33,18 @@
 				<goals>
 					<row idgoal='1'>
 						<nb_conversions>1</nb_conversions>
-						<nb_visits_converted>1</nb_visits_converted>
+						
 						<revenue>1000</revenue>
 					</row>
 					<row idgoal='2'>
 						<nb_conversions>1</nb_conversions>
-						<nb_visits_converted>1</nb_visits_converted>
+						
 						<revenue>0</revenue>
 					</row>
 				</goals>
 				<nb_conversions>2</nb_conversions>
 				<revenue>1000</revenue>
-				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+				
 			</row>
 			<row>
 				<label>LoggedIn</label>
@@ -56,13 +56,13 @@
 				<goals>
 					<row idgoal='1'>
 						<nb_conversions>1</nb_conversions>
-						<nb_visits_converted>1</nb_visits_converted>
+						
 						<revenue>0</revenue>
 					</row>
 				</goals>
 				<nb_conversions>1</nb_conversions>
 				<revenue>0</revenue>
-				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+				
 			</row>
 		</subtable>
 	</row>
@@ -76,13 +76,13 @@
 		<goals>
 			<row idgoal='1'>
 				<nb_conversions>1</nb_conversions>
-				<nb_visits_converted>1</nb_visits_converted>
+				
 				<revenue>1000</revenue>
 			</row>
 		</goals>
 		<nb_conversions>1</nb_conversions>
 		<revenue>1000</revenue>
-		<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+		
 		<subtable>
 			<row>
 				<label>abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz</label>
@@ -94,13 +94,13 @@
 				<goals>
 					<row idgoal='1'>
 						<nb_conversions>1</nb_conversions>
-						<nb_visits_converted>1</nb_visits_converted>
+						
 						<revenue>1000</revenue>
 					</row>
 				</goals>
 				<nb_conversions>1</nb_conversions>
 				<revenue>1000</revenue>
-				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+				
 			</row>
 		</subtable>
 	</row>
@@ -114,13 +114,13 @@
 		<goals>
 			<row idgoal='1'>
 				<nb_conversions>1</nb_conversions>
-				<nb_visits_converted>1</nb_visits_converted>
+				
 				<revenue>0</revenue>
 			</row>
 		</goals>
 		<nb_conversions>1</nb_conversions>
 		<revenue>0</revenue>
-		<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+		
 		<subtable>
 			<row>
 				<label>Value not defined</label>
@@ -132,13 +132,13 @@
 				<goals>
 					<row idgoal='1'>
 						<nb_conversions>1</nb_conversions>
-						<nb_visits_converted>1</nb_visits_converted>
+						
 						<revenue>0</revenue>
 					</row>
 				</goals>
 				<nb_conversions>1</nb_conversions>
 				<revenue>0</revenue>
-				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+				
 			</row>
 		</subtable>
 	</row>
@@ -152,13 +152,13 @@
 		<goals>
 			<row idgoal='1'>
 				<nb_conversions>1</nb_conversions>
-				<nb_visits_converted>1</nb_visits_converted>
+				
 				<revenue>0</revenue>
 			</row>
 		</goals>
 		<nb_conversions>1</nb_conversions>
 		<revenue>0</revenue>
-		<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+		
 		<subtable>
 			<row>
 				<label>abcdefghijklmnopqrstuvwxyz----abcdefghijklmnopqrstuvwxyz----abcdefghijklmnopqrstuvwxyz----abcdefghijklmnopqrstuvwxyz----abcdefghijklmnopqrstuvwxyz----abcdefghijklmnopqrstuvwxyz----abcdefghijklmnopqrst</label>
@@ -170,13 +170,13 @@
 				<goals>
 					<row idgoal='1'>
 						<nb_conversions>1</nb_conversions>
-						<nb_visits_converted>1</nb_visits_converted>
+						
 						<revenue>0</revenue>
 					</row>
 				</goals>
 				<nb_conversions>1</nb_conversions>
 				<revenue>0</revenue>
-				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+				
 			</row>
 		</subtable>
 	</row>
@@ -188,13 +188,13 @@
 				<label>looking at profile page</label>
 				<nb_visits>2</nb_visits>
 				<nb_actions>2</nb_actions>
-				<sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
+				
 			</row>
 			<row>
 				<label>Loggedin</label>
 				<nb_visits>1</nb_visits>
 				<nb_actions>1</nb_actions>
-				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+				
 			</row>
 		</subtable>
 	</row>
@@ -206,7 +206,7 @@
 				<label>Value not defined</label>
 				<nb_visits>1</nb_visits>
 				<nb_actions>1</nb_actions>
-				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+				
 			</row>
 		</subtable>
 	</row>
@@ -218,7 +218,7 @@
 				<label>FR</label>
 				<nb_visits>1</nb_visits>
 				<nb_actions>1</nb_actions>
-				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+				
 			</row>
 		</subtable>
 	</row>
-- 
GitLab