You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by nd...@apache.org on 2015/11/03 21:48:27 UTC

[1/2] airavata-php-gateway git commit: JIRA issue collector capability moved to portal level. Pga_config will need to be updated.

Repository: airavata-php-gateway
Updated Branches:
  refs/heads/master ff17e7afe -> 6aae243f3


JIRA issue collector capability moved to portal level.
Pga_config will need to be updated.


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/5e910ed5
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/5e910ed5
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/5e910ed5

Branch: refs/heads/master
Commit: 5e910ed5aa68c61a483f374c906375514a19ae29
Parents: ff17e7a
Author: Nipun Doshi <Nipun Doshi>
Authored: Tue Nov 3 15:17:09 2015 -0500
Committer: Nipun Doshi <Nipun Doshi>
Committed: Tue Nov 3 15:17:09 2015 -0500

----------------------------------------------------------------------
 app/config/pga_config.php.template       | 25 ++++++++++++++++++++++++-
 app/libraries/CommonUtilities.php        | 19 ++++++++++++++-----
 app/views/layout/fixed-scripts.blade.php | 15 ++++++++++-----
 3 files changed, 48 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5e910ed5/app/config/pga_config.php.template
----------------------------------------------------------------------
diff --git a/app/config/pga_config.php.template b/app/config/pga_config.php.template
index b33173b..54ee652 100644
--- a/app/config/pga_config.php.template
+++ b/app/config/pga_config.php.template
@@ -200,6 +200,29 @@ return array(
         /**
          * SMTP server port on which the portal should connect
          */
-        'portal-smtp-server-port' => '587'
+        'portal-smtp-server-port' => '587',
+
+        /**
+         * Set JIRA Issue Collector scripts here.
+         */
+        'jira-help' => 
+        [
+            /**
+             * Report Issue Script issued for your app by Atlassian JIRA
+             */
+            'report-issue-script' => '',
+            /**
+             * Collector id at the end of the above script
+             */
+            'report-issue-collector-id' => '',
+            /**
+             * Create Report Script issued for your app by Atlassian JIRA
+             */
+            'request-feature-script' => '',
+            /**
+             * Collector id at the end of the above script
+             */
+            'request-feature-collector-id' => ''
+        ]
     ]
 );
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5e910ed5/app/libraries/CommonUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CommonUtilities.php b/app/libraries/CommonUtilities.php
index edb45d9..f8f96fb 100644
--- a/app/libraries/CommonUtilities.php
+++ b/app/libraries/CommonUtilities.php
@@ -129,12 +129,21 @@ class CommonUtilities
 //                );
 //            }
 
-            $menus['Help'] = array
-            (
-                array('label' => 'Report Issue', 'url' => '#', "nav-active", ""),
-                array('label' => 'Request Feature', 'url' => '#', "nav-active", "")
+            $menus['Help'] = array();
+            if( Config::get('pga_config.portal')['jira-help']['report-issue-script'] != '' 
+                && Config::get('pga_config.portal')['jira-help']['report-issue-collector-id'] != '')
+            {
+                $menus['Help'][] = array('label' => 'Report Issue', 'url' => '#', "nav-active", "");
+            }  
 //                array('label' => 'Forgot Password?', 'url' => URL::to('/') . '/forgot-password', "nav-active" => "")
-            );
+            if( Config::get('pga_config.portal')['jira-help']['request-feature-script'] != '' 
+                && Config::get('pga_config.portal')['jira-help']['request-feature-collector-id'] != '')
+            {
+                $menus['Help'][] = array('label' => 'Request Feature', 'url' => '#', "nav-active", "");
+            }
+
+            if( count( $menus['Help'] ) == 0 )
+                unset( $menus['Help']);
         }
 
         echo '<nav class="navbar navbar-inverse navbar-static-top" role="navigation">

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5e910ed5/app/views/layout/fixed-scripts.blade.php
----------------------------------------------------------------------
diff --git a/app/views/layout/fixed-scripts.blade.php b/app/views/layout/fixed-scripts.blade.php
index b245d97..e4963a3 100644
--- a/app/views/layout/fixed-scripts.blade.php
+++ b/app/views/layout/fixed-scripts.blade.php
@@ -3,17 +3,19 @@
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
 <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
 
+<!-- Jira Issue Collector - Request Feature -->
+
 <script type="text/javascript"
-        src="https://gateways.atlassian.net/s/31280375aecc888d5140f63e1dc78a93-T/en_USmlc07/6328/46/1.4.13/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?locale=en-US&collectorId=b1572922"></script>
+        src="{{ Config::get('pga_config.portal')['jira-help']['report-issue-script'] }}"></script>
+
 
-<!-- Jira Issue Collector - Request Feature -->
 <script type="text/javascript"
-        src="https://gateways.atlassian.net/s/31280375aecc888d5140f63e1dc78a93-T/en_USmlc07/6328/46/1.4.13/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?locale=en-US&collectorId=674243b0"></script>
+        src="{{ Config::get('pga_config.portal')['jira-help']['request-feature-script'] }}"></script>
 
 
 <script type="text/javascript">
     window.ATL_JQ_PAGE_PROPS = $.extend(window.ATL_JQ_PAGE_PROPS, {
-        "b1572922": {
+        "{{ Config::get('pga_config.portal')['jira-help']['report-issue-collector-id'] }}": {
             "triggerFunction": function (showCollectorDialog) {
                 //Requries that jQuery is available!
                 jQuery("#report-issue").click(function (e) {
@@ -25,7 +27,7 @@
                 fullname : fullName !== 'undefined' ? fullName : ""
             }
         },
-        "674243b0": {
+        "{{ Config::get('pga_config.portal')['jira-help']['request-feature-collector-id'] }}": {
             "triggerFunction": function (showCollectorDialog) {
                 //Requries that jQuery is available!
                 jQuery("#request-feature").click(function (e) {
@@ -38,6 +40,9 @@
             }
         }
     });
+</script>
+
+<script type="text/javascript">
 
     var highest = null;
     $(".nav-tabs a").each(function () {  //find the height of your highest link


[2/2] airavata-php-gateway git commit: 1) Google Analytics capability added for portals 2) Improved code conditions so that changes in pga_config do not affect existing portals.

Posted by nd...@apache.org.
1) Google Analytics capability added for portals
2) Improved code conditions so that changes in pga_config do not affect
existing portals.

pga_config should be updated for jira-help and google analytics to work.

Signed-off-by: Nipurn Doshi <Nipurn Doshi>


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/6aae243f
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/6aae243f
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/6aae243f

Branch: refs/heads/master
Commit: 6aae243f35a7d57c9aac6e88f78849ad4bffc3b6
Parents: 5e910ed
Author: Nipun Doshi <Nipun Doshi>
Authored: Tue Nov 3 15:47:48 2015 -0500
Committer: Nipun Doshi <Nipun Doshi>
Committed: Tue Nov 3 15:47:48 2015 -0500

----------------------------------------------------------------------
 app/config/pga_config.php.template       | 13 +++++++++++-
 app/libraries/CommonUtilities.php        | 29 +++++++++++++++------------
 app/views/layout/basic.blade.php         | 20 ++++++++++++++++++
 app/views/layout/fixed-scripts.blade.php |  4 ++--
 4 files changed, 50 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/6aae243f/app/config/pga_config.php.template
----------------------------------------------------------------------
diff --git a/app/config/pga_config.php.template b/app/config/pga_config.php.template
index 54ee652..44b81ce 100644
--- a/app/config/pga_config.php.template
+++ b/app/config/pga_config.php.template
@@ -223,6 +223,17 @@ return array(
              * Collector id at the end of the above script
              */
             'request-feature-collector-id' => ''
-        ]
+        ],
+
+        /**
+         * Set Google Analytics Id here. ID format that generates from  
+         * creating tracker object should be 
+         *
+         * UA-XXXXX-Y 
+         *
+         * for it to be working correctly. Currently it is only set for 
+         * sending pageviews.
+         */
+        'google-analytics-id' => ''
     ]
 );
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/6aae243f/app/libraries/CommonUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CommonUtilities.php b/app/libraries/CommonUtilities.php
index f8f96fb..4c55d7b 100644
--- a/app/libraries/CommonUtilities.php
+++ b/app/libraries/CommonUtilities.php
@@ -129,21 +129,24 @@ class CommonUtilities
 //                );
 //            }
 
-            $menus['Help'] = array();
-            if( Config::get('pga_config.portal')['jira-help']['report-issue-script'] != '' 
-                && Config::get('pga_config.portal')['jira-help']['report-issue-collector-id'] != '')
+            if( isset( Config::get('pga_config.portal')['jira-help']))
             {
-                $menus['Help'][] = array('label' => 'Report Issue', 'url' => '#', "nav-active", "");
-            }  
-//                array('label' => 'Forgot Password?', 'url' => URL::to('/') . '/forgot-password', "nav-active" => "")
-            if( Config::get('pga_config.portal')['jira-help']['request-feature-script'] != '' 
-                && Config::get('pga_config.portal')['jira-help']['request-feature-collector-id'] != '')
-            {
-                $menus['Help'][] = array('label' => 'Request Feature', 'url' => '#', "nav-active", "");
-            }
+                $menus['Help'] = array();
+                if( Config::get('pga_config.portal')['jira-help']['report-issue-script'] != '' 
+                    && Config::get('pga_config.portal')['jira-help']['report-issue-collector-id'] != '')
+                {
+                    $menus['Help'][] = array('label' => 'Report Issue', 'url' => '#', "nav-active", "");
+                }  
+    //                array('label' => 'Forgot Password?', 'url' => URL::to('/') . '/forgot-password', "nav-active" => "")
+                if( Config::get('pga_config.portal')['jira-help']['request-feature-script'] != '' 
+                    && Config::get('pga_config.portal')['jira-help']['request-feature-collector-id'] != '')
+                {
+                    $menus['Help'][] = array('label' => 'Request Feature', 'url' => '#', "nav-active", "");
+                }
 
-            if( count( $menus['Help'] ) == 0 )
-                unset( $menus['Help']);
+                if( count( $menus['Help'] ) == 0 )
+                    unset( $menus['Help']);
+            }
         }
 
         echo '<nav class="navbar navbar-inverse navbar-static-top" role="navigation">

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/6aae243f/app/views/layout/basic.blade.php
----------------------------------------------------------------------
diff --git a/app/views/layout/basic.blade.php b/app/views/layout/basic.blade.php
index fae702a..475ba6e 100755
--- a/app/views/layout/basic.blade.php
+++ b/app/views/layout/basic.blade.php
@@ -104,6 +104,26 @@ var fullName = "{{Session::get("user-profile")["firstname"] . " " . Session::get
         $(".seagrid-info").scrollTop( $(window).scrollTop() + 150);
     })
 </script>
+
+<!-- Google Analytics for portal-->
+
+@if( isset( Config::get('pga_config.portal')['google-analytics-id']))
+
+    @if( Config::get("pga_config.portal")["google-analytics-id"] != '')
+    <script>
+      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+      ga('create', '{{ Config::get("pga_config.portal")["google-analytics-id"] }}', 'auto');
+      ga('send', 'pageview');
+
+    </script>
+    @endif
+
+@endif
+<!-- end google analytics --> 
 @show
 
 </html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/6aae243f/app/views/layout/fixed-scripts.blade.php
----------------------------------------------------------------------
diff --git a/app/views/layout/fixed-scripts.blade.php b/app/views/layout/fixed-scripts.blade.php
index e4963a3..30c186e 100644
--- a/app/views/layout/fixed-scripts.blade.php
+++ b/app/views/layout/fixed-scripts.blade.php
@@ -4,7 +4,7 @@
 <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
 
 <!-- Jira Issue Collector - Request Feature -->
-
+@if( isset( Config::get('pga_config.portal')['jira-help']))
 <script type="text/javascript"
         src="{{ Config::get('pga_config.portal')['jira-help']['report-issue-script'] }}"></script>
 
@@ -41,7 +41,7 @@
         }
     });
 </script>
-
+@endif
 <script type="text/javascript">
 
     var highest = null;