Changeset 1665
- Timestamp:
- 12/10/07 16:42:10
- Files:
-
- trunk/deployment/webadmin/webapp/resources/default/default/default.xsl (modified) (3 diffs)
- trunk/deployment/websubmit/webapp/resources/demoskins/default/default/default.css (modified) (2 diffs)
- trunk/deployment/websubmit/webapp/resources/demoskins/default/default/default.xsl (modified) (17 diffs)
- trunk/deployment/websubmit/webapp/resources/demoskins/resources/bedework.js (modified) (1 diff)
- trunk/deployment/websubmit/webapp/resources/demoskins/resources/bedeworkEventForm.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webadmin/webapp/resources/default/default/default.xsl
r1663 r1665 66 66 dynamically in the xslt). --> 67 67 68 <xsl:variable name="submissionsRoot" select="/bedework/submissionsRoot"/> 68 <xsl:variable name="submissionsRootEncoded" select="/bedework/submissionsRoot/encoded"/> 69 <xsl:variable name="submissionsRootUnencoded" select="/bedework/submissionsRoot/unencoded"/> 69 70 70 71 <!-- primary navigation, menu tabs --> … … 523 524 <xsl:attribute name="class">selected</xsl:attribute> 524 525 </xsl:if> 525 <a href="{$initPendingTab}&ignoreCreator=yes&calPath={$submissionsRoot }">Pending Events</a>526 <a href="{$initPendingTab}&ignoreCreator=yes&calPath={$submissionsRootEncoded}">Pending Events</a> 526 527 </li> 527 528 <xsl:if test="/bedework/currentCalSuite/currentAccess/current-user-privilege-set/privilege/write or /bedework/userInfo/superUser='true'"> … … 2166 2167 <tr> 2167 2168 <xsl:choose> 2168 <xsl:when test="starts-with(form/calendar/all/select/option[@selected],$submissionsRoot )">2169 <xsl:when test="starts-with(form/calendar/all/select/option[@selected],$submissionsRootUnencoded)"> 2169 2170 <td> 2170 2171 <input type="submit" name="updateSubmitEvent" value="Update Event"/> trunk/deployment/websubmit/webapp/resources/demoskins/default/default/default.css
r1660 r1665 248 248 font-size: 0.9em; 249 249 } 250 #bedework #instructions.navButtons {250 #bedework .navButtons { 251 251 float: right; 252 252 text-align: right; 253 253 } 254 #bedework #instructions.navButtons img {254 #bedework .navButtons img { 255 255 vertical-align: middle; 256 } 257 #bedework .navBox { 258 padding: 4px; 259 background-color: #ffe; 260 border: 1px solid #ccc; 256 261 } 257 262 #bedework #bwBottomNav { … … 729 734 font-style: italic; 730 735 } 736 #bedework .highlight { 737 color: black; 738 background-color: #fee; 739 border: 1px solid #333; 740 } 741 #bedework .notice { 742 font-weight: bold; 743 font-style: italic; 744 } trunk/deployment/websubmit/webapp/resources/demoskins/default/default/default.xsl
r1660 r1665 154 154 document.getElementById(id).focus(); 155 155 } 156 function validate(form) {157 alert ("check");158 if (form.summary.value == "") {159 alert("Please enter a summary.");160 form.summary.focus();161 return false;162 }163 }164 156 ]]> 165 157 </xsl:comment> … … 235 227 <!--==== HOME ====--> 236 228 <xsl:template name="home"> 229 <div class="navButtons navBox"> 230 <a href="{$initEvent}">start 231 <img alt="previous" 232 src="{$resourcesRoot}/resources/arrowRight.gif" 233 width="13" 234 height="13" 235 border="0"/> 236 </a> 237 </div> 237 238 <h1>Entering Events</h1> 238 239 <ol id="introduction"> … … 266 267 <!--==== ADD EVENT ====--> 267 268 <xsl:template match="formElements" mode="addEvent"> 268 <form name="eventForm" method="post" action="{$addEvent}" id="standardForm" onsubmit=" return validate();setEventFields(this);">269 <form name="eventForm" method="post" action="{$addEvent}" id="standardForm" onsubmit="setEventFields(this);"> 269 270 <xsl:apply-templates select="." mode="eventForm"/> 270 271 </form> … … 273 274 <!--==== EDIT EVENT ====--> 274 275 <xsl:template match="formElements" mode="editEvent"> 275 <form name="eventForm" method="post" action="{$updateEvent}" id="standardForm" onsubmit=" return validate();setEventFields(this);">276 <form name="eventForm" method="post" action="{$updateEvent}" id="standardForm" onsubmit="setEventFields(this);"> 276 277 <xsl:apply-templates select="." mode="eventForm"/> 277 278 </form> … … 287 288 <xsl:variable name="recurrenceId" select="recurrenceId"/> 288 289 <input type="hidden" name="endType" value="date"/> 290 <!-- for now, the comment field will hold the user's suggestions; 291 this should be replaced with a different field to avoid 292 overloading the RFC property. --> 293 <input type="hidden" name="comment" id="bwEventComment"/> 289 294 290 295 <!-- event info for edit event --> … … 375 380 <div id="bwHelp-Details"> 376 381 <div class="navButtons"> 377 <a href="javascript:show('bwEventTab-Location','bwHelp-Location','bwBottomNav-Location'); hide('bwEventTab-Details','bwHelp-Details','bwBottomNav-Details');"> 382 <a href="javascript:show('bwEventTab-Location','bwHelp-Location','bwBottomNav-Location');hide('bwEventTab-Details','bwHelp-Details','bwBottomNav-Details');" 383 onclick="return validateStep1();"> 378 384 next 379 385 <img alt="previous" … … 395 401 border="0"/> 396 402 previous</a> | 397 <a href="javascript:show('bwEventTab-Contact','bwHelp-Contact','bwBottomNav-Contact'); hide('bwEventTab-Location','bwHelp-Location','bwBottomNav-Location');"> 403 <a href="javascript:show('bwEventTab-Contact','bwHelp-Contact','bwBottomNav-Contact'); hide('bwEventTab-Location','bwHelp-Location','bwBottomNav-Location');" 404 onclick="return validateStep2();"> 398 405 next 399 406 <img alt="previous" … … 415 422 border="0"/> 416 423 previous</a> | 417 <a href="javascript:show('bwEventTab-Categories','bwHelp-Categories','bwBottomNav-Categories'); hide('bwHelp-Contact','bwEventTab-Contact','bwBottomNav-Contact');"> 424 <a href="javascript:show('bwEventTab-Categories','bwHelp-Categories','bwBottomNav-Categories'); hide('bwHelp-Contact','bwEventTab-Contact','bwBottomNav-Contact');" 425 onclick="return validateStep3();"> 418 426 next 419 427 <img alt="previous" … … 458 466 <div id="bwEventTab-Details"> 459 467 <table cellspacing="0" class="common"> 468 <!-- Calendar --> 469 <!-- ======== --> 470 <!-- the string "user/" should not be hard coded; fix this --> 471 <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable> 472 <xsl:variable name="writableCalendars"> 473 <xsl:value-of select=" 474 count(/bedework/myCalendars//calendar[calType = '1' and 475 currentAccess/current-user-privilege-set/privilege/write-content]) + 476 count(/bedework/mySubscriptions//calendar[calType = '1' and 477 currentAccess/current-user-privilege-set/privilege/write-content and 478 (not(contains(path,$userPath)))])"/> 479 </xsl:variable> 460 480 <tr> 481 <xsl:if test="$writableCalendars = 1"> 482 <xsl:attribute name="class">invisible</xsl:attribute> 483 <!-- hide this row altogether if there is only one calendar; if you want the calendar 484 path displayed, comment out this xsl:if. --> 485 </xsl:if> 461 486 <td class="fieldname"> 462 487 Calendar: 463 488 </td> 464 489 <td class="fieldval"> 465 <!-- the string "user/" should not be hard coded; fix this -->466 <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable>467 <xsl:variable name="writableCalendars">468 <xsl:value-of select="469 count(/bedework/myCalendars//calendar[calType = '1' and470 currentAccess/current-user-privilege-set/privilege/write-content]) +471 count(/bedework/mySubscriptions//calendar[calType = '1' and472 currentAccess/current-user-privilege-set/privilege/write-content and473 (not(contains(path,$userPath)))])"/>474 </xsl:variable>475 490 <xsl:choose> 476 491 <xsl:when test="$writableCalendars = 1"> … … 520 535 </tr> 521 536 <!-- Summary (title) of event --> 537 <!-- ========================= --> 522 538 <tr> 523 539 <td class="fieldname"> … … 525 541 </td> 526 542 <td class="fieldval"> 543 <div id="bwEventTitleNotice" class="invisible">You must include a title.</div> <!-- a holder for validation notes --> 527 544 <xsl:variable name="title" select="form/title/input/@value"/> 528 545 <input type="text" name="summary" size="80" value="{$title}" id="bwEventTitle"/> … … 837 854 <td class="fieldname">Description:</td> 838 855 <td class="fieldval"> 856 <div id="bwEventDescNotice" class="invisible">You must include a description.</div> <!-- a holder for validation notes --> 839 857 <xsl:choose> 840 858 <xsl:when test="normalize-space(form/desc/textarea) = ''"> 841 <textarea name="description" cols="60" rows="4" >859 <textarea name="description" cols="60" rows="4" id="bwEventDesc"> 842 860 <xsl:text> </xsl:text> 843 861 </textarea> … … 846 864 </xsl:when> 847 865 <xsl:otherwise> 848 <textarea name="description" cols="60" rows="4" >866 <textarea name="description" cols="60" rows="4" id="bwEventDescription"> 849 867 <xsl:value-of select="form/desc/textarea"/> 850 868 </textarea> … … 888 906 <!-- ============== --> 889 907 <div id="bwEventTab-Location" class="invisible"> 908 <div id="bwLocationUidNotice" class="invisible">You must either select a location or suggest one below.</div> 890 909 <div class="mainForm"> 891 910 <span id="eventFormLocationList"> 892 <select name="locationUid" class="bigSelect" >911 <select name="locationUid" class="bigSelect" id="bwLocationUid"> 893 912 <option value="">select an existing location...</option> 894 913 <xsl:copy-of select="form/location/locationmenu/select/*"/> … … 902 921 <p> 903 922 <label for="commentLocationAddress">Address: </label> 904 <input type="text" name="commentLocationAddress" />923 <input type="text" name="commentLocationAddress" id="bwCommentLocationAddress"/> 905 924 </p> 906 925 <p> … … 918 937 <!-- ============== --> 919 938 <div id="bwEventTab-Contact" class="invisible"> 939 <div id="bwContactUidNotice" class="invisible">You must either select a contact or suggest one below.</div> 920 940 <div class="mainForm"> 921 <select name=" allContactId" id="eventFormPrefContactList" class="bigSelect">941 <select name="contactUid" id="bwContactUid" class="bigSelect"> 922 942 <option value=""> 923 943 select an existing contact... … … 932 952 <p> 933 953 <label for="commentContactName">Organization Name: </label> 934 <input type="text" name="commentContactName" size="40"/>954 <input type="text" name="commentContactName" id="bwCommentContactName" size="40"/> 935 955 <span class="note"> Please limit contacts to organizations, not individuals.</span> 936 956 </p> trunk/deployment/websubmit/webapp/resources/demoskins/resources/bedework.js
r1580 r1665 218 218 } 219 219 } 220 // trim function 221 function trim(str) { 222 var trimmedStr = str.replace(/^\s+|\s+$/g, ''); 223 return trimmedStr.replace(/^(\ \;)+|(\ \;)+$/g, ''); 224 } 225 trunk/deployment/websubmit/webapp/resources/demoskins/resources/bedeworkEventForm.js
r1580 r1665 237 237 238 238 // ======================================================================== 239 // Form Manipulation Functions 239 240 // ======================================================================== 240 241 241 242 function setEventFields(formObj) { 242 243 setDates(formObj); 244 setComment(formObj); 243 245 setRecurrence(formObj); 244 246 setAccessHow(formObj,1); … … 257 259 formObj["eventEndDate.month"].value = endDate.getMonth() + 1; 258 260 formObj["eventEndDate.day"].value = endDate.getDate(); 261 } 262 function setComment(formObj) { 263 // set the submission comments (location, contact, and category suggestions) 264 // in xml format for easier post processing. 265 // add and remove values as the application grows. 266 var comment = "<location>" 267 if (formObj["commentLocationAddress"].value != "") { 268 comment += "<address>" + formObj["commentLocationAddress"].value + "</address>"; 269 } 270 if (formObj["commentLocationSubaddress"].value != "") { 271 comment += "<subaddress>" + formObj["commentLocationSubaddress"].value + "</subaddress>"; 272 } 273 if (formObj["commentLocationURL"].value != "") { 274 comment += "<url>" + formObj["commentLocationURL"].value + "</url>"; 275 } 276 if (formObj["commentLocationSubaddress"].value != "") { 277 comment += "<subaddress>" + formObj["commentLocationSubaddress"].value + "</subaddress>"; 278 } 279 comment += "</location>"; 280 comment += "<contact>"; 281 if (formObj["commentContactName"].value != "") { 282 comment += "<name>" + formObj["commentContactName"].value + "</name>"; 283 } 284 if (formObj["commentContactPhone"].value != "") { 285 comment += "<phone>" + formObj["commentContactPhone"].value + "</phone>"; 286 } 287 if (formObj["commentContactURL"].value != "") { 288 comment += "<url>" + formObj["commentContactURL"].value + "</url>"; 289 } 290 if (formObj["commentContactEmail"].value != "") { 291 comment += "<email>" + formObj["commentContactEmail"].value + "</email>"; 292 } 293 comment += "</contact>"; 294 if (formObj["commentCategory"].value != "") { 295 comment += "<category>" + formObj["commentCategory"].value + "</category>"; 296 } 297 formObj["comment"].value = comment; 259 298 } 260 299 function swapAllDayEvent(obj) { … … 584 623 } 585 624 625 // ======================================================= 626 // Event submit validation by page 627 // ======================================================= 628 function validateStep1() { 629 var validity = true; 630 if (trim(document.getElementById("bwEventTitle").value) == '') { 631 changeClass("bwEventTitle","highlight"); 632 changeClass("bwEventTitleNotice","notice"); 633 validity = false; 634 } else { 635 changeClass("bwEventTitle","none"); 636 changeClass("bwEventTitleNotice","invisible"); 637 } 638 if (trim(document.getElementById("bwEventDesc").value) == '') { 639 changeClass("bwEventDesc","highlight"); 640 changeClass("bwEventDescNotice","notice"); 641 validity = false; 642 } else { 643 changeClass("bwEventDesc","none"); 644 changeClass("bwEventDescNotice","invisible"); 645 } 646 document.getElementById("bwEventComment").value = "<comment>test</comment>"; 647 return validity; 648 } 649 650 function validateStep2() { 651 var validity = true; 652 if (document.getElementById("bwLocationUid").value == '' && 653 document.getElementById("bwCommentLocationAddress").value == '') { 654 changeClass("bwLocationUid","highlight bigSelect"); 655 changeClass("bwCommentLocationAddress","highlight"); 656 changeClass("bwLocationUidNotice","notice"); 657 validity = false; 658 } else { 659 changeClass("bwLocationUid","bigSelect"); 660 changeClass("bwCommentLocationAddress","none"); 661 changeClass("bwLocationUidNotice","invisible"); 662 } 663 return validity; 664 } 665 function validateStep3() { 666 var validity = true; 667 if (document.getElementById("bwContactUid").value == '' && 668 document.getElementById("bwCommentContactName").value == '') { 669 changeClass("bwContactUid","highlight bigSelect"); 670 changeClass("bwCommentContactName","highlight"); 671 changeClass("bwContactUidNotice","notice"); 672 validity = false; 673 } else { 674 changeClass("bwContactUid","bigSelect"); 675 changeClass("bwCommentContactName","none"); 676 changeClass("bwContactUidNotice","invisible"); 677 } 678 return validity; 679 } 680 681 // ======================================================= 682 // Dojo initialization 683 // ======================================================= 684 586 685 function init() { 587 686 var untilHolder = dojo.byId("untilHolder");
