From b38c19252593b2fea1ad2597d587741fe48f1c67 Mon Sep 17 00:00:00 2001 From: tof <> Date: Thu, 17 Apr 2008 17:18:25 +0000 Subject: Implemented #745 --- .gitattributes | 1 + HISTORY | 1 + framework/Web/UI/WebControls/TWizard.php | 19 ++++- .../tickets/protected/pages/Ticket745.page | 86 ++++++++++++++++++++++ .../tickets/protected/pages/Ticket745.php | 11 +++ .../tickets/tests/Ticket745TestCase.php | 18 +++++ 6 files changed, 134 insertions(+), 2 deletions(-) create mode 100755 tests/FunctionalTests/tickets/protected/pages/Ticket745.page create mode 100755 tests/FunctionalTests/tickets/protected/pages/Ticket745.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket745TestCase.php diff --git a/.gitattributes b/.gitattributes index 525847be..9753fefb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3021,6 +3021,7 @@ tests/FunctionalTests/tickets/protected/pages/Ticket719.page -text tests/FunctionalTests/tickets/protected/pages/Ticket72.page -text tests/FunctionalTests/tickets/protected/pages/Ticket72.php -text tests/FunctionalTests/tickets/protected/pages/Ticket722.page -text +tests/FunctionalTests/tickets/protected/pages/Ticket745.page -text tests/FunctionalTests/tickets/protected/pages/Ticket769.page -text tests/FunctionalTests/tickets/protected/pages/Ticket785.page -text tests/FunctionalTests/tickets/protected/pages/Ticket828.page -text diff --git a/HISTORY b/HISTORY index 4fd0f986..e3107577 100644 --- a/HISTORY +++ b/HISTORY @@ -35,6 +35,7 @@ CHG: Ticket#755 - Upgraded to Prototype 1.6 and Scriptaculous 1.8 (j, Christophe ENH: Ticket#722 - Added Read Only capabilities to TInPlaceTextBox (Christophe) ENH: Ticket#741 - Added CDbConnection.currentTransaction property (Qiang) ENH: Ticket#743 - Added status code header in HTTP response when in error (Qiang) +ENH: Ticket#745 - TWizard action MoveTo - allow specify step ID's (Christophe) ENH: Ticket#757 - TDateFormat and TNumberFormat now implement IDataRenderer (Qiang) ENH: Ticket#783 - Added date/time type support to soap implementation (Hongliang) ENH: Active Record supports multiple foreign references of the same table (Wei) diff --git a/framework/Web/UI/WebControls/TWizard.php b/framework/Web/UI/WebControls/TWizard.php index e8d6620d..e9c27708 100644 --- a/framework/Web/UI/WebControls/TWizard.php +++ b/framework/Web/UI/WebControls/TWizard.php @@ -1391,8 +1391,23 @@ class TWizard extends TWebControl implements INamingContainer else if(strcasecmp($command,self::CMD_MOVETO)===0) { if($this->_cancelNavigation) // may be set in onSideBarButtonClick - $navParam->setCancelNavigation(true); - $navParam->setNextStepIndex(TPropertyValue::ensureInteger($param->getCommandParameter())); + $navParam->setCancelNavigation(true); + $requestedStep=$param->getCommandParameter(); + if (!is_numeric($requestedStep)) + { + $requestedIndex=-1; + foreach ($this->getWizardSteps() as $index=>$step) + if ($step->getId()===$requestedStep) + { + $requestedIndex=$index; + break; + } + if ($requestedIndex<0) + throw new TConfigurationException('wizard_step_invalid'); + } + else + $requestedIndex=TPropertyValue::ensureInteger($requestedStep); + $navParam->setNextStepIndex($requestedIndex); $handled=true; } diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket745.page b/tests/FunctionalTests/tickets/protected/pages/Ticket745.page new file mode 100755 index 00000000..7bf583fb --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket745.page @@ -0,0 +1,86 @@ + + +

Customized Wizard Template Sample

+ + + + + Header Template +
+ Step <%= $this->Parent->ActiveStepIndex+1 %> of 3 +
+ + + SideBar Template +
+ + + + + + + + +
+ + +  ||  + +
+ Start Navigation Template +
+ + + + +
+ Step Navigation Template +
+ + + All navigation buttons are removed. +
+ Step Navigation Template +
+ + + Wizard Step Content +

+ Your favorite color: + + + + + + + + + + + +

+
+ + + Wizard Step Content +

+ +

+
+ + + Wizard Step Content +

+ Thank you for completing this survey.
+

+
+
+ +
$Id: Sample4.page 1650 2007-01-24 06:55:32Z wei $
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket745.php b/tests/FunctionalTests/tickets/protected/pages/Ticket745.php new file mode 100755 index 00000000..8d7c66ce --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket745.php @@ -0,0 +1,11 @@ +Result->Text="Your favorite color is: " . $this->DropDownList1->SelectedValue; + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php new file mode 100644 index 00000000..492b10ae --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php @@ -0,0 +1,18 @@ +open('tickets/index.php?page=Ticket745'); + $this->assertTitle("Verifying Ticket 745"); + + $this->select($base.'Wizard1_DropDownList1', 'Green'); + $this->click($base.'Wizard1_ctl4_ctl1'); + $this->pause(800); + $this->assertTextPresent ('Step 3 of 3'); + + } + +} +?> \ No newline at end of file -- cgit v1.2.3