@@ -1528,15 +1528,18 @@ define([
1528
1528
if ( me . appOptions . canFillForms ) {
1529
1529
var oform = me . api . asc_GetOForm ( ) ,
1530
1530
role = new AscCommon . CRestrictionSettings ( ) ;
1531
- if ( oform && me . appOptions . user . roles && me . appOptions . user . roles . length > 0 && oform . asc_canFillRole ( me . appOptions . user . roles [ 0 ] ) ) {
1532
- role . put_OFormRole ( this . appOptions . user . roles [ 0 ] ) ;
1531
+ if ( oform && me . appOptions . user . roles ) {
1532
+ if ( me . appOptions . user . roles . length > 0 && oform . asc_canFillRole ( me . appOptions . user . roles [ 0 ] ) ) {
1533
+ role . put_OFormRole ( this . appOptions . user . roles [ 0 ] ) ;
1534
+ me . showFillingForms ( true ) ;
1535
+ } else {
1536
+ role . put_OFormNoRole ( true ) ;
1537
+ me . view . btnFillStatus && me . view . btnFillStatus . isVisible ( ) && Common . UI . TooltipManager . addTips ( {
1538
+ 'showFillStatus' : { name : 'de-help-tip-fill-status' , text : me . helpTextFillStatus , target : '#id-btn-status' , placement : 'bottom-left' , showButton : false , automove : true , maxwidth : 300 }
1539
+ } ) ;
1540
+ }
1541
+ } else // can fill all fields
1533
1542
me . showFillingForms ( true ) ;
1534
- } else {
1535
- role . put_OFormNoRole ( true ) ;
1536
- me . view . btnFillStatus && me . view . btnFillStatus . isVisible ( ) && Common . UI . TooltipManager . addTips ( {
1537
- 'showFillStatus' : { name : 'de-help-tip-fill-status' , text : me . helpTextFillStatus , target : '#id-btn-status' , placement : 'bottom-left' , showButton : false , automove : true , maxwidth : 300 }
1538
- } ) ;
1539
- }
1540
1543
this . api . asc_setRestriction ( Asc . c_oAscRestrictionType . OnlyForms , role ) ;
1541
1544
}
1542
1545
@@ -2085,10 +2088,12 @@ define([
2085
2088
}
2086
2089
var oform = this . api . asc_GetOForm ( ) ,
2087
2090
role = new AscCommon . CRestrictionSettings ( ) ;
2088
- if ( oform && this . appOptions . user . roles && this . appOptions . user . roles . length > 0 && oform . asc_canFillRole ( this . appOptions . user . roles [ 0 ] ) ) {
2089
- role . put_OFormRole ( this . appOptions . user . roles [ 0 ] ) ;
2090
- } else {
2091
- role . put_OFormNoRole ( true ) ;
2091
+ if ( oform && this . appOptions . user . roles ) {
2092
+ if ( this . appOptions . user . roles . length > 0 && oform . asc_canFillRole ( this . appOptions . user . roles [ 0 ] ) ) {
2093
+ role . put_OFormRole ( this . appOptions . user . roles [ 0 ] ) ;
2094
+ } else {
2095
+ role . put_OFormNoRole ( true ) ;
2096
+ }
2092
2097
}
2093
2098
this . api . asc_setRestriction ( state || ! this . appOptions . canFillForms ? Asc . c_oAscRestrictionType . View : Asc . c_oAscRestrictionType . OnlyForms , role ) ;
2094
2099
} ,
0 commit comments