diff --git a/gulliver/js/form/core/form.js b/gulliver/js/form/core/form.js
index 291487ced..aad196d0f 100755
--- a/gulliver/js/form/core/form.js
+++ b/gulliver/js/form/core/form.js
@@ -3908,13 +3908,15 @@ function dropDownSetOption(elem, arrayOption)
function dynaFormChanged(frm)
{
for (var i1 = 0; i1 <= frm.elements.length - 1; i1++) {
- if (frm.elements[i1].type == "text" && frm.elements[i1].value != frm.elements[i1].defaultValue) {
- return true;
+
+ if((frm.elements[i1].type=="radio" || frm.elements[i1].type=="checkbox") && (frm.elements[i1].checked!=frm.elements[i1].defaultChecked)) {
+ return true;
}
-
- if (frm.elements[i1].type == "textarea" && frm.elements[i1].value != frm.elements[i1].defaultValue) {
- return true;
+
+ if((frm.elements[i1].type=="textarea" || frm.elements[i1].type=="text" || frm.elements[i1].type=="file") && (frm.elements[i1].value!=frm.elements[i1].defaultValue)) {
+ return true;
}
+
if (frm.elements[i1].tagName.toLowerCase() == "select") {
var selectDefaultValue = frm.elements[i1].value;
diff --git a/gulliver/js/maborak/core/maborak.js b/gulliver/js/maborak/core/maborak.js
index 8cc4f40d9..3e4091ab0 100644
--- a/gulliver/js/maborak/core/maborak.js
+++ b/gulliver/js/maborak/core/maborak.js
@@ -1281,8 +1281,8 @@ selectdd.innerHTML="";for(i=0;i<=arrayOption.options.length-1;i++){if(swOptGroup
optionAux=document.createElement("option");optGroupAux.appendChild(optionAux);optionAux.value=arrayOption.options[i].key;optionAux.text=arrayOption.options[i].value;}else{optionAux=document.createElement("option");selectdd.appendChild(optionAux);optionAux.value=arrayOption.options[i].key;optionAux.text=arrayOption.options[i].value;}}}
if(selectdd.options.length==0){selectdd.options[0]=new Option("","");}}
function dynaFormChanged(frm)
-{for(var i1=0;i1<=frm.elements.length-1;i1++){if(frm.elements[i1].type=="text"&&frm.elements[i1].value!=frm.elements[i1].defaultValue){return true;}
-if(frm.elements[i1].type=="textarea"&&frm.elements[i1].value!=frm.elements[i1].defaultValue){return true;}
+{for(var i1=0;i1<=frm.elements.length-1;i1++){if((frm.elements[i1].type=="radio"||frm.elements[i1].type=="checkbox")&&(frm.elements[i1].checked!=frm.elements[i1].defaultChecked)){return true;}
+if((frm.elements[i1].type=="textarea"||frm.elements[i1].type=="text"||frm.elements[i1].type=="file")&&(frm.elements[i1].value!=frm.elements[i1].defaultValue)){return true;}
if(frm.elements[i1].tagName.toLowerCase()=="select"){var selectDefaultValue=frm.elements[i1].value;for(var i2=0;i2<=frm.elements[i1].options.length-1;i2++){if(frm.elements[i1].options[i2].defaultSelected){selectDefaultValue=frm.elements[i1].options[i2].value;break;}}
if(frm.elements[i1].value!=selectDefaultValue){return true;}}}
return false;}
diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php
index 7550a46fe..1a50437b1 100755
--- a/gulliver/system/class.g.php
+++ b/gulliver/system/class.g.php
@@ -177,7 +177,7 @@ class G
* getIpAddress
* @return string $ip
*/
- public function getIpAddress ()
+ public static function getIpAddress ()
{
if (getenv( 'HTTP_CLIENT_IP' )) {
$ip = getenv( 'HTTP_CLIENT_IP' );
diff --git a/gulliver/system/class.publisher.php b/gulliver/system/class.publisher.php
index 1088b1014..a26b22f19 100755
--- a/gulliver/system/class.publisher.php
+++ b/gulliver/system/class.publisher.php
@@ -236,7 +236,7 @@ class Publisher
break;
case 'prompt':
// Show Prompt only if there are no required fields can submit the form.
- $G_FORM->values['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'if (document.getElementById("' . $G_FORM->id . '")&&validateForm(document.getElementById(\'DynaformRequiredFields\').value)) {new leimnud.module.app.confirm().make({label:"@G::LoadTranslation(ID_DYNAFORM_SAVE_CHANGES)",action:function(){document.getElementById("' . $G_FORM->id . '").submit();}.extend(this),cancel:function(){window.location = getField("DYN_FORWARD").href;}.extend(this)});return false;} return false;';
+ $G_FORM->values['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'if (document.getElementById("' . $G_FORM->id . '")&&validateForm(document.getElementById(\'DynaformRequiredFields\').value)) {if(dynaFormChanged(document.getElementsByTagName(\'form\').item(0))) {new leimnud.module.app.confirm().make({label:"@G::LoadTranslation(ID_DYNAFORM_SAVE_CHANGES)", action:function(){document.getElementById("' . $G_FORM->id . '").submit();}.extend(this), cancel:function(){window.location = getField("DYN_FORWARD").href;}.extend(this)});return false;} else {window.location = getField("DYN_FORWARD").href;return false;}}return false;';
break;
}
}
diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php
index 1c97d03b4..f6596eebf 100755
--- a/gulliver/system/class.xmlform.php
+++ b/gulliver/system/class.xmlform.php
@@ -854,6 +854,7 @@ class XmlForm_Field
public function NSGridType ($show = false)
{
$igt = 'pm:gridtype="' . $this->gridFieldType . '"';
+
if ($show) {
return $igt;
} else {
@@ -891,7 +892,7 @@ class XmlForm_Field
{
$_outHint = '';
if ($this->hint != '' && $this->mode == 'edit') {
- $_outHint = '
+ $_outHint = '
';
}
@@ -920,7 +921,7 @@ class XmlForm_Field_Title extends XmlForm_Field
public function render ($value = null, &$owner = null)
{
$this->label = G::replaceDataField( $this->label, $owner->values );
- return 'name . ']\' name=\'form[' . $this->name . ']\' >' . $this->htmlentities( $this->label ) . '';
+ return 'name . ']\' name=\'form[' . $this->name . ']\' ' . $this->NSFieldType() . ' >' . $this->htmlentities( $this->label ) . '';
}
/**
@@ -955,7 +956,7 @@ class XmlForm_Field_Subtitle extends XmlForm_Field
*/
public function render ($value = null)
{
- return 'name . ']\' name=\'form[' . $this->name . ']\' >' . $this->htmlentities( $this->label ) . '';
+ return 'name . ']\' name=\'form[' . $this->name . ']\' ' . $this->NSFieldType() . ' >' . $this->htmlentities( $this->label ) . '';
}
/**
@@ -1881,14 +1882,14 @@ class XmlForm_Field_Password extends XmlForm_Field
if ($this->mode === 'edit') {
if ($this->readOnly) {
- return 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly"/>';
+ return 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSFieldType() . ' readOnly="readOnly"/>';
} else {
- $html = 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\'/>';
+ $html = 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSFieldType() . '/>';
$html .= $this->renderHint();
return $html;
}
} elseif ($this->mode === 'view') {
- $html = 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly"/>';
+ $html = 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSFieldType() . ' readOnly="readOnly"/>';
$html .= $this->htmlentities( str_repeat( '*', 10 ), ENT_COMPAT, 'utf-8' );
return $html;
} else {
@@ -1955,6 +1956,7 @@ class XmlForm_Field_Textarea extends XmlForm_Field
$html .= 'style="' . $scrollStyle . '" wrap="' . $this->htmlentities( $this->wrap, ENT_QUOTES, 'UTF-8' ) . '" ';
$html .= $this->NSDefaultValue() . ' ';
$html .= $this->NSRequiredValue() . ' ';
+ $html .= $this->NSFieldType() . ' ';
$html .= 'class="' . $className . '" >';
$html .= $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
$html .= '';
@@ -2627,7 +2629,7 @@ class XmlForm_Field_YesNo extends XmlForm_Field
}
} else {
//VIEW MODE
- $html .= '';
+ $html .= '';
$html .= ($value === '0') ? G::LoadTranslation( 'ID_NO_VALUE' ) : G::LoadTranslation( 'ID_YES_VALUE' );
$html .= 'name . ']" ';
@@ -2747,7 +2749,8 @@ class XmlForm_Field_Link extends XmlForm_Field
$target = G::replaceDataField($this->target, $v);
$html = "htmlentities($link, ENT_QUOTES, "utf-8") . "\"";
- $html = $html . " id=\"form[$id]\" name=\"form[$id]\" pm:field=\"pm:field\"";
+ $html = $html . " id=\"form[$id]\" name=\"form[$id]\" pm:field=\"pm:field\" ";
+ $html .= $this->NSFieldType() . ' ';
if ((strrpos($_SERVER['HTTP_USER_AGENT'], "Chrome") === false ? false : true) && trim($this->htmlentities($link, ENT_QUOTES, "utf-8")) === "#") {
$html = $html . (($this->onclick) ? " onclick=\"" . htmlentities($onclick, ENT_QUOTES, "utf-8") . " return false;\"" : " onclick=\" return false;\"");
} else {
@@ -2903,8 +2906,7 @@ class XmlForm_Field_File extends XmlForm_Field
$styleDisplay = "display: none;";
}
- $html = $html1 . "name . "]\" name=\"form" . $rowId . "[" . $this->name . "]\" value=\"" . $value . "\" class=\"module_app_input___gray_file\" style=\"" . $styleDisplay . "\"" . $mode . " " . $this->NSRequiredValue() . " />" . $html2;
-
+ $html = $html1 . "name . "]\" name=\"form" . $rowId . "[" . $this->name . "]\" " .$this->NSFieldType(). " value=\"" . $value . "\" class=\"module_app_input___gray_file\" style=\"" . $styleDisplay . "\"" . $mode . " " . $this->NSRequiredValue() . " />" . $html2;
if (isset( $this->input ) && $this->input != null) {
require_once ("classes/model/InputDocument.php");
@@ -3081,9 +3083,9 @@ class XmlForm_Field_Checkbox extends XmlForm_Field
if ($this->mode === 'edit') {
//$readOnly = isset ( $this->readOnly ) && $this->readOnly ? 'disabled' : '';
if ($this->labelOnRight) {
- $res = "" . $this->label . '';
+ $res = "NSFieldType() . " name='form[" . $this->name . "]' type='checkbox' $checked $readOnly $disabled>" . $this->label . '';
} else {
- $res = "";
+ $res = "NSFieldType() . " name='form[" . $this->name . "]' type='checkbox' $checked $readOnly $disabled/>";
}
$res .= $this->renderHint();
@@ -3195,7 +3197,7 @@ class XmlForm_Field_Button extends XmlForm_Field
$onclick = G::replaceDataField( $this->onclick, $owner->values );
$label = G::replaceDataField( $this->label, $owner->values );
if ($this->mode === 'edit') {
- $re = "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='button' value=\"{$label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />";
+ $re = "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" " . $this->NSFieldType() . " name=\"form[{$this->name}]\" type='button' value=\"{$label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />";
return $re;
} elseif ($this->mode === 'view') {
return "style};display:none\" disabled='disabled' class='module_app_button___gray module_app_buttonDisabled___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='button' value=\"{$label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />";
@@ -3230,7 +3232,7 @@ class XmlForm_Field_Reset extends XmlForm_Field
//return '';
// return "style}\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />";
if ($this->mode === 'edit') {
- return "style}\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />";
+ return "style}\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" " . $this->NSFieldType() . " name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />";
} elseif ($this->mode === 'view') {
return "style};display:none\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />";
} else {
@@ -3266,7 +3268,7 @@ class XmlForm_Field_Submit extends XmlForm_Field
if ($this->mode === 'edit') {
// if ($this->readOnly)
// return 'label .'\' disabled/>';
- return "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='submit' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />";
+ return "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" " . $this->NSFieldType() . " name=\"form[{$this->name}]\" type='submit' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />";
} elseif ($this->mode === 'view') {
//return "style};display:none\" disabled='disabled' class='module_app_button___gray module_app_buttonDisabled___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='submit' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />";
//$sLinkNextStep = 'window.open("' . $owner->fields['__DYNAFORM_OPTIONS']->xmlMenu->values['NEXT_STEP'] . '", "_self");';
@@ -3300,7 +3302,7 @@ class XmlForm_Field_Hidden extends XmlForm_Field
public $sql = '';
public $sqlOption = array ();
public $dependentFields = '';
-
+ public $gridFieldType = 'hidden';
/**
* Function render
*
@@ -3326,7 +3328,7 @@ class XmlForm_Field_Hidden extends XmlForm_Field
}
}
if ($this->mode === 'edit') {
- return '';
+ return 'NSFieldType() . ' name="form[' . $this->name . ']" type=\'hidden\' value=\'' . $value . '\'/>';
} elseif ($this->mode === 'view') {
//a button? who wants a hidden field be showed like a button?? very strange.
return '';
@@ -3347,7 +3349,7 @@ class XmlForm_Field_Hidden extends XmlForm_Field
$result = array ();
$r = 1;
foreach ($values as $v) {
- $result[] = '';
+ $result[] = 'NSGridType() . ' value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" />';
$r ++;
}
@@ -3363,7 +3365,7 @@ class XmlForm_Field_Hidden extends XmlForm_Field
*/
public function renderTable ($value = '', $owner = null)
{
- return '';
+ return '';
}
}
@@ -3644,7 +3646,7 @@ class XmlForm_Field_Listbox extends XmlForm_Field
if ($this->width != '') {
$itemWidth = 'style="width:' . $this->width . '"';
}
- $html = '