Overview

Packages

  • Hermes
  • Horde
    • Data
  • Kronolith
  • None

Classes

  • Hermes
  • Hermes_Ajax_Application
  • Hermes_Api
  • Hermes_Driver
  • Hermes_Driver_Sql
  • Hermes_Factory_Driver
  • Hermes_Form_Admin_AddJobType
  • Hermes_Form_Admin_DeleteJobType
  • Hermes_Form_Admin_EditClientStepOne
  • Hermes_Form_Admin_EditClientStepTwo
  • Hermes_Form_Admin_EditJobTypeStepOne
  • Hermes_Form_Admin_EditJobTypeStepTwo
  • Hermes_Form_Deliverable
  • Hermes_Form_Deliverable_ClientSelector
  • Hermes_Form_Export
  • Hermes_Form_JobType_Edit_Step1
  • Hermes_Form_Search
  • Hermes_Form_Time
  • Hermes_Form_Time_Entry
  • Hermes_LoginTasks_SystemTask_Upgrade
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * DeliverableClientSelector - Form for selecting client on deliverables screen
 4:  *
 5:  * Copyright 2002-2012 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  Jason M. Felice <jason.m.felice@gmail.com>
11:  * @package Hermes
12:  */
13: class Hermes_Form_Deliverable_ClientSelector extends Horde_Form
14: {
15:     public function __construct(&$vars)
16:     {
17:         parent::Horde_Form($vars, _("Select Client"));
18:         $action = &Horde_Form_Action::factory('submit');
19:         list($clienttype, $clientparams) = $this->getClientType();
20: 
21:         $cli = &$this->addVariable(_("Client"), 'client_id', $clienttype, true, false, null, $clientparams);
22:         $cli->setAction($action);
23:         $this->setButtons(_("Edit Deliverables"));
24:     }
25: 
26:     public function getClientType()
27:     {
28:         try {
29:             $clients = Hermes::listClients();
30:         } catch (Hermes_Exception $e) {
31:             return array('invalid', array(sprintf(_("An error occurred listing clients: %s"),
32:                                                   $clients->getMessage())));
33:         }
34:         if (count($clients)) {
35:             return array('enum', array($clients));
36:         } else {
37:             return array('invalid', array(_("There are no clients which you have access to.")));
38:         }
39:     }
40: 
41: }
API documentation generated by ApiGen