[rt-users] Calendar Widget?
Myers, Adam
AMyers at abacus-us.com
Thu Jan 5 14:15:11 EST 2006
I have integrated jscalendar-1.0 into RT. I followed the help files
provided with the download and use a small calendar image to click on
and open a flat calendar.
Here is what I did:
Add jscalendar files to '/share/html/NoAuth' and add the appropriate
javascript and css links to '/local/html/Elements/Header'.
For Example
-------
<!-- calendar -->
<link rel="stylesheet" type="text/css"
href="<%$RT::WebPath%>/NoAuth/jscalendar/calendar-system.css"
title="calendar-system">
<script language="javascript" type="text/javascript"
src="<%$RT::WebPath%>/NoAuth/jscalendar/calendar.js"></script>
<script language="javascript" type="text/javascript"
src="<%$RT::WebPath%>/NoAuth/jscalendar/lang/calendar-en.js"></script>
<script language="javascript" type="text/javascript"
src="<%$RT::WebPath%>/NoAuth/jscalendar/calendar-setup.js"></script>
---------------
Use this code for '/Elements/SelectDate'
----------------------------------
<INPUT NAME="<%$Name%>" VALUE="<%$Default%>" size=<%$Size%>
id="<%$ID%>">
<img src="<%$RT::WebPath%>/NoAuth/jscalendar/img.gif"
id="<%$ID%>_trigger" title="Date selector" />
<script type="text/javascript">
Calendar.setup({
inputField : "<%$ID%>", // id of the input field
ifFormat : "%Y-%m-%d %H:%M:%S", // format of the
input field
showsTime : true, // will display a time
selector
button : "<%$ID%>_trigger", // trigger for the
calendar (button ID)
singleClick : false, // double-click mode
step : 1 // show all years in
drop-down boxes (instead of every other year as default)
});
</script>
<%init>
unless ((defined $Default) or
($current <= 0)) {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($current);
$Default = sprintf("%04d-%02d-%02d %02d:%02d",
$year+1900,$mon+1,$mday,
$hour,$min);
}
unless ($Name) {
$Name = $menu_prefix. "_Date";
}
</%init>
<%args>
$ShowTime => undef
$menu_prefix=>''
$current=>time
$Default => undef
$Name => undef
$Size => 16
$ID => ''
</%args>
--------------------------------------
Then whenever the 'SelectDate' component is called, add the appropriate
'Name' and 'ID' arguments. Something like this (from
'/Ticket/Create.html').
----------------
<& /Elements/SelectDate, Name => 'Due', ID =>'Due', current => 0,
Default => $ARGS{Due} &> </TD>
---------------
This should get you up and running. It is a very nice feature that makes
it easy to set dates.
** Adam Myers
________________________________
From: rt-users-bounces at lists.bestpractical.com
[mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Sam
Crosby
Sent: Thursday, January 05, 2006 9:34 AM
To: rt-users at lists.bestpractical.com
Subject: [rt-users] Calendar Widget?
Has anyone incorporated a calendar widget (such as the java
'jscalendar-1.0') for working with date fields in the on-line
interfaces? Using something like that would certainly be a welcome
enhancement for users...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20060105/8bf58655/attachment.htm>
More information about the rt-users
mailing list