<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I've posted this in Forums, but doesn't look like I'm going to get a
response, and I'm pretty sure someone here knows this right off the
bat. <br>
<div class="content">
<p>I'm creating an agenda module for 5.x. So far, it only requires the
event module. The module creates a new content type: "agenda". It is
set to appear in all calendars (for now) so has event start and end
date fields associated with it.<br>
</p>
<>To use it, I create
an event node, then the module allows me to create an agenda node that
corresponds to the event node.
The agenda content type has start/end date fields. I do not have
jscalendar.module installed. I wish to pass the start and end dates of
the corresponding event node to the agenda node automatically.</>
<p>I'm currently trying to use the following code in <b>hook_form</b>,
which I modified from the event_form_alter() function:<br>
</p>
<div class="codeblock"><code> $event = node_load($node->event_id);
// Load corresponding event node<br>
<br>
if (arg(1) == 'add' || arg(1) == 'ognodeadd') {<br>
$form['event_start'] = array(<br>
'#type' => 'fieldset',<br>
'#title' => t('Start date'),<br>
'#weight' => -15<br>
);<br>
$form['event_start']['date'] =
event_form_date($event->event_start, 'start',
$event->start_offset);<br>
}</code></div>
<br>
But, nothing is coming through. I still get the default time when
creating a new agenda node, and not the time from the corresponding
event node. I know the hook itself (agenda_form) is working because
other code does work:<br>
<br>
if (arg(1) == 'add' || arg(1) == 'ognodeadd') {<br>
$form['title'] = array(<br>
'#type' => 'textfield',<br>
'#title' => t('Title'),<br>
'#required' => true,<br>
'#default_value' => theme('agenda_default_title', $event),<br>
'#weight' => -5<br>
);<br>
} else {<br>
$form['title'] = array(<br>
'#type' => 'textfield',<br>
'#title' => t('Title'),<br>
'#required' => true,<br>
'#default_value' => $node->title,<br>
'#weight' => -5<br>
);<br>
}<br>
<br>
I have tried other ways of doing it suggested here:<br>
<p><a href="http://drupal.org/node/46805"
title="http://drupal.org/node/46805">http://drupal.org/node/46805</a></p>
<p><a href="http://drupal.org/node/150391"
title="http://drupal.org/node/150391">http://drupal.org/node/150391</a></p>
But, nothing seems to be working for me. Can someone please help me
with this? </div>
<br>
-ron<br>
<pre class="moz-signature" cols="72">--
Ron Parker
Software Creations <a class="moz-txt-link-freetext" href="http://www.scbbs.com">http://www.scbbs.com</a>
Self-Administration Web Site <a class="moz-txt-link-freetext" href="http://saw.scbbs.com">http://saw.scbbs.com</a>
SDSS Subscription Mgmt Service <a class="moz-txt-link-freetext" href="http://sdss.scbbs.com">http://sdss.scbbs.com</a>
Central Ave Dance Ensemble <a class="moz-txt-link-freetext" href="http://www.centralavedance.com">http://www.centralavedance.com</a>
R & B Salsa <a class="moz-txt-link-freetext" href="http://www.randbsalsa.com">http://www.randbsalsa.com</a>
</pre>
</body>
</html>