4 |
andreas |
1 |
<?
|
|
|
2 |
require_once('version.inc');
|
|
|
3 |
require_once('dbaccess.inc');
|
|
|
4 |
require_once('language.inc');
|
|
|
5 |
require_once('header.inc');
|
|
|
6 |
require_once('settings.inc');
|
|
|
7 |
require_once('helper.inc');
|
|
|
8 |
require_once('crypt.inc');
|
|
|
9 |
|
|
|
10 |
$drm = array(false, false, true, true, true, true, true, true);
|
|
|
11 |
|
|
|
12 |
require_once('menu.inc');
|
|
|
13 |
require_once('knumber.inc');
|
|
|
14 |
|
|
|
15 |
$func = $_REQUEST['func'];
|
|
|
16 |
|
|
|
17 |
function EditTask($pt_num, $neu=false) {
|
|
|
18 |
$menu = $_REQUEST['menu'];
|
|
|
19 |
global $unum;
|
|
|
20 |
global $rstufe;
|
|
|
21 |
global $phase;
|
|
|
22 |
global $numphase;
|
|
|
23 |
|
|
|
24 |
$pt_lfd = $_REQUEST['pt_lfd'];
|
|
|
25 |
$pt_level = $_REQUEST['pt_level'];
|
|
|
26 |
$pt_name = $_REQUEST['pt_name'];
|
|
|
27 |
$pt_color = $_REQUEST['pt_color'];
|
|
|
28 |
$pt_meeting = $_REQUEST['pt_meeting'];
|
|
|
29 |
$pt_phase = $_REQUEST['pt_phase'];
|
|
|
30 |
$color = $_REQUEST['color'];
|
|
|
31 |
|
|
|
32 |
if (!isset($color) || strlen($color) <= 0)
|
|
|
33 |
$color = "ffffcc";
|
|
|
34 |
|
|
|
35 |
if ($neu) {
|
|
|
36 |
$pt_tnum = $pt_num;
|
|
|
37 |
$pt_num = 0;
|
|
|
38 |
}
|
|
|
39 |
else
|
|
|
40 |
$pt_tnum = $_REQUEST['pt_tnum'];
|
|
|
41 |
|
|
|
42 |
if (!isset($pt_lfd) || $pt_lfd <= 0)
|
|
|
43 |
$pt_lfd = 1;
|
|
|
44 |
|
|
|
45 |
$db = OpenDB();
|
|
|
46 |
|
|
|
47 |
if (!$neu) {
|
|
|
48 |
$query = "select pt_tnum, pt_lfd, pt_level, pt_name, pt_color, ";
|
|
|
49 |
$query .= "pt_meeting, pt_phase from ptemp where pt_num = $pt_num";
|
|
|
50 |
$result = QueryDB($db, $query);
|
|
|
51 |
|
|
|
52 |
if (!$result) {
|
|
|
53 |
closeDB($db);
|
|
|
54 |
return;
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
$numrows = numrowsDB($result);
|
|
|
58 |
|
|
|
59 |
if ($numrows != 1) {
|
|
|
60 |
Error("Interner Fehler: Task \"$pt_num\" existiert nicht!<br>");
|
|
|
61 |
closeDB($db);
|
|
|
62 |
return;
|
|
|
63 |
}
|
|
|
64 |
|
|
|
65 |
$data = fetchDB($result, 0);
|
|
|
66 |
$pt_tnum = $data[0];
|
|
|
67 |
$pt_lfd = $data[1];
|
|
|
68 |
$pt_level = $data[2];
|
|
|
69 |
$pt_name = $data[3];
|
|
|
70 |
$pt_color = $data[4];
|
|
|
71 |
$pt_meeting = $data[5];
|
|
|
72 |
$pt_phase = $data[6];
|
|
|
73 |
$color = dechex($pt_color);
|
|
|
74 |
$len = strlen($color);
|
|
|
75 |
|
|
|
76 |
while ($len < 6) {
|
|
|
77 |
$color = "0" . $color;
|
|
|
78 |
$len++;
|
|
|
79 |
}
|
|
|
80 |
}
|
|
|
81 |
else if (isset($pt_color)) {
|
|
|
82 |
$color = dechex($pt_color);
|
|
|
83 |
$len = strlen($color);
|
|
|
84 |
|
|
|
85 |
while ($len < 6) {
|
|
|
86 |
$color = "0" . $color;
|
|
|
87 |
$len++;
|
|
|
88 |
}
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
if (isset($pt_meeting) && ($pt_meeting == "t" || $pt_meeting == "f")) {
|
|
|
92 |
if ($pt_meeting == "f")
|
|
|
93 |
$pt_meeting = 0;
|
|
|
94 |
else
|
|
|
95 |
$pt_meeting = 1;
|
|
|
96 |
}
|
|
|
97 |
|
|
|
98 |
# Den Namen des Templates hinschreiben
|
|
|
99 |
if (!$neu) {
|
|
|
100 |
$query = "select te_name from tempidx where te_num = $pt_tnum";
|
|
|
101 |
$result = QueryDB($db, $query);
|
|
|
102 |
|
|
|
103 |
if (!$result) {
|
|
|
104 |
closeDB($db);
|
|
|
105 |
return;
|
|
|
106 |
}
|
|
|
107 |
|
|
|
108 |
$data = fetchDB($result, 0);
|
|
|
109 |
$te_name = $data[0];
|
|
|
110 |
echo "<p class=\"cry\">Template: $te_name</p>";
|
|
|
111 |
}
|
|
|
112 |
?>
|
|
|
113 |
<br>
|
|
|
114 |
<form name="Task" action="templates.php" method="post">
|
|
|
115 |
<input type="hidden" name="pt_num" value="<? echo "$pt_num"; ?>">
|
|
|
116 |
<input type="hidden" name="pt_tnum" value="<? echo "$pt_tnum"; ?>">
|
|
|
117 |
<input type="hidden" name="headline" value="28">
|
|
|
118 |
<input type="hidden" name="menu" value="<? echo "$menu"; ?>">
|
|
|
119 |
<input type="hidden" name="pt_lfd" value="<? echo "$pt_lfd"; ?>">
|
|
|
120 |
<input type="hidden" name="func" value="SaveTask">
|
|
|
121 |
|
|
|
122 |
<table class="input">
|
|
|
123 |
<tr>
|
|
|
124 |
<td>Level:</td>
|
|
|
125 |
<td><input type="text" class="inputmust" name="pt_level" value="<? echo "$pt_level"; ?>" size=1 maxlength=1></td>
|
|
|
126 |
</tr>
|
|
|
127 |
<tr>
|
|
|
128 |
<td>Taskname:</td>
|
|
|
129 |
<td><input type="text" class="inputmust" name="pt_name" value="<? echo "$pt_name"; ?>" size=40 maxlength=50></td>
|
|
|
130 |
</tr>
|
|
|
131 |
<tr>
|
|
|
132 |
<td>Farbe:</td>
|
|
|
133 |
<td><input type="text" name="color" value="<? echo "$color"; ?>" size=8 maxlength=6>
|
|
|
134 |
<?php
|
|
|
135 |
echo "<button type=\"button\" onClick=\"javascript:open_window('templates.php?header=1&func=GetColor&target=window.opener.document.Task.color', 'Farbwahl', 217, 57)\">";
|
|
|
136 |
echo "<img src=\"image/coloredit.png\" border=0 width=15 height=15 alt=\"Farbwahl\"></button>";
|
|
|
137 |
?>
|
|
|
138 |
</td>
|
|
|
139 |
</tr>
|
|
|
140 |
<tr>
|
|
|
141 |
<td>Meilenstein:</td>
|
|
|
142 |
<?php
|
|
|
143 |
if ($pt_meeting) {
|
|
|
144 |
echo "<td><input type=\"checkbox\" name=\"pt_meeting\" value=\"1\" checked></td>\n";
|
|
|
145 |
} else {
|
|
|
146 |
echo "<td><input type=\"checkbox\" name=\"pt_meeting\" value=\"1\"></td>\n";
|
|
|
147 |
}
|
|
|
148 |
?>
|
|
|
149 |
</tr>
|
|
|
150 |
<?php
|
|
|
151 |
if ($phase == 1) {
|
|
|
152 |
echo "<tr><td>Phase:</td>\n<td>";
|
|
|
153 |
$query = "select kp_num, kp_phase from key_phase order by kp_num";
|
|
|
154 |
$result = QueryDB($db, $query);
|
|
|
155 |
|
|
|
156 |
if (!$result)
|
|
|
157 |
return;
|
|
|
158 |
|
|
|
159 |
$numrows = numrowsDB($result);
|
|
|
160 |
$row = 0;
|
|
|
161 |
echo "<select name=\"pt_phase\">\n";
|
|
|
162 |
|
|
|
163 |
while ($row < $numrows) {
|
|
|
164 |
$data = fetchDB($result, $row);
|
|
|
165 |
$kp_num = $data[0];
|
|
|
166 |
$kp_phase = $data[1];
|
|
|
167 |
|
|
|
168 |
if ($pt_phase == $kp_num)
|
|
|
169 |
echo "<option value=\"$kp_num\" selected>$kp_num. $kp_phase</option>\n";
|
|
|
170 |
else
|
|
|
171 |
echo "<option value=\"$kp_num\">$kp_num. $kp_phase</option>\n";
|
|
|
172 |
|
|
|
173 |
$row++;
|
|
|
174 |
}
|
|
|
175 |
|
|
|
176 |
echo "</td></tr>\n";
|
|
|
177 |
}
|
|
|
178 |
?>
|
|
|
179 |
<tr>
|
|
|
180 |
</table>
|
|
|
181 |
<table class="indent"><tr><td>
|
|
|
182 |
<?
|
|
|
183 |
ButtonSubmit("Task Speichern", "Task");
|
|
|
184 |
?>
|
|
|
185 |
</td></tr></table>
|
|
|
186 |
</form>
|
|
|
187 |
<?php
|
|
|
188 |
closeDB($db);
|
|
|
189 |
}
|
|
|
190 |
|
|
|
191 |
function EditTemplate($te_num, $edit=true) {
|
|
|
192 |
$headline = $_REQUEST['headline'];
|
|
|
193 |
$menu = $_REQUEST['menu'];
|
|
|
194 |
global $unum;
|
|
|
195 |
global $rstufe;
|
|
|
196 |
global $phase;
|
|
|
197 |
global $numphase;
|
|
|
198 |
|
|
|
199 |
$nav = "te_num=$te_num&menu=$menu&headline=$headline";
|
|
|
200 |
|
|
|
201 |
if (!isset($te_num) || $te_num < 1) {
|
|
|
202 |
Error("Interner Fehler! Templatenummer fehlt oder ist ungültig!<br>");
|
|
|
203 |
return;
|
|
|
204 |
}
|
|
|
205 |
|
|
|
206 |
$db = OpenDB();
|
|
|
207 |
# Den Namen des Templates hinschreiben.
|
|
|
208 |
$query = "select te_name from tempidx where te_num = $te_num";
|
|
|
209 |
$result = QueryDB($db, $query);
|
|
|
210 |
|
|
|
211 |
if (!$result) {
|
|
|
212 |
closeDB($db);
|
|
|
213 |
return;
|
|
|
214 |
}
|
|
|
215 |
|
|
|
216 |
$data = fetchDB($result, 0);
|
|
|
217 |
$te_name = $data[0];
|
|
|
218 |
|
|
|
219 |
echo "<p class=\"cry\">Template: $te_name</p>\n";
|
|
|
220 |
|
|
|
221 |
# Das Template optisch aufbauen.
|
|
|
222 |
$query = "select pt_num, pt_tnum, pt_lfd, pt_level, pt_name, pt_color, ";
|
|
|
223 |
$query .= "pt_meeting, pt_phase from ptemp where pt_tnum = $te_num ";
|
|
|
224 |
$query .= "order by pt_lfd";
|
|
|
225 |
$result = QueryDB($db, $query);
|
|
|
226 |
|
|
|
227 |
if (!$result) {
|
|
|
228 |
closeDB($db);
|
|
|
229 |
return;
|
|
|
230 |
}
|
|
|
231 |
|
|
|
232 |
$numrows = numrowsDB($result);
|
|
|
233 |
$row = 0;
|
|
|
234 |
$pt_lfd = 0;
|
|
|
235 |
|
|
|
236 |
if ($numrows > 0) {
|
|
|
237 |
$db2 = OpenDB();
|
|
|
238 |
|
|
|
239 |
/* if ($edit) {
|
|
|
240 |
echo "<table class=\"indent\"><tr><td>\n";
|
|
|
241 |
ButtonLink("Task Einfügen", "templates.php", "taskadd=$pt_tnum&pt_lfd=1&$nav");
|
|
|
242 |
// echo "<a href=\"#\" onClick=\"javascript:MoveTo('template.php','taskadd=$pt_tnum&pt_lfd=1&$nav')\"><img src=\"image/button_taskinsert.png\" border=0 alt=\"Einfuegen\"></a>\n";
|
|
|
243 |
echo "</td></tr></table>\n";
|
|
|
244 |
}
|
|
|
245 |
*/
|
|
|
246 |
?>
|
|
|
247 |
<table class="sel">
|
|
|
248 |
<tr>
|
|
|
249 |
<?php
|
|
|
250 |
if ($edit)
|
|
|
251 |
echo "<th class=\"sel\">Aktion</th>\n";
|
|
|
252 |
?>
|
|
|
253 |
<th class="sel">Nr.</center></th>
|
|
|
254 |
<th class="sel">Taskname</th>
|
|
|
255 |
<th class="sel">Typ</th>
|
|
|
256 |
</tr>
|
|
|
257 |
<?php
|
|
|
258 |
$snum = "1";
|
|
|
259 |
$olevel = 0;
|
|
|
260 |
|
|
|
261 |
while ($row < $numrows) {
|
|
|
262 |
$data = fetchDB($result, $row);
|
|
|
263 |
$pt_num = $data[0];
|
|
|
264 |
$pt_tnum = $data[1];
|
|
|
265 |
$pt_lfd = $data[2];
|
|
|
266 |
$pt_level = $data[3];
|
|
|
267 |
$pt_name = $data[4];
|
|
|
268 |
$pt_color = $data[5];
|
|
|
269 |
|
|
|
270 |
if ($data[6] == "t")
|
|
|
271 |
$pt_meeting = 1;
|
|
|
272 |
else
|
|
|
273 |
$pt_meeting = 0;
|
|
|
274 |
|
|
|
275 |
$pt_phase = $data[7];
|
|
|
276 |
|
|
|
277 |
$query = "select pt_level from ptemp where pt_tnum = $te_num and pt_lfd > $pt_lfd order by pt_lfd";
|
|
|
278 |
$result2 = QueryDB($db2, $query);
|
|
|
279 |
$nr = numrowsDB($result2);
|
|
|
280 |
|
|
|
281 |
if ($nr > 0) {
|
|
|
282 |
$data = fetchDB($result2, 0);
|
|
|
283 |
$xlevel = $data[0];
|
|
|
284 |
} else {
|
|
|
285 |
$xlevel = $pt_level;
|
|
|
286 |
}
|
|
|
287 |
|
|
|
288 |
if ($olevel == 0) {
|
|
|
289 |
$level = 0;
|
|
|
290 |
$olevel = $pt_level;
|
|
|
291 |
$dir = -3;
|
|
|
292 |
} else if ($olevel < $pt_level) {
|
|
|
293 |
$level = $pt_level - 1;
|
|
|
294 |
$olevel = $pt_level;
|
|
|
295 |
$dir = -3;
|
|
|
296 |
} else if ($olevel == $pt_level) {
|
|
|
297 |
$level = $pt_level - 1;
|
|
|
298 |
$dir = 0;
|
|
|
299 |
} else if ($olevel > $pt_level) {
|
|
|
300 |
$level = $pt_level - 1;
|
|
|
301 |
$olevel = $pt_level;
|
|
|
302 |
$dir = -1;
|
|
|
303 |
}
|
|
|
304 |
|
|
|
305 |
echo "<tr>";
|
|
|
306 |
|
|
|
307 |
if ($edit) {
|
|
|
308 |
echo "<td class=\"selakt\"><table border=0 cellspacing=0 cellpadding=0><tr>\n";
|
|
|
309 |
echo "<td><a href=\"#\" onClick=\"javascript:MoveTo('templates.php','taskadd=$pt_tnum&pt_lfd=$pt_lfd&$nav')\"><img src=\"image/new.png\" border=0 alt=\"Neu\"></a></td>\n";
|
|
|
310 |
echo "<td><a href=\"#\" onClick=\"javascript:MoveTo('templates.php','edittask=$pt_num&$nav')\"><img src=\"image/edit.png\" border=0 alt=\"Edit\"></a></td>\n";
|
|
|
311 |
echo "<td><a href=\"#\" onClick=\"javascript:MoveTo('templates.php','deletetask=$pt_num&pt_tnum=$pt_tnum&$nav')\"><img src=\"image/editdelete.png\" border=0 alt=\"Delete\"></a></td>\n";
|
|
|
312 |
echo "</tr></table>\n";
|
|
|
313 |
echo "</td>\n";
|
|
|
314 |
}
|
|
|
315 |
|
|
|
316 |
$snum = kNumber ($snum, $level, $dir);
|
|
|
317 |
|
|
|
318 |
if ($phase == 1 && $numphase == 1 && isset($pt_phase)) {
|
|
|
319 |
if (strpos($snum, ".")) {
|
|
|
320 |
$sarr = explode(".", $snum);
|
|
|
321 |
$sarr[0] = (string)$pt_phase;
|
|
|
322 |
$snum = implode(".", $sarr);
|
|
|
323 |
} else {
|
|
|
324 |
$snum = (string)$pt_phase;
|
|
|
325 |
}
|
|
|
326 |
}
|
|
|
327 |
|
|
|
328 |
echo "<td class=\"sel\">$snum</td>\n<td class=\"sel\">$pt_name</td>\n";
|
|
|
329 |
|
|
|
330 |
if ($pt_meeting) {
|
|
|
331 |
echo "<td class=\"sel\"><b>Meilenstein</b></td>\n";
|
|
|
332 |
} else if ($pt_level == 1 || $xlevel > $pt_level) {
|
|
|
333 |
echo "<td class=\"sel\"><i>Ordner</i></td>\n";
|
|
|
334 |
} else {
|
|
|
335 |
echo "<td class=\"sel\">Task</td>\n";
|
|
|
336 |
}
|
|
|
337 |
|
|
|
338 |
echo "</tr>\n";
|
|
|
339 |
$row++;
|
|
|
340 |
}
|
|
|
341 |
|
|
|
342 |
$pt_lfd++;
|
|
|
343 |
echo "</table>\n";
|
|
|
344 |
|
|
|
345 |
if ($edit) {
|
|
|
346 |
echo "<table class=\"indent\"><tr><td>\n";
|
|
|
347 |
ButtonLink("Task Anhängen", "templates.php", "taskadd=$pt_tnum&pt_lfd=$pt_lfd&$nav");
|
|
|
348 |
echo "</td></tr></table>\n";
|
|
|
349 |
// echo "<a href=\"#\" onClick=\"javascript:MoveTo('templates.php','taskadd=$pt_tnum&pt_lfd=$pt_lfd&$nav')\"><img src=\"image/button_taskappend.png\" border=0 alt=\"Einfuegen\"></a>\n";
|
|
|
350 |
}
|
|
|
351 |
|
|
|
352 |
echo "</form>\n";
|
|
|
353 |
closeDB($db);
|
|
|
354 |
closeDB($db2);
|
|
|
355 |
} else {
|
|
|
356 |
closeDB($db);
|
|
|
357 |
EditTask($te_num, true);
|
|
|
358 |
}
|
|
|
359 |
}
|
|
|
360 |
|
|
|
361 |
function SaveTask() {
|
|
|
362 |
global $phase;
|
|
|
363 |
$pt_num = $_REQUEST['pt_num'];
|
|
|
364 |
$pt_tnum = $_REQUEST['pt_tnum'];
|
|
|
365 |
$pt_lfd = $_REQUEST['pt_lfd'];
|
|
|
366 |
$pt_level = $_REQUEST['pt_level'];
|
|
|
367 |
$pt_name = $_REQUEST['pt_name'];
|
|
|
368 |
$pt_color = $_REQUEST['pt_color'];
|
|
|
369 |
$color = $_REQUEST['color'];
|
|
|
370 |
$pt_meeting = $_REQUEST['pt_meeting'];
|
|
|
371 |
$pt_phase = $_REQUEST['pt_phase'];
|
|
|
372 |
|
|
|
373 |
# Plausibilitaetspruefungen
|
|
|
374 |
$err = 0;
|
|
|
375 |
|
|
|
376 |
if (!isset($pt_tnum) || $pt_tnum < 1) {
|
|
|
377 |
Error("Interner Fehler: Template-Indexnummer fehlt!<br>");
|
|
|
378 |
$err = 1;
|
|
|
379 |
}
|
|
|
380 |
|
|
|
381 |
if (!isset($pt_lfd) || $pt_lfd < 1) {
|
|
|
382 |
Error("Interner Fehler: Keine oder ungültige ID-Nummer!<br>");
|
|
|
383 |
$err = 1;
|
|
|
384 |
}
|
|
|
385 |
|
|
|
386 |
if (strlen($pt_name) < 1) {
|
|
|
387 |
Error("Ein Task muss einen Namen haben!<br>");
|
|
|
388 |
$err = 1;
|
|
|
389 |
}
|
|
|
390 |
|
|
|
391 |
if (!isset($pt_color) && strlen($color) != 6) {
|
|
|
392 |
Error("Ungueltiger Farbcode!<br>");
|
|
|
393 |
$err = 1;
|
|
|
394 |
}
|
|
|
395 |
|
|
|
396 |
if ($err == 1) {
|
|
|
397 |
return false;
|
|
|
398 |
}
|
|
|
399 |
|
|
|
400 |
# Umwandlungen
|
|
|
401 |
if (!isset($pt_color))
|
|
|
402 |
$pt_color = hexdec($color);
|
|
|
403 |
|
|
|
404 |
if (!isset($pt_meeting))
|
|
|
405 |
$pt_meeting = 0;
|
|
|
406 |
|
|
|
407 |
$db = OpenDB();
|
|
|
408 |
|
|
|
409 |
# Aendern wir einen bestehenden Datensatz, oder speichern wir einen
|
|
|
410 |
# neuen?
|
|
|
411 |
if (isset($pt_num) && $pt_num > 0) { // neuer Datensatz?
|
|
|
412 |
$query = "select pt_num from ptemp where pt_num = $pt_num";
|
|
|
413 |
$result = QueryDB($db, $query);
|
|
|
414 |
|
|
|
415 |
if (!$result) {
|
|
|
416 |
closeDB($db);
|
|
|
417 |
return false;
|
|
|
418 |
}
|
|
|
419 |
|
|
|
420 |
$numrows = numrowsDB($result);
|
|
|
421 |
|
|
|
422 |
# Gibt es den Datensatz bereits, dann aendern wir ihn.
|
|
|
423 |
if ($numrows == 1) {
|
|
|
424 |
$query = "update ptemp set pt_name = '$pt_name', pt_color = '$pt_color',";
|
|
|
425 |
$query .= "pt_meeting = '$pt_meeting', pt_level = $pt_level,";
|
|
|
426 |
|
|
|
427 |
if ($phase == 1)
|
|
|
428 |
$query .= "pt_tnum = $pt_tnum, pt_lfd = $pt_lfd, pt_phase = $pt_phase ";
|
|
|
429 |
else
|
|
|
430 |
$query .= "pt_tnum = $pt_tnum, pt_lfd = $pt_lfd ";
|
|
|
431 |
|
|
|
432 |
$query .= "where pt_num = $pt_num";
|
|
|
433 |
|
|
|
434 |
if (!TQueryDB($db, $query)) {
|
|
|
435 |
closeDB($db);
|
|
|
436 |
return false;
|
|
|
437 |
}
|
|
|
438 |
|
|
|
439 |
closeDB($db);
|
|
|
440 |
return true;
|
|
|
441 |
}
|
|
|
442 |
}
|
|
|
443 |
|
|
|
444 |
# Der Datensatz existiert nicht und deshalb fuegen wir ihn ein. Es
|
|
|
445 |
# muss jedoch geprueft werden, ob die ID bereits existiert. Existiert
|
|
|
446 |
# sie, muessen alle IDs >= $pt_lfd um 1 erhoeht werden und der
|
|
|
447 |
# Datensatz anschliessend eingefuegt werden.
|
|
|
448 |
$query = "select pt_lfd from ptemp where pt_tnum = $pt_tnum and pt_lfd = $pt_lfd";
|
|
|
449 |
$result = QueryDB($db, $query);
|
|
|
450 |
|
|
|
451 |
if (!$result) {
|
|
|
452 |
closeDB($db);
|
|
|
453 |
return false;
|
|
|
454 |
}
|
|
|
455 |
|
|
|
456 |
$numrows = numrowsDB($result);
|
|
|
457 |
|
|
|
458 |
if ($numrows == 1) {
|
|
|
459 |
# Alle IDs um 1 nach hinten schieben!
|
|
|
460 |
$query = "select pt_num, pt_lfd from ptemp where pt_tnum = $pt_tnum and pt_lfd >= $pt_lfd order by pt_lfd desc";
|
|
|
461 |
$result = QueryDB($db, $query);
|
|
|
462 |
|
|
|
463 |
if (!$result) {
|
|
|
464 |
closeDB($db);
|
|
|
465 |
return false;
|
|
|
466 |
}
|
|
|
467 |
|
|
|
468 |
$numrows = numrowsDB($result);
|
|
|
469 |
$row = 0;
|
|
|
470 |
$db2 = OpenDB();
|
|
|
471 |
|
|
|
472 |
while ($row < $numrows) {
|
|
|
473 |
$data = fetchDB($result, $row);
|
|
|
474 |
$num = $data[0];
|
|
|
475 |
$id = $data[1] + 1;
|
|
|
476 |
$query = "update ptemp set pt_lfd = $id where pt_num = $num";
|
|
|
477 |
|
|
|
478 |
if (!TQueryDB($db2, $query)) {
|
|
|
479 |
closeDB($db);
|
|
|
480 |
closeDB($db2);
|
|
|
481 |
return false;
|
|
|
482 |
}
|
|
|
483 |
|
|
|
484 |
$row++;
|
|
|
485 |
}
|
|
|
486 |
|
|
|
487 |
closeDB($db2);
|
|
|
488 |
}
|
|
|
489 |
|
|
|
490 |
# Nun wird der neue Datensatz tatsaechlich geschrieben.
|
|
|
491 |
$query = "select co_ptemp from counter";
|
|
|
492 |
$result = QueryDB($db, $query);
|
|
|
493 |
|
|
|
494 |
if (!$result) {
|
|
|
495 |
closeDB($db);
|
|
|
496 |
return false;
|
|
|
497 |
}
|
|
|
498 |
|
|
|
499 |
$data = fetchDB($result, 0);
|
|
|
500 |
$pt_num = $data[0] + 1;
|
|
|
501 |
|
|
|
502 |
QueryDB($db, "begin");
|
|
|
503 |
$query = "insert into ptemp (pt_num, pt_tnum, pt_lfd, ";
|
|
|
504 |
$query .= "pt_name, pt_color, pt_meeting,";
|
|
|
505 |
$query .= "pt_level, pt_phase) values (";
|
|
|
506 |
$query .= "$pt_num, $pt_tnum, $pt_lfd, ";
|
|
|
507 |
$query .= "'$pt_name', $pt_color, ";
|
|
|
508 |
$query .= "'$pt_meeting', ";
|
|
|
509 |
|
|
|
510 |
if ($phase == 1)
|
|
|
511 |
$query .= "$pt_level, $pt_phase)";
|
|
|
512 |
else
|
|
|
513 |
$query .= "$pt_level, 0)";
|
|
|
514 |
|
|
|
515 |
if (!QueryDB($db, $query)) {
|
|
|
516 |
QueryDB($db, "rollback");
|
|
|
517 |
closeDB($db);
|
|
|
518 |
return false;
|
|
|
519 |
}
|
|
|
520 |
|
|
|
521 |
$query = "update counter set co_ptemp = $pt_num";
|
|
|
522 |
|
|
|
523 |
if (!QueryDB($db, $query)) {
|
|
|
524 |
QueryDB($db, "rollback");
|
|
|
525 |
closeDB($db);
|
|
|
526 |
return false;
|
|
|
527 |
}
|
|
|
528 |
|
|
|
529 |
QueryDB($db, "commit");
|
|
|
530 |
closeDB($db);
|
|
|
531 |
return true;
|
|
|
532 |
}
|
|
|
533 |
|
|
|
534 |
function AskDeleteTask($pt_num) {
|
|
|
535 |
$headline = $_REQUEST['headline'];
|
|
|
536 |
$menu = $_REQUEST['menu'];
|
|
|
537 |
$pt_tnum = $_REQUEST['pt_tnum'];
|
|
|
538 |
$nav = "pt_num=$pt_num&pt_tnum=$pt_tnum&func=DeleteTask&menu=$menu&headline=28";
|
|
|
539 |
|
|
|
540 |
$db = OpenDB();
|
|
|
541 |
$query = "select te_name from tempidx where te_num = $pt_tnum";
|
|
|
542 |
$result = QueryDB($db, $query);
|
|
|
543 |
|
|
|
544 |
if (!$result) {
|
|
|
545 |
closeDB($db);
|
|
|
546 |
return;
|
|
|
547 |
}
|
|
|
548 |
|
|
|
549 |
$data = fetchDB($result, 0);
|
|
|
550 |
$te_name = $data[0];
|
|
|
551 |
echo "<p class=\"cry\">Template: $te_name</p>";
|
|
|
552 |
closeDB($db);
|
|
|
553 |
?>
|
|
|
554 |
<br>
|
|
|
555 |
<form action="templates.php" method="post">
|
|
|
556 |
<table border=2 class="alarm">
|
|
|
557 |
<tr><td colspan=2><big>Warnung!</big><br><br>
|
|
|
558 |
Sie sind im Begriff einen Task zu löschen!<br><br>
|
|
|
559 |
Wollen Sie wirklich diesen Task unwiederbringlich löschen?<br>
|
|
|
560 |
</td>
|
|
|
561 |
</tr>
|
|
|
562 |
<tr>
|
|
|
563 |
<td><center><input type="button" name="yes" value="Löschen" onClick="javascript:MoveTo('templates.php','yes=yes&<? echo "$nav"; ?>')"></center></td>
|
|
|
564 |
<td><center><input type="button" name="no" value="Abbruch" onClick="javascript:MoveTo('templates.php','no=no&<? echo "$nav"; ?>')"></center></td>
|
|
|
565 |
</tr>
|
|
|
566 |
</table>
|
|
|
567 |
</form>
|
|
|
568 |
<?php
|
|
|
569 |
}
|
|
|
570 |
|
|
|
571 |
function DeleteTask() {
|
|
|
572 |
$pt_num = $_REQUEST['pt_num'];
|
|
|
573 |
|
|
|
574 |
if (!isset($pt_num) || $pt_num <= 0) {
|
|
|
575 |
Error("Error: Interner Fehler: Ungültige oder fehlende Seriennummer!");
|
|
|
576 |
return false;
|
|
|
577 |
}
|
|
|
578 |
|
|
|
579 |
$db = OpenDB();
|
|
|
580 |
QueryDB($db, "begin");
|
|
|
581 |
$query = "delete from ptemp where pt_num = $pt_num";
|
|
|
582 |
$result = QueryDB($db, $query);
|
|
|
583 |
|
|
|
584 |
if (!$result) {
|
|
|
585 |
QueryDB($db, "rollback");
|
|
|
586 |
closeDB($db);
|
|
|
587 |
return false;
|
|
|
588 |
}
|
|
|
589 |
|
|
|
590 |
QueryDB($db, "commit");
|
|
|
591 |
closeDB($db);
|
|
|
592 |
return true;
|
|
|
593 |
}
|
|
|
594 |
|
|
|
595 |
function GetColor() {
|
|
|
596 |
$target = $_REQUEST['target'];
|
|
|
597 |
?>
|
|
|
598 |
<map name="farbe">
|
|
|
599 |
<area shape="rect" coords="1,1,26,10" href="javascript:Farbe('255','128','128','<? echo "$target"; ?>')">
|
|
|
600 |
<area shape="rect" coords="28,1,53,10" href="javascript:Farbe('255','255','128','<? echo "$target"; ?>')">
|
|
|
601 |
<area shape="rect" coords="55,1,80,10" href="javascript:Farbe('128','255','128','<? echo "$target"; ?>')">
|
|
|
602 |
<area shape="rect" coords="82,1,107,10" href="javascript:Farbe('0','255','128','<? echo "$target"; ?>')">
|
|
|
603 |
<area shape="rect" coords="109,1,134,10" href="javascript:Farbe('128','255','255','<? echo "$target"; ?>')">
|
|
|
604 |
<area shape="rect" coords="136,1,161,10" href="javascript:Farbe('0','128','255','<? echo "$target"; ?>')">
|
|
|
605 |
<area shape="rect" coords="163,1,188,10" href="javascript:Farbe('255','128','192','<? echo "$target"; ?>')">
|
|
|
606 |
<area shape="rect" coords="190,1,215,10" href="javascript:Farbe('255','128','255','<? echo "$target"; ?>')">
|
|
|
607 |
<area shape="rect" coords="1,12,26,21" href="javascript:Farbe('255','0','0','<? echo "$target"; ?>')">
|
|
|
608 |
<area shape="rect" coords="28,12,53,21" href="javascript:Farbe('255','255','0''<? echo "$target"; ?>')">
|
|
|
609 |
<area shape="rect" coords="55,12,80,21" href="javascript:Farbe('128','255','0','<? echo "$target"; ?>')">
|
|
|
610 |
<area shape="rect" coords="82,12,107,21" href="javascript:Farbe('0','255','64','<? echo "$target"; ?>')">
|
|
|
611 |
<area shape="rect" coords="109,12,134,21" href="javascript:Farbe('0','255','255','<? echo "$target"; ?>')">
|
|
|
612 |
<area shape="rect" coords="136,12,161,21" href="javascript:Farbe('0','128','192','<? echo "$target"; ?>')">
|
|
|
613 |
<area shape="rect" coords="163,12,188,21" href="javascript:Farbe('128','128','192','<? echo "$target"; ?>')">
|
|
|
614 |
<area shape="rect" coords="190,12,215,21" href="javascript:Farbe('255','0','255','<? echo "$target"; ?>')">
|
|
|
615 |
<area shape="rect" coords="1,23,26,32" href="javascript:Farbe('128','64','64','<? echo "$target"; ?>')">
|
|
|
616 |
<area shape="rect" coords="28,23,53,32" href="javascript:Farbe('255','128','64','<? echo "$target"; ?>')">
|
|
|
617 |
<area shape="rect" coords="55,23,80,32" href="javascript:Farbe('0','255','0','<? echo "$target"; ?>')">
|
|
|
618 |
<area shape="rect" coords="82,23,107,32" href="javascript:Farbe('0','128','128','<? echo "$target"; ?>')">
|
|
|
619 |
<area shape="rect" coords="109,23,134,32" href="javascript:Farbe('0','64','128','<? echo "$target"; ?>')">
|
|
|
620 |
<area shape="rect" coords="136,23,161,32" href="javascript:Farbe('128','128','255','<? echo "$target"; ?>')">
|
|
|
621 |
<area shape="rect" coords="163,23,188,32" href="javascript:Farbe('128','0','64','<? echo "$target"; ?>')">
|
|
|
622 |
<area shape="rect" coords="190,23,215,32" href="javascript:Farbe('255','0','128','<? echo "$target"; ?>')">
|
|
|
623 |
<area shape="rect" coords="1,34,26,43" href="javascript:Farbe('128','0','0','<? echo "$target"; ?>')">
|
|
|
624 |
<area shape="rect" coords="28,34,53,43" href="javascript:Farbe('255','128','0','<? echo "$target"; ?>')">
|
|
|
625 |
<area shape="rect" coords="55,34,80,43" href="javascript:Farbe('0','128','0','<? echo "$target"; ?>')">
|
|
|
626 |
<area shape="rect" coords="82,34,107,43" href="javascript:Farbe('0','128','64','<? echo "$target"; ?>')">
|
|
|
627 |
<area shape="rect" coords="109,34,134,43" href="javascript:Farbe('0','0','255','<? echo "$target"; ?>')">
|
|
|
628 |
<area shape="rect" coords="136,34,161,43" href="javascript:Farbe('0','0','160','<? echo "$target"; ?>')">
|
|
|
629 |
<area shape="rect" coords="163,34,188,43" href="javascript:Farbe('128','0','128','<? echo "$target"; ?>')">
|
|
|
630 |
<area shape="rect" coords="190,34,215,43" href="javascript:Farbe('128','0','255','<? echo "$target"; ?>')">
|
|
|
631 |
<area shape="rect" coords="1,45,26,54" href="javascript:Farbe('64','0','0','<? echo "$target"; ?>')">
|
|
|
632 |
<area shape="rect" coords="28,45,53,54" href="javascript:Farbe('128','64','0','<? echo "$target"; ?>')">
|
|
|
633 |
<area shape="rect" coords="55,45,80,54" href="javascript:Farbe('0','64','0','<? echo "$target"; ?>')">
|
|
|
634 |
<area shape="rect" coords="82,45,107,54" href="javascript:Farbe('0','64','64','<? echo "$target"; ?>')">
|
|
|
635 |
<area shape="rect" coords="109,45,134,54" href="javascript:Farbe('0','0','128','<? echo "$target"; ?>')">
|
|
|
636 |
<area shape="rect" coords="136,45,161,54" href="javascript:Farbe('0','0','64','<? echo "$target"; ?>')">
|
|
|
637 |
<area shape="rect" coords="163,45,188,54" href="javascript:Farbe('64','0','64','<? echo "$target"; ?>')">
|
|
|
638 |
<area shape="rect" coords="190,45,215,54" href="javascript:Farbe('64','0','128','<? echo "$target"; ?>')">
|
|
|
639 |
<area shape="rect" coords="1,56,26,65" href="javascript:Farbe('0','0','0','<? echo "$target"; ?>')">
|
|
|
640 |
<area shape="rect" coords="28,56,53,65" href="javascript:Farbe('128','128','0','<? echo "$target"; ?>')">
|
|
|
641 |
<area shape="rect" coords="55,56,80,65" href="javascript:Farbe('128','128','64','<? echo "$target"; ?>')">
|
|
|
642 |
<area shape="rect" coords="82,56,107,65" href="javascript:Farbe('128','128','128','<? echo "$target"; ?>')">
|
|
|
643 |
<area shape="rect" coords="109,56,134,65" href="javascript:Farbe('64','128','128','<? echo "$target"; ?>')">
|
|
|
644 |
<area shape="rect" coords="136,56,161,65" href="javascript:Farbe('192','192','192','<? echo "$target"; ?>')">
|
|
|
645 |
<area shape="rect" coords="163,56,188,65" href="javascript:Farbe('64','64','64','<? echo "$target"; ?>')">
|
|
|
646 |
<area shape="rect" coords="190,56,215,65" href="javascript:Farbe('255','255','255','<? echo "$target"; ?>')">
|
|
|
647 |
</map>
|
|
|
648 |
<img src="image/farben.png" width="217" height="67" border="0" vspace="3" alt="" usemap="#farbe">
|
|
|
649 |
<form name="schliessen">
|
|
|
650 |
<input type="button" name="close" value="Schliessen" onClick="javascript:self.close()">
|
|
|
651 |
</form>
|
|
|
652 |
<?php
|
|
|
653 |
}
|
|
|
654 |
|
|
|
655 |
function TempNew($te_num=0) {
|
|
|
656 |
$menu = $_REQUEST['menu'];
|
|
|
657 |
$te_name = $_REQUEST['te_name'];
|
|
|
658 |
$te_zweck = $_REQUEST['te_zweck'];
|
|
|
659 |
|
|
|
660 |
if ($te_num > 0) {
|
|
|
661 |
$db = OpenDB();
|
|
|
662 |
$query = "select te_name, te_zweck from tempidx where te_num = $te_num";
|
|
|
663 |
$result = QueryDB($db, $query);
|
|
|
664 |
|
|
|
665 |
if (!$result) {
|
|
|
666 |
closeDB($db);
|
|
|
667 |
return;
|
|
|
668 |
}
|
|
|
669 |
|
|
|
670 |
$data = fetchDB($result, 0);
|
|
|
671 |
$te_name = $data[0];
|
|
|
672 |
$te_zweck = $data[1];
|
|
|
673 |
closeDB($db);
|
|
|
674 |
}
|
|
|
675 |
?>
|
|
|
676 |
<form name="Temp" action="templates.php" method="post">
|
|
|
677 |
<input type="hidden" name="headline" value="28">
|
|
|
678 |
<input type="hidden" name="menu" value="<? echo "$menu"; ?>">
|
|
|
679 |
<?php
|
|
|
680 |
if ($te_num > 0) {
|
|
|
681 |
echo "<input type=\"hidden\" name=\"te_num\" value=\"$te_num\">\n";
|
|
|
682 |
echo "<input type=\"hidden\" name=\"func\" value=\"tempupdate\">\n";
|
|
|
683 |
} else
|
|
|
684 |
echo "<input type=\"hidden\" name=\"func\" value=\"tempsave\">\n";
|
|
|
685 |
?>
|
|
|
686 |
<input type="hidden" name="pt_lfd" value="1">
|
|
|
687 |
|
|
|
688 |
<table class="input">
|
|
|
689 |
<tr>
|
|
|
690 |
<td>Template Name:</td>
|
|
|
691 |
<td><input type="text" class="inputmust" name="te_name" value="<? echo "$te_name"; ?>" size=40 maxlength=60></td>
|
|
|
692 |
</tr>
|
|
|
693 |
<tr>
|
|
|
694 |
<td>Beschreibung:</td>
|
|
|
695 |
<td><textarea name="te_zweck" rows=5 cols=60><? echo "$te_zweck"; ?></textarea></td>
|
|
|
696 |
</tr>
|
|
|
697 |
</table>
|
|
|
698 |
<table class="indent"><tr><td>
|
|
|
699 |
<?
|
|
|
700 |
ButtonSubmit("Speichern", "Temp");
|
|
|
701 |
?>
|
|
|
702 |
</td></tr></table>
|
|
|
703 |
</form>
|
|
|
704 |
<?php
|
|
|
705 |
}
|
|
|
706 |
|
|
|
707 |
function TempSave() {
|
|
|
708 |
global $menu;
|
|
|
709 |
$te_name = $_REQUEST['te_name'];
|
|
|
710 |
$te_zweck = $_REQUEST['te_zweck'];
|
|
|
711 |
|
|
|
712 |
if (!isset($te_name) || strlen($te_name) <= 0) {
|
|
|
713 |
Error("Sie müssen unbedingt einen Templatenamen angeben!<br>");
|
|
|
714 |
return -1;
|
|
|
715 |
}
|
|
|
716 |
|
|
|
717 |
if (!isset($te_zweck))
|
|
|
718 |
$te_zweck = "";
|
|
|
719 |
|
|
|
720 |
$db = OpenDB();
|
|
|
721 |
$query = "select co_tempidx from counter";
|
|
|
722 |
$result = QueryDB($db, $query);
|
|
|
723 |
|
|
|
724 |
if (!$result) {
|
|
|
725 |
closeDB($db);
|
|
|
726 |
return -1;
|
|
|
727 |
}
|
|
|
728 |
|
|
|
729 |
$data = fetchDB($result, 0);
|
|
|
730 |
$co_tempidx = $data[0] + 1;
|
|
|
731 |
|
|
|
732 |
QueryDB($db, "begin");
|
|
|
733 |
$query = "insert into tempidx (te_num, te_name, te_zweck) values ";
|
|
|
734 |
$query .= "($co_tempidx, '$te_name', '$te_zweck')";
|
|
|
735 |
|
|
|
736 |
if (!QueryDB($db, $query)) {
|
|
|
737 |
QueryDB($db, "rollback");
|
|
|
738 |
closeDB($db);
|
|
|
739 |
return -1;
|
|
|
740 |
}
|
|
|
741 |
|
|
|
742 |
$query = "update counter set co_tempidx = $co_tempidx";
|
|
|
743 |
|
|
|
744 |
if (!QueryDB($db, $query)) {
|
|
|
745 |
QueryDB($db, "rollback");
|
|
|
746 |
closeDB($db);
|
|
|
747 |
return -1;
|
|
|
748 |
}
|
|
|
749 |
|
|
|
750 |
QueryDB($db, "commit");
|
|
|
751 |
return $co_tempidx;
|
|
|
752 |
}
|
|
|
753 |
|
|
|
754 |
function TempUpdate() {
|
|
|
755 |
global $menu;
|
|
|
756 |
$te_num = $_REQUEST['te_num'];
|
|
|
757 |
$te_name = $_REQUEST['te_name'];
|
|
|
758 |
$te_zweck = $_REQUEST['te_zweck'];
|
|
|
759 |
|
|
|
760 |
if (!isset($te_num) || $te_num <= 0) {
|
|
|
761 |
Error("Error: Interner Fehler: Seriennummer fehlt!");
|
|
|
762 |
return false;
|
|
|
763 |
}
|
|
|
764 |
|
|
|
765 |
if (!isset($te_name) || strlen($te_name) <= 0) {
|
|
|
766 |
Error("Sie müssen unbedingt einen Templatenamen angeben!<br>");
|
|
|
767 |
return false;
|
|
|
768 |
}
|
|
|
769 |
|
|
|
770 |
if (!isset($te_zweck))
|
|
|
771 |
$te_zweck = "";
|
|
|
772 |
|
|
|
773 |
$db = OpenDB();
|
|
|
774 |
$query = "update tempidx set te_name = '$te_name', te_zweck='$te_zweck' ";
|
|
|
775 |
$query .= "where te_num = $te_num";
|
|
|
776 |
|
|
|
777 |
if (!TQueryDB($db, $query)) {
|
|
|
778 |
closeDB($db);
|
|
|
779 |
return false;
|
|
|
780 |
}
|
|
|
781 |
|
|
|
782 |
return true;
|
|
|
783 |
}
|
|
|
784 |
|
|
|
785 |
function TempDelAsk($te_num) {
|
|
|
786 |
$headline = $_REQUEST['headline'];
|
|
|
787 |
$menu = $_REQUEST['menu'];
|
|
|
788 |
$nav = "te_num=$te_num&menu=$menu&func=TempDelReal&headline=28";
|
|
|
789 |
|
|
|
790 |
if (!isset($te_num) || $te_num <= 0) {
|
|
|
791 |
Error("Interner Fehler: Es wurde keine Templatenummer übergeben!");
|
|
|
792 |
return false;
|
|
|
793 |
}
|
|
|
794 |
?>
|
|
|
795 |
<br>
|
|
|
796 |
<form action="templates.php" method="post">
|
|
|
797 |
<table border=2 class="alarm">
|
|
|
798 |
<tr><td colspan=2><big>Warnung!</big><br><br>
|
|
|
799 |
Sie sind im Begriff alle erfassten Tasks dieses Templates zu
|
|
|
800 |
löschen!<br><br>
|
|
|
801 |
Wollen Sie wirklich dieses Template mit allen Daten
|
|
|
802 |
unwiederbringlich löschen?<br>
|
|
|
803 |
</td>
|
|
|
804 |
</tr>
|
|
|
805 |
<tr>
|
|
|
806 |
<td><center><input type="button" name="yes" value="Löschen" onClick="javascript:MoveTo('templates.php','yes=yes&<? echo "$nav"; ?>')"></center></td>
|
|
|
807 |
<td><center><input type="button" name="no" value="Abbruch" onClick="javascript:MoveTo('templates.php','no=no&<? echo "$nav"; ?>')"></center></td>
|
|
|
808 |
</tr>
|
|
|
809 |
</table>
|
|
|
810 |
</form>
|
|
|
811 |
<?php
|
|
|
812 |
}
|
|
|
813 |
|
|
|
814 |
function TempDel() {
|
|
|
815 |
$te_num = $_REQUEST['te_num'];
|
|
|
816 |
|
|
|
817 |
if (!isset($te_num) || $te_num <= 0) {
|
|
|
818 |
Error("Interner Fehler: Es wurde keine Templatenummer übergeben!");
|
|
|
819 |
return false;
|
|
|
820 |
}
|
|
|
821 |
|
|
|
822 |
$db = OpenDB();
|
|
|
823 |
QueryDB($db, "begin");
|
|
|
824 |
$query = "delete from ptemp where pt_tnum = $te_num";
|
|
|
825 |
|
|
|
826 |
if (!QueryDB($db, $query)) {
|
|
|
827 |
QueryDB($db, "rollback");
|
|
|
828 |
closeDB($db);
|
|
|
829 |
return false;
|
|
|
830 |
}
|
|
|
831 |
|
|
|
832 |
$query = "delete from tempidx where te_num = $te_num";
|
|
|
833 |
|
|
|
834 |
if (!QueryDB($db, $query)) {
|
|
|
835 |
QueryDB($db, "rollback");
|
|
|
836 |
closeDB($db);
|
|
|
837 |
return false;
|
|
|
838 |
}
|
|
|
839 |
|
|
|
840 |
QueryDB($db, "commit");
|
|
|
841 |
closeDB($db);
|
|
|
842 |
return true;
|
|
|
843 |
}
|
|
|
844 |
|
|
|
845 |
$tempdel = $_REQUEST['tempdel'];
|
|
|
846 |
$tempedit = $_REQUEST['tempedit'];
|
|
|
847 |
$taskadd = $_REQUEST['taskadd'];
|
|
|
848 |
$edittask = $_REQUEST['edittask'];
|
|
|
849 |
$deletetask = $_REQUEST['deletetask'];
|
|
|
850 |
$edittemp = $_REQUEST['edittemp'];
|
|
|
851 |
|
|
|
852 |
if (isset($tempdel) && $tempdel > 0)
|
|
|
853 |
$func = "tempdel";
|
|
|
854 |
|
|
|
855 |
if (isset($tempedit) && $tempedit > 0)
|
|
|
856 |
$func = "tempedit";
|
|
|
857 |
|
|
|
858 |
if (isset($taskadd) && $taskadd > 0)
|
|
|
859 |
$func = "taskadd";
|
|
|
860 |
|
|
|
861 |
if (isset($edittask) && $edittask > 0)
|
|
|
862 |
$func = "edittask";
|
|
|
863 |
|
|
|
864 |
if (isset($deletetask) && $deletetask > 0)
|
|
|
865 |
$func = "deletetask";
|
|
|
866 |
|
|
|
867 |
if (isset($edittemp) && $edittemp > 0)
|
|
|
868 |
$func = "edittemp";
|
|
|
869 |
|
|
|
870 |
if ($func == "tempnew") {
|
|
|
871 |
TempNew();
|
|
|
872 |
}
|
|
|
873 |
|
|
|
874 |
if ($func == "edittemp")
|
|
|
875 |
TempNew($edittemp);
|
|
|
876 |
|
|
|
877 |
if ($func == "tempsave") {
|
|
|
878 |
$num = TempSave();
|
|
|
879 |
|
|
|
880 |
if ($num < 0)
|
|
|
881 |
TempNew();
|
|
|
882 |
else
|
|
|
883 |
EditTemplate($num);
|
|
|
884 |
}
|
|
|
885 |
|
|
|
886 |
if ($func == "tempupdate") {
|
|
|
887 |
$te_num = $_REQUEST['te_num'];
|
|
|
888 |
|
|
|
889 |
if (!TempUpdate())
|
|
|
890 |
TempNew($te_num);
|
|
|
891 |
}
|
|
|
892 |
|
|
|
893 |
if ($func == "tempdel") {
|
|
|
894 |
TempDelAsk($tempdel);
|
|
|
895 |
}
|
|
|
896 |
|
|
|
897 |
if ($func == "TempDelReal") {
|
|
|
898 |
if (isset($_REQUEST['yes']))
|
|
|
899 |
$x = TempDel();
|
|
|
900 |
else
|
|
|
901 |
$x = false;
|
|
|
902 |
?>
|
|
|
903 |
<form action="forms.php" method="post">
|
|
|
904 |
<input type="hidden" name="templates" value="templates">
|
|
|
905 |
<input type="hidden" name="menu" value="4">
|
|
|
906 |
<br>
|
|
|
907 |
<?
|
|
|
908 |
if ($x) {
|
|
|
909 |
?>
|
|
|
910 |
<p class="cry">Template wurde erfolgreich gelöscht!</p>
|
|
|
911 |
<?
|
|
|
912 |
}
|
|
|
913 |
?>
|
|
|
914 |
<input type="submit" name="submit" value="Weiter -->">
|
|
|
915 |
</form>
|
|
|
916 |
<?php
|
|
|
917 |
}
|
|
|
918 |
|
|
|
919 |
if ($func == "tempedit") {
|
|
|
920 |
EditTemplate($tempedit);
|
|
|
921 |
}
|
|
|
922 |
|
|
|
923 |
if ($func == "GetColor") {
|
|
|
924 |
GetColor();
|
|
|
925 |
}
|
|
|
926 |
|
|
|
927 |
if ($func == "SaveTask") {
|
|
|
928 |
if (SaveTask()) {
|
|
|
929 |
$pt_tnum = $_REQUEST['pt_tnum'];
|
|
|
930 |
EditTemplate($pt_tnum);
|
|
|
931 |
} else {
|
|
|
932 |
$pt_tnum = $_REQUEST['pt_num'];
|
|
|
933 |
EditTask($pt_tnum, true);
|
|
|
934 |
}
|
|
|
935 |
}
|
|
|
936 |
|
|
|
937 |
if ($func == "taskadd")
|
|
|
938 |
EditTask($taskadd, true);
|
|
|
939 |
|
|
|
940 |
if ($func == "edittask")
|
|
|
941 |
EditTask($edittask, false);
|
|
|
942 |
|
|
|
943 |
if ($func == "deletetask")
|
|
|
944 |
AskDeleteTask($deletetask);
|
|
|
945 |
|
|
|
946 |
if ($func == "DeleteTask") {
|
|
|
947 |
if (isset($_REQUEST['yes'])) {
|
|
|
948 |
DeleteTask();
|
|
|
949 |
}
|
|
|
950 |
|
|
|
951 |
$pt_tnum = $_REQUEST['pt_tnum'];
|
|
|
952 |
EditTemplate($pt_tnum);
|
|
|
953 |
}
|
|
|
954 |
|
|
|
955 |
require('footer.inc');
|
|
|
956 |
?>
|