Project/Open Core : Offices
Project/Open Core

Offices

Offices represent physical locations associated with customers. There's not a lot of magic to offices...

Officepermissions are managed using membership of the "admin_group" similar to projects.

create table im_offices (
        office_id               integer
                                constraint im_offices_office_id_pk
                                primary key
                                constraint im_offices_office_id_fk
                                references acs_objects,
                                -- avoid using the OpenACS permission system
                                -- because we have to ask frequently:
                                -- "Who has read permissions on this object".
        admin_group_id          integer not null
                                constraint im_offices_admin_group_fk
                                references groups,
        office_name             varchar(1000) not null
                                constraint im_offices_name_un unique,
        office_path             varchar(100) not null
                                constraint im_offices_path_un unique,
        office_status_id        integer not null
                                constraint im_offices_cust_stat_fk
                                references categories,
        office_type_id          integer not null
                                constraint im_offices_cust_type_fk
                                references categories,
                                -- "pointer" back to the company of the office
        customer_id             integer,
        phone                   varchar(50),
        fax                     varchar(50),
        address_line1           varchar(80),
        address_line2           varchar(80),
        address_city            varchar(80),
        address_state           varchar(80),
        address_postal_code     varchar(80),
        address_country_code    char(2)
                                constraint if_address_country_code_fk
                                references country_codes(iso),
        contact_person_id       integer
                                constraint im_offices_cont_per_fk
                                references users,
        note                    varchar(4000)
);