<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
  <title>aC forum: Help about adding new combo in Tickets</title>
  <link>http://www.activecollab.com/forums/topic/2546/</link>
  <description>Recent posts on topic: Help about adding new combo in Tickets</description>
  <dc:language>en-us</dc:language>
  <pubDate>Mon, 01 Dec 2008 17:49:23 UTC</pubDate>
  
  <item>
    <link>http://www.activecollab.com/forums/post/11962/#post11962</link>
    <guid>http://www.activecollab.com/forums/post/11962/#post11962</guid>
    <title>Post #5 by ipedja</title>
    <dc:creator>ipedja</dc:creator>
    <description><![CDATA[<p>Brilliant! <br />
<br />
Everything works fine, thank you...</p>]]></description>
    <pubDate>Wed, 27 Feb 2008 14:02:54 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/11960/#post11960</link>
    <guid>http://www.activecollab.com/forums/post/11960/#post11960</guid>
    <title>Post #4 by Ilija Studen</title>
    <dc:creator>Ilija Studen</dc:creator>
    <description><![CDATA[<p>Create function (with additional field) in Ticket class:<br />
<br />
<pre name="code" class="php">var $employee = false;

function getEmployee() {
  if($this-&gt;employee === false) {
    $this-&gt;employee =  Users::findById($this-&gt;getEmployeeId());
  }
  return $this-&gt;employee;
}</pre><br />
<br />
in template you would use something like this:<br />
<br />
<pre name="code" class="html">{if instance_of($ticket-&gt;getEmployee(), 'User')}
  {user_link user=$ticket-&gt;getEmployee()}
{else}
  -- Unknown User --
{/if}</pre></p>]]></description>
    <pubDate>Wed, 27 Feb 2008 13:09:55 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/11959/#post11959</link>
    <guid>http://www.activecollab.com/forums/post/11959/#post11959</guid>
    <title>Post #3 by ipedja</title>
    <dc:creator>ipedja</dc:creator>
    <description><![CDATA[<p>Thank you, it worked.<br />
<br />
What if I wanted to display this Emplyee on main Tickets page (index.tpl). I managed to display ID:<br />
<br />
<pre name="code" class="html">&lt;tbody&gt;
{foreach from=$tickets_by_milestone.objects item=ticket}
  &lt;tr class=&quot;ticket {cycle values='odd,even'}&quot; id=&quot;ticket{$ticket-&gt;getId()}&quot;&gt;
    &lt;td class=&quot;star&quot;&gt;{object_star object=$ticket user=$logged_user}&lt;/td&gt;
    &lt;td class=&quot;priority&quot;&gt;{object_priority object=$ticket}&lt;/td&gt;
    &lt;td class=&quot;ticket_id&quot;&gt;#{$ticket-&gt;getTicketId()}&lt;/td&gt;
    &lt;td class=&quot;korisnik_id&quot;&gt;#{$ticket-&gt;getEmplyeeId()}&lt;/td&gt;
    &lt;td class=&quot;name&quot;&gt;&lt;a href=&quot;{$ticket-&gt;getViewUrl()}&quot;&gt;{$ticket-&gt;getName()|clean}&lt;/h3&gt;
    &lt;/td&gt;
    &lt;td class=&quot;checkbox&quot;&gt;&lt;input type=&quot;checkbox&quot; name=&quot;tickets[]&quot; value=&quot;{$ticket-&gt;getId()}&quot; class=&quot;auto&quot; /&gt;&lt;/td&gt;
  &lt;/tr&gt;</pre><br />
<br />
but of course that is not realy usable. Can someone help me about some kind of getEmployeeName() function...</p>]]></description>
    <pubDate>Wed, 27 Feb 2008 12:42:31 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/11957/#post11957</link>
    <guid>http://www.activecollab.com/forums/post/11957/#post11957</guid>
    <title>Post #2 by Ilija Studen</title>
    <dc:creator>Ilija Studen</dc:creator>
    <description><![CDATA[<p>Open TicketsController and in edit() action see how initial form data is set:<br />
<br />
<pre name="code" class="php">$ticket_data = $this-&gt;request-&gt;post('ticket');
if(!is_array($ticket_data)) {
  $ticket_data = array(
    'name' =&gt; $this-&gt;active_ticket-&gt;getName(),
    'body' =&gt; $this-&gt;active_ticket-&gt;getBody(),
    'visibility' =&gt; $this-&gt;active_ticket-&gt;getVisibility(),
    'parent_id' =&gt; $this-&gt;active_ticket-&gt;getParentId(),
    'milestone_id' =&gt; $this-&gt;active_ticket-&gt;getMilestoneId(),
    'priority' =&gt; $this-&gt;active_ticket-&gt;getPriority(),
    'assignees' =&gt; Assignments::findAssignmentDataByObject($this-&gt;active_ticket),
    'tags' =&gt; $this-&gt;active_ticket-&gt;getTags(),
    'due_on' =&gt; $this-&gt;active_ticket-&gt;getDueOn(),
  );
} // if
$this-&gt;smarty-&gt;assign('ticket_data', $ticket_data);</pre><br />
<br />
Just add your field value to associative array and proper value should be selected in the form. Data from this array is available as $ticket_data in templates.</p>]]></description>
    <pubDate>Wed, 27 Feb 2008 08:27:44 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/11956/#post11956</link>
    <guid>http://www.activecollab.com/forums/post/11956/#post11956</guid>
    <title>Post #1 by ipedja</title>
    <dc:creator>ipedja</dc:creator>
    <description><![CDATA[<p>CAUTION!!!  I am a PHP lamer.<br />
<br />
OK, here it goes. We desperately needed information about employee (user either from Owner company or Client companies) when adding a Ticket. I managed to add a combo, it is bound with Users over integer_field_2. Problem is that later when I try to EDIT ticket (Add works fine, I checked in DB) combo won't refresh with correct data. It is always first record (user).</p>]]></description>
    <pubDate>Wed, 27 Feb 2008 07:44:17 UTC</pubDate>
  </item>
</channel>
</rss>