From 819c8064603d8e2e338f0328e66e04d7b2a81eed Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 18 Mar 2012 14:40:49 +0000 Subject: [PATCH] process js_pseudo_funcs in onchange of date-widget --- etemplate/inc/class.date_widget.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.date_widget.inc.php b/etemplate/inc/class.date_widget.inc.php index 1875680897..8125653195 100644 --- a/etemplate/inc/class.date_widget.inc.php +++ b/etemplate/inc/class.date_widget.inc.php @@ -280,7 +280,10 @@ class date_widget { $dcell['type'] = 'html'; $dcell['name'] = 'str'; - $jscaloptions = $cell['onchange'] ? ( ' onchange="'. ( (int)$cell['onchange'] === 1 ? 'this.form.submit();"' : $cell['onchange']. '"' ) ) : '' ; + $cname_parts = array_splice(explode('[',str_replace(']','',$name)), 0, -count(explode('[',str_replace(']','',$cell['name'])))); + $cname = array_shift($cname_parts); + if ($cname_parts) $cname .= '['.implode('][', $cname_parts).']'; + $jscaloptions = $cell['onchange'] ? ( ' onchange="'. ( (int)$cell['onchange'] === 1 ? 'this.form.submit();"' : $tmpl->js_pseudo_funcs($cell['onchange'],$cname). '"' ) ) : '' ; $value['str'] = $this->jscal->input($name.'[str]',False,$value['Y'],$value['m'],$value['d'],lang($cell['help']),$jscaloptions,false,!($options & 128)); $n = 2; // no other fields $options &= ~2; // no set-today button