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 2016/08/04 03:08:01 UTC

airavata-php-gateway git commit: Gateway Request related code changes

Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop 7edd1a7a2 -> 9140942fa


Gateway Request related code changes


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/9140942f
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/9140942f
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/9140942f

Branch: refs/heads/develop
Commit: 9140942fa9e7573aa84578ea9c4846fef9b97666
Parents: 7edd1a7
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Wed Aug 3 20:06:27 2016 -0700
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Wed Aug 3 20:06:27 2016 -0700

----------------------------------------------------------------------
 app/controllers/AdminController.php      | 18 +++++++++++---
 app/libraries/AdminUtilities.php         |  9 ++++---
 app/views/account/dashboard.blade.php    | 34 +++++++++++++++++++++------
 app/views/admin/manage-gateway.blade.php | 14 ++++++-----
 4 files changed, 56 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/9140942f/app/controllers/AdminController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AdminController.php b/app/controllers/AdminController.php
index fecfb0e..abf6e85 100644
--- a/app/controllers/AdminController.php
+++ b/app/controllers/AdminController.php
@@ -158,9 +158,21 @@ class AdminController extends BaseController {
 	}
 
 	public function updateGatewayRequest(){
-		AdminUtilities::update_gateway_status( Input::get("gateway_id"), Input::get("status"));
-
-		return Redirect::to("admin/dashboard/gateway");
+		$status = Input::get("status");
+		if( $status == "Approve")
+			$status = 1;
+		if( $status == "Deny")
+			$status = 5;
+
+		$comments = "";
+		if( Input::has("comments"))
+			$comments = Input::get("comments");
+
+		AdminUtilities::update_gateway_status( Input::get("gateway_id"), $status, $comments);
+		if( Session::has("super-admin"))
+			return Redirect::to("admin/dashboard/gateway");
+		else
+			return Redirect::to("admin/dashboard");
 	}
 
 	public function rolesView(){

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/9140942f/app/libraries/AdminUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/AdminUtilities.php b/app/libraries/AdminUtilities.php
index 7338b7c..7ba6b9b 100644
--- a/app/libraries/AdminUtilities.php
+++ b/app/libraries/AdminUtilities.php
@@ -38,16 +38,19 @@ class AdminUtilities
         $gateway->identityServerUserName = $inputs["admin-username"];
         $gateway->identityServerPasswordToken  = $inputs["admin-password"];
         $gateway->reviewProposalDescription = $inputs["project-details"];
-        $gateway->gatewayPublicAbstract - $inputs["public-project-description"];
+        $gateway->gatewayPublicAbstract = $inputs["public-project-description"];
 
         return Airavata::addGateway(Session::get('authz-token'), $gateway);
-
     }
 
-    public static function update_gateway_status( $gatewayId, $status){
+    public static function update_gateway_status( $gatewayId, $status, $comments = null){
         $gateway = Airavata::getGateway( Session::get('authz-token'), $gatewayId);
         $gateway->gatewayApprovalStatus = intval( $status);
+        if( $comments != null)
+            $gateway->declinedReason = $comments;
+
         if( Airavata::updateGateway( Session::get('authz-token'), $gateway->gatewayId, $gateway) ){
+        $gateway = Airavata::getGateway( Session::get('authz-token'), $gatewayId);
             if( $gateway->gatewayApprovalStatus == GatewayApprovalStatus::APPROVED){
                 $tenants = WSIS::getTenants();
                 $tenantExists = false;

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/9140942f/app/views/account/dashboard.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/dashboard.blade.php b/app/views/account/dashboard.blade.php
index 42294e0..7453e06 100644
--- a/app/views/account/dashboard.blade.php
+++ b/app/views/account/dashboard.blade.php
@@ -29,6 +29,7 @@
                             <th>Gateway Name</th>
                             <th>Request Status</th>
                             <th>Actions</th>
+                            <th>Comments</th>
                         </tr>
                     </thead>
                     <tbody>
@@ -40,17 +41,26 @@
                                 @if( $gateway["approvalStatus"] == "Approved")
                                     <div class="btn-group" role="group" aria-label="...">
                                         <button type="button" class="btn btn-default">Download Credentials</button>
+                                        <!--
                                         <button type="button" class="btn btn-default"><a href="{{URL::to('/')}}/admin/dashboard?gatewayId={{$gatewayId}}">Manage Gateway</a></button>
+                                        
                                         <button type="button" class="btn btn-danger deactivateGateway-button" data-toggle="modal" data-target="#deactivateGateway" data-gatewayid="{{$gatewayId}}">Deactivate Gateway</button>
+                                        -->
                                     </div>
                                 @elseif( $gateway["approvalStatus"] == "Requested")
-                                    <button type="button" class="btn btn-danger">Cancel Request</button>
+                                    <button type="button" class="btn btn-danger"><a href="{{URL::to('/')}}/admin/update-gateway-request?gateway_id={{$gatewayId}}&status=4">Cancel Request</a></button>
                                 @endif
                             </td>
+                            <td>
+                                {{$gateway["gatewayInfo"]->declinedReason}}
+                            </td>
                         </tr>
                     @endforeach
                     </tbody>
                 </table>
+                <div class="well">
+                <h4 class="text-center">Need faster or more customised solutions for your Gateway? Contact us at: <a href="mailto:contact@scigap.org">contact@scigap.org</a></h4>
+                </div>
             @endif
             </div>
             <div class="col-md-12">
@@ -82,7 +92,7 @@
 
                         <div class="form-group required">
                             <label class="control-label">Gateway URL</label>
-                            <input type="text" name="gateway-url" class="form-control" value="{{Input::old('gateway-url') }}"/>
+                            <input type="text" name="gateway-url" id="gateway-url" class="form-control" value="{{Input::old('gateway-url') }}" data-container="body" data-toggle="popover" data-placement="left" data-content="URL to Portal home page or Download URL (for desktop applications). This is required if the gateway is Production Ready above."/>
                         </div>
                         <div class="form-group required">
                             <label class="control-label">Gateway Admin Username</label>
@@ -112,11 +122,11 @@
                         </div>
                         <div class="form-group required">
                             <label class="control-label">Project Details</label>
-                            <textarea type="text" name="project-details" class="form-control" required="required">{{Input::old('project-details') }}</textarea>
+                            <textarea type="text" name="project-details" id="project-details" class="form-control" required="required"  data-container="body" data-toggle="popover" data-placement="left" data-content="This information will help us to understand and identify your gateway requirements, such as local or remote resources, user management, field of science and communities supported, applications and interfaces, license handling, allocation management, data management, etc... It will help us in serving you and providing you with the best option for you and your research community.">{{Input::old('project-details') }}</textarea>
                         </div>
                         <div class="form-group required">
                             <label class="control-label">Public Project Description</label>
-                            <textarea type="text" name="public-project-description" class="form-control" required="required">{{Input::old('public-project-description') }}</textarea>
+                            <textarea type="text" name="public-project-description" id="public-project-description" class="form-control" required="required"  data-container="body" data-toggle="popover" data-placement="left" data-content="This description will be used to describe the gateway in the Science Gateways List. It help a user decide whether or not this gateway will be useful to them.">{{Input::old('public-project-description') }}</textarea>
                         </div>
                         <input type="submit" value="Send Request" class="btn btn-primary"/>
                         <input type="reset" value="Reset" class="btn">
@@ -146,8 +156,7 @@
             </div>
           </div>
         </div>
-        @endif
-        @if( Session::has('authorized-user') || Session::has('admin') || Session::has('admin-read-only') )
+        @elseif( Session::has('authorized-user') || Session::has('admin') || Session::has('admin-read-only') )
         <div class="row text-center breathing-space">
             <h1>Gateway: {{Session::get("gateway_id")}}</h1>
             <h3>Let's get started!</h3>
@@ -376,11 +385,22 @@
         $(".gateway-request-form").removeClass("hide");
     });
 
-
     $("#password").popover({
         'trigger':'focus'
     });
 
+    $("#gateway-url").popover({
+        'trigger':'focus'
+    });
+
+    $("#project-details").popover({
+        'trigger':'focus'
+    });
+
+    $("#public-project-description").popover({
+        'trigger':'focus'
+    });
+
     $(".deactivateGateway-button").click( function(){
         var gatewayId = $(this).data("gatewayid");
         $("#deactivateGatewayId").val( gatewayId);

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/9140942f/app/views/admin/manage-gateway.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-gateway.blade.php b/app/views/admin/manage-gateway.blade.php
index 9216d13..a2c4ac9 100644
--- a/app/views/admin/manage-gateway.blade.php
+++ b/app/views/admin/manage-gateway.blade.php
@@ -99,16 +99,18 @@
                                         <td>{{ $gp->gatewayPublicAbstract}}</td>
                                         @if( $gp->gatewayApprovalStatus == 0)
                                             <td>
-                                                <a href="{{URL::to('/')}}/admin/update-gateway-request?gateway_id={{$gp->gatewayId}}&status=1"><input type="button" class="btn btn-primary" value="Approve"/></a>
-                                                <br/><br/>
-                                                <form action="{{URL::to('/')}}/admin/update-gateway-request?gateway_id={{$gp->gatewayId}}&status=3" method="POST">
-                                                    <textarea style="width:100%; height:80px" width="100%" name="declineReason" placeholder="Reason for Decline"></textarea>
+                                                <form action="{{URL::to('/')}}/admin/update-gateway-request" method="GET">
+                                                    <input type="hidden" name="gateway_id" value="{{$gp->gatewayId}}">
+                                                    <textarea style="width:100%; height:80px" width="100%" name="comments" placeholder="Comments"></textarea>
                                                     <br/>
-                                                    <input type="submit" class="btn btn-danger" value="Deny"/>
+                                                    <input type="submit" name="status" class="btn btn-primary" value="Approve"/>
+                                                    <input type="submit" name="status" class="btn btn-danger" value="Deny"/>
                                                 </form>
                                             </td>
                                         @elseif( $gp->gatewayApprovalStatus == 1)
-                                            <td>Approved</td>
+                                            <td>Approved @if( $gp->declinedReason != "")<br/><br/>Comment: {{$gp->declinedReason}} @endif</td>
+                                        @elseif( $gp->gatewayApprovalStatus == 5)
+                                            <td>Denied @if( $gp->declinedReason != "")<br/><br/>Comment: {{$gp->declinedReason}} @endif</td>
                                         @endif
                                     </tr>
                                 @endforeach