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


Login with username, password and session length

Search

 
Advanced search

8022 Posts in 1850 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: skipping AddEvent ?  (Read 374 times)
0 Members and 1 Guest are viewing this topic.
dtbaker
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: February 26, 2003, 04:55:00 PM »

I have a newbie question about how to modify such that I set the FIELD_title to the active user name, skip the AddEvent dialog and go right to scheduling the event. The flow is evading my understanding. I tried to edit the default.html for the calendar and set the form vars, but the system comes back to the AddEvent form rather than moving ahead to the ScheduleEvent form.

I want to use the calendar to manage an "on-call" schedule, and several things can be assumed:
- event titles can just be the user name
- events can be set to last all day

further customization will be that I can only allow 2 "events" perday i.e. 2 people on call. and that I need to make some decisions based on the user's name... but that can come later.

can anyone give me a brief description how I can set the required form variables and skip the AddEvent, and go right to scheduling when the user hits "Add Event" ?

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 220

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


WWW
« Reply #1 on: February 26, 2003, 06:58:00 PM »

** I tried to edit the default.html for the calendar and set the form vars, but the system comes back to the AddEvent form rather than moving ahead to the ScheduleEvent form. **

What script are you attempting to submit that form to?

Adding an event is a function of the calendar_admin.pl file. If you're attempting to submit the form to the calendar.pl file, it will not know what to do with the request and likely just take you back to where you were before.

If you need further assistance, posting or linking to the code you are using would likely be helpful.

JMO

Dan O.

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

Logged
dtbaker
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #2 on: February 26, 2003, 07:25:00 PM »

I editted the file calendarscript/templates/calendars/default/default.html

and in the section that creates the link to "Add Event" I tried the following edit in the attempt to set and pass the required FORM variables bypassing the initial dialog form:

      <%--    Add_Event code modified by danbak to go directly to adding...
         using user name as event title --%>
      
      <% if ($User->hasPermission($CALENDAR_KEY,"ADD_EVENT")) { %>
         <TR><TD BGCOLOR="<%=$_COMMAND_OPTION_BGCOLOR%>">
         <a                   href="<%=$ADMIN_CGI_URL%>?fromTemplate=add_edit_event.html&template=add_edit_event.html&command=add_event&FIELD_title=<%=$User->{username}%>"
         CLASS="commandtext">Add Event</A></TD></TR>
      <%}%>

      <%-- original code commented out --%>
      <%-- if ($User->hasPermission($CALENDAR_KEY,"ADD_EVENT")) { %>
         <TR><TD BGCOLOR="<%=$_COMMAND_OPTION_BGCOLOR%>"><a href="<%=$ADMIN_CGI_URL%>?calendar=<%=$CALENDAR_KEY%>&username=<%=$User->{username}%>&template=add_edit_event.html" CLASS="commandtext">Add Event</A></TD></TR>
      <%} --%>

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 220

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


WWW
« Reply #3 on: February 26, 2003, 08:41:00 PM »

** fromTemplate=add_edit_event.html&template=add_edit_event.html&command... **

template=add_edit_event.html
This bit of code should send the user to the Add Event page. I don't think you want that. What would need to be there is either schedule_event_recurring.html or schedule_event_non_recur.html in place of add_edit_event.html

BTW. Once a user clicks that link (once it's working properly) an event will be added to the database whether they complete the schedule for it or not. If people click the link by mistake too often, your database will fill up with unusable event data.

If you're only going to allow users to add single events (not recurring ones), you might have better success using the 'OneClick Event Entry' plugin from the Unofficial CalendarScript - Mods and Plugins site and hard coding the user name into a hidden form field?

Just a thought.

Dan O.

[This message has been edited by DanO (edited February 26, 2003).]

Logged
dtbaker
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #4 on: February 26, 2003, 10:27:00 PM »

I will check out the one-click deal to see if that will fit the bill....

Also wanted to follow up on your comment about "fill up the database". Ifn the process of messing around with this coding, I notice that there are events added to events.txt, and the events.id gets incremented.
- how many events can get added before the system is "full"?
- can I manually clean out the events.txt file and reset the id number, or is there more to it than that?

thanx,

d

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 220

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


WWW
« Reply #5 on: February 27, 2003, 07:38:00 PM »

** - how many events can get added before the system is "full"? **

There is no full but there may be a limit to how many events the server it is running on can handle. It is likely many tens of thousands though.

** - can I manually clean out the events.txt file and reset the id number? **

You can likely clean out the events.txt file but I don't think you should have to worry about the counter.

Dan O.

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

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