Merge pull request #752 from julceslauhub/master

Fix issues with dorms accesibility (Stanford)
This commit is contained in:
julceslauhub
2012-10-16 11:15:53 -07:00
2 changed files with 22 additions and 22 deletions

View File

@@ -681,17 +681,20 @@ var G_Grid = function(oForm, sGridName){
}
}
}
//Set focus the first element in the grid
for (var i = 0; i < this.aFields.length; i++) {
var fieldName = 'form[' + sGridName + '][' + currentRow + '][' + this.aFields[i].sFieldName + ']';
if (this.aFields[i].sType != 'file' && document.getElementById(fieldName).focus) {
document.getElementById(fieldName).focus();
break;
}
}
//Fires OnAddRow Event
if (this.onaddrow) {
this.onaddrow(currentRow);
}
var newInputs = oNewRow.getElementsByTagName('input');
for (var i = 0; i < newInputs.length; i++) {
if (typeof(newInputs[i]) != 'undefined' && newInputs[i].type != 'hidden') {
newInputs[i].focus();
break;
}
}
};
this.deleteGridRow = function (sRow, bWithoutConfirm)

View File

@@ -4789,19 +4789,16 @@ class xmlformTemplate extends Smarty
$value = (isset ( $form->values [$k] )) ? $form->values [$k] : NULL;
$result [$k] = G::replaceDataField ( $form->fields [$k]->label, $form->values );
if ($form->type == 'xmlform') {
if ($v->type == 'checkgroup' || $v->type == 'radiogroup') {
$firstValueOptions = '';
foreach ($v->options as $indexOption => $valueOptions) {
$firstValueOptions = $indexOption;
break;
}
if ($firstValueOptions != '') {
$result[$k] = '<label for="form[' . $k . '][' . $firstValueOptions . ']">' . $result[$k] . '</label>';
} else {
$result[$k] = '<label for="form[' . $k . ']">' . $result[$k] . '</label>';
}
} else {
if ($v->type != 'checkgroup' && $v->type != 'radiogroup') {
$result[$k] = '<label for="form[' . $k . ']">' . $result[$k] . '</label>';
} else {
if (is_array($v->options)) {
foreach ($v->options as $optionValue => $optionLabel) {
if (isset($form->fields[$k]->options[$optionValue])) {
$form->fields[$k]->options[$optionValue] = '<label for="form[' . $k . '][' . $optionValue . ']">' . $form->fields[$k]->options[$optionValue] . '</label>';
}
}
}
}
}
if (! is_array ( $value )) {