<?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}Department{/t}" default_view="display" orderby="departmentname" order="asc" limit="20" enable_new="true" enable_edit="true" enable_delete="true" enable_empty="true"
 trigger_new="runxml:modules/core/departments.xml:departments|createeditdepartment" trigger_edit="createeditdepartment" trigger_delete="deletedepartment" quick_add="departmentname,members">
  <view name="display" displayname="{t}Display{/t}">
  </view>
  <view name="details" displayname="{t}Details{/t}" tfield_1="departmentname">
  </view>
  <!--
  <singlebutton name="folder" displayname="{t}Folders{/t}" onclick="locate('index.php?folder=^departments_@departmentname@');" icon="folder1.gif" />
  -->

  <field name="departmentname" displayname="{t}Department{/t}" simple_type="text" is_unique="true" required="true">
    <validate function="regexp|/^[a-z0-9-_@\.]{3,128}$/|{t}Name 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@"/>
    <readonlyin views="edit"/>
  </field>
  <field name="office" displayname="{t}Office{/t}" simple_type="select" simple_size="1">
    <data function="dbselect|simple_offices|officename,officename||officename asc|10"/>
	<link value="index.php?find=asset|simple_offices||officename=@office@&amp;view=display"/>
  </field>
  <field name="manager" displayname="{t}Manager{/t}" simple_type="select" simple_size="1">
    <data function="dbselect|simple_sys_users|username,concat(lastname;' ';firstname)||lastname asc|10"/>
	<link value="index.php?find=asset|simple_sys_users||username=@manager@&amp;view=details"/>
  </field>
  <field name="sndmanager" displayname="{t}Second manager{/t}" simple_type="select" simple_size="1">
    <data function="dbselect|simple_sys_users|username,concat(lastname;' ';firstname)||lastname asc|10"/>
	<link value="index.php?find=asset|simple_sys_users||username=@sndmanager@&amp;view=details"/>
  </field>
  <field name="members" displayname="{t}Members{/t}" simple_type="select" simple_size="5">
    <data function="dbselect|simple_sys_users|username,concat(lastname;' ';firstname)||lastname asc|10"/>
	<link value="index.php?find=asset|simple_sys_users||username=@members@&amp;view=details"/>
  </field>
  <field name="description" displayname="{t}Description{/t}" simple_type="textarea">
	<notin views="display" />
  </field>
</table>