mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-16 06:56:52 +02:00
use observer in mail to overwrite refresh for Sieve rules in iframe (like app_refresh)
This commit is contained in:
parent
ddc1b2d673
commit
f5c186c384
@ -320,7 +320,7 @@ class mail_sieve
|
|||||||
$msg .= "\n".lang("Error: Could not save rule").' '.lang("No action defined!");
|
$msg .= "\n".lang("Error: Could not save rule").' '.lang("No action defined!");
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
egw_framework::refresh_opener($msg, 'mail');
|
egw_framework::refresh_opener($msg, 'mail', 'sieve');
|
||||||
if ($button == "apply")
|
if ($button == "apply")
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
@ -343,7 +343,7 @@ class mail_sieve
|
|||||||
$this->rules = array_values($this->rules);
|
$this->rules = array_values($this->rules);
|
||||||
$this->updateScript();
|
$this->updateScript();
|
||||||
}
|
}
|
||||||
egw_framework::refresh_opener($msg, 'mail');
|
egw_framework::refresh_opener($msg, 'mail', 'sieve');
|
||||||
|
|
||||||
case 'cancel':
|
case 'cancel':
|
||||||
egw_framework::window_close();
|
egw_framework::window_close();
|
||||||
@ -619,7 +619,7 @@ class mail_sieve
|
|||||||
// refresh vacationNotice on index
|
// refresh vacationNotice on index
|
||||||
$response = egw_json_response::get();
|
$response = egw_json_response::get();
|
||||||
$response->call('app.mail.mail_callRefreshVacationNotice',$this->mailbo->profileID);
|
$response->call('app.mail.mail_callRefreshVacationNotice',$this->mailbo->profileID);
|
||||||
egw_framework::refresh_opener($msg, 'mail','edit');
|
egw_framework::refresh_opener($msg, 'mail');
|
||||||
if ($button === 'apply' || $icServer->error !=="")
|
if ($button === 'apply' || $icServer->error !=="")
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
@ -865,9 +865,9 @@ class mail_sieve
|
|||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
$result = $this->updateScript();
|
$result = $this->updateScript();
|
||||||
|
|
||||||
$response = egw_json_response::get();
|
$response = egw_json_response::get();
|
||||||
|
|
||||||
if($result)
|
if($result)
|
||||||
{
|
{
|
||||||
$response->error($result);
|
$response->error($result);
|
||||||
|
@ -137,7 +137,7 @@ app.classes.mail = AppJS.extend(
|
|||||||
if (w_h[1] == 'egw_getWindowOuterHeight()')
|
if (w_h[1] == 'egw_getWindowOuterHeight()')
|
||||||
{
|
{
|
||||||
w_h[1] = (screen.availHeight>egw_getWindowOuterHeight()?screen.availHeight:egw_getWindowOuterHeight());
|
w_h[1] = (screen.availHeight>egw_getWindowOuterHeight()?screen.availHeight:egw_getWindowOuterHeight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window.resizeTo((w_h[0]?w_h[0]:870),(w_h[1]?w_h[1]:(screen.availHeight>egw_getWindowOuterHeight()?screen.availHeight:egw_getWindowOuterHeight())));
|
window.resizeTo((w_h[0]?w_h[0]:870),(w_h[1]?w_h[1]:(screen.availHeight>egw_getWindowOuterHeight()?screen.availHeight:egw_getWindowOuterHeight())));
|
||||||
break;
|
break;
|
||||||
@ -145,19 +145,62 @@ app.classes.mail = AppJS.extend(
|
|||||||
var app_registry = egw.link_get_registry('mail');
|
var app_registry = egw.link_get_registry('mail');
|
||||||
this.mail_isMainWindow = false;
|
this.mail_isMainWindow = false;
|
||||||
this.hide_cc_compose();
|
this.hide_cc_compose();
|
||||||
|
|
||||||
if (typeof app_registry['edit'] != 'undefined' && typeof app_registry['edit_popup'] != 'undefined' )
|
if (typeof app_registry['edit'] != 'undefined' && typeof app_registry['edit_popup'] != 'undefined' )
|
||||||
{
|
{
|
||||||
var w_h =app_registry['edit_popup'].split('x');
|
var w_h =app_registry['edit_popup'].split('x');
|
||||||
if (w_h[1] == 'egw_getWindowOuterHeight()') w_h[1] = (screen.availHeight>egw_getWindowOuterHeight()?screen.availHeight:egw_getWindowOuterHeight());
|
if (w_h[1] == 'egw_getWindowOuterHeight()') w_h[1] = (screen.availHeight>egw_getWindowOuterHeight()?screen.availHeight:egw_getWindowOuterHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
window.resizeTo((w_h[0]?w_h[0]:870),(w_h[1]?w_h[1]:(screen.availHeight<800?screen.availHeight:800)));
|
window.resizeTo((w_h[0]?w_h[0]:870),(w_h[1]?w_h[1]:(screen.availHeight<800?screen.availHeight:800)));
|
||||||
this.compose_cc_expander();
|
this.compose_cc_expander();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Observer method receives update notifications from all applications
|
||||||
|
*
|
||||||
|
* App is responsible for only reacting to "messages" it is interested in!
|
||||||
|
*
|
||||||
|
* @param {string} _msg message (already translated) to show, eg. 'Entry deleted'
|
||||||
|
* @param {string} _app application name
|
||||||
|
* @param {(string|number)} _id id of entry to refresh or null
|
||||||
|
* @param {string} _type either 'update', 'edit', 'delete', 'add' or null
|
||||||
|
* - update: request just modified data from given rows. Sorting is not considered,
|
||||||
|
* so if the sort field is changed, the row will not be moved.
|
||||||
|
* - edit: rows changed, but sorting may be affected. Requires full reload.
|
||||||
|
* - delete: just delete the given rows clientside (no server interaction neccessary)
|
||||||
|
* - add: requires full reload for proper sorting
|
||||||
|
* @param {string} _msg_type 'error', 'warning' or 'success' (default)
|
||||||
|
* @param {string} _targetapp which app's window should be refreshed, default current
|
||||||
|
* @return {false|*} false to stop regular refresh, thought all observers are run
|
||||||
|
*/
|
||||||
|
observer: function(_msg, _app, _id, _type, _msg_type, _targetapp)
|
||||||
|
{
|
||||||
|
switch(_app)
|
||||||
|
{
|
||||||
|
case 'mail':
|
||||||
|
if (_id === 'sieve')
|
||||||
|
{
|
||||||
|
var iframe = this.et2.getWidgetById('extra_iframe');
|
||||||
|
if (iframe && iframe.getDOMNode())
|
||||||
|
{
|
||||||
|
var contentWindow = iframe.getDOMNode().contentWindow;
|
||||||
|
if (contentWindow && contentWindow.app && contentWindow.app.mail)
|
||||||
|
{
|
||||||
|
contentWindow.app.mail.sieve_refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false; // mail nextmatch needs NOT to be refreshed
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'emailadmin':
|
||||||
|
// ToDo: update tree with given account _id and _type
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mail rebuild Action menu On nm-list
|
* mail rebuild Action menu On nm-list
|
||||||
*
|
*
|
||||||
@ -1400,10 +1443,10 @@ app.classes.mail = AppJS.extend(
|
|||||||
* @param {string} _previous - Previously selected node ID
|
* @param {string} _previous - Previously selected node ID
|
||||||
*/
|
*/
|
||||||
mail_changeFolder: function(_folder,_widget, _previous) {
|
mail_changeFolder: function(_folder,_widget, _previous) {
|
||||||
|
|
||||||
// to reset iframes to the normal status
|
// to reset iframes to the normal status
|
||||||
this.loadIframe();
|
this.loadIframe();
|
||||||
|
|
||||||
// Abort if user selected an un-selectable node
|
// Abort if user selected an un-selectable node
|
||||||
// Use image over anything else because...?
|
// Use image over anything else because...?
|
||||||
var img = _widget.getSelectedNode().images[0];
|
var img = _widget.getSelectedNode().images[0];
|
||||||
@ -2770,7 +2813,7 @@ app.classes.mail = AppJS.extend(
|
|||||||
var rowId = widget.id.replace(/[^0-9.]+/g, '');
|
var rowId = widget.id.replace(/[^0-9.]+/g, '');
|
||||||
var rights = (widget.get_value() == "custom"?[]:widget.get_value() == "aeiklprstwx")?
|
var rights = (widget.get_value() == "custom"?[]:widget.get_value() == "aeiklprstwx")?
|
||||||
widget.get_value().replace(/[k,x,t,e]/g,"cd").split(""):widget.get_value().split("");
|
widget.get_value().replace(/[k,x,t,e]/g,"cd").split(""):widget.get_value().split("");
|
||||||
|
|
||||||
for (var i=0;i<this.aclRights.length;i++)
|
for (var i=0;i<this.aclRights.length;i++)
|
||||||
{
|
{
|
||||||
var rightsWidget = this.et2.getWidgetById(rowId+'[acl_' + this.aclRights[i]+ ']');
|
var rightsWidget = this.et2.getWidgetById(rowId+'[acl_' + this.aclRights[i]+ ']');
|
||||||
@ -2829,26 +2872,26 @@ app.classes.mail = AppJS.extend(
|
|||||||
edit_sieve: function(_action, _senders)
|
edit_sieve: function(_action, _senders)
|
||||||
{
|
{
|
||||||
var acc_id = parseInt(_senders[0].id);
|
var acc_id = parseInt(_senders[0].id);
|
||||||
|
|
||||||
var url = this.egw.link('/index.php',{
|
var url = this.egw.link('/index.php',{
|
||||||
'menuaction': 'mail.mail_sieve.index',
|
'menuaction': 'mail.mail_sieve.index',
|
||||||
'acc_id': acc_id,
|
'acc_id': acc_id,
|
||||||
'ajax': 'true'
|
'ajax': 'true'
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!this.loadIframe(url))
|
if (!this.loadIframe(url))
|
||||||
{
|
{
|
||||||
this.egw.open_link(url);
|
this.egw.open_link(url);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load an url on an iframe
|
* Load an url on an iframe
|
||||||
*
|
*
|
||||||
* @param {string} _url string egw url
|
* @param {string} _url string egw url
|
||||||
* @param {iframe widget} _iFrame an iframe to be set if non, extra_iframe is default
|
* @param {iframe widget} _iFrame an iframe to be set if non, extra_iframe is default
|
||||||
*
|
*
|
||||||
* @return {boolean} return TRUE if success, and FALSE if iframe not given
|
* @return {boolean} return TRUE if success, and FALSE if iframe not given
|
||||||
*/
|
*/
|
||||||
loadIframe: function (_url, _iFrame)
|
loadIframe: function (_url, _iFrame)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user