diff --git a/build.json b/build.json index 1628d240afc..0a63ee545ae 100644 --- a/build.json +++ b/build.json @@ -69,6 +69,7 @@ "lib/css/legacy/sidebar.css", "lib/css/Aristo/aristo.selected.css", "lib/css/ui/list.css", + "lib/css/ui/fonts.css", "lib/css/bootstrap/headings.css", "lib/css/bootstrap/buttons.css", "lib/css/bootstrap/navbar.css", @@ -140,7 +141,6 @@ "lib/js/wn/ui/dialog.js", "lib/js/wn/ui/button.js", "lib/js/legacy/widgets/dialog.js", - "lib/js/legacy/widgets/listing.js", "lib/js/legacy/widgets/layout.js", "lib/js/legacy/widgets/tabbedpage.js", "lib/js/legacy/webpage/page_header.js", @@ -159,7 +159,7 @@ "lib/js/legacy/model/doclist.js", "lib/js/wn/ui/toolbar.min.js:concat", "lib/js/legacy/widgets/form/fields.js", - "lib/js/legacy/widgets/form/form_container.js", + "lib/js/legacy/widgets/form/form_dialog.js", "lib/js/legacy/widgets/form/form_header.js", "lib/js/legacy/widgets/form/form.js", "lib/js/legacy/widgets/form/form_fields.js", diff --git a/css/all-app.css b/css/all-app.css index f394e30cc8e..7cf3d76d405 100644 --- a/css/all-app.css +++ b/css/all-app.css @@ -217,6 +217,7 @@ div.std-footer-item { box-shadow: 0px 0px 6px rgba(0,0,0,0.3); background-color: #fff; padding: 15px; + margin-bottom: 30px; } .layout-wrapper-background { @@ -229,7 +230,7 @@ div.std-footer-item { float: left; padding: 15px; background-color: #FFF; - min-height: 450px; + min-height: 600px; -moz-box-shadow: 7px 0px 6px -2px #ddd; -webkit-box-shadow: 7px 0px 6px -2px #ddd; box-shadow: 7px 0px 6px -2px #ddd; @@ -241,7 +242,7 @@ div.std-footer-item { color: #606060; overflow-x: hidden; padding: 15px; - min-height: 450px; + min-height: 600px; } /* from bootstrap */ @@ -1101,9 +1102,8 @@ div.psidebar div.section { } div.psidebar div.section-head { - font-size: 12px; padding: 5px 11px; - border-bottom: 2px solid #444; + border-bottom: 2px solid #777; } div.psidebar div.section-body { @@ -1739,6 +1739,23 @@ div.stat-bar { +/* + * lib/css/ui/fonts.css + */ +@font-face { + font-family: 'Pontano Sans'; + font-style: normal; + font-weight: 400; + src: url('../lib/css/fonts/pontanosans.woff') format('woff'); +} + +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: normal; + src: local('Droid Sans'), local('DroidSans'), url('../lib/css/fonts/droidsans.woff') format('woff'); +} + /* * lib/css/bootstrap/headings.css */ @@ -1808,6 +1825,7 @@ h6 { * lib/css/bootstrap/buttons.css */ .close { + font-family: Helvetica, Sans; float: right; font-size: 20px; font-weight: bold; diff --git a/css/all-web.css b/css/all-web.css index 05cb60c4ce7..d89dcadc84a 100644 --- a/css/all-web.css +++ b/css/all-web.css @@ -217,6 +217,7 @@ div.std-footer-item { box-shadow: 0px 0px 6px rgba(0,0,0,0.3); background-color: #fff; padding: 15px; + margin-bottom: 30px; } .layout-wrapper-background { @@ -229,7 +230,7 @@ div.std-footer-item { float: left; padding: 15px; background-color: #FFF; - min-height: 450px; + min-height: 600px; -moz-box-shadow: 7px 0px 6px -2px #ddd; -webkit-box-shadow: 7px 0px 6px -2px #ddd; box-shadow: 7px 0px 6px -2px #ddd; @@ -241,7 +242,7 @@ div.std-footer-item { color: #606060; overflow-x: hidden; padding: 15px; - min-height: 450px; + min-height: 600px; } /* from bootstrap */ @@ -490,6 +491,7 @@ h6 { * lib/css/bootstrap/buttons.css */ .close { + font-family: Helvetica, Sans; float: right; font-size: 20px; font-weight: bold; diff --git a/erpnext/buying/Module Def/Buying/Buying.txt b/erpnext/buying/Module Def/Buying/Buying.txt deleted file mode 100644 index 16cae81509b..00000000000 --- a/erpnext/buying/Module Def/Buying/Buying.txt +++ /dev/null @@ -1,155 +0,0 @@ -# Module Def, Buying -[ - - # These values are common in all dictionaries - { - 'creation': '2011-07-01 17:40:38', - 'docstatus': 0, - 'modified': '2012-01-10 17:52:19', - 'modified_by': 'Administrator', - 'owner': 'Administrator' - }, - - # These values are common for all Module Def Role - { - 'doctype': 'Module Def Role', - 'name': '__common__', - 'parent': 'Buying', - 'parentfield': 'roles', - 'parenttype': 'Module Def' - }, - - # These values are common for all Module Def Item - { - 'doctype': 'Module Def Item', - 'name': '__common__', - 'parent': 'Buying', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - - # These values are common for all Module Def - { - 'disabled': 'No', - 'doctype': u'Module Def', - 'doctype_list': 'DocType Mapper, Purchase Receipt-Payable Voucher\nDocType Mapper, Purchase Order-Payable Voucher\nDocType Mapper, Purchase Order-Purchase Receipt\nDocType Mapper, Indent-Purchase Order\nPrint Format, Purchase Order Format\nPrint Format, Purchase Receipt Format\nDocType Label, Indent', - 'file_list': 'scm.gif,FileData/00209', - 'is_hidden': 'No', - 'module_desc': '
All details about your Suppliers and past transactions
', - 'module_icon': 'Buying.gif', - 'module_label': 'Buying', - 'module_name': 'Buying', - 'module_seq': 4, - 'name': '__common__' - }, - - # Module Def, Buying - { - 'doctype': u'Module Def', - 'name': 'Buying' - }, - - # Module Def Item - { - 'description': 'Your Supplier Database', - 'display_name': 'Supplier', - 'doc_name': 'Supplier', - 'doc_type': 'Forms', - 'doctype': 'Module Def Item', - 'fields': 'id\nsupplier_type\nsupplier_status\ncompany' - }, - - # Module Def Item - { - 'description': 'Buy requests from various people in your company', - 'display_name': 'Indent', - 'doc_name': 'Indent', - 'doc_type': 'Forms', - 'doctype': 'Module Def Item', - 'fields': 'status\ntransaction_date\nsales_order_no\nremark' - }, - - # Module Def Item - { - 'description': 'Orders you have placed to your suppliers', - 'display_name': 'Purchase Order', - 'doc_name': 'Purchase Order', - 'doc_type': 'Forms', - 'doctype': 'Module Def Item', - 'fields': 'status\nsupplier\ntransaction_date\ngrand_total' - }, - - # Module Def Item - { - 'display_name': 'Itemwise Receipt Details', - 'doc_name': 'Purchase Receipt Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Purchase in Transit', - 'doc_name': 'PV Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Pending PO Items To Receive', - 'doc_name': 'PO Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Pending PO Items To Bill', - 'doc_name': 'PO Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Itemwise Purchase Details', - 'doc_name': 'PO Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'description': 'Ledger details of your creditors', - 'display_name': "Creditor's Ledger", - 'doc_name': 'GL Entry', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item', - 'icon': 'accept.gif' - }, - - # Module Def Role - { - 'doctype': 'Module Def Role', - 'role': 'Purchase User' - }, - - # Module Def Role - { - 'doctype': 'Module Def Role', - 'role': 'Purchase Manager' - }, - - # Module Def Role - { - 'doctype': 'Module Def Role', - 'role': 'Administrator' - }, - - # Module Def Role - { - 'doctype': 'Module Def Role', - 'role': 'Purchase Master Manager' - } -] \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js index 2ac62f2c114..ebf359362a0 100644 --- a/erpnext/buying/doctype/supplier/supplier.js +++ b/erpnext/buying/doctype/supplier/supplier.js @@ -58,15 +58,6 @@ cur_frm.cscript.make_address = function() { parent: cur_frm.fields_dict['Address HTML'].wrapper, page_length: 2, new_doctype: "Address", - new_doc_onload: function(dn) { - ndoc = locals["Address"][dn]; - ndoc.supplier = cur_frm.doc.name; - ndoc.supplier_name = cur_frm.doc.supplier_name; - ndoc.address_type = 'Office'; - }, - new_doc_onsave: function(dn) { - cur_frm.address_list.run() - }, get_query: function() { return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where supplier='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc" }, @@ -100,14 +91,6 @@ cur_frm.cscript.make_contact = function() { parent: cur_frm.fields_dict['Contact HTML'].wrapper, page_length: 2, new_doctype: "Contact", - new_doc_onload: function(dn) { - ndoc = locals["Contact"][dn]; - ndoc.supplier = cur_frm.doc.name; - ndoc.supplier_name = cur_frm.doc.supplier_name; - }, - new_doc_onsave: function(dn) { - cur_frm.contact_list.run() - }, get_query: function() { return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where supplier='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_contact desc" }, @@ -128,6 +111,7 @@ cur_frm.cscript.make_contact = function() { // make purchase order list cur_frm.cscript.make_po_list = function(parent, doc){ + wn.require('lib/js/legacy/widgets/listing.js'); var lst = new Listing(); lst.colwidths = ['5%','25%','20%','25%','25%']; lst.colnames = ['Sr.','Id','Status','PO Date','Grand Total']; @@ -142,6 +126,7 @@ cur_frm.cscript.make_po_list = function(parent, doc){ // make purchase receipt list cur_frm.cscript.make_pr_list = function(parent,doc){ + wn.require('lib/js/legacy/widgets/listing.js'); var lst = new Listing(); lst.colwidths = ['5%','20%','20%','20%','15%','20%']; lst.colnames = ['Sr.','Id','Status','Receipt Date','% Billed','Grand Total']; @@ -156,6 +141,7 @@ cur_frm.cscript.make_pr_list = function(parent,doc){ // make purchase invoice list cur_frm.cscript.make_pi_list = function(parent,doc){ + wn.require('lib/js/legacy/widgets/listing.js'); var lst = new Listing(); lst.colwidths = ['5%','20%','20%','20%','15%','20%']; lst.colnames = ['Sr.','Id','Posting Date','Credit To','Bill Date','Grand Total']; diff --git a/erpnext/home/page/desktop/desktop.css b/erpnext/home/page/desktop/desktop.css index cc6126e2001..874f11b2121 100644 --- a/erpnext/home/page/desktop/desktop.css +++ b/erpnext/home/page/desktop/desktop.css @@ -46,10 +46,10 @@ width: 56px; height: 56px; border: 4px solid white; - box-shadow: 0 0 10px 1px black; - -moz-box-shadow: 0 0 10px 1px black; - -webkit-box-shadow: 0 0 10px 1px black; - -o-box-shadow: 0 0 10px 1px black; + box-shadow: 0 0 4px 1px black; + -moz-box-shadow: 0 0 4px 1px black; + -webkit-box-shadow: 0 0 4px 1px black; + -o-box-shadow: 0 0 4px 1px black; margin: auto; } @@ -65,14 +65,14 @@ /*font-size: 12px;*/ padding-top: 10px; text-align: center; - text-shadow: 1px 1px 5px #000, 3px 3px 5px #000; + text-shadow: 0px 0px 3px #000, 0px 0px 3px #000, 0px 0px 2px #000; } /* Hover and click effects */ .case-border:hover, .circle:hover, .hover-effect { - box-shadow: 0 0 2px 0px black, 0 0 10px 1px white !important; - -moz-box-shadow: 0 0 2px 0px black, 0 0 10px 1px white !important; - -webkit-box-shadow: 0 0 2px 0px black, 0 0 10px 1px white !important; + box-shadow: 0 0 2px 0px black, 0 0 4px 1px white !important; + -moz-box-shadow: 0 0 2px 0px black, 0 0 4px 1px white !important; + -webkit-box-shadow: 0 0 2px 0px black, 0 0 4px 1px white !important; -o-box-shadow: 0 0 2px 0px black, 0 0 10px 1px white !important; } @@ -105,10 +105,10 @@ margin-top: -74px; margin-right: 10px; border: 2px solid white; - box-shadow: 0 0 10px 1px black; - -moz-box-shadow: 0 0 10px 1px black; - -webkit-box-shadow: 0 0 10px 1px black; - -o-box-shadow: 0 0 10px 1px black; + box-shadow: 0 0 4px 1px black; + -moz-box-shadow: 0 0 4px 1px black; + -webkit-box-shadow: 0 0 4px 1px black; + -o-box-shadow: 0 0 4px 1px black; } .circle-text { diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js index d6780771387..9f5f717e1f6 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -72,15 +72,6 @@ cur_frm.cscript.make_address = function() { parent: cur_frm.fields_dict['Address HTML'].wrapper, page_length: 2, new_doctype: "Address", - new_doc_onload: function(dn) { - ndoc = locals["Address"][dn]; - ndoc.customer = cur_frm.doc.name; - ndoc.customer_name = cur_frm.doc.customer_name; - ndoc.address_type = 'Office'; - }, - new_doc_onsave: function(dn) { - cur_frm.address_list.run() - }, get_query: function() { return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where customer='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc" }, @@ -114,17 +105,6 @@ cur_frm.cscript.make_contact = function() { parent: cur_frm.fields_dict['Contact HTML'].wrapper, page_length: 2, new_doctype: "Contact", - new_doc_onload: function(dn) { - ndoc = locals["Contact"][dn]; - ndoc.customer = cur_frm.doc.name; - ndoc.customer_name = cur_frm.doc.customer_name; - if(cur_frm.doc.customer_type == 'Individual') { - ndoc.first_name = cur_frm.doc.customer_name; - } - }, - new_doc_onsave: function(dn) { - cur_frm.contact_list.run() - }, get_query: function() { return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where customer='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_contact desc" }, @@ -174,6 +154,7 @@ cur_frm.fields_dict['lead_name'].get_query = function(doc,dt,dn){ // make quotation list // -------------------- cur_frm.cscript.make_qtn_list = function(parent,doc){ + wn.require('lib/js/legacy/widgets/listing.js'); var lst = new Listing(); lst.colwidths = ['5%','20%','20%','20%','20%','15%']; @@ -191,6 +172,8 @@ cur_frm.cscript.make_qtn_list = function(parent,doc){ // make so list // ------------- cur_frm.cscript.make_so_list = function(parent,doc){ + wn.require('lib/js/legacy/widgets/listing.js'); + var lst = new Listing(); lst.colwidths = ['5%','20%','20%','30%','25%']; lst.colnames = ['Sr.','Id','Status','Sales Order Date','Grand Total']; @@ -207,6 +190,8 @@ cur_frm.cscript.make_so_list = function(parent,doc){ // make dn list // ------------- cur_frm.cscript.make_dn_list = function(parent,doc){ + wn.require('lib/js/legacy/widgets/listing.js'); + var lst = new Listing(); lst.colwidths = ['5%','20%','20%','20%','20%','15%']; lst.colnames = ['Sr.','Id','Status','Delivery Note Date','Territory','Grand Total']; @@ -223,6 +208,8 @@ cur_frm.cscript.make_dn_list = function(parent,doc){ // make si list // ------------- cur_frm.cscript.make_si_list = function(parent,doc){ + wn.require('lib/js/legacy/widgets/listing.js'); + var lst = new Listing(); lst.colwidths = ['5%','20%','20%','20%','20%','15%']; lst.colnames = ['Sr.','Id','Posting Date','Due Date','Debit To','Grand Total']; diff --git a/erpnext/setup/doctype/contact_control/contact_control.js b/erpnext/setup/doctype/contact_control/contact_control.js index b6825ebdb6c..f58e75d9d99 100755 --- a/erpnext/setup/doctype/contact_control/contact_control.js +++ b/erpnext/setup/doctype/contact_control/contact_control.js @@ -1,14 +1,6 @@ // common partner functions // ========================= -/* -// make shipping list body -// ------------------------ -cur_frm.cscript.make_sl_body = function(){ - cur_frm.fields_dict['Shipping HTML'].wrapper.innerHTML = ''; - cur_frm.shipping_html = $a(cur_frm.fields_dict['Shipping HTML'].wrapper,'div'); -} -*/ // make history list body // ----------------------- @@ -18,35 +10,6 @@ cur_frm.cscript.make_hl_body = function(){ } -/* -// set shipping list message -// -------------------------- -cur_frm.cscript.set_sl_msg = function(doc){ - cur_frm.shipping_html.innerHTML = 'Shipping Address Details will appear only when you save the ' + doc.doctype.toLowerCase(); -} -*/ -/* -// set history list message -// ------------------------- -cur_frm.cscript.set_hl_msg = function(doc){ - cur_frm.history_html.innerHTML= 'History Details will appear only when you save the ' + doc.doctype.toLowerCase(); -} -*/ - - -/* -// make shipping address -// ------------- -cur_frm.cscript.make_shipping_address = function(doc, dt, dn){ - cur_frm.shipping_html.innerHTML = ''; - - var dsn = cur_frm.doc.customer_name; - var dsa = cur_frm.doc.address; - cl = new AddressList(cur_frm.shipping_html,dt,dn,dsn,dsa); -} -*/ - - // make history // ------------- cur_frm.cscript.make_history = function(doc,dt,dn){ @@ -157,406 +120,4 @@ if(cur_frm.fields_dict['territory']){ cur_frm.fields_dict['territory'].get_query = function(doc,dt,dn) { return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50'; } -} - - -// ======================================================================================================= - -// contact list -// -------------- -ContactList = function(parent,dt,dn,dsn){ - - var me = this; - - this.dt = dt; - this.dn = dn; - this.dsn = dsn ? dsn : dn; - - this.wrapper = $a(parent,'div'); - me.get_list(); -} - -// add contact -// ------------ -ContactList.prototype.add_contact = function(){ - var me = this; - - // onload - set default values - var cont = LocalDB.create('Contact'); - - var c = locals['Contact'][cont]; - - if(me.dt == 'Customer') { - c.is_customer = 1; - c.customer = me.dn; - c.customer_name = me.dsn; - } - else if(me.dt == 'Supplier'){ - c.is_supplier = 1; - c.supplier = me.dn; - c.supplier_name = me.dsn; - } - else if(me.dt == 'Sales Partner'){ - c.is_sales_partner = 1; - c.sales_partner = me.dn; - //c.sales_partner_name = me.dsn; - } - - loaddoc('Contact',c.name); -} - -// get contact list -// ----------------- -ContactList.prototype.get_list = function(){ - var me = this; - - me.make_list(); - - var dt = me.dt.toLowerCase().split(' ').join('_'); - - // build query - me.lst.get_query = function(){ - this.query = repl("select name, first_name, last_name, concat_ws(' ', first_name, last_name), email_id, contact_no, department, designation, is_primary_contact, has_login, disable_login from tabContact where %(dt)s = '%(dn)s' and docstatus != 2",{'dt':dt, 'dn':me.dn}); - - this.query_max = repl("select count(name) from tabContact where %(dt)s = '%(dn)s' and docstatus != 2",{'dt':dt, 'dn':me.dn}); - } - - // render list ui - me.lst.show_cell = function(cell,ri,ci,d){ - me.render_list(cell,ri,ci,d); - } - - // run query - me.lst.run(); - - // onrun - me.lst.onrun = function(){ - if(!this.has_data()){ - this.rec_label.innerHTML = ''; - - $a(this.rec_label,'span').innerHTML = "You do not have any contact. "; - $($a(this.rec_label,'span')).html('Add a new contact').addClass('link_type').click(function(){ me.add_contact(); }); - - $dh(this.results); - } - else{ - $ds(this.results); - } - } -} - -// make list -// ----------- -ContactList.prototype.make_list = function(){ - var me = this; - - var l = new Listing(); - l.colwidths = ['5%','30%','30%','20%','20%']; - l.colnames = ['Sr.','Contact Name','Email Id','Contact No', 'Action']; - l.page_len = 10; - - me.lst = l; - - l.make(me.wrapper); - - // Add contact button - me.add_btn = $btn(l.btn_area,'+ Add Contact', function(){ me.add_contact();}, {fontWeight:'bold'}); -} - -// make contact cell -// ------------------ -ContactList.prototype.render_list = function(cell,ri,ci,d){ - var me = this; - - // name - if(ci == 0){ - var nm = $a($a(cell,'div'),'span','',{cursor:'pointer'}); - nm.innerHTML = d[ri][3]; - nm.id = d[ri][0]; - - nm.onclick = function(){ - loaddoc('Contact', this.id); - - // on save callback - refresh list - } - - // department and designation - var des = d[ri][7] ? d[ri][7] : ''; - var dep = d[ri][6] ? d[ri][6] : ''; - - var sp = $a(cell,'div','comment'); - sp.innerHTML = des + (dep ? (', ' + dep) : ''); - } - - // email id, contact no, department, designation - // ----------------------------------------------------- - if(ci == 1) cell.innerHTML = d[ri][4] ? d[ri][4] : '-'; - if(ci == 2) cell.innerHTML = d[ri][5] ? d[ri][5] : '-'; - - // actions - // -------------------------------------- - if(ci== 3) me.make_actions(cell,ri,ci,d); -} - -// make actions -// --------------- -ContactList.prototype.make_actions = function(cell,ri,ci,d){ - var me = this; - - var tab = make_table(cell,1,2,'100%',['40%','60%']); - - // Edit and Delete - var t = make_table($td(tab,0,0),1,2); - - var edit = $a($td(t,0,0),'div','wn-icon ic-doc_edit'); - $(edit).click(function(){ loaddoc('Contact',d[ri][0]); }); - - edit.setAttribute('title','Edit'); - -// Below code should be uncommented once customer/venodr invitation process is stable -// =========================================================================== -/* - var del = $a($td(t,0,1),'div','wn-icon ic-trash'); - $(del).click(function(){ me.delete_contact(d[ri][0],d[ri][4]) }); - - set_custom_tooltip(del, 'Delete'); - - // Invite, Enable and Disable - Integrate after gateway logic incorporated - - if(d[ri][9] == 'Yes') { - if(d[ri][10] == 'Yes'){ - var enb = $a($td(tab,0,1),'div','wn-icon ic-checkmark'); - $(enb).click(function(){ me.enable_login(d[ri][0], d[ri][4]); }); - } - else{ - var dsb = $a($td(tab,0,1),'div','wn-icon ic-delete'); - $(dsb).click(function(){ me.disable_login(d[ri][0], d[ri][4]) }); - } - } - else{ - var inv = $a($td(tab,0,1),'div','wn-icon ic-mail'); - $(inv).click(function(){ me.invite_contact(d[ri][0], d[ri][4], d[ri][1], d[ri][2]) }); - }*/ -} - -// enable login -// ---------------------------------------------------------- -ContactList.prototype.enable_login = function(id, email_id){ - var me = this; - - var callback = function(r,rt){ - me.get_list(); - - if(!r.exc) msgprint('Login for contact enabled',1); - else errprint(r.exc); - } - - var args = {}; - args.contact = id; - args.email = email_id; - - $c_obj('Contact Control','enable_login',JSON.stringify(args),callback); -} - -// disable login -// ------------------------------------------------------------- -ContactList.prototype.disable_login = function(id, email_id){ - var me = this; - - var callback = function(r,rt){ - me.get_list(); - - if(!r.exc) msgprint('Login for contact disabled',1); - else errprint(r.exc); - } - - var args = {}; - args.contact = id; - args.email = email_id; - - $c_obj('Contact Control','disable_login',JSON.stringify(args),callback); -} - -// delete contact -// ----------------- -ContactList.prototype.delete_contact = function(id,email_id,has_login){ - var me = this; - - var callback = function(r,rt){ - me.get_list(); - - if(!r.exc) msgprint('Contact deleted successfully'); - else errprint(r.exc); - } - - var args = {}; - args.contact = id; - args.email = email_id; - args.has_login = has_login; - - $c_obj('Contact Control','delete_contact',JSON.stringify(args),callback); -} - -// invite user -// -------------------------------------------------------- -ContactList.prototype.invite_contact = function(id,email_id,first_name,last_name){ - var me = this; - - if(!email_id){ - msgprint("Please add email id and save the contact first. You can then invite contact to view transactions.") - } - else{ - var callback = function(r,rt){ - if(!r.exc) msgprint('Invitation sent'); - else errprint(r.exc); - } - - var args = { - 'contact' : id, - 'email' : email_id, - 'first_name' : first_name ? first_name : '', - 'last_name' : last_name ? last_name : '', - 'usert_type' : 'Partner' - }; - - $c_obj('Contact Control','invite_contact',JSON.stringify(args),callback); - } -} - - -// address list -// -------------- -AddressList = function(parent,dt,dn,dsn,dsa){ - - var me = this; - - this.dt = dt; - this.dn = dn; - this.dsn = dsn ? dsn : dn; - this.dsa = dsa ? dsa : ''; - - this.wrapper = $a(parent,'div'); - me.get_addr_list(); -} - - -// add contact -// ------------ -AddressList.prototype.add_address = function(){ - var me = this; - - // onload - set default values - var addr = LocalDB.create('Shipping Address'); - - var a = locals['Shipping Address'][addr]; - - a.customer = me.dn; - a.customer_name = me.dsn; - a.customer_address = me.dsa; - loaddoc('Shipping Address',a.name); -} - - -// get address list -// ----------------- -AddressList.prototype.get_addr_list = function(){ - var me = this; - - me.make_addr_list(); - - var dt = me.dt.toLowerCase().split(' ').join('_'); - - // build query - me.lst.get_query = function(){ - this.query = repl("select name, ship_to, shipping_address, is_primary_address, shipping_details from `tabShipping Address` where %(dt)s = '%(dn)s' and docstatus != 2",{'dt':dt, 'dn':me.dn}); - - this.query_max = repl("select count(name) from `tabShipping Address` where %(dt)s = '%(dn)s'",{'dt':dt, 'dn':me.dn}); - } - - // render list ui - me.lst.show_cell = function(cell,ri,ci,d){ - me.render_list(cell,ri,ci,d); - } - - // run query - me.lst.run(); - - // onrun - me.lst.onrun = function(){ - if(!this.has_data()){ - this.rec_label.innerHTML = ''; - - $a(this.rec_label,'span').innerHTML = "You do not have any shipping address."; - $($a(this.rec_label,'span')).html('Add a new address').addClass('link_type').click(function(){ me.add_address(); }); - - $dh(this.results); - } - else{ - $ds(this.results); - } - } -} - - -// make list -// ----------- -AddressList.prototype.make_addr_list = function(){ - var me = this; - - var l = new Listing(); - l.colwidths = ['5%', '15%', '25%','10%','35%','10%']; - l.colnames = ['Sr.', 'Ship To', 'Shipping Address','Primary Address', 'Shipping Details', 'Action']; - l.page_len = 10; - - me.lst = l; - - l.make(me.wrapper); - - // Add address button - me.add_btn = $btn(l.btn_area,'+ Add Address', function(){ me.add_address();}, {fontWeight:'bold'}); -} - - - -// make address cell -// ------------------ -AddressList.prototype.render_list = function(cell,ri,ci,d){ - var me = this; - - // name - if(ci == 0){ - var nm = $a($a(cell,'div'),'span','',{cursor:'pointer'}); - nm.innerHTML = d[ri][1]; - nm.id = d[ri][0]; - - nm.onclick = function(){ - loaddoc('Shipping Address', this.id); - } - } - - // shipping address, primary address, shipping details - // ---------------------------------------------------- - if(ci == 1) cell.innerHTML = d[ri][2] ? d[ri][2] : '-'; - if(ci == 2) cell.innerHTML = d[ri][3] ? d[ri][3] : '-'; - if(ci == 3) cell.innerHTML = d[ri][4] ? d[ri][4] : '-'; - - // actions - // -------------------------------------- - if(ci== 4) me.make_actions(cell,ri,ci,d); -} - -// make actions -// --------------- -AddressList.prototype.make_actions = function(cell,ri,ci,d){ - var me = this; - - var tab = make_table(cell,1,2,'100%',['40%','60%']); - - // Edit and Delete - var t = make_table($td(tab,0,0),1,2); - - var edit = $a($td(t,0,0),'div','wn-icon ic-doc_edit'); - $(edit).click(function(){ loaddoc('Shipping Address',d[ri][0]); }); - - edit.setAttribute('title','Edit'); -} +} \ No newline at end of file diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.js b/erpnext/setup/doctype/sales_partner/sales_partner.js index 0c315f62705..30ab18a324c 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.js +++ b/erpnext/setup/doctype/sales_partner/sales_partner.js @@ -51,15 +51,7 @@ cur_frm.cscript.make_address = function() { cur_frm.address_list = new wn.ui.Listing({ parent: cur_frm.fields_dict['Address HTML'].wrapper, page_length: 2, - new_doctype: "Address", - new_doc_onload: function(dn) { - ndoc = locals["Address"][dn]; - ndoc.sales_partner = cur_frm.doc.name; - ndoc.address_type = 'Office'; - }, - new_doc_onsave: function(dn) { - cur_frm.address_list.run() - }, + new_doctype: "Address", get_query: function() { return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where sales_partner='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc" }, @@ -84,13 +76,6 @@ cur_frm.cscript.make_contact = function() { parent: cur_frm.fields_dict['Contact HTML'].wrapper, page_length: 2, new_doctype: "Contact", - new_doc_onload: function(dn) { - ndoc = locals["Contact"][dn]; - ndoc.sales_partner = cur_frm.doc.name; - }, - new_doc_onsave: function(dn) { - cur_frm.contact_list.run() - }, get_query: function() { return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where sales_partner='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_contact desc" }, diff --git a/erpnext/utilities/doctype/address/address.js b/erpnext/utilities/doctype/address/address.js index fc274ef8da9..f607d51afbb 100644 --- a/erpnext/utilities/doctype/address/address.js +++ b/erpnext/utilities/doctype/address/address.js @@ -17,5 +17,28 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { if(doc.customer) cur_frm.add_fetch('customer', 'customer_name', 'customer_name'); if(doc.supplier) cur_frm.add_fetch('supplier', 'supplier_name', 'supplier_name'); + + var route = wn.get_route(); + if(route[1]=='Supplier') { + var supplier = locals.Supplier[route[2]] + doc.supplier = supplier.name; + doc.supplier_name = supplier.supplier_name; + doc.address_type = 'Office'; + } else if(route[1]=='Customer') { + var customer = locals.Customer[route[2]] + doc.supplier = customer.name; + doc.customer_name = customer.customer_name; + doc.address_type = 'Office'; + } else if(route[1]=='Sales Partner') { + var sp = locals['Sales Partner'][route[2]]; + doc.sales_partner = sp.name; + ndoc.address_type = 'Office'; + } } +cur_frm.cscript.hide_dialog = function() { + var route = wn.get_route(); + cur_frm.address_list.run(); +} + + diff --git a/erpnext/utilities/doctype/contact/contact.js b/erpnext/utilities/doctype/contact/contact.js index 2aa89c1bec1..3cbc1de7a55 100644 --- a/erpnext/utilities/doctype/contact/contact.js +++ b/erpnext/utilities/doctype/contact/contact.js @@ -18,54 +18,28 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { if(doc.customer) cur_frm.add_fetch('customer', 'customer_name', 'customer_name'); if(doc.supplier) cur_frm.add_fetch('supplier', 'supplier_name', 'supplier_name'); -} -/* -//---------- on refresh ---------------------- -cur_frm.cscript.refresh = function(doc,cdt,cdn){ - -} - - -//------------- Trigger on customer --------------------- -cur_frm.cscript.is_customer = function(doc,cdt,cdn){ - if(!doc.is_customer){ - doc.customer = doc.customer_name = doc.customer_address = doc.customer_group = ''; - refresh_many(['customer','customer_name','customer_address','customer_group']); + var route = wn.get_route(); + if(route[1]=='Supplier') { + var supplier = locals.Supplier[route[2]] + doc.supplier = supplier.name; + doc.supplier_name = supplier.supplier_name; + } else if(route[1]=='Customer') { + var customer = locals.Customer[route[2]]; + doc.customer = customer.name; + doc.customer_name = customer.customer_name; + if(customer.customer_type == 'Individual') { + doc.first_name = customer.customer_name; + } + } else if(route[1]=='Sales Partner') { + var sp = locals['Sales Partner'][route[2]]; + doc.sales_partner = sp.name; } } -//------------- Trigger on supplier ----------------------- -cur_frm.cscript.is_supplier = function(doc,cdt,cdn){ - if(!doc.is_supplier){ - doc.supplier = doc.supplier_name = doc.supplier_address = doc.supplier_type = ''; - refresh_many(['supplier','supplier_address','supplier_name','supplier_type']); - } -} - -//--------------- Trigger on sales partner --------------------- -cur_frm.cscript.is_sales_partner = function(doc,cdt,cdn){ - if(!doc.is_sales_partner){ - doc.sales_partner = doc.sales_partner_address = doc.partner_type = ''; - refresh_many(['sales_partner','sales_partner_address','partner_type']); - } +cur_frm.cscript.hide_dialog = function() { + var route = wn.get_route(); + cur_frm.contact_list.run(); } -//----------- Trigger on supplier name ------------------------ -cur_frm.cscript.supplier = function(doc,cdt,cdn){ - arg = {'dt':'Supplier','dn':doc.supplier,'nm':'supplier_name','fld':'supplier_address','type':'supplier_type'}; - get_server_fields('get_address',docstring(arg),'',doc,cdt,cdn,1); -} -//------------ Trigger on customer name ------------------------ -cur_frm.cscript.customer = function(doc,cdt,cdn){ - arg = {'dt':'Customer','dn':doc.customer,'nm':'customer_name','fld':'customer_address','type':'customer_group'}; - get_server_fields('get_address',docstring(arg),'',doc,cdt,cdn,1); -} - -//------------ Trigger on sales partner ------------------------ -cur_frm.cscript.sales_partner = function(doc,cdt,cdn){ - arg = {'dt':'Sales Partner','dn':doc.sales_partner,'nm':'partner_name','fld':'sales_partner_address','type':'partner_type'}; - get_server_fields('get_address',docstring(arg),'',doc,cdt,cdn,1); -} -*/ diff --git a/erpnext/utilities/page/calendar/calendar.js b/erpnext/utilities/page/calendar/calendar.js index ac1ac8837b8..9aa5df87dc3 100644 --- a/erpnext/utilities/page/calendar/calendar.js +++ b/erpnext/utilities/page/calendar/calendar.js @@ -24,7 +24,11 @@ pscript.onload_calendar = function(wrapper) { if(!erpnext.calendar) { erpnext.calendar = new Calendar(); erpnext.calendar.init(wrapper); - rename_observers.push(erpnext.calendar); + + var me = this; + $(document).bind('rename', function(event, dt, old_name, new_name) { + erpnext.calendar.rename_notify(dt, old_name, new_name) + }); } } @@ -63,7 +67,7 @@ Calendar.prototype.init=function (parent) { Calendar.prototype.rename_notify = function(dt, old_name, new_name) { // calendar - if(dt = 'Event'){ + if(dt = 'Event'){ if(this.events_by_name[old_name]) { delete this.events_by_name[old_name]; } diff --git a/erpnext/website/doctype/style_settings/custom_template.css b/erpnext/website/doctype/style_settings/custom_template.css index 8eb3d6396f5..28515bf6a57 100644 --- a/erpnext/website/doctype/style_settings/custom_template.css +++ b/erpnext/website/doctype/style_settings/custom_template.css @@ -5,7 +5,7 @@ body { background-color: #{{ doc.background_color }}; {% endif %} {% if doc.font %} - font-family: {{ doc.font }} !important; + font-family: '{{ doc.font }}', Verdana, Sans !important; {% endif %} {% if doc.font_size %} font-size: {{ doc.font_size }} !important; @@ -26,6 +26,6 @@ footer a, footer a:visited, footer a:hover { {% if doc.heading_font %} h1, h2, h3, h4, h5 { - font-family: {{ doc.heading_font}} !important; + font-family: '{{ doc.heading_font}}', Arial, 'Helvetica Neue' !important; } {% endif %} diff --git a/erpnext/website/doctype/style_settings/style_settings.txt b/erpnext/website/doctype/style_settings/style_settings.txt index f07a9479ca1..134237af5cd 100644 --- a/erpnext/website/doctype/style_settings/style_settings.txt +++ b/erpnext/website/doctype/style_settings/style_settings.txt @@ -5,150 +5,150 @@ { 'creation': '2012-02-02 09:57:25', 'docstatus': 0, - 'modified': '2012-02-02 10:47:38', - 'modified_by': 'Administrator', - 'owner': 'Administrator' + 'modified': '2012-03-20 11:25:05', + 'modified_by': u'Administrator', + 'owner': u'Administrator' }, # These values are common for all DocType { - '_last_update': '1328159294', + '_last_update': u'1330594969', 'allow_attach': 1, - 'colour': 'White:FFF', - 'description': 'Set your background color, font and image (tiled)', + 'colour': u'White:FFF', + 'description': u'Set your background color, font and image (tiled)', 'doctype': 'DocType', 'issingle': 1, 'max_attachments': 1, - 'module': 'Website', + 'module': u'Website', 'name': '__common__', - 'section_style': 'Simple', + 'section_style': u'Simple', 'show_in_menu': 0, - 'version': 9 + 'version': 14 }, # These values are common for all DocField { - 'doctype': 'DocField', + 'doctype': u'DocField', 'name': '__common__', - 'parent': 'Style Settings', - 'parentfield': 'fields', - 'parenttype': 'DocType' + 'parent': u'Style Settings', + 'parentfield': u'fields', + 'parenttype': u'DocType' }, # These values are common for all DocPerm { - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'name': '__common__', - 'parent': 'Style Settings', - 'parentfield': 'permissions', - 'parenttype': 'DocType', + 'parent': u'Style Settings', + 'parentfield': u'permissions', + 'parenttype': u'DocType', 'read': 1, - 'role': 'Website Manager' + 'role': u'Website Manager' }, # DocType, Style Settings { 'doctype': 'DocType', - 'name': 'Style Settings' + 'name': u'Style Settings' }, # DocPerm { 'create': 1, - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'permlevel': 0, 'write': 1 }, # DocPerm { - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'permlevel': 1 }, # DocField { - 'colour': 'White:FFF', - 'description': 'Solid background color (default light gray)', - 'doctype': 'DocField', - 'fieldname': 'background_color', - 'fieldtype': 'Data', - 'label': 'Background Color', + 'colour': u'White:FFF', + 'description': u'Solid background color (default light gray)', + 'doctype': u'DocField', + 'fieldname': u'background_color', + 'fieldtype': u'Data', + 'label': u'Background Color', 'permlevel': 0 }, # DocField { - 'colour': 'White:FFF', - 'description': 'If image is selected, color will be ignored (attach first)', - 'doctype': 'DocField', - 'fieldname': 'background_image', - 'fieldtype': 'Select', - 'label': 'Background Image', - 'options': 'attach_files:', + 'colour': u'White:FFF', + 'description': u'If image is selected, color will be ignored (attach first)', + 'doctype': u'DocField', + 'fieldname': u'background_image', + 'fieldtype': u'Select', + 'label': u'Background Image', + 'options': u'attach_files:', 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'font', - 'fieldtype': 'Select', - 'label': 'Font', - 'options': '\nLucida Grande\nVerdana\nArial\nGeorgia\nTahoma', + 'doctype': u'DocField', + 'fieldname': u'font', + 'fieldtype': u'Select', + 'label': u'Font', + 'options': u'\nLucida Grande\nVerdana\nArial\nGeorgia\nTahoma\nPontano Sans\nDroid Sans\nGill Sans', 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'font_size', - 'fieldtype': 'Select', - 'label': 'Font Size', - 'options': '\n12px\n13px\n14px', + 'doctype': u'DocField', + 'fieldname': u'font_size', + 'fieldtype': u'Select', + 'label': u'Font Size', + 'options': u'\n12px\n13px\n14px', 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'heading_font', - 'fieldtype': 'Select', - 'label': 'Heaing Font', - 'options': '\nLucida Grande\nVerdana\nArial\nGeorgia\nTahoma', + 'doctype': u'DocField', + 'fieldname': u'heading_font', + 'fieldtype': u'Select', + 'label': u'Heading Font', + 'options': u'\nLucida Grande\nVerdana\nArial\nGeorgia\nTahoma\nPontano Sans\nDroid Sans\nGill Sans', 'permlevel': 0 }, # DocField { - 'colour': 'White:FFF', - 'description': 'Select a white footer foreground color if you have a dark background', - 'doctype': 'DocField', - 'fieldname': 'footer_font_color', - 'fieldtype': 'Select', - 'label': 'Footer Font Color', - 'options': '\nwhite', + 'colour': u'White:FFF', + 'description': u'Select a white footer foreground color if you have a dark background', + 'doctype': u'DocField', + 'fieldname': u'footer_font_color', + 'fieldtype': u'Select', + 'label': u'Footer Font Color', + 'options': u'\nwhite', 'permlevel': 0 }, # DocField { - 'colour': 'White:FFF', - 'description': 'Auto generated', - 'doctype': 'DocField', - 'fieldname': 'custom_css', - 'fieldtype': 'Code', - 'label': 'Custom CSS', + 'colour': u'White:FFF', + 'description': u'Auto generated', + 'doctype': u'DocField', + 'fieldname': u'custom_css', + 'fieldtype': u'Code', + 'label': u'Custom CSS', 'permlevel': 1 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'file_list', - 'fieldtype': 'Text', + 'doctype': u'DocField', + 'fieldname': u'file_list', + 'fieldtype': u'Text', 'hidden': 1, - 'label': 'File List', + 'label': u'File List', 'no_copy': 1, 'permlevel': 0, 'print_hide': 1 diff --git a/js/all-app.js b/js/all-app.js index 0b8d75aa811..20214bd75b3 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -185,7 +185,7 @@ wn.get_cookie=function(c){var t=""+document.cookie;var ind=t.indexOf(c);if(ind== /* * lib/js/wn/model.js */ -wn.provide('wn.model');wn.model={no_value_type:['Section Break','Column Break','HTML','Table','Button','Image'],with_doctype:function(doctype,callback){if(locals.DocType[doctype]){callback();}else{wn.call({method:'webnotes.widgets.form.load.getdoctype',args:{doctype:doctype},callback:callback});}},with_doc:function(doctype,name,callback){if(!name)name=doctype;if(locals[doctype]&&locals[doctype][name]){callback(name);}else{if(name&&name.indexOf('New '+doctype)!=-1){name=LocalDB.create(doctype);callback(name);}else{wn.call({method:'webnotes.widgets.form.load.getdoc',args:{doctype:doctype,name:name},callback:function(r){callback(name);}});}}},can_delete:function(doctype){if(!doctype)return false;return locals.DocType[doctype].allow_trash&&wn.boot.profile.can_cancel.indexOf(doctype)!=-1;}} +wn.provide('wn.model');wn.model={no_value_type:['Section Break','Column Break','HTML','Table','Button','Image'],new_names:{},with_doctype:function(doctype,callback){if(locals.DocType[doctype]){callback();}else{wn.call({method:'webnotes.widgets.form.load.getdoctype',args:{doctype:doctype},callback:callback});}},with_doc:function(doctype,name,callback){if(!name)name=doctype;if(locals[doctype]&&locals[doctype][name]){callback(name);}else{if(name&&name.indexOf('New '+doctype)!=-1){name=LocalDB.create(doctype);callback(name);}else{wn.call({method:'webnotes.widgets.form.load.getdoc',args:{doctype:doctype,name:name},callback:function(r){callback(name);}});}}},can_delete:function(doctype){if(!doctype)return false;return locals.DocType[doctype].allow_trash&&wn.boot.profile.can_cancel.indexOf(doctype)!=-1;}} /* * lib/js/wn/misc/user.js */ @@ -232,7 +232,7 @@ wn.route=function(){wn._cur_route=window.location.hash;route=wn.get_route();swit wn.views.formview.show(route[1],route[2]);break;case"Report":wn.views.reportview.show(route[1],route[2]);break;default:wn.views.pageview.show(route[0]);}} wn.get_route=function(route){if(!route) route=window.location.hash;if(route.substr(0,1)=='#')route=route.substr(1);if(route.substr(0,1)=='!')route=route.substr(1);return $.map(route.split('/'),function(r){return decodeURIComponent(r);});} -wn.set_route=function(route){window.location.hash=route;} +wn.set_route=function(){route=$.map(arguments,function(a){return encodeURIComponent(a)}).join('/');window.location.hash=route;} wn._cur_route=null;$(window).bind('hashchange',function(){if(location.hash==wn._cur_route) return;wn.route();if(wn.boot.analytics_code){try{eval(wn.boot.analytics_code);}catch(e){console.log(e);}}}); /* @@ -281,7 +281,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\ \ \ ',this.opts));this.$w=$(this.parent).find('.wnlist');this.set_events();this.make_filters();},add_button:function(html,onclick,before){$(html).click(onclick).insertBefore(this.$w.find('.list-toolbar '+before));this.btn_groupify();},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-refresh').click(function(){me.run();});this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);} -if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype,me.new_doc_onload,true,me.new_doc_onsave);})}else{this.$w.find('.btn-new').remove();} +if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype);})}else{this.$w.find('.btn-new').remove();} if(!me.show_filters){this.$w.find('.btn-filter').remove();} if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').remove();} this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns>1){this.$w.find('.list-toolbar').addClass('btn-group')} @@ -407,7 +407,8 @@ if(me.wrapper[event]){me.wrapper[event](me.wrapper);}}catch(e){console.log(e);}} /* * lib/js/wn/views/formview.js */ -wn.provide('wn.views.formview');wn.views.formview={show:function(dt,dn){wn.model.with_doctype(dt,function(){wn.model.with_doc(dt,dn,function(dn){if(!wn.views.formview[dt]){wn.views.formview[dt]=wn.container.add_page('Form - '+dt);wn.views.formview[dt].frm=new _f.Frm(dt,wn.views.formview[dt]);} +wn.provide('wn.views.formview');wn.views.formview={show:function(dt,dn){if(wn.model.new_names[dn]) +dn=wn.model.new_names[dn];wn.model.with_doctype(dt,function(){wn.model.with_doc(dt,dn,function(dn){if(!wn.views.formview[dt]){wn.views.formview[dt]=wn.container.add_page('Form - '+dt);wn.views.formview[dt].frm=new _f.Frm(dt,wn.views.formview[dt]);} wn.container.change_to('Form - '+dt);wn.views.formview[dt].frm.refresh(dn);});})}} /* * lib/js/wn/views/reportview.js @@ -961,100 +962,6 @@ else if(d[0]=='Text'){c1.innerHTML=d[1];c2.style.overflow='auto';this.widgets[d[ else if(d[0]=='Button'){c2.style.height='32px';var b=$btn(c2,d[1],function(btn){if(btn._onclick)btn._onclick(me)},null,null,1);b.dialog=me;if(!this.first_button){$(b).addClass('btn-info');this.first_button=true;} if(d[2]){b._onclick=d[2];} this.widgets[d[1]]=b;}} -/* - * lib/js/legacy/widgets/listing.js - */ -list_opts={cell_style:{padding:'3px 2px'},alt_cell_style:{},head_style:{height:'20px',overflow:'hidden',verticalAlign:'middle',fontWeight:'bold',padding:'1px',fontSize:'13px'},head_main_style:{padding:'0px'},hide_export:1,hide_print:1,hide_refresh:0,hide_rec_label:0,show_calc:1,show_empty_tab:0,no_border:1,append_records:1,table_width:null};function Listing(head_text,no_index,no_loading){this.start=0;this.page_len=20;this.filters_per_line=7;this.cell_idx=0;this.head_text=head_text?head_text:'Result';this.keyword='records';this.no_index=no_index;this.underline=1;this.no_rec_message='No Result';this.show_cell=null;this.show_result=null;this.colnames=null;this.colwidths=null;this.coltypes=null;this.coloptions=null;this.filters={};this.sort_list={};this.sort_order_dict={};this.sort_heads={};this.is_std_query=false;this.server_call=null;this.no_loading=no_loading;this.opts=copy_dict(list_opts);} -Listing.prototype.make=function(parent){var me=this;this.wrapper=parent;this.filter_wrapper=$a(parent,'div','srs_filter_wrapper');this.filter_area=$a(this.filter_wrapper,'div','srs_filter_area');$dh(this.filter_wrapper);this.btn_area=$a(parent,'div','',{margin:'8px 0px'});this.body_area=$a(parent,'div','srs_body_area');if(!this.opts.hide_rec_label) -this.rec_label=$a(this.body_area,'div','',{margin:'4px 0px',color:'#888'});this.results=$a($a(this.body_area,'div','srs_results_area'),'div');this.fetching_area=$a(this.body_area,'div','',{height:'120px',background:'url("lib/images/ui/square_loading.gif") center no-repeat',display:'none'});this.show_no_records=$a(this.body_area,'div','',{margin:'200px 0px',textAlign:'center',fontSize:'14px',color:'#888',display:'none'});this.show_no_records.innerHTML='No Result';if(this.opts.show_empty_tab) -this.make_result_tab();this.bottom_div=$a(this.body_area,'div','',{paddingTop:'8px'});this.make_toolbar();} -Listing.prototype.make_toolbar=function(){var me=this;this.buttons={};var make_btn=function(label,icon,onclick,bold){var btn=$btn(me.btn_area,label,onclick,{marginRight:'4px'});if(bold)$y(btn,{fontWeight:'bold'});me.buttons[label]=btn;} -if(!this.opts.hide_refresh){make_btn('Refresh','ui-icon-refresh',function(btn){me.start=0;me.run();},1);} -if(this.opts.show_new){make_btn('New ','ui-icon-document',function(){new_doc(me.dt);},1);} -if(this.opts.show_report){make_btn('Report Builder','ui-icon-clipboard',function(){loadreport(me.dt,null,null,null,1);},0);} -if(!this.opts.hide_export){make_btn('Export','ui-icon-circle-arrow-e',function(){me.do_export();});} -if(!this.opts.hide_print){make_btn('Print','ui-icon-print',function(){me.do_print();});} -if(this.opts.show_calc){make_btn('Calc','ui-icon-calculator',function(){me.do_calc();});$dh(me.buttons['Calc'])} -this.loading_img=$a(this.btn_area,'img','',{display:'none',marginBottom:'-2px'});this.loading_img.src='lib/images/ui/button-load.gif';if(!keys(this.buttons).length) -$dh(this.btn_area);} -Listing.prototype.do_print=function(){this.build_query();if(!this.query){alert('No Query!');return;} -args={query:this.query,title:this.head_text,colnames:this.colnames,colwidths:this.colwidths,coltypes:this.coltypes,has_index:(this.no_index?0:1),has_headings:1,check_limit:1,is_simple:1} -wn.require('lib/js/legacy/widgets/print_query.js');_p.print_query=new _p.PrintQuery();_p.print_query.show_dialog(args);} -Listing.prototype.do_calc=function(){show_calc(this.result_tab,this.colnames,this.coltypes,0)} -Listing.prototype.add_filter=function(label,ftype,options,tname,fname,cond){if(!this.filter_area){alert('[Listing] make() must be called before add_filter');} -var me=this;if(!this.filter_set){var h=$a(this.filter_area,'div','',{fontSize:'14px',fontWeight:'bold',marginBottom:'4px'});h.innerHTML='Filter your search';this.filter_area.div=$a(this.filter_area,'div');this.perm=[[1,1],] -this.filters={};} -$ds(this.filter_wrapper);if((!this.inp_tab)||(this.cell_idx==this.filters_per_line)){this.inp_tab=$a(this.filter_area.div,'table','',{width:'100%',tableLayout:'fixed'});this.inp_tab.insertRow(0);for(var i=0;iCreated:
\
+ \
+ %(creation)s
Modified:
\
+ \
+ %(modified)s