From b473a4d4896229c97c371b27d58d2d8ea20d6f05 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 1 Mar 2012 13:58:17 +0530 Subject: [PATCH] added all_read condition to check if user can read --- erpnext/startup/js/modules.js | 6 +++--- js/all-app.js | 2 +- version.num | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/startup/js/modules.js b/erpnext/startup/js/modules.js index add068c75f..d43b0210b3 100644 --- a/erpnext/startup/js/modules.js +++ b/erpnext/startup/js/modules.js @@ -32,7 +32,7 @@ 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) { + if(wn.boot.profile.all_read.indexOf(get_label_doctype(dt))==-1) { var txt = $(this).text(); $(this).parent().css('color', '#999').html(txt); } @@ -41,7 +41,7 @@ erpnext.module_page.hide_links = function(wrapper) { // reports $(wrapper).find('[data-doctype]').each(function() { var dt = $(this).attr('data-doctype'); - if(wn.boot.profile.can_read.indexOf(dt)==-1) { + if(wn.boot.profile.all_read.indexOf(dt)==-1) { var txt = $(this).text(); $(this).parent().css('color', '#999').html(txt); } @@ -51,7 +51,7 @@ erpnext.module_page.hide_links = function(wrapper) { $(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) { + if(wn.boot.profile.all_read.indexOf(get_label_doctype(dt))==-1) { var txt = $(this).text(); $(this).parent().css('color', '#999').html(txt); } diff --git a/js/all-app.js b/js/all-app.js index fc177258b8..4fdd6e6b7a 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -2253,7 +2253,7 @@ $(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.hide_links=function(wrapper){$(wrapper).find('[href*="List/"]').each(function(){var href=$(this).attr('href');var dt=href.split('/')[1];if(wn.boot.profile.all_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.all_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.all_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('\ %(criteria_name)s',data))},args:{module:module},no_refresh:true,callback:function(r){erpnext.module_page.hide_links(wrapper)}});wrapper.list.run();} diff --git a/version.num b/version.num index d0af645045..83249da5a1 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -783 \ No newline at end of file +784 \ No newline at end of file