浏览代码

Allow developers to choose attachments (#4477)

* Allow developers to choose attachments

This change allows developers to choose attachments, even if there is a cur_frm object.

* Update communication.js

* Merge this.attachments and form attachments

* fix codacy
version-14
ci2014 7 年前
committed by Faris Ansari
父节点
当前提交
01a955eb45
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. +7
    -4
      frappe/public/js/frappe/views/communication.js

+ 7
- 4
frappe/public/js/frappe/views/communication.js 查看文件

@@ -354,11 +354,14 @@ frappe.views.CommunicationComposer = Class.extend({
var fields = this.dialog.fields_dict;
var attach = $(fields.select_attachments.wrapper).find(".attach-list").empty();

if (cur_frm){
var files = cur_frm.get_files();
}else {
var files = this.attachments
var files = [];
if (this.attachments && this.attachments.length) {
files = files.concat(this.attachments);
}
if (cur_frm) {
files = files.concat(cur_frm.get_files());
}

if(files.length) {
$.each(files, function(i, f) {
if (!f.file_name) return;


正在加载...
取消
保存