<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: tempissue20.xml 1788 2006-04-29 19:22:37Z bfontana $ -->
<!-- Looks best in vi if you set tabstop=2 -->
<tempissue>
  <!--
  Global parameters.
  -->
  <ti_version value="2.3"/>
  <informix informixdir="/cas/db" informixserver="aixdev51"/>
  <!--
  The debug_level controls how much debugging information TempIssue
  will produce, from 0 being minimal, while a setting of 10 produces
  verbose output both on the screen and in the server's log.
  -->
  <debug_level value="1"/>
  <!--
  This setting controls how long a workstation can remain idle
  before the TempIssue application forces the session to close.
  -->
  <inactivity_timeout value="60m"/>
  <!--
  Every 5 minutes, a task checks all of the currently issued temporary
  badges and suspends those badges that have expired.  For auditing
  purposes, this task needs to be run as a valid Picture Perfect
  operator with permission to update badges.
  -->
  <unattended_operator value="install"/>
  <!--
  The auto_enable parameter specifies whether you want TempIssue to
  automatically re-activate a person's permanent badge when their
  temporary badge expires.  Of course, implementing such a policy 
  would require a good deal of trust.
  -->
  <auto_enable value="n"/>
  <!--
  The value we will put into the badge status field of the permanent
  badge when the cardholder receives a temporary badge.
  -->
  <deact_status value="5"/>
  <!--
  The auto_init flag controls whether the temporary badge automagically 
  gets initialized by the values in the temp_deactivate action list
  when it expires.  If set to "n", then the only field that will be
  updated is the badge status field.  That field will be set to the
  value specified by the deact_status parameter.
  -->
  <auto_init value="n"/>
  <!--
  The show_bid parameter allows you to suppress the displaying of 
  the encoded numbers when swiping or entering BIDs into TempIssue.
  -->
  <show_bid value="n"/>
  <!--
  If numeric_bid is set, then TempIssue will ignore any non-numeric leading 
  trailing characters.  Some wedge readers do not suppress the start and
  stop characters. Set this to "y" if your wedge reader emits unwanted
  characters along with the BID.
  -->
  <numeric_bid value="y"/>
  <!--
  The max_count option defines how many results will be displayed when more
  than one badge is found when searching for a permanent badge.
  -->
  <max_count value="10"/>
  <!--
  The next two fields allow you to specify your own logo instead of ours.
  The login_logo can be pretty much any size since it displays on the 
  login screen.  However, the issue_logo needs to be limited to (currently)
  no more than 42 characters.  Note that you can use the same image for
  both, specifying different dimensions as necessary.
  -->
  <login_logo img="/tempissue_html/TempIssue20.gif"/>
  <issue_logo img="/tempissue_html/TempIssue20.gif" height="42"/>
  <!--
  Allow receptionist to update certain badge fields at issue time.
  -->
  <enable_regular_overrides value="y"/>
  <!--
  User defined macros that get executed during the 5 actions.  We supply
  a handful of useful ones.  Use your imagination and write your
  own.  There is minimal syntax checking and beware that we turn off
  strict subs during execution.
  -->
  <macros>
    <macro code="$ppdate:   sub { my @lt=localtime(); sprintf '%04d%02d%02d', $lt[5]+1900, $lt[4]+1, $lt[3] };"/>
    <macro code="$pptime:   sub { my @lt=localtime(); sprintf '%02d%02d%02d', $lt[2], $lt[1], $lt[0] };"/>
    <macro code="$date:     sub { scalar localtime() };"/>
    <macro code="$hotstamp: sub { substr ($badge->bid, length($badge->bid) - 5); };"/>
  </macros>
  <!--
  User defined search columns that allow you to configure how the operator
  searches for a permanent cardholder's badge.
  -->
  <search_columns>
    <search_column table="badge" column="last_name" label="Last Name" default="y"/>
    <search_column table="badge" column="employee" label="Employee Number"/>
  </search_columns>
  <!--
  User-defined display columns for badge confirmations and for the
  picklist that gets displayed if more than one badge meets the search
  criteria. 
  -->
  <display_columns>
    <display_column table="badge_user" column="description" slot_number="40" label="Hot Stamp"/>
    <display_column table="badge" column="last_name" label="Last Name" width="25" sort="1"/>
    <display_column table="badge" column="first_name" label="First Name" width="15"/>
    <display_column table="badge" column="employee" label="Employee" width="8"/>
    <display_column table="badge" column="access_date" label="Last Used" width="12"/>
  </display_columns>
  <!--
  Here you can define the duration drop-down list.  The first item on the list
  is always the default.
  -->
  <durations>
    <duration label="30 minutes" seconds="1800"/>
    <duration label="1 hour" seconds="3600"/>
    <duration label="8 hours" seconds="28800"/>
    <duration label="1 day" seconds="86400"/>
    <duration label="2 days" seconds="172800"/>
    <duration label="1 week" seconds="604800"/>
    <duration label="2 weeks" seconds="1209600"/>
  </durations>
  <!--
  At least one badge field on temporary cards must be reserved for TempIssue.
  The temp_column tells us that the card is not just ANY card.  It is a card
  that has been enrolled into TempIssue.  You can choose any badge
  or badge_user field, and you can set its value to anything as long as you
  don't change it after you've enrolled badges.  We suggest you leave the value
  as "TEMPORARY".  If you absolutely insist on changing the table, field, or
  value , you will need to re-enroll all badges that had previously been enrolled
  using the original settings.
  
  The optional location_column allows you to associate a location
  (or receptionist) with temporary badges during the enrollment process:
  
    <location_column table="badge_user" column="description" slot_number="29"/>
  
  TempIssue will update the contents of this column with the location or
  receptionist when the badge is enrolled.  If you don't want Tempissue to
  update this column with anything, but want to associate the location
  with a pre-existing field (such as facility), then add the attribute,
  ronly="true" as shown below:
  
    <location_column table="badge" column="facility" ronly="true"/>
  
  If you specify the ronly attribute and set its value to anything but
  "true", it will be treated as false or writeable.
  
  When the location column is writeable, and the operator does not specify
  a value during the enrollment process, the existing contents of the column
  will be cleared.
  
  If no location column is specified, then the enrollment GUI will disable
  the New "Location" button.
  
  You are not required to specify a location during enrollment even if you
  have specified a location_column.  Like temp_column, location_column can be
  any badge or badge_user field, but you cannot change it after you've enrolled
  badges for that location.  If you absolutely insist on changing the field
  used location, you will need to re-enroll any badges that had previously been
  enrolled using the original temp_column settings.
  
  The filter_column parameter allows you to specify the filter used by the
  Report function.  The filter column can be different than the location
  column.  The report will only display records that match the value
  supplied for this field.  For instance, if you currently use badge.address5
  to store the country name and you specify the following:
  
    <filter_column table="badge" column="address5"/>
  
  then the report will display a prompt whose label will be the same as the
  one displayed on the Picture Perfect badge form for the address5 field.
  
  When you specify a value for that prompt, the result set will contain
  only badge records whose address5 field matches the specified value.
  -->
  <special_columns>
    <temp_column table="badge_user" column="description" slot_number="31" value="TEMPORARY"/>
    <location_column table="badge_user" column="description" slot_number="29"/>
    <filter_column table="badge_user" column="description" slot_number="29"/>
  </special_columns>
  <!--
  Protected columns allow you to maintain certain identifying bits of
  information in a temporary badge record.  If you didn't protect 
  certain fields, then their values would be overwritten by the values 
  in the permanent badge, or may get wiped out when the badge is enrolled
  or returned.  While copying the contents of one badge to another is pretty
  much exactly what you want, you will still need to protect the id, bid, and 
  possibly a hot stamp number.  The two special columns above must also
  protected.  You may also want to protect the reader and access information
  so that you can view that information even after a badge is returned.
  -->
  <protected_columns>
    <protected_column table="badge" column="id"/>
    <protected_column table="badge" column="bid"/>
    <protected_column table="badge" column="bid_format_id"/>
    <protected_column table="badge" column="reader"/>
    <protected_column table="badge" column="access_date"/>
    <protected_column table="badge" column="access_time"/>
    <protected_column table="badge" column="modify_date"/>
    <protected_column table="badge" column="modify_time"/>
    <protected_column table="badge_user" column="description" slot_number="29"/>
    <protected_column table="badge_user" column="description" slot_number="31"/>
    <protected_column table="badge_user" column="description" slot_number="40"/>
  </protected_columns>
  <!--
  The visitor override columns are mandatory if you intend to issue badges
  to visitors.  That's because visitors don't already have a badge, so we
  need to gather some basic information about the person before we print
  and issue a badge to them.  Note that you can pre-fill these fields
  with default values by assigning a value to them.  You can also set up a
  default categories so that the person has general access.
  -->
  <visitor_override_columns>
    <visitor_override_column table="badge" column="first_name" label="First Name"/>
    <visitor_override_column table="badge" column="last_name" label="Last Name"/>
    <visitor_override_column table="badge" column="initials" label="Initials" value=""/>
    <visitor_override_column table="badge" column="address2" label="D/L#" value=""/>
    <visitor_override_column table="badge" column="address3" label="Company"/>
    <visitor_override_column table="badge_user" column="description" slot_number="28" label="Visiting"/>
    <visitor_override_column table="badge_category" column="category_id" slot_number="1" value="5"/>
  </visitor_override_columns>
  <!--
  The regular override columns functions similarly to the visitor override 
  columns except they apply to the fields on the temporary card.  First the
  permanent fields are copied to the temporary badge.  The, any overrides
  are applied. 
  -->
  <regular_override_columns>
  </regular_override_columns>
  <!--
  There are 2 sets of actions for issuing, 2 sets of actions for returning,
  and one set of actions for enrollment.  An action is a specification for
  placing a certain value into a certain column at a certain stage of the
  issue, return, or enrollment process. 
        
  For all actions, if you specify a column name and do not supply a value,
  then you are specifying that you expressly wish to clear the contents from
  that column.  Said another way, if you want to clear the contents of a
  column, add a line with the table name and column name but do not specify a
  value.  Hence, there is never a need to specify "" to clear a value.
  
  TempIssue provides a shorthand method for specifying actions on a range of
  repeating fields. The slot numbers specified in the range are represented
  by the starting slot number, two dots, and the ending slot number. 

  This is shown in the following examples:

    To specify that you wan to clear a badge of its existing badge categories
    starting from slot numbers 2 through 96, instead of using:
        
      <action table="badge_category" column="category" slot_number="2"/>
      <action table="badge_category" column="category" slot_number="3"/>
      ...
      ...
      <action table="badge_category" column="category" slot_number="96"/>
            
    use:
        
      <action table="badge_category" column="category2..96" />
        
    Also note that the column="category" and slot_number="M" are combined into
    a single column="categoryM..N".
    
    To clear the user-defined slot numbers 36 through 40, rather than using:
       
          <action table="badge_user" column="description" slot_number="36"/>
          <action table="badge_user" column="description" slot_number="37"/>
          <action table="badge_user" column="description" slot_number="38"/>
          <action table="badge_user" column="description" slot_number="39"/>
          <action table="badge_user" column="description" slot_number="40"/>
      
    you can use:
       
      <action table="badge_user" column="user36..40" />
       
    To specify badge address fields 1 through 3, use the
    form: <action table="badge" column="address1..3" />
     
  If you don't use the shorthand method, refer to specific slot numbers by
  using the "slot_number" form as shown here for badge_category and badge_user
  respectively:
      
    <action table="badge_category" column="category" slot_number="1" value="-2" />
      
  and
     
        <action table="badge_user" column="description" slot_number="30" />
   
  Actions are specified here.
  -->
  <actions>
    <issue_actions>
      <!--
      Things we want to do with the temporary badge after the operator confirms
      that they want to issue it.
      -->
      <temp_activate>
        <action table="badge" column="status" value="0"/>
        <!-- Clear out the last reader, access_date, and access_time.  Some
        site administrators prefer NOT to do this because they may want to
        preserve that information until the card is issued again.  Here, we
        clear it because we don't care.
        -->
        <action table="badge" column="reader"/>
        <action table="badge" column="access_date"/>
        <action table="badge" column="access_time"/>
        <!-- Update the issue date and time with the current date and time -->
        <action table="badge" column="issue_date" value="$ppdate"/>
        <action table="badge" column="issue_time" value="$pptime"/>
        <action table="badge_user" column="description" slot_number="30"/>
      </temp_activate>
      <!--
      Things we want to do with the permanent badge right before we activate the
      temporary card.  A good example is to set the status to 5 (suspended).
      -->
      <perm_deactivate>
        <!-- Disable the person's permanent badge -->
        <action table="badge" column="status" value="5"/>
        <!--
        Make a notation in the user30 slot explaining why this card
        is being suspended.
        -->
        <action table="badge_user" column="description" slot_number="30" value="TEMP $date"/>
      </perm_deactivate>
    </issue_actions>
    <return_actions>
      <!--
      Things we want to do with the permanent badge after the temporary badge
      was returned.  A good example is to set the status to 0 (active).  The
      cardholder will appreciate that.
      -->
      <perm_activate>
        <!-- Set the permanent card status back to "Active" -->
        <action table="badge" column="status" value="0"/>
        <!-- Clear out the "TEMPORARY 2005-02-16 10:16:00" message -->
        <action table="badge_user" column="description" slot_number="30"/>
      </perm_activate>
      <!--
      Things we want to do with the temporary badge after the operator confirms
      that the card is returned.  Note that the actions specified below
      will also occur if the auto_init field is set to "y" and the temporary badge
      expires.
      -->
      <temp_deactivate>
        <action table="badge" column="status" value="5"/>
        <action table="badge" column="employee" value="$hotstamp"/>
        <action table="badge" column="dept"/>
        <action table="badge" column="employee" value="999999"/>
        <action table="badge" column="first_name" value="TEMP"/>
        <action table="badge" column="last_name" value="BADGE"/>
        <action table="badge" column="initials" value="T"/>
        <action table="badge" column="address1..5"/>
        <action table="badge" column="reader"/>
        <action table="badge" column="access_date"/>
        <action table="badge" column="access_time"/>
        <action table="badge" column="issue_date"/>
        <action table="badge" column="issue_time"/>
        <action table="badge" column="expired_date"/>
        <action table="badge" column="expired_time"/>
        <action table="badge" column="return_date" value="$ppdate"/>
        <action table="badge" column="return_time" value="$pptime"/>
        <action table="badge_user" column="user1..28" />
        <!-- Skip 29-31, given to TempIssue for internal use.  (See
        special_columns above).  Then clear out 32-39 and put the
        badge's hotstamp number in 40.
         -->
        <action table="badge_user" column="user32..39" />
        <action table="badge_user" column="description" slot_number="40" value="$hotstamp"/>
        <!-- Clear out all categories -->
        <action table="badge_category" column="category1..96"/>
      </temp_deactivate>
    </return_actions>
    <enroll_actions>
      <!--
      Things we want to do with the temporary badge when an operator enrolls a
      a badge into TempIssue.  These actions are generally similar to return
      actions.  Note that in addition to these actions, the special_columns
      fields will also be initialized.
      -->
      <temp_deactivate>
        <action table="badge" column="status" value="5"/>
        <action table="badge" column="employee" value="$hotstamp"/>
        <action table="badge" column="dept"/>
        <action table="badge" column="employee" value="999999"/>
        <action table="badge" column="first_name" value="TEMP"/>
        <action table="badge" column="last_name" value="BADGE"/>
        <action table="badge" column="initials" value="T"/>
        <action table="badge" column="address1..5"/>
        <action table="badge" column="reader"/>
        <action table="badge" column="access_date"/>
        <action table="badge" column="access_time"/>
        <action table="badge" column="issue_date"/>
        <action table="badge" column="issue_time"/>
        <action table="badge" column="expired_date"/>
        <action table="badge" column="expired_time"/>
        <action table="badge" column="return_date" value="$ppdate"/>
        <action table="badge" column="return_time" value="$pptime"/>
        <action table="badge_user" column="user1..28" />
        <!--
        Skip initializing 29-31, since we have specified that TempIssue
        can have them for internal use.  (See special_columns above).  
        Then clear out slots 32-39 and put the badge's hotstamp number in 40.
        -->
        <action table="badge_user" column="user32..39" />
        <action table="badge_user" column="description" slot_number="40" value="$hotstamp"/>
        <!-- Clear out all categories -->
        <action table="badge_category" column="category1..96"/>
      </temp_deactivate>
    </enroll_actions>
  </actions>
  <!--
  The permission list is a security safeguard that allows you to restrict
  the operators who are allowed to issue temporary badges.  If you leave
  these values in place, only operators whose permission ID is 1, 2, or 3
  will be able to issue temporary badges, so don't forget to change them
  or remove them!
  -->
  <permissions>
    <perm value="1"/>
    <perm value="2"/>
    <perm value="3"/>
  </permissions>
</tempissue>

