AIRAVATA-1910 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/96856c42 Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/96856c42 Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/96856c42 Branch: refs/heads/master Commit: 96856c42cccb96ee3a4632be909f2d86a99a2b92 Parents: 4749da9 Author: Nipurn Doshi <[email protected]> Authored: Tue Apr 5 12:48:15 2016 -0400 Committer: Nipurn Doshi <[email protected]> Committed: Tue Apr 5 12:48:15 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/96856c42/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/96856c42/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/96856c42/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/96856c42/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) }}
