| | 1787 | <!--+++++++++++++++ Subscriptions ++++++++++++++++++++--> |
|---|
| | 1788 | <xsl:template match="subscriptions"> |
|---|
| | 1789 | <table id="subsTable"> |
|---|
| | 1790 | <tr> |
|---|
| | 1791 | <td class="cals"> |
|---|
| | 1792 | <h3>Public calendars</h3> |
|---|
| | 1793 | <p class="smaller"> |
|---|
| | 1794 | Select a calendar below to add a <em><strong>new</strong></em> |
|---|
| | 1795 | internal subscription. <!-- or |
|---|
| | 1796 | <a href="{$subscriptions-initAdd}&calUri=please enter a calendar uri"> |
|---|
| | 1797 | subscribe to an external calendar</a>.--> |
|---|
| | 1798 | </p> |
|---|
| | 1799 | <ul id="calendarTree"> |
|---|
| | 1800 | <xsl:apply-templates select="/bedeworkadmin/subscriptions/subscribe/calendars/calendar" mode="subscribe"/> |
|---|
| | 1801 | </ul> |
|---|
| | 1802 | </td> |
|---|
| | 1803 | <td class="subs"> |
|---|
| | 1804 | <xsl:choose> |
|---|
| | 1805 | <xsl:when test="/bedeworkadmin/page='subscriptions'"> |
|---|
| | 1806 | <xsl:call-template name="subscriptionList"/> |
|---|
| | 1807 | </xsl:when> |
|---|
| | 1808 | <xsl:when test="/bedeworkadmin/creating='true'"> |
|---|
| | 1809 | <xsl:apply-templates select="subscription" mode="addSubscription"/> |
|---|
| | 1810 | </xsl:when> |
|---|
| | 1811 | <xsl:otherwise> |
|---|
| | 1812 | <xsl:apply-templates select="subscription" mode="modSubscription"/> |
|---|
| | 1813 | </xsl:otherwise> |
|---|
| | 1814 | </xsl:choose> |
|---|
| | 1815 | </td> |
|---|
| | 1816 | </tr> |
|---|
| | 1817 | </table> |
|---|
| | 1818 | </xsl:template> |
|---|
| | 1819 | |
|---|
| | 1820 | <xsl:template match="calendar" mode="subscribe"> |
|---|
| | 1821 | <xsl:variable name="id" select="id"/> |
|---|
| | 1822 | <xsl:variable name="itemClass"> |
|---|
| | 1823 | <xsl:choose> |
|---|
| | 1824 | <xsl:when test="calendarCollection='false'">folder</xsl:when> |
|---|
| | 1825 | <xsl:otherwise>calendar</xsl:otherwise> |
|---|
| | 1826 | </xsl:choose> |
|---|
| | 1827 | </xsl:variable> |
|---|
| | 1828 | <li class="{$itemClass}"> |
|---|
| | 1829 | <a href="{$subscriptions-initAdd}&calId={$id}"> |
|---|
| | 1830 | <xsl:value-of select="name"/> |
|---|
| | 1831 | </a> |
|---|
| | 1832 | <xsl:if test="calendar"> |
|---|
| | 1833 | <ul> |
|---|
| | 1834 | <xsl:apply-templates select="calendar" mode="subscribe"> |
|---|
| | 1835 | <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>--> |
|---|
| | 1836 | </xsl:apply-templates> |
|---|
| | 1837 | </ul> |
|---|
| | 1838 | </xsl:if> |
|---|
| | 1839 | </li> |
|---|
| | 1840 | </xsl:template> |
|---|
| | 1841 | |
|---|
| | 1842 | <xsl:template match="subscription" mode="addSubscription"> |
|---|
| | 1843 | <h2>Add New Subscription</h2> |
|---|
| | 1844 | <p class="note">*the subsciption name must be unique</p> |
|---|
| | 1845 | <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post"> |
|---|
| | 1846 | <table class="eventFormTable"> |
|---|
| | 1847 | <tr> |
|---|
| | 1848 | <th>Name*:</th> |
|---|
| | 1849 | <td> |
|---|
| | 1850 | <xsl:variable name="subName" select="name"/> |
|---|
| | 1851 | <input type="text" value="{$subName}" name="subscription.name" size="60"/> |
|---|
| | 1852 | </td> |
|---|
| | 1853 | </tr> |
|---|
| | 1854 | <xsl:if test="internal='false'"> |
|---|
| | 1855 | <tr> |
|---|
| | 1856 | <th>Uri:</th> |
|---|
| | 1857 | <td> |
|---|
| | 1858 | <xsl:variable name="subUri" select="uri"/> |
|---|
| | 1859 | <input type="text" value="{$subUri}" name="subscription.uri" size="60"/> |
|---|
| | 1860 | </td> |
|---|
| | 1861 | </tr> |
|---|
| | 1862 | </xsl:if> |
|---|
| | 1863 | <tr> |
|---|
| | 1864 | <th>Display:</th> |
|---|
| | 1865 | <td> |
|---|
| | 1866 | <input type="radio" value="true" name="subscription.display"/> yes |
|---|
| | 1867 | <input type="radio" value="false" name="subscription.display" checked="checked"/> no |
|---|
| | 1868 | </td> |
|---|
| | 1869 | </tr> |
|---|
| | 1870 | <tr> |
|---|
| | 1871 | <th>Style:</th> |
|---|
| | 1872 | <td> |
|---|
| | 1873 | <xsl:variable name="subStyle" select="style"/> |
|---|
| | 1874 | <input type="text" value="{$subStyle}" name="subscription.style" size="60"/> |
|---|
| | 1875 | </td> |
|---|
| | 1876 | </tr> |
|---|
| | 1877 | <tr> |
|---|
| | 1878 | <th>Unremovable:</th> |
|---|
| | 1879 | <td> |
|---|
| | 1880 | <input type="radio" value="true" name="unremoveable" size="60"/> true |
|---|
| | 1881 | <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false |
|---|
| | 1882 | </td> |
|---|
| | 1883 | </tr> |
|---|
| | 1884 | </table> |
|---|
| | 1885 | <table border="0" id="submitTable"> |
|---|
| | 1886 | <tr> |
|---|
| | 1887 | <td> |
|---|
| | 1888 | <input type="submit" name="addSubscription" value="Add Subscription"/> |
|---|
| | 1889 | <input type="submit" name="cancelled" value="Cancel"/> |
|---|
| | 1890 | <input type="reset" value="Clear"/> |
|---|
| | 1891 | </td> |
|---|
| | 1892 | </tr> |
|---|
| | 1893 | </table> |
|---|
| | 1894 | </form> |
|---|
| | 1895 | </xsl:template> |
|---|
| | 1896 | |
|---|
| | 1897 | <xsl:template match="subscription" mode="modSubscription"> |
|---|
| | 1898 | <h2>Modify Subscription</h2> |
|---|
| | 1899 | <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post"> |
|---|
| | 1900 | <table class="eventFormTable"> |
|---|
| | 1901 | <tr> |
|---|
| | 1902 | <th>Name*:</th> |
|---|
| | 1903 | <td> |
|---|
| | 1904 | <xsl:value-of select="name"/> |
|---|
| | 1905 | <xsl:variable name="subName" select="name"/> |
|---|
| | 1906 | <input type="hidden" value="{$subName}" name="name"/> |
|---|
| | 1907 | </td> |
|---|
| | 1908 | </tr> |
|---|
| | 1909 | <xsl:choose> |
|---|
| | 1910 | <xsl:when test="internal='false'"> |
|---|
| | 1911 | <tr> |
|---|
| | 1912 | <th>Uri:</th> |
|---|
| | 1913 | <td> |
|---|
| | 1914 | <xsl:variable name="subUri" select="uri"/> |
|---|
| | 1915 | <input type="text" value="{$subUri}" name="subscription.uri" size="60"/> |
|---|
| | 1916 | </td> |
|---|
| | 1917 | </tr> |
|---|
| | 1918 | </xsl:when> |
|---|
| | 1919 | <xsl:otherwise> |
|---|
| | 1920 | <tr> |
|---|
| | 1921 | <th>Uri:</th> |
|---|
| | 1922 | <td> |
|---|
| | 1923 | <xsl:value-of select="uri"/> |
|---|
| | 1924 | </td> |
|---|
| | 1925 | </tr> |
|---|
| | 1926 | </xsl:otherwise> |
|---|
| | 1927 | </xsl:choose> |
|---|
| | 1928 | <tr> |
|---|
| | 1929 | <th>Display:</th> |
|---|
| | 1930 | <td> |
|---|
| | 1931 | <xsl:choose> |
|---|
| | 1932 | <xsl:when test="display='true'"> |
|---|
| | 1933 | <input type="radio" value="true" name="subscription.display" checked="checked"/> yes |
|---|
| | 1934 | <input type="radio" value="false" name="subscription.display"/> no |
|---|
| | 1935 | </xsl:when> |
|---|
| | 1936 | <xsl:otherwise> |
|---|
| | 1937 | <input type="radio" value="true" name="subscription.display"/> yes |
|---|
| | 1938 | <input type="radio" value="false" name="subscription.display" checked="checked"/> no |
|---|
| | 1939 | </xsl:otherwise> |
|---|
| | 1940 | </xsl:choose> |
|---|
| | 1941 | </td> |
|---|
| | 1942 | </tr> |
|---|
| | 1943 | <tr> |
|---|
| | 1944 | <th>Style:</th> |
|---|
| | 1945 | <td> |
|---|
| | 1946 | <xsl:variable name="subStyle" select="style"/> |
|---|
| | 1947 | <input type="text" value="{$subStyle}" name="subscription.style" size="60"/> |
|---|
| | 1948 | </td> |
|---|
| | 1949 | </tr> |
|---|
| | 1950 | <tr> |
|---|
| | 1951 | <th>Unremovable:</th> |
|---|
| | 1952 | <td> |
|---|
| | 1953 | <xsl:choose> |
|---|
| | 1954 | <xsl:when test="unremoveable='true'"> |
|---|
| | 1955 | <input type="radio" value="true" name="unremoveable" size="60" checked="checked"/> true |
|---|
| | 1956 | <input type="radio" value="false" name="unremoveable" size="60"/> false |
|---|
| | 1957 | </xsl:when> |
|---|
| | 1958 | <xsl:otherwise> |
|---|
| | 1959 | <input type="radio" value="true" name="unremoveable" size="60"/> true |
|---|
| | 1960 | <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false |
|---|
| | 1961 | </xsl:otherwise> |
|---|
| | 1962 | </xsl:choose> |
|---|
| | 1963 | </td> |
|---|
| | 1964 | </tr> |
|---|
| | 1965 | </table> |
|---|
| | 1966 | <table border="0" id="submitTable"> |
|---|
| | 1967 | <tr> |
|---|
| | 1968 | <td> |
|---|
| | 1969 | <input type="submit" name="updateSubscription" value="Update Subscription"/> |
|---|
| | 1970 | <input type="submit" name="cancelled" value="Cancel"/> |
|---|
| | 1971 | <input type="reset" value="Reset"/> |
|---|
| | 1972 | </td> |
|---|
| | 1973 | <td align="right"> |
|---|
| | 1974 | <input type="submit" name="delete" value="Delete Subscription"/> |
|---|
| | 1975 | </td> |
|---|
| | 1976 | </tr> |
|---|
| | 1977 | </table> |
|---|
| | 1978 | </form> |
|---|
| | 1979 | </xsl:template> |
|---|
| | 1980 | |
|---|
| | 1981 | <xsl:template name="subscriptionList"> |
|---|
| | 1982 | <h3>Current subscriptions</h3> |
|---|
| | 1983 | <table id="commonListTable"> |
|---|
| | 1984 | <tr> |
|---|
| | 1985 | <th>Name</th> |
|---|
| | 1986 | <th>URI</th> |
|---|
| | 1987 | <th>Style</th> |
|---|
| | 1988 | <th>Display</th> |
|---|
| | 1989 | <th>Unremovable</th> |
|---|
| | 1990 | <th>External</th> |
|---|
| | 1991 | <th>Deleted?</th> |
|---|
| | 1992 | </tr> |
|---|
| | 1993 | <xsl:for-each select="subscription"> |
|---|
| | 1994 | <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>--> |
|---|
| | 1995 | <tr> |
|---|
| | 1996 | <td> |
|---|
| | 1997 | <xsl:variable name="subname" select="name"/> |
|---|
| | 1998 | <a href="{$subscriptions-fetchForUpdate}&subname={$subname}"> |
|---|
| | 1999 | <xsl:value-of select="name"/> |
|---|
| | 2000 | </a> |
|---|
| | 2001 | </td> |
|---|
| | 2002 | <td> |
|---|
| | 2003 | <xsl:value-of select="uri"/> |
|---|
| | 2004 | </td> |
|---|
| | 2005 | <td> |
|---|
| | 2006 | <xsl:value-of select="style"/> |
|---|
| | 2007 | </td> |
|---|
| | 2008 | <td class="center"> |
|---|
| | 2009 | <xsl:if test="display='true'"> |
|---|
| | 2010 | <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/> |
|---|
| | 2011 | </xsl:if> |
|---|
| | 2012 | </td> |
|---|
| | 2013 | <td class="center"> |
|---|
| | 2014 | <xsl:if test="unremoveable='true'"> |
|---|
| | 2015 | <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/> |
|---|
| | 2016 | </xsl:if> |
|---|
| | 2017 | </td> |
|---|
| | 2018 | <td class="center"> |
|---|
| | 2019 | <xsl:if test="internal='false'"> |
|---|
| | 2020 | <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/> |
|---|
| | 2021 | </xsl:if> |
|---|
| | 2022 | </td> |
|---|
| | 2023 | <td class="center"> |
|---|
| | 2024 | <xsl:if test="calendarDeleted='true'"> |
|---|
| | 2025 | <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/> |
|---|
| | 2026 | </xsl:if> |
|---|
| | 2027 | </td> |
|---|
| | 2028 | </tr> |
|---|
| | 2029 | </xsl:for-each> |
|---|
| | 2030 | </table> |
|---|
| | 2031 | <!--<h4><a href="{$subscriptions-initAdd}&calUri=please enter a calendar uri">Subscribe to a remote calendar</a> (by URI)</h4>--> |
|---|
| | 2032 | </xsl:template> |
|---|
| | 2033 | |
|---|