airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [06/23] airavata-php-gateway git commit: AIRAVATA-1926 for PGA
Date Sat, 23 Apr 2016 02:08:03 GMT
AIRAVATA-1926 for PGA


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

Branch: refs/heads/master
Commit: fd5c6ef78e0ee139140b9b6053b00d3b48889800
Parents: 4749da9
Author: Nipurn Doshi <nipunhere@gmail.com>
Authored: Tue Apr 5 12:58:01 2016 -0400
Committer: Nipurn Doshi <nipunhere@gmail.com>
Committed: Tue Apr 5 12:58:01 2016 -0400

----------------------------------------------------------------------
 app/controllers/ExperimentController.php       | 13 +++++++++++--
 app/libraries/ProjectUtilities.php             |  4 ++--
 app/views/experiment/edit.blade.php            |  2 +-
 app/views/partials/experiment-inputs.blade.php | 14 +++-----------
 4 files changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/fd5c6ef7/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index 07a3366..03de1a2 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -41,7 +41,12 @@ class ExperimentController extends BaseController
                 "wallTimeLimit" => Config::get('pga_config.airavata')["wall-time-limit"]
             );
 
+            $clonedExp = false;
+            if( Input::has("clonedExp"))
+                $clonedExp = true;
+
             $experimentInputs = array(
+                "clonedExp" => $clonedExp,
                 "disabled" => ' disabled',
                 "experimentName" => $_POST['experiment-name'],
                 "experimentDescription" => $_POST['experiment-description'] . ' ',
@@ -193,7 +198,12 @@ class ExperimentController extends BaseController
 
         $computeResources = CRUtilities::create_compute_resources_select($experiment->executionId,
$expVal['scheduling']->resourceHostId);
 
+        $clonedExp = false;
+        if( Input::has("clonedExp"))
+            $clonedExp = true;
+
         $experimentInputs = array(
+            "clonedExp" => $clonedExp,
             "disabled" => ' ',
             "experimentName" => $experiment->experimentName,
             "experimentDescription" => $experiment->description,
@@ -205,7 +215,6 @@ class ExperimentController extends BaseController
             "queueDefaults" => $queueDefaults,
             'project' => $project,
             'expVal' => $expVal,
-            'cloning' => true,
             'advancedOptions' => Config::get('pga_config.airavata')["advanced-experiment-options"],
             'computeResources' => $computeResources,
             "resourceHostId" => $expVal['scheduling']->resourceHostId,
@@ -227,7 +236,7 @@ class ExperimentController extends BaseController
             $expVal = ExperimentUtilities::get_experiment_values($experiment, $project);
             $expVal["jobState"] = ExperimentUtilities::get_job_status($experiment);
 
-            return Redirect::to('experiment/edit?expId=' . $cloneId);
+            return Redirect::to('experiment/edit?expId=' . $cloneId . "&clonedExp=true");
         }
     }
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/fd5c6ef7/app/libraries/ProjectUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ProjectUtilities.php b/app/libraries/ProjectUtilities.php
index 2e2dd70..2c04f51 100644
--- a/app/libraries/ProjectUtilities.php
+++ b/app/libraries/ProjectUtilities.php
@@ -75,10 +75,10 @@ class ProjectUtilities
      */
     public static function create_project_select($projectId = null, $editable = true)
     {
-        $editable ? $disabled = '' : $disabled = 'disabled';
+        $editable ? $readonly = '' : $readonly = 'readonly';
         $userProjects = ProjectUtilities::get_all_user_projects(Session::get("gateway_id"),
Session::get('username'));
 
-        echo '<select class="form-control" name="project" id="project" required ' . $disabled
. '>';
+        echo '<select class="form-control" name="project" id="project" required ' . $readonly
. '>';
         if (sizeof($userProjects) > 0) {
             foreach ($userProjects as $project) {
                 if ($project->projectID == $projectId) {

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/fd5c6ef7/app/views/experiment/edit.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/edit.blade.php b/app/views/experiment/edit.blade.php
index ea44de1..e73e5e7 100755
--- a/app/views/experiment/edit.blade.php
+++ b/app/views/experiment/edit.blade.php
@@ -22,7 +22,7 @@
         <form action="{{URL::to('/')}}/experiment/edit" method="POST" role="form" enctype="multipart/form-data">
             <input type="hidden" name="expId" value="<?php echo Input::get('expId');
?>"/>
 
-            @include('partials/experiment-inputs')
+            @include('partials/experiment-inputs', array( "expInputs", $expInputs))
 
 
             <div class="btn-toolbar">

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/fd5c6ef7/app/views/partials/experiment-inputs.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-inputs.blade.php b/app/views/partials/experiment-inputs.blade.php
index 95615f2..30cd075 100644
--- a/app/views/partials/experiment-inputs.blade.php
+++ b/app/views/partials/experiment-inputs.blade.php
@@ -14,19 +14,11 @@
 </div>
 <div class="form-group required">
     <label for="project" class="control-label">Project</label>
-    @if( isset( $expInputs['cloning']))
-    {{ ProjectUtilities::create_project_select($expInputs['experiment']->projectId, $expInputs['expVal']['editable'])
}}
-    @else
-    {{ ProjectUtilities::create_project_select($expInputs['project'], !$expInputs['disabled'])
}}
-    @endif
+    {{ ProjectUtilities::create_project_select($expInputs['project'], !$expInputs['clonedExp'])
}}
 </div>
 <div class="form-group">
     <label for="application">Application</label>
-    @if( isset( $expInputs['cloning']))
-    {{ ExperimentUtilities::create_application_select($expInputs['application'], false)}}
-    @else
-    {{ ExperimentUtilities::create_application_select($expInputs['application'], !$expInputs['disabled'])
}}
-    @endif
+    {{ ExperimentUtilities::create_application_select($expInputs['application'], false) }}
 </div>
 
 <div class="panel panel-default">
@@ -36,7 +28,7 @@
 
         <div class="well">
             <input type="hidden" id="allowedFileSize" value="{{$expInputs['allowedFileSize']}}"/>
-            @if( isset( $expInputs['cloning']))
+            @if( $expInputs["clonedExp"])
             <div class="form-group">
                 <p><strong>Current inputs</strong></p>
                 {{ ExperimentUtilities::list_input_files($expInputs['experiment']->experimentInputs)
}}


Mime
View raw message