<!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.&nbsp; <br>
<div class="content">
<p>I'm creating an agenda module for 5.x. So far, it only requires the
event module.&nbsp; The module creates a new content type: "agenda".&nbsp; 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.&nbsp; 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>&nbsp; $event = node_load($node-&gt;event_id);
// Load corresponding event node<br>
<br>
&nbsp;&nbsp;&nbsp; if (arg(1) == 'add' || arg(1) == 'ognodeadd') {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $form['event_start'] = array(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#type' =&gt; 'fieldset',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#title' =&gt; t('Start date'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#weight' =&gt; -15<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $form['event_start']['date'] =
event_form_date($event-&gt;event_start, 'start',
$event-&gt;start_offset);<br>
&nbsp;&nbsp;&nbsp; }</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.&nbsp; I know the hook itself (agenda_form) is working because
other code does work:<br>
<br>
&nbsp; if (arg(1) == 'add' || arg(1) == 'ognodeadd') {<br>
&nbsp;&nbsp;&nbsp; $form['title'] = array(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#type' =&gt; 'textfield',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#title' =&gt; t('Title'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#required' =&gt; true,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#default_value' =&gt; theme('agenda_default_title', $event),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#weight' =&gt; -5<br>
&nbsp;&nbsp;&nbsp; );<br>
&nbsp; } else {<br>
&nbsp;&nbsp;&nbsp; $form['title'] = array(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#type' =&gt; 'textfield',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#title' =&gt; t('Title'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#required' =&gt; true,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#default_value' =&gt; $node-&gt;title,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#weight' =&gt; -5<br>
&nbsp;&nbsp;&nbsp; );<br>
&nbsp; }<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.&nbsp; 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 &amp; B Salsa                      <a class="moz-txt-link-freetext" href="http://www.randbsalsa.com">http://www.randbsalsa.com</a>
</pre>
</body>
</html>