diff options
-rw-r--r-- | .gitattributes | 1 | ||||
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TWizard.php | 19 | ||||
-rwxr-xr-x | tests/FunctionalTests/tickets/protected/pages/Ticket745.page | 86 | ||||
-rwxr-xr-x | tests/FunctionalTests/tickets/protected/pages/Ticket745.php | 11 | ||||
-rw-r--r-- | tests/FunctionalTests/tickets/tests/Ticket745TestCase.php | 18 |
6 files changed, 134 insertions, 2 deletions
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 @@ -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 @@ +<com:TContent ID="Content">
+
+<h2>Customized Wizard Template Sample</h2>
+
+<com:TWizard ID="Wizard1"
+ BackColor="OldLace"
+ Width="400px"
+ SideBarStyle.Width="120px"
+ StepStyle.BackColor="#FFFBD6"
+ HeaderStyle.BackColor="Moccasin"
+ NavigationStyle.BackColor="PaleGoldenrod"
+ OnActiveStepChanged="wizardCompleted" >
+
+ <prop:HeaderTemplate>
+ <i>Header Template</i>
+ <br/>
+ <b>Step <%= $this->Parent->ActiveStepIndex+1 %> of 3</b>
+ </prop:HeaderTemplate>
+
+ <prop:SideBarTemplate>
+ <i>SideBar Template</i>
+ <br/>
+ <com:TDataList ID="SideBarList">
+ <prop:ItemTemplate>
+ <com:TButton ID="SideBarButton" />
+ </prop:ItemTemplate>
+ <prop:SelectedItemTemplate>
+ <com:TButton ID="SideBarButton" Font.Bold="true" />
+ </prop:SelectedItemTemplate>
+ </com:TDataList>
+ </prop:SideBarTemplate>
+
+ <prop:StartNavigationTemplate>
+ <com:TLinkButton CommandName="NextStep" Text="Next >" /> || + <com:TLinkButton CommandName="MoveTo" CommandParameter="WizardStep3" Text="Go to step 3"/>
+ <br/>
+ <i>Start Navigation Template</i>
+ </prop:StartNavigationTemplate>
+
+ <prop:StepNavigationTemplate>
+ <com:TLinkButton CausesValidation="False" CommandName="PreviousStep" Text="< Previous" />
+ <com:TLinkButton CommandName="NextStep" Text="Next >" />
+ <br/>
+ <i>Step Navigation Template</i>
+ </prop:StepNavigationTemplate>
+
+ <prop:FinishNavigationTemplate>
+ All navigation buttons are removed.
+ <br/>
+ <i>Step Navigation Template</i>
+ </prop:FinishNavigationTemplate>
+
+ <com:TWizardStep ID="WizardStep1" Title="Step 1">
+ <i>Wizard Step Content</i>
+ <br/><br/>
+ Your favorite color:
+ <com:TDropDownList ID="DropDownList1">
+ <com:TListItem Value="Red" />
+ <com:TListItem Value="Blue" />
+ <com:TListItem Value="Green" />
+ <com:TListItem Value="Purple" />
+ <com:TListItem Value="Black" />
+ <com:TListItem Value="Yellow" />
+ <com:TListItem Value="Orange" />
+ <com:TListItem Value="Pink" />
+ <com:TListItem Value="Cyan" />
+ </com:TDropDownList>
+ <br/><br/>
+ </com:TWizardStep>
+
+ <com:TWizardStep ID="WizardStep2" Title="Step 2">
+ <i>Wizard Step Content</i>
+ <br/><br/>
+ <com:TLabel ID="Result" />
+ <br/><br/>
+ </com:TWizardStep>
+
+ <com:TWizardStep ID="WizardStep3" Title="Step 3">
+ <i>Wizard Step Content</i>
+ <br/><br/>
+ Thank you for completing this survey.<br />
+ <br/><br/>
+ </com:TWizardStep>
+</com:TWizard>
+
+<div class="last-modified">$Id: Sample4.page 1650 2007-01-24 06:55:32Z wei $</div></com:TContent>
\ 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 @@ +<?php + +class Ticket745 extends TPage +{ + public function wizardCompleted($sender,$param) + { + $this->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 @@ +<?php +class Ticket745TestCase extends SeleniumTestCase +{ + function test() + { + $base = 'ctl0_Content_'; + $this->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 |