airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndo...@apache.org
Subject [4/4] airavata-php-gateway git commit: Bug Fixes for ultrascan
Date Thu, 14 May 2015 18:12:43 GMT
Bug Fixes for ultrascan


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

Branch: refs/heads/master
Commit: 0e68bf27bb299087806e1cf5f438e5184c263e7c
Parents: f82bdcb
Author: Nipurn Doshi <nipunhere@gmail.com>
Authored: Thu May 14 14:12:25 2015 -0400
Committer: Nipurn Doshi <nipunhere@gmail.com>
Committed: Thu May 14 14:12:25 2015 -0400

----------------------------------------------------------------------
 app/libraries/Utilities.php            |  6 +++++
 app/views/admin/manage-users.blade.php | 35 ++++++++++++++++++++++++++---
 app/views/layout/basic.blade.php       |  4 ++--
 3 files changed, 40 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0e68bf27/app/libraries/Utilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/Utilities.php b/app/libraries/Utilities.php
index 14cfd47..d489292 100644
--- a/app/libraries/Utilities.php
+++ b/app/libraries/Utilities.php
@@ -631,7 +631,10 @@ public static function assemble_experiment()
     $userConfigData = new UserConfigurationData();
     $userConfigData->computationalResourceScheduling = $scheduling;
     if( isset( $_POST["userDN"]) )
+    {        
+        $userConfigDataUpdated->generateCert = 1;
         $userConfigData->userDN = $_POST["userDN"];
+    }
 
     $applicationInputs = Utilities::get_application_inputs($_POST['application']);
     $experimentInputs = Utilities::process_inputs($applicationInputs, $experimentInputs);
@@ -2105,7 +2108,10 @@ public static function apply_changes_to_experiment($experiment, $input)
 
     $userConfigDataUpdated->computationalResourceScheduling = $schedulingUpdated;
     if( isset( $input["userDN"]) )
+    {
+        $userConfigDataUpdated->generateCert = 1;
         $userConfigDataUpdated->userDN = $input["userDN"];
+    }
 
     $experiment->userConfigurationData = $userConfigDataUpdated;
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0e68bf27/app/views/admin/manage-users.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-users.blade.php b/app/views/admin/manage-users.blade.php
index 7e8ee01..ab635b8 100644
--- a/app/views/admin/manage-users.blade.php
+++ b/app/views/admin/manage-users.blade.php
@@ -79,15 +79,16 @@
                     </div>
                     <div class="roles-list">
                     </div>  
-                    <div class="add-role">
-                        <div class="form-group">
+                    <div class="add-roles-block hide">
+                        <div class="form-group form-horizontal">
                             <label class="control-label">Add a new role to the user</label>
-                            <select name="new-role">
+                            <select multiple name="new-role" class="new-roles-select"
class="form-control">
                                 <option>Select a role</option>
                                 @foreach( (array)$roles as $role)
                                 <option value="{{$role}}">{{$role}}</option>
                                 @endforeach
                             </select>
+                            <button type="button" class="btn btn primary add-roles-submit">Add
Roles</button>
                         </div>
                     </div>
                 </div>
@@ -100,6 +101,13 @@
             <input type="hidden" class="base-url" value="{{URL::to('/')}}"/>
         </div>
     </div>
+
+    <div class="role-block hide">
+        <div class="btn-group" role="group">
+            <button type="button" class="btn btn-default role-name" disabled>Role</button>
+            <button type="button" class="btn btn-default"><span class="glyphicon
glyphicon-remove"></span></button>
+        </div>
+    </div>
 @stop
 
 @section('scripts')
@@ -116,11 +124,18 @@
     );
     $(".check-roles").click( function(){
 
+        //remove disabled roles from previous actions.
+        $(".new-roles-select option").each(function()
+        {
+            $(this).removeAttr("disabled");
+        }
         var userName = $(this).data("username");
         $("#check-role-block").modal("show");
         $(".roles-of-user").html( "User : " + userName);
         $(".roles-load").removeClass("hide");
         $(".roles-list").addClass("hide");
+
+        //getting user's existing roles
         $.ajax({
             type: "POST",
             url: $(".base-url").val() + "/admin/check-roles",
@@ -134,15 +149,29 @@
             roleBlocks = "";
             for( var i=0; i<roles.length; i++)
             {
+                //disable roles which user already has.
+                $(".new-roles-select option").each(function()
+                {
+                    if( $(this).val() == roles[i])
+                        $(this).attr("disabled", "disabled");
+                    else
+                        $(this).removeAttr("disabled");
+                });
                 $(".role-block").find(".role-name").html( roles[i]);
                 var newRoleBlock = $(".role-block").html();
                 roleBlocks += newRoleBlock;
                 $(".roles-list").prepend( roleBlocks);
+
+                $(".add-roles-block").removeClass("hide");
             }
             $(".roles-load").addClass("hide");
             $(".roles-list").removeClass("hide");
         });
 
+        $(".add-roles-submit").click( function(){
+            console.log( $(".new-roles-select").val() );
+        })
+
     });
     </script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0e68bf27/app/views/layout/basic.blade.php
----------------------------------------------------------------------
diff --git a/app/views/layout/basic.blade.php b/app/views/layout/basic.blade.php
index 5e5485e..a593df3 100755
--- a/app/views/layout/basic.blade.php
+++ b/app/views/layout/basic.blade.php
@@ -99,8 +99,8 @@
             var visitortime = new Date();
             var visitortimezone = visitortime.getTimezoneOffset()/60;
             $.ajax({
-                type: "GET",
-                url: "{{URL::to('/')/setUserTimezone",
+                type:"GET",
+                url:"{{URL::to('/')}}/setUserTimezone",
                 data: 'timezone='+ visitortimezone,
                 success: function(){
                     //location.reload();


Mime
View raw message