1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15:
16: class Sesha_Forms_Type_Client extends Horde_Form_Type_enum {
17:
18: public function init($values = null, $prompt = null)
19: {
20: global $conf, $registry;
21:
22:
23: if ($registry->hasMethod('clients/getClientSource')) {
24: $source = $registry->call('clients/getClientSource');
25: if (!empty($source)) {
26: $results = $registry->call('clients/searchClients', array(array('')));
27: $clientlist = $results[''];
28: $clients = array();
29: foreach ($clientlist as $client) {
30: $key = isset($client['id']) ? $client['id'] : $client['__key'];
31: $clients[$key] = isset($client[$conf['client']['field']]) ? $client[$conf['client']['field']] : '';
32: }
33: asort($clients);
34: parent::init($clients);
35: }
36: }
37: }
38:
39: 40: 41:
42: public function about()
43: {
44: $about = array();
45: $about['name'] = _("Client");
46: return $about;
47: }
48:
49: }
50: