|
|
@@ -29,8 +29,8 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { |
|
|
|
cur_frm.frm_head.status_area.innerHTML = |
|
|
|
'<span style="padding: 2px; background-color: rgb(0, 170, 17); \ |
|
|
|
color: rgb(255, 255, 255); font-weight: bold; margin-left: 0px; \ |
|
|
|
font-size: 11px;">Saved</span>' |
|
|
|
console.log(arguments); |
|
|
|
font-size: 11px;">Saved</span>'; |
|
|
|
//console.log(arguments); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
@@ -42,49 +42,49 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { |
|
|
|
}, 1); |
|
|
|
|
|
|
|
cur_frm.add_custom_button('Reset to defaults', function() { |
|
|
|
cur_frm.confirm('This will remove the customizations defined for this form.\n\n' |
|
|
|
+ 'Are you sure you want to reset to defaults?'); |
|
|
|
cur_frm.confirm('This will <b>remove the customizations</b> defined for this form.<br /><br />' |
|
|
|
+ 'Are you sure you want to <i>reset to defaults</i>?', doc, dt, dn); |
|
|
|
}, 1); |
|
|
|
} |
|
|
|
|
|
|
|
cur_frm.confirm = function(msg) { |
|
|
|
cur_frm.confirm = function(msg, doc, dt, dn) { |
|
|
|
var d = new wn.widgets.Dialog({ |
|
|
|
title: 'Reset To Defaults', |
|
|
|
width: 300, |
|
|
|
fields: [ |
|
|
|
{ |
|
|
|
fieldtype: 'HTML', |
|
|
|
label: 'Please Confirm', |
|
|
|
fieldname: 'msg' |
|
|
|
}, |
|
|
|
{ |
|
|
|
fieldtype: 'Button', |
|
|
|
label: 'Proceed', |
|
|
|
fieldname: 'btn_proceed' |
|
|
|
}, |
|
|
|
{ |
|
|
|
fieldtype: 'Button', |
|
|
|
label: 'Cancel', |
|
|
|
fieldname: 'btn_cancel' |
|
|
|
} |
|
|
|
] |
|
|
|
width: 500 |
|
|
|
}); |
|
|
|
//d.set_value('msg', msg); |
|
|
|
d.fields_dict.btn_proceed.input.onclick = function() { |
|
|
|
this.set_working(); |
|
|
|
|
|
|
|
$y(d.body, {padding: '32px', textAlign: 'center'}); |
|
|
|
|
|
|
|
$a(d.body, 'div', '', '', msg); |
|
|
|
|
|
|
|
var button_wrapper = $a(d.body, 'div'); |
|
|
|
$y(button_wrapper, {paddingTop: '15px'}); |
|
|
|
|
|
|
|
var proceed_btn = $btn(button_wrapper, 'Proceed', function() { |
|
|
|
$c_obj(make_doclist(dt, dn), 'delete', '', function(r, rt) { |
|
|
|
//console.log(arguments); |
|
|
|
if(r.exc) { |
|
|
|
msgprint(r.exc); |
|
|
|
} else { |
|
|
|
console.log(arguments); |
|
|
|
cur_frm.confirm.dialog.hide(); |
|
|
|
cur_frm.refresh(); |
|
|
|
cur_frm.frm_head.status_area.innerHTML = |
|
|
|
'<span style="padding: 2px; background-color: rgb(0, 170, 17); \ |
|
|
|
color: rgb(255, 255, 255); font-weight: bold; margin-left: 0px; \ |
|
|
|
font-size: 11px;">Saved</span>'; |
|
|
|
} |
|
|
|
}); |
|
|
|
this.done_working(); |
|
|
|
cur_frm.confirm_dialog.hide(); |
|
|
|
} |
|
|
|
d.fields_dict.btn_cancel.input.onclick = function() { |
|
|
|
}); |
|
|
|
|
|
|
|
$y(proceed_btn, {marginRight: '20px', fontWeight: 'bold'}); |
|
|
|
|
|
|
|
var cancel_btn = $btn(button_wrapper, 'Cancel', function() { |
|
|
|
cur_frm.confirm.dialog.hide(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
cancel_btn.className = 'cupid-green'; |
|
|
|
$y(cancel_btn, {fontWeight: 'bold'}); |
|
|
|
|
|
|
|
cur_frm.confirm.dialog = d; |
|
|
|
d.show(); |
|
|
|
} |