Merge branch 'master' into latest
diff --git a/.gitignore b/.gitignore
index e9e476b..28fcc88 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,8 @@
*.comp.js
.DS_Store
server_tools
+services
+user_files
patch.log
lib
versions-local.db
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/blank.html
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to blank.html
diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js
index 51cacda..b07bb9c 100644
--- a/erpnext/accounts/doctype/account/account.js
+++ b/erpnext/accounts/doctype/account/account.js
@@ -15,7 +15,7 @@
cur_frm.cscript.onload = function(doc, cdt, cdn) {
cur_frm.cscript.account_type(doc, cdt, cdn);
// hide India specific fields
- var cp = locals['Control Panel']['Control Panel'];
+ var cp = wn.control_panel;
if(cp.country == 'India')
unhide_field(['pan_number', 'tds_applicable', 'tds_details', 'TDS']);
else
diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
index f65ee31..983d303 100644
--- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
+++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
@@ -1,5 +1,5 @@
cur_frm.cscript.onload = function(doc, cdt, cdn) {
- var cp = locals['Control Panel']['Control Panel'];
+ var cp = wn.control_panel;
if (!doc.voucher_date) doc.voucher_date = dateutil.obj_to_str(new Date());
diff --git a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js
index ce26865..ff80d6b 100644
--- a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js
+++ b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js
@@ -7,7 +7,7 @@
// On Load
// --------
cur_frm.cscript.onload = function(doc,dt,dn) {
- var cp = locals['Control Panel']['Control Panel'];
+ var cp = wn.control_panel;
if(!doc.voucher_date) set_multiple(dt,dn,{voucher_date:get_today()});
if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()});
diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
index edff465..bac1a1b 100644
--- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
+++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
@@ -71,7 +71,7 @@
}
// India related fields
- var cp = locals['Control Panel']['Control Panel'];
+ var cp = wn.control_panel;
if (cp.country == 'India') unhide_field(['c_form_applicable', 'c_form_no']);
else hide_field(['c_form_applicable', 'c_form_no']);
diff --git a/erpnext/home/__init__.py b/erpnext/home/__init__.py
index 8969695..7059cec 100644
--- a/erpnext/home/__init__.py
+++ b/erpnext/home/__init__.py
@@ -48,9 +48,9 @@
def update_feed(doc, method=None):
"adds a new feed"
- if method=='validate':
- return
- subject, color = feed_dict.get(doc.doctype, [None, None])
- if subject:
- subject = subject % doc.fields
- make_feed(doc, subject, color)
+ if method=='on_update':
+ subject, color = feed_dict.get(doc.doctype, [None, None])
+ if subject:
+ subject = subject % doc.fields
+
+ make_feed(doc, subject, color)
diff --git a/erpnext/home/doctype/home_control/home_control.py b/erpnext/home/doctype/home_control/home_control.py
index ce15bfd..9d82153 100644
--- a/erpnext/home/doctype/home_control/home_control.py
+++ b/erpnext/home/doctype/home_control/home_control.py
@@ -197,7 +197,10 @@
return count
def get_todo_list(self):
- return convert_to_lists(sql("select name, description, date, priority,checked from `tabToDo Item` where owner=%s order by field(priority,'High','Medium','Low') asc, date asc", session['user']))
+ return sql("""select name, description, date,
+ priority, checked, reference_type, reference_name from `tabToDo Item`
+ where owner=%s order by field(priority,'High','Medium','Low') asc, date asc""", \
+ session['user'], as_dict=1)
def add_todo_item(self,args):
args = json.loads(args)
diff --git a/erpnext/home/page/dashboard/dashboard.js b/erpnext/home/page/dashboard/dashboard.js
index aac42a3..8ef2ffb 100644
--- a/erpnext/home/page/dashboard/dashboard.js
+++ b/erpnext/home/page/dashboard/dashboard.js
@@ -1,6 +1,7 @@
pscript.onload_dashboard = function() {
// load jqplot
$.scriptPath = 'js/'
+ wn.require('lib/css/jqpot.css');
wn.require('lib/js/legacy/jquery/jquery.jqplot.min.js');
wn.require('lib/js/legacy/jquery/jqplot-plugins/jqplot.barRenderer.js');
wn.require('lib/js/legacy/jquery/jqplot-plugins/jqplot.canvasAxisTickRenderer.min.js');
diff --git a/erpnext/home/page/event_updates/complete_registration.js b/erpnext/home/page/event_updates/complete_registration.js
new file mode 100644
index 0000000..4ed3fe9
--- /dev/null
+++ b/erpnext/home/page/event_updates/complete_registration.js
@@ -0,0 +1,88 @@
+// complete my company registration
+// --------------------------------
+pscript.complete_registration = function(is_complete) {
+ if(is_complete == 'No'){
+ var d = new Dialog(400, 200, "Please Complete Your Registration");
+ if(user != 'Administrator'){
+ d.no_cancel(); // Hide close image
+ $('header').toggle(false);
+ }
+
+ d.make_body([
+ ['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;
+ }
+
+
+ //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
+ ];
+
+ $c_obj('Setup Control','setup_account',JSON.stringify(args),function(r, rt){
+ sys_defaults = r.message;
+ d.hide();
+ $('header').toggle(true);
+ });
+ }
+ }
+ 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 = ['Company Abbreviation', 'Fiscal Year Start Date', 'Default Currency'];
+ var msg = 'Please enter the following fields';
+ var flag = 1;
+ for(var i=0; i<lst.length; i++)
+ {
+ if(!d.widgets[lst[i]].value){
+ flag = 0;
+ msg = msg + NEWLINE + lst[i];
+ }
+ }
+
+ if(!flag) alert(msg);
+ return flag;
+}
\ No newline at end of file
diff --git a/erpnext/home/page/event_updates/event_updates.js b/erpnext/home/page/event_updates/event_updates.js
index ee348e6..87c7f5c 100644
--- a/erpnext/home/page/event_updates/event_updates.js
+++ b/erpnext/home/page/event_updates/event_updates.js
@@ -6,7 +6,7 @@
pscript.home_make_body();
pscript.home_make_status();
- pscript.home_pre_process();
+ pscript.home_set_banner();
pscript.home_make_widgets();
}
@@ -30,9 +30,9 @@
// ==================================
-pscript.home_pre_process = function(wrapper) {
+pscript.home_set_banner = function(wrapper) {
var wrapper = page_body.pages['Event Updates'];
- var cp = locals['Control Panel']['Control Panel'];
+ var cp = wn.control_panel;
// banner
if(cp.client_name) {
@@ -346,21 +346,32 @@
$y(tab, {tableLayout:'fixed'});
var span = $a($td(tab, 0, 0), 'span', '', {padding:'2px',color:'#FFF',fontSize:'10px'
- ,backgroundColor:(det[3]=='Low' ? '#888' : (det[3]=='High' ? '#EDA857' : '#687FD3'))});
+ , backgroundColor:(det.priority=='Low' ? '#888' :
+ (det.priority=='High' ? '#EDA857' : '#687FD3'))});
$(span).css('-moz-border-radius','3px').css('-webkit-border-radius','3px');
- span.innerHTML = det[3];
+ span.innerHTML = det.priority;
// text
- var span = $a($td(tab, 0, 1), 'span', 'social', {lineHeight:'1.5em'}, replace_newlines(det[1]));
- if(det[4]) $y(span,{textDecoration:'line-through'});
+ var span = $a($td(tab, 0, 1), 'div', 'social', {lineHeight:'1.5em'},
+ replace_newlines(det.description));
+ if(det.checked) $y(span,{textDecoration:'line-through'});
+
+ // reference link
+ if(det.reference_name) {
+ $a($td(tab, 0, 1), 'div', 'social', '',
+ repl('<a href="#!Form/%(reference_type)s/%(reference_name)s">%(reference_name)s</a>',
+ det))
+ }
// if expired & open, then in red
- if(!det[4] && dateutil.str_to_obj(det[2]) < new Date()) {
+ if(!det.checked && dateutil.str_to_obj(det.date) < new Date()) {
$y(span,{color:'RED'});
- $a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'}, dateutil.str_to_user(det[2]) + ' (Overdue)');
+ $a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'},
+ dateutil.str_to_user(det.date) + ' (Overdue)');
} else {
- $a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'}, dateutil.str_to_user(det[2]));
+ $a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'},
+ dateutil.str_to_user(det.date));
}
}
@@ -371,10 +382,10 @@
HomeToDo.prototype.set_dialog_values = function(det) {
var d = this.widget.dialog;
d.set_values({
- date: det[2],
- priority: det[3],
- description: det[1],
- checked: det[4]
+ date: det.date,
+ priority: det.priority,
+ description: det.description,
+ checked: det.checked
});
d.det = det;
}
@@ -389,8 +400,6 @@
return;
}
- det.name = d.det ? d.det[0] : '';
-
var callback = function(r,rt) {
btn.done_working();
me.widget.dialog.hide();
@@ -420,9 +429,6 @@
// head
$a(this.head,'h1','', {display:'inline'}, 'Home');
- $a(this.head,'span','link_type', {marginLeft:'7px', fontSize:'11px'}, 'help', function() {
- msgprint('<b>What appears here?</b> This is where you get updates of everything you are permitted to follow')
- })
// refresh
$a(this.head,'span','link_type',
@@ -583,10 +589,6 @@
this.render = function(r) {
this.wrapper.innerHTML = '';
- this.profile_settings = $a($a(this.wrapper, 'p'), 'span', 'link_type', {fontWeight:'bold'});
- this.profile_settings.innerHTML = user_fullname + ' (Profile Settings)';
- this.profile_settings.onclick = function() { loadpage('profile-settings'); }
-
this.span = $a($a(this.wrapper, 'p'), 'span', 'link_type', {fontWeight:'bold'});
this.span.onclick = function() { loadpage('My Company') }
@@ -614,6 +616,7 @@
// complete registration
if(in_list(user_roles,'System Manager')) {
+ wn.require("erpnext/home/page/event_updates/complete_registration.js");
pscript.complete_registration(r.message.registration_complete);
}
@@ -625,95 +628,6 @@
);
}
-// complete my company registration
-// --------------------------------
-pscript.complete_registration = function(is_complete) {
- if(is_complete == 'No'){
- var d = new Dialog(400, 200, "Please Complete Your Registration");
- if(user != 'Administrator'){
- d.no_cancel(); // Hide close image
- $dh(page_body.wntoolbar.wrapper);
- }
-
- d.make_body([
- ['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(locals['Control Panel']['Control Panel'].company_name) {
- d.widgets['Company Name'].value = locals['Control Panel']['Control Panel'].company_name;
- d.widgets['Company Name'].disabled = 1;
- }
-
-
- //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
- ];
-
- $c_obj('Setup Control','setup_account',JSON.stringify(args),function(r, rt){
- sys_defaults = r.message;
- d.hide();
- $ds(page_body.wntoolbar.wrapper);
- });
- }
- }
- 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 = ['Company Abbreviation', 'Fiscal Year Start Date', 'Default Currency'];
- var msg = 'Please enter the following fields';
- var flag = 1;
- for(var i=0; i<lst.length; i++)
- {
- if(!d.widgets[lst[i]].value){
- flag = 0;
- msg = msg + NEWLINE + lst[i];
- }
- }
-
- if(!flag) alert(msg);
- return flag;
-}
-
SetupWizard = function(status) {
var me = this;
$.extend(this, {
diff --git a/erpnext/home/page/my_company/my_company.js b/erpnext/home/page/my_company/my_company.js
index 58ff91e..e85623f 100644
--- a/erpnext/home/page/my_company/my_company.js
+++ b/erpnext/home/page/my_company/my_company.js
@@ -43,14 +43,11 @@
//
pscript.myc_add_user = function() {
var fields = [{
- fieldtype: 'Data',
- fieldname: 'user',
- reqd: 1,
- label: 'Email Id of the user to add'
- }];
-
- if(!pscript.is_erpnext_saas) {
- fields = fields.concat([
+ fieldtype: 'Data',
+ fieldname: 'user',
+ reqd: 1,
+ label: 'Email Id of the user to add'
+ },
{
fieldtype: 'Data',
fieldname: 'first_name',
@@ -67,14 +64,14 @@
fieldname: 'password',
reqd: 1,
label: 'Password'
- }]);
- }
+ },
+ {
+ fieldtype: 'Button',
+ label: 'Add',
+ fieldname: 'add'
+ }];
- fields.push({
- fieldtype: 'Button',
- label: 'Add',
- fieldname: 'add'
- });
+ fields.push();
var d = new wn.widgets.Dialog({
title: 'Add User',
@@ -246,7 +243,8 @@
// image
this.img = $a($td(this.tab,0,0),'img','',{width:'41px'});
set_user_img(this.img, det.name, null,
- (det.file_list ? det.file_list.split(NEWLINE)[0].split(',')[1] : ('no_img_' + (det.gender=='Female' ? 'f' : 'm'))));
+ (det.file_list ? det.file_list.split(NEWLINE)[0].split(',')[1] :
+ ('no_img_' + (det.gender=='Female' ? 'f' : 'm'))));
}
// set other details like email id, name etc
@@ -464,7 +462,7 @@
// delete user
// create a confirm dialog and call server method
this.delete_user = function() {
- var cp = locals['Control Panel']['Control Panel'];
+ var cp = wn.control_panel;
var d = new Dialog(400,200,'Delete User');
d.make_body([
@@ -581,7 +579,7 @@
$ds(this.member_item.working_img);
$dh(this.wrapper);
this.loading = 1;
- $c('webnotes.widgets.form.getdoc', {'name':this.uid, 'doctype':'Profile', 'user':user}, callback); // onload
+ $c('webnotes.widgets.form.load.getdoc', {'name':this.uid, 'doctype':'Profile', 'user':user}, callback); // onload
}
// show / hide
diff --git a/erpnext/home/page/my_company/my_company.py b/erpnext/home/page/my_company/my_company.py
index dcd54e1..9a5f58c 100644
--- a/erpnext/home/page/my_company/my_company.py
+++ b/erpnext/home/page/my_company/my_company.py
@@ -1,6 +1,7 @@
import webnotes
from webnotes.utils import cint, load_json, cstr
+from webnotes.model.doc import Document
try: import json
except: import simplejson as json
@@ -64,8 +65,7 @@
# add profile record
#
def add_profile(args):
- from webnotes.utils import validate_email_add
- from webnotes.model.doc import Document
+ from webnotes.utils import validate_email_add, now
email = args['user']
sql = webnotes.conn.sql
@@ -79,7 +79,7 @@
if sql("select name from tabProfile where name = %s", email):
# exists, enable it
sql("update tabProfile set enabled = 1, docstatus=0 where name = %s", email)
- webnotes.msgprint('Profile exists, enabled it')
+ webnotes.msgprint('Profile exists, enabled it with new password')
else:
# does not exist, create it!
pr = Document('Profile')
@@ -91,11 +91,24 @@
pr.user_type = 'System User'
pr.save(1)
- if args.get('password'):
- sql("""
- UPDATE tabProfile
- SET password = PASSWORD(%s)
- WHERE name = %s""", (args.get('password'), email))
+ if args.get('password'):
+ sql("""
+ UPDATE tabProfile
+ SET password = PASSWORD(%s), modified = %s
+ WHERE name = %s""", (args.get('password'), now, email))
+
+ send_welcome_mail(email, args)
+
+def send_welcome_mail(email, args):
+ """send welcome mail to user with password and login url"""
+ pr = Document('Profile', email)
+ from webnotes.utils.email_lib import sendmail_md
+ args.update({
+ 'company': webnotes.conn.get_default('company'),
+ 'password': password,
+ 'account_url': webnotes.conn.get_default('account_url')
+ })
+ sendmail_md(pr.email, subject="Welcome to ERPNext", msg=welcome_txt % args)
#
# post comment
@@ -165,3 +178,20 @@
else:
webnotes.conn.sql("update tabProfile set password=password(%s) where name=%s", (args['new_password'], args['user']))
else: webnotes.msgprint('Settings Updated')
+
+welcome_txt = """
+## %(company)s
+
+Dear %(first_name)s %(last_name)s
+
+Welcome!
+
+A new account has been created for you, here are your details:
+
+login-id: %(name)s
+password: %(password)s
+
+To login to your new ERPNext account, please go to:
+
+%(account_url)s
+"""
diff --git a/erpnext/home/page/profile_settings/profile_settings.py b/erpnext/home/page/profile_settings/profile_settings.py
index 22af804..ef969ca 100644
--- a/erpnext/home/page/profile_settings/profile_settings.py
+++ b/erpnext/home/page/profile_settings/profile_settings.py
@@ -8,16 +8,12 @@
"""
arg = load_json(arg)
- if cint(webnotes.conn.get_value('Control Panel',None,'sync_with_gateway')):
- import server_tools.gateway_utils
- webnotes.msgprint(server_tools.gateway_utils.change_password(arg['old_password'], arg['new_password'])['message'])
- else:
- if not webnotes.conn.sql('select name from tabProfile where name=%s and password=password(%s)', (webnotes.session['user'], arg['old_password'])):
- webnotes.msgprint('Old password is not correct', raise_exception=1)
+ if not webnotes.conn.sql('select name from tabProfile where name=%s and password=password(%s)', (webnotes.session['user'], arg['old_password'])):
+ webnotes.msgprint('Old password is not correct', raise_exception=1)
- from webnotes.utils import nowdate
- webnotes.conn.sql("update tabProfile set password=password(%s) where name=%s",(arg['new_password'], nowdate(), webnotes.session['user']))
- webnotes.msgprint('Password Updated');
+ from webnotes.utils import nowdate
+ webnotes.conn.sql("update tabProfile set password=password(%s), modified=%s where name=%s",(arg['new_password'], nowdate(), webnotes.session['user']))
+ webnotes.msgprint('Password Updated');
def get_user_details(arg=None):
"""
diff --git a/erpnext/hr/doctype/appraisal/appraisal.js b/erpnext/hr/doctype/appraisal/appraisal.js
index d040c53..78b5fd3 100644
--- a/erpnext/hr/doctype/appraisal/appraisal.js
+++ b/erpnext/hr/doctype/appraisal/appraisal.js
@@ -90,8 +90,6 @@
declare_completed_dialog.refresh_dt = function(){
cur_frm.cscript.refresh(this.doc, this.cdt, this.cdn);
- msgprint("refersh done");
- $c('webnotes.widgets.form.form_header.refresh_labels',this.doc,function(r,rt){});
}
declare_completed_dialog.add = function() {
diff --git a/erpnext/patches/jan_mar_2012/subdomain_login_patch.py b/erpnext/patches/jan_mar_2012/subdomain_login_patch.py
new file mode 100644
index 0000000..5c58b08
--- /dev/null
+++ b/erpnext/patches/jan_mar_2012/subdomain_login_patch.py
@@ -0,0 +1,39 @@
+import webnotes
+from webnotes.model.doc import Document
+from webnotes.modules import reload_doc
+
+def execute():
+ add_default_home_page()
+ reload_doc('setup','doctype','manage_account')
+ webnotes.conn.commit()
+ webnotes.conn.sql("drop table if exists tabDocTrigger")
+ cleanup()
+
+def cleanup():
+ webnotes.conn.begin()
+ from webnotes.model import delete_doc
+ delete_doc("DocType", "SSO Control")
+ delete_doc("DocType", "WN ERP Client Control")
+ delete_doc("DocType", "DocTrigger")
+
+ # cleanup control panel
+ delete_doc("DocType", "Control Panel")
+ reload_doc("core", "doctype", "control_panel")
+
+ # cleanup page
+ delete_doc("DocType", "Control Panel")
+ reload_doc("core", "doctype", "control_panel")
+
+ webnotes.conn.sql("""delete from tabSingles
+ where field like 'startup_%' and doctype='Control Panel'""")
+
+def add_default_home_page():
+ if not webnotes.conn.sql("""select name from `tabDefault Home Page`
+ where role='Guest' and home_page='Login Page'"""):
+ d = Document('Default Home Page')
+ d.parent = 'Control Panel'
+ d.parenttype = 'Control Panel'
+ d.parentfield = 'default_home_pages'
+ d.role = 'Guest'
+ d.home_page = 'Login Page'
+ d.save(1)
diff --git a/erpnext/patches/jan_mar_2012/website.py b/erpnext/patches/jan_mar_2012/website.py
new file mode 100644
index 0000000..ad60cc5
--- /dev/null
+++ b/erpnext/patches/jan_mar_2012/website.py
@@ -0,0 +1,24 @@
+# website patch
+
+import webnotes
+def execute():
+ cleanup_file_data()
+ return
+ update_patch_log()
+ from webnotes.modules import reload_doc
+ reload_doc('website', 'Module Def', 'Website')
+ reload_doc('website', 'Role', 'Website Manager')
+ reload_doc('website', 'doctype', 'home_settings')
+ reload_doc('website', 'doctype', 'top_bar_settings')
+ reload_doc('website', 'doctype', 'top_bar_item')
+ reload_doc('website', 'page', 'home')
+
+def cleanup_file_data():
+ webnotes.conn.commit()
+ webnotes.conn.sql("""alter table `tabFile Data` drop column blob_content""")
+ webnotes.conn.begin()
+
+def update_patch_log():
+ webnotes.conn.commit()
+ webnotes.conn.sql("""alter table __PatchLog engine=InnoDB""")
+ webnotes.conn.begin()
diff --git a/erpnext/projects/page/projects/projects.js b/erpnext/projects/page/projects/projects.js
index 8335869..5f4c52d 100644
--- a/erpnext/projects/page/projects/projects.js
+++ b/erpnext/projects/page/projects/projects.js
@@ -58,7 +58,7 @@
var w = this.make_filter(label,idx);
var i = $a(w, 'input');
- var user_fmt = locals['Control Panel']['Control Panel'].date_format;
+ var user_fmt = wn.control_panel.date_format;
if(!this.user_fmt)this.user_fmt = 'dd-mm-yy';
$(i).datepicker({
diff --git a/erpnext/setup/doctype/manage_account/manage_account.js b/erpnext/setup/doctype/manage_account/manage_account.js
index 7c3b193..63cc1d5 100644
--- a/erpnext/setup/doctype/manage_account/manage_account.js
+++ b/erpnext/setup/doctype/manage_account/manage_account.js
@@ -1,6 +1,6 @@
// Validate
cur_frm.cscript.validate = function(doc, cdt, cdn) {
- $c_obj(make_doclist(cdt, cdn), 'update_cp', '', function(r, rt){
+ $c_obj(make_doclist(cdt, cdn), 'get_defaults', '', function(r, rt){
sys_defaults = r.message;
});
}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/manage_account/manage_account.py b/erpnext/setup/doctype/manage_account/manage_account.py
index 5b1292a..757d323 100644
--- a/erpnext/setup/doctype/manage_account/manage_account.py
+++ b/erpnext/setup/doctype/manage_account/manage_account.py
@@ -1,66 +1,60 @@
-# Please edit this list and import only required elements
+"""Global Defaults"""
import webnotes
-from webnotes.utils import cint, cstr, get_defaults, set_default, fmt_money, get_last_day, get_first_day
-from webnotes import session, form, is_testing, msgprint, errprint
-
-sql = webnotes.conn.sql
-
-
-# -----------------------------------------------------------------------------------------
-
+keydict = {
+ "fiscal_year": "current_fiscal_year",
+ 'company': 'default_company',
+ 'currency': 'default_currency',
+ 'price_list_name': 'default_price_list',
+ 'price_list_currency': 'default_price_list_currency',
+ 'item_group': 'default_item_group',
+ 'customer_group': 'default_customer_group',
+ 'cust_master_name': 'cust_master_name',
+ 'supplier_type': 'default_supplier_type',
+ 'supp_master_name': 'supp_master_name',
+ 'territory': 'default_territory',
+ 'stock_uom': 'default_stock_uom',
+ 'fraction_currency': 'default_currency_fraction',
+ 'valuation_method': 'default_valuation_method',
+ 'date_format': 'date_format',
+ 'currency_format':'default_currency_format',
+ 'account_url':'account_url'
+}
class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+ def __init__(self, d, dl):
+ self.doc, self.doclist = d, dl
-#---------------------------------------------------------------------------------------------------------------------------------------------
- def get_bal(self,arg):
- bal = sql("select `tabAccount Balance`.balance,`tabAccount`.debit_or_credit from `tabAccount`,`tabAccount Balance` where `tabAccount Balance`.account=%s and `tabAccount Balance`.period=%s and `tabAccount Balance`.account=`tabAccount`.name ",(arg,self.doc.current_fiscal_year))
- if bal:
- return fmt_money(flt(bal[0][0])) + ' ' + bal[0][1]
-
-
-# =========================================================================================================================================
-
- # Update Default
- # ---------------
- def set_system_default(self, defkey, defvalue):
- set_default(defkey, defvalue)
-
- if defkey == 'fiscal_year':
- ysd = sql("select year_start_date from `tabFiscal Year` where name=%s", cstr(defvalue))
- ysd = ysd and ysd[0][0] or ''
- if ysd:
- set_default('year_start_date', ysd.strftime('%Y-%m-%d'))
- set_default('year_end_date', get_last_day(get_first_day(ysd,0,11)).strftime('%Y-%m-%d'))
-
-
- # Update
- # --------
- def update_cp(self):
- def_list = [['fiscal_year',self.doc.current_fiscal_year],
- ['company',self.doc.default_company],
- ['currency',self.doc.default_currency],
- ['price_list_name',self.doc.default_price_list or ''],
- ['price_list_currency', self.doc.default_price_list_currency or ''],
- ['item_group',self.doc.default_item_group or ''],
- ['customer_group',self.doc.default_customer_group or ''],
- ['cust_master_name',self.doc.cust_master_name or ''],
- ['supplier_type',self.doc.default_supplier_type or ''],
- ['supp_master_name',self.doc.supp_master_name],
- ['territory',self.doc.default_territory or ''],
- ['stock_uom',self.doc.default_stock_uom or ''],
- ['fraction_currency',self.doc.default_currency_fraction or ''],
- ['valuation_method',self.doc.default_valuation_method]]
-
- for d in def_list:
- self.set_system_default(d[0],d[1])
- # Update Currency Format
+ def get_bal(self,arg):
+ """get account balance (??)"""
+ from webnotes.utils import fmt_money, flt
+ bal = webnotes.conn.sql("select `tabAccount Balance`.balance,`tabAccount`.debit_or_credit from `tabAccount`,`tabAccount Balance` where `tabAccount Balance`.account=%s and `tabAccount Balance`.period=%s and `tabAccount Balance`.account=`tabAccount`.name ",(arg,self.doc.current_fiscal_year))
+ if bal:
+ return fmt_money(flt(bal[0][0])) + ' ' + bal[0][1]
- sql("update `tabSingles` set value = '%s' where field = 'currency_format' and doctype = 'Control Panel'" % self.doc.default_currency_format)
- sql("update `tabSingles` set value = '%s' where field = 'date_format' and doctype = 'Control Panel'" %self.doc.date_format)
-
-
- return get_defaults()
-
+ def validate(self):
+ """validate"""
+ if not (self.doc.account_url and (self.doc.account_url.startswith('http://') \
+ or self.doc.account_url.startswith('https://'))):
+ webnotes.msgprint("Account URL must start with 'http://' or 'https://'", raise_exception=1)
+
+ def on_update(self):
+ """update defaults"""
+ self.validate()
+
+ for key in keydict:
+ webnotes.conn.set_default(key, self.doc.fields.get(keydict[key], ''))
+
+ # update year start date and year end date from fiscal_year
+ ysd = webnotes.conn.sql("""select year_start_date from `tabFiscal Year`
+ where name=%s""", self.doc.fiscal_year)
+
+ ysd = ysd and ysd[0][0] or ''
+ from webnotes.utils import get_first_day, get_last_day
+ if ysd:
+ webnotes.conn.set_default('year_start_date', ysd.strftime('%Y-%m-%d'))
+ webnotes.conn.set_default('year_end_date', \
+ get_last_day(get_first_day(ysd,0,11)).strftime('%Y-%m-%d'))
+
+ def get_defaults(self):
+ return webnotes.conn.get_defaults()
\ No newline at end of file
diff --git a/erpnext/setup/doctype/manage_account/manage_account.txt b/erpnext/setup/doctype/manage_account/manage_account.txt
index 8a156a0..18a9872 100644
--- a/erpnext/setup/doctype/manage_account/manage_account.txt
+++ b/erpnext/setup/doctype/manage_account/manage_account.txt
@@ -5,14 +5,13 @@
{
'creation': '2010-08-08 17:09:09',
'docstatus': 0,
- 'modified': '2011-12-21 13:22:33',
+ 'modified': '2012-01-20 11:25:18',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
-
'_last_update': '1323855502',
'allow_copy': 1,
'allow_email': 1,
@@ -29,7 +28,7 @@
'section_style': 'Tabbed',
'server_code_error': ' ',
'show_in_menu': 1,
- 'version': 515
+ 'version': 517
},
# These values are common for all DocField
@@ -106,6 +105,37 @@
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
+ 'label': 'System'
+ },
+
+ # DocField
+ {
+ 'colour': 'White:FFF',
+ 'description': 'Example: http://frappe.erpnext.com',
+ 'doctype': 'DocField',
+ 'fieldname': 'account_url',
+ 'fieldtype': 'Data',
+ 'label': 'Account URL'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldtype': 'Column Break'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldname': 'sms_sender_name',
+ 'fieldtype': 'Data',
+ 'label': 'SMS Sender Name'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldtype': 'Section Break',
'label': 'Company'
},
@@ -176,14 +206,6 @@
# DocField
{
'doctype': 'DocField',
- 'fieldname': 'sms_sender_name',
- 'fieldtype': 'Data',
- 'label': 'SMS Sender Name'
- },
-
- # DocField
- {
- 'doctype': 'DocField',
'fieldtype': 'Section Break',
'label': 'Stock'
},
@@ -510,4 +532,4 @@
'label': 'Employee Records to be created by ',
'options': '\nNaming Series\nEmployee Number'
}
-]
+]
\ No newline at end of file
diff --git a/erpnext/setup/doctype/notification_control/notification_control.js b/erpnext/setup/doctype/notification_control/notification_control.js
index 2e9bb10..d8133bb 100644
--- a/erpnext/setup/doctype/notification_control/notification_control.js
+++ b/erpnext/setup/doctype/notification_control/notification_control.js
@@ -6,7 +6,7 @@
refresh_field('custom_message');
}
$c_obj('Notification Control','get_message',doc.select_transaction, callback)
- }
+}
}
cur_frm.cscript.notify = function(doc, args) {
diff --git a/erpnext/setup/page/setup/setup.html b/erpnext/setup/page/setup/setup.html
index e60d00b..ec21ab7 100644
--- a/erpnext/setup/page/setup/setup.html
+++ b/erpnext/setup/page/setup/setup.html
@@ -1 +1,3 @@
-<div id="setup_div" class="layout_wrapper"></div>
\ No newline at end of file
+<div id="setup_div" class="layout_wrapper">
+ <div style="margin: 200px auto; text-align: center; color: #888">Loading...</div>
+</div>
\ No newline at end of file
diff --git a/erpnext/setup/page/setup/setup.js b/erpnext/setup/page/setup/setup.js
index b3a195e..d58f11a 100644
--- a/erpnext/setup/page/setup/setup.js
+++ b/erpnext/setup/page/setup/setup.js
@@ -1,9 +1,8 @@
pscript.onload_Setup = function() {
var parent = $i('setup_div');
- add_space_holder(parent);
var callback = function(r,rt){
-
+ $('#setup_div').empty();
// header
parent.page_head = new PageHeader(parent,'Setup');
@@ -11,7 +10,6 @@
var setup_data = new SetupData(r.message);
pscript.setup_make_sections(setup_data);
- remove_space_holder();
}
$c_obj('Setup Wizard Control','get_country','',callback);
}
diff --git a/erpnext/setup_masters/Module Def/Setup Masters/Setup Masters.txt b/erpnext/setup_masters/Module Def/Setup Masters/Setup Masters.txt
new file mode 100644
index 0000000..fe1a048
--- /dev/null
+++ b/erpnext/setup_masters/Module Def/Setup Masters/Setup Masters.txt
@@ -0,0 +1,29 @@
+# Module Def, Setup Masters
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2010-08-08 17:35:42',
+ 'docstatus': 0,
+ 'modified': '2012-01-23 17:04:53',
+ 'modified_by': 'Administrator',
+ 'owner': 'Administrator'
+ },
+
+ # These values are common for all Module Def
+ {
+ 'disabled': 'No',
+ 'doctype': u'Module Def',
+ 'is_hidden': 'No',
+ 'last_updated_date': '2010-11-29 12:02:02',
+ 'module_label': 'Setup Masters',
+ 'module_name': 'Setup Masters',
+ 'name': '__common__'
+ },
+
+ # Module Def, Setup Masters
+ {
+ 'doctype': u'Module Def',
+ 'name': 'Setup Masters'
+ }
+]
\ No newline at end of file
diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py
index 304d2e4..8b1a7cf 100644
--- a/erpnext/startup/event_handlers.py
+++ b/erpnext/startup/event_handlers.py
@@ -2,102 +2,52 @@
import webnotes.defs
from webnotes.utils import cint
-#
-# alias the current user
-#
def on_login(login_manager):
+ """
+ called from login manager, before login
+ """
+ try:
+ if login_manager.user not in ('Guest', None, ''):
+ import server_tools.gateway_utils
+ server_tools.gateway_utils.check_login(login_manager.user)
+ except ImportError:
+ pass
- # login as
- if login_manager.user == 'Administrator':
- user = webnotes.form.getvalue('login_as')
-
- if user:
- # create if missing (due to some bug)
- login_as(user, login_manager)
-
- # alisaing here... so check if the user is disabled
- if not webnotes.conn.sql("select ifnull(enabled,0) from tabProfile where name=%s", user)[0][0]:
- # throw execption
- webnotes.msgprint("Authentication Failed", raise_exception=1)
-
- if hasattr(webnotes.defs, 'validate_ip'):
- msg = getattr(webnotes.defs, 'validate_ip')()
- if msg: webnotes.msgprint(msg, raise_exception=1)
-
- login_manager.user = user
-
-#
-# update account details
-#
-def update_account_details():
- # additional details (if from gateway)
- if webnotes.form_dict.get('is_trial'):
- webnotes.conn.set_global('is_trial', cint(webnotes.form_dict.get('is_trial')))
-
- if webnotes.form_dict.get('days_to_expiry'):
- webnotes.conn.set_global('days_to_expiry', webnotes.form_dict.get('days_to_expiry'))
-
- if webnotes.form_dict.get('first_name'):
- from server_tools.gateway_utils import update_user_details
- update_user_details()
-#
-# save (login from)
-#
def on_login_post_session(login_manager):
- # login from
- if webnotes.form_dict.get('login_from'):
- webnotes.session['data']['login_from'] = webnotes.form.getvalue('login_from')
- webnotes.session_obj.update()
-
+ """
+ called after login
+ update login_from and delete parallel sessions
+ """
# Clear previous sessions i.e. logout previous log-in attempts
- exception_list = ['demo@webnotestech.com', 'Administrator']
+ exception_list = ['demo@webnotestech.com', 'Administrator', 'Guest']
if webnotes.session['user'] not in exception_list:
sid_list = webnotes.conn.sql("""
- SELECT sid
- FROM `tabSessions`
+ DELETE FROM `tabSessions`
WHERE
user=%s AND
- sid!=%s
- ORDER BY lastupdate desc""", \
+ sid!=%s""", \
(webnotes.session['user'], webnotes.session['sid']), as_list=1)
- for sid in sid_list:
- webnotes.conn.sql("DELETE FROM `tabSessions` WHERE sid=%s", sid[0])
- update_account_details()
-
-#
-# logout the user from SSO
-#
-def on_logout(login_manager):
- if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')):
- from server_tools.gateway_utils import logout_sso
- logout_sso(user=login_manager.user)
-
-#
-# create a profile (if logs in for the first time)
-#
-def login_as(user, login_manager):
- import os
+def doclist_all(doc, method):
+ """doclist trigger called from webnotes.model.doclist on any event"""
+ import home
+ home.update_feed(doc, method)
+
+def boot_session(bootinfo):
+ """boot session - send website info if guest"""
import webnotes
- webnotes.session = {'user': user}
- ip = os.environ.get('REMOTE_ADDR')
+ import webnotes.model.doc
+
+ if webnotes.session['user']=='Guest':
+ bootinfo['topbar'] = webnotes.model.doc.getsingle('Top Bar Settings')
+ bootinfo['topbaritems'] = webnotes.conn.sql("""select label, std_page, custom_page, parent_label
+ from `tabTop Bar Item`""", as_dict=1)
+ else:
+ bootinfo['letter_heads'] = get_letter_heads()
- # validate if user is from SSO
- if ip == '72.55.168.105' or 1:
- # if user does not exist, create it
- if not webnotes.conn.sql("select name from tabProfile where name=%s", user):
- from webnotes.model.doc import Document
-
- import webnotes
- import webnotes.utils.webservice
-
- p = Document('Profile')
- p.first_name = webnotes.form_dict.get('first_name')
- p.last_name = webnotes.form_dict.get('last_name')
- p.email = user
- p.name = user
- p.enabled = 1
- p.owner = user
- p.save(1)
-
+def get_letter_heads():
+ """load letter heads with startup"""
+ import webnotes
+ ret = webnotes.conn.sql("select name, content from `tabLetter Head` where ifnull(disabled,0)=0")
+ return dict(ret)
diff --git a/erpnext/startup/feature_setup.js b/erpnext/startup/feature_setup.js
new file mode 100644
index 0000000..ba81cbd
--- /dev/null
+++ b/erpnext/startup/feature_setup.js
@@ -0,0 +1,187 @@
+/* features setup "Dictionary", "Script"
+Dictionary Format
+ 'projects': {
+ 'Sales Order': {
+ 'fields':['project_name'],
+ 'sales_order_details':['projected_qty']
+ },
+ 'Purchase Order': {
+ 'fields':['project_name']
+ }
+ }
+// ====================================================================*/
+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': {
+ 'Delivery Note': {'fields':['packing_details','print_packing_slip','packing_checked_by','packed_by','pack_size','shipping_mark'],'delivery_note_details':['no_of_packs','pack_gross_wt','pack_nett_wt','pack_no','pack_unit']},
+ 'Sales Order': {'fields':['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)
+ {
+ if(sys_defaults[sys_feat]=='0' && (sys_feat in pscript.feature_dict)) //"Features to hide" exists
+ {
+ if(cur_frm.doc.doctype in pscript.feature_dict[sys_feat])
+ {
+ for(fort in pscript.feature_dict[sys_feat][cur_frm.doc.doctype])
+ {
+ if(fort=='fields')
+ hide_field(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]);
+ else if(cur_frm.fields_dict[fort])
+ {
+ for(grid_field in pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort])
+ cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort][grid_field], false);
+ }
+ else
+ msgprint('Grid "'+fort+'" does not exists');
+ }
+ }
+ }
+ }
+})
diff --git a/erpnext/startup/modules.js b/erpnext/startup/modules.js
new file mode 100644
index 0000000..3dd7b3e
--- /dev/null
+++ b/erpnext/startup/modules.js
@@ -0,0 +1,373 @@
+// ====================================================================
+
+pscript.startup_make_sidebar = function() {
+ $y(page_body.left_sidebar, {width:(100/6)+'%', paddingTop:'8px'});
+
+ var callback = function(r,rt) {
+ // menu
+ var ml = r.message;
+
+ // clear
+ page_body.left_sidebar.innerHTML = '';
+
+ for(var m=0; m<ml.length; m++){
+ if(ml[m]) {
+ new SidebarItem(ml[m]);
+ }
+ }
+ if(in_list(user_roles, 'System Manager')) {
+ var div = $a(page_body.left_sidebar, 'div', 'link_type', {padding:'8px', fontSize:'11px'});
+ $(div).html('[edit]').click(pscript.startup_set_module_order)
+ }
+ nav_obj.observers.push({notify:function(t,dt,dn) { pscript.select_sidebar_menu(t, dt, dn); }});
+
+ // select current
+ var no = nav_obj.ol[nav_obj.ol.length-1];
+ if(no && menu_item_map[decodeURIComponent(no[0])][decodeURIComponent(no[1])])
+ pscript.select_sidebar_menu(decodeURIComponent(no[0]), decodeURIComponent(no[1]));
+ }
+ $c_obj('Home Control', 'get_modules', '', callback);
+}
+
+// ====================================================================
+// Menu observer
+// ====================================================================
+
+cur_menu_pointer = null;
+var menu_item_map = {'Form':{}, 'Page':{}, 'Report':{}, 'List':{}}
+
+pscript.select_sidebar_menu = function(t, dt, dn) {
+ // get menu item
+ if(menu_item_map[t][dt]) {
+ // select
+ menu_item_map[t][dt].select();
+ } else {
+ // none found :-( Unselect
+ if(cur_menu_pointer)
+ cur_menu_pointer.deselect();
+ }
+}
+
+// ====================================================================
+// Menu pointer
+// ====================================================================
+
+var body_background = '#e2e2e2';
+
+MenuPointer = function(parent, label) {
+
+ this.wrapper = $a(parent, 'div', '', {padding:'0px', cursor:'pointer', margin:'2px 0px'});
+ $br(this.wrapper, '3px');
+
+ this.tab = make_table($a(this.wrapper, 'div'), 1, 2, '100%', ['', '11px'], {height:'22px',
+ verticalAlign:'middle', padding:'0px'}, {borderCollapse:'collapse', tableLayout:'fixed'});
+
+ $y($td(this.tab, 0, 0), {padding:'0px 4px', color:'#444', whiteSpace:'nowrap'});
+
+ // triangle border (?)
+ this.tab.triangle_div = $a($td(this.tab, 0, 1), 'div','', {
+ borderColor: body_background + ' ' + body_background + ' ' + body_background + ' ' + 'transparent',
+ borderWidth:'11px', borderStyle:'solid', height:'0px', width:'0px', marginRight:'-11px'});
+
+ this.label_area = $a($td(this.tab, 0, 0), 'span', '', '', label);
+
+ $(this.wrapper)
+ .hover(
+ function() { if(!this.selected)$bg(this, '#eee'); } ,
+ function() { if(!this.selected)$bg(this, body_background); }
+ )
+
+ $y($td(this.tab, 0, 0), {borderBottom:'1px solid #ddd'});
+
+}
+
+// ====================================================================
+
+MenuPointer.prototype.select = function(grey) {
+ $y($td(this.tab, 0, 0), {color:'#fff', borderBottom:'0px solid #000'});
+ //$gr(this.wrapper, '#F84', '#F63');
+ $gr(this.wrapper, '#888', '#666');
+ this.selected = 1;
+
+ if(cur_menu_pointer && cur_menu_pointer != this)
+ cur_menu_pointer.deselect();
+
+ cur_menu_pointer = this;
+}
+
+// ====================================================================
+
+MenuPointer.prototype.deselect = function() {
+ $y($td(this.tab, 0, 0), {color:'#444', borderBottom:'1px solid #ddd'});
+ $gr(this.wrapper, body_background, body_background);
+ this.selected = 0;
+}
+
+
+// ====================================================================
+// Sidebar Item
+// ====================================================================
+
+var cur_sidebar_item = null;
+
+SidebarItem = function(det) {
+ var me = this;
+ this.det = det;
+ this.wrapper = $a(page_body.left_sidebar, 'div', '', {marginRight:'12px'});
+
+ this.body = $a(this.wrapper, 'div');
+ this.tab = make_table(this.body, 1, 2, '100%', ['24px', null], {verticalAlign:'middle'}, {tableLayout:'fixed'});
+
+ // icon
+ var ic = $a($td(this.tab, 0, 0), 'div', 'module-icons module-icons-' + det.module_label.toLowerCase(), {marginLeft:'3px', marginBottom:'-2px'});
+
+ // pointer table
+ this.pointer = new MenuPointer($td(this.tab, 0, 1), det.module_label);
+ $y($td(this.pointer.tab, 0, 0), {fontWeight:'bold'});
+
+ // for page type
+ if(det.module_page) {
+ menu_item_map.Page[det.module_page] = this.pointer;
+ }
+
+ // items area
+ this.items_area = $a(this.wrapper, 'div');
+
+ this.body.onclick = function() { me.onclick(); }
+}
+
+// ====================================================================
+
+SidebarItem.prototype.onclick = function() {
+ var me = this;
+
+ if(this.det.module_page) {
+ // page type
+ this.pointer.select();
+
+ $item_set_working(me.pointer.label_area);
+ loadpage(this.det.module_page, function() { $item_done_working(me.pointer.label_area); });
+
+ } else {
+ // show sub items
+ this.toggle();
+ }
+}
+
+// ====================================================================
+
+SidebarItem.prototype.collapse = function() {
+ $(this.items_area).slideUp();
+ this.is_open = 0;
+ $fg(this.pointer.label_area, '#444')
+}
+
+// ====================================================================
+
+SidebarItem.prototype.toggle = function() {
+ if(this.loading) return;
+
+ if(this.is_open) {
+ this.collapse();
+ } else {
+ if(this.loaded) $(this.items_area).slideDown();
+ else this.show_items();
+ this.is_open = 1;
+ $fg(this.pointer.label_area, '#000')
+ //this.pointer.select(1);
+
+ // close existing open
+ if(cur_sidebar_item && cur_sidebar_item != this) {
+ cur_sidebar_item.collapse();
+ }
+ cur_sidebar_item = this;
+ }
+}
+
+// ====================================================================
+
+SidebarItem.prototype.show_items = function() {
+ this.loading = 1;
+ var me = this;
+
+ $item_set_working(this.pointer.label_area);
+ var callback = function(r,rt){
+ me.loaded = 1;
+ me.loading = 0;
+ var smi = null;
+ var has_reports = 0;
+ var has_tools = 0;
+
+ // widget code
+ $item_done_working(me.pointer.label_area);
+
+ if(r.message.il) {
+ me.il = r.message.il;
+
+ // forms
+ for(var i=0; i<me.il.length;i++){
+ if(me.il[i].doc_type == 'Forms') {
+ if(in_list(profile.can_read, me.il[i].doc_name)) {
+ var smi = new SidebarModuleItem(me, me.il[i]);
+
+ menu_item_map['Form'][me.il[i].doc_name] = smi.pointer;
+ menu_item_map['List'][me.il[i].doc_name] = smi.pointer;
+ }
+ }
+ if(me.il[i].doc_type=='Reports') has_reports = 1;
+ if(in_list(['Single DocType', 'Pages', 'Setup Forms'], me.il[i].doc_type))
+ has_tools = 1;
+ }
+ // reports
+ if(has_reports) {
+ var smi = new SidebarModuleItem(me, {doc_name:'Reports', doc_type:'Reports'});
+
+ // add to menu-item mapper
+ menu_item_map['Page'][me.det.module_label + ' Reports'] = smi.pointer;
+ }
+
+ // tools
+ if(has_tools) {
+ var smi = new SidebarModuleItem(me, {doc_name:'Tools', doc_type:'Tools'});
+
+ // add to menu-item mapper
+ menu_item_map['Page'][me.det.module_label + ' Tools'] = smi.pointer;
+ }
+
+ // custom reports
+ if(r.message.custom_reports.length) {
+ me.il = add_lists(r.message.il, r.message.custom_reports);
+ var smi = new SidebarModuleItem(me, {doc_name:'Custom Reports', doc_type:'Custom Reports'});
+
+ // add to menu-item mapper
+ menu_item_map['Page'][me.det.module_label + ' Custom Reports'] = smi.pointer;
+ }
+ }
+
+
+ $(me.items_area).slideDown();
+
+ // high light
+ var no = nav_obj.ol[nav_obj.ol.length-1];
+ if(no && menu_item_map[decodeURIComponent(no[0])][decodeURIComponent(no[1])])
+ pscript.select_sidebar_menu(decodeURIComponent(no[0]), decodeURIComponent(no[1]));
+
+ }
+
+ $c_obj('Home Control', 'get_module_details', me.det.name, callback);
+}
+
+// ====================================================================
+// Show Reports
+// ====================================================================
+
+SidebarItem.prototype.show_section = function(sec_type) {
+ var me = this;
+ var label = this.det.module_label + ' ' + sec_type;
+ var type_map = {'Reports':'Reports', 'Custom Reports':'Custom Reports', 'Pages':'Tools', 'Single DocType':'Tools', 'Setup Forms':'Tools'}
+
+ if(page_body.pages[label]) {
+ loadpage(label, null, 1);
+ } else {
+ // make the reports page
+ var page = page_body.add_page(label);
+ this.wrapper = $a(page,'div','layout_wrapper');
+
+
+ // head
+ this.head = new PageHeader(this.wrapper, label);
+
+ // body
+ this.body1 = $a(this.wrapper, 'div', '', {marginTop:'16px'});
+
+ // add a report link
+ var add_link = function(det) {
+ var div = $a(me.body1, 'div', '', {marginBottom:'6px'});
+ var span = $a(div, 'span', 'link_type');
+
+ // tag the span
+ span.innerHTML = det.display_name; span.det = det;
+ if(sec_type=='Reports' || sec_type=='Custom Reports') {
+ // Reports
+ // -------
+ span.onclick = function() { loadreport(this.det.doc_name, this.det.display_name); }
+
+ } else {
+ // Tools
+ // -----
+
+ if(det.doc_type=='Pages') {
+ // Page
+ if(det.click_function) {
+ span.onclick = function() { eval(this.det.click_function) }
+ span.click_function = det.click_function;
+ } else {
+ span.onclick = function() { loadpage(this.det.doc_name); }
+ }
+ } else if(det.doc_type=='Setup Forms') {
+ // Doc Browser
+ span.onclick = function() { loaddocbrowser(this.det.doc_name); }
+ } else {
+ // Single
+ span.onclick = function() { loaddoc(this.det.doc_name, this.det.doc_name); }
+ }
+ }
+ }
+
+ // item list
+ for(var i=0; i<me.il.length;i++){
+ if(type_map[me.il[i].doc_type] == sec_type) {
+ add_link(me.il[i]);
+ }
+ }
+ loadpage(label, null, 1);
+ }
+}
+
+
+// ====================================================================
+// Sidebar module item
+// ====================================================================
+
+SidebarModuleItem = function(si, det) {
+ this.det = det;
+ var me= this;
+
+ this.pointer = new MenuPointer(si.items_area, get_doctype_label(det.doc_name));
+ $y(si.items_area, {marginLeft:'32px'})
+ $y($td(this.pointer.tab, 0, 0), {fontSize:'11px'});
+
+ this.pointer.wrapper.onclick = function() {
+ if(me.det.doc_type=='Forms')
+ loaddocbrowser(det.doc_name);
+ else
+ si.show_section(me.det.doc_type);
+ }
+}
+
+
+// ====================================================================
+// Drag & Drop order selection
+// ====================================================================
+
+pscript.startup_set_module_order = function() {
+ var update_order= function(ml) {
+ mdict = {};
+ for(var i=0; i<ml.length; i++) {
+ mdict[ml[i][3][3]] = {'module_seq':ml[i][1], 'is_hidden':(ml[i][2] ? 'No' : 'Yes')}
+ }
+ $c_obj('Home Control', 'set_module_order', JSON.stringify(mdict), function(r,rt) { pscript.startup_make_sidebar(); } )
+ }
+
+ var callback = function(r, rt) {
+ var ml = [];
+ for(var i=0; i<r.message.length; i++) {
+ var det = r.message[i];
+ ml.push([det[1], det[2], (det[3]!='No' ? 0 : 1), det[0]]);
+ }
+ new ListSelector('Set Module Sequence', 'Select items and set the order you want them to appear'+
+ '<br><b>Note:</b> <i>These changes will apply to all users!</i>', ml, update_order, 1);
+ }
+ $c_obj('Home Control', 'get_module_order', '', callback)
+
+}
diff --git a/erpnext/startup/startup.css b/erpnext/startup/startup.css
index 7b2b6e5..f7aff1c 100644
--- a/erpnext/startup/startup.css
+++ b/erpnext/startup/startup.css
@@ -12,22 +12,14 @@
background-color: #e2e2e2;
}
-.layout_wrapper {
- padding: 13px;
- margin: 7px;
- -moz-box-shadow: 1px 1px 6px #AAA;
- -webkit-box-shadow: 1px 1px 6px #AAA;
- box-shadow: 1px 1px 6px #AAA;
- background-color: #FFF;
+.erpnext-footer {
+ margin: 3px auto;
+ color: #888;
+ text-align: center;
}
-#birthday_area {
- display: none;
- padding: 4px;
- margin-bottom: 8px;
- background-color: #FDD;
- padding: 4px;
- color: #644;
+.erpnext-footer a, .erpnext-footer a:hover, .erpnext-footer a:visited {
+ color: #666;
}
.module-icons {
diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js
index 5a66ec6..f97eb39 100644
--- a/erpnext/startup/startup.js
+++ b/erpnext/startup/startup.js
@@ -1,461 +1,41 @@
-if(user == 'Guest'){
- $dh(page_body.left_sidebar);
-}
-
var current_module;
var is_system_manager = 0;
var module_content_dict = {};
var user_full_nm = {};
-// check if session user is system manager
-if(inList(user_roles,'System Manager')) is_system_manager = 1;
+wn.provide('erpnext.startup');
-function startup_setup() {
- pscript.is_erpnext_saas = cint(locals['Control Panel']['Control Panel'].sync_with_gateway)
+erpnext.startup.set_globals = function() {
+ pscript.is_erpnext_saas = cint(wn.control_panel.sync_with_gateway)
+ if(inList(user_roles,'System Manager')) is_system_manager = 1;
+}
+erpnext.startup.start = function() {
+ $('#startup_div').html('Starting up...').toggle(true);
+
+ erpnext.startup.set_globals();
+
+ if(user == 'Guest'){
+ $dh(page_body.left_sidebar);
+ wn.require('erpnext/website/css/website.css');
+ wn.require('erpnext/website/js/topbar.js');
+ } else {
+ // modules
+ wn.require('erpnext/startup/modules.js');
+ pscript.startup_make_sidebar();
- if(get_url_arg('embed')) {
- // hide header, footer
- $dh(page_body.banner_area);
- $dh(page_body.wntoolbar);
- $dh(page_body.footer);
- return;
+ // setup toolbar
+ wn.require('erpnext/startup/toolbar.js');
+ erpnext.toolbar.setup();
+ wn.require('erpnext/startup/feature_setup.js');
}
-
- if(user=='Guest' && !get_url_arg('akey')) {
- if(pscript.is_erpnext_saas) {
- window.location.href = 'https://www.erpnext.com';
- return;
- }
- }
-
- // page structure
- // --------------
- $td(page_body.wntoolbar.body_tab,0,0).innerHTML = '<i><b>erp</b>next</i>';
- $y($td(page_body.wntoolbar.body_tab,0,0), {width:'140px', color:'#FFF', paddingLeft:'8px', paddingRight:'8px', fontSize:'14px'})
- $dh(page_body.banner_area);
-
- // sidebar
- // -------
- pscript.startup_make_sidebar();
-
+
// border to the body
// ------------------
- $dh(page_body.footer);
+ $('footer').html('<div class="erpnext-footer">\
+ Powered by <a href="https://erpnext.com">ERPNext</a></div>');
- // setup toolbar
- pscript.startup_setup_toolbar();
-}
-
-// ====================================================================
-
-pscript.startup_make_sidebar = function() {
- $y(page_body.left_sidebar, {width:(100/6)+'%', paddingTop:'8px'});
-
- var callback = function(r,rt) {
- // menu
- var ml = r.message;
-
- // login-file
- if(r.login_url){
- login_file = 'http://' + r.login_url;
- }
- else if(pscript.is_erpnext_saas) {
- login_file = 'https://www.erpnext.com';
- }
-
- // clear
- page_body.left_sidebar.innerHTML = '';
-
- for(var m=0; m<ml.length; m++){
- if(ml[m]) {
- new SidebarItem(ml[m]);
- }
- }
- if(in_list(user_roles, 'System Manager')) {
- var div = $a(page_body.left_sidebar, 'div', 'link_type', {padding:'8px', fontSize:'11px'});
- $(div).html('[edit]').click(pscript.startup_set_module_order)
- }
- nav_obj.observers.push({notify:function(t,dt,dn) { pscript.select_sidebar_menu(t, dt, dn); }});
-
- // select current
- var no = nav_obj.ol[nav_obj.ol.length-1];
- if(no && menu_item_map[decodeURIComponent(no[0])][decodeURIComponent(no[1])])
- pscript.select_sidebar_menu(decodeURIComponent(no[0]), decodeURIComponent(no[1]));
- }
- $c_obj('Home Control', 'get_modules', '', callback);
-}
-
-// ====================================================================
-// Menu observer
-// ====================================================================
-
-cur_menu_pointer = null;
-var menu_item_map = {'Form':{}, 'Page':{}, 'Report':{}, 'List':{}}
-
-pscript.select_sidebar_menu = function(t, dt, dn) {
- // get menu item
- if(menu_item_map[t][dt]) {
- // select
- menu_item_map[t][dt].select();
- } else {
- // none found :-( Unselect
- if(cur_menu_pointer)
- cur_menu_pointer.deselect();
- }
-}
-
-// ====================================================================
-// Menu pointer
-// ====================================================================
-
-var body_background = '#e2e2e2';
-
-MenuPointer = function(parent, label) {
-
- this.wrapper = $a(parent, 'div', '', {padding:'0px', cursor:'pointer', margin:'2px 0px'});
- $br(this.wrapper, '3px');
-
- this.tab = make_table($a(this.wrapper, 'div'), 1, 2, '100%', ['', '11px'], {height:'22px',
- verticalAlign:'middle', padding:'0px'}, {borderCollapse:'collapse', tableLayout:'fixed'});
-
- $y($td(this.tab, 0, 0), {padding:'0px 4px', color:'#444', whiteSpace:'nowrap'});
-
- // triangle border (?)
- this.tab.triangle_div = $a($td(this.tab, 0, 1), 'div','', {
- borderColor: body_background + ' ' + body_background + ' ' + body_background + ' ' + 'transparent',
- borderWidth:'11px', borderStyle:'solid', height:'0px', width:'0px', marginRight:'-11px'});
-
- this.label_area = $a($td(this.tab, 0, 0), 'span', '', '', label);
-
- $(this.wrapper)
- .hover(
- function() { if(!this.selected)$bg(this, '#eee'); } ,
- function() { if(!this.selected)$bg(this, body_background); }
- )
-
- $y($td(this.tab, 0, 0), {borderBottom:'1px solid #ddd'});
-
-}
-
-// ====================================================================
-
-MenuPointer.prototype.select = function(grey) {
- $y($td(this.tab, 0, 0), {color:'#fff', borderBottom:'0px solid #000'});
- //$gr(this.wrapper, '#F84', '#F63');
- $gr(this.wrapper, '#888', '#666');
- this.selected = 1;
-
- if(cur_menu_pointer && cur_menu_pointer != this)
- cur_menu_pointer.deselect();
-
- cur_menu_pointer = this;
-}
-
-// ====================================================================
-
-MenuPointer.prototype.deselect = function() {
- $y($td(this.tab, 0, 0), {color:'#444', borderBottom:'1px solid #ddd'});
- $gr(this.wrapper, body_background, body_background);
- this.selected = 0;
-}
-
-
-// ====================================================================
-// Sidebar Item
-// ====================================================================
-
-var cur_sidebar_item = null;
-
-SidebarItem = function(det) {
- var me = this;
- this.det = det;
- this.wrapper = $a(page_body.left_sidebar, 'div', '', {marginRight:'12px'});
-
- this.body = $a(this.wrapper, 'div');
- this.tab = make_table(this.body, 1, 2, '100%', ['24px', null], {verticalAlign:'middle'}, {tableLayout:'fixed'});
-
- // icon
- var ic = $a($td(this.tab, 0, 0), 'div', 'module-icons module-icons-' + det.module_label.toLowerCase(), {marginLeft:'3px', marginBottom:'-2px'});
-
- // pointer table
- this.pointer = new MenuPointer($td(this.tab, 0, 1), det.module_label);
- $y($td(this.pointer.tab, 0, 0), {fontWeight:'bold'});
-
- // for page type
- if(det.module_page) {
- menu_item_map.Page[det.module_page] = this.pointer;
- }
-
- // items area
- this.items_area = $a(this.wrapper, 'div');
-
- this.body.onclick = function() { me.onclick(); }
-}
-
-// ====================================================================
-
-SidebarItem.prototype.onclick = function() {
- var me = this;
-
- if(this.det.module_page) {
- // page type
- this.pointer.select();
-
- $item_set_working(me.pointer.label_area);
- loadpage(this.det.module_page, function() { $item_done_working(me.pointer.label_area); });
-
- } else {
- // show sub items
- this.toggle();
- }
-}
-
-// ====================================================================
-
-SidebarItem.prototype.collapse = function() {
- $(this.items_area).slideUp();
- this.is_open = 0;
- $fg(this.pointer.label_area, '#444')
-}
-
-// ====================================================================
-
-SidebarItem.prototype.toggle = function() {
- if(this.loading) return;
-
- if(this.is_open) {
- this.collapse();
- } else {
- if(this.loaded) $(this.items_area).slideDown();
- else this.show_items();
- this.is_open = 1;
- $fg(this.pointer.label_area, '#000')
- //this.pointer.select(1);
-
- // close existing open
- if(cur_sidebar_item && cur_sidebar_item != this) {
- cur_sidebar_item.collapse();
- }
- cur_sidebar_item = this;
- }
-}
-
-// ====================================================================
-
-SidebarItem.prototype.show_items = function() {
- this.loading = 1;
- var me = this;
-
- $item_set_working(this.pointer.label_area);
- var callback = function(r,rt){
- me.loaded = 1;
- me.loading = 0;
- var smi = null;
- var has_reports = 0;
- var has_tools = 0;
-
- // widget code
- $item_done_working(me.pointer.label_area);
-
- if(r.message.il) {
- me.il = r.message.il;
-
- // forms
- for(var i=0; i<me.il.length;i++){
- if(me.il[i].doc_type == 'Forms') {
- if(in_list(profile.can_read, me.il[i].doc_name)) {
- var smi = new SidebarModuleItem(me, me.il[i]);
-
- menu_item_map['Form'][me.il[i].doc_name] = smi.pointer;
- menu_item_map['List'][me.il[i].doc_name] = smi.pointer;
- }
- }
- if(me.il[i].doc_type=='Reports') has_reports = 1;
- if(in_list(['Single DocType', 'Pages', 'Setup Forms'], me.il[i].doc_type)) has_tools = 1;
- }
- // reports
- if(has_reports) {
- var smi = new SidebarModuleItem(me, {doc_name:'Reports', doc_type:'Reports'});
-
- // add to menu-item mapper
- menu_item_map['Page'][me.det.module_label + ' Reports'] = smi.pointer;
- }
-
- // tools
- if(has_tools) {
- var smi = new SidebarModuleItem(me, {doc_name:'Tools', doc_type:'Tools'});
-
- // add to menu-item mapper
- menu_item_map['Page'][me.det.module_label + ' Tools'] = smi.pointer;
- }
-
- // custom reports
- if(r.message.custom_reports.length) {
- me.il = add_lists(r.message.il, r.message.custom_reports);
- var smi = new SidebarModuleItem(me, {doc_name:'Custom Reports', doc_type:'Custom Reports'});
-
- // add to menu-item mapper
- menu_item_map['Page'][me.det.module_label + ' Custom Reports'] = smi.pointer;
- }
- }
-
-
- $(me.items_area).slideDown();
-
- // high light
- var no = nav_obj.ol[nav_obj.ol.length-1];
- if(no && menu_item_map[decodeURIComponent(no[0])][decodeURIComponent(no[1])])
- pscript.select_sidebar_menu(decodeURIComponent(no[0]), decodeURIComponent(no[1]));
-
- }
-
- $c_obj('Home Control', 'get_module_details', me.det.name, callback);
-}
-
-// ====================================================================
-// Show Reports
-// ====================================================================
-
-SidebarItem.prototype.show_section = function(sec_type) {
- var me = this;
- var label = this.det.module_label + ' ' + sec_type;
- var type_map = {'Reports':'Reports', 'Custom Reports':'Custom Reports', 'Pages':'Tools', 'Single DocType':'Tools', 'Setup Forms':'Tools'}
-
- if(page_body.pages[label]) {
- loadpage(label, null, 1);
- } else {
- // make the reports page
- var page = page_body.add_page(label);
- this.wrapper = $a(page,'div','layout_wrapper');
-
-
- // head
- this.head = new PageHeader(this.wrapper, label);
-
- // body
- this.body1 = $a(this.wrapper, 'div', '', {marginTop:'16px'});
-
- // add a report link
- var add_link = function(det) {
- var div = $a(me.body1, 'div', '', {marginBottom:'6px'});
- var span = $a(div, 'span', 'link_type');
-
- // tag the span
- span.innerHTML = det.display_name; span.det = det;
- if(sec_type=='Reports' || sec_type=='Custom Reports') {
- // Reports
- // -------
- span.onclick = function() { loadreport(this.det.doc_name, this.det.display_name); }
-
- } else {
- // Tools
- // -----
-
- if(det.doc_type=='Pages') {
- // Page
- if(det.click_function) {
- span.onclick = function() { eval(this.det.click_function) }
- span.click_function = det.click_function;
- } else {
- span.onclick = function() { loadpage(this.det.doc_name); }
- }
- } else if(det.doc_type=='Setup Forms') {
- // Doc Browser
- span.onclick = function() { loaddocbrowser(this.det.doc_name); }
- } else {
- // Single
- span.onclick = function() { loaddoc(this.det.doc_name, this.det.doc_name); }
- }
- }
- }
-
- // item list
- for(var i=0; i<me.il.length;i++){
- if(type_map[me.il[i].doc_type] == sec_type) {
- add_link(me.il[i]);
- }
- }
- loadpage(label, null, 1);
- }
-}
-
-
-// ====================================================================
-// Sidebar module item
-// ====================================================================
-
-SidebarModuleItem = function(si, det) {
- this.det = det;
- var me= this;
-
- this.pointer = new MenuPointer(si.items_area, get_doctype_label(det.doc_name));
- $y(si.items_area, {marginLeft:'32px'})
- $y($td(this.pointer.tab, 0, 0), {fontSize:'11px'});
-
- this.pointer.wrapper.onclick = function() {
- if(me.det.doc_type=='Forms')
- loaddocbrowser(det.doc_name);
- else
- si.show_section(me.det.doc_type);
- }
-}
-
-
-// ====================================================================
-// Drag & Drop order selection
-// ====================================================================
-
-pscript.startup_set_module_order = function() {
- var update_order= function(ml) {
- mdict = {};
- for(var i=0; i<ml.length; i++) {
- mdict[ml[i][3][3]] = {'module_seq':ml[i][1], 'is_hidden':(ml[i][2] ? 'No' : 'Yes')}
- }
- $c_obj('Home Control', 'set_module_order', JSON.stringify(mdict), function(r,rt) { pscript.startup_make_sidebar(); } )
- }
-
- var callback = function(r, rt) {
- var ml = [];
- for(var i=0; i<r.message.length; i++) {
- var det = r.message[i];
- ml.push([det[1], det[2], (det[3]!='No' ? 0 : 1), det[0]]);
- }
- new ListSelector('Set Module Sequence', 'Select items and set the order you want them to appear'+
- '<br><b>Note:</b> <i>These changes will apply to all users!</i>', ml, update_order, 1);
- }
- $c_obj('Home Control', 'get_module_order', '', callback)
-
-}
-
-// ====================================================================
-
-pscript.startup_setup_toolbar = function() {
- var menu_tab = page_body.wntoolbar.menu_table_right;
- // help
- // ----
- $td(menu_tab,0,0).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://erpnext.blogspot.com/2011/03/erpnext-help.html" target="_blank">Help</a>';
-
- $td(menu_tab,0,1).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://groups.google.com/group/erpnext-user-forum" target="_blank">Forum</a>';
-
- if(pscript.is_erpnext_saas){
- // Live Chat Help
- // --------------
- $td(menu_tab,0,2).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">Chat</a>';
-
- // Manage account
- // --------------
- if(is_system_manager) {
- $td(menu_tab,0,3).innerHTML = '<a style="font-weight: bold; color: #FFF;" href="#!billing">Billing</a>';
- }
- }
- else{
- $dh($td(menu_tab,0,2));
- $dh($td(menu_tab,0,3));
- }
-
- $y(cell, page_body.wntoolbar.right_table_style);
-
+ $('#startup_div').toggle(false);
}
// chart of accounts
@@ -496,224 +76,5 @@
if(callback) this.callback = function(){ callback(); }
}
-
-// get plural
-// ====================================================================
-
-get_plural = function(str){
- if(str.charAt(str.length-1).toLowerCase() == 'y') return str.substr(0, str.length-1) + 'ies'
- else return str + 's';
-}
-
-// set user fullname
-// ====================================================================
-pscript.set_user_fullname = function(ele,username,get_latest){
-
- var set_it = function(){
- if(ele)
- ele.innerHTML = user_full_nm[username];
- }
-
- if(get_latest){
- $c_obj('Home Control','get_user_fullname',username, function(r,rt){ user_full_nm[username] = r.message; set_it(); });
- }
- else{
- if(user_full_nm[username]){
- set_it();
- }
-
- else
- $c_obj('Home Control','get_user_fullname',username, function(r,rt){ user_full_nm[username] = r.message; set_it(); });
- }
-}
-
-// ====================================================================
-startup_setup();
-
-/* features setup "Dictionary", "Script"
-Dictionary Format
- 'projects': {
- 'Sales Order': {
- 'fields':['project_name'],
- 'sales_order_details':['projected_qty']
- },
- 'Purchase Order': {
- 'fields':['project_name']
- }
- }
-// ====================================================================*/
-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': {
- 'Delivery Note': {'fields':['packing_details','print_packing_slip','packing_checked_by','packed_by','pack_size','shipping_mark'],'delivery_note_details':['no_of_packs','pack_gross_wt','pack_nett_wt','pack_no','pack_unit']},
- 'Sales Order': {'fields':['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)
- {
- if(sys_defaults[sys_feat]=='0' && (sys_feat in pscript.feature_dict)) //"Features to hide" exists
- {
- if(cur_frm.doc.doctype in pscript.feature_dict[sys_feat])
- {
- for(fort in pscript.feature_dict[sys_feat][cur_frm.doc.doctype])
- {
- if(fort=='fields')
- hide_field(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]);
- else if(cur_frm.fields_dict[fort])
- {
- for(grid_field in pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort])
- cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort][grid_field], false);
- }
- else
- msgprint('Grid "'+fort+'" does not exists');
- }
- }
- }
- }
-})
+// start
+erpnext.startup.start();
\ No newline at end of file
diff --git a/erpnext/startup/toolbar.js b/erpnext/startup/toolbar.js
new file mode 100644
index 0000000..49738ce
--- /dev/null
+++ b/erpnext/startup/toolbar.js
@@ -0,0 +1,27 @@
+/* toolbar settings */
+wn.provide('erpnext.toolbar');
+
+erpnext.toolbar.setup = function() {
+ // profile
+ $('#toolbar-user').append('<li><a href="#profile-settings">Profile Settings</a></li>')
+
+ // help
+ $('.topbar .secondary-nav').append('<li class="dropdown">\
+ <a class="dropdown-toggle" href="#" onclick="return false;">Help</a>\
+ <ul class="dropdown-menu" id="toolbar-help">\
+ </ul></li>')
+
+ $('#toolbar-help').append('<li><a href="http://erpnext.blogspot.com/2011/03/erpnext-help.html" target="_blank">\
+ Documentation</a></li>')
+
+ $('#toolbar-help').append('<li><a href="http://groups.google.com/group/erpnext-user-forum" target="_blank">\
+ Forum</a></li>')
+
+ $('#toolbar-help').append('<li><a href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">\
+ Live Chat (Office Hours)</a></li>')
+
+ // billing
+ if(pscript.is_erpnext_saas && is_system_manager) {
+ $('#toolbar-user').append('<li><a href="#billing">Billing</a></li>')
+ }
+}
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/profile_control/profile_control.py b/erpnext/utilities/doctype/profile_control/profile_control.py
index 189d8b1..b8db231 100644
--- a/erpnext/utilities/doctype/profile_control/profile_control.py
+++ b/erpnext/utilities/doctype/profile_control/profile_control.py
@@ -22,66 +22,9 @@
self.doc, self.doclist = d,dl
self.last_profile = None
- # Sync Profile with Gateway
- # -------------------------
- def sync_with_gateway(self,pid):
- p = Document('Profile',pid)
-
- # login to gateway
- from webnotes.utils.webservice import FrameworkServer
- fw = FrameworkServer('www.erpnext.com','/','__system@webnotestech.com','password',https=1)
-
- account_id = sql("select value from tabSingles where doctype='Control Panel' and field='account_id'")[0][0]
-
- # call add profile
- ret = fw.runserverobj('Profile Control','Profile Control','add_profile_gateway',str([p.first_name, p.middle_name, p.last_name, p.email, p.name, account_id]))
-
- if ret.get('exc'):
- msgprint(ret['exc'])
- raise Exception
-
def get_role_permission(self,role):
perm = sql("select distinct t1.`parent`, t1.`read`, t1.`write`, t1.`create`, t1.`submit`,t1.`cancel`,t1.`amend` from `tabDocPerm` t1, `tabDocType` t2 where t1.`role` ='%s' and t1.docstatus !=2 and t1.permlevel = 0 and t1.`read` = 1 and t2.module != 'Recycle Bin' and t1.parent=t2.name "%role)
return perm or ''
-
-
- # Check if password is expired
- # --------------------------------
- def has_pwd_expired(self):
- if session['user'] != 'Administrator' and session['user'].lower() != 'demo':
- last_pwd_date = None
- try:
- last_pwd_date = sql("select password_last_updated from tabProfile where name=%s",session['user'])[0][0] or ''
- except:
- return 'No'
- if cstr(last_pwd_date) == '':
- sql("update tabProfile set password_last_updated = '%s' where name='%s'"% (nowdate(),session['user']))
- return 'No'
- else:
- date_diff = (getdate(nowdate()) - last_pwd_date).days
- expiry_period = sql("select value from tabSingles where doctype='Control Panel' and field='password_expiry_days'")
- if expiry_period and cint(expiry_period[0][0]) and cint(expiry_period[0][0]) < date_diff:
- return 'Yes'
- return 'No'
-
- def reset_password(self,pwd):
- if sql("select name from tabProfile where password=PASSWORD(%s) and name=%s", (pwd,session['user'])):
- return 'Password cannot be same as old password'
- sql("update tabProfile set password=PASSWORD(%s),password_last_updated=%s where name = %s", (pwd,nowdate(),session['user']))
- return 'ok'
-
-#-------------------------------------------------------------------------------------------------------
- #functions for manage user page
- #-----------Enable/Disable Profile-----------------------------------------------------------------------------------------------
- def change_login(self,args):
- args = eval(args)
-
- if cint(args['set_disabled'])==0:
- sql("update `tabProfile` set enabled=1 where name='%s'"%args['user'])
- else:
- sql("update `tabProfile` set enabled=0 where name='%s'"%args['user'])
-
- return 'ok'
#------------return role list -------------------------------------------------------------------------------------------------
# All roles of Role Master
@@ -113,75 +56,3 @@
pr.parentfield = 'userroles'
pr.save(1)
-
-
- # Add new member
- # ---------------
- def add_profile(self,arg):
-
- # Check credit balance
- get_obj('WN ERP Client Control').check_credit_balance()
-
- arg=eval(arg)
- pr=Document('Profile')
- for d in arg.keys():
- if d!='role':
- pr.fields[d] = arg[d]
-
- pr.enabled=0
- pr.user_type='System User'
- pr.save(1)
- pr_obj = get_obj('Profile',pr.name)
- if (pr.name):
- msg="New member is added"
- pr_obj.on_update()
- else:
- msg="Profile not created"
-
- return cstr(msg)
-
- # to find currently login user
- def current_login(self):
- cl_list=sql("select distinct user from tabSessions")
- if cl_list:
- cl_list=[x[0] for x in cl_list]
-
- return cl_list
-
-
- # Remove Profile
- # ---------------
- def remove_profile(self, user):
- # delete profile
- webnotes.model.delete_doc('Profile',user)
-
- # Update WN ERP Client Control
- sql("update tabSingles set value = value - 1 where field = 'total_users' and doctype = 'WN ERP Client Control'")
-
- # login to gateway
- from webnotes.utils.webservice import FrameworkServer
- fw = FrameworkServer('www.erpnext.com','/','__system@webnotestech.com','password',https=1)
-
- account_id = sql("select value from tabSingles where doctype='Control Panel' and field='account_id'")[0][0]
-
- # call remove profile
- ret = fw.runserverobj('Profile Control','Profile Control','remove_app_sub',str([user, account_id, session['user']]))
-
- if ret.get('exc'):
- msgprint(ret['exc'])
- raise Exception
-
- return "User Removed Successfully"
-
-
- # Create Profile
- # ---------------
- def create_profile(self, email):
- if sql("select name from tabProfile where name = %s", email):
- sql("update tabProfile set docstatus = 0 where name = %s", email)
- else:
- pr = Document('Profile')
- pr.email = email
- pr.enabled=0
- pr.user_type='System User'
- pr.save(1)
diff --git a/erpnext/utilities/doctype/sso_control/sso_control.py b/erpnext/utilities/doctype/sso_control/sso_control.py
deleted file mode 100644
index bfc0e43..0000000
--- a/erpnext/utilities/doctype/sso_control/sso_control.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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
-
-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):
- self.doc, self.doclist = d, dl
-
- def logout_sso(self):
- import webnotes
- import webnotes.utils.webservice
-
- if session['data'].get('login_from'):
- sso = webnotes.utils.webservice.FrameworkServer(session['data'].get('login_from'), '/', '__system@webnotestech.com', 'password')
- sso.runserverobj('SSO Control', 'SSO Control', 'logout_user', session['user'])
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/sso_control.txt b/erpnext/utilities/doctype/sso_control/sso_control.txt
deleted file mode 100644
index ee0224e..0000000
--- a/erpnext/utilities/doctype/sso_control/sso_control.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-# DocType, SSO Control
-[
-
- # These values are common in all dictionaries
- {
- 'creation': '2010-08-08 17:09:24',
- 'docstatus': 0,
- 'modified': '2010-12-20 19:44:29',
- 'modified_by': 'umair@iwebnotes.com',
- 'owner': 'Administrator'
- },
-
- # These values are common for all DocType
- {
- 'colour': 'White:FFF',
- 'doctype': 'DocType',
- 'issingle': 1,
- 'module': 'Utilities',
- 'name': '__common__',
- 'section_style': 'Simple',
- 'server_code_error': ' ',
- 'version': 1
- },
-
- # DocType, SSO Control
- {
- 'doctype': 'DocType',
- 'name': 'SSO Control'
- }
-]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/wn_erp_client_control/__init__.py b/erpnext/utilities/doctype/wn_erp_client_control/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/utilities/doctype/wn_erp_client_control/__init__.py
+++ /dev/null
diff --git a/erpnext/utilities/doctype/wn_erp_client_control/wn_erp_client_control.py b/erpnext/utilities/doctype/wn_erp_client_control/wn_erp_client_control.py
deleted file mode 100644
index 288f305..0000000
--- a/erpnext/utilities/doctype/wn_erp_client_control/wn_erp_client_control.py
+++ /dev/null
@@ -1,141 +0,0 @@
-# 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
-
-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, doc, doclist):
- self.doc, self.doclist = doc, doclist
-
-
- # Check End of Trial Period
- # -------------------------
- def trial_payment_reminders(self):
- if cint(self.doc.is_trial_account)==1:
- # Trial Period Expiry
- trial_end_date = add_days(self.doc.account_start_date, 30)
- days = date_diff(trial_end_date, nowdate())
- # check if trial period has expired
- if days < 10 and days >= 0 and has_common(['System Manager'],webnotes.user.get_roles()):
- return "Your Trial Period expires on '%s'. Please buy credits online using Manage Account." % (formatdate(trial_end_date))
-
- # trial period has already expired
- elif days < 0 and days >= -6:
- extended_days = 7 + days
- return "Your Trial Period has expired on %s. However, your account will be live for %s days. Please contact your System Manager to buy credits." % (formatdate(trial_end_date),cstr(extended_days))
- elif not has_common(['Administrator'],webnotes.user.get_roles()) and days < -6:
- return "Stopped"
-
- # Account is not a trial account
- else:
- return self.account_expiry_reminder()
-
-
- # Account Expiry Reminder
- # -----------------------
- def account_expiry_reminder(self):
- import webnotes.utils
- from datetime import datetime
- # Payment Reminder in case of not enough balance
- cr_reqd = cint(self.doc.total_users)
- days_left = cint(self.calc_days())
- # check if account balance is sufficient
- if cint(self.doc.credit_balance)<(cr_reqd):
-
- # Difference between last payment date and current date
- if self.doc.last_deduction_date: last_payment = date_diff(nowdate(),self.doc.last_deduction_date)
- else: last_payment = -1
-
- # 7 days extension
- remaining_days = days_left - 24
- if last_payment > 30 or last_payment == -1:
- if remaining_days < 8 and remaining_days >= 1:
- return "Your account will be de-activated in " + cstr(remaining_days) + " days. Please contact your System Manager to buy credits."
- elif remaining_days==0:
- return "Your account will be disabled from tomorrow. Please contact your System Manager to buy credits."
- elif not has_common(['Administrator'],webnotes.user.get_roles()):
- return "Stopped"
-
- # check if user account is extended for seven days
- if cint(self.doc.is_trial_account)==0:
- if days_left < 10 and days_left >= 0:
- return "You have only %s Credits in your account. Buy credits before %s." % (cint(self.doc.credit_balance),formatdate(self.next_bill_sdate))
-
-
-
- # Calculate days between current date and billing cycle end date
- # --------------------------------------------------------------
- def calc_days(self):
- if self.doc.billing_cycle_date:
- next_bill_month = cint(nowdate().split('-')[1])
- if cint(nowdate().split('-')[2]) > cint(self.doc.billing_cycle_date.split('-')[2]):
- next_bill_month = cint(nowdate().split('-')[1]) + 1
- next_bill_year = nowdate().split('-')[0]
- if next_bill_month > 12:
- next_bill_month = next_bill_month % 12
- next_bill_year += 1
- self.next_bill_sdate = cstr(next_bill_year)+'-'+cstr(next_bill_month)+'-'+(self.calc_next_day(next_bill_year,next_bill_month))
- #msgprint("next_bill_month :::" + self.next_bill_sdate)
- return date_diff(self.next_bill_sdate, nowdate())
-
-
- # Calculate next billing date day
- # --------------------------------
- def calc_next_day(self, next_year, next_month):
- bill_cycle_day = cstr(self.doc.billing_cycle_date).split('-')[2]
- if cint(next_month) == 2 and next_year%4==0 and (next_year%100!=0 or next_year%400==0) and cint(bill_cycle_day) > 28:
- bill_cycle_day = '28'
- elif cint(bill_cycle_day) == 31 and cint(next_month) in (4,6,9,11):
- bill_cycle_day = '30'
- return bill_cycle_day
-
-
- # Update acc credits and balance (making payment from gateway)
- # -------------------------------------------------------------
- def update_acc_bal(self,args):
- args = eval(args)
- self.doc.credit_balance = cint(self.doc.credit_balance) + cint(args.get('net_cr'))
- self.doc.total_users = cint(self.doc.total_users) + cint(args.get('total_users'))
- if cint(self.doc.is_trial_account) == 1:
- if not self.doc.account_start_date:
- self.doc.account_start_date = nowdate()
- self.doc.is_trial_account = 0
- self.doc.billing_cycle_date = nowdate()
- self.doc.last_deduction_date = nowdate()
- self.doc.save()
-
-
- # Check Credit Balance
- # ---------------------
- def check_credit_balance(self):
- if cint(self.doc.is_trial_account) == 0:
- if cint(self.doc.credit_balance) < 1:
- msgprint("You do not have enough credits to add new user. Please buy credits.")
- raise Exception
- else:
- self.doc.credit_balance = cint(self.doc.credit_balance) - 1
- msgprint("Your one credit is consumed. Balance Credits : %s" % (self.doc.credit_balance))
- self.doc.total_users = cint(self.doc.total_users) + 1
- self.doc.save()
-
-
- # Monthly Deduction
- # ------------------
- def monthly_deduction(self, cr_ded):
- self.doc.credit_balance = cint(self.doc.credit_balance) - cint(cr_ded)
- self.doc.last_deduction_date = nowdate()
- self.doc.save()
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/wn_erp_client_control/wn_erp_client_control.txt b/erpnext/utilities/doctype/wn_erp_client_control/wn_erp_client_control.txt
deleted file mode 100644
index 1ab4ed8..0000000
--- a/erpnext/utilities/doctype/wn_erp_client_control/wn_erp_client_control.txt
+++ /dev/null
@@ -1,124 +0,0 @@
-# DocType, WN ERP Client Control
-[
-
- # These values are common in all dictionaries
- {
- 'creation': '2010-08-08 17:09:30',
- 'docstatus': 0,
- 'modified': '2010-09-20 14:06:57',
- 'modified_by': 'Administrator',
- 'owner': 'Administrator'
- },
-
- # These values are common for all DocType
- {
- 'colour': 'White:FFF',
- 'doctype': 'DocType',
- 'issingle': 1,
- 'istable': 0,
- 'module': 'Utilities',
- 'name': '__common__',
- 'read_only': 1,
- 'section_style': 'Simple',
- 'server_code_error': ' ',
- 'show_in_menu': 1,
- 'version': 137
- },
-
- # These values are common for all DocField
- {
- 'doctype': 'DocField',
- 'name': '__common__',
- 'parent': 'WN ERP Client Control',
- 'parentfield': 'fields',
- 'parenttype': 'DocType',
- 'permlevel': 0
- },
-
- # These values are common for all DocPerm
- {
- 'doctype': 'DocPerm',
- 'name': '__common__',
- 'parent': 'WN ERP Client Control',
- 'parentfield': 'permissions',
- 'parenttype': 'DocType',
- 'read': 1,
- 'role': 'System Manager'
- },
-
- # DocType, WN ERP Client Control
- {
- 'doctype': 'DocType',
- 'name': 'WN ERP Client Control'
- },
-
- # DocPerm
- {
- 'create': 1,
- 'doctype': 'DocPerm',
- 'idx': 1,
- 'permlevel': 0,
- 'write': 1
- },
-
- # DocPerm
- {
- 'doctype': 'DocPerm',
- 'idx': 2,
- 'permlevel': 1
- },
-
- # DocField
- {
- 'doctype': 'DocField',
- 'fieldname': 'account_start_date',
- 'fieldtype': 'Date',
- 'idx': 1,
- 'label': 'Account Start Date'
- },
-
- # DocField
- {
- 'doctype': 'DocField',
- 'fieldname': 'billing_cycle_date',
- 'fieldtype': 'Date',
- 'idx': 2,
- 'label': 'Billing Cycle Date'
- },
-
- # DocField
- {
- 'doctype': 'DocField',
- 'fieldname': 'total_users',
- 'fieldtype': 'Int',
- 'idx': 3,
- 'label': 'Total Users'
- },
-
- # DocField
- {
- 'doctype': 'DocField',
- 'fieldname': 'credit_balance',
- 'fieldtype': 'Int',
- 'idx': 4,
- 'label': 'Credit Balance'
- },
-
- # DocField
- {
- 'doctype': 'DocField',
- 'fieldname': 'is_trial_account',
- 'fieldtype': 'Check',
- 'idx': 5,
- 'label': 'Is Trial Account'
- },
-
- # DocField
- {
- 'doctype': 'DocField',
- 'fieldname': 'last_deduction_date',
- 'fieldtype': 'Date',
- 'idx': 6,
- 'label': 'Last Credit Deduction Date'
- }
-]
\ No newline at end of file
diff --git a/erpnext/website/Module Def/Website/Website.txt b/erpnext/website/Module Def/Website/Website.txt
new file mode 100644
index 0000000..7e67c3c
--- /dev/null
+++ b/erpnext/website/Module Def/Website/Website.txt
@@ -0,0 +1,74 @@
+# Module Def, Website
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2012-01-23 17:05:32',
+ 'docstatus': 0,
+ 'modified': '2012-01-24 15:57:51',
+ 'modified_by': 'Administrator',
+ 'owner': 'Administrator'
+ },
+
+ # These values are common for all Module Def Role
+ {
+ 'doctype': 'Module Def Role',
+ 'name': '__common__',
+ 'parent': 'Website',
+ 'parentfield': 'roles',
+ 'parenttype': 'Module Def'
+ },
+
+ # These values are common for all Module Def Item
+ {
+ 'doctype': 'Module Def Item',
+ 'name': '__common__',
+ 'parent': 'Website',
+ 'parentfield': 'items',
+ 'parenttype': 'Module Def'
+ },
+
+ # These values are common for all Module Def
+ {
+ 'disabled': 'No',
+ 'doctype': u'Module Def',
+ 'is_hidden': 'No',
+ 'module_label': 'Website',
+ 'module_name': 'Website',
+ 'name': '__common__'
+ },
+
+ # Module Def, Website
+ {
+ 'doctype': u'Module Def',
+ 'name': 'Website'
+ },
+
+ # Module Def Item
+ {
+ 'display_name': 'Top Bar Settings',
+ 'doc_name': 'Top Bar Settings',
+ 'doc_type': 'Single DocType',
+ 'doctype': 'Module Def Item'
+ },
+
+ # Module Def Item
+ {
+ 'display_name': 'Home Settings',
+ 'doc_name': 'Home Settings',
+ 'doc_type': 'Forms',
+ 'doctype': 'Module Def Item'
+ },
+
+ # Module Def Role
+ {
+ 'doctype': 'Module Def Role',
+ 'role': 'System Manager'
+ },
+
+ # Module Def Role
+ {
+ 'doctype': 'Module Def Role',
+ 'role': 'Website Manager'
+ }
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/__init__.py
similarity index 100%
rename from erpnext/utilities/doctype/sso_control/__init__.py
rename to erpnext/website/__init__.py
diff --git a/erpnext/website/css/website.css b/erpnext/website/css/website.css
new file mode 100644
index 0000000..bdef882
--- /dev/null
+++ b/erpnext/website/css/website.css
@@ -0,0 +1,21 @@
+#body_div {
+ width: 900px;
+ margin: auto;
+}
+
+header .topbar .container {
+ width: 900px;
+ margin: auto;
+}
+
+.web-main-section {
+ width: 65%;
+ float: left;
+ margin-bottom: 20px;
+}
+
+.web-side-section {
+ width: 30%;
+ float: right;
+ margin-bottom: 20px;
+}
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/__init__.py
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/home_settings/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/home_settings/__init__.py
diff --git a/erpnext/website/doctype/home_settings/home_settings.py b/erpnext/website/doctype/home_settings/home_settings.py
new file mode 100644
index 0000000..3ceea16
--- /dev/null
+++ b/erpnext/website/doctype/home_settings/home_settings.py
@@ -0,0 +1,26 @@
+"""
+generate home html
+"""
+
+class DocType:
+ def __init__(self, d, dl):
+ self.doc, self.doclist = d, dl
+
+ def on_update(self):
+ """make home html"""
+ import os, jinja2, markdown2
+ import webnotes
+
+ # markdown
+ self.doc.main_section_html = markdown2.markdown(self.doc.main_section or '', \
+ extras=["wiki-tables"])
+ self.doc.side_section_html = markdown2.markdown(self.doc.side_section or '', \
+ extras=["wiki-tables"])
+
+ # write template
+ with open(os.path.join(os.path.dirname(__file__), 'template.html'), 'r') as f:
+ temp = jinja2.Template(f.read())
+
+ html = temp.render(doc = self.doc.fields)
+ webnotes.conn.set_value('Page', 'Home', 'content', html)
+
\ No newline at end of file
diff --git a/erpnext/website/doctype/home_settings/home_settings.txt b/erpnext/website/doctype/home_settings/home_settings.txt
new file mode 100644
index 0000000..413f63f
--- /dev/null
+++ b/erpnext/website/doctype/home_settings/home_settings.txt
@@ -0,0 +1,118 @@
+# DocType, Home Settings
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2012-01-24 15:56:06',
+ 'docstatus': 0,
+ 'modified': '2012-01-25 13:31:56',
+ 'modified_by': 'Administrator',
+ 'owner': 'Administrator'
+ },
+
+ # These values are common for all DocType
+ {
+ '_last_update': '1327476129',
+ 'allow_attach': 1,
+ 'colour': 'White:FFF',
+ 'doctype': 'DocType',
+ 'issingle': 1,
+ 'max_attachments': 5,
+ 'module': 'Website',
+ 'name': '__common__',
+ 'section_style': 'Simple',
+ 'show_in_menu': 0,
+ 'version': 4
+ },
+
+ # These values are common for all DocField
+ {
+ 'doctype': 'DocField',
+ 'name': '__common__',
+ 'parent': 'Home Settings',
+ 'parentfield': 'fields',
+ 'parenttype': 'DocType',
+ 'permlevel': 0
+ },
+
+ # These values are common for all DocPerm
+ {
+ 'create': 1,
+ 'doctype': 'DocPerm',
+ 'name': '__common__',
+ 'parent': 'Home Settings',
+ 'parentfield': 'permissions',
+ 'parenttype': 'DocType',
+ 'permlevel': 0,
+ 'read': 1,
+ 'write': 1
+ },
+
+ # DocType, Home Settings
+ {
+ 'doctype': 'DocType',
+ 'name': 'Home Settings'
+ },
+
+ # DocPerm
+ {
+ 'doctype': 'DocPerm',
+ 'role': 'System Manager'
+ },
+
+ # DocPerm
+ {
+ 'doctype': 'DocPerm',
+ 'role': 'Website Manager'
+ },
+
+ # DocField
+ {
+ 'colour': 'White:FFF',
+ 'description': 'HTML that will appear on the top part of the home page. For no headline, leave blank',
+ 'doctype': 'DocField',
+ 'fieldname': 'headline',
+ 'fieldtype': 'Text',
+ 'label': 'Headline'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldname': 'banner',
+ 'fieldtype': 'Select',
+ 'label': 'Banner',
+ 'options': 'attach_files:'
+ },
+
+ # DocField
+ {
+ 'colour': 'White:FFF',
+ 'description': 'For formatting, use \n<a href="http://warpedvisions.org/projects/markdown-cheat-sheet/" \ntarget = "_blank">markdown</a>',
+ 'doctype': 'DocField',
+ 'fieldname': 'main_section',
+ 'fieldtype': 'Code',
+ 'label': 'Main Section'
+ },
+
+ # DocField
+ {
+ 'colour': 'White:FFF',
+ 'description': 'For formatting, use \n<a href="http://warpedvisions.org/projects/markdown-cheat-sheet/" \ntarget = "_blank">markdown</a>',
+ 'doctype': 'DocField',
+ 'fieldname': 'side_section',
+ 'fieldtype': 'Code',
+ 'label': 'Side Section'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldname': 'file_list',
+ 'fieldtype': 'Text',
+ 'hidden': 1,
+ 'label': 'File List',
+ 'no_copy': 1,
+ 'print_hide': 1
+ }
+]
\ No newline at end of file
diff --git a/erpnext/website/doctype/home_settings/template.html b/erpnext/website/doctype/home_settings/template.html
new file mode 100644
index 0000000..424489a
--- /dev/null
+++ b/erpnext/website/doctype/home_settings/template.html
@@ -0,0 +1,17 @@
+<div class="layout_wrapper">
+ <div id="content-home">
+ {% if doc.headline %}
+ <h1>{{ doc.headline }}</h1>
+ {% endif %}
+ {% if doc.banner %}
+ <img src="files/{{ doc.banner }}" style="width: 870px; margin-bottom: 20px" />
+ {% endif %}
+ <div class="web-main-section">
+ {{ doc.main_section_html }}
+ </div>
+ <div class="web-side-section">
+ {{ doc.side_section_html }}
+ </div>
+ <div style="clear: both"></div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/top_bar_item/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/top_bar_item/__init__.py
diff --git a/erpnext/website/doctype/top_bar_item/top_bar_item.txt b/erpnext/website/doctype/top_bar_item/top_bar_item.txt
new file mode 100644
index 0000000..e352ef5
--- /dev/null
+++ b/erpnext/website/doctype/top_bar_item/top_bar_item.txt
@@ -0,0 +1,74 @@
+# DocType, Top Bar Item
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2012-01-24 10:24:19',
+ 'docstatus': 0,
+ 'modified': '2012-01-24 10:24:19',
+ 'modified_by': 'Administrator',
+ 'owner': 'Administrator'
+ },
+
+ # These values are common for all DocType
+ {
+ 'colour': 'White:FFF',
+ 'doctype': 'DocType',
+ 'istable': 1,
+ 'module': 'Website',
+ 'name': '__common__',
+ 'section_style': 'Simple',
+ 'show_in_menu': 0,
+ 'version': 1
+ },
+
+ # These values are common for all DocField
+ {
+ 'doctype': 'DocField',
+ 'name': '__common__',
+ 'parent': 'Top Bar Item',
+ 'parentfield': 'fields',
+ 'parenttype': 'DocType',
+ 'permlevel': 0
+ },
+
+ # DocType, Top Bar Item
+ {
+ 'doctype': 'DocType',
+ 'name': 'Top Bar Item'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldname': 'label',
+ 'fieldtype': 'Data',
+ 'label': 'Label'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldname': 'std_page',
+ 'fieldtype': 'Select',
+ 'label': 'Std Page',
+ 'options': 'Home\nAbout\nContact\nProduct\nCustomer\nBlog\nPartner\nCareer\nCustom'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldname': 'custom_page',
+ 'fieldtype': 'Link',
+ 'label': 'Custom Page',
+ 'options': 'Web Page'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldname': 'parent_label',
+ 'fieldtype': 'Select',
+ 'label': 'Parent Label'
+ }
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/top_bar_settings/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/top_bar_settings/__init__.py
diff --git a/erpnext/website/doctype/top_bar_settings/top_bar_settings.txt b/erpnext/website/doctype/top_bar_settings/top_bar_settings.txt
new file mode 100644
index 0000000..d651461
--- /dev/null
+++ b/erpnext/website/doctype/top_bar_settings/top_bar_settings.txt
@@ -0,0 +1,99 @@
+# DocType, Top Bar Settings
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2012-01-24 10:21:41',
+ 'docstatus': 0,
+ 'modified': '2012-01-24 10:45:02',
+ 'modified_by': 'Administrator',
+ 'owner': 'Administrator'
+ },
+
+ # These values are common for all DocType
+ {
+ '_last_update': '1327380941',
+ 'allow_attach': 1,
+ 'colour': 'White:FFF',
+ 'doctype': 'DocType',
+ 'document_type': 'Other',
+ 'issingle': 1,
+ 'max_attachments': 1,
+ 'module': 'Website',
+ 'name': '__common__',
+ 'section_style': 'Simple',
+ 'show_in_menu': 0,
+ 'version': 3
+ },
+
+ # These values are common for all DocField
+ {
+ 'doctype': 'DocField',
+ 'name': '__common__',
+ 'parent': 'Top Bar Settings',
+ 'parentfield': 'fields',
+ 'parenttype': 'DocType',
+ 'permlevel': 0
+ },
+
+ # These values are common for all DocPerm
+ {
+ 'create': 1,
+ 'doctype': 'DocPerm',
+ 'name': '__common__',
+ 'parent': 'Top Bar Settings',
+ 'parentfield': 'permissions',
+ 'parenttype': 'DocType',
+ 'permlevel': 0,
+ 'read': 1,
+ 'write': 1
+ },
+
+ # DocType, Top Bar Settings
+ {
+ 'doctype': 'DocType',
+ 'name': 'Top Bar Settings'
+ },
+
+ # DocPerm
+ {
+ 'doctype': 'DocPerm',
+ 'role': 'System Manager'
+ },
+
+ # DocPerm
+ {
+ 'doctype': 'DocPerm',
+ 'role': 'Website Manager'
+ },
+
+ # DocField
+ {
+ 'colour': 'White:FFF',
+ 'description': 'Brand is what appears on the top-right of the toolbar. If it is an image, make sure it\nhas a transparent background and use the <img /> tag',
+ 'doctype': 'DocField',
+ 'fieldname': 'brand_html',
+ 'fieldtype': 'Text',
+ 'label': 'Brand HTML'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldname': 'top_bar_items',
+ 'fieldtype': 'Table',
+ 'label': 'Top Bar Items',
+ 'options': 'Top Bar Item'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldname': 'file_list',
+ 'fieldtype': 'Text',
+ 'hidden': 1,
+ 'label': 'File List',
+ 'no_copy': 1,
+ 'print_hide': 1
+ }
+]
\ No newline at end of file
diff --git a/erpnext/website/js/topbar.js b/erpnext/website/js/topbar.js
new file mode 100644
index 0000000..85d975b
--- /dev/null
+++ b/erpnext/website/js/topbar.js
@@ -0,0 +1,47 @@
+wn.provide('erpnext.topbar');
+wn.require('lib/css/bootstrap/bootstrap-topbar.css');
+wn.require('lib/js/bootstrap/bootstrap-dropdown.js');
+
+/*
+<li class="dropdown">\
+ <a class="dropdown-toggle" href="#" onclick="return false;"></a>\
+ <ul class="dropdown-menu" id="toolbar-user">\
+ </ul>\
+</li>\
+*/
+
+erpnext.topbar.TopBar = Class.extend({
+ init: function() {
+ this.make();
+ $('.brand').html(wn.boot.topbar.brand_html);
+ this.make_items();
+ },
+ make: function() {
+ $('header').append('<div class="topbar">\
+ <div class="topbar-inner">\
+ <div class="container">\
+ <a class="brand">[brand]</a>\
+ <ul class="nav">\
+ </ul>\
+ <img src="lib/images/ui/spinner.gif" id="spinner"/>\
+ <ul class="nav secondary-nav">\
+ <li><a href="#!Login Page">Login</a></li>\
+ </ul>\
+ </div>\
+ </div>\
+ </div>');
+ },
+ make_items: function() {
+ var items = wn.boot.topbaritems
+ for(var i=0;i<items.length;i++) {
+ var item = items[i];
+ if(!item.parent_label) {
+ item.route = item.std_page.toLowerCase();
+ $('header .nav:first').append(repl('<li><a href="#!%(route)s" \
+ data-label="%(label)s">%(label)s</a></li>', item))
+ }
+ }
+ }
+});
+
+erpnext.topbar.topbar = new erpnext.topbar.TopBar();
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/page/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/page/__init__.py
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/page/home/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/page/home/__init__.py
diff --git a/erpnext/website/page/home/home.txt b/erpnext/website/page/home/home.txt
new file mode 100644
index 0000000..c8bc806
--- /dev/null
+++ b/erpnext/website/page/home/home.txt
@@ -0,0 +1,42 @@
+# Page, home
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2012-01-24 16:08:44',
+ 'docstatus': 0,
+ 'modified': '2012-01-24 16:08:44',
+ 'modified_by': 'Administrator',
+ 'owner': 'Administrator'
+ },
+
+ # These values are common for all Page
+ {
+ 'doctype': 'Page',
+ 'module': 'Website',
+ 'name': '__common__',
+ 'page_name': 'home',
+ 'standard': 'Yes'
+ },
+
+ # These values are common for all Page Role
+ {
+ 'doctype': 'Page Role',
+ 'name': '__common__',
+ 'parent': 'home',
+ 'parentfield': 'roles',
+ 'parenttype': 'Page',
+ 'role': 'Guest'
+ },
+
+ # Page, home
+ {
+ 'doctype': 'Page',
+ 'name': 'home'
+ },
+
+ # Page Role
+ {
+ 'doctype': 'Page Role'
+ }
+]
\ No newline at end of file
diff --git a/index.html b/index.html
index c6afcd1..dacded5 100644
--- a/index.html
+++ b/index.html
@@ -3,25 +3,130 @@
<meta charset="utf-8">
<title>ERPNext</title>
<meta name="author" content="">
- <script type="text/javascript">window._version_number="113"
+ <script type="text/javascript">window._version_number="201";
+
+/*
+* lib/js/wn/class.js
+*/
+/*
+
+Inheritence "Class"
+-------------------
+see: http://ejohn.org/blog/simple-javascript-inheritance/
+To subclass, use:
+
+ var MyClass = Class.extend({
+ init: function
+ })
+
+*/
+
+/* Simple JavaScript Inheritance
+ * By John Resig http://ejohn.org/
+ * MIT Licensed.
+ */
+// Inspired by base2 and Prototype
+
+(function(){
+ var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
+ // The base Class implementation (does nothing)
+ this.Class = function(){};
+
+ // Create a new Class that inherits from this class
+ Class.extend = function(prop) {
+ var _super = this.prototype;
+
+ // Instantiate a base class (but only create the instance,
+ // don't run the init constructor)
+ initializing = true;
+ var prototype = new this();
+ initializing = false;
+
+ // Copy the properties over onto the new prototype
+ for (var name in prop) {
+ // Check if we're overwriting an existing function
+ prototype[name] = typeof prop[name] == "function" &&
+ typeof _super[name] == "function" && fnTest.test(prop[name]) ?
+ (function(name, fn){
+ return function() {
+ var tmp = this._super;
+
+ // Add a new ._super() method that is the same method
+ // but on the super-class
+ this._super = _super[name];
+
+ // The method only need to be bound temporarily, so we
+ // remove it when we're done executing
+ var ret = fn.apply(this, arguments);
+ this._super = tmp;
+
+ return ret;
+ };
+ })(name, prop[name]) :
+ prop[name];
+ }
+
+ // The dummy class constructor
+ function Class() {
+ // All construction is actually done in the init method
+ if ( !initializing && this.init )
+ this.init.apply(this, arguments);
+ }
+
+ // Populate our constructed prototype object
+ Class.prototype = prototype;
+
+ // Enforce the constructor to be what we expect
+ Class.prototype.constructor = Class;
+
+ // And make this class extendable
+ Class.extend = arguments.callee;
+
+ return Class;
+ };
+})();
+
+/*
+* lib/js/wn/provide.js
+*/
wn={}
wn.provide=function(namespace){var nsl=namespace.split('.');var l=nsl.length;var parent=window;for(var i=0;i<l;i++){var n=nsl[i];if(!parent[n]){parent[n]={}}
parent=parent[n];}}
-wn.provide('wn.settings');wn.provide('wn.ui');wn.xmlhttp={request:function(){if(window.XMLHttpRequest)
+wn.provide('wn.settings');wn.provide('wn.ui');
+/*
+* lib/js/wn/xmlhttp.js
+*/
+
+wn.xmlhttp={request:function(){if(window.XMLHttpRequest)
return new XMLHttpRequest();else if(window.ActiveXObject)
return new ActiveXObject("MsXml2.XmlHttp");},complete:function(req,callback,url){if(req.status==200||req.status==304){callback(req.responseText);}else{alert(url+' request error: '+req.statusText+' ('+req.status+')');}},get:function(url,callback,args,async){if(async===null)async=true;var req=wn.xmlhttp.request();req.onreadystatechange=function(){if(req.readyState==4){wn.xmlhttp.complete(req,callback,url)}}
var sep=((args&&args.indexOf('?'))==-1)?'?':'&';var u=args?(url+sep+args):url;req.open('GET',u,async);req.send(null);if(!async){wn.xmlhttp.complete(req,callback,url)}}}
+/*
+* lib/js/wn/versions.js
+*/
+
wn.versions={check:function(){if(localStorage){if(window._version_number==-1||parseInt(localStorage._version_number)!=parseInt(window._version_number)){localStorage.clear();}
localStorage.setItem('_version_number',window._version_number);}}}
+/*
+* lib/js/wn/assets.js
+*/
+
wn.assets={executed_:{},exists:function(src){if('localStorage'in window&&localStorage.getItem(src))
return true},add:function(src,txt){if('localStorage'in window){localStorage.setItem(src,txt);}},get:function(src){return localStorage.getItem(src);},extn:function(src){if(src.indexOf('?')!=-1){src=src.split('?').slice(-1)[0];}
-return src.split('.').slice(-1)[0];},html_src:function(src){if(src.indexOf('/')!=-1){var t=src.split('/').slice(0,-1);t.push('src');t=t.join('/')+'/'+a.split('/').slice(-1)[0];}else{var t='src/'+src;}
-return t;},load:function(src){var t=wn.assets.extn(src)=='html'?wn.assets.html_src(src):src;wn.xmlhttp.get(t,function(txt){wn.assets.add(src,txt);},'q='&Math.floor(Math.random()*1000),false)},execute:function(src){if(!wn.assets.exists(src)){wn.assets.load(src);}
+return src.split('.').slice(-1)[0];},load:function(src){var t=src;wn.xmlhttp.get(t,function(txt){wn.assets.add(src,txt);},'q='+Math.floor(Math.random()*1000),false)},execute:function(src){if(!wn.assets.exists(src)){wn.assets.load(src);}
var type=wn.assets.extn(src);if(wn.assets.handler[type]){wn.assets.handler[type](wn.assets.get(src),src);wn.assets.executed_[src]=1;}},handler:{js:function(txt,src){wn.dom.eval(txt);},css:function(txt,src){var se=document.createElement('style');se.type="text/css";if(se.styleSheet){se.styleSheet.cssText=txt;}else{se.appendChild(document.createTextNode(txt));}
-document.getElementsByTagName('head')[0].appendChild(se);},html:function(txt,src){var page=wn.dom.add($('.outer .inner').get(0),'div','content',null,txt);page.setAttribute("_src",src);},cgi:function(txt,src){wn.dom.eval(txt)}}}
+document.getElementsByTagName('head')[0].appendChild(se);},cgi:function(txt,src){wn.dom.eval(txt)}}}
+/*
+* lib/js/wn/require.js
+*/
+
wn.require=function(items){if(typeof items==="string"){items=[items];}
var l=items.length;for(var i=0;i<l;i++){var src=items[i];if(!(src in wn.assets.executed_)){wn.assets.execute(src);}}}
+/*
+* lib/js/wn/dom.js
+*/
+
wn.provide('wn.dom');wn.dom.by_id=function(id){return document.getElementById(id);}
wn.dom.eval=function(txt){var el=document.createElement('script');el.appendChild(document.createTextNode(txt));document.getElementsByTagName('head')[0].appendChild(el);}
wn.dom.add=function(parent,newtag,className,cs,innerHTML,onclick){if(parent&&parent.substr)parent=wn.dom.by_id(parent);var c=document.createElement(newtag);if(parent)
@@ -33,10 +138,18 @@
wn.dom.css=function(ele,s){if(ele&&s){for(var i in s)ele.style[i]=s[i];};return ele;}
wn.dom.hide=function(ele){ele.style.display='none';}
wn.dom.show=function(ele,value){if(!value)value='block';ele.style.display=value;}
+/*
+* lib/js/wn/page.js
+*/
+
wn.page={set:function(src){var new_selection=$('.inner div.content[_src="'+src+'"]');if(!new_selection.length){wn.assets.execute(src);new_selection=$('.inner div.content[_src="'+src+'"]');}
$('.inner .current_page').removeClass('current_page');new_selection.addClass('current_page');var title=$('nav ul li a[href*="'+src+'"]').attr('title')||'No Title'
state=window.location.hash;if(state!=src){window.location.hash=state;}
else{document.title=title;}}}
+/*
+* lib/js/lib/json2.js
+*/
+
var JSON;if(!JSON){JSON={};}
(function(){"use strict";function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
@@ -61,19 +174,24 @@
text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
-throw new SyntaxError('JSON.parse');};}}());wn.versions.check();wn.require("lib/js/lib/jquery.min.js");wn.require("lib/js/lib/history/history.min.js");$(document).bind('ready',function(){var base=window.location.href.split('#')[0];$.each($('a[softlink!="false"]'),function(i,v){if(v.href.substr(0,base.length)==base){var path=(v.href.substr(base.length));if(path.substr(0,1)!='#'){v.href=base+'#'+path;}}});if(!wn.settings.no_history&&window.location.hash){wn.page.set(window.location.hash.substr(1));}});</script>
+throw new SyntaxError('JSON.parse');};}}());
+/*
+* lib/js/core.js
+*/
+
+wn.versions.check();wn.require("lib/js/lib/jquery.min.js");wn.require("lib/js/lib/history/history.min.js");$(document).bind('ready',function(){var base=window.location.href.split('#')[0];$.each($('a[softlink!="false"]'),function(i,v){if(v.href.substr(0,base.length)==base){var path=(v.href.substr(base.length));if(path.substr(0,1)!='#'){v.href=base+'#'+path;}}});if(!wn.settings.no_history&&window.location.hash){wn.page.set(window.location.hash.substr(1));}});</script>
</head>
<body>
+ <header></header>
<div id="startup_div" style="padding: 8px; font-size: 14px;"></div>
-
<!-- Main Starts -->
<div id="body_div">
-
<!--static (no script) content-->
- <div class="no_script" style='font-family: verdana, sans'>
+ <div class="no_script" style='font-family: Lucida Grande, Verdana, Sans; font-size: 12px'>
Loading...
</div>
</div>
+ <footer></footer>
<script>wn.require('js/app.js');</script>
<div id="dialog_back"></div>
</body>
diff --git a/js/app.js b/js/app.js
index 5a8597d..6b72451 100644
--- a/js/app.js
+++ b/js/app.js
@@ -1,3 +1,13 @@
+wn.app = {
+ name: 'ERPNext',
+ license: 'GNU/GPL - Usage Condition: All "erpnext" branding must be kept as it is',
+ source: 'https://github.com/webnotes/erpnext',
+ publisher: 'Web Notes Technologies Pvt Ltd, Mumbai',
+ copyright: '© Web Notes Technologies Pvt Ltd',
+ version: '2.' + window._version_number
+}
+
+wn.modules_path = 'erpnext';
wn.settings.no_history = true;
wn.require('lib/js/lib/jquery.min.js');
@@ -11,4 +21,8 @@
$(document).bind('ready', function() {
startup();
-});
\ No newline at end of file
+});
+
+$(document).bind('toolbar_setup', function() {
+ $('.brand').html('<b>erp</b>next');
+})
\ No newline at end of file
diff --git a/templates/index.html b/templates/index.html
index af0b8e5..84f0545 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -6,16 +6,16 @@
<script type="text/javascript">%s</script>
</head>
<body>
+ <header></header>
<div id="startup_div" style="padding: 8px; font-size: 14px;"></div>
-
<!-- Main Starts -->
<div id="body_div">
-
<!--static (no script) content-->
- <div class="no_script" style='font-family: verdana, sans'>
+ <div class="no_script" style='font-family: Lucida Grande, Verdana, Sans; font-size: 12px'>
Loading...
</div>
</div>
+ <footer></footer>
<script>wn.require('js/app.js');</script>
<div id="dialog_back"></div>
</body>
diff --git a/version.num b/version.num
index 95c8a67..3bc92d4 100644
--- a/version.num
+++ b/version.num
@@ -1 +1 @@
-113
\ No newline at end of file
+201