{*
Event details
This Template displays the detailed information for an event
and also offers most of LCCs actions.
Variables assigned by the core:
$data Data of this event as it comes from $event->getData().
This is a associative array containing the fields of the event
$subscribed_yes Array of users that are subscribed with "yes"
$subscribed_no Array of users that are subscribed with "no"
$subscribed_unknown Array of users that are subscribed with "unknown"
*}
{* Fetch the UserDriver, so we can get the leaded groups *}
{assign var=LCC_USERDRIVER value=$LCC_CORE->getUserDriverInstance()}
{assign var=groups_leaded value=$LCC_USERDRIVER->getGroupsLeaded($LCC_AUTHED_USER)}
<div class="event_details">
<div class="legend">
<div class="colorbox" style="background:{$data.color}"></div>
{$data.title}
</div>
<div class="field">
<b>{#lcc_event_desc_start_date#}:</b> {$data.event_start|convertDate} {$data.event_start|convertTime}
</div>
<div class="field">
<b>{#lcc_event_desc_end_date#}:</b> {$data.event_end|convertDate} {$data.event_end|convertTime}
</div>
<div class="field">
<b>{#lcc_event_desc_author#}:</b> {$data.author}
</div>
<div class="field">
<b>{#lcc_event_desc_created#}:</b> {$data.created|convertDate} {$data.created|convertTime}
</div>
<div class="field">
<b>{#lcc_event_desc_last_modified_author#}:</b> {$data.last_modified_author}
</div>
<div class="field">
<b>{#lcc_event_desc_last_modified#}:</b> {$data.last_modified|convertDate} {$data.last_modified|convertTime}
</div>
<!-- add your fields here -->
<div class="description">
{$data.description}
</div>
<table class="participations">
<tr>
<th>{#lcc_view_subscribed_yes#}</th>
<th>{#lcc_view_subscribed_no#}</th>
<th>{#lcc_view_subscribed_unknown#}</th>
</tr>
<tr>
<td>{foreach from=$subscribed_yes item=user}<div>{$user}</div>{/foreach}</td>
<td>{foreach from=$subscribed_no item=user}<div>{$user}</div>{/foreach}</td>
<td>{foreach from=$subscribed_unknown item=user}<div>{$user}</div>{/foreach}</td>
</tr>
<tr class="participate_options">
<td>{if $LCC_CORE->checkRight('event_subscribe_yes')}<a href="{$smarty.server.SCRIPT_NAME}?lcc_action=event_subscribe&lcc_id={$data.id}&lcc_interest=yes">{#lcc_link_subscribe_yes#}</a><br>{/if}</td>
<td>{if $LCC_CORE->checkRight('event_subscribe_no')}<a href="{$smarty.server.SCRIPT_NAME}?lcc_action=event_subscribe&lcc_id={$data.id}&lcc_interest=no">{#lcc_link_subscribe_no#}<br></a>{/if}</td>
<td>{if $LCC_CORE->checkRight('event_subscribe_unknown')}<a href="{$smarty.server.SCRIPT_NAME}?lcc_action=event_subscribe&lcc_id={$data.id}&lcc_interest=unknown">{#lcc_link_subscribe_unknown#}</a>{/if}</td>
</tr>
</table>
{if $groups_leaded && ($LCC_CORE->checkRight('event_subscribe_group_yes') || $LCC_CORE->checkRight('event_subscribe_group_no') || $LCC_CORE->checkRight('event_subscribe_group_unknown'))}
<div class="group_subscription">
<div class="caption">{#lcc_subscribe_group#}</div>
<center>
<form action="{$smarty.server.SCRIPT_NAME}" method="GET">
<input type="hidden" name="lcc_action" value="event_subscribe_group">
<input type="hidden" name="lcc_id" value="{$data.id}">
<select name="lcc_group">
{foreach from=$groups_leaded item=groupname}
<option>{$groupname}</option>
{/foreach}
</select>
<select name="lcc_interest">
{if $LCC_CORE->checkRight('event_subscribe_group_yes')}<option value="yes">{#lcc_view_subscribed_yes#}</option>{/if}
{if $LCC_CORE->checkRight('event_subscribe_group_no')}<option value="no">{#lcc_view_subscribed_no#}</option>{/if}
{if $LCC_CORE->checkRight('event_subscribe_group_unknown')}<option value="unknown">{#lcc_view_subscribed_unknown#}</option>{/if}
</select>
<input type="submit" value="{#lcc_subscribe_group#}">
</form>
</center>
</div>
{/if}
{* In this design i decided to display all notes here *}
{if $LCC_CORE->checkRight('note_view')}{$LCC_CORE->performAction('show_notes', $LCC_CORE->buildActionParams('lcc_eventid', $data.id))}{/if}
</div>
<div>
{if $LCC_CORE->checkRight('calendar_view')}<a href="{$smarty.server.SCRIPT_NAME}?lcc_action=show_calendar">{#lcc_link_backtocalendar#}</a>{/if}
{if $LCC_CORE->checkRight('event_mod') || ($LCC_CORE->checkRight('event_mod_own') && $data.author == $LCC_AUTHED_USER)}| <a href="{$smarty.server.SCRIPT_NAME}?lcc_action=edit_event&lcc_id={$data.id}">{#lcc_link_editthisevent#}</a>{/if}
{if $LCC_CORE->checkRight('event_del') || ($LCC_CORE->checkRight('event_del_own') && $data.author == $LCC_AUTHED_USER)}| <a href="{$smarty.server.SCRIPT_NAME}?lcc_action=delete_event&lcc_id={$data.id}">{#lcc_link_deletethisevent#}</a>{/if}
{if $LCC_CORE->checkRight('note_add') || ($LCC_CORE->checkRight('note_add_own') && $data.author == $LCC_AUTHED_USER)} | <a href="{$smarty.server.SCRIPT_NAME}?lcc_action=edit_note&lcc_eventid={$data.id}">{#lcc_link_addnote#}</a>{/if}
</div>