Overview

Packages

  • Horde
    • Form
    • MIME
      • Viewer
    • Scheduler
  • None
  • Whups
    • UnitTests

Classes

  • Whups_Application
  • Whups_Block_Myqueries
  • Whups_Block_Myrequests
  • Whups_Block_Mytickets
  • Whups_Block_Query
  • Whups_Block_Queuecontents
  • Whups_Block_Queuesummary
  • Whups_Block_Unassigned
  • Whups_Driver_sql
  • Whups_Exception
  • Whups_Factory_Driver
  • Whups_Form_AddListener
  • Whups_Form_DeleteListener
  • Whups_Form_Queue_StepOne
  • Whups_Form_Queue_StepThree
  • Whups_Form_Queue_StepTwo
  • Whups_Form_Renderer_Query
  • Whups_Form_SetTypeStepOne
  • Whups_Form_SetTypeStepTwo
  • Whups_Form_Ticket_Delete
  • Whups_Test_Perms
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Copyright 2001-2002 Robert E. Coyle <robertecoyle@hotmail.com>
 4:  * Copyright 2001-2012 Horde LLC (http://www.horde.org/)
 5:  *
 6:  * See the enclosed file LICENSE for license information (BSD). If you
 7:  * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
 8:  */
 9: class Whups_Form_Ticket_Delete extends Horde_Form
10: {
11:     protected $_queue;
12: 
13:     public function __construct(&$vars, $title = '')
14:     {
15:         parent::__construct($vars, $title);
16: 
17:         $info = $GLOBALS['whups_driver']->getTicketDetails($vars->get('id'));
18:         $this->_queue = $info['queue'];
19:         $this->addHidden('', 'id', 'int', true, true);
20:         $summary = &$this->addVariable(_("Summary"), 'summary', 'text', false,
21:                                        true);
22:         $summary->setDefault($info['summary']);
23:         $yesno = array(0 => _("No"), 1 => _("Yes"));
24:         $this->addVariable(_("Really delete this ticket? It will NOT be archived, and will be gone forever."), 'yesno', 'enum', true, false, null, array($yesno));
25:     }
26: 
27:     public function validate(&$vars)
28:     {
29:         if (!Whups::hasPermission($this->_queue, 'queue', Horde_Perms::DELETE)) {
30:             $this->setError('yesno', _("Permission Denied."));
31:         }
32: 
33:         return parent::validate($vars);
34:     }
35: 
36: }
API documentation generated by ApiGen