summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwei <>2006-08-01 00:54:51 +0000
committerwei <>2006-08-01 00:54:51 +0000
commitc1658a277ad56426e88b948eab064b0ce07ea528 (patch)
tree0536dc134ca3c5e094740cf8f56a040c9eca8e81
parent62274f7a89ff033a32bcd436923d39d90831f4db (diff)
Fixed #312
-rw-r--r--.gitattributes1
-rw-r--r--HISTORY2
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php8
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket312.page11
4 files changed, 21 insertions, 1 deletions
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 @@
+<com:TContent ID="Content">
+<com:TButton Text="Click me" />
+<com:TDatePicker
+ ReadOnly="true"
+ InputMode="DropDownList"
+ DateFormat="M/yyyy" />
+
+<com:TDatePicker
+ DateFormat="d/M/yyyy" />
+
+</com:TContent> \ No newline at end of file