瀏覽代碼

[fix] [client script] call cur_frm.cscript.custom_ type functions in the callback of standard functions

version-14
Anand Doshi 12 年之前
父節點
當前提交
f6f54d7027
共有 44 個文件被更改,包括 94 次插入105 次删除
  1. +1
    -1
      core/doctype/communication/communication.js
  2. +1
    -1
      core/doctype/custom_field/custom_field.js
  3. +3
    -3
      core/doctype/customize_form/customize_form.js
  4. +2
    -2
      core/doctype/documentation_tool/documentation_tool.js
  5. +2
    -2
      core/doctype/profile/profile.js
  6. +2
    -2
      core/page/data_import_tool/data_import_tool.js
  7. +3
    -3
      core/page/messages/messages.js
  8. +1
    -1
      core/page/modules_setup/modules_setup.js
  9. +8
    -8
      core/page/permission_manager/permission_manager.js
  10. +3
    -3
      core/page/todo/todo.js
  11. +1
    -1
      core/page/update_manager/update_manager.js
  12. +4
    -4
      core/page/user_properties/user_properties.js
  13. +3
    -23
      public/js/legacy/clientscriptAPI.js
  14. +1
    -1
      public/js/legacy/form.js
  15. +3
    -3
      public/js/legacy/handler.js
  16. +3
    -3
      public/js/wn/app.js
  17. +1
    -1
      public/js/wn/defaults.js
  18. +1
    -1
      public/js/wn/form/assign_to.js
  19. +1
    -1
      public/js/wn/form/attachments.js
  20. +2
    -2
      public/js/wn/form/comments.js
  21. +7
    -2
      public/js/wn/form/control.js
  22. +1
    -1
      public/js/wn/form/infobar.js
  23. +1
    -1
      public/js/wn/form/link_selector.js
  24. +9
    -5
      public/js/wn/form/script_manager.js
  25. +1
    -1
      public/js/wn/misc/tools.js
  26. +2
    -2
      public/js/wn/model/create_new.js
  27. +1
    -1
      public/js/wn/model/doclist.js
  28. +4
    -4
      public/js/wn/model/model.js
  29. +2
    -2
      public/js/wn/request.js
  30. +1
    -1
      public/js/wn/ui/listing.js
  31. +2
    -2
      public/js/wn/ui/tags.js
  32. +1
    -1
      public/js/wn/ui/toolbar/toolbar.js
  33. +1
    -1
      public/js/wn/ui/tree.js
  34. +1
    -1
      public/js/wn/upload.js
  35. +2
    -2
      public/js/wn/views/calendar.js
  36. +2
    -2
      public/js/wn/views/communication.js
  37. +1
    -1
      public/js/wn/views/doclistview.js
  38. +1
    -1
      public/js/wn/views/ganttview.js
  39. +1
    -1
      public/js/wn/views/grid_report.js
  40. +1
    -1
      public/js/wn/views/moduleview.js
  41. +1
    -1
      public/js/wn/views/pageview.js
  42. +2
    -2
      public/js/wn/views/query_report.js
  43. +2
    -2
      public/js/wn/views/reportview.js
  44. +1
    -1
      public/js/wn/views/sidebar_stats.js

+ 1
- 1
core/doctype/communication/communication.js 查看文件

@@ -36,7 +36,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {

cur_frm.cscript.contact = function(doc, dt, dn) {
if (doc.contact) {
wn.call({
return wn.call({
method: 'support.doctype.communication.communication.get_customer_supplier',
args: {
contact: doc.contact


+ 1
- 1
core/doctype/custom_field/custom_field.js 查看文件

@@ -75,7 +75,7 @@ cur_frm.cscript.dt = function(doc, dt, dn) {
set_field_options('insert_after', '');
return;
}
wn.call({
return wn.call({
method: 'core.doctype.custom_field.custom_field.get_fields_label',
args: { doctype: doc.dt, fieldname: doc.fieldname },
callback: function(r, rt) {


+ 3
- 3
core/doctype/customize_form/customize_form.js 查看文件

@@ -27,7 +27,7 @@ $(cur_frm.wrapper).on("grid-row-render", function(e, grid_row) {
})

cur_frm.cscript.doc_type = function(doc, dt, dn) {
cur_frm.call({
return cur_frm.call({
method: "get",
doc: cur_frm.doc,
callback: function(r) {
@@ -58,7 +58,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {

cur_frm.add_custom_button('Update', function() {
if(cur_frm.doc.doc_type) {
cur_frm.call({
return cur_frm.call({
doc: cur_frm.doc,
method: "post",
callback: function(r) {
@@ -129,7 +129,7 @@ cur_frm.confirm = function(msg, doc, dt, dn) {
$y(button_wrapper, {paddingTop: '15px'});
var proceed_btn = $btn(button_wrapper, 'Proceed', function() {
cur_frm.call({
return cur_frm.call({
doc: cur_frm.doc,
method: "delete",
callback: function(r) {


+ 2
- 2
core/doctype/documentation_tool/documentation_tool.js 查看文件

@@ -64,7 +64,7 @@ wn.docs.generate_all = function(logarea) {
logarea.empty().append("Downloading server docs...<br>");
wn.call({
return wn.call({
"method": "core.doctype.documentation_tool.documentation_tool.get_docs",
args: {options: cur_frm.doc},
callback: function(r) {
@@ -86,7 +86,7 @@ wn.docs.generate_all = function(logarea) {
make_page("docs");

logarea.append("Writing...<br>");
wn.call({
return wn.call({
method: "core.doctype.documentation_tool.documentation_tool.write_docs",
args: {
data: JSON.stringify(wn.docs.to_write),


+ 2
- 2
core/doctype/profile/profile.js 查看文件

@@ -68,7 +68,7 @@ wn.RoleEditor = Class.extend({
var me = this;
this.wrapper = wrapper;
$(wrapper).html('<div class="help">Loading...</div>')
wn.call({
return wn.call({
method:'core.doctype.profile.profile.get_all_roles',
callback: function(r) {
me.roles = r.message;
@@ -174,7 +174,7 @@ wn.RoleEditor = Class.extend({
if(!this.perm_dialog)
this.make_perm_dialog()
$(this.perm_dialog.body).empty();
wn.call({
return wn.call({
method:'core.doctype.profile.profile.get_perm_info',
args: {role: role},
callback: function(r) {


+ 2
- 2
core/page/data_import_tool/data_import_tool.js 查看文件

@@ -46,7 +46,7 @@ wn.pages['data-import-tool'].onload = function(wrapper) {
"Performing hardcore import process....", 100);
// load doctypes
wn.call({
return wn.call({
method:'core.page.data_import_tool.data_import_tool.get_doctypes',
callback: function(r) {
$select.add_options(['Select...'].concat(r.message));
@@ -71,7 +71,7 @@ wn.pages['data-import-tool'].onload = function(wrapper) {
$('#dit-download').empty();
// get options
wn.call({
return wn.call({
method:'core.page.data_import_tool.data_import_tool.get_doctype_options',
args: {doctype: val},
callback: function(r) {


+ 3
- 3
core/page/messages/messages.js 查看文件

@@ -61,7 +61,7 @@ erpnext.Messages = Class.extend({
$('#post-message .btn').click(function() {
var txt = $('#post-message textarea').val();
if(txt) {
wn.call({
return wn.call({
module:'core',
page:'messages',
method:'post',
@@ -163,7 +163,7 @@ erpnext.Messages = Class.extend({
},
delete: function(ele) {
$(ele).parent().css('opacity', 0.6);
wn.call({
return wn.call({
method:'core.page.messages.messages.delete',
args: {name : $(ele).attr('data-name')},
callback: function() {
@@ -173,7 +173,7 @@ erpnext.Messages = Class.extend({
},
show_active_users: function() {
var me = this;
wn.call({
return wn.call({
module:'core',
page:'messages',
method:'get_active_users',


+ 1
- 1
core/page/modules_setup/modules_setup.js 查看文件

@@ -36,7 +36,7 @@ wn.modules_setup = {
ml.push($(this).attr('data-module'));
});
wn.call({
return wn.call({
method: 'core.page.modules_setup.modules_setup.update',
args: {
ml: ml


+ 8
- 8
core/page/permission_manager/permission_manager.js 查看文件

@@ -84,7 +84,7 @@ wn.PermissionEngine = Class.extend({
var me = this;
me.make_reset_button();
wn.call({
return wn.call({
module:"core",
page:"permission_manager",
method: "get_roles_and_doctypes",
@@ -120,7 +120,7 @@ wn.PermissionEngine = Class.extend({
var me = this;
me.reset_button = me.wrapper.appframe.add_button("Reset Permissions", function() {
if(wn.confirm("Reset Permissions for " + me.get_doctype() + "?", function() {
wn.call({
return wn.call({
module:"core",
page:"permission_manager",
method:"reset",
@@ -151,7 +151,7 @@ wn.PermissionEngine = Class.extend({
return;
}
// get permissions
wn.call({
return wn.call({
module: "core",
page: "permission_manager",
method: "get_permissions",
@@ -239,7 +239,7 @@ wn.PermissionEngine = Class.extend({
.attr("data-role", role)
.click(function() {
var role = $(this).attr("data-role");
wn.call({
return wn.call({
module: "core",
page: "permission_manager",
method: "get_users_with_role",
@@ -279,7 +279,7 @@ wn.PermissionEngine = Class.extend({
.attr("data-name", d.name)
.attr("data-doctype", d.parent)
.click(function() {
wn.call({
return wn.call({
module: "core",
page: "permission_manager",
method: "remove",
@@ -307,7 +307,7 @@ wn.PermissionEngine = Class.extend({
ptype: chk.attr("data-ptype"),
value: chk.prop("checked") ? 1 : 0
}
wn.call({
return wn.call({
module: "core",
page: "permission_manager",
method: "update",
@@ -355,7 +355,7 @@ wn.PermissionEngine = Class.extend({
if(!args) {
return;
}
wn.call({
return wn.call({
module: "core",
page: "permission_manager",
method: "add",
@@ -416,7 +416,7 @@ wn.PermissionEngine = Class.extend({
.click(function() {
var match_value = $(dialog.wrapper).find(":radio:checked").val();
var perm = me.get_perm($(this).attr('data-name'))
wn.call({
return wn.call({
module: "core",
page: "permission_manager",
method: "update_match",


+ 3
- 3
core/page/todo/todo.js 查看文件

@@ -18,7 +18,7 @@ wn.provide('erpnext.todo');

erpnext.todo.refresh = function() {
wn.call({
return wn.call({
method: 'core.page.todo.todo.get',
callback: function(r,rt) {
var todo_list = $('#todo-list div.todo-content');
@@ -117,7 +117,7 @@ erpnext.todo.ToDoItem = Class.extend({
.data('name', todo.name)
.click(function() {
$(this).parent().css('opacity', 0.5);
wn.call({
return wn.call({
method:'core.page.todo.todo.delete',
args: {name: $(this).data('name')},
callback: function() {
@@ -172,7 +172,7 @@ erpnext.todo.save = function(btn) {
}
det.name = d.det.name || '';
wn.call({
return wn.call({
method:'core.page.todo.todo.edit',
args: det,
btn: btn,


+ 1
- 1
core/page/update_manager/update_manager.js 查看文件

@@ -50,7 +50,7 @@ wn.UpdateThisApp = Class.extend({
</div> \
<div>' + wn._("Update is in progress. This may take some time.") + '</div>');
wn.call({
return wn.call({
module: "core",
page: "update_manager",
method: "update_this_app",


+ 4
- 4
core/page/user_properties/user_properties.js 查看文件

@@ -33,7 +33,7 @@ wn.UserProperties = Class.extend({
},
make: function() {
var me = this;
wn.call({
return wn.call({
module:"core",
page:"user_properties",
method: "get_users_and_links",
@@ -101,7 +101,7 @@ wn.UserProperties = Class.extend({
return;
}
// get permissions
wn.call({
return wn.call({
module: "core",
page: "user_properties",
method: "get_properties",
@@ -147,7 +147,7 @@ wn.UserProperties = Class.extend({
.attr("data-name", d.name)
.attr("data-user", d.parent)
.click(function() {
wn.call({
return wn.call({
module: "core",
page: "user_properties",
method: "remove",
@@ -212,7 +212,7 @@ wn.UserProperties = Class.extend({
if(!args) {
return;
}
wn.call({
return wn.call({
module: "core",
page: "user_properties",
method: "add",


+ 3
- 23
public/js/legacy/clientscriptAPI.js 查看文件

@@ -20,29 +20,9 @@
// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

// Client Side Scripting API
// ======================================================================================

$c_get_values = function(args, doc, dt, dn, user_callback) {
var call_back = function(r,rt) {
if(!r.message)return;
if(user_callback) user_callback(r.message);
var fl = args.fields.split(',');
for(var i in fl) {
locals[dt][dn][fl[i]] = r.message[fl[i]]; // set value
if(args.table_field)
refresh_field(fl[i], dn, args.table_field);
else
refresh_field(fl[i]);
}
}
$c('webnotes.widgets.form.utils.get_fields',args,call_back);
}

get_server_fields = function(method, arg, table_field, doc, dt, dn, allow_edit, call_back) {
wn.dom.freeze();
$c('runserverobj',
return $c('runserverobj',
args={'method':method,
'docs':wn.model.compress(make_doclist(doc.doctype, doc.name)),
'arg':arg
@@ -205,7 +185,7 @@ _f.Frm.prototype.toggle_display = function(fnames, show) {
}

_f.Frm.prototype.call_server = function(method, args, callback) {
$c_obj(cur_frm.get_doclist(), method, args, callback);
return $c_obj(cur_frm.get_doclist(), method, args, callback);
}

_f.Frm.prototype.get_files = function() {
@@ -270,7 +250,7 @@ _f.Frm.prototype.call = function(opts) {
}
}
wn.call(opts);
return wn.call(opts);
}

_f.Frm.prototype.get_field = function(field) {


+ 1
- 1
public/js/legacy/form.js 查看文件

@@ -611,7 +611,7 @@ _f.Frm.prototype.runscript = function(scriptname, callingfield, onrefresh) {
if(callingfield)
$(callingfield.input).set_working();

$c('runserverobj', {'docs':doclist, 'method':scriptname },
return $c('runserverobj', {'docs':doclist, 'method':scriptname },
function(r, rtxt) {
// run refresh
if(onrefresh)


+ 3
- 3
public/js/legacy/handler.js 查看文件

@@ -21,7 +21,7 @@
//

function $c(command, args, callback, error, no_spinner, freeze_msg, btn) {
wn.request.call({
return wn.request.call({
args: $.extend(args, {cmd: command}),
success: callback,
error: error,
@@ -46,7 +46,7 @@ function $c_obj(doclist, method, arg, callback, no_spinner, freeze_msg, btn) {
else
args.docs = wn.model.compress(doclist)
wn.request.call({
return wn.request.call({
args: args,
success: callback,
btn: btn,
@@ -58,7 +58,7 @@ function $c_obj(doclist, method, arg, callback, no_spinner, freeze_msg, btn) {
// For call a page metho
function $c_page(module, page, method, arg, callback, no_spinner, freeze_msg, btn) {
if(arg && typeof arg!='string') arg = JSON.stringify(arg);
wn.request.call({
return wn.request.call({
args: {
cmd: module+'.page.'+page+'.'+page+'.'+method,
arg: arg,


+ 3
- 3
public/js/wn/app.js 查看文件

@@ -23,7 +23,7 @@ wn.Application = Class.extend({
load_startup: function() {
var me = this;
if(window.app) {
wn.call({
return wn.call({
method: 'startup',
callback: function(r, rt) {
wn.provide('wn.boot');
@@ -109,7 +109,7 @@ wn.Application = Class.extend({
refresh_notifications: function() {
if(wn.session_alive) {
wn.call({
return wn.call({
method: "webnotes.widgets.notification.get",
callback: function(r) {
if(r.message) {
@@ -175,7 +175,7 @@ wn.Application = Class.extend({
logout: function() {
var me = this;
me.logged_out = true;
wn.call({
return wn.call({
method:'logout',
callback: function(r) {
if(r.exc) {


+ 1
- 1
public/js/wn/defaults.js 查看文件

@@ -24,7 +24,7 @@ wn.defaults = {
value = JSON.stringify(value);
wn.boot.profile.defaults[key] = value;
wn.call({
return wn.call({
method: "webnotes.client.set_default",
args: {
key: key,


+ 1
- 1
public/js/wn/form/assign_to.js 查看文件

@@ -118,7 +118,7 @@ wn.ui.form.AssignTo = Class.extend({
var assign_to = me.dialog.fields_dict.assign_to.get_value();
var args = me.dialog.get_values();
if(assign_to) {
wn.call({
return wn.call({
method:'webnotes.widgets.form.assign_to.add',
args: $.extend(args, {
doctype: me.frm.doctype,


+ 1
- 1
public/js/wn/form/attachments.js 查看文件

@@ -100,7 +100,7 @@ wn.ui.form.Attachments = Class.extend({
wn.confirm(wn._("Are you sure you want to delete the attachment?"),
function() {
var data = $(remove_btn).data("fileid");
wn.call({
return wn.call({
method: 'webnotes.widgets.form.utils.remove_attach',
args: {
fid: data,


+ 2
- 2
public/js/wn/form/comments.js 查看文件

@@ -78,7 +78,7 @@ wn.ui.form.Comments = Class.extend({
comment_by: user
};
wn.call({
return wn.call({
method: "webnotes.widgets.form.utils.add_comment",
args: {
doclist:[comment]
@@ -97,7 +97,7 @@ wn.ui.form.Comments = Class.extend({
},
delete_comment: function(name) {
var me = this;
wn.call({
return wn.call({
method: "webnotes.client.delete",
args: {
doctype: "Comment",


+ 7
- 2
public/js/wn/form/control.js 查看文件

@@ -619,7 +619,11 @@ wn.ui.form.ControlLink = wn.ui.form.ControlData.extend({
//this.bind_change_event();
var me = this;
this.$input.on("blur", function() {
if(me.doctype && me.docname && !me.autocomplete_open) {
if(me.selected) {
me.selected = false;
return;
}
if(me.doctype && me.docname) {
var value = me.get_value();
if(value!==me.last_value) {
me.parse_validate_and_set_in_model(value);
@@ -671,7 +675,7 @@ wn.ui.form.ControlLink = wn.ui.form.ControlData.extend({

me.set_custom_query(args);

wn.call({
return wn.call({
type: "GET",
method:'webnotes.widgets.search.search_link',
args: args,
@@ -693,6 +697,7 @@ wn.ui.form.ControlLink = wn.ui.form.ControlData.extend({
select: function(event, ui) {
me.autocomplete_open = false;
if(me.frm && me.frm.doc) {
me.selected = true;
me.parse_validate_and_set_in_model(ui.item.value);
} else {
me.$input.val(ui.item.value);


+ 1
- 1
public/js/wn/form/infobar.js 查看文件

@@ -110,7 +110,7 @@ wn.ui.form.InfoBar = Class.extend({
},
go_prev_next: function(prev) {
var me = this;
wn.call({
return wn.call({
method: "webnotes.widgets.form.utils.get_next",
args: {
doctype: me.frm.doctype,


+ 1
- 1
public/js/wn/form/link_selector.js 查看文件

@@ -67,7 +67,7 @@ wn.ui.form.LinkSelector = Class.extend({

this.target.set_custom_query(args);
wn.call({
return wn.call({
method: "webnotes.widgets.search.search_widget",
type: "GET",
args: args,


+ 9
- 5
public/js/wn/form/script_manager.js 查看文件

@@ -6,13 +6,17 @@ wn.ui.form.ScriptManager = Class.extend({
this.frm.cscript = $.extend(this.frm.cscript, new ControllerClass({frm: this.frm}));
},
trigger: function(event_name, doctype, name) {
var me = this;
doctype = doctype || this.frm.doctype;
name = name || this.frm.docname;
if(this.frm.cscript[event_name])
this.frm.cscript[event_name](this.frm.doc, doctype, name);
if(this.frm.cscript["custom_" + event_name])
if(this.frm.cscript[event_name]) {
$.when(this.frm.cscript[event_name](this.frm.doc, doctype, name)).then(function() {
if(me.frm.cscript["custom_" + event_name])
me.frm.cscript["custom_" + event_name](me.frm.doc, doctype, name);
});
} else if(this.frm.cscript["custom_" + event_name]) {
this.frm.cscript["custom_" + event_name](this.frm.doc, doctype, name);
}
},
setup: function() {
var doctype = this.frm.meta;
@@ -46,7 +50,7 @@ wn.ui.form.ScriptManager = Class.extend({
if(this.frm && this.frm.fetch_dict[df.fieldname])
fetch = this.frm.fetch_dict[df.fieldname].columns.join(', ');
wn.call({
return wn.call({
method:'webnotes.widgets.form.utils.validate_link',
type: "GET",
args: {


+ 1
- 1
public/js/wn/misc/tools.js 查看文件

@@ -111,7 +111,7 @@ wn.slickgrid_tools = {
$.each(grid.getColumns(), function(i, col) {
if(col.docfield && col.previousWidth != col.width &&
!in_list(wn.model.std_fields_list, col.docfield.fieldname) ) {
wn.call({
return wn.call({
method:"webnotes.client.make_width_property_setter",
args: {
doclist: [{


+ 2
- 2
public/js/wn/model/create_new.js 查看文件

@@ -129,7 +129,7 @@ $.extend(wn.model, {
},
open_mapped_doc: function(opts) {
wn.call({
return wn.call({
type: "GET",
method: opts.method,
args: {
@@ -151,7 +151,7 @@ $.extend(wn.model, {
}
}
var _map = function() {
wn.call({
return wn.call({
type: "GET",
method: opts.method,
args: {


+ 1
- 1
public/js/wn/model/doclist.js 查看文件

@@ -124,7 +124,7 @@ wn.model.DocList = Class.extend({
// btn: btn
// }
$(opts.btn).attr("disabled", true);
wn.call({
return wn.call({
freeze: true,
method: opts.method,
args: opts.args,


+ 4
- 4
public/js/wn/model/model.js 查看文件

@@ -67,7 +67,7 @@ $.extend(wn.model, {
var cached_doclist = JSON.parse(localStorage["_doctype:" + doctype]);
cached_timestamp = cached_doclist[0].modified;
}
wn.call({
return wn.call({
method:'webnotes.widgets.form.load.getdoctype',
type: "GET",
args: {
@@ -106,7 +106,7 @@ $.extend(wn.model, {
if(locals[doctype] && locals[doctype][name] && wn.model.get_docinfo(doctype, name)) {
callback(name);
} else {
wn.call({
return wn.call({
method: 'webnotes.widgets.form.load.getdoc',
type: "GET",
args: {
@@ -410,7 +410,7 @@ $.extend(wn.model, {
delete_doc: function(doctype, docname, callback) {
wn.confirm("Permanently delete "+ docname + "?", function() {
wn.call({
return wn.call({
method: 'webnotes.model.delete_doc',
args: {
dt:doctype,
@@ -441,7 +441,7 @@ $.extend(wn.model, {
var args = d.get_values();
if(!args) return;
d.get_input("rename").set_working();
wn.call({
return wn.call({
method:"webnotes.model.rename_doc.rename_doc",
args: {
doctype: doctype,


+ 2
- 2
public/js/wn/request.js 查看文件

@@ -51,7 +51,7 @@ wn.call = function(opts) {
}
}

wn.request.call({
return wn.request.call({
type: opts.type || "POST",
args: args,
success: opts.callback,
@@ -110,7 +110,7 @@ wn.request.call = function(opts) {
})
}
$.ajax(ajax_args);
return $.ajax(ajax_args);
}

// call execute serverside request


+ 1
- 1
public/js/wn/ui/listing.js 查看文件

@@ -229,7 +229,7 @@ wn.ui.Listing = Class.extend({
if(!me.opts.no_loading)
me.set_working(true);
wn.call({
return wn.call({
method: this.opts.method || 'webnotes.widgets.query_builder.runquery',
type: "GET",
args: this.get_call_args(),


+ 2
- 2
public/js/wn/ui/tags.js 查看文件

@@ -17,14 +17,14 @@ wn.ui.TagEditor = Class.extend({
placeholderText: 'Add Tag',
onTagAdded: function(ev, tag) {
if(me.initialized) {
wn.call({
return wn.call({
method: 'webnotes.widgets.tags.add_tag',
args: me.get_args(tag.find('.tagit-label').text())
});
}
},
onTagRemoved: function(ev, tag) {
wn.call({
return wn.call({
method: 'webnotes.widgets.tags.remove_tag',
args: me.get_args(tag.find('.tagit-label').text())
});


+ 1
- 1
public/js/wn/ui/toolbar/toolbar.js 查看文件

@@ -260,7 +260,7 @@ wn.ui.toolbar.clear_cache = function() {

wn.ui.toolbar.download_backup = function() {
msgprint(wn._("Your download is being built, this may take a few moments..."));
$c('webnotes.utils.backups.get_backup',{},function(r,rt) {});
return $c('webnotes.utils.backups.get_backup',{},function(r,rt) {});
return false;
}



+ 1
- 1
public/js/wn/ui/tree.js 查看文件

@@ -104,7 +104,7 @@ wn.ui.TreeNode = Class.extend({

$(me.$a).set_working();

wn.call({
return wn.call({
method: this.tree.method,
args: args,
callback: function(r) {


+ 1
- 1
public/js/wn/upload.js 查看文件

@@ -54,7 +54,7 @@ wn.upload = {
var _upload_file = function() {
var msgbox = msgprint(wn._("Uploading..."));
wn.call({
return wn.call({
"method": "uploadfile",
args: args,
callback: function(r) {


+ 2
- 2
public/js/wn/views/calendar.js 查看文件

@@ -92,7 +92,7 @@ wn.views.Calendar = Class.extend({
selectable: true,
selectHelper: true,
events: function(start, end, callback) {
wn.call({
return wn.call({
method: me.get_events_method || "webnotes.widgets.calendar.get_events",
type: "GET",
args: me.get_args(start, end),
@@ -180,7 +180,7 @@ wn.views.Calendar = Class.extend({
update_event: function(event, revertFunc) {
var me = this;
wn.model.remove_from_locals(me.doctype, event.name);
wn.call({
return wn.call({
method: me.update_event_method || "webnotes.widgets.calendar.update_event",
args: me.get_update_args(event),
callback: function(r) {


+ 2
- 2
public/js/wn/views/communication.js 查看文件

@@ -254,7 +254,7 @@ wn.views.CommunicationComposer = Class.extend({
var print_html = "";
}
wn.call({
return wn.call({
method:"core.doctype.communication.communication.make",
args: {
sender: [wn.user_info(user).fullname, wn.boot.profile.email],
@@ -331,7 +331,7 @@ wn.views.CommunicationComposer = Class.extend({
})
.autocomplete({
source: function(request, response) {
wn.call({
return wn.call({
method:'webnotes.utils.email_lib.get_contact_list',
args: {
'select': "email_id",


+ 1
- 1
public/js/wn/views/doclistview.js 查看文件

@@ -267,7 +267,7 @@ wn.views.DocListView = wn.ui.Listing.extend({
wn.confirm(wn._('This is permanent action and you cannot undo. Continue?'),
function() {
me.set_working(true);
wn.call({
return wn.call({
method: 'webnotes.widgets.reportview.delete_items',
args: {
items: $.map(dl, function(d, i) { return d.name }),


+ 1
- 1
public/js/wn/views/ganttview.js 查看文件

@@ -65,7 +65,7 @@ wn.views.Gantt = Class.extend({
.html('<div class="alert">Loading...</div>');
var me = this;
wn.call({
return wn.call({
method: this.get_events_method,
type: "GET",
args: {


+ 1
- 1
public/js/wn/views/grid_report.js 查看文件

@@ -8,7 +8,7 @@ $.extend(wn.report_dump, {
last_modified: {},
with_data: function(doctypes, callback, progress_bar) {
var pre_loaded = keys(wn.report_dump.last_modified);
wn.call({
return wn.call({
method: "webnotes.widgets.report_dump.get_data",
type: "GET",
args: {


+ 1
- 1
public/js/wn/views/moduleview.js 查看文件

@@ -194,7 +194,7 @@ wn.views.moduleview.ModuleView = Class.extend({
render_dynamic: function() {
// render reports
var me = this;
wn.call({
return wn.call({
method: "webnotes.widgets.moduleview.get_data",
args: {
module: me.module,


+ 1
- 1
public/js/wn/views/pageview.js 查看文件

@@ -23,7 +23,7 @@ wn.views.pageview = {
callback();
} else {
// get fresh
wn.call({
return wn.call({
method: 'webnotes.widgets.page.getpage',
args: {'name':name },
callback: function(r) {


+ 2
- 2
public/js/wn/views/query_report.js 查看文件

@@ -86,7 +86,7 @@ wn.views.QueryReport = Class.extend({
me.appframe.set_title(wn._("Query Report")+": " + me.report_name);
if(!wn.query_reports[me.report_name]) {
wn.call({
return wn.call({
method:"webnotes.widgets.query_report.get_script",
args: {
report_name: me.report_name
@@ -142,7 +142,7 @@ wn.views.QueryReport = Class.extend({
$.each(this.filters || [], function(i, f) {
filters[f.df.fieldname] = f.get_parsed_value();
})
wn.call({
return wn.call({
method: "webnotes.widgets.query_report.run",
args: {
"report_name": me.report_name,


+ 2
- 2
public/js/wn/views/reportview.js 查看文件

@@ -368,7 +368,7 @@ wn.views.ReportView = wn.ui.Listing.extend({
}
// callback
wn.call({
return wn.call({
method: 'webnotes.widgets.reportview.save_report',
args: {
name: name,
@@ -416,7 +416,7 @@ wn.views.ReportView = wn.ui.Listing.extend({
return;
if(wn.confirm(wn._("This is PERMANENT action and you cannot undo. Continue?"),
function() {
wn.call({
return wn.call({
method: 'webnotes.widgets.reportview.delete_items',
args: {
items: delete_list,


+ 1
- 1
public/js/wn/views/sidebar_stats.js 查看文件

@@ -17,7 +17,7 @@ wn.views.SidebarStats = Class.extend({
},
get_stats: function() {
var me = this
wn.call({
return wn.call({
type: "GET",
method: 'webnotes.widgets.reportview.get_stats',
args: {


Loading…
取消
儲存