From c1658a277ad56426e88b948eab064b0ce07ea528 Mon Sep 17 00:00:00 2001 From: wei <> Date: Tue, 1 Aug 2006 00:54:51 +0000 Subject: Fixed #312 --- .gitattributes | 1 + HISTORY | 2 ++ framework/Web/UI/WebControls/TDatePicker.php | 8 +++++++- tests/FunctionalTests/tickets/protected/pages/Ticket312.page | 11 +++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket312.page diff --git a/.gitattributes b/.gitattributes index 4570c63a..6f6f9da8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1635,6 +1635,7 @@ tests/FunctionalTests/tickets/protected/pages/Ticket284.php -text tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php -text tests/FunctionalTests/tickets/protected/pages/Ticket284Component.tpl -text tests/FunctionalTests/tickets/protected/pages/Ticket311.page -text +tests/FunctionalTests/tickets/protected/pages/Ticket312.page -text tests/FunctionalTests/tickets/protected/pages/Ticket54.page -text tests/FunctionalTests/tickets/protected/pages/Ticket54Master.php -text tests/FunctionalTests/tickets/protected/pages/Ticket54Master.tpl -text diff --git a/HISTORY b/HISTORY index 982db00a..2cab7a14 100644 --- a/HISTORY +++ b/HISTORY @@ -5,6 +5,8 @@ BUG: Ticket#268 - THttpResponse.redirect() may fail for some browsers (Qiang) BUG: Ticket#297 - THttpRequest::constructUrl() encoding bug about array GET parameters (Qiang) BUG: TDataGrid may complain getting ItemType on a non-object if the grid is not data-bound (Qiang) BUG: TCheckBox.Value should be converted to string (Qiang) +BUG: Ticket#311 - Several bugs in TDatePicker (Wei) +BUG: Ticket#312 - TDatePicker's ReadOnly property bug (Wei) CHG: Ticket#206 - TBaseValidator.OnValidate is raised only when the validator is visible (Qiang) ENH: Ticket#178 - Added TRadioButton.UniqueGroupName property (Qiang) ENH: Ticket#220 - TClientScripts method to import custom javascript files (Wei) diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php index 529728ec..f0d00119 100644 --- a/framework/Web/UI/WebControls/TDatePicker.php +++ b/framework/Web/UI/WebControls/TDatePicker.php @@ -328,7 +328,7 @@ class TDatePicker extends TTextBox */ protected function renderDatePickerButtons($writer) { - if($this->getShowCalendar()) + if($this->getShowCalendar() && $this->getEnabled(true)) { switch ($this->getMode()) { @@ -553,6 +553,8 @@ class TDatePicker extends TTextBox $writer->addAttribute('id', $this->getClientID().'_day'); $writer->addAttribute('name', $this->getUniqueID().'$day'); $writer->addAttribute('class', 'datepicker_day_options'); + if($this->getReadOnly() || !$this->getEnabled(true)) + $writer->addAttribute('disabled', 'disabled'); $writer->renderBeginTag('select'); $this->renderDropDownListOptions($writer, $days, $selected); $writer->renderEndTag(); @@ -570,6 +572,8 @@ class TDatePicker extends TTextBox $writer->addAttribute('id', $this->getClientID().'_month'); $writer->addAttribute('name', $this->getUniqueID().'$month'); $writer->addAttribute('class', 'datepicker_month_options'); + if($this->getReadOnly() || !$this->getEnabled(true)) + $writer->addAttribute('disabled', 'disabled'); $writer->renderBeginTag('select'); $this->renderDropDownListOptions($writer, $this->getLocalizedMonthNames($info), $selected-1); @@ -614,6 +618,8 @@ class TDatePicker extends TTextBox $years[$i] = $i; $writer->addAttribute('id', $this->getClientID().'_year'); $writer->addAttribute('name', $this->getUniqueID().'$year'); + if($this->getReadOnly() || !$this->getEnabled(true)) + $writer->addAttribute('disabled', 'disabled'); $writer->renderBeginTag('select'); $writer->addAttribute('class', 'datepicker_year_options'); $this->renderDropDownListOptions($writer, $years, $selected); diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket312.page b/tests/FunctionalTests/tickets/protected/pages/Ticket312.page new file mode 100644 index 00000000..f6c550c5 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket312.page @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file -- cgit v1.2.3