Calendar Navigation Improvements

From PikaDocs

Some thoughts on improving the navigation in the calendar, fixing what some would call bugs.

 Screenshot of areas of calendar screen we are examining

Problem 1

The "Go to Date" box in the upper right hand of the calendar screen reverts to showing your own calendar even if you are looking at someone else's calendar. It also reverts to showing just one week even if you are currently looking at 2 or 4 weeks. In my opinion, it should retain the settings of the current page since the user has chosen them.

How to change this:

First, modify subtemplates/cal_week.html
This is around line 26, you can see where I've added an opening and closing comments, the 2 lines of HTML between the comments are the new code.

<form action="cal_week.php" method="get">
Go to date:
<input type="text" name="cal_date" size="10" maxlength="10" tabindex="2"/>
<!-- Andrew Cameron 2006/2/13 see ticket #1433. When click go to date it uses your user_id,
it should retain another person's user_id if that is what you are looking at
also should retain the screen variable which is how many weeks you are looking at currently -->
<input type="hidden" name="user_id" value="%%[user_id]%%"/>
<input type="hidden" name="screen" value="%%[screen]%%"/>
<!-- end Andrew's changes -->
<input type="submit" value="Go"/>
</form>


A similar change should be made in subtemplates/cal_day.html around line 46:

<form action="cal_day.php" method="get">
Go to date:
<input type="text" name="cal_date" size="10" maxlength="10" tabindex="2"/>
<!-- Andrew Cameron 2006/2/13 see ticket #1433. When click go to date it uses your user_id,
it should retain another person's user_id if that is what you are looking at
also should retain the screen variable which is how many weeks you are looking at currently -->
<input type="hidden" name="user_id" value="%%[user_id]%%"/>
<input type="hidden" name="screen" value="%%[screen]%%"/>
<!-- end Andrew's changes -->
<input type="submit" value="Go"/>
</form>


Problem 2

The "View Another Person's Calendar" tool on the calendar screen loses what day you are looking at. That is, if you are looking at April 1 on your own calendar, then select another user's calendar, it will pull up that person's calendar for today instead of for April 1. This appears to be due to a simple typo.

To fix subtemplates/cal_week.html around line 65 I commented out the line with the typo and added a new line.:

<!-- Andrew Cameron 2006/4/13 fixing a typo in the original subtemplate here which calls the
variable act_date instead of cal_date -->
<!--<input type="hidden" name="act_date" value="%%[cal_date]%%"/><br/>-->
<input type="hidden" name="cal_date" value="%%[cal_date]%%"/>


Also make this same fix in subtemplates/cal_day.html around line 140:

<!-- Andrew Cameron 2006/4/13 fixing a typo in the original subtemplate here which calls the
variable act_date instead of cal_date -->
<!--<input type="hidden" name="act_date" value="%%[cal_date]%%"/><br/>-->
<input type="hidden" name="cal_date" value="%%[cal_date]%%"/>

As always, put your own name or initials in the comment, and put the date you made the change. This will help distinguish changes you made yourself from upgrades done by Pika Software.


original entry by Andrew Cameron
Legal Services Lawline of Vermont (http://www.lawlinevt.org/) and Vermont Legal Aid (http://www.vtlegalaid.org/)