1<?php
2/**
3 * This file contains all Horde_Form classes for ticket type administration.
4 *
5 * Copyright 2002-2017 Horde LLC (http://www.horde.org/)
6 *
7 * See the enclosed file LICENSE for license information (BSD). If you
8 * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
9 *
10 * @author  Chuck Hagenbuch <chuck@horde.org>
11 * @package Whups
12 */
13
14class Whups_Form_Admin_CloneType extends Horde_Form
15{
16    public function __construct(&$vars)
17    {
18        global $whups_driver;
19
20        $type = $vars->get('type');
21        $info = $whups_driver->getType($type);
22        parent::__construct(
23            $vars, sprintf(_("Make a clone of %s"), $info['name']));
24
25        $this->setButtons(_("Clone"));
26        $this->addHidden('', 'type', 'int', true, true);
27
28        $tname = $this->addVariable(
29            _("Name of the cloned copy"), 'name', 'text', true);
30        $tname->setDefault(sprintf(_("Copy of %s"), $info['name']));
31
32        $tdesc = $this->addVariable(
33            _("Clone Description"), 'description', 'text', true);
34        $tdesc->setDefault($info['description']);
35    }
36
37}
38