summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2005-08-19 18:04:25 +0000
committerMax Kremmel <xing@synapse.plus.com>2005-08-19 18:04:25 +0000
commitfb7b4b478fb6fb759fd3f6f0cd9163c135427b9a (patch)
tree5a69f17e3db382c192645f39da93302a7cecc8b7
parent642165a72b56758029d2695a6a13c4a29d69c504 (diff)
downloadcalendar-fb7b4b478fb6fb759fd3f6f0cd9163c135427b9a.tar.gz
calendar-fb7b4b478fb6fb759fd3f6f0cd9163c135427b9a.tar.bz2
calendar-fb7b4b478fb6fb759fd3f6f0cd9163c135427b9a.zip
a lot of bugfixes and further code cleanup - sort_mode still a bit dodgy, october 30th bug still needs fixing
-rw-r--r--Calendar.php109
-rw-r--r--index.php52
-rw-r--r--templates/calendar.tpl55
-rw-r--r--templates/calendar_options_inc.tpl5
4 files changed, 108 insertions, 113 deletions
diff --git a/Calendar.php b/Calendar.php
index 8a6cf8a..e24dcc9 100644
--- a/Calendar.php
+++ b/Calendar.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_calendar/Calendar.php,v 1.4 2005/08/19 11:46:31 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_calendar/Calendar.php,v 1.5 2005/08/19 18:04:24 squareing Exp $
* @package calendar
*/
@@ -36,39 +36,69 @@ class Calendar extends LibertyContent {
return $ret;
}
- function prepGetList( &$pListHash ) {
- if( !empty( $pListHash['focus_date'] ) ) {
- if( !empty( $pListHash['view_mode'] ) ) {
- $pListHash['view_mode'] = 'month';
- }
+ function doDateCalculations( $pDateHash ) {
+ $d = 60 * 60 * 24;
+ $currentweek = date( "W", $pDateHash['focus_date'] );
+ $wd = date( 'w', $pDateHash['focus_date'] );
- $year = date( 'Y', $pListHash['focus_date'] );
- $month = date( 'm', $pListHash['focus_date'] );
- $day = date( 'd', $pListHash['focus_date'] );
+ $year = date( 'Y', $pDateHash['focus_date'] );
+ $month = date( 'm', $pDateHash['focus_date'] );
+ $day = date( 'd', $pDateHash['focus_date'] );
- $day_secs = 60 * 60 * 24;
- $currentweek = date( "W", $pListHash['focus_date'] );
- $weekday = date( 'w', $pListHash['focus_date'] );
+ if( $pDateHash['view_mode'] == 'month' ) {
+ $viewstart = mktime( 0, 0, 0, $month, 1, $year );
+ // this is the last day of $month
+ $viewend = mktime( 0, 0, 0, $month + 1, 0, $year );
+ // move viewstart back to Sunday....
+ $viewstart -= date( "w", $viewstart ) * $d;
+ $viewend += ( 6 - date( "w", $viewend ) ) * $d -1;
- if( $pListHash['view_mode'] == 'day' ) {
- $firstweek = $currentweek;
- $lastweek = $currentweek;
- $viewstart = mktime( 0, 0, 0, $month, $day, $year);
- $viewend = $viewstart + ( $d - 1 );
- $weekdays = array( date( 'w',$focusdate ) );
- } elseif( $pListHash['view_mode'] == 'week' ) {
- // start by putting $viewstart at midnight starting focusdate
- $viewstart = mktime( 0, 0, 0, $month, $day, $year);
- // then back up to the preceding Sunday;
- $viewstart -= $wd * $day_secs;
- // then go to the end of the week for $viewend
- $viewend = $viewstart + ((7 * $d) - 1);
- } else {
- $viewstart = mktime( 0, 0, 0, $month , 1, $year);
- $viewend = mktime( 0, 0, 0, $month + 1, 0, $year);
+ // ISO weeks --- kinda mangled because ours begin on Sunday...
+ $firstweek = date( "W", $viewstart + $d );
+ $lastweek = date( "W", $viewend );
+ if( $lastweek < $firstweek ) {
+ if( $currentweek < $firstweek ) {
+ $firstweek -= 52;
+ } else {
+ $lastweek += 52;
+ }
}
- $pListHash['start'] = $viewstart;
- $pListHash['stop'] = $viewend;
+ $numberofweeks = $lastweek - $firstweek;
+ } elseif( $pDateHash['view_mode'] == 'week') {
+ $firstweek = $currentweek;
+ $lastweek = $currentweek;
+ // start by putting $viewstart at midnight starting focusdate
+ $viewstart = mktime( 0, 0, 0, $month, $day, $year);
+ // then back up to the preceding Sunday;
+ $viewstart -= $wd * $d;
+ // then go to the end of the week for $viewend
+ $viewend = $viewstart + ( ( 7 * $d ) - 1 );
+ $numberofweeks = 0;
+ } else {
+ $firstweek = $currentweek;
+ $lastweek = $currentweek;
+ $viewstart = mktime( 0, 0, 0, $month, $day, $year);
+ $viewend = $viewstart + ( $d - 1 );
+ $weekdays = array( date( 'w', $pDateHash['focus_date'] ) );
+ $numberofweeks = 0;
+ }
+
+ $ret = array(
+ 'first_week' => $firstweek,
+ 'last_week' => $lastweek,
+ 'view_start' => $viewstart,
+ 'view_end' => $viewend,
+ 'number_of_weeks' => $numberofweeks,
+ );
+
+ return $ret;
+ }
+
+ function prepGetList( &$pListHash ) {
+ if( !empty( $pListHash['focus_date'] ) ) {
+ $calDates = $this->doDateCalculations( $pListHash );
+ $pListHash['start'] = $calDates['view_start'];
+ $pListHash['stop'] = $calDates['view_end'];
}
if( !empty( $pListHash['sort_mode'] ) ) {
@@ -78,6 +108,7 @@ class Calendar extends LibertyContent {
return TRUE;
}
+/* testing stuff - xing
function getCalendarList( $pListHash ) {
$calendarHash = $this->buildCalendar( $pListHash['focus_date'] );
@@ -85,15 +116,15 @@ class Calendar extends LibertyContent {
if( !empty( $pListHash['content_type_guid'] ) ) {
$year = date( 'Y', $pListHash['focus_date'] );
$month = date( 'm', $pListHash['focus_date'] );
- $day = date( 'd', $pListHash['focus_date'] );
+ $day = date( 'd', $pListHash['focus_date'] );
- $day_secs = 60 * 60 * 24;
+ $day_secs = 60 * 60 * 24;
$currentweek = date( "W", $pListHash['focus_date'] );
- $weekday = date( 'w', $pListHash['focus_date'] );
+ $weekday = date( 'w', $pListHash['focus_date'] );
if( $pListHash['calendar_view_mode'] == 'month' ) {
- $viewstart = mktime( 0, 0, 0, $month , 1, $year);
- $viewend = mktime( 0, 0, 0, $month + 1, 0, $year);
+ $viewstart = mktime( 0, 0, 0, $month , 1, $year);
+ $viewend = mktime( 0, 0, 0, $month + 1, 0, $year);
} elseif( $pListHash['calendar_view_mode'] == 'week' ) {
// start by putting $viewstart at midnight starting focusdate
$viewstart = mktime( 0, 0, 0, $month, $day, $year);
@@ -132,9 +163,9 @@ class Calendar extends LibertyContent {
$year = date( 'Y', $pTimeStamp );
$month = date( 'm', $pTimeStamp );
- $day = date( 'd', $pTimeStamp );
+ $day = date( 'd', $pTimeStamp );
- $prev_month_end = mktime( 0, 0, 0, $month , 0, $year );
+ $prev_month_end = mktime( 0, 0, 0, $month , 0, $year );
$next_month_begin = mktime( 0, 0, 0, $month + 1, 1, $year );
//$prev_month_end = mktime( 0, 0, 0, $month - 1, $day, $year );
@@ -236,12 +267,13 @@ class Calendar extends LibertyContent {
assert( FALSE );
}
}
+*/
/**
* @param int $pDayOfWeek Sunday is 0, Monday is 1, etc.
* @return string
*/
- function dayOfWeek( $pDayOfWeek ) {
+/* function dayOfWeek( $pDayOfWeek ) {
// January 2, 2000 is an arbitrary Sunday that serves as the basis for
// using strftime() to get the localized name (or abbreviation) of the
// specified day of week.
@@ -268,6 +300,7 @@ class Calendar extends LibertyContent {
$days = $monthdays[$m] - $weekdays[$wn];
return( ceil( $days/7 )+1 );
}
+*/
}
?>
diff --git a/index.php b/index.php
index 1afa0c0..37c0efe 100644
--- a/index.php
+++ b/index.php
@@ -1,6 +1,6 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_calendar/index.php,v 1.15 2005/08/19 11:54:23 squareing Exp $
+// $Header: /cvsroot/bitweaver/_bit_calendar/index.php,v 1.16 2005/08/19 18:04:24 squareing Exp $
// Copyright( c ) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
@@ -64,39 +64,6 @@ $gBitSmarty->assign( 'monthafter', mktime( 0, 0, 0, $focus_month + 1, $focus_day
$gBitSmarty->assign( 'yearafter', mktime( 0, 0, 0, $focus_month, $focus_day, $focus_year + 1 ) );
$gBitSmarty->assign( 'focusmonth', $focus_month );
$gBitSmarty->assign( 'focusdate', $focusdate );
-$gBitSmarty->assign( 'now', mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) ) );
-
-$weekdays = range( 0, 6 );
-
-// calculate timespan for sql query
-if( $_SESSION['calendar']['view_mode'] == 'month' ) {
- $viewstart = mktime( 0, 0, 0, $focus_month , 1, $focus_year );
- $viewend = mktime( 0, 0, 0, $focus_month + 1, 0, $focus_year );
- // move viewstart back to Sunday....
- $viewstart -= date( "w", $viewstart ) * 86400;
- $viewend +=( 6 - date( "w", $viewend ) ) * 86400 - 1;
-
- // ISO weeks --- kinda mangled because ours begin on Sunday...
- $firstweek = date( "W", $viewstart + 86400 );
- $lastweek = date( "W", $viewend );
- if( $lastweek < $firstweek ) {
- if( date( "W", $focusdate ) < $firstweek ) {
- $firstweek -= 52;
- } else {
- $lastweek += 52;
- }
- }
- $numberofweeks = $lastweek - $firstweek;
-} elseif( $_SESSION['calendar']['view_mode'] == 'week' ) {
- $viewstart = mktime( 0, 0, 0, $focus_month, $focus_day, $focus_year );
- $numberofweeks = 0;
-} else {
- $viewstart = mktime( 0, 0, 0, $focus_month, $focus_day, $focus_year );
- $numberofweeks = 0;
-}
-
-$weeks = array();
-$cell = array();
if( $_SESSION['calendar']['content_type_guid'] ) {
$listHash = $_SESSION['calendar'];
@@ -109,12 +76,18 @@ if( $_SESSION['calendar']['content_type_guid'] ) {
$bitEvents = array();
}
+$calDates = $Calendar->doDateCalculations( $_SESSION['calendar'] );
+
+$weekdays = range( 0, 6 );
+$weeks = array();
+$cell = array();
+
// note that number of weeks starts at ZERO( i.e., zero = 1 week to display ).
-for( $i = 0; $i <= $numberofweeks; $i++ ) {
- $weeks[] = $firstweek + $i;
+for( $i = 0; $i <= $calDates['number_of_weeks']; $i++ ) {
+ $weeks[] = $calDates['first_week'] + $i;
// $start_of_week is a unix timestamp
- $start_of_week = $viewstart + $i * 604800; // one week
+ $start_of_week = $calDates['view_start'] + $i * 604800; // one week
foreach( $weekdays as $wd ) {
$leday = array();
@@ -146,7 +119,7 @@ for( $i = 0; $i <= $numberofweeks; $i++ ) {
$hrows = array();
if( $_SESSION['calendar']['view_mode'] == 'day' ) {
foreach( $cell[0]["{$weekdays[0]}"]['items'] as $dayitems ) {
- $hrows[intval( date( 'h', $dayitems['last_modified'] ) )][] = $dayitems;
+ $hrows[intval( date( 'G', $dayitems['last_modified'] ) )][] = $dayitems;
}
}
$hours = array( '0:00', '1:00', '2:00', '3:00', '4:00', '5:00', '6:00', '7:00',
@@ -169,12 +142,9 @@ $gBitSmarty->assign( 'hours', $hours );
$gBitSmarty->assign( 'trunc', 12 ); // put in a pref, number of chars displayed in cal cells
$gBitSmarty->assign( 'daformat', $gBitSystem->get_long_date_format()." ".tra( "at" )." %H:%M" );
$gBitSmarty->assign( 'daformat2', $gBitSystem->get_long_date_format() );
-$gBitSmarty->assign( 'firstweek', $firstweek );
-$gBitSmarty->assign( 'lastweek', $lastweek );
$gBitSmarty->assign( 'weekdays', $weekdays );
$gBitSmarty->assign( 'weeks', $weeks );
$gBitSmarty->assign( 'cell', $cell );
-$gBitSmarty->assign( 'var', '' );
$gBitSystem->display( 'bitpackage:calendar/calendar.tpl' );
?>
diff --git a/templates/calendar.tpl b/templates/calendar.tpl
index ee33f5a..56c4583 100644
--- a/templates/calendar.tpl
+++ b/templates/calendar.tpl
@@ -1,4 +1,4 @@
-{* $Header: /cvsroot/bitweaver/_bit_calendar/templates/calendar.tpl,v 1.11 2005/08/19 11:54:23 squareing Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_calendar/templates/calendar.tpl,v 1.12 2005/08/19 18:04:25 squareing Exp $ *}
{strip}
{if !$gBitSystem->isFeatureActive( 'feature_helppopup' )}
@@ -13,6 +13,9 @@
<div class="body">
{include file="bitpackage:calendar/calendar_options_inc.tpl"}
+ {* this is used to keep stuff like sort_mode persistent in all links on this page *}
+ {assign var=url_string value="sort_mode=`$smarty.request.sort_mode`&amp;user_id=`$smarty.request.user_id`"}
+
{if $gBitSystemPrefs.feature_jscalendar eq 'y'}
<table>
<tr>
@@ -41,9 +44,9 @@
</td>
<td nowrap="nowrap" width="120" align="right">
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?view_mode=day" class="{if $smarty.session.calendar.view_mode eq 'day'}highlight{/if}">{biticon ipackage=calendar iname=day iexplain=Day}</a>
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?view_mode=week" class="{if $smarty.session.calendar.view_mode eq 'week'}highlight{/if}">{biticon ipackage=calendar iname=week iexplain=Week}</a>
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?view_mode=month" class="{if $smarty.session.calendar.view_mode eq 'month'}highlight{/if}">{biticon ipackage=calendar iname=month iexplain=Month}</a>
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?view_mode=day&amp;{$url_string}" class="{if $smarty.session.calendar.view_mode eq 'day'}highlight{/if}">{biticon ipackage=calendar iname=day iexplain=Day}</a>
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?view_mode=week&amp;{$url_string}" class="{if $smarty.session.calendar.view_mode eq 'week'}highlight{/if}">{biticon ipackage=calendar iname=week iexplain=Week}</a>
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?view_mode=month&amp;{$url_string}" class="{if $smarty.session.calendar.view_mode eq 'month'}highlight{/if}">{biticon ipackage=calendar iname=month iexplain=Month}</a>
</td>
</tr>
</table>
@@ -51,29 +54,29 @@
<table>
<tr>
<td rowspan="2" style="text-align:left;">
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$daybefore}" title="{$daybefore|bit_long_date}">&laquo; {tr}day{/tr}</a><br />
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$weekbefore}" title="{$weekbefore|bit_long_date}">&laquo; {tr}week{/tr}</a><br />
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$monthbefore}" title="{$monthbefore|bit_long_date}">&laquo; {tr}month{/tr}</a><br />
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$yearbefore}" title="{$yearbefore|bit_long_date}">&laquo; {tr}year{/tr}</a>
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$daybefore}&amp;{$url_string}" title="{$daybefore|bit_long_date}">&laquo; {tr}day{/tr}</a><br />
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$weekbefore}&amp;{$url_string}" title="{$weekbefore|bit_long_date}">&laquo; {tr}week{/tr}</a><br />
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$monthbefore}&amp;{$url_string}" title="{$monthbefore|bit_long_date}">&laquo; {tr}month{/tr}</a><br />
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$yearbefore}&amp;{$url_string}" title="{$yearbefore|bit_long_date}">&laquo; {tr}year{/tr}</a>
</td>
<td style="text-align:center;">
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$now}" title="{$nowt|bit_short_date}">{tr}Today{/tr}: <strong>{$now|bit_short_date}</strong></a>
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$smarty.now}&amp;{$url_string}" title="{$smarty.now|bit_long_date}">{tr}Today{/tr}: <strong>{$smarty.now|bit_short_date}</strong></a>
</td>
<td rowspan="2" style="text-align:right;">
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$dayafter}" title="{$dayafter|bit_long_date}">{tr}day{/tr} &raquo;</a><br />
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$weekafter}" title="{$weekafter|bit_long_date}">{tr}week{/tr} &raquo;</a><br />
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$monthafter}" title="{$monthafter|bit_long_date}">{tr}month{/tr} &raquo;</a><br />
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$yearafter}" title="{$yearafter|bit_long_date}">{tr}year{/tr} &raquo;</a>
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$dayafter}&amp;{$url_string}" title="{$dayafter|bit_long_date}">{tr}day{/tr} &raquo;</a><br />
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$weekafter}&amp;{$url_string}" title="{$weekafter|bit_long_date}">{tr}week{/tr} &raquo;</a><br />
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$monthafter}&amp;{$url_string}" title="{$monthafter|bit_long_date}">{tr}month{/tr} &raquo;</a><br />
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$yearafter}&amp;{$url_string}" title="{$yearafter|bit_long_date}">{tr}year{/tr} &raquo;</a>
</td>
</tr>
<tr>
<td style="text-align:center;">
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?view_mode=day" class="{if $smarty.session.calendar.view_mode eq 'day'}highlight{/if}">{biticon ipackage=calendar iname=day iexplain=Day}</a>
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?view_mode=week" class="{if $smarty.session.calendar.view_mode eq 'day'}highlight{/if}">{biticon ipackage=calendar iname=week iexplain=Week}</a>
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?view_mode=month" class="{if $smarty.session.calendar.view_mode eq 'day'}highlight{/if}">{biticon ipackage=calendar iname=month iexplain=Month}</a>
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?view_mode=day&amp;{$url_string}" class="{if $smarty.session.calendar.view_mode eq 'day'}highlight{/if}">{biticon ipackage=calendar iname=day iexplain=Day}</a>
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?view_mode=week&amp;{$url_string}" class="{if $smarty.session.calendar.view_mode eq 'week'}highlight{/if}">{biticon ipackage=calendar iname=week iexplain=Week}</a>
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?view_mode=month&amp;{$url_string}" class="{if $smarty.session.calendar.view_mode eq 'month'}highlight{/if}">{biticon ipackage=calendar iname=month iexplain=Month}</a>
</td>
</tr>
</table>
@@ -83,12 +86,11 @@
<caption>{tr}Selection: {$focusdate|bit_long_date}{/tr}</caption>
{if $smarty.session.calendar.view_mode eq 'day'}
<tr>
- <th style="width:15%;">{tr}Hours{/tr}</th>
+ <th style="width:15%;">{tr}Time{/tr}</th>
<th>{tr}Events{/tr}</th>
</tr>
- {cycle values="odd,even" print=false}
{section name=h loop=$hours}
- <tr class="{cycle}">
+ <tr class="{cycle values="odd,even"}">
<td style="text-align:right; vertical-align:top; padding-right:15px;">{$hours[h]}</td>
<td>
{section name=hr loop=$hrows[h]}
@@ -99,11 +101,6 @@
&nbsp; <a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$cell[w][d].items[items].content_id}" {popup fullhtml="1" text=$over|escape:"javascript"|escape:"html"}>
{$hrows[h][hr].title|default:"..."}
</a>
-
- {if $hrows[h][hr].web}
- <a href="{$hrows[h][hr].web}" title="{$hrows[h][hr].web}">w</a>
- {/if}
-{* - Omit description for moment - need to strip <CR> $hrows[h][hr].description *}
</div>
{/section}
</td>
@@ -135,7 +132,7 @@
<td class="calday {cycle}" style="vertical-align:top;">
{if $cell[w][d].day|date_format:"%m" eq $focusmonth or $smarty.session.calendar.view_mode eq "week"}
{if $cell[w][d].day eq $focusdate}<strong>{/if}
- <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$cell[w][d].day}">{$cell[w][d].day|date_format:"%d/%m"}</a>
+ <a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?todate={$cell[w][d].day}&amp;{$url_string}">{$cell[w][d].day|date_format:"%d/%m"}</a>
{if $cell[w][d].day eq $focusdate}</strong>{/if}
<hr />
@@ -143,15 +140,9 @@
{section name=items loop=$cell[w][d].items}
{assign var=over value=$cell[w][d].items[items].over}
<div class="cal{$cell[w][d].items[items].content_type_guid}">
-
- <a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$cell[w][d].items[items].content_id}" {popup fullhtml="1" text=$over|escape:"javascript"|escape:"html"}>
+ <a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$cell[w][d].items[items].content_id}&amp;{$url_string}" {popup fullhtml="1" text=$over|escape:"javascript"|escape:"html"}>
{$cell[w][d].items[items].title|truncate:$trunc:"..."|default:"?"}
</a>
-
- {if $cell[w][d].items[items].web}
- <a href="{$cell[w][d].items[items].web}" title="{$cell[w][d].items[items].web}">w</a>
- {/if}
- <br />
</div>
{/section}
{else}
diff --git a/templates/calendar_options_inc.tpl b/templates/calendar_options_inc.tpl
index f4961b2..02ef288 100644
--- a/templates/calendar_options_inc.tpl
+++ b/templates/calendar_options_inc.tpl
@@ -4,9 +4,9 @@
document.write("<li><a href=\"javascript:toggle('tabcal');\">{tr}Show / Hide Options{/tr}</a></li>");
//]]></script>
{if $smarty.request.user_id}
- <li>{smartlink ititle="Show all"}</li>
+ <li>{smartlink ititle="Show all" sort_mode=$smarty.request.sort_mode}</li>
{else}
- <li>{smartlink ititle="Only my items" user_id=$gBitUser->mUserId}</li>
+ <li>{smartlink ititle="Only my items" user_id=$gBitUser->mUserId sort_mode=$smarty.request.sort_mode}</li>
{/if}
<li>{smartlink ititle="Creation date" isort="created"}</li>
<li>{smartlink ititle="Modification date" idefault=1 isort="last_modified"}</li>
@@ -14,6 +14,7 @@
</div>
<div class="clear"></div>
+<br />
<script type="text/javascript">//<![CDATA[
document.write("<div id=\"tabcal\" style=\"display:{if $smarty.cookies.tabcal eq 'o'}block{else}none{/if};\">");