1 | <?php |
---|
2 | /**************************************************************************\ |
---|
3 | * eGroupWare * |
---|
4 | * http://www.egroupware.org * |
---|
5 | * -------------------------------------------- * |
---|
6 | * This program is free software; you can redistribute it and/or modify it * |
---|
7 | * under the terms of the GNU General Public License as published by the * |
---|
8 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
9 | * option) any later version. * |
---|
10 | \**************************************************************************/ |
---|
11 | |
---|
12 | require_once dirname(__FILE__) . SEP . 'common.inc.php'; |
---|
13 | |
---|
14 | /** |
---|
15 | * @package Workflow |
---|
16 | * @license http://www.gnu.org/copyleft/gpl.html GPL |
---|
17 | * @author Sidnei Augusto Drovetto Junior |
---|
18 | */ |
---|
19 | class ui_generic_select |
---|
20 | { |
---|
21 | /** |
---|
22 | * @var array $public_functions public functions |
---|
23 | * @access public |
---|
24 | */ |
---|
25 | var $public_functions = array( |
---|
26 | 'form' => true |
---|
27 | ); |
---|
28 | |
---|
29 | /** |
---|
30 | * @var int $containerNumber |
---|
31 | * @access public |
---|
32 | */ |
---|
33 | var $containerNumber; |
---|
34 | /** |
---|
35 | * @var $sessionSection |
---|
36 | * @access public |
---|
37 | */ |
---|
38 | var $sessionSection; |
---|
39 | /** |
---|
40 | * @var $target_element |
---|
41 | * @access public |
---|
42 | */ |
---|
43 | var $targetElement; |
---|
44 | /** |
---|
45 | * @var $selected |
---|
46 | * @access public |
---|
47 | */ |
---|
48 | var $selected; |
---|
49 | /** |
---|
50 | * @var $digest |
---|
51 | * @access public |
---|
52 | */ |
---|
53 | var $digest; |
---|
54 | |
---|
55 | function readPostedData() |
---|
56 | { |
---|
57 | $this->sessionSection = "generic_select"; |
---|
58 | $this->targetElement = isset($_GET['target_element']) ? $_GET['target_element'] : 'user_list'; |
---|
59 | $this->containerNumber = isset($_GET['container_number']) ? $_GET['container_number'] : 0; |
---|
60 | $this->selected = isset($_GET['selected']) ? $_GET['selected'] : -1; |
---|
61 | $this->digest = isset($_GET['digest']) ? $_GET['digest'] : "false"; |
---|
62 | } |
---|
63 | |
---|
64 | /** |
---|
65 | * Constructor |
---|
66 | * @access public |
---|
67 | * @return void |
---|
68 | */ |
---|
69 | function ui_generic_select() |
---|
70 | { |
---|
71 | $this->readPostedData(); |
---|
72 | } |
---|
73 | |
---|
74 | /** |
---|
75 | * Build the generic select form |
---|
76 | * @access public |
---|
77 | * @return void |
---|
78 | */ |
---|
79 | function form() |
---|
80 | { |
---|
81 | $smarty = Factory::getInstance('workflow_smarty', false); |
---|
82 | $smarty->setHeader(workflow_smarty::SHOW_HEADER | workflow_smarty::SHOW_FOOTER); |
---|
83 | |
---|
84 | $javaScripts = '<script src="' . $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'workflow' . SEP . 'js' . SEP . 'jscode' . SEP . 'generic_select.js' . '" type="text/javascript"></script>'; |
---|
85 | |
---|
86 | /* pass the variables to Smarty */ |
---|
87 | $smarty->assign('list', $_SESSION[$this->sessionSection][$this->digest][$this->containerNumber]); |
---|
88 | $smarty->assign('selected', $this->selected); |
---|
89 | $smarty->assign('targetElement', $this->targetElement); |
---|
90 | $smarty->assign('javaScripts', $javaScripts); |
---|
91 | $smarty->assign('lang_to_Search', lang('search')); |
---|
92 | $smarty->assign('lang_Close', lang('Close')); |
---|
93 | $smarty->assign('lang_Add', lang('Add')); |
---|
94 | $smarty->assign('header', $smarty->expressoHeader); |
---|
95 | $smarty->assign('footer', $smarty->expressoFooter); |
---|
96 | $smarty->display('generic_select.tpl'); |
---|
97 | } |
---|
98 | } |
---|
99 | ?> |
---|