1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
//------------------------------------------------------------------------------ |
4
|
|
|
// |
5
|
|
|
// eTraxis - Records tracking web-based system |
6
|
|
|
// Copyright (C) 2005-2011 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/projects.php'); |
33
|
|
|
require_once('../dbo/states.php'); |
34
|
|
|
/**#@-*/ |
35
|
|
|
|
36
|
|
|
init_page(); |
37
|
|
|
|
38
|
|
|
if (get_user_level() != USER_LEVEL_ADMIN) |
39
|
|
|
{ |
40
|
|
|
debug_write_log(DEBUG_NOTICE, 'User must have admin rights to be allowed.'); |
41
|
|
|
header('Location: index.php'); |
42
|
|
|
exit; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
// check that requested state exists |
46
|
|
|
|
47
|
|
|
$id = ustr2int(try_request('id')); |
48
|
|
|
$state = state_find($id); |
49
|
|
|
|
50
|
|
|
if (!$state) |
|
|
|
|
51
|
|
|
{ |
52
|
|
|
debug_write_log(DEBUG_NOTICE, 'State cannot be found.'); |
53
|
|
|
header('Location: index.php'); |
54
|
|
|
exit; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
// page's title |
58
|
|
|
|
59
|
|
|
$title = ustrprocess(get_html_resource(RES_STATE_X_ID), ustr2html($state['state_name'])); |
60
|
|
|
|
61
|
|
|
// generate breadcrumbs and tabs |
62
|
|
|
|
63
|
|
|
$xml = gen_context_menu('tview.php?id=', 'sview.php?id=', 'fview.php?id=', $state['project_id'], $state['template_id'], $id) |
64
|
|
|
. '<breadcrumbs>' |
65
|
|
|
. '<breadcrumb url="index.php">' . get_html_resource(RES_PROJECTS_ID) . '</breadcrumb>' |
66
|
|
|
. '<breadcrumb url="view.php?id=' . $state['project_id'] . '">' . ustrprocess(get_html_resource(RES_PROJECT_X_ID), ustr2html($state['project_name'])) . '</breadcrumb>' |
67
|
|
|
. '<breadcrumb url="tview.php?id=' . $state['template_id'] . '">' . ustrprocess(get_html_resource(RES_TEMPLATE_X_ID), ustr2html($state['template_name'])) . '</breadcrumb>' |
68
|
|
|
. '<breadcrumb url="sview.php?id=' . $id . '">' . $title . '</breadcrumb>' |
69
|
|
|
. '</breadcrumbs>' |
70
|
|
|
. '<tabs>' |
71
|
|
|
. '<tab url="state.php?id=' . $id . '">' . ustr2html($state['state_name']) . '</tab>' |
72
|
|
|
. '<tab url="findex.php?id=' . $id . '">' . get_html_resource(RES_FIELDS_ID) . '</tab>'; |
73
|
|
|
|
74
|
|
|
if ($state['state_type'] != STATE_TYPE_FINAL) |
75
|
|
|
{ |
76
|
|
|
$xml .= '<tab url="strans.php?id=' . $id . '">' . get_html_resource(RES_TRANSITIONS_ID) . '</tab>'; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
if ($state['responsible'] == STATE_RESPONSIBLE_ASSIGN) |
80
|
|
|
{ |
81
|
|
|
$xml .= '<tab url="assignees.php?id=' . $id . '">' . get_html_resource(RES_RESPONSIBLE_ID) . '</tab>'; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
$xml .= '</tabs>'; |
85
|
|
|
|
86
|
|
|
echo(xml2html($xml, $title)); |
87
|
|
|
|
88
|
|
|
?> |
89
|
|
|
|
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.