From 12852e73abe2c1bd2e459f9f862eac7e41c98a31 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 29 Feb 2012 15:11:06 +0530 Subject: [PATCH] added activity page --- build.json | 8 +- erpnext/home/page/activity/__init__.py | 0 erpnext/home/page/activity/activity.css | 23 ++++ erpnext/home/page/activity/activity.html | 6 + erpnext/home/page/activity/activity.js | 57 ++++++++ erpnext/home/page/activity/activity.py | 16 +++ erpnext/home/page/activity/activity.txt | 28 ++++ erpnext/home/page/desktop/desktop.js | 14 +- .../event_updates/complete_registration.js | 124 ------------------ erpnext/patches/jan_mar_2012/navupdate.py | 3 + .../doctype/setup_control/setup_control.py | 76 +++++------ erpnext/startup/event_handlers.py | 4 + erpnext/startup/js/complete_setup.js | 93 +++++++++++++ erpnext/startup/{ => js}/feature_setup.js | 0 erpnext/startup/{ => js}/modules.js | 0 erpnext/startup/{ => js}/toolbar.js | 0 erpnext/startup/startup.js | 33 ++--- erpnext/utilities/__init__.py | 3 +- js/all-app.js | 55 +++++--- js/all-web.js | 49 +++++-- version.num | 2 +- 21 files changed, 367 insertions(+), 227 deletions(-) create mode 100644 erpnext/home/page/activity/__init__.py create mode 100644 erpnext/home/page/activity/activity.css create mode 100644 erpnext/home/page/activity/activity.html create mode 100644 erpnext/home/page/activity/activity.js create mode 100644 erpnext/home/page/activity/activity.py create mode 100644 erpnext/home/page/activity/activity.txt delete mode 100644 erpnext/home/page/event_updates/complete_registration.js create mode 100644 erpnext/startup/js/complete_setup.js rename erpnext/startup/{ => js}/feature_setup.js (100%) rename erpnext/startup/{ => js}/modules.js (100%) rename erpnext/startup/{ => js}/toolbar.js (100%) diff --git a/build.json b/build.json index 95a38d6c57..76f3da0304 100644 --- a/build.json +++ b/build.json @@ -78,6 +78,7 @@ "lib/js/lib/jquery.min.js:concat", "lib/js/lib/history/history.min.js:concat", "lib/js/lib/bootstrap.min.js:concat", + "lib/js/lib/sprintf.js", "lib/js/core.min.js:concat", "lib/js/legacy/globals.js", "lib/js/legacy/utils/datatype.js", @@ -121,6 +122,7 @@ "lib/js/legacy/jquery/jquery-ui.min.js:concat", "lib/js/legacy/tiny_mce_33/jquery.tinymce.js:concat", "lib/js/lib/bootstrap.min.js:concat", + "lib/js/lib/sprintf.js", "lib/js/core.min.js:concat", "lib/js/legacy/globals.js", "lib/js/legacy/utils/datatype.js", @@ -175,9 +177,9 @@ "lib/js/legacy/app.js", "js/app.js", "erpnext/startup/startup.js", - "erpnext/startup/modules.js", - "erpnext/startup/toolbar.js", - "erpnext/startup/feature_setup.js" + "erpnext/startup/js/modules.js", + "erpnext/startup/js/toolbar.js", + "erpnext/startup/js/feature_setup.js" ] } diff --git a/erpnext/home/page/activity/__init__.py b/erpnext/home/page/activity/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/home/page/activity/activity.css b/erpnext/home/page/activity/activity.css new file mode 100644 index 0000000000..f3988b275d --- /dev/null +++ b/erpnext/home/page/activity/activity.css @@ -0,0 +1,23 @@ +#activity-list .label { + display: inline-block; + width: 100px; + margin-right: 7px; +} + +#activity-list .label-info { + cursor: pointer; +} + +#activity-list .user-info { + float: right; + color: #777; + font-size: 10px; +} + +#activity-list .date-sep { + margin-bottom: 11px; + padding: 5px 0px; + border-bottom: 1px solid #aaa; + color: #555; + font-size: 10px; +} \ No newline at end of file diff --git a/erpnext/home/page/activity/activity.html b/erpnext/home/page/activity/activity.html new file mode 100644 index 0000000000..b348d95cc6 --- /dev/null +++ b/erpnext/home/page/activity/activity.html @@ -0,0 +1,6 @@ +
+ × +

Activity

+
+
+
\ No newline at end of file diff --git a/erpnext/home/page/activity/activity.js b/erpnext/home/page/activity/activity.js new file mode 100644 index 0000000000..77e4ab92ea --- /dev/null +++ b/erpnext/home/page/activity/activity.js @@ -0,0 +1,57 @@ +wn.pages['activity'].onload = function(wrapper) { + var list = new wn.widgets.Listing({ + method: 'home.page.activity.activity.get_feed', + parent: $('#activity-list'), + render_row: function(row, data) { + new erpnext.ActivityFeed(row, data); + } + }); + list.run(); +} + +erpnext.last_feed_date = false; +erpnext.ActivityFeed = Class.extend({ + init: function(row, data) { + this.scrub_data(data); + this.add_date_separator(row, data); + $(row).append(repl('%(feed_type)s\ + %(link)s %(subject)s %(by)s', data)); + }, + scrub_data: function(data) { + data.by = wn.boot.user_fullnames[data.owner]; + + // feedtype + if(!data.feed_type) { + data.feed_type = get_doctype_label(data.doc_type); + data.add_class = "label-info"; + data.onclick = repl('onclick="window.location.href=\'#!List/%(feed_type)s\';"', data) + } + + // color for comment + if(data.feed_type=='Comment') { + data.add_class = "label-important"; + } + + // link + if(data.doc_name && data.feed_type!='Login') { + data.link = repl('%(doc_name)s', data) + } + }, + add_date_separator: function(row, data) { + var date = dateutil.str_to_obj(data.modified); + var last = erpnext.last_feed_date; + + if((last && dateutil.get_diff(last, date)>1) || (!last)) { + var pdate = dateutil.comment_when(date); + var diff = dateutil.get_diff(new Date(), date); + if(diff < 1) { + pdate = 'Today'; + } else if(diff > 6) { + pdate = dateutil.global_date_format(date); + } + $(row).html(repl('
%(date)s
', {date: pdate})); + } + erpnext.last_feed_date = date; + } +}) \ No newline at end of file diff --git a/erpnext/home/page/activity/activity.py b/erpnext/home/page/activity/activity.py new file mode 100644 index 0000000000..8b8faf3f5f --- /dev/null +++ b/erpnext/home/page/activity/activity.py @@ -0,0 +1,16 @@ +import webnotes + +@webnotes.whitelist() +def get_feed(arg=None): + """get feed""" + return webnotes.conn.sql("""select + distinct t1.name, t1.feed_type, t1.doc_type, t1.doc_name, t1.subject, t1.owner, + t1.modified + from tabFeed t1, tabDocPerm t2 + where t1.doc_type = t2.parent + and t2.role in ('%s') + and ifnull(t2.`read`,0) = 1 + order by t1.modified desc + limit %s, %s""" % ("','".join(webnotes.get_roles()), + webnotes.form_dict['limit_start'], webnotes.form_dict['limit_page_length']), + as_dict=1) \ No newline at end of file diff --git a/erpnext/home/page/activity/activity.txt b/erpnext/home/page/activity/activity.txt new file mode 100644 index 0000000000..e7f396389f --- /dev/null +++ b/erpnext/home/page/activity/activity.txt @@ -0,0 +1,28 @@ +# Page, activity +[ + + # These values are common in all dictionaries + { + 'creation': '2012-02-29 11:59:13', + 'docstatus': 0, + 'modified': '2012-02-29 12:11:46', + 'modified_by': u'Administrator', + 'owner': u'Administrator' + }, + + # These values are common for all Page + { + 'doctype': 'Page', + 'module': u'Home', + 'name': '__common__', + 'page_name': u'activity', + 'standard': u'Yes', + 'title': u'Activity' + }, + + # Page, activity + { + 'doctype': 'Page', + 'name': u'activity' + } +] \ No newline at end of file diff --git a/erpnext/home/page/desktop/desktop.js b/erpnext/home/page/desktop/desktop.js index 63a075ceb2..3aa9049e55 100644 --- a/erpnext/home/page/desktop/desktop.js +++ b/erpnext/home/page/desktop/desktop.js @@ -3,12 +3,12 @@ wn.provide('erpnext.desktop'); erpnext.desktop.gradient = "" @@ -79,7 +79,7 @@ erpnext.desktop.render = function() { for(var i in wn.boot.modules_list) { var m = wn.boot.modules_list[i]; - if(m!='Setup'); + if(m!='Setup') add_icon(m); } diff --git a/erpnext/home/page/event_updates/complete_registration.js b/erpnext/home/page/event_updates/complete_registration.js deleted file mode 100644 index 8f7eed32d4..0000000000 --- a/erpnext/home/page/event_updates/complete_registration.js +++ /dev/null @@ -1,124 +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 . - -// complete my company registration -// -------------------------------- -pscript.complete_registration = function(is_complete, profile) { - if(is_complete == 'No'){ - var d = new Dialog(400, 200, "Setup your Account"); - if(user != 'Administrator'){ - d.no_cancel(); // Hide close image - $('header').toggle(false); - } - - d.make_body([ - ['HTML', 'Your Profile Details', '

Your Profile Details

'], - ['Data', 'First Name'], - ['Data', 'Last Name'], - ['HTML', 'Company Details', '

Create your first company

'], - ['Data','Company Name','Example: Your Company LLC'], - ['Data','Company Abbreviation', 'Example: YC (all your acconts will have this as a suffix)'], - ['Select','Fiscal Year Start Date'], - ['Select','Default Currency'], - ['Button','Save'], - ]); - - // if company name is set, set the input value - // and disable it - if(wn.control_panel.company_name) { - d.widgets['Company Name'].value = wn.control_panel.company_name; - d.widgets['Company Name'].disabled = 1; - } - - if(profile && profile.length>0) { - if(profile[0].first_name && profile[0].first_name!='None') { - d.widgets['First Name'].value = profile[0].first_name; - } - - if(profile[0].last_name && profile[0].last_name!='None') { - d.widgets['Last Name'].value = profile[0].last_name; - } - } - - - //d.widgets['Save'].disabled = true; // disable Save button - pscript.make_dialog_field(d); - - // submit details - d.widgets['Save'].onclick = function() - { - d.widgets['Save'].set_working(); - - flag = pscript.validate_fields(d); - if(flag) - { - var args = [ - d.widgets['Company Name'].value, - d.widgets['Company Abbreviation'].value, - d.widgets['Fiscal Year Start Date'].value, - d.widgets['Default Currency'].value, - d.widgets['First Name'].value, - d.widgets['Last Name'].value - ]; - - $c_obj('Setup Control','setup_account',JSON.stringify(args),function(r, rt){ - sys_defaults = r.message; - user_fullname = r.message.user_fullname; - d.hide(); - $('header').toggle(true); - page_body.wntoolbar.set_user_name(); - }); - } else { - d.widgets['Save'].done_working(); - } - } - d.show(); - } -} - -// make dialog fields -// ------------------ -pscript.make_dialog_field = function(d) -{ - // fiscal year format - fisc_format = d.widgets['Fiscal Year Start Date']; - add_sel_options(fisc_format, ['', '1st Jan', '1st Apr', '1st Jul', '1st Oct']); - - // default currency - currency_list = ['', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BTN', 'BYR', 'BZD', 'CAD', 'CDF', 'CFA', 'CFP', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CUC', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EEK', 'EGP', 'ERN', 'ETB', 'EUR', 'EURO', 'FJD', 'FKP', 'FMG', 'GBP', 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GQE', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LTL', 'LVL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZM', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NRs', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', 'RMB', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SCR', 'SDG', 'SDR', 'SEK', 'SGD', 'SHP', 'SOS', 'SRD', 'STD', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TRY', 'TTD', 'TWD', 'TZS', 'UAE', 'UAH', 'UGX', 'USD', 'USh', 'UYU', 'UZS', 'VEB', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XDR', 'XOF', 'XPF', 'YEN', 'YER', 'YTL', 'ZAR', 'ZMK', 'ZWR']; - currency = d.widgets['Default Currency']; - add_sel_options(currency, currency_list); -} - - -// validate fields -// --------------- -pscript.validate_fields = function(d) -{ - var lst = ['First Name', 'Company Name', 'Company Abbreviation', 'Fiscal Year Start Date', 'Default Currency']; - var msg = 'Please enter the following fields'; - var flag = 1; - for(var i=0; i. -# Please edit this list and import only required elements import webnotes -from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add -from webnotes.model import db_exists -from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType -from webnotes.model.doclist import getlist, copy_doclist -from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax -from webnotes import session, form, is_testing, msgprint, errprint +from webnotes.utils import cint, cstr, flt, getdate, now, nowdate +from webnotes.model.doc import Document, addchild +from webnotes.model.code import get_obj +from webnotes import session, form, msgprint -set = webnotes.conn.set sql = webnotes.conn.sql -get_value = webnotes.conn.get_value -in_transaction = webnotes.conn.in_transaction -convert_to_lists = webnotes.conn.convert_to_lists - -# ----------------------------------------------------------------------------------------- - class DocType: def __init__(self, d, dl): @@ -74,9 +64,10 @@ class DocType: # Account Setup # --------------- def setup_account(self, args): - import webnotes - company_name, comp_abbr, fy_start, currency, first_name, last_name = eval(args) - curr_fiscal_year,fy_start_date = self.get_fy_details(fy_start) + import webnotes, json + locals().update(args) + + curr_fiscal_year, fy_start_date = self.get_fy_details(fy_start) self.currency = currency # Update Profile @@ -92,7 +83,7 @@ class DocType: # Company master_dict = {'Company':{'company_name':company_name, - 'abbr':comp_abbr, + 'abbr':company_abbr, 'default_currency':currency }} self.create_records(master_dict) @@ -117,15 +108,39 @@ class DocType: # Set self.set_defaults(def_args) - # Set Registration Complete - set_default('registration_complete','1') + self.create_feed_and_todo() - msgprint("Great! Your company has now been created") + webnotes.clear_cache() + msgprint("Company setup is complete") import webnotes.utils user_fullname = (first_name or '') + (last_name and (" " + last_name) or '') return {'sys_defaults': webnotes.utils.get_defaults(), 'user_fullname': user_fullname} + def create_feed_and_todo(self): + """update activty feed and create todo for creation of item, customer, vendor""" + import home + home.make_feed('Comment', '', '', webnotes.session['user'], + '"' + doc.comment + '"', '#6B24B3') + + d = Document('ToDo Item') + d.description = 'Create your first Customer' + d.priority = 'High' + d.date = nowdate() + d.save(1) + + d = Document('ToDo Item') + d.description = 'Create your first Item' + d.priority = 'High' + d.date = nowdate() + d.save(1) + + d = Document('ToDo Item') + d.description = 'Create your first Supplier' + d.priority = 'High' + d.date = nowdate() + d.save(1) + # Get Fiscal year Details # ------------------------ @@ -207,14 +222,6 @@ class DocType: d = addchild(pr,'userroles', 'UserRole', 1) d.role = r d.save(1) - - - # Sync DB - # ------- - def sync_db(arg=''): - import webnotes.model.db_schema - sql("delete from `tabDocType Update Register`") - webnotes.model.db_schema.sync_all() def is_setup_okay(self, args): @@ -224,21 +231,14 @@ class DocType: from server_tools.gateway_utils import get_total_users - args = eval(args) - #webnotes.logger.error("args in set_account_details of setup_control: " + str(args)) - + args = eval(args) cp_defaults = webnotes.conn.get_value('Control Panel', None, 'account_id') - user_profile = webnotes.conn.get_value('Profile', args['user'], 'name') from webnotes.utils import cint total_users = get_total_users() - - #webnotes.logger.error("setup_control.is_setup_okay: " + cp_defaults + " " + user_profile + " " + str(total_users)) - - #webnotes.logger.error("setup_control.is_setup_okay: Passed Values:" + args['account_name'] + " " + args['user'] + " " + str(args['total_users'])) - + if (cp_defaults==args['account_name']) and user_profile and \ (total_users==cint(args['total_users'])): return 'True' diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py index a1d805ef1f..79fd60312a 100644 --- a/erpnext/startup/event_handlers.py +++ b/erpnext/startup/event_handlers.py @@ -89,6 +89,10 @@ def boot_session(bootinfo): bootinfo['docs'] += webnotes.model.doctype.get('Event') bootinfo['modules_list'] = webnotes.conn.get_global('modules_list') + + # if no company, show a dialog box to create a new company + bootinfo['setup_complete'] = webnotes.conn.sql("""select name from + tabCompany limit 1""") and 'Yes' or 'No' def get_letter_heads(): """load letter heads with startup""" diff --git a/erpnext/startup/js/complete_setup.js b/erpnext/startup/js/complete_setup.js new file mode 100644 index 0000000000..663c7b97f0 --- /dev/null +++ b/erpnext/startup/js/complete_setup.js @@ -0,0 +1,93 @@ +// 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 . + +// complete my company registration +// -------------------------------- + +erpnext.complete_setup = function() { + var currency_list = ['', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AZN', + 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BTN', 'BYR', + 'BZD', 'CAD', 'CDF', 'CFA', 'CFP', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CUC', 'CZK', 'DJF', + 'DKK', 'DOP', 'DZD', 'EEK', 'EGP', 'ERN', 'ETB', 'EUR', 'EURO', 'FJD', 'FKP', 'FMG', 'GBP', + 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GQE', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', + 'IDR', 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF', + 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LTL', 'LVL', 'LYD', + 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', + 'MZM', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NRs', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', + 'PKR', 'PLN', 'PYG', 'QAR', 'RMB', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SCR', 'SDG', 'SDR', + 'SEK', 'SGD', 'SHP', 'SOS', 'SRD', 'STD', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TRY', + 'TTD', 'TWD', 'TZS', 'UAE', 'UAH', 'UGX', 'USD', 'USh', 'UYU', 'UZS', 'VEB', 'VND', 'VUV', + 'WST', 'XAF', 'XCD', 'XDR', 'XOF', 'XPF', 'YEN', 'YER', 'YTL', 'ZAR', 'ZMK', 'ZWR']; + + var d = new wn.widgets.Dialog({ + title: "Setup", + fields: [ + {fieldname:'first_name', label:'Your First Name', fieldtype:'Data'}, + {fieldname:'last_name', label:'Your Last Name', fieldtype:'Data'}, + {fieldname:'company_name', label:'Company Name', fieldtype:'Data', reqd:1, + description: 'e.g. "My Company LLC"'}, + {fieldname:'company_abbr', label:'Company Abbreviation', fieldtype:'Data', + description:'e.g. "MC"',reqd:1}, + {fieldname:'fy_start', label:'Financial Year Start Date', fieldtype:'Select', + description:'Your financial year begins on"', reqd:1, + options=['', '1st Jan', '1st Apr', '1st Jul', '1st Oct'].join('\n')}, + {fieldname:'currency': label: 'Default Currency', reqd:1, + options=currency_list.join('\n')}, + {fieldname:'update', label:'Setup',fieldtype:'Button'} + ] + }) + + // prepare + if(user != 'Administrator'){ + d.no_cancel(); // Hide close image + $('header').toggle(false); // hide toolbar + } + + // company name already set + if(wn.control_panel.company_name) { + var inp = d.fields_dict.company_name.input; + inp.value = wn.control_panel.company_name; + inp.disabled = true; + } + + // set first name, last name + if(user_fullname) { + u = user_fullname.spilt(' '); + if(u[0]) { + d.fields_dict.first_name.input.value = u[0]; + } + if(u[1]) { + d.fields_dict.last_name.input.value = u[1]; + } + } + + // setup + d.fields_dict.update.input.onclick = function() { + var data = d.get_values(); + if(!data) return; + $(this).set_working(); + $c_obj('Setup Control','setup_account',data,function(r, rt){ + sys_defaults = r.message; + user_fullname = r.message.user_fullname; + wn.boot.user_fullnames[user] = user_fullname; + d.hide(); + $('header').toggle(true); + page_body.wntoolbar.set_user_name(); + }); + } + + d.show(); +} \ No newline at end of file diff --git a/erpnext/startup/feature_setup.js b/erpnext/startup/js/feature_setup.js similarity index 100% rename from erpnext/startup/feature_setup.js rename to erpnext/startup/js/feature_setup.js diff --git a/erpnext/startup/modules.js b/erpnext/startup/js/modules.js similarity index 100% rename from erpnext/startup/modules.js rename to erpnext/startup/js/modules.js diff --git a/erpnext/startup/toolbar.js b/erpnext/startup/js/toolbar.js similarity index 100% rename from erpnext/startup/toolbar.js rename to erpnext/startup/js/toolbar.js diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js index 30ab28d53b..aef298cbd2 100644 --- a/erpnext/startup/startup.js +++ b/erpnext/startup/startup.js @@ -30,7 +30,7 @@ erpnext.modules = { 'Website': 'website-home', 'HR': 'hr-home', 'Setup': 'Setup', - 'Activity': 'Event Updates', + 'Activity': 'activity', 'To Do': 'todo', 'Calendar': 'calendar', 'Messages': 'messages', @@ -58,7 +58,7 @@ erpnext.startup.start = function() { } else { // setup toolbar erpnext.toolbar.setup(); - + // set interval for updates erpnext.startup.set_periodic_updates(); @@ -66,6 +66,13 @@ erpnext.startup.start = function() { // ------------------ $('footer').html(''); + + // complete registration + if(in_list(user_roles,'System Manager') && (wn.boot.setup_complete=='No')) { + wn.require("erpnext/startup/js/complete_setup.js"); + erpnext.complete_setup(); + } + } $('#startup_div').toggle(false); @@ -87,28 +94,6 @@ show_chart_browser = function(nm, chart_type){ } -// Module Page -// ==================================================================== - -ModulePage = function(parent, module_name, module_label, help_page, callback) { - this.parent = parent; - - // add to current page - page_body.cur_page.module_page = this; - - this.wrapper = $a(parent,'div'); - this.module_name = module_name; - this.transactions = []; - this.page_head = new PageHeader(this.wrapper, module_label); - - if(help_page) { - var btn = this.page_head.add_button('Help', function() { loadpage(this.help_page) }, 1, 'ui-icon-help') - btn.help_page = help_page; - } - - if(callback) this.callback = function(){ callback(); } -} - // ========== Update Messages ============ var update_messages = function() { // Updates Team Messages diff --git a/erpnext/utilities/__init__.py b/erpnext/utilities/__init__.py index 28eaccecdc..d57f0def05 100644 --- a/erpnext/utilities/__init__.py +++ b/erpnext/utilities/__init__.py @@ -23,6 +23,7 @@ def get_report_list(arg=None): distinct criteria_name, doc_type, parent_doc_type from `tabSearch Criteria` where module='%(module)s' - and docstatus in (0, NULL) + and docstatus in (0, NULL) + and ifnull(disabled, 0) = 0 order by criteria_name limit %(limit_start)s, %(limit_page_length)s""" % webnotes.form_dict, as_dict=True) \ No newline at end of file diff --git a/js/all-app.js b/js/all-app.js index 62d63ce67f..09e92a504f 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -111,6 +111,33 @@ $(document).bind('ready', function() { /* * lib/js/lib/bootstrap.min.js */!function(a){a(function(){"use strict",a.support.transition=function(){var b=document.body||document.documentElement,c=b.style,d=c.transition!==undefined||c.WebkitTransition!==undefined||c.MozTransition!==undefined||c.MsTransition!==undefined||c.OTransition!==undefined;return d&&{end:function(){var b="TransitionEnd";return a.browser.webkit?b="webkitTransitionEnd":a.browser.mozilla?b="transitionend":a.browser.opera&&(b="oTransitionEnd"),b}()}}()})}(window.jQuery),!function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype={constructor:c,close:function(b){function f(){e.remove(),e.trigger("closed")}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),e.trigger("close"),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()}},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype={constructor:b,setState:function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},toggle:function(){var a=this.$element.parent('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")}},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(function(){a("body").on("click.button.data-api","[data-toggle^=button]",function(b){a(b.target).button("toggle")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.carousel.defaults,c),this.options.slide&&this.slide(this.options.slide)};b.prototype={cycle:function(){return this.interval=setInterval(a.proxy(this.next,this),this.options.interval),this},to:function(b){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(){return clearInterval(this.interval),this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this;return this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h](),!a.support.transition&&this.$element.hasClass("slide")?(this.$element.trigger("slide"),d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")):(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.trigger("slide"),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})),f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=typeof c=="object"&&c;e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):typeof c=="string"||(c=f.slide)?e[c]():e.cycle()})},a.fn.carousel.defaults={interval:5e3},a.fn.carousel.Constructor=b,a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!e.data("modal")&&a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find(".in"),e;d&&d.length&&(e=d.data("collapse"),d.collapse("hide"),e||d.data("collapse",null)),this.$element[b](0),this.transition("addClass","show","shown"),this.$element[b](this.$element[0][c])},hide:function(){var a=this.dimension();this.reset(this.$element[a]()),this.transition("removeClass","hide","hidden"),this.$element[a](0)},reset:function(a){var b=this.dimension();this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element.addClass("collapse")},transition:function(b,c,d){var e=this,f=function(){c=="show"&&e.reset(),e.$element.trigger(d)};this.$element.trigger(c)[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();a(e).collapse(f)})})}(window.jQuery),!function(a){function d(){a(b).parent().removeClass("open")}"use strict";var b='[data-toggle="dropdown"]',c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),e=c.attr("data-target"),f,g;return e||(e=c.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,"")),f=a(e),f.length||(f=c.parent()),g=f.hasClass("open"),d(),!g&&f.toggleClass("open"),!1}},a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a(function(){a("html").on("click.dropdown.data-api",d),a("body").on("click.dropdown.data-api",b,c.prototype.toggle)})}(window.jQuery),!function(a){function c(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),d.call(b)},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),d.call(b)})}function d(a){this.$element.hide().trigger("hidden"),e.call(this)}function e(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup();}} $('#startup_div').toggle(false);} show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);} else if(nm=='Accounts Browser') pscript.make_chart(chart_type);} loadpage(nm,call_back);} -ModulePage=function(parent,module_name,module_label,help_page,callback){this.parent=parent;page_body.cur_page.module_page=this;this.wrapper=$a(parent,'div');this.module_name=module_name;this.transactions=[];this.page_head=new PageHeader(this.wrapper,module_label);if(help_page){var btn=this.page_head.add_button('Help',function(){loadpage(this.help_page)},1,'ui-icon-help') -btn.help_page=help_page;} -if(callback)this.callback=function(){callback();}} var update_messages=function(){if(inList(['Guest'],user)){return;} $c_page('home','event_updates','get_unread_messages',null,function(r,rt){if(!r.exc){page_body.wntoolbar.set_new_comments(r.message);var circle=$('#msg_count') if(circle){if(r.message.length){circle.find('span:first').text(r.message.length);circle.toggle(true);}else{circle.toggle(false);}}}else{clearInterval(wn.updates.id);}});} @@ -2213,7 +2236,7 @@ erpnext.startup.set_periodic_updates=function(){wn.updates={};if(wn.updates.id){ wn.updates.id=setInterval(update_messages,60000);} $(document).bind('startup',function(){erpnext.startup.start();}); /* - * erpnext/startup/modules.js + * erpnext/startup/js/modules.js */ wn.provide('erpnext.module_page');erpnext.module_page.setup_page=function(module,wrapper){erpnext.module_page.hide_links(wrapper);erpnext.module_page.make_list(module,wrapper);$(wrapper).find("a[title]").tooltip({delay:{show:500,hide:100}});} erpnext.module_page.hide_links=function(wrapper){$(wrapper).find('[href*="List/"]').each(function(){var href=$(this).attr('href');var dt=href.split('/')[1];if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});$(wrapper).find('[data-doctype]').each(function(){var dt=$(this).attr('data-doctype');if(wn.boot.profile.can_read.indexOf(dt)==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});$(wrapper).find('[href*="Form/"]').each(function(){var href=$(this).attr('href');var dt=href.split('/')[1];if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});} @@ -2221,7 +2244,7 @@ erpnext.module_page.make_list=function(module,wrapper){wrapper.list=new wn.widge data-doctype="%(parent_doc_type)s">\ %(criteria_name)s',data))},args:{module:module},no_refresh:true});wrapper.list.run();} /* - * erpnext/startup/toolbar.js + * erpnext/startup/js/toolbar.js */ wn.provide('erpnext.toolbar');erpnext.toolbar.setup=function(){erpnext.toolbar.add_modules();$('#toolbar-user').append('
  • Profile Settings
  • ');$('.navbar .pull-right').append('\
  • ');$('.navbar .pull-right').prepend('
  • \
  • Setup
  • ');}} /* - * erpnext/startup/feature_setup.js + * erpnext/startup/js/feature_setup.js */ pscript.feature_dict={'fs_projects':{'Bill Of Materials':{'fields':['project_name']},'Delivery Note':{'fields':['project_name']},'Payable Voucher':{'fields':['project_name']},'Production Order':{'fields':['project_name']},'Purchase Order':{'fields':['project_name']},'Purchase Receipt':{'fields':['project_name']},'Receivable Voucher':{'fields':['project_name']},'Sales Order':{'fields':['project_name']},'Stock Entry':{'fields':['project_name']},'Timesheet':{'timesheet_details':['project_name']}},'fs_packing_details':{},'fs_discounts':{'Delivery Note':{'delivery_note_details':['adj_rate']},'Quotation':{'quotation_details':['adj_rate']},'Receivable Voucher':{'entries':['adj_rate']},'Sales Order':{'sales_order_details':['adj_rate','ref_rate']}},'fs_purchase_discounts':{'Purchase Order':{'po_details':['purchase_ref_rate','discount_rate','import_ref_rate']},'Purchase Receipt':{'purchase_receipt_details':['purchase_ref_rate','discount_rate','import_ref_rate']},'Payable Voucher':{'entries':['purchase_ref_rate','discount_rate','import_ref_rate']}},'fs_brands':{'Delivery Note':{'delivery_note_details':['brand']},'Indent':{'indent_details':['brand']},'Item':{'fields':['brand']},'Purchase Order':{'po_details':['brand']},'Payable Voucher':{'entries':['brand']},'Quotation':{'quotation_details':['brand']},'Receivable Voucher':{'entries':['brand']},'Sales BOM':{'fields':['new_item_brand']},'Sales Order':{'sales_order_details':['brand']},'Serial No':{'fields':['brand']}},'fs_after_sales_installations':{'Delivery Note':{'fields':['installation_status','per_installed'],'delivery_note_details':['installed_qty']}},'fs_item_batch_nos':{'Delivery Note':{'delivery_note_details':['batch_no']},'Item':{'fields':['has_batch_no']},'Purchase Receipt':{'purchase_receipt_details':['batch_no']},'QA Inspection Report':{'fields':['batch_no']},'Sales and Pruchase Return Wizard':{'return_details':['batch_no']},'Receivable Voucher':{'entries':['batch_no']},'Stock Entry':{'mtn_details':['batch_no']},'Stock Ledger Entry':{'fields':['batch_no']}},'fs_item_serial_nos':{'Customer Issue':{'fields':['serial_no']},'Delivery Note':{'delivery_note_details':['serial_no'],'packing_details':['serial_no']},'Installation Note':{'installed_item_details':['serial_no']},'Item':{'fields':['has_serial_no']},'Maintenance Schedule':{'item_maintenance_details':['serial_no'],'maintenance_schedule_details':['serial_no']},'Maintenance Visit':{'maintenance_visit_details':['serial_no']},'Purchase Receipt':{'purchase_receipt_details':['serial_no']},'QA Inspection Report':{'fields':['item_serial_no']},'Sales and Pruchase Return Wizard':{'return_details':['serial_no']},'Receivable Voucher':{'entries':['serial_no']},'Stock Entry':{'mtn_details':['serial_no']},'Stock Ledger Entry':{'fields':['serial_no']}},'fs_item_group_in_details':{'Delivery Note':{'delivery_note_details':['item_group']},'Enquiry':{'enquiry_details':['item_group']},'Indent':{'indent_details':['item_group']},'Item':{'fields':['item_group']},'Manage Account':{'fields':['default_item_group']},'Purchase Order':{'po_details':['item_group']},'Purchase Receipt':{'purchase_receipt_details':['item_group']},'Purchase Voucher':{'entries':['item_group']},'Quotation':{'quotation_details':['item_group']},'Receivable Voucher':{'entries':['item_group']},'Sales BOM':{'fields':['serial_no']},'Sales Order':{'sales_order_details':['item_group']},'Serial No':{'fields':['item_group']},'Sales Partner':{'partner_target_details':['item_group']},'Sales Person':{'target_details':['item_group']},'Territory':{'target_details':['item_group']}},'fs_page_break':{'Delivery Note':{'delivery_note_details':['page_break'],'packing_details':['page_break']},'Indent':{'indent_details':['page_break']},'Purchase Order':{'po_details':['page_break']},'Purchase Receipt':{'purchase_receipt_details':['page_break']},'Purchase Voucher':{'entries':['page_break']},'Quotation':{'quotation_details':['page_break']},'Receivable Voucher':{'entries':['page_break']},'Sales Order':{'sales_order_details':['page_break']}},'fs_exports':{'Delivery Note':{'fields':['Note','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'delivery_note_details':['base_ref_rate','export_amount','export_rate']},'POS Setting':{'fields':['conversion_rate','currency']},'Quotation':{'fields':['Note HTML','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'quotation_details':['base_ref_rate','export_amount','export_rate']},'Receivable Voucher':{'fields':['conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'entries':['base_ref_rate','export_amount','export_rate']},'Item':{'ref_rate_details':['ref_currency']},'Sales BOM':{'fields':['currency']},'Sales Order':{'fields':['Note1','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'sales_order_details':['base_ref_rate','export_amount','export_rate']}},'fs_imports':{'Payable Voucher':{'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'entries':['import_amount','import_rate']},'Purchase Order':{'fields':['Note HTML','conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'po_details':['import_amount','import_rate']},'Purchase Receipt':{'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'purchase_receipt_details':['import_amount','import_rate']},'Supplier Quotation':{'fields':['conversion_rate','currency']}},'fs_item_advanced':{'Item':{'fields':['item_customer_details']}},'fs_sales_extras':{'Address':{'fields':['sales_partner']},'Contact':{'fields':['sales_partner']},'Customer':{'fields':['sales_team']},'Delivery Note':{'fields':['sales_team','Packing List']},'Item':{'fields':['item_customer_details']},'Receivable Voucher':{'fields':['sales_team']},'Sales Order':{'fields':['sales_team','Packing List']}},'fs_more_info':{'Customer':{'fields':['More Info']},'Delivery Note':{'fields':['More Info']},'Enquiry':{'fields':['More Info']},'Indent':{'fields':['More Info']},'Lead':{'fields':['More Info']},'Payable Voucher':{'fields':['More Info']},'Purchase Order':{'fields':['More Info']},'Purchase Receipt':{'fields':['More Info']},'Quotation':{'fields':['More Info']},'Receivable Voucher':{'fields':['More Info']},'Sales Order':{'fields':['More Info']},'Serial No':{'fields':['More Info']},'Supplier':{'fields':['More Info']}},'fs_quality':{'Item':{'fields':['Item Inspection Criteria','inspection_required']},'Purchase Receipt':{'purchase_receipt_details':['qa_no']}},'fs_manufacturing':{'Item':{'fields':['Manufacturing']}},'fs_pos':{'Receivable Voucher':{'fields':['is_pos']}},'fs_recurring_invoice':{'Receivable Voucher':{'fields':['Recurring Invoice']}}} $(document).bind('form_refresh',function(){for(sys_feat in sys_defaults) diff --git a/js/all-web.js b/js/all-web.js index 07fae99a0d..98e1a7ab9b 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -37,6 +37,33 @@ $(document).bind('ready', function() { /* * lib/js/lib/bootstrap.min.js */!function(a){a(function(){"use strict",a.support.transition=function(){var b=document.body||document.documentElement,c=b.style,d=c.transition!==undefined||c.WebkitTransition!==undefined||c.MozTransition!==undefined||c.MsTransition!==undefined||c.OTransition!==undefined;return d&&{end:function(){var b="TransitionEnd";return a.browser.webkit?b="webkitTransitionEnd":a.browser.mozilla?b="transitionend":a.browser.opera&&(b="oTransitionEnd"),b}()}}()})}(window.jQuery),!function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype={constructor:c,close:function(b){function f(){e.remove(),e.trigger("closed")}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),e.trigger("close"),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()}},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype={constructor:b,setState:function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},toggle:function(){var a=this.$element.parent('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")}},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(function(){a("body").on("click.button.data-api","[data-toggle^=button]",function(b){a(b.target).button("toggle")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.carousel.defaults,c),this.options.slide&&this.slide(this.options.slide)};b.prototype={cycle:function(){return this.interval=setInterval(a.proxy(this.next,this),this.options.interval),this},to:function(b){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(){return clearInterval(this.interval),this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this;return this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h](),!a.support.transition&&this.$element.hasClass("slide")?(this.$element.trigger("slide"),d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")):(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.trigger("slide"),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})),f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=typeof c=="object"&&c;e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):typeof c=="string"||(c=f.slide)?e[c]():e.cycle()})},a.fn.carousel.defaults={interval:5e3},a.fn.carousel.Constructor=b,a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!e.data("modal")&&a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find(".in"),e;d&&d.length&&(e=d.data("collapse"),d.collapse("hide"),e||d.data("collapse",null)),this.$element[b](0),this.transition("addClass","show","shown"),this.$element[b](this.$element[0][c])},hide:function(){var a=this.dimension();this.reset(this.$element[a]()),this.transition("removeClass","hide","hidden"),this.$element[a](0)},reset:function(a){var b=this.dimension();this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element.addClass("collapse")},transition:function(b,c,d){var e=this,f=function(){c=="show"&&e.reset(),e.$element.trigger(d)};this.$element.trigger(c)[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();a(e).collapse(f)})})}(window.jQuery),!function(a){function d(){a(b).parent().removeClass("open")}"use strict";var b='[data-toggle="dropdown"]',c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),e=c.attr("data-target"),f,g;return e||(e=c.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,"")),f=a(e),f.length||(f=c.parent()),g=f.hasClass("open"),d(),!g&&f.toggleClass("open"),!1}},a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a(function(){a("html").on("click.dropdown.data-api",d),a("body").on("click.dropdown.data-api",b,c.prototype.toggle)})}(window.jQuery),!function(a){function c(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),d.call(b)},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),d.call(b)})}function d(a){this.$element.hide().trigger("hidden"),e.call(this)}function e(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup();}} $('#startup_div').toggle(false);} show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);} else if(nm=='Accounts Browser') pscript.make_chart(chart_type);} loadpage(nm,call_back);} -ModulePage=function(parent,module_name,module_label,help_page,callback){this.parent=parent;page_body.cur_page.module_page=this;this.wrapper=$a(parent,'div');this.module_name=module_name;this.transactions=[];this.page_head=new PageHeader(this.wrapper,module_label);if(help_page){var btn=this.page_head.add_button('Help',function(){loadpage(this.help_page)},1,'ui-icon-help') -btn.help_page=help_page;} -if(callback)this.callback=function(){callback();}} var update_messages=function(){if(inList(['Guest'],user)){return;} $c_page('home','event_updates','get_unread_messages',null,function(r,rt){if(!r.exc){page_body.wntoolbar.set_new_comments(r.message);var circle=$('#msg_count') if(circle){if(r.message.length){circle.find('span:first').text(r.message.length);circle.toggle(true);}else{circle.toggle(false);}}}else{clearInterval(wn.updates.id);}});} diff --git a/version.num b/version.num index 3879e48b52..d6ee760bad 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -753 \ No newline at end of file +762 \ No newline at end of file