<?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 modulename="{t}Mail identities{/t}" default_view="display" orderby="users" order="asc" limit="20" enable_new="true" enable_edit="true" enable_delete="true" enable_empty="true" disable_quick_add="true">
  <view name="display" displayname="{t}Display{/t}">
  </view>
  <view name="details" displayname="{t}Details{/t}" tfield_1="identityid">
  </view>
  
  <field name="identityid" displayname="{t}Id{/t}" simple_type="text" required="true" is_unique="true">
    <validate function="regexp|/^[a-z0-9-_@\.]{3,128}$/|{t}Id must be not null, lowercase, min 3 characters, max 128 containing [a-z0-9_-@.].{/t}"/>
    <linktext views="display" value="#index.php?view=details&amp;iframe=1&amp;item[]=@id@"/>
  </field>
  <field name="email" displayname="{t}E-mail{/t}" simple_type="text" is_unique="true" required="true">
    <validate function="email"/>
    <link value="@ext/norefer.php?url=@email@" icon="link_mail.gif"/>
  </field>
  <field name="users" displayname="{t}Users{/t}" simple_type="select" required="true">
    <data title="{t}Lookup{/t}" function="dbselect|simple_sys_users|username,concat(lastname;' ';firstname)||lastname asc|10"/>
	<data title="{t}Default{/t}" function="other_users"/>
	<link value="index.php?find=asset|simple_sys_users||username=@users@&amp;view=details"/>
  </field>
  <field name="name" displayname="{t}Name{/t}" simple_type="text">
  </field>
  <field name="smtp" displayname="SMTP" simple_type="text" no_search_index="true" disable_ccp="true">
    <onlyin views="new|edit|edit_as_new" />
	<restore views="edit_as_new" function="empty_str"/>
	<description title="{t}Help{/t}" value="
alert('
{t}If empty, the SMTP connection from the module users will be used.{/t}\n\n
{t}Usage{/t}: username:password[:port[:tls]]@hostname\n
{t}If username or password contains the &quot;@&quot; character, replace it with &quot;%%&quot;.{/t}\n
{t}If username or password contains the &quot;:&quot; character, replace it with &quot;==&quot;.{/t}\n
');"/>
  </field>
  <!-- TODO implement, translate
  <field name="signature" displayname="Signature" simple_type="textarea">
    <notin views="display" />
  </field>
  -->
  <field name="description" displayname="{t}Description{/t}" simple_type="textarea">
    <notin views="display" />
  </field>
</table>