* Mail: replying to a mail should only update icon, not move it to top of list

This commit is contained in:
Ralf Becker 2020-07-29 13:58:02 +02:00
parent 631587eab1
commit 08acad038c
5 changed files with 15 additions and 2 deletions

View File

@ -433,6 +433,7 @@ var et2_nextmatch = /** @class */ (function (_super) {
* Change type parameters allows for quicker refresh then complete server side reload: * Change type parameters allows for quicker refresh then complete server side reload:
* - update: request just modified data from given rows. Sorting is not considered, * - 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. * so if the sort field is changed, the row will not be moved.
* - update-in-place: update row, but do NOT move it, or refresh if uid does not exist
* - edit: rows changed, but sorting may be affected. May require full reload. * - edit: rows changed, but sorting may be affected. May require full reload.
* - delete: just delete the given rows clientside (no server interaction neccessary) * - delete: just delete the given rows clientside (no server interaction neccessary)
* - add: put the new row in at the top, unless app says otherwise * - add: put the new row in at the top, unless app says otherwise
@ -504,6 +505,9 @@ var et2_nextmatch = /** @class */ (function (_super) {
id_loop: for (var i = 0; i < _row_ids.length; i++) { id_loop: for (var i = 0; i < _row_ids.length; i++) {
var uid = _row_ids[i].toString().indexOf(this.controller.dataStorePrefix) == 0 ? _row_ids[i] : this.controller.dataStorePrefix + "::" + _row_ids[i]; var uid = _row_ids[i].toString().indexOf(this.controller.dataStorePrefix) == 0 ? _row_ids[i] : this.controller.dataStorePrefix + "::" + _row_ids[i];
switch (_type) { switch (_type) {
case "update-in-place":
this.egw().dataRefreshUID(uid);
break;
case "edit": case "edit":
case "update": case "update":
if (!this.refresh_update(uid)) { if (!this.refresh_update(uid)) {

View File

@ -681,6 +681,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
* Change type parameters allows for quicker refresh then complete server side reload: * Change type parameters allows for quicker refresh then complete server side reload:
* - update: request just modified data from given rows. Sorting is not considered, * - 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. * so if the sort field is changed, the row will not be moved.
* - update-in-place: update row, but do NOT move it, or refresh if uid does not exist
* - edit: rows changed, but sorting may be affected. May require full reload. * - edit: rows changed, but sorting may be affected. May require full reload.
* - delete: just delete the given rows clientside (no server interaction neccessary) * - delete: just delete the given rows clientside (no server interaction neccessary)
* - add: put the new row in at the top, unless app says otherwise * - add: put the new row in at the top, unless app says otherwise
@ -769,6 +770,9 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
var uid = _row_ids[i].toString().indexOf(this.controller.dataStorePrefix) == 0 ? _row_ids[i] : this.controller.dataStorePrefix + "::" + _row_ids[i]; var uid = _row_ids[i].toString().indexOf(this.controller.dataStorePrefix) == 0 ? _row_ids[i] : this.controller.dataStorePrefix + "::" + _row_ids[i];
switch(_type) switch(_type)
{ {
case "update-in-place":
this.egw().dataRefreshUID(uid);
break;
case "edit": case "edit":
case "update": case "update":
if(!this.refresh_update(uid)) if(!this.refresh_update(uid))

View File

@ -875,6 +875,7 @@ declare interface IegwWndLocal extends IegwGlobal
* @param {string} _type either 'update', 'edit', 'delete', 'add' or null * @param {string} _type either 'update', 'edit', 'delete', 'add' or null
* - update: request just modified data from given rows. Sorting is not considered, * - 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. * so if the sort field is changed, the row will not be moved.
* - update-in-place: update row, but do NOT move it, or refresh if uid does not exist
* - edit: rows changed, but sorting may be affected. Requires full reload. * - edit: rows changed, but sorting may be affected. Requires full reload.
* - delete: just delete the given rows clientside (no server interaction neccessary) * - delete: just delete the given rows clientside (no server interaction neccessary)
* - add: requires full reload for proper sorting * - add: requires full reload for proper sorting

View File

@ -319,6 +319,7 @@ egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd)
* @param {string} _type either 'update', 'edit', 'delete', 'add' or null * @param {string} _type either 'update', 'edit', 'delete', 'add' or null
* - update: request just modified data from given rows. Sorting is not considered, * - 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. * so if the sort field is changed, the row will not be moved.
* - update-in-place: update row, but do NOT move it, or refresh if uid does not exist
* - edit: rows changed, but sorting may be affected. Requires full reload. * - edit: rows changed, but sorting may be affected. Requires full reload.
* - delete: just delete the given rows clientside (no server interaction neccessary) * - delete: just delete the given rows clientside (no server interaction neccessary)
* - add: requires full reload for proper sorting * - add: requires full reload for proper sorting

View File

@ -570,6 +570,7 @@ class mail_compose
{ {
$rhA = mail_ui::splitRowID($_content['processedmail_id']); $rhA = mail_ui::splitRowID($_content['processedmail_id']);
$idsForRefresh[] = mail_ui::generateRowID($rhA['profileID'], $rhA['folder'], $rhA['msgUID'], $_prependApp=false); $idsForRefresh[] = mail_ui::generateRowID($rhA['profileID'], $rhA['folder'], $rhA['msgUID'], $_prependApp=false);
$workingFolder = $rhA['folder']; // need folder to refresh eg. drafts folder
} }
$response = Api\Json\Response::get(); $response = Api\Json\Response::get();
if ($activeProfile != $composeProfile) if ($activeProfile != $composeProfile)
@ -577,17 +578,19 @@ class mail_compose
// we need a message only, when account ids (composeProfile vs. activeProfile) differ // we need a message only, when account ids (composeProfile vs. activeProfile) differ
$response->call('opener.egw_message',lang('Message send successfully.')); $response->call('opener.egw_message',lang('Message send successfully.'));
} }
elseif ($activeProfile == $composeProfile && ($workingFolder==$activeFolder['mailbox'] && $mode != 'compose') || ($this->mail_bo->isSentFolder($workingFolder)||$this->mail_bo->isDraftFolder($workingFolder))) elseif ($activeProfile == $composeProfile && ($workingFolder==$activeFolder['mailbox'] && $mode != 'compose') ||
($this->mail_bo->isSentFolder($workingFolder) || $this->mail_bo->isDraftFolder($workingFolder)))
{ {
if ($this->mail_bo->isSentFolder($workingFolder)||$this->mail_bo->isDraftFolder($workingFolder)) if ($this->mail_bo->isSentFolder($workingFolder)||$this->mail_bo->isDraftFolder($workingFolder))
{ {
// we may need a refresh when on sent folder or in drafts, as drafted messages will/should be deleted after succeeded send action // we may need a refresh when on sent folder or in drafts, as drafted messages will/should be deleted after succeeded send action
$response->call('opener.egw_refresh',lang('Message send successfully.'),'mail'); $response->call('opener.egw_refresh',lang('Message send successfully.'),'mail');
} }
// we only need to update the icon of the replied or forwarded mails --> 'update-in-place'
else else
{ {
//error_log(__METHOD__.__LINE__.array2string($idsForRefresh)); //error_log(__METHOD__.__LINE__.array2string($idsForRefresh));
$response->call('opener.egw_refresh',lang('Message send successfully.'),'mail',$idsForRefresh,'update'); $response->call('opener.egw_refresh',lang('Message send successfully.'),'mail',$idsForRefresh,'update-in-place');
} }
} }
else else