<?xml version="1.0" encoding="utf-8"?>
<!--
	/**************************************************************************\
	* Simple Groupware 0.724                                                   *
	* http://www.simple-groupware.de                                           *
	* Copyright (C) 2002-2011 by Thomas Bley                                   *
	* ------------------------------------------------------------------------ *
	*  This program is free software; you can redistribute it and/or           *
	*  modify it under the terms of the GNU General Public License Version 2   *
	*  as published by the Free Software Foundation; only version 2            *
	*  of the License, no later version.                                       *
	*                                                                          *
	*  This program is distributed in the hope that it will be useful,         *
	*  but WITHOUT ANY WARRANTY; without even the implied warranty of          *
	*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
	*  GNU General Public License for more details.                            *
	*                                                                          *
	*  You should have received a copy of the GNU General Public License       *
	*  Version 2 along with this program; if not, write to the Free Software   *
	*  Foundation, Inc., 59 Temple Place - Suite 330, Boston,                  *
	*  MA  02111-1307, USA.                                                    *
	\**************************************************************************/
-->
<table custom_name="
(select b.*,concat('{t}Birthday{/t}: ';firstname;' ';lastname;' ';username) as subject,
		86399 as duration,0 as repeatuntil,birthday as begin,(birthday+86399) as ending,1 as allday,
		'years' as recurrence,0 as until,1 as repeatinterval,0 as repeatcount,'' as repeatexcludes,
		0 as repeatbegin,365 as repeatend from simple_sys_users b where activated=1 and birthday!=0
union all
select a.*,concat('{t}Anniversary{/t}: ';firstname;' ';lastname;' ';username) as subject,
		86399 as duration,0 as repeatuntil,anniversary as begin,(anniversary+86399) as ending,1 as allday,
		'years' as recurrence,0 as until,1 as repeatinterval,0 as repeatcount,'' as repeatexcludes,
		0 as repeatbegin,365 as repeatend from simple_sys_users a where activated=1 and anniversary!=0
) p" modulename="{t}Calendar{/t}" default_view="display" orderby="begin" order="asc" limit="20" enable_calendar="begin,ending,recurrence,until,allday,repeatinterval,repeatexcludes,repeatbegin,repeatend">
  <view name="display" template="display" markdate="month">
  </view>
  <tab name="general" />

  <field name="subject" displayname="{t}Subject{/t}" simple_type="text" required="true">
    <linktext views="display" value="index.php?view=details&amp;item[]=@id@"/>
  </field>
  <field name="begin" displayname="{t}Birthday{/t}" simple_type="datetime" simple_default_function="dateformat_request|begin|now|{t}m/d/Y g:i a{/t}" required="true" nowrap="true">
    <filter views="all" function="shortdatetimeformat"/>
    <link value="index.php?view=calendar&amp;today=@begin@"/>
  </field>
  <field name="ending" simple_type="datetime" hidden="true">
  </field>
  <field name="duration" simple_type="int" hidden="true">
  </field>
  <field name="allday" simple_type="checkbox" hidden="true">
  </field>
  <field name="recurrence" simple_type="select" hidden="true">
  </field>
  <field name="repeatinterval" simple_type="int" hidden="true">
  </field>
  <field name="repeatcount" simple_type="int" hidden="true">
  </field>
  <field name="repeatuntil" simple_type="date" hidden="true">
  </field>
  <field name="repeatexcludes" simple_type="dateselect" hidden="true">
  </field>
  <field name="until" simple_type="id" hidden="true">
  </field>
</table>