forked from extern/egroupware
Implement save into VFS for mail compose toolbar
This commit is contained in:
parent
f9c1883713
commit
bc1578693c
@ -178,6 +178,13 @@ class mail_compose
|
||||
'children' => array(),
|
||||
'toolbarDefault' => true,
|
||||
'hint' => 'Select the message priority tag'
|
||||
),
|
||||
'save2vfs' => array (
|
||||
'caption' => 'Save to VFS',
|
||||
'icon' => 'filesave',
|
||||
'group' => ++$group,
|
||||
'onExecute' => 'javaScript:app.mail.compose_saveDraft2fm',
|
||||
'hint' => 'Save the drafted message as eml file into VFS'
|
||||
)
|
||||
);
|
||||
foreach (self::$priorities as $priority)
|
||||
|
@ -2567,7 +2567,8 @@ app.classes.mail = AppJS.extend(
|
||||
var url = window.egw_webserverUrl+'/index.php?';
|
||||
url += 'menuaction=filemanager.filemanager_select.select'; // todo compose for Draft folder
|
||||
url += '&mode=saveas';
|
||||
var filename =dataElem.data.subject.replace(/[\f\n\t\v/\\:*#?<>\|]/g,"_");
|
||||
var subject = dataElem? dataElem.data.subject: _elems[0].subject;
|
||||
var filename = subject.replace(/[\f\n\t\v/\\:*#?<>\|]/g,"_")|| 'unknown';
|
||||
url += '&name='+encodeURIComponent(filename+'.eml');
|
||||
url += '&mime=message'+encodeURIComponent('/')+'rfc822';
|
||||
url += '&method=mail.mail_ui.vfsSaveMessage';
|
||||
@ -4275,4 +4276,25 @@ app.classes.mail = AppJS.extend(
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Save drafted compose as eml file into VFS
|
||||
* @param {type} _action action
|
||||
*/
|
||||
compose_saveDraft2fm: function (_action)
|
||||
{
|
||||
var content = this.et2.getArrayMgr('content').data;
|
||||
var subject = this.et2.getWidgetById('subject');
|
||||
var elem = {0:{id:"", subject:""}};
|
||||
if (typeof content != 'undefined' && content.lastDrafted && subject)
|
||||
{
|
||||
elem[0].id = content.lastDrafted;
|
||||
elem[0].subject = subject.get_value();
|
||||
this.mail_save2fm(_action, elem);
|
||||
}
|
||||
else
|
||||
{
|
||||
et2_dialog.alert('You need to save the message as draft first before to be able to save it into VFS','Save into VFS','info');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user