remove egw_refresh and egw_message calls and replace them with (this.)egw.message and (this.)egw.refresh

This commit is contained in:
Klaus Leithoff 2014-05-27 13:31:37 +00:00
parent d1c25c7c38
commit 324a599ae2
2 changed files with 26 additions and 26 deletions

View File

@ -3734,7 +3734,7 @@ $this->partID = $partID;
}
else
{
$response->call('egw_refresh',lang('failed to rename %1 ! Reason: %2',$oldFolderName,$msg),'mail');
$response->call('egw.refresh',lang('failed to rename %1 ! Reason: %2',$oldFolderName,$msg),'mail');
}
}
}
@ -3935,7 +3935,7 @@ $this->partID = $partID;
}
else
{
$response->call('egw_refresh',lang('failed to move %1 ! Reason: %2',$folderName,$msg),'mail');
$response->call('egw.refresh',lang('failed to move %1 ! Reason: %2',$folderName,$msg),'mail');
}
}
}
@ -4049,7 +4049,7 @@ $this->partID = $partID;
}
else
{
$response->call('egw_refresh',lang('failed to delete %1 ! Reason: %2',$oldFolderInfo['shortDisplayName'],$msg),'mail');
$response->call('egw.refresh',lang('failed to delete %1 ! Reason: %2',$oldFolderInfo['shortDisplayName'],$msg),'mail');
}
}
}
@ -4226,7 +4226,7 @@ $this->partID = $partID;
{
$oldFolderInfo = $this->mail_bo->getFolderStatus($trashFolder,false);
$response = egw_json_response::get();
$response->call('egw_message',lang('empty trash'));
$response->call('egw.message',lang('empty trash'));
$response->call('app.mail.mail_reloadNode',array($icServerID.self::$delimiter.$trashFolder=>$oldFolderInfo['shortDisplayName']));
//error_log(__METHOD__.__LINE__.' change Profile to ->'.$rememberServerID);
$this->changeProfile($rememberServerID);
@ -4234,7 +4234,7 @@ $this->partID = $partID;
else
{
$response = egw_json_response::get();
$response->call('egw_refresh',lang('empty trash'),'mail');
$response->call('egw.refresh',lang('empty trash'),'mail');
}
}
@ -4271,7 +4271,7 @@ $this->partID = $partID;
$this->changeProfile($rememberServerID);
}
$response = egw_json_response::get();
$response->call('egw_refresh',lang('compress folder').': '.$folderName,'mail');
$response->call('egw.refresh',lang('compress folder').': '.$folderName,'mail');
}
}
@ -4429,7 +4429,7 @@ $this->partID = $partID;
if ($_sendJsonResponse)
{
$response = egw_json_response::get();
$response->call('egw_message',lang('flagged %1 messages as %2 in %3',(isset($_messageList['all']) && $_messageList['all']?lang('all'):count($_messageList['msg'])),lang($_flag),$folder));
$response->call('egw.message',lang('flagged %1 messages as %2 in %3',(isset($_messageList['all']) && $_messageList['all']?lang('all'):count($_messageList['msg'])),lang($_flag),$folder));
}
}
@ -4552,17 +4552,17 @@ $this->partID = $partID;
$this->mail_bo->moveMessages($targetFolder,$messageList,($_copyOrMove=='copy'?false:true),$folder,false,($targetProfileID!=$sourceProfileID?$targetProfileID:null));
if ($_copyOrMove=='copy')
{
$response->call('egw_message',lang('copied %1 message(s) from %2 to %3',count($messageList),$folder,$targetFolder));
$response->call('egw.message',lang('copied %1 message(s) from %2 to %3',count($messageList),$folder,$targetFolder));
}
else
{
$response->call('egw_refresh',lang('moved %1 message(s) from %2 to %3',count($messageList),$folder,$targetFolder),'mail',$messageListForRefresh,'delete');
$response->call('egw.refresh',lang('moved %1 message(s) from %2 to %3',count($messageList),$folder,$targetFolder),'mail',$messageListForRefresh,'delete');
}
}
catch (Exception $e)
{
//error_log(__METHOD__.__LINE__.function_backtrace());
$response->call('egw_message',$e->getMessage(),"error");
$response->call('egw.message',$e->getMessage(),"error");
if ($changeFolderActions == false)
{
unset($lastFoldersUsedForMoveCont[$targetProfileID][$targetFolder]);

View File

@ -1123,7 +1123,7 @@ app.classes.mail = AppJS.extend(
for (var i in _status)
{
// if olddesc is undefined or #skip# then skip the message, as we process subfolders
if (typeof _status[i]['olddesc'] !== 'undefined' && _status[i]['olddesc'] !== '#skip-user-interaction-message#') egw_message(this.egw.lang("Renamed Folder %1 to %2",_status[i]['olddesc'],_status[i]['desc']));
if (typeof _status[i]['olddesc'] !== 'undefined' && _status[i]['olddesc'] !== '#skip-user-interaction-message#') this.egw.message(this.egw.lang("Renamed Folder %1 to %2",_status[i]['olddesc'],_status[i]['desc']));
ftree.renameItem(i,_status[i]['id'],_status[i]['desc']);
ftree.setStyle(i, 'font-weight: '+(_status[i]['desc'].match(this._unseen_regexp) ? 'bold' : 'normal'));
//alert(i +'->'+_status[i]['id']+'+'+_status[i]['desc']);
@ -1149,7 +1149,7 @@ app.classes.mail = AppJS.extend(
for (var i in _status)
{
// if olddesc is undefined or #skip# then skip the message, as we process subfolders
if (typeof _status[i] !== 'undefined' && _status[i] !== '#skip-user-interaction-message#') egw_message(this.egw.lang("Removed Folder %1 ",_status[i]));
if (typeof _status[i] !== 'undefined' && _status[i] !== '#skip-user-interaction-message#') this.egw.message(this.egw.lang("Removed Folder %1 ",_status[i]));
ftree.deleteItem(i,(selectedNode.id==i));
var selectedNodeAfter = ftree.getSelectedNode();
//alert(i +'->'+_status[i]['id']+'+'+_status[i]['desc']);
@ -1176,7 +1176,7 @@ app.classes.mail = AppJS.extend(
// if olddesc is undefined or #skip# then skip the message, as we process subfolders
if (typeof _status[i] !== 'undefined' && _status[i] !== '#skip-user-interaction-message#')
{
egw_message(this.egw.lang("Reloaded Folder %1 ",typeof _status[i] == "string" ? _status[i].replace(this._unseen_regexp, '') : _status[i].text.replace(this._unseen_regexp, '')));
this.egw.message(this.egw.lang("Reloaded Folder %1 ",typeof _status[i] == "string" ? _status[i].replace(this._unseen_regexp, '') : _status[i].text.replace(this._unseen_regexp, '')));
}
ftree.refreshItem(i,typeof _status[i] == "object" ? _status[i] : null);
if (typeof _status[i] == "string") ftree.setStyle(i, 'font-weight: '+(_status[i].match(this._unseen_regexp) ? 'bold' : 'normal'));
@ -1347,8 +1347,8 @@ app.classes.mail = AppJS.extend(
//{
// ids.push(_msg['msg'][i].replace(/mail::/,''));
//}
//egw_refresh(this.egw.lang("deleted %1 messages in %2",_msg['msg'].length,(displayname?displayname:egw.lang('current folder'))),'mail',ids,'delete');
egw_message(this.egw.lang("deleted %1 messages in %2",_msg['msg'].length,(displayname?displayname:egw.lang('current Folder'))));
//this.egw.refresh(this.egw.lang("deleted %1 messages in %2",_msg['msg'].length,(displayname?displayname:egw.lang('current folder'))),'mail',ids,'delete');
this.egw.message(this.egw.lang("deleted %1 messages in %2",_msg['msg'].length,(displayname?displayname:egw.lang('current Folder'))));
},
/**
@ -1364,8 +1364,8 @@ app.classes.mail = AppJS.extend(
{
ids.push(_msg['msg'][i].replace(/mail::/,''));
}
//egw_message(_msg['egw_message']);
egw_refresh(_msg['egw_message'],'mail',ids,'delete');
//this.egw.message(_msg['egw_message']);
this.egw.refresh(_msg['egw_message'],'mail',ids,'delete');
},
/**
@ -1384,7 +1384,7 @@ app.classes.mail = AppJS.extend(
}
else
{
egw_message(this.egw.lang('canceled deletion due to userinteraction'));
this.egw.message(this.egw.lang('canceled deletion due to userinteraction'));
this.mail_removeRowClass(messageList,'deleted');
}
this.mail_refreshMessageGrid();
@ -1410,10 +1410,10 @@ app.classes.mail = AppJS.extend(
var server = _senders[0].iface.id.split('::');
//console.log(action,_senders,FolderName);
egw_message(this.egw.lang('empty trash'));
this.egw.message(this.egw.lang('empty trash'));
egw.json('mail.mail_ui.ajax_emptyTrash',[server[0]])
.sendRequest(true);
// since the json reply is using egw_refresh, we should not need to call refreshFolderStatus
// since the json reply is using this.egw.refresh, we should not need to call refreshFolderStatus
// as the actions thereof are now bound to run after grid refresh
//this.mail_refreshFolderStatus();
},
@ -1427,10 +1427,10 @@ app.classes.mail = AppJS.extend(
*/
mail_compressFolder: function(action,_senders) {
//console.log(action,_senders,FolderName);
egw_message(this.egw.lang('compress folder'));
this.egw.message(this.egw.lang('compress folder'));
egw.jsonq('mail.mail_ui.ajax_compressFolder',[_senders[0].iface.id]);
// .sendRequest(true);
// since the json reply is using egw_refresh, we should not need to call refreshFolderStatus
// since the json reply is using this.egw.refresh, we should not need to call refreshFolderStatus
// as the actions thereof are now bound to run after grid refresh
//this.mail_refreshFolderStatus();
},
@ -1450,7 +1450,7 @@ app.classes.mail = AppJS.extend(
getFolders = true;
}
// alert(folder);
egw_message(this.egw.lang('Connect to Profile %1',_widget.getSelectedLabel().replace(this._unseen_regexp, '')));
this.egw.message(this.egw.lang('Connect to Profile %1',_widget.getSelectedLabel().replace(this._unseen_regexp, '')));
this.lock_tree();
egw.json('mail.mail_ui.ajax_changeProfile',[folder, getFolders], jQuery.proxy(function() {
@ -1509,7 +1509,7 @@ app.classes.mail = AppJS.extend(
{
var displayname = _widget.getSelectedLabel();
var myMsg = (displayname?displayname:_folder).replace(this._unseen_regexp, '')+' '+this.egw.lang('selected');
egw_message(myMsg);
this.egw.message(myMsg);
}
// Update non-grid
@ -3042,7 +3042,7 @@ app.classes.mail = AppJS.extend(
var mailbox = _senders[0].id.split('::');
var folder = mailbox[1], acc_id = mailbox[0];
var ftree = this.et2.getWidgetById(this.nm_index+'[foldertree]');
egw_message(this.egw.lang('Subscribe to Folder %1',ftree.getLabel(_senders[0].id).replace(this._unseen_regexp,'')));
this.egw.message(this.egw.lang('Subscribe to Folder %1',ftree.getLabel(_senders[0].id).replace(this._unseen_regexp,'')));
egw.json('mail.mail_ui.ajax_foldersubscription',[acc_id,folder,true])
.sendRequest();
},
@ -3058,7 +3058,7 @@ app.classes.mail = AppJS.extend(
var mailbox = _senders[0].id.split('::');
var folder = mailbox[1], acc_id = mailbox[0];
var ftree = this.et2.getWidgetById(this.nm_index+'[foldertree]');
egw_message(this.egw.lang('Unsubscribe from Folder %1',ftree.getLabel(_senders[0].id).replace(this._unseen_regexp,'')));
this.egw.message(this.egw.lang('Unsubscribe from Folder %1',ftree.getLabel(_senders[0].id).replace(this._unseen_regexp,'')));
egw.json('mail.mail_ui.ajax_foldersubscription',[acc_id,folder,false])
.sendRequest();
},