Merge branch 'master' of github.com:webnotes/wnframework into production

This commit is contained in:
Nabin Hait 2012-12-14 13:21:43 +05:30
commit bbdeddce59
5 changed files with 30 additions and 3 deletions

View file

@ -32,6 +32,7 @@ mail_login = None
mail_password = None
mail_port = None
use_ssl = None
auto_email_id = None
# logging settings
log_file_name = 'logs/error_log.txt'

View file

@ -16,6 +16,10 @@ a {
Filter:alpha(opacity=100); /* For IE8 and earlier */
}
.navbar .brand {
max-height: 15px;
}
.navbar #spinner {
display: block;
float: right;

View file

@ -931,7 +931,7 @@ _f.Frm.prototype.savesubmit = function(btn) {
if(!r.exc && me.cscript.on_submit) {
me.runclientscript('on_submit', me.doctype, me.docname);
}
}, btn);
}, btn);
});
}
@ -966,6 +966,12 @@ _f.Frm.prototype.amend_doc = function() {
this.copy_doc(fn, 1);
}
_f.Frm.prototype.disable_save = function() {
cur_frm.save_disabled = true;
cur_frm.page_layout.footer.hide_save();
cur_frm.frm_head.appframe.buttons.Save.toggle(false);
}
_f.get_value = function(dt, dn, fn) {
if(locals[dt] && locals[dt][dn])
return locals[dt][dn][fn];

View file

@ -151,6 +151,16 @@ _f.Grid.prototype.set_column_disp = function(fieldname, show) {
this.reset_table_width();
}
_f.Grid.prototype.toggle_reqd = function(fieldname, reqd) {
// IMPORTANT: this should be called in refresh event
var grid_field = this.get_field(fieldname);
grid_field.df.reqd = reqd ? true : false;
grid_field.refresh();
$(grid_field.grid.head_row).find('[data-grid-fieldname="' + grid_field.grid.doctype
+ '-' + fieldname + '"]').css({ color: reqd ? "#D22" : "black" });
}
_f.Grid.prototype.append_row = function(idx, docname) {
if(!idx)idx = this.tab.rows.length;
var row = this.tab.insertRow(idx);

View file

@ -199,9 +199,15 @@ class EMail:
return email
if not self.sender:
# TODO: remove erpnext id
self.sender = webnotes.conn.get_value('Email Settings', None,
'auto_email_id') or getattr(conf, 'auto_email_id')
'auto_email_id') or getattr(conf, 'auto_email_id', None)
if not self.sender:
webnotes.msgprint("""Please specify 'Auto Email Id' \
in Setup > Email Settings""")
if not hasattr(conf, "expires_on"):
webnotes.msgprint("""Alternatively, \
you can also specify 'auto_email_id' in conf.py""")
raise webnotes.ValidationError
self.sender = _validate(self.sender)
self.reply_to = _validate(self.reply_to)