# -*- Perl -*-
#
# Copyright (C) 1996 Craig Ruefenacht <ruefenac@cs.utah.edu> and the
#                    University of Utah Computer Science Department
#
# $Id: CS_Rust_Configs.pm,v 1.1.1.1 2000/05/03 19:55:12 wright Exp $
#
# This is part of RUST-1.0 Beta 2
#
# Abstract: This library contains functions to create a hash for
#           global configuration variables for rust.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# any 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
# along with the source distribution of Inquire, in the license
# directory. If you don't have a copy of it, write to: 
#
# Free Software Foundation, Inc.
# 675 Mass Ave
# Cambridge, MA 02139, USA.
#
# How this file works
#
#      This file contains all the configurable options of RUST.
#      To modify/change configuration variables, go through the
#      "get_globals" subroutine and change whatever you are looking
#      for. There are comments throughout the subroutine that
#      explains what config variables do what, so read carefully.
#
#      Some configs in here are arrays.  They are not a real array,
#      but have the format
#
#           <some_info>:<some_more_info>:<yet_some_more_info>....
# 
#      The above line is returned as a string.  The elements of the
#      "array" are seperated by the ':' character.  All arrays in the
#      global configs are related to each other.  The first element in
#      each "array" concerns RUST Queue #1, the second element concerns
#      RUST Queue #2, the third concerns RUST Queue #3, and so on. 

{
package CS_Rust_Configs;

require Exporter;
@ISA = qw(Exporter);
@EXPORT =
    (
     # name                       brief description
     # --------------------------------------------------------     
     'get_globals',		# Create a hash table of global vars
     'extract_element'		# Extract an element from the hash
     );
 
#-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
sub get_globals {
    #
    # Type: Can be called by external scripts
    #
    # Abstract: Create a new "class" definition to hold global config
    #           information.

    $globals = {};

    # ======================================================
    # MAILING LIST SETUP
    #
    # The following variables are used to configure your
    # mailing lists, such as their names, titles, etc...

    # alias_names is an array of your mailing lists.  This is the
    # email address as you use it, without the @<machine_name> on
    # the end.  If you have several email addresses for the same
    # thing, like "system" and "systems" all go to the same
    # mailing list, just use one of them, using the one that
    # is most used, or the one you desire all people to use.
    # There must only be one email address per mailing list.

 @alias_names = ("opers","unixsys","dsl","accounts","printers",
                    "afsadmin","modems","rust1","rust2","rust3","rust-bugs",
                    "a1-bugs","webmaster","video");


    $globals->{"alias_name"} = join(':',@alias_names);

    # number_of_queues is how many queues you are using.
    # It is one based, so setting it to 1 means that you have only
    # one queue, 10 means you have 10 queues, etc...  It can
    # theoretically be as large a number as you need.

    $globals->{"number_of_queues"} = 14;

    # valid_status returns a string, seperated with ":",
    # of valid statuses that you want to use in RUST.  There
    # are a few required ones.  They are "new","open", "resolved",
    # and "archived".  Beyond that, you can put anything
    # you want here.  

    # DON'T CHANGE $required 
    $required = "new:open:resolved:archived";

    $globals->{"valid_status"} = join(':',$required,"active","pending","ongoing");

  
    return $globals;
}

#-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
sub extract_element {
    #
    # Type: Can be called by external scripts
    #
    # Abstract: Take in a element which is stored in the global
    #           hash and "split" it apart to extract which one
    #           is needed.  This is done here to remove these
    #           messy calls, because it is an ugly line of code
 
    my ($key, $index) = @_;
 
    my $line = $globals->{$key};
    return (split(':',$line))[$index];
}


}
1;

#EOF
