Changeset 1449
- Timestamp:
- 07/02/07 14:34:01
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl
r1445 r1449 356 356 <script type="text/javascript" src="{$resourcesRoot}/resources/bedework.js"> </script> 357 357 <xsl:if test="/bedework/page='modSchedulingPrefs' or 358 /bedework/page='modPrefs' or 358 /bedework/page='modPrefs' or 359 359 /bedework/page='attendeeRespond'"> 360 360 <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkPrefs.js"> </script> … … 3023 3023 <div id="sharingBox"> 3024 3024 <xsl:choose> 3025 <xsl:when test="/bedework/editableAccess/access/acl"> 3025 <xsl:when test="/bedework/editableAccess/access/acl"> 3026 3026 <xsl:apply-templates select="/bedework/editableAccess/access/acl" mode="currentAccess"> 3027 3027 <xsl:with-param name="action" select="$event-setAccess"/> … … 3029 3029 <xsl:with-param name="guid" select="$guid"/> 3030 3030 <xsl:with-param name="recurrenceId" select="$recurrenceId"/> 3031 <xsl:with-param name="method">2</xsl:with-param> 3031 <xsl:with-param name="method">2</xsl:with-param> 3032 3032 </xsl:apply-templates> 3033 3033 </xsl:when> … … 7012 7012 Rights: 7013 7013 </h5> 7014 <input type="hidden" name="how" value="" />7014 <input type="hidden" name="how" value="" id="bwCurrentHow"/> 7015 7015 <!-- field 'acl' will receive xml for method 2 --> 7016 <input type="hidden" name="acl" value="" />7016 <input type="hidden" name="acl" value="" id="bwCurrentAcl" /> 7017 7017 <!-- Advanced Access Rights: --> 7018 7018 <!-- the "how" field is set by iterating over the howItems below --> … … 7264 7264 <xsl:param name="recurrenceId"/> <!-- optional (for entities) --> 7265 7265 <xsl:param name="what"/> <!-- optional (for scheduling only) --> 7266 <xsl:param name="method">1</xsl:param> <!-- which method of access control 7267 are we using: 1 (one request per pricipal) or 2 (set all with 7268 javascript and send entire ACL to server) --> 7266 <xsl:param name="method">1</xsl:param> <!-- which method of access control 7267 are we using: 1 (one request per pricipal) or 2 (set all with 7268 javascript and send entire ACL to server) --> 7269 7269 <h3>Current Access:</h3> 7270 7270 <table class="common scheduling" id="bwCurrentAccess"> … … 7392 7392 </table> 7393 7393 </xsl:template> 7394 7394 7395 7395 <!--==== SEARCH RESULT ====--> 7396 7396 <xsl:template name="searchResult"> … … 7689 7689 </xsl:template> 7690 7690 7691 <xsl:template name="grantDenyToInternal"><!-- 7692 --><xsl:param name="name"/><!-- 7691 <xsl:template name="grantDenyToInternal"><!-- 7692 --><xsl:param name="name"/><!-- 7693 7693 --><xsl:choose> 7694 7694 <xsl:when test="$name = 'all'">A</xsl:when> … … 7705 7705 <xsl:when test="$name = 'schedule-request'">t</xsl:when> 7706 7706 <xsl:when test="$name = 'schedule-reply'">y</xsl:when> 7707 <xsl:when test="$name = 'schedule-free-busy'">s</xsl:when> 7707 <xsl:when test="$name = 'schedule-free-busy'">s</xsl:when> 7708 7708 <xsl:when test="$name = 'unbind'">u</xsl:when> 7709 7709 <xsl:when test="$name = 'unlock'">U</xsl:when> … … 7733 7733 </xsl:choose> 7734 7734 </xsl:template> 7735 7735 7736 7736 <!--==== FOOTER ====--> 7737 7737 <xsl:template name="footer"> trunk/deployment/webuser/webapp/resources/demoskins/resources/bedeworkAccess.js
r1448 r1449 51 51 var ownerStr = "owner"; 52 52 var otherStr = "other"; 53 var deleteStr = "remove";54 53 var grantStr = "grant"; 54 55 var deleteStr = "default"; 55 56 56 57 // How granted accesses appear … … 290 291 */ 291 292 function bwPrincipal(who, whoType) { 292 this.who = who;293 293 this.whoType = whoType; 294 294 295 // Don't touch email like addresses 296 if (who.indexOf("@") < 0) { 297 // Normalize the who 298 if (whoType == "user") { 299 if (who.indexOf(principalPrefix) != "0") { 300 who = userPrincipalPrefix + who; 301 } 302 } else if (whoType == "group") { 303 if (who.indexOf(principalPrefix) != "0") { 304 who = groupPrincipalPrefix + who; 305 } 306 } else if (whoType == "resource") { 307 if (who.indexOf(principalPrefix) != "0") { 308 who = resourcePrincipalPrefix + who; 295 if ((whoType == "auth") || 296 (whoType == "unauth") || 297 (whoType == "owner") || 298 (whoType == "other")) { 299 // Don't set who 300 } else { 301 this.who = who; 302 303 // Don't touch email like addresses 304 if (who.indexOf("@") < 0) { 305 // Normalize the who 306 if (whoType == "user") { 307 if (who.indexOf(principalPrefix) != "0") { 308 who = userPrincipalPrefix + who; 309 } 310 } else if (whoType == "group") { 311 if (who.indexOf(principalPrefix) != "0") { 312 who = groupPrincipalPrefix + who; 313 } 314 } else if (whoType == "resource") { 315 if (who.indexOf(principalPrefix) != "0") { 316 who = resourcePrincipalPrefix + who; 317 } 309 318 } 310 319 } … … 368 377 } 369 378 379 this.toString = function() { 380 return "bwPrincipal[who=" + this.who + ", whoType=" + this.whoType + "]"; 381 } 382 370 383 this.equals = function(pr) { 384 //alert("this=" + this.toString() + " pr=" + pr.toString()); 385 371 386 if (this.whoType != pr.whoType) { 372 387 return false; … … 480 495 } 481 496 482 this.toFormRow = function(row ) {497 this.toFormRow = function(row, aceI) { 483 498 row.insertCell(0).appendChild(document.createTextNode(this.principal.format())); 484 499 row.insertCell(1).appendChild(document.createTextNode(this.formatHow())); 485 500 row.insertCell(2).appendChild(document.createTextNode(this.formatInherited())); 486 501 var td_3 = row.insertCell(3); 487 td_3.appendChild(document.createTextNode('')); 488 //<a href="javascript:bwAcl.delete(' + j +')">' + deleteStr + '</a> 502 if (this.inherited == "") { 503 td_3.innerHTML = "<a href=\"javascript:bwAcl.deleteAce('" + aceI + "')\">" + deleteStr + "</a>"; 504 } 489 505 } 490 506 } … … 495 511 var aces = new Array(); 496 512 513 /* If we delete an ace we need to reinstate any inherited access for the same principal 514 */ 515 var savedInherited = new Array(); 516 497 517 // Initialize the list. 498 518 // The function expects a comma-separated list of arguments grouped 499 519 // into the five ACE properties. 500 520 this.init = function(who, whoType, how, inherited, invert) { 501 aces.push(new bwAce(who, whoType, how, inherited, invert)); 521 var newAce = new bwAce(who, whoType, how, inherited, invert); 522 aces.push(newAce); 523 if (inherited != "") { 524 savedInherited.push(newAce); 525 } 502 526 } 503 527 … … 505 529 this.addAce = function(newAce) { 506 530 // expects a bwAce object as parameter 507 for ( i = 0; i < aces.length; i++) {531 for (var i = 0; i < aces.length; i++) { 508 532 if (aces[i].equals(newAce)) { 509 533 // replace an existing ace … … 539 563 // "\ntype= " + type + "\nhow=" + how); 540 564 541 bwAcl.addAce(new bwAce(formObj.who.value, type, how, "" , false));565 this.addAce(new bwAce(formObj.who.value, type, how, "" , false)); 542 566 formObj.who.value = ""; 543 567 544 568 // update the acl form field 545 formObj.acl.value = this.toXml(); 569 var formAcl = document.getElementById("bwCurrentAcl"); 570 formAcl.value = this.toXml(); 546 571 547 572 // redraw the display … … 550 575 551 576 this.deleteAce = function(index) { 552 bwAcl.aces.splice(index, 1); 577 var ace = aces[index]; 578 var replace = false; 579 580 for (var si = 0; si < savedInherited.length; si++) { 581 if (savedInherited[si].equals(ace)) { 582 ace = savedInherited[si]; 583 replace = true; 584 break; 585 } 586 } 587 588 if (replace) { 589 aces[index] = ace; 590 } else { 591 aces.splice(index, 1); 592 } 553 593 554 594 // update the acl form field 555 formObj.acl = this.toXml(); 595 var formAcl = document.getElementById("bwCurrentAcl"); 596 formAcl.value = this.toXml(); 556 597 557 598 // redraw the display … … 575 616 var tr = aclTableBody.insertRow(j); 576 617 577 curAce.toFormRow(tr );618 curAce.toFormRow(tr, j); 578 619 } 579 620 } catch (e) {
