SF Bug #2554402 - template autofill command not work on appearance,date_attrs
This commit is contained in:
parent
23a2da1f26
commit
efd1860a91
@ -1,5 +1,5 @@
|
||||
function dateSelector(id) {
|
||||
var el = document.getElementById('f_date_'+id);
|
||||
var el = document.getElementById('new_values_'+id);
|
||||
var format = gettype(el.id);
|
||||
var epoch;
|
||||
var parse = false;
|
||||
|
@ -702,7 +702,7 @@ class PageRender extends Visitor {
|
||||
$val = $attribute->getValue($i);
|
||||
|
||||
echo '<span style="white-space: nowrap;">';
|
||||
printf('<input type="text" class="value" id="f_date_%s_%s" name="new_values[%s][%s]" value="%s" %s%s %s %s/> ',
|
||||
printf('<input type="text" class="value" id="new_values_%s_%s" name="new_values[%s][%s]" value="%s" %s%s %s %s/> ',
|
||||
$attribute->getName(),$i,
|
||||
htmlspecialchars($attribute->getName()),$i,htmlspecialchars($val),
|
||||
$attribute->needJS('focus') ? sprintf('onFocus="focus_%s(this);" ',$attribute->getName()) : '',
|
||||
|
@ -1852,14 +1852,16 @@ function fillRec(id,value) {
|
||||
if ($attribute->needJS('blur')) {
|
||||
printf('function blur_%s(component) {',$attribute->getName());
|
||||
echo "\n";
|
||||
//echo ' alert("BLUR: ID:"+component.id+", V:"+pla_getComponentValue(component));';
|
||||
$this->draw('BlurJavascript',$attribute,'component');
|
||||
echo "};\n";
|
||||
}
|
||||
|
||||
echo '// validate'."\n";
|
||||
printf('function validate_%s(component,silence) {',$attribute->getName());
|
||||
echo "\n";
|
||||
|
||||
if ($attribute->needJS('validate')) {
|
||||
printf('function validate_%s(component,silence) {',$attribute->getName());
|
||||
echo "\n";
|
||||
echo ' var valid = true;';
|
||||
echo "\n";
|
||||
$this->draw('ValidateJavascript',$attribute,'component','silence','valid');
|
||||
@ -1867,9 +1869,13 @@ function fillRec(id,value) {
|
||||
echo ' if (valid) { component.style.backgroundColor = "white"; component.style.color = "black"; }';
|
||||
echo ' else { component.style.backgroundColor = \'#FFFFA0\'; component.style.color = "black"; }';
|
||||
echo ' return valid;';
|
||||
echo '}'."\n";
|
||||
|
||||
} else {
|
||||
echo ' return true;'."\n";
|
||||
}
|
||||
|
||||
echo '}'."\n";
|
||||
|
||||
echo '</script>'."\n";
|
||||
|
||||
printf('<!-- END: ATTRIBUTE %s (%s)-->',__METHOD__,$attribute->getName());
|
||||
@ -2232,7 +2238,7 @@ function deleteAttribute(attrName,friendlyName,i)
|
||||
$config['format'] = $config['date'][$attribute->getName()];
|
||||
|
||||
for ($i=0;$i<=$attribute->getValueCount();$i++) {
|
||||
printf('<script type="text/javascript" language="javascript">defaults[\'f_date_%s_%s\'] = \'%s\';</script>',$attribute->getName(),$i,$config['format']);
|
||||
printf('<script type="text/javascript" language="javascript">defaults[\'new_values_%s_%s\'] = \'%s\';</script>',$attribute->getName(),$i,$config['format']);
|
||||
|
||||
if (in_array_ignore_case($attribute->getName(),array_keys($config['time'])) && ($config['time'][$attribute->getName()]))
|
||||
printf('<script type="text/javascript" language="javascript">defaults[\'f_time_%s_%s\'] = \'%s\';</script>',$attribute->getName(),$i,'true');
|
||||
|
Loading…
Reference in New Issue
Block a user