fixes to home (multiple loading)
diff --git a/erpnext/home/doctype/home_control/home_control.py b/erpnext/home/doctype/home_control/home_control.py
index 1f58a5e..b25e420 100644
--- a/erpnext/home/doctype/home_control/home_control.py
+++ b/erpnext/home/doctype/home_control/home_control.py
@@ -33,9 +33,6 @@
ml = sql("select distinct t1.name, t1.module_icon, t1.module_label, t1.module_desc, t1.module_page from `tabModule Def` t1, `tabModule Def Role` t2 where t2.role in ('%s') and t1.disabled !='Yes' and ifnull(t1.is_hidden, 'No') != 'Yes' and t1.name = t2.parent order by t1.module_seq asc" % "','".join(rl), as_dict=1)
return ml
- def get_login_url(self):
- return session['data'].get('login_from', '')
-
def get_module_details(self,m):
ret = {}
ret['il'] = sql('select doc_type, doc_name, display_name, icon, description, fields, click_function, idx from `tabModule Def Item` where parent=%s and ifnull(`hide`,0)=0 order by idx asc', m, as_dict=1)
@@ -50,6 +47,9 @@
AND t2.read=1
AND t2.role IN ("%s")
AND ifnull(standard,"No")="No"''' % (m, '", "'.join(webnotes.user.get_roles())), as_dict=1)
+
+ ret['login_url'] = session['data'].get('login_from', '')
+
return ret
# ----------------------------------------------------------------------------------------------------------------
@@ -249,7 +249,12 @@
if msg_id and msg_id != webnotes.conn.get_global('system_message_id', session['user']):
msg = webnotes.conn.get_global('system_message')
- return {'user_count': count and cint(count[0][0]) or 0, 'unread': unread and cint(unread[0][0]) or 0, 'system_message':msg}
+ return {
+ 'user_count': count and cint(count[0][0]) or 0,
+ 'unread': unread and cint(unread[0][0]) or 0,
+ 'system_message':msg,
+ 'registration_complete': self.registration_complete()
+ }
# -------------------------------------------------------------------------------------------------------
diff --git a/erpnext/home/page/event_updates/event_updates.js b/erpnext/home/page/event_updates/event_updates.js
index e93ed9d..c869eb8 100644
--- a/erpnext/home/page/event_updates/event_updates.js
+++ b/erpnext/home/page/event_updates/event_updates.js
@@ -39,9 +39,6 @@
var banner = $a(wrapper.banner_area, 'div', '', {paddingBottom:'4px'})
banner.innerHTML = cp.client_name;
}
-
- // complete registration
- if(in_list(user_roles,'System Manager')) { pscript.complete_registration(); }
}
// Widgets
@@ -78,16 +75,8 @@
}
}
]
- })
- sidebar.refresh()
-
- /*$y(cell,{padding:'0px 8px'});
-
- new HomeCalendar(new HomeWidget(cell, 'Calendar', 'Event'));
-
-
- new HomeToDo(new HomeWidget(cell, 'To Do', 'Item'));*/
-
+ });
+
new FeedList(wrapper.body);
}
@@ -618,6 +607,11 @@
// render online users
pscript.online_users_obj.render(r.message.online_users);
pscript.online_users = r.message.online_users;
+
+ // complete registration
+ if(in_list(user_roles,'System Manager')) {
+ pscript.complete_registration(r.registration_complete);
+ }
// setup wizard
if(r.message.setup_status) {
@@ -629,54 +623,50 @@
// complete my company registration
// --------------------------------
-pscript.complete_registration = function()
-{
- var reg_callback = function(r, rt){
- if(r.message == '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);
- }
- $($a(d.body,'div','', {margin:'8px', color:'#888'})).html('<b>Company Name : </b>'+locals['Control Panel']['Control Panel'].company_name);
-
- d.make_body(
- [
- ['Data','Company Abbreviation'],
- ['Select','Fiscal Year Start Date'],
- ['Select','Default Currency'],
- ['Button','Save'],
- ]);
-
- //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 = [
- locals['Control Panel']['Control Panel'].company_name,
- 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();
+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);
}
+ $($a(d.body,'div','', {margin:'8px', color:'#888'})).html('<b>Company Name : </b>'+locals['Control Panel']['Control Panel'].company_name);
+
+ d.make_body(
+ [
+ ['Data','Company Abbreviation'],
+ ['Select','Fiscal Year Start Date'],
+ ['Select','Default Currency'],
+ ['Button','Save'],
+ ]);
+
+ //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 = [
+ locals['Control Panel']['Control Panel'].company_name,
+ 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();
}
- $c_obj('Home Control','registration_complete','',reg_callback);
}
// make dialog fields
diff --git a/erpnext/setup/page/import_data/import_data.html b/erpnext/setup/page/import_data/import_data.html
index 5b30dd2..d227c2c 100644
--- a/erpnext/setup/page/import_data/import_data.html
+++ b/erpnext/setup/page/import_data/import_data.html
@@ -45,7 +45,7 @@
<td style="border: 1px solid #AAA; padding: 4px;">
<h3>Import Log:</h3>
<div id="import_result_area">
-<iframe src="blank1.html" name="ImportIFrame" style="border: 0px; height: 500px; width: 100%"></iframe>
+<iframe name="ImportIFrame" style="border: 0px; height: 500px; width: 100%"></iframe>
</div>
</td>
</tr>
diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js
index 942f4ef..6f967ff 100644
--- a/erpnext/startup/startup.js
+++ b/erpnext/startup/startup.js
@@ -43,18 +43,7 @@
// ------------------
$dh(page_body.footer);
- // for logout and payment
- var callback = function(r,rt) {
- if(r.message){
- login_file = 'http://' + r.message;
- }
- else if(pscript.is_erpnext_saas) {
- login_file = 'https://www.erpnext.com';
- }
- // setup toolbar
- pscript.startup_setup_toolbar();
- }
- $c_obj('Home Control', 'get_login_url', '', callback);
+ pscript.startup_setup_toolbar();
}
// ====================================================================
@@ -63,6 +52,15 @@
$y(page_body.left_sidebar, {width:(100/6)+'%', paddingTop:'8px'});
var callback = function(r,rt) {
+ // login url
+ if(r.login_url){
+ login_file = 'http://' + r.message;
+ }
+ else if(pscript.is_erpnext_saas) {
+ login_file = 'https://www.erpnext.com';
+ }
+
+
// menu
var ml = r.message;