From 3a9ddaf2c1e96ec7ba5cbff6e949165cfa827297 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 18 Apr 2012 12:34:18 +0530 Subject: [PATCH] permission engine bugfix --- .../doctype/permission_control/permission_control.py | 3 ++- js/all-app.js | 9 ++++++--- js/all-web.js | 9 ++++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/erpnext/setup/doctype/permission_control/permission_control.py b/erpnext/setup/doctype/permission_control/permission_control.py index 41f3a48ccf..4ddf5c6868 100644 --- a/erpnext/setup/doctype/permission_control/permission_control.py +++ b/erpnext/setup/doctype/permission_control/permission_control.py @@ -68,7 +68,8 @@ class DocType: 'create': cint(perm.create), 'cancel': cint(perm.cancel), 'submit': cint(perm.submit), - 'amend': cint(perm.amend) + 'amend': cint(perm.amend), + 'match': perm.match } for perm in sorted(doclist, key=lambda d: [d.fields.get('permlevel'), d.fields.get('role')]) if perm.doctype=='DocPerm'] diff --git a/js/all-app.js b/js/all-app.js index 962d2147c7..8be8069596 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -184,7 +184,11 @@ wn.dom.css=function(ele,s){if(ele&&s){for(var i in s)ele.style[i]=s[i];};return wn.get_cookie=function(c){var t=""+document.cookie;var ind=t.indexOf(c);if(ind==-1||c=="")return"";var ind1=t.indexOf(';',ind);if(ind1==-1)ind1=t.length;return unescape(t.substring(ind+c.length+1,ind1));} wn.dom.set_box_shadow=function(ele,spread){$(ele).css('-moz-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);') $(ele).css('-webkit-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);') -$(ele).css('-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);')} +$(ele).css('-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);')};(function($){$.fn.add_options=function(options_list){for(var i=0;i').html(label).attr('value',value).appendTo(this);} +$(this).val(options_list[0].value||options_list[0]);} +$.fn.set_working=function(){var ele=this.get(0);if(ele.loading_img){$di(ele.loading_img)}else{ele.disabled=1;ele.loading_img=$('').insertAfter(ele);}} +$.fn.done_working=function(){var ele=this.get(0);ele.disabled=0;if(ele.loading_img){$(ele.loading_img).toggle(false);};}})(jQuery); /* * lib/js/wn/model.js */ @@ -591,8 +595,7 @@ function $btn(parent,label,onclick,style,css_class,is_ajax){if(css_class==='gree $item_normal=function(ele){$y(ele,{padding:'6px 8px',cursor:'pointer',marginRight:'8px',whiteSpace:'nowrap',overflow:'hidden',borderBottom:'1px solid #DDD'});$bg(ele,'#FFF');$fg(ele,'#000');} $item_active=function(ele){$bg(ele,'#FE8');$fg(ele,'#000');} $item_selected=function(ele){$bg(ele,'#777');$fg(ele,'#FFF');} -$item_pressed=function(ele){$bg(ele,'#F90');$fg(ele,'#FFF');};(function($){$.fn.set_working=function(){var ele=this.get(0);if(ele.loading_img){$di(ele.loading_img)}else{ele.disabled=1;ele.loading_img=$a(ele.parentNode,'img','',{marginLeft:'4px',marginBottom:'-2px',display:'inline'});ele.loading_img.src='lib/images/ui/button-load.gif';}} -$.fn.done_working=function(){var ele=this.get(0);ele.disabled=0;if(ele.loading_img){$dh(ele.loading_img)};}})(jQuery);function set_opacity(ele,ieop){var op=ieop/100;if(ele.filters){try{ele.filters.item("DXImageTransform.Microsoft.Alpha").opacity=ieop;}catch(e){ele.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+ieop+')';}}else{ele.style.opacity=op;}} +$item_pressed=function(ele){$bg(ele,'#F90');$fg(ele,'#FFF');};function set_opacity(ele,ieop){var op=ieop/100;if(ele.filters){try{ele.filters.item("DXImageTransform.Microsoft.Alpha").opacity=ieop;}catch(e){ele.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+ieop+')';}}else{ele.style.opacity=op;}} $br=function(ele,r,corners){if(corners){var cl=['top-left','top-right','bottom-right','bottom-left'];for(var i=0;i<4;i++){if(corners[i]){$(ele).css('-moz-border-radius-'+cl[i].replace('-',''),r).css('-webkit-'+cl[i]+'-border-radius',r);}}}else{$(ele).css('-moz-border-radius',r).css('-webkit-border-radius',r).css('border-radius',r);}} $bs=function(ele,r){$(ele).css('-moz-box-shadow',r).css('-webkit-box-shadow',r).css('box-shadow',r);} function SelectWidget(parent,options,width,editable,bg_color){var me=this;this.inp=$a(parent,'select');if(options)add_sel_options(this.inp,options);if(width)$y(this.inp,{width:width});this.set_width=function(w){$y(this.inp,{width:w})};this.set_options=function(o){add_sel_options(this.inp,o);} diff --git a/js/all-web.js b/js/all-web.js index 27a673af5f..db20e574ef 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -71,7 +71,11 @@ wn.dom.css=function(ele,s){if(ele&&s){for(var i in s)ele.style[i]=s[i];};return wn.get_cookie=function(c){var t=""+document.cookie;var ind=t.indexOf(c);if(ind==-1||c=="")return"";var ind1=t.indexOf(';',ind);if(ind1==-1)ind1=t.length;return unescape(t.substring(ind+c.length+1,ind1));} wn.dom.set_box_shadow=function(ele,spread){$(ele).css('-moz-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);') $(ele).css('-webkit-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);') -$(ele).css('-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);')} +$(ele).css('-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);')};(function($){$.fn.add_options=function(options_list){for(var i=0;i').html(label).attr('value',value).appendTo(this);} +$(this).val(options_list[0].value||options_list[0]);} +$.fn.set_working=function(){var ele=this.get(0);if(ele.loading_img){$di(ele.loading_img)}else{ele.disabled=1;ele.loading_img=$('').insertAfter(ele);}} +$.fn.done_working=function(){var ele=this.get(0);ele.disabled=0;if(ele.loading_img){$(ele.loading_img).toggle(false);};}})(jQuery); /* * lib/js/wn/model.js */ @@ -478,8 +482,7 @@ function $btn(parent,label,onclick,style,css_class,is_ajax){if(css_class==='gree $item_normal=function(ele){$y(ele,{padding:'6px 8px',cursor:'pointer',marginRight:'8px',whiteSpace:'nowrap',overflow:'hidden',borderBottom:'1px solid #DDD'});$bg(ele,'#FFF');$fg(ele,'#000');} $item_active=function(ele){$bg(ele,'#FE8');$fg(ele,'#000');} $item_selected=function(ele){$bg(ele,'#777');$fg(ele,'#FFF');} -$item_pressed=function(ele){$bg(ele,'#F90');$fg(ele,'#FFF');};(function($){$.fn.set_working=function(){var ele=this.get(0);if(ele.loading_img){$di(ele.loading_img)}else{ele.disabled=1;ele.loading_img=$a(ele.parentNode,'img','',{marginLeft:'4px',marginBottom:'-2px',display:'inline'});ele.loading_img.src='lib/images/ui/button-load.gif';}} -$.fn.done_working=function(){var ele=this.get(0);ele.disabled=0;if(ele.loading_img){$dh(ele.loading_img)};}})(jQuery);function set_opacity(ele,ieop){var op=ieop/100;if(ele.filters){try{ele.filters.item("DXImageTransform.Microsoft.Alpha").opacity=ieop;}catch(e){ele.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+ieop+')';}}else{ele.style.opacity=op;}} +$item_pressed=function(ele){$bg(ele,'#F90');$fg(ele,'#FFF');};function set_opacity(ele,ieop){var op=ieop/100;if(ele.filters){try{ele.filters.item("DXImageTransform.Microsoft.Alpha").opacity=ieop;}catch(e){ele.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+ieop+')';}}else{ele.style.opacity=op;}} $br=function(ele,r,corners){if(corners){var cl=['top-left','top-right','bottom-right','bottom-left'];for(var i=0;i<4;i++){if(corners[i]){$(ele).css('-moz-border-radius-'+cl[i].replace('-',''),r).css('-webkit-'+cl[i]+'-border-radius',r);}}}else{$(ele).css('-moz-border-radius',r).css('-webkit-border-radius',r).css('border-radius',r);}} $bs=function(ele,r){$(ele).css('-moz-box-shadow',r).css('-webkit-box-shadow',r).css('box-shadow',r);} function SelectWidget(parent,options,width,editable,bg_color){var me=this;this.inp=$a(parent,'select');if(options)add_sel_options(this.inp,options);if(width)$y(this.inp,{width:width});this.set_width=function(w){$y(this.inp,{width:w})};this.set_options=function(o){add_sel_options(this.inp,o);}