From ab3eba1b854e978ed4f3bcb3b144a4fff2964aab Mon Sep 17 00:00:00 2001
From: Stefan Giehl <stefan@piwik.org>
Date: Mon, 26 Sep 2016 00:22:41 +0200
Subject: [PATCH] Adds possibility to define a goal description (#10057)

* Adds possibility to define goal description

* update db schema

* fixed tests

* show goal description in goal reports

* fix tests
---
 core/Db/Schema/Mysql.php                      |   1 +
 core/ViewDataTable/Config.php                 |   5 +++
 plugins/CoreHome/templates/_dataTable.twig    |   4 +++
 plugins/Goals/API.php                         |  23 +++++++++----
 plugins/Goals/Reports/Get.php                 |   3 ++
 plugins/Goals/Updates/3.0.0-b1.php            |  32 ++++++++++++++++++
 .../manage-goals/manage-goals.controller.js   |   6 ++--
 plugins/Goals/stylesheets/goals.css           |   5 +++
 plugins/Goals/templates/_formAddGoal.twig     |   5 +++
 plugins/Goals/templates/_listGoalEdit.twig    |   4 ++-
 plugins/Goals/tests/Integration/APITest.php   |  16 +++++----
 plugins/Morpheus/stylesheets/ui/_cards.less   |  10 ++++++
 .../test_ImportLogs__Goals.getGoals.xml       |   1 +
 ...st_OneVisitorTwoVisits__Goals.getGoals.xml |   2 ++
 ...sits_withCookieSupport__Goals.getGoals.xml |   2 ++
 .../UIIntegrationTest_api_listing.png         | Bin 132 -> 132 bytes
 .../UIIntegrationTest_dashboard2.png          | Bin 132 -> 132 bytes
 ...IIntegrationTest_goals_individual_goal.png | Bin 131 -> 131 bytes
 .../UIIntegrationTest_goals_manage.png        | Bin 130 -> 130 bytes
 tests/resources/OmniFixture-dump.sql          |   3 +-
 20 files changed, 105 insertions(+), 17 deletions(-)
 create mode 100644 plugins/Goals/Updates/3.0.0-b1.php

diff --git a/core/Db/Schema/Mysql.php b/core/Db/Schema/Mysql.php
index 4d55da9d49..fa0c096413 100644
--- a/core/Db/Schema/Mysql.php
+++ b/core/Db/Schema/Mysql.php
@@ -105,6 +105,7 @@ class Mysql implements SchemaInterface
                               `idsite` int(11) NOT NULL,
                               `idgoal` int(11) NOT NULL,
                               `name` varchar(50) NOT NULL,
+                              `description` varchar(255) NOT NULL DEFAULT '',
                               `match_attribute` varchar(20) NOT NULL,
                               `pattern` varchar(255) NOT NULL,
                               `pattern_type` varchar(10) NOT NULL,
diff --git a/core/ViewDataTable/Config.php b/core/ViewDataTable/Config.php
index 30f3c8802b..25b5518f41 100644
--- a/core/ViewDataTable/Config.php
+++ b/core/ViewDataTable/Config.php
@@ -274,6 +274,11 @@ class Config
      */
     public $title = '';
 
+    /**
+     * The report description. eg like a goal description
+     */
+    public $description = '';
+
     /**
      * Controls whether a report's related reports are listed with the view or not.
      */
diff --git a/plugins/CoreHome/templates/_dataTable.twig b/plugins/CoreHome/templates/_dataTable.twig
index 21ecf30558..d387244fb7 100644
--- a/plugins/CoreHome/templates/_dataTable.twig
+++ b/plugins/CoreHome/templates/_dataTable.twig
@@ -26,6 +26,10 @@
     <div class="card-content">
 {% endif %}
 
+{% if properties.description %}
+    <div class="card-description">{{ properties.description }}</div>
+{% endif %}
+
 {% set summaryRowId = constant('Piwik\\DataTable::ID_SUMMARY_ROW') %}{# ID_SUMMARY_ROW #}
 {% set isSubtable = javascriptVariablesToSet.idSubtable is defined and javascriptVariablesToSet.idSubtable != 0 %}
 <div class="dataTable {{ visualizationCssClass }} {{ properties.datatable_css_class|default('') }} {% if isSubtable %}subDataTable{% endif %}"
diff --git a/plugins/Goals/API.php b/plugins/Goals/API.php
index dedc555fc7..4c6b28a8f9 100644
--- a/plugins/Goals/API.php
+++ b/plugins/Goals/API.php
@@ -126,20 +126,23 @@ class API extends \Piwik\Plugin\API
      * @param bool|float $revenue If set, default revenue to assign to conversions
      * @param bool $allowMultipleConversionsPerVisit By default, multiple conversions in the same visit will only record the first conversion.
      *                         If set to true, multiple conversions will all be recorded within a visit (useful for Ecommerce goals)
+     * @param string $description
      * @return int ID of the new goal
      */
-    public function addGoal($idSite, $name, $matchAttribute, $pattern, $patternType, $caseSensitive = false, $revenue = false, $allowMultipleConversionsPerVisit = false)
+    public function addGoal($idSite, $name, $matchAttribute, $pattern, $patternType, $caseSensitive = false, $revenue = false, $allowMultipleConversionsPerVisit = false, $description = '')
     {
         Piwik::checkUserHasAdminAccess($idSite);
 
         $this->checkPatternIsValid($patternType, $pattern, $matchAttribute);
-        $name    = $this->checkName($name);
-        $pattern = $this->checkPattern($pattern);
+        $name        = $this->checkName($name);
+        $pattern     = $this->checkPattern($pattern);
+        $description = $this->checkDescription($description);
 
         $revenue = Common::forceDotAsSeparatorForDecimalPoint((float)$revenue);
 
         $goal = array(
             'name'            => $name,
+            'description'     => $description,
             'match_attribute' => $matchAttribute,
             'pattern'         => $pattern,
             'pattern_type'    => $patternType,
@@ -176,20 +179,23 @@ class API extends \Piwik\Plugin\API
      * @param bool $caseSensitive
      * @param bool|float $revenue
      * @param bool $allowMultipleConversionsPerVisit
+     * @param string $description
      * @return void
      */
-    public function updateGoal($idSite, $idGoal, $name, $matchAttribute, $pattern, $patternType, $caseSensitive = false, $revenue = false, $allowMultipleConversionsPerVisit = false)
+    public function updateGoal($idSite, $idGoal, $name, $matchAttribute, $pattern, $patternType, $caseSensitive = false, $revenue = false, $allowMultipleConversionsPerVisit = false, $description = '')
     {
         Piwik::checkUserHasAdminAccess($idSite);
 
-        $name    = $this->checkName($name);
-        $pattern = $this->checkPattern($pattern);
+        $name        = $this->checkName($name);
+        $description = $this->checkDescription($description);
+        $pattern     = $this->checkPattern($pattern);
         $this->checkPatternIsValid($patternType, $pattern, $matchAttribute);
 
         $revenue = Common::forceDotAsSeparatorForDecimalPoint((float)$revenue);
 
         $this->getModel()->updateGoal($idSite, $idGoal, array(
             'name'            => $name,
+            'description'     => $description,
             'match_attribute' => $matchAttribute,
             'pattern'         => $pattern,
             'pattern_type'    => $patternType,
@@ -219,6 +225,11 @@ class API extends \Piwik\Plugin\API
         return urldecode($name);
     }
 
+    private function checkDescription($description)
+    {
+        return urldecode($description);
+    }
+
     private function checkPattern($pattern)
     {
         return urldecode($pattern);
diff --git a/plugins/Goals/Reports/Get.php b/plugins/Goals/Reports/Get.php
index b6842b1722..712a986937 100644
--- a/plugins/Goals/Reports/Get.php
+++ b/plugins/Goals/Reports/Get.php
@@ -185,6 +185,9 @@ class Get extends Base
             $goal = $this->getGoal($idGoal);
             if (!empty($goal['name'])) {
                 $view->config->title = Piwik::translate('Goals_GoalX', "'" . $goal['name'] . "'");
+                if (!empty($goal['description'])) {
+                    $view->config->description = $goal['description'];
+                }
             } else {
                 $view->config->title = Piwik::translate('General_EvolutionOverPeriod');
             }
diff --git a/plugins/Goals/Updates/3.0.0-b1.php b/plugins/Goals/Updates/3.0.0-b1.php
new file mode 100644
index 0000000000..db28c5a45c
--- /dev/null
+++ b/plugins/Goals/Updates/3.0.0-b1.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+
+namespace Piwik\Plugins\Goals;
+
+use Piwik\Common;
+use Piwik\Updater;
+use Piwik\Updates;
+
+
+class Updates_3_0_0_b1 extends Updates
+{
+    public function getMigrationQueries(Updater $updater)
+    {
+        $updateSql = array(
+            'ALTER TABLE `' . Common::prefixTable('goal')
+                . '` ADD COLUMN `description` VARCHAR(255) NOT NULL DEFAULT \'\' AFTER `name`;' => array(1060)
+        );
+        return $updateSql;
+    }
+
+    public function doUpdate(Updater $updater)
+    {
+        $updater->executeMigrationQueries(__FILE__, $this->getMigrationQueries($updater));
+    }
+}
diff --git a/plugins/Goals/angularjs/manage-goals/manage-goals.controller.js b/plugins/Goals/angularjs/manage-goals/manage-goals.controller.js
index 631d8c9afa..f7c26cea4a 100644
--- a/plugins/Goals/angularjs/manage-goals/manage-goals.controller.js
+++ b/plugins/Goals/angularjs/manage-goals/manage-goals.controller.js
@@ -27,10 +27,11 @@
             });
         }
 
-        function initGoalForm(goalMethodAPI, submitText, goalName, matchAttribute, pattern, patternType, caseSensitive, revenue, allowMultiple, goalId) {
+        function initGoalForm(goalMethodAPI, submitText, goalName, description, matchAttribute, pattern, patternType, caseSensitive, revenue, allowMultiple, goalId) {
 
             self.goal = {};
             self.goal.name = goalName;
+            self.goal.description = description;
 
             if (matchAttribute == 'manually') {
                 self.goal.triggerType = 'manually';
@@ -75,6 +76,7 @@
 
             var parameters = {};
             parameters.name = encodeURIComponent(this.goal.name);
+            parameters.description = encodeURIComponent(this.goal.description);
 
             if (this.isManuallyTriggered()) {
                 parameters.matchAttribute = 'manually';
@@ -146,7 +148,7 @@
         this.editGoal = function (goalId) {
             this.showAddEditForm();
             var goal = piwik.goals[goalId];
-            initGoalForm("Goals.updateGoal", _pk_translate('Goals_UpdateGoal'), goal.name, goal.match_attribute, goal.pattern, goal.pattern_type, (goal.case_sensitive != '0'), goal.revenue, goal.allow_multiple, goalId);
+            initGoalForm("Goals.updateGoal", _pk_translate('Goals_UpdateGoal'), goal.name, goal.description, goal.match_attribute, goal.pattern, goal.pattern_type, (goal.case_sensitive != '0'), goal.revenue, goal.allow_multiple, goalId);
             scrollToTop();
         };
 
diff --git a/plugins/Goals/stylesheets/goals.css b/plugins/Goals/stylesheets/goals.css
index e2307baedb..220f57e3d2 100644
--- a/plugins/Goals/stylesheets/goals.css
+++ b/plugins/Goals/stylesheets/goals.css
@@ -38,3 +38,8 @@ ul.ulGoalTopElements li {
     border-bottom: 1px dotted #0033CC;
     line-height: 2em;
 }
+
+.goalDescription {
+    padding-bottom: 12px;
+    color: #999;
+}
diff --git a/plugins/Goals/templates/_formAddGoal.twig b/plugins/Goals/templates/_formAddGoal.twig
index 2a3f43bbfe..b027622af8 100644
--- a/plugins/Goals/templates/_formAddGoal.twig
+++ b/plugins/Goals/templates/_formAddGoal.twig
@@ -13,6 +13,11 @@
              title="{{ 'Goals_GoalName'|translate|e('html_attr') }}">
         </div>
 
+        <div piwik-field uicontrol="text" name="goal_description"
+             ng-model="manageGoals.goal.description"
+             title="{{ 'General_Description'|translate|e('html_attr') }}">
+        </div>
+
         <div class="row goalIsTriggeredWhen">
             <div class="col s12">
                 <h3>{{ 'Goals_GoalIsTriggered'|translate|e('html_attr') }}</h3>
diff --git a/plugins/Goals/templates/_listGoalEdit.twig b/plugins/Goals/templates/_listGoalEdit.twig
index 40b4d9639c..aab0b77ca0 100644
--- a/plugins/Goals/templates/_listGoalEdit.twig
+++ b/plugins/Goals/templates/_listGoalEdit.twig
@@ -25,6 +25,7 @@
         <tr>
             <th class="first">Id</th>
             <th>{{ 'Goals_GoalName'|translate }}</th>
+            <th>{{ 'General_Description'|translate }}</th>
             <th>{{ 'Goals_GoalIsTriggeredWhen'|translate }}</th>
             <th>{{ 'General_ColumnRevenue'|translate }}</th>
             {% if userCanEditGoals %}
@@ -35,7 +36,7 @@
         </thead>
         {% if goals is empty %}
             <tr>
-                <td colspan='7'>
+                <td colspan='8'>
                     <br/>
                     {{ 'Goals_ThereIsNoGoalToManage'|translate(siteName)|raw }}.
                     <br/><br/>
@@ -46,6 +47,7 @@
                 <tr>
                     <td class="first">{{ goal.idgoal }}</td>
                     <td>{{ goal.name }}</td>
+                    <td>{{ goal.description }}</td>
                     <td><span class='matchAttribute'>{{ goal.match_attribute }}</span>
                         {% if goal.pattern_type is defined %}
                             <br/>
diff --git a/plugins/Goals/tests/Integration/APITest.php b/plugins/Goals/tests/Integration/APITest.php
index b2a1d60e98..c31047132d 100644
--- a/plugins/Goals/tests/Integration/APITest.php
+++ b/plugins/Goals/tests/Integration/APITest.php
@@ -50,23 +50,23 @@ class APITest extends IntegrationTestCase
 
     public function test_addGoal_shouldSucceed_IfOnlyMinimumFieldsGiven()
     {
-        $idGoal = $this->api->addGoal($this->idSite, 'MyName', 'url', 'http://www.test.de/?pk_campaign=1', 'exact');
+        $idGoal = $this->api->addGoal($this->idSite, 'MyName', 'url', 'http://www.test.de/?pk_campaign=1', 'exact', false, false, false, 'test description');
 
-        $this->assertGoal($idGoal, 'MyName', 'url', 'http://www.test.de/?pk_campaign=1', 'exact', 0, 0, 0);
+        $this->assertGoal($idGoal, 'MyName', 'test description', 'url', 'http://www.test.de/?pk_campaign=1', 'exact', 0, 0, 0);
     }
 
     public function test_addGoal_ShouldSucceed_IfAllFieldsGiven()
     {
         $idGoal = $this->api->addGoal($this->idSite, 'MyName', 'url', 'http://www.test.de', 'exact', true, 50, true);
 
-        $this->assertGoal($idGoal, 'MyName', 'url', 'http://www.test.de', 'exact', 1, 50, 1);
+        $this->assertGoal($idGoal, 'MyName', '', 'url', 'http://www.test.de', 'exact', 1, 50, 1);
     }
 
     public function test_addGoal_ShouldSucceed_IfExactPageTitle()
     {
         $idGoal = $this->api->addGoal($this->idSite, 'MyName', 'title', 'normal title', 'exact', true, 50, true);
 
-        $this->assertGoal($idGoal, 'MyName', 'title', 'normal title', 'exact', 1, 50, 1);
+        $this->assertGoal($idGoal, 'MyName', '', 'title', 'normal title', 'exact', 1, 50, 1);
     }
 
     /**
@@ -143,7 +143,7 @@ class APITest extends IntegrationTestCase
         $idGoal = $this->createAnyGoal();
         $this->api->updateGoal($this->idSite, $idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains', true, 999, true);
 
-        $this->assertGoal($idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains', 1, 999, 1);
+        $this->assertGoal($idGoal, 'UpdatedName', '', 'file', 'http://www.updatetest.de', 'contains', 1, 999, 1);
     }
 
     public function test_updateGoal_shouldUpdateMinimalFields_ShouldLeaveOtherFieldsUntouched()
@@ -151,7 +151,7 @@ class APITest extends IntegrationTestCase
         $idGoal = $this->createAnyGoal();
         $this->api->updateGoal($this->idSite, $idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains');
 
-        $this->assertGoal($idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains', 0, 0, 0);
+        $this->assertGoal($idGoal, 'UpdatedName', '', 'file', 'http://www.updatetest.de', 'contains', 0, 0, 0);
     }
 
     public function test_deleteGoal_shouldNotDeleteAGoal_IfGoalIdDoesNotExist()
@@ -213,6 +213,7 @@ class APITest extends IntegrationTestCase
             'idsite' => '1',
             'idgoal' => '1',
             'name' => 'MyName1',
+            'description' => '',
             'match_attribute' => 'event_action',
             'pattern' => 'test',
             'pattern_type' => 'exact',
@@ -235,12 +236,13 @@ class APITest extends IntegrationTestCase
         $this->assertEmpty($goals);
     }
 
-    private function assertGoal($idGoal, $name, $url, $pattern, $patternType, $caseSenstive = 0, $revenue = 0, $allowMultiple = 0)
+    private function assertGoal($idGoal, $name, $description, $url, $pattern, $patternType, $caseSenstive = 0, $revenue = 0, $allowMultiple = 0)
     {
         $expected = array($idGoal => array(
             'idsite' => $this->idSite,
             'idgoal' => $idGoal,
             'name' => $name,
+            'description' => $description,
             'match_attribute' => $url,
             'pattern' => $pattern,
             'pattern_type' => $patternType,
diff --git a/plugins/Morpheus/stylesheets/ui/_cards.less b/plugins/Morpheus/stylesheets/ui/_cards.less
index 0daebd4601..4589d53999 100644
--- a/plugins/Morpheus/stylesheets/ui/_cards.less
+++ b/plugins/Morpheus/stylesheets/ui/_cards.less
@@ -29,6 +29,16 @@ h1, h2, h3, h4 {
       font-weight: 400;
     }
   }
+
+  .card-title + .card-description {
+    margin-top: -12px;
+  }
+
+  .card-description {
+    margin-bottom: 16px;
+    font-size: 16px;
+    font-weight: 400;
+  }
 }
 
 .card-table + .tableActionBar {
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getGoals.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getGoals.xml
index b33fbbd767..ae84c83be9 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getGoals.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getGoals.xml
@@ -4,6 +4,7 @@
 		<idsite>1</idsite>
 		<idgoal>1</idgoal>
 		<name>all</name>
+		<description />
 		<match_attribute>url</match_attribute>
 		<pattern>http</pattern>
 		<pattern_type>contains</pattern_type>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml
index c9cc82f044..d76dfc3cf8 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml
@@ -4,6 +4,7 @@
 		<idsite>1</idsite>
 		<idgoal>1</idgoal>
 		<name>triggered js</name>
+		<description />
 		<match_attribute>manually</match_attribute>
 		<allow_multiple>0</allow_multiple>
 		<revenue>0</revenue>
@@ -13,6 +14,7 @@
 		<idsite>1</idsite>
 		<idgoal>2</idgoal>
 		<name>matching purchase.htm</name>
+		<description />
 		<match_attribute>url</match_attribute>
 		<pattern>(.*)store\/purchase\.(.*)</pattern>
 		<pattern_type>regex</pattern_type>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml
index c9cc82f044..d76dfc3cf8 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml
@@ -4,6 +4,7 @@
 		<idsite>1</idsite>
 		<idgoal>1</idgoal>
 		<name>triggered js</name>
+		<description />
 		<match_attribute>manually</match_attribute>
 		<allow_multiple>0</allow_multiple>
 		<revenue>0</revenue>
@@ -13,6 +14,7 @@
 		<idsite>1</idsite>
 		<idgoal>2</idgoal>
 		<name>matching purchase.htm</name>
+		<description />
 		<match_attribute>url</match_attribute>
 		<pattern>(.*)store\/purchase\.(.*)</pattern>
 		<pattern_type>regex</pattern_type>
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png b/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png
index 5371d389558a1654f3d326b1f310598a4ec1757b..9eafa608c840794c7bb7ddd0851458fdc4ae2986 100644
GIT binary patch
delta 85
zcmWN@u?@g52n0a6^%NNautCof*}+CeN}VpX2gu0DRkzD7uboMp5(1huVnF|;o5!5)
f3rZ;sWU4(E%#l!7%W(0|#xv@DJ?rS?YOM7G<{1`Z

delta 85
zcmV~$u@S%^2mrvdb&8At0s>292Q+e*I$df9$jJHMWtXp?JsX6$=a5K_tAj`5jH$TP
e0+gl+4r`H=v>Yu+qz!ODC4u_f?>ZQq39bJB4i=XH

diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png
index 17e16b81b4993319d08e0a31417c8b6c259dc15c..baae74bd465d694b4600490de2f4296c4430a50e 100644
GIT binary patch
delta 85
zcmV~$u@S%^2mrvdb&8At8bFrF4j_1!I$df9$jJHMWtWeyZ~+&ZqN$+Lla^2)ZKgv<
e0c?>C0hT7QxpD@3IM}i=jJZDdn+Kkxh+2R43>P&3

delta 85
zcmWN^u@S%^2mrvdb&8B23W!T&2L!oGoi4QlWaQ+#-)X0pPwgX!L0Yd~6ob7B(_E~7
gnt@eYPF~l9=nxuJK@E^ZsHu*8U(Y%Ku@#p50Taj<wg3PC

diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_goals_individual_goal.png b/tests/UI/expected-screenshots/UIIntegrationTest_goals_individual_goal.png
index 758a37c24f760ce7b56af94a143c17f202a900b7..dc19add4123b90173aa69a60d0beb1bf3bab53e1 100644
GIT binary patch
delta 84
zcmV~$u@QhE3<c1mWeP_~1Va804nab=v$nHk0Y~<|op$=<0voMXn$Mx7RvW}jL{b$Y
eC^4Y!1CWm9%MoGP8P*qx%~SJpzj3e@aLqr^Ef%l<

delta 84
zcmV~$yAgmO3;@uhWeP_~$Ojn0A!11GtnF-Bz>$4#mt8(R%>$BoIV*=T&8wlMte(q<
e2o2`uW(qL{s2OT%NN5Y>bcp)gZyeZV64f68_ZLq9

diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_goals_manage.png b/tests/UI/expected-screenshots/UIIntegrationTest_goals_manage.png
index e18256fbe8f582637137c618de1599551b1dc3b0..aed4c28221221f4a151b9d978b765f0e65ea5966 100644
GIT binary patch
delta 83
zcmWN>xeb6Y3;;mUW(r2|lQ_-}EP<a$)O3`YfRW*fTie=RIUFV`S7jUlK)uqL!Q7^U
e7<3Cu_AZKpL~S5YH1fYB0|F`c_2k|vsg@6;loh)G

delta 83
zcmV~$u@S%^2mrvdb&8CD22gg$5+HDwI$cU9$jJHMWtWdHR|S*MW}c)=PGnq>$Yu&n
dC!1rRJz0V@30Ov_fFT3Y!?`~98wWvSsXqzT7lZ%+

diff --git a/tests/resources/OmniFixture-dump.sql b/tests/resources/OmniFixture-dump.sql
index 1f7542fcbb..350c46c1d1 100644
--- a/tests/resources/OmniFixture-dump.sql
+++ b/tests/resources/OmniFixture-dump.sql
@@ -179,6 +179,7 @@ CREATE TABLE `goal` (
   `idsite` int(11) NOT NULL,
   `idgoal` int(11) NOT NULL,
   `name` varchar(50) NOT NULL,
+  `description` VARCHAR(255) NOT NULL DEFAULT '',
   `match_attribute` varchar(20) NOT NULL,
   `pattern` varchar(255) NOT NULL,
   `pattern_type` varchar(10) NOT NULL,
@@ -196,7 +197,7 @@ CREATE TABLE `goal` (
 
 LOCK TABLES `goal` WRITE;
 /*!40000 ALTER TABLE `goal` DISABLE KEYS */;
-INSERT INTO `goal` VALUES (1,1,'<script>$(\'body\').html(\'goal name XSS!\');</script>','url','http','contains',0,1,5,0),(1,2,'two','url','xxxxxxxxxxxxx','contains',0,0,5,0),(1,3,'click event','event_action','click','contains',0,0,0,0),(1,4,'category event','event_category','The_Category','exact',1,0,0,0),(1,5,'name event','event_name','<the_\'\"name>','exact',0,0,0,0);
+INSERT INTO `goal` VALUES (1,1,'<script>$(\'body\').html(\'goal name XSS!\');</script>','<script>$(\'body\').html(\'goal description XSS!\');</script>','url','http','contains',0,1,5,0),(1,2,'two','twodesc','url','xxxxxxxxxxxxx','contains',0,0,5,0),(1,3,'click event','','event_action','click','contains',0,0,0,0),(1,4,'category event','categorydesc','event_category','The_Category','exact',1,0,0,0),(1,5,'name event','eventdesc','event_name','<the_\'\"name>','exact',0,0,0,0);
 /*!40000 ALTER TABLE `goal` ENABLE KEYS */;
 UNLOCK TABLES;
 
-- 
GitLab