Changeset 19654


Ignore:
Timestamp:
02/03/12 20:01:38 (4 months ago)
Author:
anp
Message:

simpleTask : gestion des permissions - suite

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Wsp_Modeling/spaces/gen/modelBuilder/bs/sm_simpleTask/mainview.xul.xsl

    r19630 r19654  
    6363                        <taskBox title="{resultatAgent('//nameTask')}" 
    6464                                         taskCode="{resultatAgent('//codeTask')}" 
    65                                          editorKey=""/> 
     65                                         editorKey=""> 
     66                                <xsl:if test="sm:security/sm:perms/sm:writePerm/@sc:refUri"><xsl:attribute name="writePerm"><xsl:value-of select="resultatAgent(concat('@', getIdFromPath(sm:security/sm:perms/sm:writePerm/@sc:refUri), '/codePerm'))"/></xsl:attribute></xsl:if> 
     67                        </taskBox> 
    6668                        <script src="chrome://scenariWsp/content/windows/contentView/mainview.launch.js"/> 
    6769                </window> 
  • trunk/Xul_Core/content/Core/widgets/jsForm/jsForm.xbl.xml

    r19651 r19654  
    226226                        <!-- Ensemble des inputs invalides (modifié par les handler inputInvalid et inputValid) --> 
    227227                        <field name="fInvalidInputs" /> 
     228                        <!-- Mode readonly  
     229                                        ATTENTION : Pas de propagation dsur les areas en cas de changement de cette valeur ; réappeler buildInputs si besoin--> 
     230                        <property name="readonly"> 
     231                                <getter> 
     232                                        return this.getAttribute('readonly') 
     233                                </getter> 
     234                                <setter> 
     235                                        if(val) this.setAttribute('readonly', true) 
     236                                                else this.removeAttribute('readonly'); 
     237                                </setter> 
     238                        </property> 
    228239                         
    229240                        <!-- 
     
    245256                                        this.removeInputs();                                     
    246257                                        this.fInputs = this.areas.applyLayout(this, vAreaList, pContext); 
     258                                        if(this.readonly){ 
     259                                                for each(var vInput in this.fInputs) { 
     260                                                        vInput.setAttribute("readonly", true); 
     261                                                } 
     262                                        } 
    247263                                        if (!(pInitializeInputs==false)) { 
    248264                                                //log.info("pContext.value ::: "+log.listProperties(pContext.value)); 
  • trunk/Xul_Wsp/content/Collab/widgets/taskBox/taskBox.xbl.xml

    r19633 r19654  
    4949                        - taskCode 
    5050                        - editorKey [optionnel] 
     51                        - writePerm [optionnel] 
    5152        --> 
    5253        <binding id="taskBox"> 
     
    106107                        <property name="editorKey" onget="return this.hasAttribute('editorKey') ? this.getAttribute('editorKey') : ''" readonly="true"/> 
    107108                         
     109                        <!-- box readonly ou pas --> 
     110                        <property name="readonly"> 
     111                                <getter><![CDATA[ 
     112                                        var vIsReadonly = false; 
     113                                        if(window.scSecurityCtx && this.hasAttribute("writePerm")){ 
     114                                                var vWritePerm = window.scSecurityCtx.getPerm(this.getAttribute("writePerm")); 
     115                                                vIsReadonly = !window.scSecurityCtx.hasPermForObjectRoot(vWritePerm); 
     116                                        } 
     117                                        return desk.isReadOnly() || this.hasAttribute("readonly") || vIsReadonly; 
     118                                ]]></getter>     
     119                        </property> 
     120                         
     121                        <!--   --> 
     122                        <method name="this.checkBoxPerms"> 
     123                                <parameter name="pPermList"/> 
     124                                <body><![CDATA[ 
     125                                        if(!pPermList) return true; 
     126                                        var vScSecurityCtx = window.scSecurityCtx; 
     127                                        if(!vScSecurityCtx) return true; 
     128                                        //log.info("pPermList :: "+log.listProperties(pPermList)); 
     129                                        return vScSecurityCtx.hasPermForObjectRoot(pPermList); 
     130                                ]]></body> 
     131                        </method> 
     132                         
    108133                         
    109134                        <!-- Chargement/recharement de la box --> 
     
    204229                                        //Construction des widgets. 
    205230                                        var vListWidgets = vModelExtPoints.getList("formEditor:widgets:"+this.editorKey); 
     231                                        this.fJsForm.readonly = this.readonly; 
    206232                                        this.fJsForm.buildInputs(vContext, vListWidgets, false); 
    207233                                        this.fJsForm.extractValue(vContext); 
Note: See TracChangeset for help on using the changeset viewer.