Index: trunk/LATMOS-Accounts/Changes
===================================================================
--- trunk/LATMOS-Accounts/Changes	(revision 2412)
+++ trunk/LATMOS-Accounts/Changes	(revision 2413)
@@ -1,3 +1,5 @@
 6.1.2
+    # WARNING: database schema need to be upgraded
+
     - Fix: account export when employment end later
     - Fix ACL, replace $ROOT by @ROOT: '$' has special meaning here
@@ -15,4 +17,5 @@
     - always try to create missing object in destination (regardless recent changes)
     - Fix: dynamics attributes not properly compute after object creation
+    - add support objects (hardare support contact)
 
 6.1.1
Index: trunk/LATMOS-Accounts/MANIFEST
===================================================================
--- trunk/LATMOS-Accounts/MANIFEST	(revision 2412)
+++ trunk/LATMOS-Accounts/MANIFEST	(revision 2413)
@@ -74,4 +74,5 @@
 lib/LATMOS/Accounts/Bases/Ldap/Aliases.pm
 lib/LATMOS/Accounts/Bases/Ldap/Group.pm
+lib/LATMOS/Accounts/Bases/Ldap/Groupofnames.pm
 lib/LATMOS/Accounts/Bases/Ldap/Onlyaddress.pm
 lib/LATMOS/Accounts/Bases/Ldap/User.pm
@@ -94,4 +95,5 @@
 lib/LATMOS/Accounts/Bases/Sql/Employmentsummary.pm
 lib/LATMOS/Accounts/Bases/Sql/Group.pm
+lib/LATMOS/Accounts/Bases/Sql/Groupofnames.pm
 lib/LATMOS/Accounts/Bases/Sql/Nethost.pm
 lib/LATMOS/Accounts/Bases/Sql/Netzone.pm
@@ -101,4 +103,5 @@
 lib/LATMOS/Accounts/Bases/Sql/Site.pm
 lib/LATMOS/Accounts/Bases/Sql/Stat.pm
+lib/LATMOS/Accounts/Bases/Sql/Support.pm
 lib/LATMOS/Accounts/Bases/Sql/Sutype.pm
 lib/LATMOS/Accounts/Bases/Sql/Templates.pm
Index: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm
===================================================================
--- trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm	(revision 2412)
+++ trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm	(revision 2413)
@@ -18,5 +18,5 @@
 our $VERSION = (q$Rev$ =~ /^Rev: (\d+) /)[0];
 
-sub SCHEMA_VERSION { 37 };
+sub SCHEMA_VERSION { 38 };
 
 =head1 NAME
Index: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Nethost.pm
===================================================================
--- trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Nethost.pm	(revision 2412)
+++ trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Nethost.pm	(revision 2413)
@@ -268,5 +268,8 @@
                 label => l('Locked'),
             },
-
+            support => {
+                reference => 'support',
+                label => l('Support'),
+            },
         }
     )
Index: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Support.pm
===================================================================
--- trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Support.pm	(revision 2413)
+++ trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Support.pm	(revision 2413)
@@ -0,0 +1,78 @@
+package LATMOS::Accounts::Bases::Sql::Support;
+
+use 5.010000;
+use strict;
+use warnings;
+
+use base qw(LATMOS::Accounts::Bases::Sql::objects);
+use LATMOS::Accounts::Log;
+use LATMOS::Accounts::Utils;
+use LATMOS::Accounts::I18N;
+use Net::IP;
+
+our $VERSION = (q$Rev: 2104 $ =~ /^Rev: (\d+) /)[0];
+
+=head1 NAME
+
+LATMOS::Accounts::Bases::Sql::Nethost - A Network Host entry
+
+=cut
+
+sub _object_table { 'support' }
+
+sub _key_field { 'name' }
+
+sub _has_extended_attributes { 1 }
+
+sub _get_attr_schema {
+    my ($class, $base) = @_;
+
+    $class->SUPER::_get_attr_schema($base,
+        {
+            name    => { ro => 1, inline => 1, },
+            cn      => { ro => 1, inline => 1, iname => 'name' },
+            date    => { ro => 1, inline => 1, },
+            create  => { ro => 1, inline => 1, },
+            exported => { formtype => 'CHECKBOX', },
+            comment => {
+                label => l('Comment'),
+            },
+            description => {
+                label => l('Description'),
+            },
+            address => {
+                label => l('Address'),
+                formtype => 'TEXTAREA',
+            },
+            phone => {
+                label => l('Phone'),
+            },
+            mail => {
+                label => l('Mail'),
+            }
+        }
+    )
+}
+
+1;
+
+__END__
+
+=head1 SEE ALSO
+
+L<LATMOS::Accounts::Bases::Sql::Netzones>, L<LATMOS::Accounts::Bases::Sql>
+
+=head1 AUTHOR
+
+Olivier Thauvin, E<lt>olivier.thauvin@latmos.ipsl.frE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2008, 2009, 2010, 2011, 2012 CNRS SA/CETP/LATMOS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.10.0 or,
+at your option, any later version of Perl 5 you may have available.
+
+
+=cut
Index: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/upgrade.pm
===================================================================
--- trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/upgrade.pm	(revision 2412)
+++ trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/upgrade.pm	(revision 2413)
@@ -1351,4 +1351,165 @@
             ],
         },
+        {
+            ver => 38,
+            sql => [
+                q{
+
+                CREATE TABLE public.support
+                (
+                  CONSTRAINT support_pkey PRIMARY KEY (name),
+                  CONSTRAINT support_ikey_uniq UNIQUE (ikey)
+                )
+                INHERITS (public.objects)
+                WITH (
+                  OIDS=FALSE
+                );
+                ALTER TABLE public.support
+                  OWNER TO latmos;
+
+
+                CREATE TRIGGER support_update_rev_tg
+                  BEFORE INSERT OR UPDATE OR DELETE
+                  ON public.support
+                  FOR EACH ROW
+                  EXECUTE PROCEDURE public.rev_tg_f();
+
+
+                CREATE TABLE public.support_attributes
+                (
+                  CONSTRAINT support_attributes_pkey PRIMARY KEY (attr_key),
+                  CONSTRAINT support_attr_support_okey_fkey FOREIGN KEY (okey)
+                      REFERENCES public.support (ikey) MATCH SIMPLE
+                      ON UPDATE CASCADE ON DELETE CASCADE
+                )
+                INHERITS (public.attributes)
+                WITH (
+                  OIDS=FALSE
+                );
+
+                CREATE OR REPLACE FUNCTION public.support_attr_update_ref()
+                  RETURNS trigger AS
+                $BODY$begin
+
+                IF (TG_OP != 'INSERT') then
+                update "support" set date = now() where "support".ikey = old.okey;
+                end if;
+                IF (TG_OP != 'DELETE') then
+                update "support"  set date = now() where "support".ikey = new.okey;
+                end if;
+
+                IF (TG_OP = 'DELETE') then
+                  return old;
+                ELSE
+                  return new;
+                END IF;
+
+                END;$BODY$
+                  LANGUAGE plpgsql VOLATILE
+                  COST 100;
+
+                CREATE INDEX fki_support_attributes_attr_fkey
+                  ON public.support_attributes
+                  USING btree
+                  (attr COLLATE pg_catalog."default");
+
+                CREATE INDEX support_attr_value_idx
+                  ON public.support_attributes
+                  USING btree
+                  (value COLLATE pg_catalog."default");
+
+                  CREATE TRIGGER support_attr_update
+                  AFTER INSERT OR UPDATE OR DELETE
+                  ON public.support_attributes
+                  FOR EACH ROW
+                  EXECUTE PROCEDURE public.support_attr_update_ref();
+
+                CREATE TABLE public.nethost_attributes_supports
+                (
+                  CONSTRAINT nethost_attributes_support_pkey PRIMARY KEY (attr_key),
+                  CONSTRAINT nethost_attr_support_okey_fkey FOREIGN KEY (okey)
+                      REFERENCES public.nethost (ikey) MATCH SIMPLE
+                      ON UPDATE CASCADE ON DELETE CASCADE,
+                  CONSTRAINT nethost_attributes_support_support_fkey FOREIGN KEY (value)
+                      REFERENCES public."support" (name) MATCH SIMPLE
+                      ON UPDATE CASCADE ON DELETE CASCADE,
+                  CONSTRAINT nethost_attributes_support_uniq UNIQUE (okey, attr, value)
+                )
+                INHERITS (public.nethost_attributes)
+                WITH (
+                  OIDS=FALSE
+                );
+
+                CREATE INDEX fki_nethost_attr_support_okey_fkey
+                  ON public.nethost_attributes_supports
+                  USING btree
+                  (okey);
+
+                CREATE INDEX fki_nethost_attributes_support_attr_fkey
+                  ON public.nethost_attributes_supports
+                  USING btree
+                  (attr COLLATE pg_catalog."default");
+
+
+                CREATE INDEX fki_nethost_attributes_support_support_fkey
+                  ON public.nethost_attributes_supports
+                  USING btree
+                  (value COLLATE pg_catalog."default");
+
+                CREATE TRIGGER nethost_attributes_support_update_ref
+                  AFTER INSERT OR UPDATE OR DELETE
+                  ON public.nethost_attributes_supports
+                  FOR EACH ROW
+                  EXECUTE PROCEDURE public.nethost_attr_update_ref();
+
+                CREATE OR REPLACE FUNCTION public.nethost_sort_fields()
+                  RETURNS trigger AS
+                $BODY$BEGIN
+
+                              IF (TG_OP='INSERT') then
+                              IF (new.attr='ip') THEN
+                              insert into nethost_attributes_ips VALUES (new.*);
+                              RETURN NULL;
+                              END IF;
+
+                              IF (new.attr='macaddr') THEN
+                              insert into nethost_attributes_macs VALUES (new.*);
+                              RETURN NULL;
+                              END IF;
+
+                              IF (new.attr='owner') THEN
+                              insert into nethost_attributes_users VALUES (new.*);
+                              RETURN NULL;
+                              END IF;
+
+                              IF (new.attr='user') THEN
+                              insert into nethost_attributes_users VALUES (new.*);
+                              RETURN NULL;
+                              END IF;
+
+                          IF (new.attr='related') THEN
+                              insert into nethost_attributes_nethosts VALUES (new.*);
+                              RETURN NULL;
+                              END IF;
+
+                          IF (new.attr='support') THEN
+                              insert into nethost_attributes_supports VALUES (new.*);
+                              RETURN NULL;
+                              END IF;
+
+                              end if;
+
+                              if (TG_OP='DELETE') THEN
+                              RETURN old;
+                              else
+                              RETURN new;
+                              end if;
+                              END;$BODY$
+                  LANGUAGE plpgsql VOLATILE
+                  COST 100;
+
+                }
+            ],
+        },
     );
 
