Commit a35a6884 authored by Leigh Stoller's avatar Leigh Stoller

Merge branch 'master' into 'master'

Added skipping first step of wizard when instantiate button is clicked from profile

Merge request for issue #159

See merge request !17
parents 5da3ccef 799873f3
......@@ -57,7 +57,8 @@ $optargs = OptionalPageArguments("create", PAGEARG_STRING,
"project", PAGEARG_PROJECT,
"asguest", PAGEARG_BOOLEAN,
"default", PAGEARG_STRING,
"classic", PAGEARG_STRING,
"classic", PAGEARG_STRING,
"from", PAGEARG_STRING,
"formfields", PAGEARG_ARRAY);
if ($ISAPT && !$this_user) {
......@@ -80,6 +81,11 @@ if ($ISAPT && !$this_user) {
}
}
$skipfirststep = 0;
if (isset($from) && ($from == "manage-profile" || $from == "show-profile")) {
$skipfirststep = 1;
}
#
# Alternate version of the picker, temporary.
#
......@@ -333,7 +339,7 @@ function SPITFORM($formfields, $newuser, $errors)
{
global $TBBASE, $APTMAIL, $ISAPT, $ISCLOUD, $ISPNET, $PORTAL_NAME;
global $profile_array, $this_user, $profilename, $profile, $am_array;
global $projlist, $classic, $TBMAINSITE;
global $projlist, $skipfirststep, $classic, $TBMAINSITE;
$amlist = array();
$fedlist = array();
......@@ -434,6 +440,7 @@ function SPITFORM($formfields, $newuser, $errors)
$doconstraints = (isset($this_user) &&
(ISADMINISTRATOR() || STUDLY()) ? 1 : 0);
echo " window.DOCONSTRAINTS = 1;\n";
echo " window.SKIPFIRSTSTEP = " . ($skipfirststep ? "true" : "false") . ";\n";
echo " window.PORTAL_NAME = '$PORTAL_NAME';\n";
echo " window.CLASSIC = " . ($classic ? "true" : "false") . ";\n";
echo "</script>\n";
......
......@@ -204,6 +204,7 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt,
return Instantiate(this, event);
},
});
// This activates the popover subsystem.
$('[data-toggle="popover"]').popover({
trigger: 'hover',
......@@ -368,7 +369,12 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt,
var startProfile = $('#profile_name li[value = ' + window.PROFILE + ']:first');
ChangeProfileSelection(startProfile);
_.delay(function () {$('.dropdown-toggle').dropdown();}, 500);
_.delay(function () {
$('.dropdown-toggle').dropdown();
if (window.SKIPFIRSTSTEP) {
$('#stepsContainer').steps('next');
}
}, 500);
// Set up the click function for expanding and collapsing profile groups
$('#profile_name > span').click(function() {
......
......@@ -479,7 +479,7 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, aptforms,
*/
$('#profile_instantiate_button').click(function (event) {
window.location.replace("instantiate.php?profile=" +
version_uuid);
version_uuid + "&from=manage-profile");
});
/*
......
......@@ -180,7 +180,7 @@ function (_, sup, moment,
*/
$('#profile_instantiate_button').click(function (event) {
window.location.replace("instantiate.php?profile=" +
version_uuid);
version_uuid + "&from=show-profile");
});
// Handler for normal instantiate submit button, which is in
// the modal.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment