diff --git a/application/forms.class.inc.php b/application/forms.class.inc.php
index 74965a92f..2e35035e9 100644
--- a/application/forms.class.inc.php
+++ b/application/forms.class.inc.php
@@ -37,6 +37,7 @@ class DesignerForm
protected $sSubmitTo;
protected $bReadOnly;
protected $sSelectorClass;
+ protected $bDisplayed;
public function __construct()
{
@@ -51,6 +52,7 @@ class DesignerForm
$this->bReadOnly = false;
$this->sSelectorClass = '';
$this->StartFieldSet($this->sCurrentFieldSet);
+ $this->bDisplayed = true;
}
public function AddField(DesignerFormField $oField)
@@ -365,7 +367,23 @@ EOF
return $this->oParentForm;
}
-
+ public function SetDisplayed($bDisplayed)
+ {
+ $this->bDisplayed = $bDisplayed;
+ }
+
+ public function IsDisplayed()
+ {
+ if ($this->oParentForm == null)
+ {
+ return $this->bDisplayed;
+ }
+ else
+ {
+ return ($this->bDisplayed && $this->oParentForm->IsDisplayed());
+ }
+ }
+
public function AddScript($sScript)
{
$this->sScript .= $sScript;
@@ -513,6 +531,7 @@ class DesignerFormField
protected $bReadOnly;
protected $bAutoApply;
protected $aCSSClasses;
+ protected $bDisplayed;
public function __construct($sCode, $sLabel, $defaultValue)
{
@@ -523,6 +542,7 @@ class DesignerFormField
$this->bReadOnly = false;
$this->bAutoApply = false;
$this->aCSSClasses = array();
+ $this->bDisplayed = true;
}
public function GetCode()
@@ -561,6 +581,16 @@ class DesignerFormField
return $this->bAutoApply;
}
+ public function SetDisplayed($bDisplayed)
+ {
+ $this->bDisplayed = $bDisplayed;
+ }
+
+ public function IsDisplayed()
+ {
+ return $this->bDisplayed;
+ }
+
public function Render(WebPage $oP, $sFormId, $sRenderMode='dialog')
{
$sId = $this->oForm->GetFieldId($this->sCode);
@@ -670,20 +700,25 @@ class DesignerTextField extends DesignerFormField
{
$sId = $this->oForm->GetFieldId($this->sCode);
$sName = $this->oForm->GetFieldName($this->sCode);
- $sPattern = addslashes($this->sValidationPattern);
- if (is_array($this->aForbiddenValues))
+ if ($this->IsReadOnly())
{
- $sForbiddenValues = json_encode($this->aForbiddenValues);
- $sExplainForbiddenValues = addslashes($this->sExplainForbiddenValues);
+ $sHtmlValue = "".htmlentities($this->defaultValue, ENT_QUOTES, 'UTF-8')."defaultValue, ENT_QUOTES, 'UTF-8')."\"/>";
}
else
{
- $sForbiddenValues = 'null';
- $sExplainForbiddenValues = 'null';
- }
- $sMandatory = $this->bMandatory ? 'true' : 'false';
- $sReadOnly = $this->IsReadOnly() ? 'readonly' : '';
- $oP->add_ready_script(
+ $sPattern = addslashes($this->sValidationPattern);
+ if (is_array($this->aForbiddenValues))
+ {
+ $sForbiddenValues = json_encode($this->aForbiddenValues);
+ $sExplainForbiddenValues = addslashes($this->sExplainForbiddenValues);
+ }
+ else
+ {
+ $sForbiddenValues = 'null';
+ $sExplainForbiddenValues = 'null';
+ }
+ $sMandatory = $this->bMandatory ? 'true' : 'false';
+ $oP->add_ready_script(
<<aCSSClasses) > 0)
- {
- $sCSSClasses = 'class="'.implode(' ', $this->aCSSClasses).'"';
+ );
+ $sCSSClasses = '';
+ if (count($this->aCSSClasses) > 0)
+ {
+ $sCSSClasses = 'class="'.implode(' ', $this->aCSSClasses).'"';
+ }
+ $sHtmlValue = "defaultValue, ENT_QUOTES, 'UTF-8')."\">";
}
- return array('label' => $this->sLabel, 'value' => "defaultValue, ENT_QUOTES, 'UTF-8')."\">");
+ return array('label' => $this->sLabel, 'value' => $sHtmlValue);
}
public function ReadParam(&$aValues)
@@ -798,39 +835,67 @@ class DesignerComboField extends DesignerFormField
{
$sCSSClasses = 'class="'.implode(' ', $this->aCSSClasses).'"';
}
- if ($this->bMultipleSelection)
+ if ($this->IsReadOnly())
{
- $sHtml = "