-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·220 lines (185 loc) · 6.7 KB
/
index.php
File metadata and controls
executable file
·220 lines (185 loc) · 6.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?php
/**
* Display the main cleaning/coding page
*
*
* This file is part of queXC
*
* queXC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* queXC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with queXC; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*
* @author Adam Zammit <adam.zammit@deakin.edu.au>
* @copyright Deakin University 2007,2008,2009
* @package queXC
* @subpackage user
* @link http://www.deakin.edu.au/dcarf/ queXC was writen for DCARF - Deakin Computer Assisted Research Facility
* @license http://opensource.org/licenses/agpl-v3.html The GNU Affero General Public License (AGPL) Version 3
*
*/
/**
* Configuration file
*/
include ("config.inc.php");
/**
* XHTML functions
*/
include ("functions/functions.xhtml.php");
/**
* Work functions
*/
include("functions/functions.work.php");
/**
* Code functinos
*/
include("functions/functions.code.php");
/**
* Process functinos
*/
include("functions/functions.process.php");
$operator_id = get_operator_id();
if ($operator_id != false)
$work_unit_id = get_work($operator_id);
if (isset($_GET['search']))
{
if ($work_unit_id != false)
{
$codes = search_codes_all($work_unit_id,$_GET['search']);
if ($codes != false)
{
print "<ul>";
foreach($codes as $code_id => $label)
{
print "<li><a href='?code_id=$code_id'>$label</a></li>";
}
print "</ul>";
}
else
print "<a href='?'>" . T_("No results") ."</a>";
}
exit();
}
if (isset($_GET['display_codes']))
{
if ($work_unit_id != false)
{
$code_ids = explode('X',substr($_GET['display_codes'],3));
$code_id = intval($code_ids[0]);
display_all_codes($code_id,true,$work_unit_id);
print "<script type='text/javascript'>updateevents();</script>";
}
exit();
}
$code_id = false;
if (isset($_GET['code_id'])) $code_id = intval($_GET['code_id']); //get from search request
$message = false; //message to display
if (isset($_POST['work_unit_id']))
{
//If we are ending work, include endwork function and exit here
if (isset($_POST['submit_end_only']))
{
include("endwork.php");
exit();
}
//If we are adding a new code...
if (isset($_POST['submit_add_parent']) || isset($_POST['submit_add_sibling']) || isset($_POST['submit_add_multi']))
{
$code_id = add_code($_POST);
}
else if (isset($_POST['submit_refer']))
{
//refer this case to the supervisor (if one exists, otherwise just display the same case)
if (!refer_to_supervisor($_POST['work_unit_id']))
$message = T_("Could not refer to supervisor - no supervisor may be assigned");
}
else
save_work_process($_POST); //Posted - save the data
//If we are ending work, include endwork function and exit here
if (isset($_POST['submit_end']))
{
include("endwork.php");
exit();
}
}
xhtml_head(T_("queXC"), true, array("css/table.css","css/index.css","include/ajax-spell/styles.css","include/mif.menu-v1.2/Source/assets/styles/menu.css"),array('include/mif.menu-v1.2/assets/scripts/mootools.js','include/mootools/mootools-extension.js','js/index.js','include/mif.menu-v1.2/mif.menu-v1.2.js'));
//See if there is work for us, if not, display "No more work" and allow for the page to be refreshed, or work to end
if ($operator_id != false)
{
$work_unit_id = get_work($operator_id);
print "<div id='content'>";
if ($message !== false)
print "<div class='message'>$message</div>";
if ($work_unit_id == false)
{
p(T_("No more work currently available"),"p");
print "<p><a href=''>" . T_("Try again for more work") . "</a></p>";
print "<p><a href='endwork.php'>" . T_("End work") . "</a></p>";
}
else
{
print "<div id='heading'>";
//print "<h2>" . get_work_data_description($work_unit_id) . "</h2>";
print "<input type='text' value='' size='100' id='selectedText' readonly='readonly'/>";
print "</div>";
print "<div id='othervariables'>";
$othervariables = get_work_other_variables($work_unit_id);
if (!empty($othervariables))
xhtml_table($othervariables,array('name','data'));
print "</div>";
print "<div id='thiscolumn'>";
$thiscolumn = get_work_column($work_unit_id);
print "<p>{$thiscolumn['name']}: {$thiscolumn['description']}</p><h3 id='menu-target' onmouseup='getSelectedText();'>{$thiscolumn['data'][0]}</h3>";
print "</div>";
print "<form action='?' method='post' id='cleancodeform'>";
print "<p><input type='submit' name='submit' value='" . T_("Submit and continue") . "'/> <input type='submit' name='submit_end' value='" . T_("Submit and end work") . "'/> <input type='submit' name='submit_refer' value='" . T_("Refer to supervisor") . "'/> <input type='submit' name='submit_end_only' value='" . T_("End work") . "'/></p>";
print "<div id='cleancode'>";
$r = get_work_process($work_unit_id);
$cell_id = $r['cell_id'];
$process_id = $r['process_id'];
$work_id = $r['work_id'];
$cdata = get_cell_data($cell_id);
$process_function = get_process_function($process_id);
if ($process_function == false) //coding
{
//search area
print "<div id='searcharea'><label for='search'>" . T_("Search") . ":</label><input type='text' id='search' name='search'/> <span id='searchclick'>" . T_("Click here to search (or press enter)") . "</span></div>";
//coding
print "<div class='header' id='header'>";
if ($code_id == false)
display_codes($work_unit_id,$operator_id,$cdata[0]);
else
display_all_codes($code_id,true,$work_unit_id);
print "</div>";
}
else
{
if (is_callable($process_function))
call_user_func($process_function,$cell_id,$cdata[0],$work_unit_id);
else
print "<p>" . T_("Error: Cannot execute process function:") . " $process_function</p>";
}
print "<input type='hidden' name='work_unit_id' value='$work_unit_id'/></div>";
print "</form>";
}
print "</div>";
print "<div id='workhistory'>";
xhtml_object("workhistory.php","work-history");
print "<div id='performance'>";
xhtml_object("performance.php","performancetab");
print "</div>";
}
else
p(T_("No operator"),"p");
xhtml_foot();
?>