| | 4431 | <xsl:template name="selectCalForPublicAlias"> |
|---|
| | 4432 | <!-- selectCalForPublicAlias creates a calendar tree in a pop-up window. |
|---|
| | 4433 | Used when selecting a public calendar subscription (alias). --> |
|---|
| | 4434 | |
|---|
| | 4435 | <input type="button" onclick="javascript:changeClass('calSelectWidget','visible')" value="select calendar" class="small"/> |
|---|
| | 4436 | <div id="calSelectWidget" class="invisible"> |
|---|
| | 4437 | <h2>select a calendar</h2> |
|---|
| | 4438 | <a href="javascript:changeClass('calSelectWidget','invisible')" id="calSelectWidgetCloser" title="close">x</a> |
|---|
| | 4439 | <ul class="calendarTree"> |
|---|
| | 4440 | <xsl:apply-templates select="/bedework/calendars/calendar/calendar[canAlias='true']" mode="selectCalForPublicAliasCalTree"/> |
|---|
| | 4441 | </ul> |
|---|
| | 4442 | <!-- Uncomment the following to use a three column format |
|---|
| | 4443 | <xsl:variable name="topCalsCount" select="count(/bedework/calendars/calendar/calendar)"/> |
|---|
| | 4444 | <xsl:variable name="topCalsDivThree" select="floor($topCalsCount div 3)"/> |
|---|
| | 4445 | <xsl:variable name="topCalsTopSet" select="number($topCalsCount - $topCalsDivThree)"/> |
|---|
| | 4446 | <ul class="calendarTree left"> |
|---|
| | 4447 | <xsl:apply-templates select="/bedework/calendars/calendar/calendar[canAlias='true' and (position() <= $topCalsDivThree)]" mode="selectCalForPublicAliasCalTree"/> |
|---|
| | 4448 | </ul> |
|---|
| | 4449 | <ul class="calendarTree left"> |
|---|
| | 4450 | <xsl:apply-templates select="/bedework/calendars/calendar/calendar[canAlias='true' and (position() > $topCalsDivThree) and (position() <= $topCalsTopSet)]" mode="selectCalForPublicAliasCalTree"/> |
|---|
| | 4451 | </ul> |
|---|
| | 4452 | <ul class="calendarTree left"> |
|---|
| | 4453 | <xsl:apply-templates select="/bedework/calendars/calendar/calendar[canAlias='true' and (position() > $topCalsTopSet)]" mode="selectCalForPublicAliasCalTree"/> |
|---|
| | 4454 | </ul> |
|---|
| | 4455 | --> |
|---|
| | 4456 | </div> |
|---|
| | 4457 | </xsl:template> |
|---|
| | 4458 | |
|---|
| | 4459 | <xsl:template match="calendar" mode="selectCalForPublicAliasCalTree"> |
|---|
| | 4460 | <xsl:variable name="id" select="id"/> |
|---|
| | 4461 | <li> |
|---|
| | 4462 | <xsl:attribute name="class"> |
|---|
| | 4463 | <xsl:choose> |
|---|
| | 4464 | <xsl:when test="/bedework/selectionState/selectionType = 'calendar' |
|---|
| | 4465 | and name = /bedework/selectionState/subscriptions/subscription/calendar/name">selected</xsl:when> |
|---|
| | 4466 | <xsl:when test="name='Trash'">trash</xsl:when> |
|---|
| | 4467 | <xsl:when test="calendarCollection='false'">folder</xsl:when> |
|---|
| | 4468 | <xsl:otherwise>calendar</xsl:otherwise> |
|---|
| | 4469 | </xsl:choose> |
|---|
| | 4470 | </xsl:attribute> |
|---|
| | 4471 | <xsl:variable name="calPath" select="path"/> |
|---|
| | 4472 | <xsl:variable name="calDisplay" select="path"/> |
|---|
| | 4473 | <xsl:variable name="calendarCollection" select="calendarCollection"/> |
|---|
| | 4474 | <a href="javascript:updateEventFormCalendar('{$calPath}','{$calDisplay}','{$calendarCollection}')"> |
|---|
| | 4475 | <strong><xsl:value-of select="name"/></strong> |
|---|
| | 4476 | </a> |
|---|
| | 4477 | <xsl:if test="calendar"> |
|---|
| | 4478 | <ul> |
|---|
| | 4479 | <xsl:apply-templates select="calendar" mode="selectCalForPublicAliasCalTree"/> |
|---|
| | 4480 | </ul> |
|---|
| | 4481 | </xsl:if> |
|---|
| | 4482 | </li> |
|---|
| | 4483 | </xsl:template> |
|---|
| | 4484 | |
|---|
| 4868 | | <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable> |
|---|
| 4869 | | <xsl:for-each select="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]"> |
|---|
| 4870 | | <xsl:choose> |
|---|
| 4871 | | <xsl:when test="calendarDeleted='true'"> |
|---|
| 4872 | | <li class="deleted"> |
|---|
| 4873 | | <xsl:value-of select="name"/><br/> |
|---|
| 4874 | | <em>calendar not available</em> |
|---|
| 4875 | | </li> |
|---|
| 4876 | | </xsl:when> |
|---|
| 4877 | | <xsl:when test="count(calendars//calendar[calendarCollection='true']) = 1"> |
|---|
| 4878 | | <xsl:for-each select="calendars//calendar[calendarCollection='true']"> |
|---|
| 4879 | | <li class="calendar"> |
|---|
| 4880 | | <xsl:variable name="calPath" select="path"/> |
|---|
| 4881 | | <xsl:variable name="name" select="name"/> |
|---|
| 4882 | | <a href="javascript:exportCalendar('exportCalendarForm','{$name}','{$calPath}')"> |
|---|
| 4883 | | <xsl:value-of select="name"/> |
|---|
| 4884 | | </a> |
|---|
| 4885 | | </li> |
|---|
| 4886 | | </xsl:for-each> |
|---|
| 4887 | | </xsl:when> |
|---|
| 4888 | | <xsl:otherwise> |
|---|
| 4889 | | <li class="folder"> |
|---|
| 4890 | | <xsl:value-of select="name"/>: |
|---|
| 4891 | | <xsl:if test="calendars//calendar[calendarCollection='true']"> |
|---|
| 4892 | | <ul> |
|---|
| 4893 | | <xsl:for-each select="calendars//calendar[calendarCollection='true']"> |
|---|
| 4894 | | <li class="calendar"> |
|---|
| 4895 | | <xsl:variable name="calPath" select="path"/> |
|---|
| 4896 | | <xsl:variable name="name" select="name"/> |
|---|
| 4897 | | <a href="javascript:exportCalendar('exportCalendarForm','{$name}','{$calPath}')"> |
|---|
| 4898 | | <xsl:value-of select="name"/> |
|---|
| 4899 | | </a> |
|---|
| 4900 | | </li> |
|---|
| 4901 | | </xsl:for-each> |
|---|
| 4902 | | </ul> |
|---|
| 4903 | | </xsl:if> |
|---|
| 4904 | | </li> |
|---|
| 4905 | | </xsl:otherwise> |
|---|
| 4906 | | </xsl:choose> |
|---|
| 4907 | | </xsl:for-each> |
|---|
| 4908 | | </ul> |
|---|
| 4909 | | </td> |
|---|
| 4910 | | <td> |
|---|
| 4911 | | <ul class="calendarTree"> |
|---|
| 4912 | | <xsl:for-each select=".//calendar[calendarCollection='true']"> |
|---|
| 4913 | | <li class="calendar"> |
|---|
| 4914 | | <xsl:variable name="calPath" select="path"/> |
|---|
| 4915 | | <xsl:variable name="name" select="name"/> |
|---|
| 4916 | | <a href="javascript:exportCalendar('exportCalendarForm','{$name}','{$calPath}')"> |
|---|
| 4917 | | <xsl:value-of select="name"/> |
|---|
| 4918 | | </a> |
|---|
| 4919 | | </li> |
|---|
| 4920 | | </xsl:for-each> |
|---|
| | 4923 | <xsl:apply-templates select="./calendar" mode="buildExportTree"/> |
|---|
| 4953 | | <table id="subsTable"> |
|---|
| 4954 | | <tr> |
|---|
| 4955 | | <td class="cals"> |
|---|
| 4956 | | <h3>Public calendars</h3> |
|---|
| 4957 | | <ul class="calendarTree"> |
|---|
| 4958 | | <xsl:apply-templates select="/bedework/subscriptions/subscribe/calendars/calendar[canAlias='true']" mode="subscribe"/> |
|---|
| 4959 | | </ul> |
|---|
| 4960 | | </td> |
|---|
| 4961 | | <td class="subs"> |
|---|
| 4962 | | <h3>Add a public subscription</h3> |
|---|
| 4963 | | <p> |
|---|
| 4964 | | Select a calendar to the left to add a new internal public subscription. |
|---|
| 4965 | | </p> |
|---|
| 4966 | | <h3>Add a public subscription</h3> |
|---|
| 4967 | | <p class="note">*the subsciption name must be unique</p> |
|---|
| 4968 | | <form name="subscribeForm" action="{$calendar-update}" onsubmit="return setSubscriptionUri(this,'bwcal://')" method="post"> |
|---|
| 4969 | | <input type="hidden" value="" name="aliasUri"/> |
|---|
| 4970 | | <table class="common" cellspacing="0"> |
|---|
| 4971 | | <tr> |
|---|
| 4972 | | <td class="fieldname">Name:</td> |
|---|
| 4973 | | <td> |
|---|
| 4974 | | <xsl:variable name="subName" select="name"/> |
|---|
| 4975 | | <input type="text" value="{$subName}" name="calendar.name" size="60"/> |
|---|
| 4976 | | </td> |
|---|
| 4977 | | </tr> |
|---|
| 4978 | | <!--<xsl:if test="internal='false'"> |
|---|
| 4979 | | <tr> |
|---|
| 4980 | | <td class="fieldname">Uri:</td> |
|---|
| 4981 | | <td> |
|---|
| 4982 | | <xsl:variable name="calPath" select="uri"/> |
|---|
| 4983 | | <input type="text" value="{$calPath}" name="aliasUri" size="60"/> |
|---|
| 4984 | | </td> |
|---|
| 4985 | | </tr> |
|---|
| 4986 | | </xsl:if> |
|---|
| 4987 | | <tr> |
|---|
| 4988 | | <td class="fieldname">Display:</td> |
|---|
| 4989 | | <td> |
|---|
| 4990 | | <input type="radio" value="true" name="subscription.display" checked="checked"/> yes |
|---|
| 4991 | | <input type="radio" value="false" name="subscription.display"/> no |
|---|
| 4992 | | </td> |
|---|
| 4993 | | </tr>--> |
|---|
| 4994 | | <tr> |
|---|
| 4995 | | <td class="fieldname">Affects Free/Busy:</td> |
|---|
| 4996 | | <td> |
|---|
| 4997 | | <input type="radio" value="true" name="subscription.affectsFreeBusy"/> yes |
|---|
| 4998 | | <input type="radio" value="false" name="subscription.affectsFreeBusy" checked="checked"/> no |
|---|
| 4999 | | </td> |
|---|
| 5000 | | </tr> |
|---|
| 5001 | | <tr> |
|---|
| 5002 | | <td class="fieldname">Style:</td> |
|---|
| 5003 | | <td> |
|---|
| 5004 | | <select name="subscription.style"> |
|---|
| 5005 | | <option value="default">default</option> |
|---|
| 5006 | | <xsl:for-each select="document('subColors.xml')/subscriptionColors/color"> |
|---|
| 5007 | | <xsl:variable name="subColor" select="."/> |
|---|
| 5008 | | <option value="{$subColor}" class="{$subColor}"> |
|---|
| 5009 | | <xsl:value-of select="@name"/> |
|---|
| 5010 | | </option> |
|---|
| 5011 | | </xsl:for-each> |
|---|
| 5012 | | </select> |
|---|
| 5013 | | </td> |
|---|
| 5014 | | </tr> |
|---|
| 5015 | | <!--<tr> |
|---|
| 5016 | | <td class="fieldname">Unremovable:</td> |
|---|
| 5017 | | <td> |
|---|
| 5018 | | <input type="radio" value="true" name="subscription.unremoveable" size="60"/> true |
|---|
| 5019 | | <input type="radio" value="false" name="subscription.unremoveable" size="60" checked="checked"/> false |
|---|
| 5020 | | </td> |
|---|
| 5021 | | </tr>--> |
|---|
| 5022 | | </table> |
|---|
| 5023 | | <table border="0" id="submitTable"> |
|---|
| 5024 | | <tr> |
|---|
| 5025 | | <td> |
|---|
| 5026 | | <input type="submit" name="addSubscription" value="Add Subscription"/> |
|---|
| 5027 | | <input type="submit" name="cancelled" value="cancel"/> |
|---|
| 5028 | | </td> |
|---|
| 5029 | | </tr> |
|---|
| 5030 | | </table> |
|---|
| 5031 | | </form> |
|---|
| 5032 | | </td> |
|---|
| 5033 | | </tr> |
|---|
| 5034 | | </table> |
|---|
| | 4986 | <div id="content"> |
|---|
| | 4987 | <h3>Add a public subscription</h3> |
|---|
| | 4988 | <p class="note">*the subsciption name must be unique</p> |
|---|
| | 4989 | <form name="subscribeForm" action="{$calendar-update}" onsubmit="return setSubscriptionUri(this,'bwcal://')" method="post"> |
|---|
| | 4990 | <table class="common" cellspacing="0"> |
|---|
| | 4991 | <tr> |
|---|
| | 4992 | <td class="fieldname">Calendar:</td> |
|---|
| | 4993 | <td> |
|---|
| | 4994 | <input type="hidden" value="" name="aliasUri" size="60" id="bwNewCalPathField"/> |
|---|
| | 4995 | <input type="hidden" value="" name="calendarCollection" id="bwCalCollectionField"/> |
|---|
| | 4996 | <span id="bwEventCalDisplay"> |
|---|
| | 4997 | <xsl:text> </xsl:text> |
|---|
| | 4998 | </span> |
|---|
| | 4999 | <xsl:call-template name="selectCalForPublicAlias"/> |
|---|
| | 5000 | </td> |
|---|
| | 5001 | </tr> |
|---|
| | 5002 | <tr> |
|---|
| | 5003 | <td class="fieldname">Name:</td> |
|---|
| | 5004 | <td> |
|---|
| | 5005 | <xsl:variable name="subName" select="name"/> |
|---|
| | 5006 | <input type="text" value="{$subName}" name="calendar.name" size="30"/> |
|---|
| | 5007 | </td> |
|---|
| | 5008 | </tr> |
|---|
| | 5009 | <!--<tr> |
|---|
| | 5010 | <td class="fieldname">Display:</td> |
|---|
| | 5011 | <td> |
|---|
| | 5012 | <input type="radio" value="true" name="subscription.display" checked="checked"/> yes |
|---|
| | 5013 | <input type="radio" value="false" name="subscription.display"/> no |
|---|
| | 5014 | </td> |
|---|
| | 5015 | </tr>--> |
|---|
| | 5016 | <tr> |
|---|
| | 5017 | <td class="fieldname">Affects Free/Busy:</td> |
|---|
| | 5018 | <td> |
|---|
| | 5019 | <input type="radio" value="true" name="subscription.affectsFreeBusy"/> yes |
|---|
| | 5020 | <input type="radio" value="false" name="subscription.affectsFreeBusy" checked="checked"/> no |
|---|
| | 5021 | </td> |
|---|
| | 5022 | </tr> |
|---|
| | 5023 | <tr> |
|---|
| | 5024 | <td class="fieldname">Style:</td> |
|---|
| | 5025 | <td> |
|---|
| | 5026 | <select name="calendar.color"> |
|---|
| | 5027 | <option value="">default</option> |
|---|
| | 5028 | <xsl:for-each select="document('subColors.xml')/subscriptionColors/color"> |
|---|
| | 5029 | <xsl:variable name="subColor" select="@rgb"/> |
|---|
| | 5030 | <xsl:variable name="subColorClass" select="."/> |
|---|
| | 5031 | <option value="{$subColor}" class="{$subColorClass}"> |
|---|
| | 5032 | <xsl:value-of select="@name"/> |
|---|
| | 5033 | </option> |
|---|
| | 5034 | </xsl:for-each> |
|---|
| | 5035 | </select> |
|---|
| | 5036 | </td> |
|---|
| | 5037 | </tr> |
|---|
| | 5038 | <!--<tr> |
|---|
| | 5039 | <td class="fieldname">Unremovable:</td> |
|---|
| | 5040 | <td> |
|---|
| | 5041 | <input type="radio" value="true" name="subscription.unremoveable" size="60"/> true |
|---|
| | 5042 | <input type="radio" value="false" name="subscription.unremoveable" size="60" checked="checked"/> false |
|---|
| | 5043 | </td> |
|---|
| | 5044 | </tr>--> |
|---|
| | 5045 | </table> |
|---|
| | 5046 | <table border="0" id="submitTable"> |
|---|
| | 5047 | <tr> |
|---|
| | 5048 | <td> |
|---|
| | 5049 | <input type="submit" name="addSubscription" value="Add Subscription"/> |
|---|
| | 5050 | <input type="submit" name="cancelled" value="cancel"/> |
|---|
| | 5051 | </td> |
|---|
| | 5052 | </tr> |
|---|
| | 5053 | </table> |
|---|
| | 5054 | </form> |
|---|
| | 5055 | </div> |
|---|