Use hover_action to edit subject of a message

This commit is contained in:
Hadi Nategh 2018-02-26 17:53:59 +01:00
parent b7582fa9a0
commit 89f4deba8e
2 changed files with 7 additions and 6 deletions

View File

@ -6039,13 +6039,14 @@ app.classes.mail = AppJS.extend(
/** /**
* Creates a dialog for changing meesage subject * Creates a dialog for changing meesage subject
* *
* @param {type} _action * @param {object} _action|_widget
* @param {type} _sender * @param {object} _sender|_content
*/ */
modifyMessageSubjectDialog: function (_action, _sender) modifyMessageSubjectDialog: function (_action, _sender)
{ {
var id = _sender[0].id != 'nm'? _sender[0].id:_sender[1].id; var id = (_sender && _sender.uid) ? _sender.row_id:
var data = egw.dataGetUIDdata(id); _sender[0].id != 'nm'? _sender[0].id:_sender[1].id;
var data = (_sender && _sender.uid) ? {data:_sender} : egw.dataGetUIDdata(id);
var subject = data && data.data? data.data.subject : ""; var subject = data && data.data? data.data.subject : "";
var buttons = [ var buttons = [
@ -6064,7 +6065,7 @@ app.classes.mail = AppJS.extend(
switch (_button_id) switch (_button_id)
{ {
case "save": case "save":
egw.json('mail.mail_ui.ajax_saveModifiedMessageSubject',[_sender[0].id, newSubject], function(_data){ egw.json('mail.mail_ui.ajax_saveModifiedMessageSubject',[id, newSubject], function(_data){
if (_data && !_data.success) if (_data && !_data.success)
{ {
egw.message(_data.msg, "error"); egw.message(_data.msg, "error");

View File

@ -111,7 +111,7 @@
<description span="1" class="status_img"/> <description span="1" class="status_img"/>
<html id="${row}[attachments]"/> <html id="${row}[attachments]"/>
<vbox> <vbox>
<description id="${row}[subject]" no_lang="1"/> <description id="${row}[subject]" no_lang="1" hover_action="app.mail.modifyMessageSubjectDialog"/>
<description id="${row}[bodypreview]" no_lang="1" class='et2_label bodypreview'/> <description id="${row}[bodypreview]" no_lang="1" class='et2_label bodypreview'/>
</vbox> </vbox>
<hbox> <hbox>