diff --git a/js/legacy/report.compressed.js b/js/legacy/report.compressed.js index 1dc322615b..900c9cbb48 100644 --- a/js/legacy/report.compressed.js +++ b/js/legacy/report.compressed.js @@ -185,7 +185,7 @@ _r.DataTable.prototype.run=function(){if(this.validate&&!this.validate()) return;if(_r.rb_con.cur_rb){if(_r.rb_con.cur_rb.large_report==1){msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.

Please click on 'Export' to open in a spreadsheet");return;} _r.rb_con.cur_rb.mytabs.items['Result'].expand();} var me=this;this._get_query();if(this.set_data){this.show_result(this.set_data);this.set_data=null;return;} -$ds(this.fetching_tag);if(isFF)this.clear_all();var args={'query':me.query,'report_name':'_r.DataTable','show_deleted':1,'sc_id':me.search_criteria?me.search_criteria.name:'','filter_values':me.filter_vals?docstring(me.filter_vals):'','roles':'["'+user_roles.join('","')+'"]'} +$ds(this.fetching_tag);if($.browser.mozilla)this.clear_all();var args={'query':me.query,'report_name':'_r.DataTable','show_deleted':1,'sc_id':me.search_criteria?me.search_criteria.name:'','filter_values':me.filter_vals?docstring(me.filter_vals):'','roles':'["'+user_roles.join('","')+'"]'} if(this.is_simple)args.is_simple=1;$c('webnotes.widgets.query_builder.runquery',args,function(r,rt){$dh(me.fetching_tag);me.show_result(r,rt);});} _r.DataTable.prototype.clear_all=function(){if(this.htab&&this.htab.parentNode){this.htab.parentNode.removeChild(this.htab);delete this.htab;} if(this.tab&&this.tab.parentNode){this.tab.parentNode.removeChild(this.tab);delete this.tab;} diff --git a/js/legacy/utils/browser_detect.js b/js/legacy/utils/browser_detect.js deleted file mode 100644 index 91e29c492e..0000000000 --- a/js/legacy/utils/browser_detect.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com) -// -// MIT License (MIT) -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -/* Version Detect */ - -var appVer = navigator.appVersion.toLowerCase(); -var is_minor = parseFloat(appVer); -var is_major = parseInt(is_minor); -var iePos = appVer.indexOf('msie'); -if (iePos !=-1) { - is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos))) - is_major = parseInt(is_minor); -} -var isIE = (iePos!=-1); -var isIE6 = (isIE && is_major <= 6); -var isIE7 = (isIE && is_major >= 7); -if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits); - var isFF = 1; - var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number - if (ffversion>=3) var isFF3 = 1; - else if (ffversion>=2) var isFF2 = 1; - else if (ffversion>=1) var isFF1 = 1; -} -var isSafari = navigator.userAgent.indexOf('Safari')!=-1 ? 1 : 0; -var isChrome = navigator.userAgent.indexOf('Chrome')!=-1 ? 1 : 0; \ No newline at end of file diff --git a/js/legacy/utils/handler.js b/js/legacy/utils/handler.js index 3100a6443c..ec4d052d57 100644 --- a/js/legacy/utils/handler.js +++ b/js/legacy/utils/handler.js @@ -47,7 +47,7 @@ var pending_req = 0; // new XMLHttpRequest object function newHttpReq() { - if (!isIE) + if (!$.browser.msie) var r=new XMLHttpRequest(); else if (window.ActiveXObject) var r=new ActiveXObject("Microsoft.XMLHTTP"); diff --git a/js/legacy/webpage/freeze_page.js b/js/legacy/webpage/freeze_page.js index c092edd757..31eb036045 100644 --- a/js/legacy/webpage/freeze_page.js +++ b/js/legacy/webpage/freeze_page.js @@ -29,7 +29,7 @@ function freeze(msg, do_freeze) { // blur if(!dialog_back) { dialog_back = $a($i('body_div'), 'div', 'dialog_back'); - if(isIE) dialog_back.style['filter'] = 'alpha(opacity=60)'; + $(dialog_back).css('opacity', 0.6); } $ds(dialog_back); diff --git a/js/legacy/widgets/autosuggest.js b/js/legacy/widgets/autosuggest.js index 9442a86a1f..3572420ac9 100644 --- a/js/legacy/widgets/autosuggest.js +++ b/js/legacy/widgets/autosuggest.js @@ -416,11 +416,7 @@ AutoSuggest.prototype.createList = function(arr) { } this.body = div; - - if(isIE) { - $y(div,{border:'1px solid #444'}); - } - + // currently no item is highlighted // @@ -477,15 +473,15 @@ AutoSuggest.prototype.setHighlight = function(n) if(this.body.scrollbars) { var cur_y = 0; for(var i=0; i= (this.body.scrollTop + this.oP.maxheight - h)) this.body.scrollTop = cur_y - this.oP.maxheight + h + ff_delta; } diff --git a/js/legacy/widgets/report_builder/datatable.js b/js/legacy/widgets/report_builder/datatable.js index b5156ad467..a9e6ae560e 100644 --- a/js/legacy/widgets/report_builder/datatable.js +++ b/js/legacy/widgets/report_builder/datatable.js @@ -304,7 +304,7 @@ _r.DataTable.prototype.run = function() { } $ds(this.fetching_tag); - if(isFF)this.clear_all(); + if($.browser.mozilla)this.clear_all(); var args = { 'query':me.query, diff --git a/py/webnotes/profile.py b/py/webnotes/profile.py index 5984402742..984e2794ab 100644 --- a/py/webnotes/profile.py +++ b/py/webnotes/profile.py @@ -205,7 +205,8 @@ class Profile: t = webnotes.conn.sql("""select email, first_name, last_name, recent_documents from tabProfile where name = %s""", self.name)[0] - self.build_permissions() + if not self.can_read: + self.build_permissions() d = {} d['name'] = self.name