You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2015/07/22 21:14:13 UTC

airavata-php-gateway git commit: fixing clone experiment not working issue

Repository: airavata-php-gateway
Updated Branches:
  refs/heads/0.15-release-branch 403417621 -> a8c054fb1


fixing clone experiment not working issue


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

Branch: refs/heads/0.15-release-branch
Commit: a8c054fb13cb2a8643bedf11acc30f83f86e6304
Parents: 4034176
Author: Supun Nakandala <sc...@apache.org>
Authored: Thu Jul 23 00:43:47 2015 +0530
Committer: Supun Nakandala <sc...@apache.org>
Committed: Thu Jul 23 00:43:47 2015 +0530

----------------------------------------------------------------------
 app/controllers/ExperimentController.php     | 24 +++++++++++++----------
 app/routes.php                               |  2 ++
 app/views/partials/experiment-info.blade.php | 20 +++++++++++++------
 3 files changed, 30 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a8c054fb/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index b262ec3..d8ff45d 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -142,16 +142,6 @@ class ExperimentController extends BaseController
         if (isset($_POST['launch'])) {
             ExperimentUtilities::launch_experiment($experiment->experimentID);
             return Redirect::to('experiment/summary?expId=' . $experiment->experimentID);
-        } elseif (isset($_POST['clone'])) {
-            $cloneId = ExperimentUtilities::clone_experiment($experiment->experimentID);
-            $experiment = ExperimentUtilities::get_experiment($cloneId);
-            $project = ProjectUtilities::get_project($experiment->projectID);
-
-            $expVal = ExperimentUtilities::get_experiment_values($experiment, $project);
-            $expVal["jobState"] = ExperimentUtilities::get_job_status($experiment);
-
-            return Redirect::to('experiment/edit?expId=' . $experiment->experimentID);
-
         } elseif (isset($_POST['cancel'])) {
             ExperimentUtilities::cancel_experiment($experiment->experimentID);
             return Redirect::to('experiment/summary?expId=' . $experiment->experimentID);
@@ -197,6 +187,20 @@ class ExperimentController extends BaseController
         return View::make("experiment/edit", array("expInputs" => $experimentInputs));
     }
 
+    public function cloneExperiment()
+    {
+        if (isset($_GET['expId'])) {
+            $cloneId = ExperimentUtilities::clone_experiment($_GET['expId']);
+            $experiment = ExperimentUtilities::get_experiment($cloneId);
+            $project = ProjectUtilities::get_project($experiment->projectID);
+
+            $expVal = ExperimentUtilities::get_experiment_values($experiment, $project);
+            $expVal["jobState"] = ExperimentUtilities::get_job_status($experiment);
+
+            return Redirect::to('experiment/edit?expId=' . $cloneId);
+        }
+    }
+
     public function editSubmit()
     {
         if (isset($_POST['save']) || isset($_POST['launch'])) {

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a8c054fb/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index 83efc0a..7ede441 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -72,6 +72,8 @@ Route::get("experiment/summary", "ExperimentController@summary");
 
 Route::post("experiment/summary", "ExperimentController@expChange");
 
+Route::get("experiment/clone", "ExperimentController@cloneExperiment");
+
 Route::get("experiment/edit", "ExperimentController@editView");
 
 Route::post("experiment/edit", "ExperimentController@editSubmit");

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a8c054fb/app/views/partials/experiment-info.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-info.blade.php b/app/views/partials/experiment-info.blade.php
index 295d38f..802dccb 100644
--- a/app/views/partials/experiment-info.blade.php
+++ b/app/views/partials/experiment-info.blade.php
@@ -157,12 +157,20 @@
                 <input name="cancel" type="submit" class="btn btn-warning"
                        value="Cancel" <?php if (!$expVal["cancelable"]) echo 'disabled'; ?> >
             </a>
-            <input name="clone"
-                   type="submit"
-                   class="btn btn-primary"
-                   value="Clone"
-                   title="Create a clone of the experiment. Cloning is the only way to change an experiment's settings
-                    after it has been launched.">
+<!--            <input name="clone"-->
+<!--                   type="submit"-->
+<!--                   class="btn btn-primary"-->
+<!--                   value="Clone"-->
+<!--                   title="Create a clone of the experiment. Cloning is the only way to change an experiment's settings-->
+<!--                    after it has been launched.">-->
+            <a href="{{URL::to('/') }}/experiment/clone?expId={{ $experiment->experimentID }}"
+               class="btn btn-primary"
+               role="button"
+               title="Create a clone of the experiment. Cloning is the only way to change an experiment's settings
+                    after it has been launched." target="_blank">
+                <span class="glyphicon glyphicon-pencil"></span>
+                Clone
+            </a>
             <input type="hidden" name="expId" value="{{ Input::get('expId') }}"/>
             <a href="{{URL::to('/') }}/experiment/edit?expId={{ $experiment->experimentID }}"
                class="btn btn-default"