nabinhait | c62e585 | 2011-06-17 17:22:28 +0530 | [diff] [blame] | 1 | if(user == 'Guest'){ |
Pratik Vyas | c1e6e4c | 2011-06-08 14:37:15 +0530 | [diff] [blame] | 2 | $dh(page_body.left_sidebar); |
| 3 | } |
| 4 | |
| 5 | var current_module; |
| 6 | var is_system_manager = 0; |
| 7 | var module_content_dict = {}; |
| 8 | var user_full_nm = {}; |
| 9 | |
| 10 | // check if session user is system manager |
| 11 | if(inList(user_roles,'System Manager')) is_system_manager = 1; |
| 12 | |
| 13 | function startup_setup() { |
| 14 | pscript.is_erpnext_saas = cint(locals['Control Panel']['Control Panel'].sync_with_gateway) |
| 15 | |
| 16 | |
| 17 | if(get_url_arg('embed')) { |
| 18 | // hide header, footer |
| 19 | $dh(page_body.banner_area); |
| 20 | $dh(page_body.wntoolbar); |
| 21 | $dh(page_body.footer); |
| 22 | return; |
| 23 | } |
| 24 | |
| 25 | if(user=='Guest' && !get_url_arg('akey')) { |
| 26 | if(pscript.is_erpnext_saas) { |
| 27 | window.location.href = 'https://www.erpnext.com'; |
| 28 | return; |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | // page structure |
| 33 | // -------------- |
| 34 | $td(page_body.wntoolbar.body_tab,0,0).innerHTML = '<i><b>erp</b>next</i>'; |
| 35 | $y($td(page_body.wntoolbar.body_tab,0,0), {width:'140px', color:'#FFF', paddingLeft:'8px', paddingRight:'8px', fontSize:'14px'}) |
| 36 | $dh(page_body.banner_area); |
| 37 | |
| 38 | // sidebar |
| 39 | // ------- |
| 40 | pscript.startup_make_sidebar(); |
| 41 | |
| 42 | // border to the body |
| 43 | // ------------------ |
| 44 | $dh(page_body.footer); |
| 45 | |
| 46 | // for logout and payment |
| 47 | var callback = function(r,rt) { |
| 48 | if(r.message){ |
Rushabh Mehta | d673db8 | 2011-07-18 11:36:43 +0530 | [diff] [blame] | 49 | login_file = 'http://' + r.message; |
Pratik Vyas | c1e6e4c | 2011-06-08 14:37:15 +0530 | [diff] [blame] | 50 | } |
Rushabh Mehta | 33bce67 | 2011-08-25 15:15:25 +0530 | [diff] [blame] | 51 | else if(pscript.is_erpnext_saas) { |
Rushabh Mehta | a5109b7 | 2011-08-29 15:22:29 +0530 | [diff] [blame] | 52 | login_file = 'https://www.erpnext.com'; |
Rushabh Mehta | 33bce67 | 2011-08-25 15:15:25 +0530 | [diff] [blame] | 53 | } |
Pratik Vyas | c1e6e4c | 2011-06-08 14:37:15 +0530 | [diff] [blame] | 54 | // setup toolbar |
| 55 | pscript.startup_setup_toolbar(); |
| 56 | } |
| 57 | $c_obj('Home Control', 'get_login_url', '', callback); |
| 58 | } |
| 59 | |
| 60 | // ==================================================================== |
| 61 | |
| 62 | pscript.startup_make_sidebar = function() { |
| 63 | $y(page_body.left_sidebar, {width:(100/6)+'%', paddingTop:'8px'}); |
| 64 | |
| 65 | var callback = function(r,rt) { |
| 66 | // menu |
| 67 | var ml = r.message; |
| 68 | |
| 69 | // clear |
| 70 | page_body.left_sidebar.innerHTML = ''; |
| 71 | |
| 72 | for(var m=0; m<ml.length; m++){ |
| 73 | if(ml[m]) { |
| 74 | new SidebarItem(ml[m]); |
| 75 | } |
| 76 | } |
| 77 | if(in_list(user_roles, 'System Manager')) { |
| 78 | var div = $a(page_body.left_sidebar, 'div', 'link_type', {padding:'8px', fontSize:'11px'}); |
| 79 | $(div).html('[edit]').click(pscript.startup_set_module_order) |
| 80 | } |
| 81 | nav_obj.observers.push({notify:function(t,dt,dn) { pscript.select_sidebar_menu(t, dt, dn); }}); |
| 82 | |
| 83 | // select current |
| 84 | var no = nav_obj.ol[nav_obj.ol.length-1]; |
| 85 | if(no && menu_item_map[decodeURIComponent(no[0])][decodeURIComponent(no[1])]) |
| 86 | pscript.select_sidebar_menu(decodeURIComponent(no[0]), decodeURIComponent(no[1])); |
| 87 | } |
| 88 | $c_obj('Home Control', 'get_modules', '', callback); |
| 89 | } |
| 90 | |
| 91 | // ==================================================================== |
| 92 | // Menu observer |
| 93 | // ==================================================================== |
| 94 | |
| 95 | cur_menu_pointer = null; |
| 96 | var menu_item_map = {'Form':{}, 'Page':{}, 'Report':{}, 'List':{}} |
| 97 | |
| 98 | pscript.select_sidebar_menu = function(t, dt, dn) { |
| 99 | // get menu item |
| 100 | if(menu_item_map[t][dt]) { |
| 101 | // select |
| 102 | menu_item_map[t][dt].select(); |
| 103 | } else { |
| 104 | // none found :-( Unselect |
| 105 | if(cur_menu_pointer) |
| 106 | cur_menu_pointer.deselect(); |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | // ==================================================================== |
| 111 | // Menu pointer |
| 112 | // ==================================================================== |
| 113 | |
| 114 | var body_background = '#e2e2e2'; |
| 115 | |
| 116 | MenuPointer = function(parent, label) { |
| 117 | |
| 118 | this.wrapper = $a(parent, 'div', '', {padding:'0px', cursor:'pointer', margin:'2px 0px'}); |
| 119 | $br(this.wrapper, '3px'); |
| 120 | |
| 121 | this.tab = make_table($a(this.wrapper, 'div'), 1, 2, '100%', ['', '11px'], {height:'22px', |
| 122 | verticalAlign:'middle', padding:'0px'}, {borderCollapse:'collapse', tableLayout:'fixed'}); |
| 123 | |
| 124 | $y($td(this.tab, 0, 0), {padding:'0px 4px', color:'#444', whiteSpace:'nowrap'}); |
| 125 | |
| 126 | // triangle border (?) |
| 127 | this.tab.triangle_div = $a($td(this.tab, 0, 1), 'div','', { |
| 128 | borderColor: body_background + ' ' + body_background + ' ' + body_background + ' ' + 'transparent', |
| 129 | borderWidth:'11px', borderStyle:'solid', height:'0px', width:'0px', marginRight:'-11px'}); |
| 130 | |
| 131 | this.label_area = $a($td(this.tab, 0, 0), 'span', '', '', label); |
| 132 | |
| 133 | $(this.wrapper) |
| 134 | .hover( |
| 135 | function() { if(!this.selected)$bg(this, '#eee'); } , |
| 136 | function() { if(!this.selected)$bg(this, body_background); } |
| 137 | ) |
| 138 | |
| 139 | $y($td(this.tab, 0, 0), {borderBottom:'1px solid #ddd'}); |
| 140 | |
| 141 | } |
| 142 | |
| 143 | // ==================================================================== |
| 144 | |
| 145 | MenuPointer.prototype.select = function(grey) { |
| 146 | $y($td(this.tab, 0, 0), {color:'#fff', borderBottom:'0px solid #000'}); |
| 147 | //$gr(this.wrapper, '#F84', '#F63'); |
| 148 | $gr(this.wrapper, '#888', '#666'); |
| 149 | this.selected = 1; |
| 150 | |
| 151 | if(cur_menu_pointer && cur_menu_pointer != this) |
| 152 | cur_menu_pointer.deselect(); |
| 153 | |
| 154 | cur_menu_pointer = this; |
| 155 | } |
| 156 | |
| 157 | // ==================================================================== |
| 158 | |
| 159 | MenuPointer.prototype.deselect = function() { |
| 160 | $y($td(this.tab, 0, 0), {color:'#444', borderBottom:'1px solid #ddd'}); |
| 161 | $gr(this.wrapper, body_background, body_background); |
| 162 | this.selected = 0; |
| 163 | } |
| 164 | |
| 165 | |
| 166 | // ==================================================================== |
| 167 | // Sidebar Item |
| 168 | // ==================================================================== |
| 169 | |
| 170 | var cur_sidebar_item = null; |
| 171 | |
| 172 | SidebarItem = function(det) { |
| 173 | var me = this; |
| 174 | this.det = det; |
| 175 | this.wrapper = $a(page_body.left_sidebar, 'div', '', {marginRight:'12px'}); |
| 176 | |
| 177 | this.body = $a(this.wrapper, 'div'); |
| 178 | this.tab = make_table(this.body, 1, 2, '100%', ['24px', null], {verticalAlign:'middle'}, {tableLayout:'fixed'}); |
| 179 | |
| 180 | // icon |
| 181 | var ic = $a($td(this.tab, 0, 0), 'div', 'module-icons module-icons-' + det.module_label.toLowerCase(), {marginLeft:'3px', marginBottom:'-2px'}); |
| 182 | |
| 183 | // pointer table |
| 184 | this.pointer = new MenuPointer($td(this.tab, 0, 1), det.module_label); |
| 185 | $y($td(this.pointer.tab, 0, 0), {fontWeight:'bold'}); |
| 186 | |
| 187 | // for page type |
| 188 | if(det.module_page) { |
| 189 | menu_item_map.Page[det.module_page] = this.pointer; |
| 190 | } |
| 191 | |
| 192 | // items area |
| 193 | this.items_area = $a(this.wrapper, 'div'); |
| 194 | |
| 195 | this.body.onclick = function() { me.onclick(); } |
| 196 | } |
| 197 | |
| 198 | // ==================================================================== |
| 199 | |
| 200 | SidebarItem.prototype.onclick = function() { |
| 201 | var me = this; |
| 202 | |
| 203 | if(this.det.module_page) { |
| 204 | // page type |
| 205 | this.pointer.select(); |
| 206 | |
| 207 | $item_set_working(me.pointer.label_area); |
| 208 | loadpage(this.det.module_page, function() { $item_done_working(me.pointer.label_area); }); |
| 209 | |
| 210 | } else { |
| 211 | // show sub items |
| 212 | this.toggle(); |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | // ==================================================================== |
| 217 | |
| 218 | SidebarItem.prototype.collapse = function() { |
| 219 | $(this.items_area).slideUp(); |
| 220 | this.is_open = 0; |
| 221 | $fg(this.pointer.label_area, '#444') |
| 222 | } |
| 223 | |
| 224 | // ==================================================================== |
| 225 | |
| 226 | SidebarItem.prototype.toggle = function() { |
| 227 | if(this.loading) return; |
| 228 | |
| 229 | if(this.is_open) { |
| 230 | this.collapse(); |
| 231 | } else { |
| 232 | if(this.loaded) $(this.items_area).slideDown(); |
| 233 | else this.show_items(); |
| 234 | this.is_open = 1; |
| 235 | $fg(this.pointer.label_area, '#000') |
| 236 | //this.pointer.select(1); |
| 237 | |
| 238 | // close existing open |
| 239 | if(cur_sidebar_item && cur_sidebar_item != this) { |
| 240 | cur_sidebar_item.collapse(); |
| 241 | } |
| 242 | cur_sidebar_item = this; |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | // ==================================================================== |
| 247 | |
| 248 | SidebarItem.prototype.show_items = function() { |
| 249 | this.loading = 1; |
| 250 | var me = this; |
| 251 | |
| 252 | $item_set_working(this.pointer.label_area); |
| 253 | var callback = function(r,rt){ |
| 254 | me.loaded = 1; |
| 255 | me.loading = 0; |
| 256 | var smi = null; |
| 257 | var has_reports = 0; |
| 258 | var has_tools = 0; |
| 259 | |
| 260 | // widget code |
| 261 | $item_done_working(me.pointer.label_area); |
| 262 | |
| 263 | if(r.message.il) { |
| 264 | me.il = r.message.il; |
| 265 | |
| 266 | // forms |
| 267 | for(var i=0; i<me.il.length;i++){ |
| 268 | if(me.il[i].doc_type == 'Forms') { |
| 269 | if(in_list(profile.can_read, me.il[i].doc_name)) { |
| 270 | var smi = new SidebarModuleItem(me, me.il[i]); |
| 271 | |
| 272 | menu_item_map['Form'][me.il[i].doc_name] = smi.pointer; |
| 273 | menu_item_map['List'][me.il[i].doc_name] = smi.pointer; |
| 274 | } |
| 275 | } |
| 276 | if(me.il[i].doc_type=='Reports') has_reports = 1; |
| 277 | if(in_list(['Single DocType', 'Pages', 'Setup Forms'], me.il[i].doc_type)) has_tools = 1; |
| 278 | } |
| 279 | // reports |
| 280 | if(has_reports) { |
| 281 | var smi = new SidebarModuleItem(me, {doc_name:'Reports', doc_type:'Reports'}); |
| 282 | |
| 283 | // add to menu-item mapper |
| 284 | menu_item_map['Page'][me.det.module_label + ' Reports'] = smi.pointer; |
| 285 | } |
| 286 | |
| 287 | // tools |
| 288 | if(has_tools) { |
| 289 | var smi = new SidebarModuleItem(me, {doc_name:'Tools', doc_type:'Tools'}); |
| 290 | |
| 291 | // add to menu-item mapper |
| 292 | menu_item_map['Page'][me.det.module_label + ' Tools'] = smi.pointer; |
| 293 | } |
| 294 | |
| 295 | // custom reports |
| 296 | if(r.message.custom_reports.length) { |
| 297 | me.il = add_lists(r.message.il, r.message.custom_reports); |
| 298 | var smi = new SidebarModuleItem(me, {doc_name:'Custom Reports', doc_type:'Custom Reports'}); |
| 299 | |
| 300 | // add to menu-item mapper |
| 301 | menu_item_map['Page'][me.det.module_label + ' Custom Reports'] = smi.pointer; |
| 302 | |
| 303 | } |
| 304 | |
| 305 | } |
| 306 | $(me.items_area).slideDown(); |
| 307 | |
| 308 | // high light |
| 309 | var no = nav_obj.ol[nav_obj.ol.length-1]; |
| 310 | if(no && menu_item_map[decodeURIComponent(no[0])][decodeURIComponent(no[1])]) |
| 311 | pscript.select_sidebar_menu(decodeURIComponent(no[0]), decodeURIComponent(no[1])); |
| 312 | |
| 313 | } |
| 314 | |
| 315 | $c_obj('Home Control', 'get_module_details', me.det.name, callback); |
| 316 | } |
| 317 | |
| 318 | // ==================================================================== |
| 319 | // Show Reports |
| 320 | // ==================================================================== |
| 321 | |
| 322 | SidebarItem.prototype.show_section = function(sec_type) { |
| 323 | var me = this; |
| 324 | var label = this.det.module_label + ' ' + sec_type; |
| 325 | var type_map = {'Reports':'Reports', 'Custom Reports':'Custom Reports', 'Pages':'Tools', 'Single DocType':'Tools', 'Setup Forms':'Tools'} |
| 326 | |
| 327 | if(page_body.pages[label]) { |
| 328 | loadpage(label, null, 1); |
| 329 | } else { |
| 330 | // make the reports page |
| 331 | var page = page_body.add_page(label); |
| 332 | this.wrapper = $a(page,'div','layout_wrapper'); |
| 333 | |
| 334 | |
| 335 | // head |
| 336 | this.head = new PageHeader(this.wrapper, label); |
| 337 | |
| 338 | // body |
| 339 | this.body1 = $a(this.wrapper, 'div', '', {marginTop:'16px'}); |
| 340 | |
| 341 | // add a report link |
| 342 | var add_link = function(det) { |
| 343 | var div = $a(me.body1, 'div', '', {marginBottom:'6px'}); |
| 344 | var span = $a(div, 'span', 'link_type'); |
| 345 | |
| 346 | // tag the span |
| 347 | span.innerHTML = det.display_name; span.det = det; |
| 348 | if(sec_type=='Reports' || sec_type=='Custom Reports') { |
| 349 | // Reports |
| 350 | // ------- |
| 351 | span.onclick = function() { loadreport(this.det.doc_name, this.det.display_name); } |
| 352 | |
| 353 | } else { |
| 354 | // Tools |
| 355 | // ----- |
| 356 | |
| 357 | if(det.doc_type=='Pages') { |
| 358 | // Page |
| 359 | if(det.click_function) { |
| 360 | span.onclick = function() { eval(this.det.click_function) } |
| 361 | span.click_function = det.click_function; |
| 362 | } else { |
| 363 | span.onclick = function() { loadpage(this.det.doc_name); } |
| 364 | } |
| 365 | } else if(det.doc_type=='Setup Forms') { |
| 366 | // Doc Browser |
| 367 | span.onclick = function() { loaddocbrowser(this.det.doc_name); } |
| 368 | } else { |
| 369 | // Single |
| 370 | span.onclick = function() { loaddoc(this.det.doc_name, this.det.doc_name); } |
| 371 | } |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | // item list |
| 376 | for(var i=0; i<me.il.length;i++){ |
| 377 | if(type_map[me.il[i].doc_type] == sec_type) { |
| 378 | add_link(me.il[i]); |
| 379 | } |
| 380 | } |
| 381 | loadpage(label, null, 1); |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | |
| 386 | // ==================================================================== |
| 387 | // Sidebar module item |
| 388 | // ==================================================================== |
| 389 | |
| 390 | SidebarModuleItem = function(si, det) { |
| 391 | this.det = det; |
| 392 | var me= this; |
| 393 | |
| 394 | this.pointer = new MenuPointer(si.items_area, get_doctype_label(det.doc_name)); |
| 395 | $y(si.items_area, {marginLeft:'32px'}) |
| 396 | $y($td(this.pointer.tab, 0, 0), {fontSize:'11px'}); |
| 397 | |
| 398 | this.pointer.wrapper.onclick = function() { |
| 399 | if(me.det.doc_type=='Forms') |
| 400 | loaddocbrowser(det.doc_name); |
| 401 | else |
| 402 | si.show_section(me.det.doc_type); |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | |
| 407 | // ==================================================================== |
| 408 | // Drag & Drop order selection |
| 409 | // ==================================================================== |
| 410 | |
| 411 | pscript.startup_set_module_order = function() { |
| 412 | var update_order= function(ml) { |
| 413 | mdict = {}; |
| 414 | for(var i=0; i<ml.length; i++) { |
| 415 | mdict[ml[i][3][3]] = {'module_seq':ml[i][1], 'is_hidden':(ml[i][2] ? 'No' : 'Yes')} |
| 416 | } |
| 417 | $c_obj('Home Control', 'set_module_order', JSON.stringify(mdict), function(r,rt) { pscript.startup_make_sidebar(); } ) |
| 418 | } |
| 419 | |
| 420 | var callback = function(r, rt) { |
| 421 | var ml = []; |
| 422 | for(var i=0; i<r.message.length; i++) { |
| 423 | var det = r.message[i]; |
| 424 | ml.push([det[1], det[2], (det[3]!='No' ? 0 : 1), det[0]]); |
| 425 | } |
| 426 | new ListSelector('Set Module Sequence', 'Select items and set the order you want them to appear'+ |
| 427 | '<br><b>Note:</b> <i>These changes will apply to all users!</i>', ml, update_order, 1); |
| 428 | } |
| 429 | $c_obj('Home Control', 'get_module_order', '', callback) |
| 430 | |
| 431 | } |
| 432 | |
| 433 | // ==================================================================== |
| 434 | |
| 435 | pscript.startup_setup_toolbar = function() { |
| 436 | var menu_tab = page_body.wntoolbar.menu_table_right; |
| 437 | // Profile |
| 438 | // --------- |
| 439 | $td(menu_tab,0,0).innerHTML = '<a style="font-weight: bold; color: #FFF" href="javascript:'+"loadpage('profile-settings')"+'">'+user_fullname+'</a>'; |
| 440 | |
| 441 | if(pscript.is_erpnext_saas){ |
| 442 | // Help |
| 443 | // -------------- |
| 444 | //var help_url = login_file + '#!helpdesk' |
| 445 | $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>'; |
| 446 | |
| 447 | // Manage account |
| 448 | // -------------- |
| 449 | if(is_system_manager) { |
Rushabh Mehta | 33a7f28 | 2011-07-06 10:42:21 +0530 | [diff] [blame] | 450 | $td(menu_tab,0,3).innerHTML = '<a style="font-weight: bold; color: #FFF;" href="#!billing">Billing</a>'; |
Pratik Vyas | c1e6e4c | 2011-06-08 14:37:15 +0530 | [diff] [blame] | 451 | } |
| 452 | } |
| 453 | else{ |
| 454 | $dh($td(menu_tab,0,1)); |
| 455 | $dh($td(menu_tab,0,3)); |
| 456 | } |
| 457 | |
| 458 | // Live Chat Help |
| 459 | // -------------- |
| 460 | $td(menu_tab,0,2).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">Chat</a>'; |
| 461 | |
| 462 | // help |
| 463 | // ---- |
| 464 | var cell = menu_tab.rows[0].insertCell(3); |
| 465 | cell.innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://erpnext.blogspot.com/2011/03/erpnext-help.html" target="_blank">Help</a>'; |
| 466 | $y(cell, page_body.wntoolbar.right_table_style); |
| 467 | |
| 468 | } |
| 469 | |
Pratik Vyas | c1e6e4c | 2011-06-08 14:37:15 +0530 | [diff] [blame] | 470 | // chart of accounts |
| 471 | // ==================================================================== |
| 472 | show_chart_browser = function(nm, chart_type){ |
| 473 | |
| 474 | var call_back = function(){ |
| 475 | if(nm == 'Sales Browser'){ |
| 476 | var sb_obj = new SalesBrowser(); |
| 477 | sb_obj.set_val(chart_type); |
| 478 | } |
| 479 | else if(nm == 'Accounts Browser') |
| 480 | pscript.make_chart(chart_type); |
| 481 | } |
| 482 | loadpage(nm,call_back); |
| 483 | } |
| 484 | |
| 485 | |
| 486 | // Module Page |
| 487 | // ==================================================================== |
| 488 | |
| 489 | ModulePage = function(parent, module_name, module_label, help_page, callback) { |
| 490 | this.parent = parent; |
| 491 | |
| 492 | // add to current page |
| 493 | page_body.cur_page.module_page = this; |
| 494 | |
| 495 | this.wrapper = $a(parent,'div'); |
| 496 | this.module_name = module_name; |
| 497 | this.transactions = []; |
| 498 | this.page_head = new PageHeader(this.wrapper, module_label); |
| 499 | |
| 500 | if(help_page) { |
| 501 | var btn = this.page_head.add_button('Help', function() { loadpage(this.help_page) }, 1, 'ui-icon-help') |
| 502 | btn.help_page = help_page; |
| 503 | } |
| 504 | |
| 505 | if(callback) this.callback = function(){ callback(); } |
| 506 | } |
| 507 | |
| 508 | |
| 509 | // get plural |
| 510 | // ==================================================================== |
| 511 | |
| 512 | get_plural = function(str){ |
| 513 | if(str.charAt(str.length-1).toLowerCase() == 'y') return str.substr(0, str.length-1) + 'ies' |
| 514 | else return str + 's'; |
| 515 | } |
| 516 | |
| 517 | // set user fullname |
| 518 | // ==================================================================== |
| 519 | pscript.set_user_fullname = function(ele,username,get_latest){ |
| 520 | |
| 521 | var set_it = function(){ |
| 522 | if(ele) |
| 523 | ele.innerHTML = user_full_nm[username]; |
| 524 | } |
| 525 | |
| 526 | if(get_latest){ |
| 527 | $c_obj('Home Control','get_user_fullname',username, function(r,rt){ user_full_nm[username] = r.message; set_it(); }); |
| 528 | } |
| 529 | else{ |
| 530 | if(user_full_nm[username]){ |
| 531 | set_it(); |
| 532 | } |
| 533 | |
| 534 | else |
| 535 | $c_obj('Home Control','get_user_fullname',username, function(r,rt){ user_full_nm[username] = r.message; set_it(); }); |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | // ==================================================================== |
| 540 | startup_setup(); |
Rushabh Mehta | 9e6e7fa | 2011-08-25 16:08:06 +0530 | [diff] [blame] | 541 | |
Rushabh Mehta | a5109b7 | 2011-08-29 15:22:29 +0530 | [diff] [blame] | 542 | $(document).bind('form_refresh', function() { }) |