email settings separated from control panel

This commit is contained in:
Anand Doshi 2012-03-20 14:54:25 +05:30
parent 5dabfdd920
commit 8347aad402
2 changed files with 0 additions and 44 deletions

View File

@ -1,21 +0,0 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
cur_frm.cscript.refresh = function(doc,cdt,cdn){
if(!doc.outgoing_mail_server || !doc.mail_login || !doc.mail_password || !doc.auto_email_id || !doc.mail_port || !doc.use_ssl){
get_server_fields('set_vals','','',doc, cdt, cdn, 1);
}
}

View File

@ -23,21 +23,6 @@ class DocType:
def __init__(self,doc,doclist):
self.doc,self.doclist = doc,doclist
def set_vals(self):
res = sql("select field, value from `tabSingles` where doctype = 'Control Panel' and field IN ('outgoing_mail_server','mail_login','mail_password','auto_email_id','mail_port','use_ssl')")
ret = {}
for r in res:
ret[cstr(r[0])]=r[1] and cstr(r[1]) or ''
return ret
def set_cp_value(self, key):
"""
Update value in control panel
"""
webnotes.conn.set_value('Control Panel', None, key,
self.doc.fields.get(key))
def validate(self):
"""
Checks connectivity to email servers before saving
@ -113,11 +98,3 @@ class DocType:
except poplib.error_proto, e:
webnotes.msgprint('Invalid User Name or Support Password. Please rectify and try again.')
webnotes.msgprint(e)
def on_update(self):
"""
update control panel
"""
for f in ('outgoing_mail_server', 'mail_login', 'mail_password', 'auto_email_id', 'mail_port', 'use_ssl'):
self.set_cp_value(f)