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
Calendar Script CommunityCustomizationHacks and Mods (Moderators: scott, DanO, Marty)Redirecting to calendar after adding event
Pages: 1 [2]   Go Down
Print
Author Topic: Redirecting to calendar after adding event  (Read 887 times)
0 Members and 1 Guest are viewing this topic.
xoldmaster
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #15 on: October 13, 2004, 07:46:00 PM »

It's changed to cgi.

[This message has been edited by xoldmaster (edited October 13, 2004).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #16 on: October 13, 2004, 08:55:00 PM »

* but it redirect me to calendar_admin.pl, not to calendar.pl *

** It's changed to cgi.**

Than it should be redirecting you to calendar_admin.cgi not calendar_admin.pl
as you stated previously?

Dan O.


[This message has been edited by DanO (edited October 14, 2004).]

Logged
xoldmaster
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #17 on: October 14, 2004, 01:28:00 AM »

Yeap. But not to calendar.cgi how it has to.
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #18 on: October 14, 2004, 02:24:00 AM »

** But not to calendar.cgi how it has to. **

No, because the plug-in is looking for a file name ending in .pl

You'll need to change the file name ending references in that plug-in's
after_schedule_event.pl file in order for it to work with files renamed to .cgi

BTW. It's best if you state accurately what the problem is when asking for assistance.

JMO

Dan O.

[This message has been edited by DanO (edited October 14, 2004).]

Logged
xoldmaster
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #19 on: October 14, 2004, 08:54:00 AM »

OK.
I changed after_schedule_event.pl. Now it looks like:
code:

my ($url) = $Template::CGI_URL;
$url =~ s|calendar\.cgi|calendar_admin\.cgi|;


But it still transfer me to calendar_admin.cgi.
When I tried to rename after_schedule_event.pl to .cgi plugin doesn't work at all.
What else can be wrong?
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #20 on: October 14, 2004, 12:13:00 PM »

** But it still transfer me to calendar_admin.cgi **

The only way I can see that still occurring is if the modified line isn't being executed.
I don't know how that could be happening unless you didn't upload the modified file or
maybe you uploaded it to the wrong place.

** When I tried to rename after_schedule_event.pl to .cgi plugin doesn't work at all. **

No it won't. All plug-in files must retain the .pl file name extensions.

** What else can be wrong? **

There is nothing else I can think of which would cause
the modified file to fail (unless it isn't there to be used).

Dan O.

[This message has been edited by DanO (edited October 14, 2004).]

Logged
xoldmaster
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #21 on: October 14, 2004, 10:08:00 PM »

OK.
I resolved this problem. May be it's not "professional" but it works. I just changed string
code:
<META HTTP-EQUIV="REFRESH" CONTENT="0;URL=$url?calendar=$calendar&datestring=$datestr">


with string
code:
<META HTTP-EQUIV="REFRESH" CONTENT="0;URL=calendar.cgi?calendar=$calendar&datestring=$datestr">

Logged
wderzawiec
New Member
*

Karma: 0
Offline Offline

Posts: 15

Web site coordinator


WWW
« Reply #22 on: June 08, 2006, 12:02:00 PM »

Hi,

I've been trying to use the redirector plugin for adding, editing, rescheduling and deleting events.

All is well except for deleting.  I tried implementing Dan O's method for editing, that is, copying the after_schedule_event.pl file and renaming it after_delete_event.pl, but it redirects to Jan. 1970.
I tried changing:

my ($ss, $mi, $hh, $dd, $mm, $yy) = gmtime($db->getRecord({'event_id' => $in{'EVENT_id'}})->{start});

to:

my ($ss, $mi, $hh, $dd, $mm, $yy) = gmtime($db->getRecord({'event_id' => $Template::event->{'id'}})->{start});

in the new after_delete_event.pl but still 1970.  I tried copying the code from after_delete_event.pl to the end of the delete_event subroutine in calendar_admin.pl but still 1970.  Is there anything else I can try?  Thank you.

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

Logged
wderzawiec
New Member
*

Karma: 0
Offline Offline

Posts: 15

Web site coordinator


WWW
« Reply #23 on: June 10, 2006, 10:01:00 PM »

fwiw, on redirecting after delete, I'm guessing the script was not able to find the date of the deleted event because it had been deleted.  I created a new file "before_delete_event.pl" in the Redirector plugin directory with this code:

sub before_delete_event
{

       my ($db) = new DBFile($schedule_db);
   my ($ss, $mi, $hh, $dd, $mm, $yy) = gmtime($db->getRecord({'event_id' => $in{'EVENT_id'}})->{start});
   $mm++;
   $yy += 1900;
   my ($datestr) = sprintf ( "%04d%02d%02d", $yy, $mm, $dd );
   my ($url) = $Template::CGI_URL;
   $url =~ s|calendar_admin\.pl|calendar\.pl|;

               #from delete_event subroutine in calendar_admin.pl
      if ($db->deleteRecords( { 'event_id'=>$in{EVENT_id} } )) {
         &addUserMessage(&getMessage("EVENT_DELETED_FROM_SCHEDULE"));
         }
      else {
         &ERROR($db->getErrorMessage());
         }
      $db = new DBFile($events_db);
      if ($db->deleteRecords( { 'id'=>$in{EVENT_id} } )) {
         &addUserMessage(&getMessage("EVENT_DELETED_FROM_DATABASE"));
         }
      else {
         &ERROR($db->getErrorMessage());
         }
               #end from delete_event subroutine


print <<EOF;
Content-type:text/html

<HTML>
<HEAD>
<META HTTP-EQUIV="REFRESH" CONTENT="0;URL=$url?calendar=$calendar&datestring=$datestr">
</HEAD>
<BODY>
Delete successful. We are sending you back to the <A HREF="$url?calendar=$calendar&datestring=$datestr">calendar</A>.
</BODY>
</HTML>
EOF


   &exitGracefully();
}

1;


Seems to work.  Thanks.

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

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