<?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}Users{/t}" default_view="display" orderby="username" order="asc" limit="20" trigger_edit="increase_pwdexpire|createedituser|notify" trigger_new="runxml:modules/core/users.xml:home|createuser|notify" trigger_delete="deleteuser" enable_new="true" enable_edit="true" enable_delete="true" enable_empty="true" quick_add="username,password,email,firstname,lastname">
  <view name="display" displayname="{t}Active{/t}" where="activated=1">
  </view>
  <view name="display2" displayname="{t}Inactive{/t}" where="activated=0 and self_registration=0" template="display">
  </view>
  <view name="unconfirmed" displayname="{t}Unconfirmed{/t}" where="activated=0 and self_registration=1" template="display">
  </view>
  <view name="details" displayname="{t}Details{/t}" image_width="200" image_height="100" tfield_1="username" show_preview="true">
  </view>
  <view name="calendar" displayname="{t}Calendar{/t}" schema="sys_nodb_calendar_users" enable_calendar="true">
  </view>
  <view name="changepwd" displayname="{t}Change settings{/t}" where="username=@username@" template="edit" schema_mode="edit" visibility="bottom" disable_tabs="true" showonly="id|username|password|status|cal_day_begin|cal_day_end|timezone|folder">
  </view>
  <singlebutton name="deactivate" displayname="{t}Deactivate{/t}" onclick="asset_update_confirm({activated:'0'},'@id@');" condition="activated|neq|0" right="write" icon="disabled.gif" />
  <singlebutton name="activate" displayname="{t}Activate{/t}" onclick="asset_update_confirm({activated:'1'},'@id@');" condition="activated|neq|1" right="write" icon="enabled.gif" />

  <tab name="general" displayname="{t}General{/t}" />
  <tab name="organisation" displayname="{t}Organisation{/t}" />
  <tab name="miscellaneous" displayname="{t}Miscellaneous{/t}" />
  <tab name="account" displayname="{t}Account{/t}" />

  <field name="username" displayname="{t}Username{/t}" simple_type="text" simple_tab="general" required="true" is_unique_with_trash="true">
    <validate function="username"/>
    <readonlyin views="edit|changepwd"/>
    <linktext views="display|display2" value="#index.php?view=details&amp;iframe=1&amp;item[]=@id@"/>
  </field>
  <field name="password" displayname="{t}Password{/t}" simple_type="password" simple_tab="general" required="true" disable_ccp="true">
    <onlyin views="new|edit|edit_as_new|changepwd" />
	<restore views="edit_as_new" function="empty_str"/>
  </field>
  <field name="email" displayname="{t}E-mail{/t}" simple_type="text" simple_tab="general" is_unique="true" required="true">
    <validate function="email"/>
    <link value="@ext/norefer.php?url=@email@" icon="link_mail.gif"/>
  </field>
  <field name="firstname" displayname="{t}First name{/t}" simple_type="text" simple_tab="general">
  </field>
  <field name="lastname" displayname="{t}Last name{/t}" simple_type="text" simple_tab="general">
  </field>
  <field name="phone" displayname="{t}Phone{/t}" simple_type="text" simple_tab="general">
    <link value="sip:@phone@" icon="phone.gif"/>
  </field>
  <field name="status" displayname="{t}Status{/t}" simple_type="select" simple_size="1" simple_tab="general">
    <data values="{t}online{/t}|{t}offline{/t}|{t}out of office{/t}"/>
    <notin views="new|edit_as_new"/>
  </field>
  <field name="department" displayname="{t}Department{/t}" simple_type="select" simple_size="1" simple_tab="organisation">
    <data function="dbselect|simple_departments|departmentname,departmentname||departmentname asc|10"/>
	<link value="index.php?find=asset|simple_departments||departmentname=@department@&amp;view=display"/>
  </field>
  <field name="position" displayname="{t}Position{/t}" simple_type="select" simple_size="1" simple_tab="organisation">
    <data function="dbselect|simple_positions|positionname,positionname||positionname asc|10"/>
	<link value="index.php?find=asset|simple_positions||positionname=@position@&amp;view=display"/>
  </field>
  <field name="location" displayname="{t}Location{/t}" simple_type="select" simple_size="1" simple_tab="organisation">
    <data function="dbselect|simple_locations|locationname,locationname||locationname asc|10" />
    <notin views="display|display2"/>
	<link value="index.php?find=asset|simple_locations||locationname=@location@&amp;view=display"/>
  </field>
  <field name="secretary" displayname="{t}Secretary{/t}" simple_type="select" simple_tab="organisation">
    <data function="dbselect|simple_sys_users|username,concat(lastname;' ';firstname)||lastname asc|10"/>
    <notin views="display|display2"/>
	<link value="index.php?find=asset|simple_sys_users||username=@secretary@&amp;view=details"/>
  </field>
  <field name="mobile" displayname="{t}Mobile{/t}" simple_type="text" simple_tab="organisation">
  </field>
  <field name="pager" displayname="{t}Pager{/t}" simple_type="text" simple_tab="organisation">
  </field>
  <field name="skype" displayname="Skype" simple_type="text" simple_tab="organisation">
    <link value="skype:@skype@?userinfo" icon="phone.gif"/>
  </field>
  <field name="fax" displayname="{t}Fax{/t}" simple_type="text" simple_tab="organisation">
  </field>
  <field name="anniversary" displayname="{t}Anniversary{/t}" simple_type="date" simple_tab="organisation">
    <filter views="all" function="dateformat||{t}m/d/Y{/t}"/>
  </field>
  <field name="gender" displayname="{t}Gender{/t}" simple_type="select" simple_size="1" simple_tab="organisation">
    <data values="{t}male{/t}|{t}female{/t}"/>
  </field>
  <field name="birthday" displayname="{t}Birthday{/t}" simple_type="date" simple_tab="miscellaneous">
    <filter views="all" function="dateformat||{t}m/d/Y{/t}"/>
  </field>
  <field name="familystatus" displayname="{t}Family status{/t}" simple_type="select" simple_size="1" simple_tab="miscellaneous">
    <data values="{t}single{/t}|{t}engaged{/t}|{t}married{/t}|{t}divorced{/t}|{t}widowed{/t}"/>
  </field>
  <field name="emailprivate" displayname="{t}E-mail private{/t}" simple_type="text" simple_tab="miscellaneous">
    <validate function="email"/>
    <notin views="display"/>
  </field>
  <field name="phoneprivate" displayname="{t}Phone private{/t}" simple_type="text" simple_tab="miscellaneous">
    <link value="sip:@phoneprivate@" icon="phone.gif"/>
  </field>
  <field name="homepage" displayname="{t}Homepage{/t}" simple_type="text" simple_tab="miscellaneous">
    <validate function="url"/>
    <notin views="display"/>
    <filter views="display" function="truncate|20"/>
    <link value="@ext/norefer.php?url=@homepage@"/>
  </field>
  <field name="street" displayname="{t}Street{/t}" simple_type="text" simple_tab="miscellaneous">
    <link value="@ext/norefer.php?url=http://maps.google.com/maps?q=@zipcode@ @city@ @street@ @country@"/>
  </field>
  <field name="zipcode" displayname="{t}Zipcode{/t}" simple_type="text" simple_tab="miscellaneous">
  </field>
  <field name="city" displayname="{t}City{/t}" simple_type="text" simple_tab="miscellaneous">
  </field>
  <field name="state" displayname="{t}State{/t}" simple_type="text" simple_tab="miscellaneous">
  </field>
  <field name="country" displayname="{t}Country{/t}" simple_type="text" simple_tab="miscellaneous">
  </field>
  <field name="jobdesc" displayname="{t}Job description{/t}" simple_type="textarea" simple_tab="miscellaneous">
    <notin views="display|display2"/>
  </field>
  <field name="superior" displayname="{t}Superior{/t}" simple_type="select" simple_size="1" simple_tab="account">
    <data function="dbselect|simple_sys_users|username,concat(lastname;' ';firstname)||lastname asc|10"/>
    <notin views="display|display2"/>
	<link value="index.php?find=asset|simple_sys_users||username=@superior@&amp;view=details"/>
  </field>
  <field name="image" displayname="{t}Image{/t}" simple_type="files" simple_file_size="5M" simple_size="10">
    <notin views="display|display2"/>
    <validate function="fileupload|jpg,jpeg,gif,png"/>
  </field>
  <field name="cvitae" displayname="{t}Curriculum vitae{/t}" simple_type="files" simple_file_size="10M" simple_size="10">
    <notin views="display|display2"/>
    <validate function="fileupload|doc,pdf,sxw,txt"/>
  </field>
  <field name="expires" displayname="{t}Expires{/t}" simple_type="date" simple_default="today +1 year" simple_tab="account">
    <filter views="all" function="dateformat||{t}m/d/Y{/t}"/>
	<description hint="{t}Relative formats{/t}" value="nWin('http://www.php.net/manual/en/datetime.formats.relative.php');"/>
  </field>
  <field name="neverexp" displayname="{t}Never expires{/t}" simple_type="checkbox" simple_default="1" simple_tab="account">
  </field>
  <field name="pwdexpires" displayname="{t}Password expires{/t}" simple_type="date" simple_default="today +3 months" simple_tab="account">
    <filter views="all" function="dateformat||{t}m/d/Y{/t}"/>
  </field>
  <field name="activated" displayname="{t}Activated{/t}" simple_type="checkbox" simple_default="1" simple_tab="account">
    <INDEX/>
  </field>
  <field name="home_folder" displayname="{t}Home folder id{/t}" simple_type="text" simple_tab="account">
  </field>
  <field name="cal_day_begin" displayname="{t}Day begin{/t}" simple_type="time" simple_default_function="dateformat|07:00|{t}g:i a{/t}" simple_tab="account">
    <filter views="all" function="dateformat||{t}g:i a{/t}"/>
  </field>
  <field name="cal_day_end" displayname="{t}Day end{/t}" simple_type="time" simple_default_function="dateformat|18:00|{t}g:i a{/t}" simple_tab="account">
    <filter views="all" function="dateformat||{t}g:i a{/t}"/>
  </field>
  <field name="timezone" displayname="{t}Time zone{/t}" simple_type="select" simple_size="1" simple_tab="account">
    <data function="timezones"/>
  </field>
  <field name="enabled_modules" displayname="{t}Allow disabled modules{/t}" simple_type="select" simple_size="5" simple_tab="account">
    <data function="disabled_modules"/>
  </field>
  <field name="smtp" displayname="SMTP" simple_type="text" simple_tab="account" no_search_index="true" disable_ccp="true">
	<restore views="edit_as_new" function="empty_str"/>
    <onlyin views="new|edit|edit_as_new" />
	<description title="{t}Help{/t}" value="
alert('
{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}
');"/>
  </field>
  <field name="self_registration" simple_type="checkbox" simple_default="0" hidden="true">
  </field>
</table>