diff --git a/utilities/doctype/address/address.py b/utilities/doctype/address/address.py index ae0f2177b6..243bbdd7e3 100644 --- a/utilities/doctype/address/address.py +++ b/utilities/doctype/address/address.py @@ -25,23 +25,19 @@ class DocType: self.doclist = doclist def autoname(self): - if self.doc.customer: - self.doc.name = self.doc.customer + '-' + self.doc.address_type - elif self.doc.supplier: - self.doc.name = self.doc.supplier + '-' + self.doc.address_type - elif self.doc.sales_partner: - self.doc.name = self.doc.sales_partner + '-' + self.doc.address_type - elif self.doc.address_title: - self.doc.address_title = self.doc.address_title + "-" + self.doc.address_type + if not self.doc.address_title: + self.doc.address_title = self.doc.customer or self.doc.supplier or self.doc.sales_partner + + if self.doc.address_title: + self.doc.name = self.doc.address_title + "-" + self.doc.address_type + + else: + webnotes.msgprint("""Address Title is mandatory.""", raise_exception=True) + def validate(self): - self.validate_for_whom() self.validate_primary_address() self.validate_shipping_address() - - def validate_for_whom(self): - if not (self.doc.customer or self.doc.supplier or self.doc.sales_partner): - msgprint("Please enter value in atleast one of customer, supplier and sales partner field", raise_exception=1) def validate_primary_address(self): """Validate that there can only be one primary address for particular customer, supplier""" diff --git a/utilities/doctype/address/address.txt b/utilities/doctype/address/address.txt index f77f3975b9..8ab6431948 100644 --- a/utilities/doctype/address/address.txt +++ b/utilities/doctype/address/address.txt @@ -4,7 +4,7 @@ "docstatus": 0, "creation": "2012-07-03 13:30:41", "modified_by": "Administrator", - "modified": "2012-12-27 11:31:37" + "modified": "2012-12-27 18:08:55" }, { "name": "__common__", @@ -55,6 +55,7 @@ "label": "Address Title", "fieldname": "address_title", "fieldtype": "Data", + "reqd": 1, "permlevel": 0 }, { @@ -214,60 +215,6 @@ "fieldtype": "Link", "permlevel": 0 }, - { - "create": 1, - "doctype": "DocPerm", - "write": 1, - "role": "System Manager", - "cancel": 1, - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "write": 1, - "role": "Sales Master Manager", - "cancel": 1, - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "write": 1, - "role": "Purchase Master Manager", - "cancel": 1, - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "write": 1, - "role": "Maintenance Manager", - "cancel": 0, - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "write": 1, - "role": "Accounts Manager", - "cancel": 0, - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "write": 1, - "role": "Sales Manager", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "write": 1, - "role": "Purchase Manager", - "permlevel": 0 - }, { "create": 1, "doctype": "DocPerm", diff --git a/website/doctype/about_us_settings/about_us_settings.txt b/website/doctype/about_us_settings/about_us_settings.txt index 9facfbb4a1..e0c1d4c2cc 100644 --- a/website/doctype/about_us_settings/about_us_settings.txt +++ b/website/doctype/about_us_settings/about_us_settings.txt @@ -4,7 +4,7 @@ "docstatus": 0, "creation": "2012-12-27 14:24:35", "modified_by": "Administrator", - "modified": "2012-12-27 15:51:11" + "modified": "2012-12-27 17:44:55" }, { "issingle": 1, @@ -38,6 +38,13 @@ "name": "About Us Settings", "doctype": "DocType" }, + { + "doctype": "DocField", + "label": "Help", + "fieldname": "help", + "fieldtype": "HTML", + "options": "
Static (content) web page.
Weblog (blog) entr.y
+Weblog (blog) entry.
Slideshows for adding in website pages.
@@ -23,6 +23,9 @@Settings for About Us Page.
+Settings for the Contact Us Page.
diff --git a/website/templates/js/contact.js b/website/templates/js/contact.js new file mode 100644 index 0000000000..f7310ad7e4 --- /dev/null +++ b/website/templates/js/contact.js @@ -0,0 +1,37 @@ +$(document).ready(function() { + + $('.btn-send').click(function() { + var email = $('[name="email"]').val(); + var message = $('[name="message"]').val(); + + if(!(email && message)) { + msgprint("Please enter both your email and message so that we \ + can get back to you. Thanks!"); + return false; + } + + if(!valid_email(email)) { + msgprint("You seem to have written your name instead of your email. \ + Please enter a valid email address so that we can get back."); + $('[name="email"]').focus(); + return false; + } + + $("#contact-alert").toggle(false); + erpnext.send_message({ + subject: $('[name="subject"]').val(), + sender: email, + message: message, + callback: function(r) { + msgprint(r.message); + $(':input').val(''); + } + }); + return false; + }); + +}); + +var msgprint = function(txt) { + if(txt) $("#contact-alert").html(txt).toggle(true); +} diff --git a/website/templates/pages/about.html b/website/templates/pages/about.html index f4b6e307f7..669aed944c 100644 --- a/website/templates/pages/about.html +++ b/website/templates/pages/about.html @@ -1,11 +1,13 @@ {% extends "html/page.html" %} +{% block title %} +About Us +{% endblock %} + {% block content %}
- |
- {{ d.employee_name }}- {{ d.bio }} |
+ {{ d.employee_name }}+{{ d.bio }} |