Make button onclick work inside nextmatch again

This commit is contained in:
Nathan Gray 2012-03-12 17:55:52 +00:00
parent da10c03762
commit c2d1edc754
7 changed files with 48 additions and 7 deletions

View File

@ -640,7 +640,7 @@ abstract class bo_tracking
$notification = new notifications();
$notification->set_receivers(array($receiver));
$notification->set_message($this->get_body(false,$data,$old,false,$receiver)); // set message as plaintext
$notification->set_message($this->get_body(true,$data,$old,false,$receiver)); // and html
$notification->set_message($this->get_body(true,$data,$old,true,$receiver)); // and html
$notification->set_sender($this->get_sender($data,$old,true,$receiver));
$notification->set_subject($this->get_subject($data,$old,$deleted,$receiver));
$notification->set_links(array($this->get_notification_link($data,$old,$receiver)));

View File

@ -25,7 +25,12 @@
*
* etemplate or uietemplate extends boetemplate, all vars and public functions are inherited
*/
class etemplate extends boetemplate
//*
//$GLOBALS['egw_info']['flags']['js_link_registry'] = true;
class etemplate extends etemplate_new{}
class etemplate_old extends boetemplate
//*/
//class etemplate extends boetemplate
{
/**
* integer debug-level or template-name or cell-type or '' = off

View File

@ -135,6 +135,8 @@ class etemplate_new extends etemplate_widget_template
// not sure if we want to handle it this way, thought otherwise we will have a few ajax request for each dialog fetching predefined selectboxes
$template = etemplate_widget_template::instance($this->name, $this->template_set, $this->version, $this->laod_via);
$template->run('beforeSendToClient');
error_log('-------------');
error_log(array2string($sel_options));
$data = array(
'etemplate_exec_id' => self::$request->id(),

View File

@ -136,7 +136,7 @@ class etemplate_widget_customfields extends etemplate_widget_transformer
}
}
// check if name refers to a single custom field --> show only that
if (($pos=strpos($form_name,$this->prefix)) !== false && // allow the prefixed name to be an array index too
if (($pos=strpos($form_name,self::$prefix)) !== false && // allow the prefixed name to be an array index too
preg_match("/$this->prefix([^\]]+)/",$form_name,$matches) && isset($fields[$name=$matches[1]]))
{
$fields = array($name => $fields[$name]);
@ -145,6 +145,7 @@ class etemplate_widget_customfields extends etemplate_widget_transformer
$form_name = substr($form_name,0,-strlen("[$this->prefix$name]"));
}
if(!is_array($fields)) $fields = array();
switch($type = $this->type)
{
case 'customfields-types':

View File

@ -76,7 +76,7 @@ class etemplate_widget_tree extends etemplate_widget
}
$valid =& self::get_array($validated, $form_name, true);
$valid = $value;
error_log(__METHOD__."() $form_name: ".array2string($value_in).' --> '.array2string($value).', allowed='.array2string($allowed));
//error_log(__METHOD__."() $form_name: ".array2string($value_in).' --> '.array2string($value).', allowed='.array2string($allowed));
}
}
@ -203,7 +203,7 @@ class etemplate_widget_tree extends etemplate_widget
$cat2path[$cat['id']] = $path = ($cat['parent'] ? $cat2path[$cat['parent']].'/' : '').(string)$cat['id'];
// 1D array
$options[$cat['id']] = $cat + array('text' => $cat['name'], 'path' => $path);
$options[$cat['id']] = $cat + array('text' => $s, 'path' => $path);
// Tree in array
//$options[$cat['parent']][] = $cat;

View File

@ -202,7 +202,12 @@ var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM], {
{
this.options.onclick = _values["onclick"];
}
var type = this._type
var attrs = jQuery.extend(_values, this.options);
var parent = this._parent;
jQuery(this.getDOMNode()).bind("click.et2_baseWidget", this, function(e) {
var widget = et2_createWidget(type,attrs,parent);
e.data = widget;
e.data.set_id(_values["id"]);
return e.data.click.call(e.data,e);
});

View File

@ -2,6 +2,33 @@
<head>
<title>ET2 - Test</title>
<script>
var url = '/egroupware';
// legacy code
egw_webserverUrl = url;
// reference the egw object from the parent window or set the
// webserver url
if (window.opener && typeof window.opener.egw != 'undefined')
{
window['egw'] = window.opener.egw;
}
else if (window.top && typeof window.top.egw != 'undefined')
{
window['egw'] = window.top.egw;
}
else
{
// Create a "preferences only" egw object
window['egw'] = {
'prefsOnly': true,
'webserverUrl': url
};
}
</script>
<script src="jquery.js"></script>
<script src="../../../phpgwapi/js/jsapi/jsapi.js"></script>
<script src="../../../phpgwapi/js/egw_json.js"></script>
@ -136,9 +163,10 @@
<div id="container"></div>
<div style="color: silver;">[Just here to test the dynheight component...]</div>
<script>
window.egw_webserverUrl = egw.webserverUrl = '/egroupware';
var et2 = new (egw().etemplate2)(document.getElementById("container"), "");
egw(window).ready(function() {
var et2 = new etemplate2(document.getElementById("container"), "");
},null,true);
function open_xet(file, content) {
et2.load(file, content);
}