summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHash9 <hash9@users.sourceforge.net>2006-02-02 14:39:47 +0000
committerHash9 <hash9@users.sourceforge.net>2006-02-02 14:39:47 +0000
commita06df5176d1c67d91fa2e5a2f3b5e2bbcfcf7773 (patch)
tree3763e7e558327d602983f651671cf228141cdfa4
parent1f622e8ba676f2aeeda1a3571eec3990652b2a80 (diff)
downloadcalendar-a06df5176d1c67d91fa2e5a2f3b5e2bbcfcf7773.tar.gz
calendar-a06df5176d1c67d91fa2e5a2f3b5e2bbcfcf7773.tar.bz2
calendar-a06df5176d1c67d91fa2e5a2f3b5e2bbcfcf7773.zip
add the (default) option to sort by event date
-rw-r--r--Calendar.php3
-rw-r--r--index.php4
-rw-r--r--templates/calendar_nav_inc.tpl6
3 files changed, 8 insertions, 5 deletions
diff --git a/Calendar.php b/Calendar.php
index c4de0de..7bf8a88 100644
--- a/Calendar.php
+++ b/Calendar.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_calendar/Calendar.php,v 1.31 2006/01/14 19:56:42 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_calendar/Calendar.php,v 1.32 2006/02/02 14:39:46 hash9 Exp $
* @package calendar
*/
@@ -47,6 +47,7 @@ class Calendar extends LibertyContent {
$item['timestamp'] = $item[$pListHash['calendar_sort_mode']] + $offset;
$item['created'] = $item['created'] + $offset;
$item['last_modified'] = $item['last_modified'] + $offset;
+ $item['event_time'] = $item['event_time'] + $offset;
$dstart = $this->mDate->gmmktime( 0, 0, 0, $this->mDate->date( "m", $item['timestamp'], true ), $this->mDate->date( "d", $item['timestamp'], true ), $this->mDate->date( "Y", $item['timestamp'], true ) );
$ret[$dstart][] = $item;
}
diff --git a/index.php b/index.php
index 3546239..5db0622 100644
--- a/index.php
+++ b/index.php
@@ -1,6 +1,6 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_calendar/index.php,v 1.37 2006/01/10 21:19:49 squareing Exp $
+// $Header: /cvsroot/bitweaver/_bit_calendar/index.php,v 1.38 2006/02/02 14:39:46 hash9 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.
@@ -66,7 +66,7 @@ $gBitSmarty->assign_by_ref( 'calDay', $calDay = $gCalendar->buildDay( $_SESSION[
if( $_SESSION['calendar']['content_type_guid'] ) {
$listHash = $_SESSION['calendar'];
$listHash['user_id'] = !empty( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : NULL;
- $listHash['sort_mode'] = !empty( $_REQUEST['sort_mode'] ) ? $_REQUEST['sort_mode'] : 'last_modified_asc';
+ $listHash['sort_mode'] = !empty( $_REQUEST['sort_mode'] ) ? $_REQUEST['sort_mode'] : 'event_time_asc';
$listHash['offset'] = 0;
$listHash['max_records'] = 500;
$bitEvents = $gCalendar->getList( $listHash );
diff --git a/templates/calendar_nav_inc.tpl b/templates/calendar_nav_inc.tpl
index 92e0390..915a335 100644
--- a/templates/calendar_nav_inc.tpl
+++ b/templates/calendar_nav_inc.tpl
@@ -6,7 +6,8 @@
<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>
+ <li>{smartlink ititle="Modification date" isort="last_modified"}</li>
+ <li>{smartlink ititle="Event time" idefault=1 isort="event_time"}</li>
</ul>
</div>
@@ -19,6 +20,7 @@
<td>
<div>
{form method="get" id="f"}
+ <input type="hidden" id="sort_mode" name="sort_mode" value="{$smarty.request.sort_mode}" />
<input type="hidden" id="todate" name="todate" value="{$navigation.focus_date|cal_date_format:"%B %e, %Y %H:%M %Z"}" />
<span class="highlight" style="cursor:pointer;" title="{tr}Date Selector{/tr}" id="datrigger">{$navigation.focus_date|bit_long_date}</span>
&nbsp;&nbsp;&nbsp;<small>&laquo;&nbsp;{tr}click to navigate{/tr}</small>
@@ -27,7 +29,7 @@
<script type="text/javascript">//<![CDATA[
function gotocal() {ldelim}
- window.location = '{$gBitLoc.CALENDAR_PKG_URL}index.php?todate='+document.getElementById('todate').value;
+ document.getElementById('f').submit();
{rdelim}
Calendar.setup( {ldelim}