Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: Start/End Time on Event View  (Read 806 times)
0 Members and 1 Guest are viewing this topic.
Krypto
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: July 31, 2002, 07:13:00 AM »

I am running version 3.1 with the oldstyle. I have tried the steps in the "SCHEDULE not available in EVENT view" post but I can not get this to work. Has anyone else been able to get this to work with the above version and style?? If so can you please share how you were able to do this.
Logged
kayleigh
New Member
*

Karma: 0
Offline Offline

Posts: 0

Computer Analyst


WWW
« Reply #1 on: July 31, 2002, 05:22:00 PM »

What specific problems are you having? I know I had problems with the event popup not getting the correct date, so I added the datestring to the link refence.

Here's how I added the date to the event_detail.html:

code:
<!-- START Time MOD -->
   <TR><TD ALIGN="right" VALIGN="top" NOWRAP>
      <SPAN CLASS="text"><B>Start Time:</B></TD>
       <TD ALIGN="left" VALIGN="top" NOWRAP>
      <%
      $starttime = &Date::formatTime($EVENT2->{'schedule'}->{'start_time'}, $Config->get(time_format));
      $endtime = &Date::formatTime($EVENT2->{'schedule'}->{'end_time'}, $Config->get(time_format));
      if ($EVENT->{'schedule'}->{'start_time'}) { %>
         <%= $starttime %>
         <% } %>
      <% if ($EVENT->{'schedule'}->{'end_time'} ne $EVENT->{'schedule'}->{'start_time'}) { %>
         - <%= $endtime %>
         <%}%>
      <% if ($EVENT->{'schedule'}->{'all_day'} == "1") { %><B><I>All Day</I></B><%}%>
      </TD></TR></SPAN>
<!-- END Time MOD -->

The full code I use to link to the event_detail.html popup is:

code:
<A HREF="<%=$CGI_URL_QUERYSTRING%>popup=0&template=event_detail.html&event_id=<%= EVENT FIELD(id) %>&datestring=<%= $DAY->{datestring} %>" onClick="showDetails('<%=$EVENT->{'details'}->{'id'}%>&datestring=<%= $DAY->{datestring} %>');return false;"><%=EVENT FIELD(title)%></A>

(Um, That all goes on one line.) See if that works for you. If not, we may have to add another hack DanO posted a while back.

------------------
Stephanie Meemken
Webmaster, Minnesota Jaycees
http://www.mnjaycees.org/

[This message has been edited by kayleigh (edited July 31, 2002).]

Logged

Stephanie Meemken
Webmaster, Minnesota Jaycees

http://www.mnjaycees.org/
diver165
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #2 on: July 31, 2002, 07:44:00 PM »

Can you use this mod in the default calendar view or does this only work for the "old style"?

If so where do I place the code?

------------------

Logged
Krypto
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #3 on: August 01, 2002, 08:32:00 AM »

OK kayleigh thanks for the post this is were I'm at. I have added the <-Start time Mod-> code to the event_detail.html after the code: "<TR><TD ALIGN="right" VALIGN="top"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></TD><TD ALIGN="left" VALIGN="top"><%=$EVENT->{$_}%></TD></TR>
<% } %>"

and added the link code to the default.html in place of:
"HREF="<%=$CGI_URL_QUERYSTRING%>popup=0&template=event_detail.html&event_id=<%=$EVENT->{'details'}->{'id'}%>" onClick="showDetails('<%=$EVENT->{'details'}->{'id'}%>');return false;"><%= $EVENT->{'details'}->{'title'} %></A><BR>"

I still do not get a value for the start time just the label...

Is everything that I've done so far wright???Do I need to add anything to the calendar.pl for the $EVENT2?Huh?

I added Kent's code to the calendar.pl but did not add the code for the default.html. It looks like the code is just for the new default style not the oldstyle. However I  still can't get the start time to show up.


------------------

[This message has been edited by Krypto (edited August 01, 2002).]

Logged
kayleigh
New Member
*

Karma: 0
Offline Offline

Posts: 0

Computer Analyst


WWW
« Reply #4 on: August 02, 2002, 06:52:00 PM »

diver165:
I'm using this with the default calendar. I just copied the event_detail.html & styles_scripts.html files from the /oldstyle directory to the /default directory & changed my event link codes to call the popup template.

Krypto:
Try

$starttime = &Date::formatTime($EVENT->{'schedule'}->{'start_time'}, $Config->get(time_format));
$endtime = &Date::formatTime($EVENT->{'schedule'}->{'end_time'}, $Config->get(time_format));

I haven't always been able to get the $EVENT2 mod to work.

------------------
Stephanie Meemken
Webmaster, Minnesota Jaycees

http://www.mnjaycees.org/

Logged

Stephanie Meemken
Webmaster, Minnesota Jaycees

http://www.mnjaycees.org/
Triple-M
Guest
« Reply #5 on: August 03, 2002, 10:43:00 AM »

Hi Kayleigh,

I'm currently having the same problem as krypto, the time simply does not show up, just the label "Start Time:"!

Any other ideas?

Thanks in Advance,

Tom

Logged
Krypto
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #6 on: August 05, 2002, 09:19:00 AM »

Thanks alot kayleigh!!!!I was able to get the start\end times to work. Now all I need is to get the date on it. Here is what I did to get it working with the oldstyle:

Calendar.pl code added in BOLD:

# Call-back method to get events
   *Template::getEvents = \&getEvents;
   *Template::getEvent = \&getEvent;
    *Template::getEvent2 = \&getEvent2;

Find the subroutine "getEvent", below it add this new subroutine:


code:
--------------------------------------------------------------------------------

###################################################
# Subroutine called by Template to get the schedule  
###################################################
   sub getEvent2 {
      my ($id2) = @_;   my ($db2) = new DBFile($schedule_db);   
      my ($event2) = $db2->getRecord( {'event_id'=>$id2 } );   
      return $event2;   
      }


Event_detail.html code added in BOLD:

----Code located at top------

<%
$VIEW = "EVENT";
$EVENT = &getEvent($in{'event_id'});
$db = new DBFile($main::events_db);
$EVENT2->{'schedule'} = &getEvent2($in{'event_id'});
$fields = &main::  DBGetFieldsInDisplayOrder($db);
%>

----Code Located near bottom-------

<TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0">

               <!-- START Time Code -->
<SPAN CLASS="text"><TR><TD ALIGN="right" VALIGN="top"><B>Time:</B></TD>            
<TD ALIGN="left" VALIGN="top">
   <%                
      if ( $event->{'schedule'}->{'all_day'})
   {                    
      print "All Day";                }       
   else {  print  &Date::formatTime($EVENT2->{schedule}->{start_time},$Config->get("time_format")),  " - ",       &Date::formatTime($EVENT2->{schedule}->{end_time} ,  $Config->get("time_format"));                }            
   %>
   </TD></TR></SPAN>
               <!-- End Time Code -->

[This message has been edited by Krypto (edited August 05, 2002).]

[This message has been edited by Krypto (edited August 05, 2002).]

[This message has been edited by Krypto (edited August 05, 2002).]

[This message has been edited by Krypto (edited August 05, 2002).]

Logged
janedsh
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #7 on: June 17, 2003, 10:58:00 AM »

Thanks!  By following this thread I was FINALLY able to get the Time/Date added to the event view.  It's working great....except that I noticed in any view other than the month view, I lose the date navigation at the top of the page.

Here's the sample: http://webdev.rcs.k12.in.us/cgi-bin/calendar.pl?=default

Can anyone suggest a fix?

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #8 on: June 17, 2003, 02:05:00 PM »

** in any view other than the month view, I lose
the date navigation at the top of the page. **

You must have altered the navigation code in the default.html
template file. You'll have to correct it again.

Dan O.

------------------

Logged
janedsh
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #9 on: June 18, 2003, 09:47:00 AM »

Sorry to be dense...I can cut and paste with the best of them, but I'm not a programer.

Earlier, I did install the MonthWrap hack but it seems to be working fine in the two week view.

Where *exactly* would I find the navigation code that you are refering to?


------------------

[This message has been edited by janedsh (edited June 18, 2003).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #10 on: June 18, 2003, 12:27:00 PM »

** Where *exactly* would I find the navigation code that you are refering to? **

Towards the top of the default.html template file you should see code something like:

<!-- MONTH NAVIGATION -->
HTML code here
<!-- /MONTH NAVIGATION -->

<!-- WEEKLY NAVIGATION -->
HTML code here
<!-- /WEEKLY NAVIGATION -->

<!-- DAY NAVIGATION -->
HTML code here
<!-- /DAY NAVIGATION -->

<!-- /EVENT NAVIGATION -->

<!-- SEARCH NAVIGATION -->
HTML code here
<!-- /SEARCH NAVIGATION -->


Something in that section must have been changed or removed.
Most likely in or on the lines just before the
<!-- WEEKLY NAVIGATION -->
as the Monthly and Day View navigation code IS displaying.

Dan O.

------------------

Logged
janedsh
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #11 on: June 19, 2003, 11:39:00 AM »

DanO...Thank you, thank you, thank you!!

I compared my files and found my mistake, thanks to your helpful suggestions.

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #12 on: June 19, 2003, 07:43:00 PM »

** found my mistake **

Glad to hear it, thanks for the follow up.

Dan O.

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: