airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndo...@apache.org
Subject [1/2] airavata-php-gateway git commit: Fixing Reservation Time issues AIRAVATA-2059, AIRAVATA-2049,
Date Thu, 01 Sep 2016 20:30:48 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop 65f199511 -> c5958ab21


Fixing Reservation Time issues AIRAVATA-2059, AIRAVATA-2049,


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

Branch: refs/heads/develop
Commit: 58d46eb1a2f8362e1db0b736e150bda601cd6a94
Parents: af9e9a4
Author: Nipurn Doshi <nipunhere@gmail.com>
Authored: Thu Sep 1 13:28:36 2016 -0700
Committer: Nipurn Doshi <nipunhere@gmail.com>
Committed: Thu Sep 1 13:28:36 2016 -0700

----------------------------------------------------------------------
 app/libraries/CRUtilities.php                   |  5 ++---
 app/views/admin/manage-gateway.blade.php        | 10 +++++-----
 .../compute-resource-preferences.blade.php      | 21 +++++++++++++++++---
 3 files changed, 25 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/58d46eb1/app/libraries/CRUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php
index 644f482..365eb37 100755
--- a/app/libraries/CRUtilities.php
+++ b/app/libraries/CRUtilities.php
@@ -525,16 +525,15 @@ class CRUtilities
 
     public static function add_or_update_CRP($inputs)
     {
-
         $timeDifference = Session::get("user_timezone");
         $addOrSubtract = "-";
         if( $timeDifference > 0)
             $addOrSubtract = "+";
         $inputs = Input::all();
         if( $inputs["reservationStartTime"] != "")
-            $inputs["reservationStartTime"] = strtotime( $inputs["reservationStartTime"])
* 1000;
+            $inputs["reservationStartTime"] = strtotime( $addOrSubtract . " " . Session::get("user_timezone")
. " hours", strtotime( $inputs["reservationStartTime"]) ) * 1000;
         if( $inputs["reservationEndTime"] != "")
-            $inputs["reservationEndTime"] = strtotime($inputs["reservationEndTime"]) * 1000;
+            $inputs["reservationEndTime"] = strtotime( $addOrSubtract . " " . Session::get("user_timezone")
. " hours", strtotime($inputs["reservationEndTime"]) ) * 1000;
 
         $computeResourcePreferences = new computeResourcePreference($inputs);
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/58d46eb1/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 3e8e8e0..bcbbb1d 100644
--- a/app/views/admin/manage-gateway.blade.php
+++ b/app/views/admin/manage-gateway.blade.php
@@ -600,15 +600,15 @@
     });
 
 
-    /* making datetimepicker work for reservation start and end date */
+    /* making datetimepicker work for reservation start and end date kept in compute-resource-preferences
blade*/
 
     $('.datetimepicker1').datetimepicker({
-        pick12HourFormat: false,
-        pickTime: false
+        pick12HourFormat: false
+        //pickTime: false
     });
     $('.datetimepicker2').datetimepicker({
-        pick12HourFormat: false,
-        pickTime: false
+        pick12HourFormat: false
+        //pickTime: false
     });
 
     $(".datetimepicker1 input").focus( function(){

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/58d46eb1/app/views/partials/compute-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/compute-resource-preferences.blade.php b/app/views/partials/compute-resource-preferences.blade.php
index caeb1a4..627a485 100644
--- a/app/views/partials/compute-resource-preferences.blade.php
+++ b/app/views/partials/compute-resource-preferences.blade.php
@@ -130,13 +130,28 @@
                value="@if( isset( $preferences) ){{$preferences->reservation}}@endif"/>
     </div>
 </div>
-
+<?php
+//to add or remove time according to local hours.
+$timeDifference = Session::get("user_timezone");
+$addOrSubtract = "-";
+if( $timeDifference < 0)
+    $addOrSubtract = "+";
+
+$reservationStartTime = "";
+if( isset( $preferences) && $preferences->reservationStartTime != '')
+    $reservationStartTime = strtotime( $addOrSubtract . " " . Session::get("user_timezone")
. " hours", $preferences->reservationStartTime/1000);
+
+$reservationEndTime = "";
+if( isset( $preferences) && $preferences->reservationEndTime != '')
+    $reservationEndTime = strtotime( $addOrSubtract . " " . Session::get("user_timezone")
. " hours", $preferences->reservationEndTime/1000);
+
+?>
 <div class="form-group col-md-6">
     <label class="control-label col-md-3">Reservation Start Time</label>
 
     <div class="input-group date datetimepicker1">
         <input type="text" name="reservationStartTime" class="form-control"
-               value="@if( isset( $preferences) ) @if( $preferences->reservationStartTime
!= '') {{date('m/d/Y',$preferences->reservationStartTime/1000) }} @endif @endif"/>
+               value="@if( isset( $preferences) )@if( $preferences->reservationStartTime
!= ''){{date('m/d/Y h:i:s A', intval( $reservationStartTime))}}@endif @endif"/>
         <span class="input-group-addon">
             <span class="glyphicon glyphicon-calendar"></span>
         </span>
@@ -148,7 +163,7 @@
 
     <div class="input-group date datetimepicker2">
         <input type="text" name="reservationEndTime" class="form-control"
-               value="@if( isset( $preferences) ){{date('m/d/Y',$preferences->reservationEndTime/1000)
}}@endif"/>
+               value="@if( isset( $preferences) )@if( $preferences->reservationStartTime
!= ''){{date('m/d/Y h:i:s A', intval($reservationEndTime))}}@endif @endif"/>
         <span class="input-group-addon">
             <span class="glyphicon glyphicon-calendar"></span>
         </span>


Mime
View raw message