Changeset 19651
- Timestamp:
- 02/03/12 18:13:10 (4 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
Wsp_Modeling/spaces/gen/modelBuilder/bs/sm_simpleTask.xml (modified) (2 diffs)
-
Xul_Core/content/Core/widgets/jsForm/jsForm.jsm (modified) (3 diffs)
-
Xul_Core/content/Core/widgets/jsForm/jsForm.xbl.xml (modified) (3 diffs)
-
Xul_Wsp/content/Wsp/widgets/jsForm/wspJsForm.xbl.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Wsp_Modeling/spaces/gen/modelBuilder/bs/sm_simpleTask.xml
r19647 r19651 336 336 <xsl:if test="sm:help">.setDescription("<xsl:value-of select="sm:help/@quickHelp"/>")</xsl:if> 337 337 <!-- sm:perms --> 338 <!-- TODO perms 339 .addWritePermName() 340 .addPermissionName() 341 --> 338 <xsl:if test="sm:perms/sm:writePerm/@sc:refUri">.addWritePermName("<xsl:value-of select="resultatAgent(concat('@', getIdFromPath(sm:perms/sm:writePerm/@sc:refUri), '/codePerm'))"/>")</xsl:if> 339 <xsl:if test="$pFormWidget/sm:perms/sm:writePerm/@sc:refUri">.addWritePermName("<xsl:value-of select="resultatAgent(concat('@', getIdFromPath($pFormWidget/sm:perms/sm:writePerm/@sc:refUri), '/codePerm'))"/>")</xsl:if> 342 340 </xsl:template> 343 341 … … 407 405 </page> 408 406 </affichage> 407 </valeur> 408 409 <!-- @API : peuplement des buffers de gestion des droits --> 410 <valeur code="fillMapRights"> 411 <source type="xpathOnSrc-dynamique">execute(concatExpr(//*[local-name()='addRight' or local-name()='writePerm'], resultatAgent(concat('@', getIdFromPath(@sc:refUri), '/fillMapRights'))))</source> 409 412 </valeur> 410 413 -
trunk/Xul_Core/content/Core/widgets/jsForm/jsForm.jsm
r19519 r19651 42 42 isReadOnly: function(pContext) { 43 43 if(this.fReadOnly == true) return true; 44 var vPerms = this.getWritePerms( );45 if (!vPerms ) return false;44 var vPerms = this.getWritePerms(pContext); 45 if (!vPerms || !pContext) return false; 46 46 var vSecurityCtx = pContext.scSecurityCtx || pContext.window.scSecurityCtx; 47 47 if (!vSecurityCtx) return false; … … 57 57 /** Ajoute une permission par son nom. La perm devra être résolu en fonction du contexte à l'execution du isReadOnly(pContext). */ 58 58 addWritePermName:function(pPermName){ 59 //TODO 60 }, 61 62 getWritePerms: function () { 63 return this.fWritePerms; 59 if(!this.fWritePermsNameArray) this.fWritePermsNameArray=[]; 60 this.fWritePermsNameArray.push(pPermName); 61 return this; 62 }, 63 64 getWritePerms: function (pContext) { 65 try{ 66 if(!this.fWritePermsNameArray || !pContext){ 67 return this.fWritePerms; 68 }else{ 69 var vPermsArray = Array.isArray(this.fWritePerms) ? this.fWritePerms.clone() : []; 70 if(this.fWritePerms && !Array.isArray(this.fWritePerms)) vPermsArray.push(this.fWritePerms); 71 var vSecurityCtx = pContext.scSecurityCtx || pContext.window.scSecurityCtx; 72 if(vSecurityCtx){ 73 vPermsArray = vPermsArray.concat(vSecurityCtx.getPerms(this.fWritePermsNameArray.join(" "))); 74 } 75 return vPermsArray; 76 } 77 }catch(e){log.debug(e)} 64 78 }, 65 79 … … 121 135 if (vLabel) vInput.setAttribute('label', vLabel); 122 136 123 if (this.isReadOnly( )) vInput.setAttribute('readonly', 'true');124 if (this.isRequired( )) vInput.setAttribute('required', 'true');137 if (this.isReadOnly(pContext)) vInput.setAttribute('readonly', 'true'); 138 if (this.isRequired(pContext)) vInput.setAttribute('required', 'true'); 125 139 126 140 var vDescription = this.getDescription(pContext); -
trunk/Xul_Core/content/Core/widgets/jsForm/jsForm.xbl.xml
r19647 r19651 535 535 <xul:label anonid="label" xbl:inherits="value=label" /> 536 536 <xul:hbox align="top" xbl:inherits="tooltiptext=description"> 537 <xul:toolbarbutton anonid="clear" class="smallbutton" xbl:inherits="disabled, disabled=readonly" oncommand="document.getBindingParent(this)._DeleteValue()"/>537 <xul:toolbarbutton anonid="clear" class="smallbutton" xbl:inherits="disabled,collapsed=readonly" oncommand="document.getBindingParent(this)._DeleteValue()"/> 538 538 <xul:datepicker anonid="input" isnull="true" xbl:inherits="disabled,readonly,required" type="popup"/> 539 539 </xul:hbox> … … 558 558 <property name="fInputNode" onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'input')" /> 559 559 <property name="fBtn" onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'clear')" /> 560 <property name="readonly" onget="return this.getAttribute('readonly')=='true'" /> 560 561 561 562 <!-- @param pFormat[optionnel] [XML(défaut)|timestamp] --> … … 612 613 this.dispatchDirtyEvent(); 613 614 </handler> 614 <handler event="focus"> 615 if( this.fInputNode.isnull){615 <handler event="focus"><![CDATA[ 616 if(!this.readonly && this.fInputNode.isnull){ 616 617 this.fInputNode.isnull = false; 617 618 this.dispatchDirtyEvent(); 618 619 } 619 </handler>620 ]]></handler> 620 621 </handlers> 621 622 </binding> -
trunk/Xul_Wsp/content/Wsp/widgets/jsForm/wspJsForm.xbl.xml
r19647 r19651 54 54 <xul:xedToolBar anonid="toolBar" style="-moz-binding: url(chrome://scenariXedLib/content/libUiBase/widgets/xedUiBase.xbl.xml#xedToolBar);" /> 55 55 </xul:hbox> 56 <xul:editXedBox anonid="xedBox" class="maskIfClosed" hideStructBar="true" xmlErrorsAllowed="false" style="-moz-binding: url(chrome://scenariXedLib/content/core/xed.xbl.xml#xedBoxNoScroll);" xbl:inherits="hideStructBar,xmlErrorsAllowed,tooltiptext=description "/>56 <xul:editXedBox anonid="xedBox" class="maskIfClosed" hideStructBar="true" xmlErrorsAllowed="false" style="-moz-binding: url(chrome://scenariXedLib/content/core/xed.xbl.xml#xedBoxNoScroll);" xbl:inherits="hideStructBar,xmlErrorsAllowed,tooltiptext=description,readonly"/> 57 57 </content> 58 58 <implementation>
Note: See TracChangeset
for help on using the changeset viewer.