#!/usr/bin/perl -wT

#----------------------------------------------------------------------
# heading     : Configuration
# description : Printers
# navigation  : 6000 6400
# 
# copyright (C) 2002 Mitel Networks Corp.
# 
# 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
# (at your option) 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 this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
# 
#----------------------------------------------------------------------

use strict;
use esmith::FormMagick::Panel::printers;

my $fm = esmith::FormMagick::Panel::printers->new();
$fm->display();

__DATA__
<form title="FORM_TITLE" header="/etc/e-smith/web/common/head.tmpl"
footer="/etc/e-smith/web/common/foot.tmpl">
  <page name="Initial" pre-event="print_status_message">
    <description>INITIAL_DESC</description>
    <subroutine src="show_printers()"/>
  </page>

  <page name="Add" pre-event="print_status_message"
  post-event="create_printer">
    <title>CREATE_NEW_PRINTER</title>
    <description>CREATE_NEW_DESC</description>
    <field id="name" type="text" validation="nonblank, maxlength(32)">
      <label>PRINTER_NAME</label>
    </field>
    <field id="description" type="text" validation="nonblank, maxlength(32)">
      <label>BRIEF_DESCRIPTION</label>
    </field>
    <field id="location" type="select" options="'lp0'=>'LOCAL_PRINTER_0',
    'lp1'=>'LOCAL_PRINTER_1','lp2'=>'LOCAL_PRINTER_2','remote'=>'NET_PRINTER',
    'usb/lp0'=>'FIRST_USB_PRINTER','usb/lp1'=>'SECOND_USB_PRINTER'" 
    value="remote" validation="nonblank">
      <label>LOCATION</label>
    </field>
    <subroutine src="print_button('CREATE')"/>
  </page>

  <page name="AddNetwork" pre-event="turn_off_buttons"
  post-event="create_printer">
    <title>CREATE_NETWORK_PRINTER</title>
    <description>CREATE_NETWORK_DESC</description>
    <field id="address" type="text" validation="hostname_or_ip">
      <label>HOSTNAME_OR_IP</label>
    </field>
    <field id="remoteName" type="text" value="raw" validation="nonblank">
      <label>REMOTE_NAME_DESC</label>
    </field>
    <subroutine src="print_hidden_fields()"/>
    <subroutine src="print_button('CREATE')"/>
  </page>

  <page name="Delete" pre-event="turn_off_buttons">
  </page>

  <page name="ConfirmDelete" pre-event="turn_off_buttons"
  post-event="delete_printer">
    <title>REMOVE_PRINTER</title>
    <subroutine src="show_delete_confirmation()"/>
    <subroutine src="print_button('REMOVE')"/>
  </page>

</form>

