This topic is locked

Adding past events on the calendar

4/29/2008 10:53:29 AM
Calendar Template general questions
D
Dowdy author

I am need to allow the admin to add past events to the calendar. I would appreciate any help someone can give to show me how this is done.

Sergey Kornilov admin 5/1/2008

Let's assume we talking about the Monthly view. Proceed to events tab, Monthly View, "List page: Before display" event.

Check lines 95-96:
This code hides "Add new" links for past dates.
if(strtotime(date("Y-m-d"))-strtotime($yr."-".$mon."-".$i)<=0)

$smarty->assign("row00AddHideM" . (int)($i+$wd) . "_value","");
If you change it the following way:

if(strtotime("2008-05-12")-strtotime($yr."-".$mon."-".$i)<=0)

$smarty->assign("row00AddHideM" . (int)($i+$wd) . "_value","");
It will prohibit to add events to all dates prior to May 12, 2008.
If you remove these two lines you'll be able to add events to any date.

D
Dowdy author 5/20/2008

I is showing the "Add new" lines needed, but when I try to add a new entry for a past date, it give a popup windows error...
"error Date or Time"
Is there another line I need to comment out?
Thanks for the support.

Dowdy

Sergey Kornilov admin 5/21/2008

I recommend you to post your application to Demo Account and to send the URL to support@xlinesoft.com for investigation.

S
simonedan 2/10/2009

Once can notice there are many users incountering this Problem.Why this Limitation was at all put to the Tamplate??????????????There is no reason.

One can need offen to add a event from the past.

I have finde a solution not perfact, adding the event from the original table: calcalendar_add.php (implementing it insted of caldayly_add.php), where this Limitation dos not exist.
To remoove the Limitation from the caldayly_add.php:

OK, once 2 Lines has been remooved from the montly view as described the problem remains.

Which are exactly Lines to be remooved from the dayly, weekly and yearly view??? in order to remoove this Limitation?

J
Jane 3/4/2009

Hi,
you need to remove thes lines:

if(strtotime(date("Y-m-d"))-strtotime($yr."-".$mon."-".$i)<=0)

$smarty->assign("row00AddHideM" . (int)($i+$wd) . "_value","");
Then open Before record added and Before record updated events for caldaily view on the Events tab, find this line:

if ((strtotime(now())-strtotime($values["DateField"]." ".$values["TimeField"]))>=0 && $values["DayEvent"]!=1 && $values["Recurrence"]!=1 || (strtotime(date("Y-m-d"))-strtotime($values["DateField"]))/606024>0 && $values["DayEvent"]==1 && $values["Recurrence"]!=1)



and replace it with this one:

if ((strtotime(date("Y-m-d"))-strtotime($values["DateField"]))/606024>0 && $values["DayEvent"]==1 && $values["Recurrence"]!=1)