@@ -107,12 +107,12 @@ def set_lead_and_contact(d): | |||||
d.lead = webnotes.conn.get_value("Lead", {"email_id": email_addr[1]}, "name") or None | d.lead = webnotes.conn.get_value("Lead", {"email_id": email_addr[1]}, "name") or None | ||||
if not d.lead and not d.contact: | if not d.lead and not d.contact: | ||||
d.lead = make_lead(d, email_addr[0]) | |||||
d.lead = make_lead(d, email_addr[0], email_id[1]) | |||||
def make_lead(d, real_name): | |||||
def make_lead(d, real_name, email_id): | |||||
lead = webnotes.doc("Lead") | lead = webnotes.doc("Lead") | ||||
lead.lead_name = real_name or d.sender | |||||
lead.email_id = d.sender | |||||
lead.lead_name = real_name or email_id | |||||
lead.email_id = email_id | |||||
lead.source = "Email" | lead.source = "Email" | ||||
lead.save(1) | lead.save(1) | ||||
return lead.name | return lead.name | ||||
@@ -22,13 +22,23 @@ | |||||
// default print style | // default print style | ||||
_p.def_print_style_body = "html, body, div, span, td { \ | _p.def_print_style_body = "html, body, div, span, td { \ | ||||
font-family: Arial, Helvetica; font-size: 12px; }\ | |||||
pre { margin:0; padding:0;}" | |||||
font-family: Arial, Helvetica; \ | |||||
font-size: 10pt; \ | |||||
}\ | |||||
pre { margin:0; padding:0;}" | |||||
_p.def_print_style_other = "\n.simpletable, .noborder { \ | _p.def_print_style_other = "\n.simpletable, .noborder { \ | ||||
border-collapse: collapse; margin-bottom: 10px;}\ | |||||
.simpletable td {border: 1pt solid #777; vertical-align: top; padding: 4px; }\ | |||||
.noborder td { vertical-align: top; }" | |||||
border-collapse: collapse;\ | |||||
margin-bottom: 10px;\ | |||||
}\ | |||||
.simpletable td {\ | |||||
border: 1pt solid #777;\ | |||||
vertical-align: top;\ | |||||
padding: 4px;\ | |||||
}\ | |||||
.noborder td {\ | |||||
vertical-align: top;\ | |||||
}" | |||||
_p.go = function(html) { | _p.go = function(html) { | ||||
var d = document.createElement('div') | var d = document.createElement('div') | ||||
@@ -279,7 +289,6 @@ $.extend(_p, { | |||||
} | } | ||||
// Concatenate all styles | // Concatenate all styles | ||||
//style_concat = _p.def_print_style_other + args.style + body_style; | |||||
style_concat = (args.only_body ? '' : _p.def_print_style_body) | style_concat = (args.only_body ? '' : _p.def_print_style_body) | ||||
+ _p.def_print_style_other + args.style + body_style; | + _p.def_print_style_other + args.style + body_style; | ||||
@@ -186,6 +186,9 @@ def setup_options(): | |||||
metavar = "remote branch", | metavar = "remote branch", | ||||
help="git pull (both repos)") | help="git pull (both repos)") | ||||
parser.add_option("--commit", nargs=1, default=False, | |||||
metavar = "commit both repos", | |||||
help="git commit -a -m [comment]") | |||||
parser.add_option("--push", nargs=2, default=False, | parser.add_option("--push", nargs=2, default=False, | ||||
metavar = "remote branch", | metavar = "remote branch", | ||||
help="git push (both repos) [remote] [branch]") | help="git push (both repos) [remote] [branch]") | ||||
@@ -319,6 +322,12 @@ def run(): | |||||
if options.pull: | if options.pull: | ||||
pull(options.pull[0], options.pull[1], build=True) | pull(options.pull[0], options.pull[1], build=True) | ||||
elif options.commit: | |||||
os.chdir('lib') | |||||
os.system('git commit -a -m %s' % (options.commit[0])) | |||||
os.chdir('../app') | |||||
os.system('git commit -a -m %s' % (options.commit[0])) | |||||
elif options.push: | elif options.push: | ||||
os.chdir('lib') | os.chdir('lib') | ||||
os.system('git push %s %s' % (options.push[0], options.push[1])) | os.system('git push %s %s' % (options.push[0], options.push[1])) | ||||