module page link fix

This commit is contained in:
Rushabh Mehta
2012-02-29 19:19:01 +05:30
parent 204e77d125
commit a4f454faa0
6 changed files with 10 additions and 7 deletions

View File

@@ -73,7 +73,10 @@ erpnext.module_page.make_list = function(module, wrapper) {
args: {
module: module
},
no_refresh: true
no_refresh: true,
callback: function(r) {
erpnext.module_page.hide_links(wrapper)
}
});
wrapper.list.run();
}

View File

@@ -4,7 +4,7 @@
<h1>Stock</h1>
<hr>
<div style="width: 48%; float: left;">
<h4><a ahref="#!List/Stock Entry">Stock Entry</a></h4>
<h4><a href="#!List/Stock Entry">Stock Entry</a></h4>
<p class="help">Transfer stock from one warehouse to another</p>
<h4><a href="#!List/Delivery Note">Delivery Note</a></h4>
<p class="help">Delivery (shipment) to customers</p>

View File

@@ -4,7 +4,7 @@
<h1>Support</h1>
<hr>
<div style="width: 48%; float: left;">
<h4><a ahref="#!List/Web Page">Web Page</a></h4>
<h4><a href="#!List/Web Page">Web Page</a></h4>
<p class="help">Static (content) web page</p>
<h4><a href="#!List/Product">Product</a></h4>
<p class="help">Product listed in catolog</p>

View File

@@ -901,7 +901,7 @@ this.clear=function(){this.results_area.innerHTML='';this.table=null;$ds(this.re
this.ref_img=$a(this.toolbar_area,'span','link_type',{color:'#888'},'[refresh]');this.ref_img.onclick=function(){me.run();}
this.loading_img=$a(this.toolbar_area,'img','lib/images/ui/button-load.gif',{display:'none',marginLeft:'3px',marginBottom:'-2px'});}
if(this.opts.new_doctype){this.new_btn=$btn(this.toolbar_area,'New '+get_doctype_label(this.opts.new_doctype),function(){newdoc(me.opts.new_doctype,me.opts.new_doc_onload,me.opts.new_doc_indialog,me.opts.new_doc_onsave);},{marginLeft:'7px'});}}
this.make_more_button=function(){this.more_btn=$btn(this.more_button_area,'More...',function(){me.more_btn.set_working();me.run(function(){me.more_btn.done_working();},1);},'',0,1);$y(this.more_btn.loading_img,{marginBottom:'0px'});}
this.make_more_button=function(){this.more_btn=$btn(this.more_button_area,'More...',function(){me.more_btn.set_working();me.run(function(){me.more_btn.done_working();},1);},'',0,1);$y(this.more_btn.loading_img,{marginBottom:'0px'});}
this.clear=function(){this.results_area.innerHTML='';this.table=null;$ds(this.results_area);$dh(this.no_results_area);}
this.make_results=function(r,rt){if(this.start==0)this.clear();$dh(this.more_button_area);if(this.loading_img)$dh(this.loading_img)
if(r.message)r.values=r.message;if(r.values&&r.values.length){this.values=r.values;var m=Math.min(r.values.length,this.page_length);for(var i=0;i<m;i++){var row=this.add_row();this.opts.render_row(row,r.values[i],this,i);}
@@ -2255,7 +2255,7 @@ wn.provide('erpnext.module_page');erpnext.module_page.setup_page=function(module
$(document).bind('startup',function(){erpnext.startup.start();});
/*
* erpnext/startup/js/modules.js
*/
*/
wn.provide('erpnext.module_page');erpnext.module_page.setup_page=function(module,wrapper){erpnext.module_page.hide_links(wrapper);erpnext.module_page.make_list(module,wrapper);$(wrapper).find("a[title]").tooltip({delay:{show:500,hide:100}});}
erpnext.module_page.hide_links=function(wrapper){$(wrapper).find('[href*="List/"]').each(function(){var href=$(this).attr('href');var dt=href.split('/')[1];if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});$(wrapper).find('[data-doctype]').each(function(){var dt=$(this).attr('data-doctype');if(wn.boot.profile.can_read.indexOf(dt)==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});$(wrapper).find('[href*="Form/"]').each(function(){var href=$(this).attr('href');var dt=href.split('/')[1];if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});}
erpnext.module_page.make_list=function(module,wrapper){wrapper.list=new wn.widgets.Listing({parent:$(wrapper).find('.reports-list').get(0),method:'utilities.get_report_list',render_row:function(row,data){if(!data.parent_doc_type)data.parent_doc_type=data.doc_type;$(row).html(repl('<a href="#!Report/%(doc_type)s/%(criteria_name)s" \

View File

@@ -716,7 +716,7 @@ this.clear=function(){this.results_area.innerHTML='';this.table=null;$ds(this.re
this.make_results=function(r,rt){if(this.start==0)this.clear();$dh(this.more_button_area);if(this.loading_img)$dh(this.loading_img)
if(r.message)r.values=r.message;if(r.values&&r.values.length){this.values=r.values;var m=Math.min(r.values.length,this.page_length);for(var i=0;i<m;i++){var row=this.add_row();this.opts.render_row(row,r.values[i],this,i);}
this.start+=m;if(r.values.length>=this.page_length)$ds(this.more_button_area);}else{if(this.start==0){$dh(this.results_area);$ds(this.no_results_area);}}
if(this.onrun)this.onrun();if(this.opts.onrun)this.opts.onrun();}
if(this.onrun)this.onrun();if(this.opts.onrun)this.opts.onrun();if(this.opts.callback)this.opts.callback(r);}
this.add_row=function(){return $a(this.results_area,'div','',(opts.cell_style?opts.cell_style:{padding:'3px 0px'}));}
this.run=function(callback,append){if(callback)
this.onrun=callback;if(!append)

View File

@@ -1 +1 @@
773
774