1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
//------------------------------------------------------------------------------ |
4
|
|
|
// |
5
|
|
|
// eTraxis - Records tracking web-based system |
6
|
|
|
// Copyright (C) 2005-2010 Artem Rodygin |
7
|
|
|
// |
8
|
|
|
// This program is free software: you can redistribute it and/or modify |
9
|
|
|
// it under the terms of the GNU General Public License as published by |
10
|
|
|
// the Free Software Foundation, either version 3 of the License, or |
11
|
|
|
// (at your option) any later version. |
12
|
|
|
// |
13
|
|
|
// This program is distributed in the hope that it will be useful, |
14
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
|
|
|
// GNU General Public License for more details. |
17
|
|
|
// |
18
|
|
|
// You should have received a copy of the GNU General Public License |
19
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. |
20
|
|
|
// |
21
|
|
|
//------------------------------------------------------------------------------ |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @package eTraxis |
25
|
|
|
* @ignore |
26
|
|
|
*/ |
27
|
|
|
|
28
|
|
|
/**#@+ |
29
|
|
|
* Dependency. |
30
|
|
|
*/ |
31
|
|
|
require_once('../engine/engine.php'); |
32
|
|
|
require_once('../dbo/groups.php'); |
33
|
|
|
/**#@-*/ |
34
|
|
|
|
35
|
|
|
init_page(LOAD_TAB); |
36
|
|
|
|
37
|
|
|
if (get_user_level() != USER_LEVEL_ADMIN) |
38
|
|
|
{ |
39
|
|
|
debug_write_log(DEBUG_NOTICE, 'User must have admin rights to be allowed.'); |
40
|
|
|
exit; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
// local JS functions |
44
|
|
|
|
45
|
|
|
$resTitle = get_js_resource(RES_NEW_GROUP_ID); |
46
|
|
|
$resOK = get_js_resource(RES_OK_ID); |
47
|
|
|
$resCancel = get_js_resource(RES_CANCEL_ID); |
48
|
|
|
|
49
|
|
|
$xml = <<<JQUERY |
50
|
|
|
<script> |
51
|
|
|
|
52
|
|
|
function groupCreate () |
53
|
|
|
{ |
54
|
|
|
jqModal("{$resTitle}", "create.php", "{$resOK}", "{$resCancel}", "$('#createform').submit()"); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
</script> |
58
|
|
|
JQUERY; |
59
|
|
|
|
60
|
|
|
// get list of groups |
61
|
|
|
|
62
|
|
|
$sort = $page = NULL; |
63
|
|
|
$list = groups_list(0, $sort, $page); |
64
|
|
|
|
65
|
|
|
$from = $to = 0; |
66
|
|
|
|
67
|
|
|
// generate list of groups |
68
|
|
|
|
69
|
|
|
$xml .= '<button action="groupCreate()">' . get_html_resource(RES_CREATE_ID) . '</button>'; |
70
|
|
|
|
71
|
|
|
if ($list->rows != 0) |
|
|
|
|
72
|
|
|
{ |
73
|
|
|
$columns = array |
74
|
|
|
( |
75
|
|
|
RES_GROUP_NAME_ID, |
76
|
|
|
RES_DESCRIPTION_ID, |
77
|
|
|
); |
78
|
|
|
|
79
|
|
|
$bookmarks = gen_xml_bookmarks($page, $list->rows, $from, $to, 'list.php?'); |
|
|
|
|
80
|
|
|
|
81
|
|
|
$xml .= '<list>' |
82
|
|
|
. '<hrow>'; |
83
|
|
|
|
84
|
|
View Code Duplication |
for ($i = 1; $i <= count($columns); $i++) |
85
|
|
|
{ |
86
|
|
|
$smode = ($sort == $i ? ($i + count($columns)) : $i); |
87
|
|
|
|
88
|
|
|
$xml .= "<hcell url=\"list.php?sort={$smode}\">" |
89
|
|
|
. get_html_resource($columns[$i - 1]) |
90
|
|
|
. '</hcell>'; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
$xml .= '</hrow>'; |
94
|
|
|
|
95
|
|
|
$list->seek($from - 1); |
96
|
|
|
|
97
|
|
|
for ($i = $from; $i <= $to; $i++) |
98
|
|
|
{ |
99
|
|
|
$row = $list->fetch(); |
100
|
|
|
|
101
|
|
|
$xml .= "<row url=\"view.php?id={$row['group_id']}\">" |
102
|
|
|
. '<cell>' . ustr2html($row['group_name']) . '</cell>' |
103
|
|
|
. '<cell>' . ustr2html($row['description']) . '</cell>' |
104
|
|
|
. '</row>'; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
$xml .= '</list>' |
108
|
|
|
. $bookmarks; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
echo(xml2html($xml)); |
112
|
|
|
|
113
|
|
|
?> |
114
|
|
|
|
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.