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('crypt.inc');
|
|
|
8 |
require_once('helper.inc');
|
|
|
9 |
|
|
|
10 |
if (!isset($menu)) {
|
|
|
11 |
$menu = $_REQUEST['menu'];
|
|
|
12 |
}
|
|
|
13 |
|
|
|
14 |
if (!isset($func)) {
|
|
|
15 |
$func = $_REQUEST['func'];
|
|
|
16 |
}
|
|
|
17 |
|
|
|
18 |
if (!isset($unum)) {
|
|
|
19 |
$unum = $_COOKIE['TPMunum'];
|
|
|
20 |
}
|
|
|
21 |
|
|
|
22 |
if (!isset($rstufe)) {
|
|
|
23 |
$rstufe = $_COOKIE['TPMrstufe'];
|
|
|
24 |
}
|
|
|
25 |
|
|
|
26 |
if (!isset($unum) || !isset($rstufe)) {
|
|
|
27 |
Output(-1, 141, "<p>Dieses System arbeitet mit
|
|
|
28 |
<a href=\"http://www.www-kurs.de/cookies.htm\" target=\"_blank\">Cookies</a>.
|
|
|
29 |
Leider hat ihr Browser mein <i>Cookie</i> nicht akzeptiert.
|
|
|
30 |
Bitte aktivieren Sie die Annahme von Cookies in Ihrem Browser,
|
|
|
31 |
da sonst ein Arbeiten hier nicht möglich ist.<br><br>
|
|
|
32 |
Alle hier gesetzten Cookies werden von Ihrem Browser <b>automatisch</b>
|
|
|
33 |
nach dem Abmelden oder spätestens nach 24 Stunden gelöscht
|
|
|
34 |
Was immer früher eintritt.</p>\n");
|
|
|
35 |
require('footer.inc');
|
|
|
36 |
exit;
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
$un = decrypt($unum);
|
|
|
40 |
$rs = decrypt($rstufe);
|
|
|
41 |
|
|
|
42 |
if (((isset($_REQUEST['plan']) || $menu == 2) && $rs >= 3)) { //|| ((isset($_REQUEST['verwalt']) || $menu == 4) && $rs >= 2)) {
|
|
|
43 |
$db = OpenDB();
|
|
|
44 |
$query = "select mi_hacker from mitarbeiter where mi_num = $un";
|
|
|
45 |
$result = QueryDB($db, $query);
|
|
|
46 |
$data = fetchDB($result, 0);
|
|
|
47 |
$mi_hacker = $data[0] + 1;
|
|
|
48 |
$query = "update mitarbeiter set mi_hacker = $mi_hacker where mi_num = $un";
|
|
|
49 |
TqueryDB($db, $query);
|
|
|
50 |
closeDB($db);
|
|
|
51 |
unset($db);
|
|
|
52 |
unset($query);
|
|
|
53 |
unset($result);
|
|
|
54 |
unset($data);
|
|
|
55 |
|
|
|
56 |
if ($mi_hacker > 3) {
|
|
|
57 |
$s = "Sie haben bereits mehrfach versucht dieses Programm\n";
|
|
|
58 |
$s .= "illegal zu manipulieren!<br>\n";
|
|
|
59 |
$s .= "Der Administrator wurde per E-Mail darüber informiert\n";
|
|
|
60 |
$s .= "und ihr Zugang <b>gesperrt</b>! Um wieder freigeschalten\n";
|
|
|
61 |
$s .= "zu werden, wenden sie sich bitte an ihren Administrator!";
|
|
|
62 |
echo "<p>" . GetMessage(-1, 90, $s) . "</p>";
|
|
|
63 |
unset($mi_hacker);
|
|
|
64 |
require('footer.inc');
|
|
|
65 |
exit;
|
|
|
66 |
} else {
|
|
|
67 |
Output(-1, 142, "<p><b>ACHTUNG!</b><br>Sie haben (mehrfach) versucht dieses
|
|
|
68 |
System zu manipulieren! Der Systemadministrator wurde darüber
|
|
|
69 |
bereits per E-Mail informiert. Falls sie es noch einmal versuchen,
|
|
|
70 |
wird Ihr <b>Zugang gesperrt</b>!</p>");
|
|
|
71 |
unset($mi_hacker);
|
|
|
72 |
require('footer.inc');
|
|
|
73 |
exit;
|
|
|
74 |
}
|
|
|
75 |
|
|
|
76 |
}
|
|
|
77 |
|
|
|
78 |
unset($un);
|
|
|
79 |
unset($rs);
|
|
|
80 |
unset($unum);
|
|
|
81 |
unset($rstufe);
|
|
|
82 |
|
|
|
83 |
# Hauptmenue
|
|
|
84 |
if (isset($_REQUEST['ist'])) { $knopf = 1; $headline = 10; $menu = 1; }
|
|
|
85 |
if (isset($_REQUEST['plan'])) { $knopf = 2; $headline = 9; $menu = 2; }
|
|
|
86 |
if (isset($_REQUEST['auswert'])) { $knopf = 3; $headline = 8; $menu = 3; }
|
|
|
87 |
if (isset($_REQUEST['verwalt'])) { $knopf = 4; $headline = 4; $menu = 4; }
|
|
|
88 |
|
|
|
89 |
# Planungsmenue
|
|
|
90 |
if (isset($_REQUEST['plneu'])) { $knopf = 10; $headline = 19; }
|
|
|
91 |
if (isset($_REQUEST['plchange'])) { $knopf = 11; }
|
|
|
92 |
if (isset($_REQUEST['plumplan'])) { $knopf = 12; }
|
|
|
93 |
|
|
|
94 |
# Auswertungsmenue
|
|
|
95 |
if (isset($_REQUEST['gantt'])) { $knopf = 20; }
|
|
|
96 |
if (isset($_REQUEST['pjplan'])) { $knopf = 21; $headline = 27; }
|
|
|
97 |
if (isset($_REQUEST['stamm'])) { $knopf = 22; }
|
|
|
98 |
if (isset($_REQUEST['IST'])) { $knopf = 23; $headline = 25; }
|
|
|
99 |
if (isset($_REQUEST['statusb'])) { $knopf = 24; $headline = 26; }
|
|
|
100 |
if (isset($_REQUEST['planung'])) { $knopf = 25; $headline = 29; }
|
|
|
101 |
if (isset($_REQUEST['ressource'])) { $knopf = 26; $headline = 30; }
|
|
|
102 |
if (isset($_REQUEST['auswertung'])) { $knopf = 27; $headline = 31; }
|
|
|
103 |
if (isset($_Request['revisor'])) { $knopf = 28; $headline = 34; }
|
|
|
104 |
|
|
|
105 |
# Verwaltungsmenue
|
|
|
106 |
if (isset($_REQUEST['mi'])) { $knopf = 30; $headline = 5; }
|
|
|
107 |
if (isset($_REQUEST['pj'])) { $knopf = 31; $headline = 11; }
|
|
|
108 |
if (isset($_REQUEST['tm'])) { $knopf = 32; $headline = 14; }
|
|
|
109 |
if (isset($_REQUEST['sgf'])) { $knopf = 33; $headline = 15; }
|
|
|
110 |
if (isset($_REQUEST['abt'])) { $knopf = 34; $headline = 16; }
|
|
|
111 |
if (isset($_REQUEST['land'])) { $knopf = 35; $headline = 17; }
|
|
|
112 |
if (isset($_REQUEST['role'])) { $knopf = 36; $headline = 18; }
|
|
|
113 |
if (isset($_REQUEST['status'])) { $knopf = 37; $headline = 22; }
|
|
|
114 |
if (isset($_REQUEST['phase'])) { $knopf = 38; $headline = 24; }
|
|
|
115 |
if (isset($_REQUEST['settings'])) { $knopf = 39; $headline = 23; }
|
|
|
116 |
if (isset($_REQUEST['templates'])) { $knopf = 40; $headline = 28; }
|
|
|
117 |
if (isset($_REQUEST['pw'])) { $knopf = 41; $headline = 32; }
|
|
|
118 |
if (isset($_REQUEST['journal'])) { $knopf = 42; $headline = 33; }
|
|
|
119 |
if (isset($_REQUEST['kunde'])) { $knopf = 43; $headline = 34; }
|
|
|
120 |
if (isset($_REQUEST['anteil'])) { $knopf = 44; $headline = 35; }
|
|
|
121 |
if (isset($_REQUEST['anrede'])) { $knopf = 45; $headline = 36; }
|
|
|
122 |
if (isset($_REQUEST['category'])) { $knopf = 46; $headline = 37; }
|
|
|
123 |
if (isset($_REQUEST['costloc'])) { $knopf = 47; $headline = 38; }
|
|
|
124 |
if (isset($_REQUEST['kgroup'])) { $knopf = 48; $headline = 39; }
|
|
|
125 |
if (isset($_REQUEST['temptagsatz'])) { $knopf = 49; $headline = 40; }
|
|
|
126 |
if (isset($_REQUEST['pjclose'])) { $knopf = 50; $headline = 41; }
|
|
|
127 |
|
|
|
128 |
require_once('menu.inc');
|
|
|
129 |
|
|
|
130 |
function EditProject($headline, $rstufe, $menu, $unum) {
|
|
|
131 |
# Zunaechst pruefen wir, ob der Anwender ueberhaupt dazu berechtigt
|
|
|
132 |
# ist.
|
|
|
133 |
if ($rstufe > 1) {
|
|
|
134 |
Error(GetMessage(-1, 50, "Berechtigungsfehler!"));
|
|
|
135 |
return;
|
|
|
136 |
}
|
|
|
137 |
|
|
|
138 |
$nav = "menu=$menu&headline=11";
|
|
|
139 |
echo "<form name=\"edit_pj\" action=\"edit_pj.php\" method=\"post\">\n";
|
|
|
140 |
echo "<input type=\"hidden\" name=\"headline\" value=\"11\">\n";
|
|
|
141 |
echo "<input type=\"hidden\" name=\"menu\" value=\"$menu\">\n";
|
|
|
142 |
echo "<input type=\"hidden\" name=\"pjnew\" value=\"pjnew\">\n";
|
|
|
143 |
|
|
|
144 |
echo "<table class=\"indent\"><tr><td>";
|
|
|
145 |
Button(GetMessage(-1, 143, "Neues Projekt"), "edit_pj");
|
|
|
146 |
echo "</td></tr></table>\n";
|
|
|
147 |
|
|
|
148 |
$db = OpenDB();
|
|
|
149 |
$query = "select count(*) from project";
|
|
|
150 |
|
|
|
151 |
if (!($result = QueryDB($db, $query))) {
|
|
|
152 |
CloseDB($db);
|
|
|
153 |
return;
|
|
|
154 |
}
|
|
|
155 |
|
|
|
156 |
$data = fetchDB($result, 0);
|
|
|
157 |
|
|
|
158 |
if ($data[0] > 0) {
|
|
|
159 |
echo "<table class=\"sel\">\n";
|
|
|
160 |
echo "<tr><th class=\"sel\">" . GetMessage($db, 144, "Aktion") . "</th>";
|
|
|
161 |
echo "<th class=\"sel\">" . GetMessage($db, 145, "Nummer") . "</th>";
|
|
|
162 |
echo "<th class=\"sel\">" . GetMessage($db, 146, "Bezeichnung") . "</th>";
|
|
|
163 |
echo "<th class=\"sel\">" . GetMessage($db, 147, "Projektleiter") . "</th>";
|
|
|
164 |
echo "<th class=\"sel\">" . GetMessage($db, 148, "Status/Art") . "</th></tr>\n";
|
|
|
165 |
|
|
|
166 |
$query = "select pr_num, pr_name, pr_pl, pr_status from project ";
|
|
|
167 |
$query .= "order by pr_num";
|
|
|
168 |
|
|
|
169 |
if (!($result = QueryDB($db, $query))) {
|
|
|
170 |
closeDB($db);
|
|
|
171 |
return;
|
|
|
172 |
}
|
|
|
173 |
|
|
|
174 |
$numrows = numrowsDB($result);
|
|
|
175 |
$row = 0;
|
|
|
176 |
|
|
|
177 |
while ($row < $numrows) {
|
|
|
178 |
$data = fetchDB($result, $row);
|
|
|
179 |
$pr_num = $data[0];
|
|
|
180 |
$pr_name = $data[1];
|
|
|
181 |
$pr_pl = $data[2];
|
|
|
182 |
$pr_status = $data[3];
|
|
|
183 |
|
|
|
184 |
if ($pr_status == 0) {
|
|
|
185 |
$query = "select pl_status from plan where ";
|
|
|
186 |
$query .= "pl_prnum = $pr_num order by pl_lfd desc";
|
|
|
187 |
|
|
|
188 |
if (!($respl = QueryDB($db, $query))) {
|
|
|
189 |
closeDB($db);
|
|
|
190 |
return;
|
|
|
191 |
}
|
|
|
192 |
|
|
|
193 |
$menge = numrowsDB($respl);
|
|
|
194 |
|
|
|
195 |
if ($menge > 0) {
|
|
|
196 |
$data = fetchDB($respl, 0);
|
|
|
197 |
$pl_status = $data[0];
|
|
|
198 |
|
|
|
199 |
if ($menge > 1 && $pl_status == 1) {
|
|
|
200 |
$data = fetchDB($respl, 1);
|
|
|
201 |
$pl_status = $data[0];
|
|
|
202 |
}
|
|
|
203 |
} else
|
|
|
204 |
$pl_status = 7; // Hilfsnummer fuer Projekte ohne Plan
|
|
|
205 |
} else
|
|
|
206 |
$pl_status = 0;
|
|
|
207 |
|
|
|
208 |
switch ($pl_status) {
|
|
|
209 |
case 1: $ps = GetMessage($db, 149, "In Erstellung / Projekt"); break;
|
|
|
210 |
case 2: $ps = GetMessage($db, 150, "Freigegeben / Projekt"); break;
|
|
|
211 |
case 4: $ps = GetMessage($db, 151, "Aktiv / Projekt"); break;
|
|
|
212 |
case 5: $ps = GetMessage($db, 152, "Inaktiv / Projekt"); break;
|
|
|
213 |
case 6: $ps = GetMessage($db, 153, "Abgeschlossen / Projekt"); break;
|
|
|
214 |
case 7: $ps = GetMessage($db, 154, "− / Projekt"); break;
|
|
|
215 |
default: $ps = GetMessage($db, 155, "− / Konto");
|
|
|
216 |
}
|
|
|
217 |
|
|
|
218 |
$query = "select mi_vname, mi_nname from mitarbeiter where mi_num = $pr_pl";
|
|
|
219 |
|
|
|
220 |
if (!($result2 = QueryDB($db, $query))) {
|
|
|
221 |
closeDB($db);
|
|
|
222 |
return;
|
|
|
223 |
}
|
|
|
224 |
|
|
|
225 |
$data = fetchDB($result2, 0);
|
|
|
226 |
$vname = $data[0];
|
|
|
227 |
$nname = $data[1];
|
|
|
228 |
echo "<tr><td class=\"selakt\"><a href=\"#\" onClick=\"javascript:MoveTo('edit_pj.php','pjedit=$pr_num&$nav')\"><img src=\"image/edit.png\" border=0 alt=\"Edit\"></a>";
|
|
|
229 |
echo "<a href=\"#\" onClick=\"javascript:MoveTo('edit_pj.php','pjdel=$pr_num&$nav')\"><img src=\"image/editdelete.png\" border=0 alt=\"Projekt loeschen\"></a></td>";
|
|
|
230 |
echo "<td class=\"sel\">$pr_num</td><td class=\"sel\">$pr_name</td><td class=\"sel\">$nname $vname</td>\n";
|
|
|
231 |
echo "<td class=\"sel\">$ps</td></tr>\n";
|
|
|
232 |
$row++;
|
|
|
233 |
}
|
|
|
234 |
|
|
|
235 |
echo "</table>\n";
|
|
|
236 |
|
|
|
237 |
echo "<table class=\"indent\"><tr><td>";
|
|
|
238 |
Button(GetMessage($db, 143, "Neues Projekt"), "edit_pj");
|
|
|
239 |
echo "</td></tr></table>\n";
|
|
|
240 |
}
|
|
|
241 |
|
|
|
242 |
echo "</form>\n";
|
|
|
243 |
closeDB($db);
|
|
|
244 |
}
|
|
|
245 |
|
|
|
246 |
function EditKey($key, $headline, $rstufe, $menu, $unum) {
|
|
|
247 |
$nav = "menu=$menu&headline=$headline";
|
|
|
248 |
# Zunaechst pruefen wir, ob der Anwender ueberhaupt dazu berechtigt
|
|
|
249 |
# ist.
|
|
|
250 |
if ($rstufe > 1 && $rstufe != 6) {
|
|
|
251 |
Error(GetMessage(-1, 50, "Berechtigungsfehler!"));
|
|
|
252 |
return;
|
|
|
253 |
}
|
|
|
254 |
|
|
|
255 |
?>
|
|
|
256 |
<form name="<? echo"$key"; ?>" action="<? echo "$key"; ?>.php" method="post">
|
|
|
257 |
<input type="hidden" name="headline" value="<? echo "$headline"; ?>">
|
|
|
258 |
<input type="hidden" name="menu" value="<? echo "$menu"; ?>">
|
|
|
259 |
<input type="hidden" name="new<? echo "$key"; ?>" value="new">
|
|
|
260 |
<table class="indent"><tr><td>
|
|
|
261 |
<?php
|
|
|
262 |
Button(GetMessage(-1, 156, "Hinzufügen"), $key);
|
|
|
263 |
echo "</td></tr></table>\n";
|
|
|
264 |
$db = OpenDB();
|
|
|
265 |
$query = "select * from key_$key";
|
|
|
266 |
$result = QueryDB($db, $query);
|
|
|
267 |
|
|
|
268 |
if (!$result) {
|
|
|
269 |
Error("SQL-Error: $query");
|
|
|
270 |
require('footer.inc');
|
|
|
271 |
return;
|
|
|
272 |
}
|
|
|
273 |
|
|
|
274 |
$numrows = numrowsDB($result);
|
|
|
275 |
|
|
|
276 |
if ($numrows > 0) {
|
|
|
277 |
?>
|
|
|
278 |
<table class="sel">
|
|
|
279 |
<tr>
|
|
|
280 |
<th class="sel"><? Output($db, 157, "Aktion"); ?></th>
|
|
|
281 |
<th class="sel"><? Output($db, 158, "Key"); ?></th>
|
|
|
282 |
<th class="sel"><? Output($db, 159, "Text"); ?></th>
|
|
|
283 |
</tr>
|
|
|
284 |
<?php
|
|
|
285 |
$row = 0;
|
|
|
286 |
|
|
|
287 |
while ($row < $numrows) {
|
|
|
288 |
$data = fetchDB($result, $row);
|
|
|
289 |
$num = $data[0];
|
|
|
290 |
$txt = $data[1];
|
|
|
291 |
echo "<tr><td class=\"selakt\"><a href=\"#\" onClick=\"javascript:MoveTo('$key.php','edit$key=$num&$nav')\"><img src=\"image/edit.png\" border=0 alt=\"Edit\"></a></td>";
|
|
|
292 |
echo "<td class=\"sel\">$num</td><td class=\"sel\">$txt</td></tr>";
|
|
|
293 |
$row++;
|
|
|
294 |
}
|
|
|
295 |
|
|
|
296 |
echo "</table>\n<table class=\"indent\"><tr><td>";
|
|
|
297 |
Button(GetMessage($db, 156, "Hinzufügen"), $key);
|
|
|
298 |
echo "</td></tr></table>\n";
|
|
|
299 |
// echo "<button type=\"submit\" name=\"new$key\" value=\"new\"><img src=\"image/button_new$key.png\" border=0 alt=\"Neu\"></button>\n";
|
|
|
300 |
}
|
|
|
301 |
|
|
|
302 |
echo "</form>\n";
|
|
|
303 |
closeDB($db);
|
|
|
304 |
}
|
|
|
305 |
|
|
|
306 |
function EditTemplates() {
|
|
|
307 |
global $menu;
|
|
|
308 |
|
|
|
309 |
# Zunaechst pruefen wir, ob der Anwender ueberhaupt dazu berechtigt
|
|
|
310 |
# ist.
|
|
|
311 |
if ($rstufe > 1) {
|
|
|
312 |
Error(GetMessage(-1, 50, "Berechtigungsfehler!"));
|
|
|
313 |
return;
|
|
|
314 |
}
|
|
|
315 |
|
|
|
316 |
$nav = "menu=$menu&headline=28";
|
|
|
317 |
echo "<form name=\"templates\" action=\"templates.php\" method=\"post\">\n";
|
|
|
318 |
echo "<input type=\"hidden\" name=\"headline\" value=\"28\">\n";
|
|
|
319 |
echo "<input type=\"hidden\" name=\"menu\" value=\"$menu\">\n";
|
|
|
320 |
echo "<input type=\"hidden\" name=\"func\" value=\"tempnew\">\n";
|
|
|
321 |
echo "<input type=\"hidden\" name=\"tempnew\" value=\"tempnew\">\n";
|
|
|
322 |
echo "<table class=\"indent\"><tr><td>\n";
|
|
|
323 |
Button("Neues Template", "templates");
|
|
|
324 |
echo "</td></tr></table>\n";
|
|
|
325 |
|
|
|
326 |
$db = OpenDB();
|
|
|
327 |
$query = "select te_num, te_name, te_zweck from tempidx order by te_name";
|
|
|
328 |
$result = QueryDB($db, $query);
|
|
|
329 |
|
|
|
330 |
if (!$result) {
|
|
|
331 |
closeDB($db);
|
|
|
332 |
return;
|
|
|
333 |
}
|
|
|
334 |
|
|
|
335 |
$numrows = numrowsDB($result);
|
|
|
336 |
$row = 0;
|
|
|
337 |
|
|
|
338 |
echo "<table class=\"sel\" width=\"80%\">\n";
|
|
|
339 |
echo "<tr><th class=\"sel\">" . GetMessage($db, 160, "Akt.") . "</th>\n";
|
|
|
340 |
echo "<th class=\"sel\">" . GetMessage($db, 161, "Name") . "</th>\n";
|
|
|
341 |
echo "<th class=\"sel\">" . GetMessage($db, 162, "Zweck") . "</th></tr>\n";
|
|
|
342 |
|
|
|
343 |
while ($row < $numrows) {
|
|
|
344 |
$data = fetchDB($result, $row);
|
|
|
345 |
$te_num = $data[0];
|
|
|
346 |
$te_name = $data[1];
|
|
|
347 |
$te_zweck = $data[2];
|
|
|
348 |
echo "<tr><td class=\"selakt\" valign=\"top\"><table border=0 cellspacing=0 cellpadding=0><tr><td>";
|
|
|
349 |
echo "<a href=\"#\" onClick=\"javascript:MoveTo('templates.php','tempedit=$te_num&$nav')\"><img src=\"image/edit.png\" border=0 alt=\"Edit\"></a>";
|
|
|
350 |
echo "</td><td>";
|
|
|
351 |
echo "<a href=\"#\" onClick=\"javascript:MoveTo('templates.php','tempdel=$te_num&$nav')\"><img src=\"image/editdelete.png\" border=0 alt=\"Loeschen\"></a>";
|
|
|
352 |
echo "</td></tr></table></td>\n";
|
|
|
353 |
echo "<td class=\"selakt\" valign=\"top\"><a href=\"#\" onClick=\"javascript:MoveTo('templates.php','edittemp=$te_num&$nav')\">$te_name</a></td>\n";
|
|
|
354 |
echo "<td class=\"sel\">$te_zweck</td></tr>\n";
|
|
|
355 |
$row++;
|
|
|
356 |
}
|
|
|
357 |
|
|
|
358 |
echo "</table>\n";
|
|
|
359 |
echo "<table class=\"indent\"><tr><td>\n";
|
|
|
360 |
Button(GetMessage($db, 163, "Neues Template"), "templates");
|
|
|
361 |
echo "</td></tr></table>\n";
|
|
|
362 |
echo "</form>\n";
|
|
|
363 |
closeDB($db);
|
|
|
364 |
}
|
|
|
365 |
|
|
|
366 |
# Folgende Funktion zeigt eine Maske zum setzen / aendern der
|
|
|
367 |
# Grundeinstellungen des Programms an. Die eingegebenen Daten
|
|
|
368 |
# werden in einer Datei gespeichert!
|
|
|
369 |
#
|
|
|
370 |
function Settings() {
|
|
|
371 |
global $rstufe;
|
|
|
372 |
global $menu;
|
|
|
373 |
|
|
|
374 |
if ($rstufe > 1) {
|
|
|
375 |
Error(GetMessage(-1, 50, "Berechtigungsfehler!"));
|
|
|
376 |
return;
|
|
|
377 |
}
|
|
|
378 |
|
|
|
379 |
$ini_array = parse_ini_file("setup/settings.dat");
|
|
|
380 |
$periode = $ini_array['periode'];
|
|
|
381 |
$verteil = $ini_array['verteil'];
|
|
|
382 |
$einheit = $ini_array['einheit'];
|
|
|
383 |
$leneinheit = $ini_array['leneinheit'];
|
|
|
384 |
$phase = $ini_array['phase'];
|
|
|
385 |
$numphase = $ini_array['numphase'];
|
|
|
386 |
$dtformatshort = $ini_array['dtformatshort'];
|
|
|
387 |
$pmlight = $ini_array['pmlight'];
|
|
|
388 |
$dtformatlong = $ini_array['dtformatlong'];
|
|
|
389 |
$datetime = $ini_array['datetime'];
|
|
|
390 |
$role = $ini_array['role'];
|
|
|
391 |
$ist_erledigung = $ini_array['ist_erledigung'];
|
|
|
392 |
$title_str = $ini_array['title'];
|
|
|
393 |
$menucolor = $ini_array['menucolor'];
|
|
|
394 |
$ist_future = $ini_array['ist_future'];
|
|
|
395 |
$pj_lock = $ini_array['pj_lock'];
|
|
|
396 |
$statusbericht = $ini_array['statusbericht'];
|
|
|
397 |
$shortcuts = $ini_array['shortcuts'];
|
|
|
398 |
$verrmodul = $ini_array['verrmodul'];
|
|
|
399 |
$fixkunde = $ini_array['fixkunde'];
|
|
|
400 |
$stdwhg = $ini_array['stdwhg'];
|
|
|
401 |
$language = $ini_array['language'];
|
|
|
402 |
$pjcopy = $ini_array['pjcopy'];
|
|
|
403 |
|
|
|
404 |
if (!isset($shortcuts))
|
|
|
405 |
$shortcuts = true;
|
|
|
406 |
|
|
|
407 |
if (!isset($verrmodul))
|
|
|
408 |
$verrmodul = false;
|
|
|
409 |
|
|
|
410 |
if (!isset($stdwhg) || $stdwhg <= 0)
|
|
|
411 |
$stdwhg = 42; // EUR; Euro
|
|
|
412 |
|
|
|
413 |
if (!isset($pjcopy))
|
|
|
414 |
$pjcopy = 3;
|
|
|
415 |
?>
|
|
|
416 |
<form name="settings" action="forms.php" method="post">
|
|
|
417 |
<input type="hidden" name="func" value="SaveSettings">
|
|
|
418 |
<input type="hidden" name="menu" value="<? echo "$menu"; ?>">
|
|
|
419 |
<input type="hidden" name="dtformatlong" value="<? echo "$dtformatlong"; ?>">
|
|
|
420 |
<input type="hidden" name="datetime" value="<? echo "$datetime"; ?>">
|
|
|
421 |
<input type="hidden" name="statusbericht" value="<? echo "$statusbericht"; ?>">
|
|
|
422 |
<input type="hidden" name="verrmodul" value="<? echo "$verrmodul"; ?>">
|
|
|
423 |
<input type="hidden" name="headline" value="23">
|
|
|
424 |
<table class="input" border=0>
|
|
|
425 |
<tr>
|
|
|
426 |
<th colspan=2 class="sel"><? Output(-1, 91, "Einstellungen für die Planung"); ?></th>
|
|
|
427 |
</tr>
|
|
|
428 |
<tr>
|
|
|
429 |
<td><? Output(-1, 92, "Länge einer Periode:"); ?></td>
|
|
|
430 |
<td><select name="periode" disabled>
|
|
|
431 |
<option value="1" <? if ($periode == 1) echo "selected"; echo ">"; Output(-1, 93, "Jahr"); ?></option>
|
|
|
432 |
<option value="2" <? if ($periode == 2) echo "selected"; echo ">"; Output(-1, 94, "Quartal"); ?></option>
|
|
|
433 |
<option value="3" <? if ($periode == 3) echo "selected"; echo ">"; Output(-1, 95, "Monat"); ?></option>
|
|
|
434 |
<option value="4" <? if ($periode == 4) echo "selected"; echo ">"; Output(-1, 96, "Woche"); ?></option>
|
|
|
435 |
<option value="5" <? if ($periode == 5) echo "selected"; echo ">"; Output(-1, 97, "Tag"); ?></option>
|
|
|
436 |
</select>
|
|
|
437 |
</td>
|
|
|
438 |
</tr>
|
|
|
439 |
<tr>
|
|
|
440 |
<td><? Output(-1, 98, "Verteilung der Auwände:"); ?></td>
|
|
|
441 |
<td><select name="verteil" disabled>
|
|
|
442 |
<option value="1" <? if ($verteil == 1) echo "selected"; ?>><? Output(-1, 99, "Normalverteilung"); ?></option>
|
|
|
443 |
<option value="2" <? if ($verteil == 2) echo "selected"; ?>><? Output(-1, 100, "Endlastig"); ?></option>
|
|
|
444 |
<option value="3" <? if ($verteil == 3) echo "selected"; ?>><? Output(-1, 101, "Anfangslastig"); ?></option>
|
|
|
445 |
<option value="4" <? if ($verteil == 4) echo "selected"; ?>><? Output(-1, 102, "Anfang− und Endlasig"); ?></option>
|
|
|
446 |
<option value="5" <? if ($verteil == 5) echo "selected"; ?>><? Output(-1, 103, "Mittellastig"); ?></option>
|
|
|
447 |
<option value="6" <? if ($verteil == 6) echo "selected"; ?>><? Output(-1, 104, "Individuell"); ?></option>
|
|
|
448 |
</select>
|
|
|
449 |
</td>
|
|
|
450 |
</tr>
|
|
|
451 |
<tr>
|
|
|
452 |
<td><? Output(-1, 105, "Größe einer Arbeitseiheit:"); ?></td>
|
|
|
453 |
<td><select name="einheit" disabled>
|
|
|
454 |
<option value="1" <? if ($einheit == 1) echo "selected"; ?>><? Output(-1, 106, "Stunde"); ?></option>
|
|
|
455 |
<option value="2" <? if ($einheit == 2) echo "selected"; ?>><? Output(-1, 107, "Tag"); ?></option>
|
|
|
456 |
<option value="3" <? if ($einheit == 3) echo "selected"; ?>><? Output(-1, 108, "Woche"); ?></option>
|
|
|
457 |
<option value="4" <? if ($einheit == 4) echo "selected"; ?>><? Output(-1, 109, "Monat"); ?></option>
|
|
|
458 |
<option value="5" <? if ($einheit == 5) echo "selected"; ?>><? Output(-1, 110, "Quartal"); ?></option>
|
|
|
459 |
<option value="6" <? if ($einheit == 6) echo "selected"; ?>><? Output(-1, 111, "Jahr"); ?></option>
|
|
|
460 |
</select>
|
|
|
461 |
</td>
|
|
|
462 |
</tr>
|
|
|
463 |
<tr>
|
|
|
464 |
<td><? Output(-1, 112, "Länge einer Arbeitseinh. in Stunden:"); ?></td>
|
|
|
465 |
<td><input type="text" class="inputmust" name="leneinheit" value="<? echo "$leneinheit"; ?>" size=5 maxlength=5>
|
|
|
466 |
</tr>
|
|
|
467 |
<tr>
|
|
|
468 |
<td><? Output(-1, 113, "Projektphasen verwenden?"); ?></td>
|
|
|
469 |
<td><input type="checkbox" name="phase" value="1" <? if (isset($phase) && $phase) echo "checked"; ?>>
|
|
|
470 |
</tr>
|
|
|
471 |
<tr>
|
|
|
472 |
<td><? Output(-1, 114, "Tasks nach Phasen nummerieren?"); ?></td>
|
|
|
473 |
<td><input type="checkbox" name="numphase" value="1" <? if (isset($numphase) && $numphase) echo "checked"; ?>>
|
|
|
474 |
</tr>
|
|
|
475 |
<tr>
|
|
|
476 |
<td><? Output(-1, 115, "Datumsformat:"); ?></td>
|
|
|
477 |
<td><select name="dtformatshort">
|
|
|
478 |
<option value="d.m.Y" <? if ($dtformatshort == "d.m.Y") echo "selected"; ?>>TT.MM.JJJJ</option>
|
|
|
479 |
<option value="d.m.y" <? if ($dtformatshort == "d.m.y") echo "selected"; ?>>TT.MM.JJ</option>
|
|
|
480 |
<option value="j.n.Y" <? if ($dtformatshort == "j.n.Y") echo "selected"; ?>>T.M.JJJJ</option>
|
|
|
481 |
<option value="j.n.y" <? if ($dtformatshort == "j.n.y") echo "selected"; ?>>T.M.JJ</option>
|
|
|
482 |
<option value="m/d/Y" <? if ($dtformatshort == "m/d/Y") echo "selected"; ?>>MM/DD/YYYY</option>
|
|
|
483 |
<option value="m/d/y" <? if ($dtformatshort == "m/d/y") echo "selected"; ?>>MM/DD/YY</option>
|
|
|
484 |
<option value="Y-m-d" <? if ($dtformatshort == "Y-m-d") echo "selected"; ?>>YYYY-MM-DD</option>
|
|
|
485 |
</select>
|
|
|
486 |
</td>
|
|
|
487 |
</tr>
|
|
|
488 |
<tr>
|
|
|
489 |
<td><? Output(-1, 116, "Periodensicht:"); ?></td>
|
|
|
490 |
<td><input type="checkbox" name="pmlight" value="1" <? if (isset($pmlight) && $pmlight) echo "checked"; ?>></td>
|
|
|
491 |
</tr>
|
|
|
492 |
<tr>
|
|
|
493 |
<td><? Output(-1, 117, "Mitarbeiterrolle in Plan:"); ?></td>
|
|
|
494 |
<td><input type="checkbox" name="role" value="1" <? if (isset($role) && $role) echo "checked"; ?>></td>
|
|
|
495 |
</tr>
|
|
|
496 |
<tr>
|
|
|
497 |
<td><? Output(-1, 118, "Prozent erledigt bei Zeiterfassung:"); ?></td>
|
|
|
498 |
<td><input type="checkbox" name="ist_erledigung" value="1" <? if (isset($ist_erledigung) && $ist_erledigung) echo "checked"; ?>></td>
|
|
|
499 |
</tr>
|
|
|
500 |
<tr>
|
|
|
501 |
<td><? Output(-1, 119, "Taskgenaue Zeiterfassung:"); ?></td>
|
|
|
502 |
<td><input type="checkbox" name="ist_future" value="1" <? if (isset($ist_future) && $ist_future) echo "checked"; ?>></td>
|
|
|
503 |
</tr>
|
|
|
504 |
<tr>
|
|
|
505 |
<td><? Output(-1, 120, "Projekt Teilabschluss durch:"); ?></td>
|
|
|
506 |
<td><select name="pj_lock">
|
|
|
507 |
<option value="0"><? Output(-1, 121, "Projektleiter"); ?></option>
|
|
|
508 |
<option value="1" <? if (isset($pj_lock) && $pj_lock == 1) echo "selected"; ?>><? Output(-1, 122, "Kontroller"); ?></option>
|
|
|
509 |
</select>
|
|
|
510 |
</td>
|
|
|
511 |
</tr>
|
|
|
512 |
<tr>
|
|
|
513 |
<td><? Output(-1, 123, "Shortcuts:"); ?></td>
|
|
|
514 |
<td><input type="checkbox" name="shortcuts" value="1" <? if (isset($shortcuts) && $shortcuts) echo "checked"; ?>></td>
|
|
|
515 |
</tr>
|
|
|
516 |
<tr>
|
|
|
517 |
<td><? Output(-1, 398, "Plan kopieren:"); ?></td>
|
|
|
518 |
<td><select name="pjcopy">
|
|
|
519 |
<option value="1" <? if ($pjcopy == 1) echo "selected"; ?>><? Output(-1, 399, "Individuelles Datums für IST-Wertübernahme"); ?></option>
|
|
|
520 |
<option value="2" <? if ($pjcopy == 2) echo "selected"; ?>><? Output(-1, 400, "IST-Werte bis Ultimo der letzten Periode übernehmen"); ?></option>
|
|
|
521 |
<option value="3" <? if ($pjcopy == 3) echo "selected"; ?>><? Output(-1, 401, "IST-Werte bis letzten Teilprojektabschluss übernehmen"); ?></option>
|
|
|
522 |
</select>
|
|
|
523 |
</td>
|
|
|
524 |
</tr>
|
|
|
525 |
<?
|
|
|
526 |
if ($verrmodul) {
|
|
|
527 |
?>
|
|
|
528 |
<tr>
|
|
|
529 |
<th class="sel" colspan=2><? Output(-1, 124, "Verrechnungsmodul"); ?></th>
|
|
|
530 |
</tr>
|
|
|
531 |
<tr>
|
|
|
532 |
<td><? Output(-1, 125, "Fixe Kundengruppen:"); ?></td>
|
|
|
533 |
<td><input type="checkbox" name="fixkunde" value="1" <? if (isset($fixkunde) && $fixkunde) echo "checked"; ?>></td>
|
|
|
534 |
</tr>
|
|
|
535 |
<tr>
|
|
|
536 |
<td><? Output(-1, 126, "Standardwährung:"); ?></td>
|
|
|
537 |
<td><select name="stdwhg">
|
|
|
538 |
<?
|
|
|
539 |
$db = OpenDB($db);
|
|
|
540 |
$query = "select wh_num, wh_whg, wh_bez from key_whg order by wh_num";
|
|
|
541 |
|
|
|
542 |
if (!($result = QueryDB($db, $query))) {
|
|
|
543 |
closeDB($db);
|
|
|
544 |
return;
|
|
|
545 |
}
|
|
|
546 |
|
|
|
547 |
$rows = numrowsDB($result);
|
|
|
548 |
$j = 0;
|
|
|
549 |
|
|
|
550 |
while ($j < $rows) {
|
|
|
551 |
$data = fetchDB($result, $j);
|
|
|
552 |
$wh_num = $data[0];
|
|
|
553 |
$wh_whg = $data[1];
|
|
|
554 |
$wh_bez = $data[2];
|
|
|
555 |
|
|
|
556 |
if ($stdwhg == $wh_num)
|
|
|
557 |
echo "<option value=\"$wh_num\" selected>$wh_whg $wh_bez</option>\n";
|
|
|
558 |
else
|
|
|
559 |
echo "<option value=\"$wh_num\">$wh_whg $wh_bez</option>\n";
|
|
|
560 |
|
|
|
561 |
$j++;
|
|
|
562 |
}
|
|
|
563 |
|
|
|
564 |
closeDB($db);
|
|
|
565 |
?>
|
|
|
566 |
</select>
|
|
|
567 |
</td>
|
|
|
568 |
</tr>
|
|
|
569 |
<?
|
|
|
570 |
}
|
|
|
571 |
?>
|
|
|
572 |
<tr>
|
|
|
573 |
<th class="sel" colspan=2><? Output(-1, 127, "Einstellungen der Ansicht"); ?></th>
|
|
|
574 |
</tr>
|
|
|
575 |
<tr>
|
|
|
576 |
<td><? Output(-1, 215, "Standardsprache:"); ?></td>
|
|
|
577 |
<td><select name="language">
|
|
|
578 |
<option value="ger">Deutsch</option>
|
|
|
579 |
<option value="eng"<? if ($language == "eng") echo " selected"; ?>>English</option>
|
|
|
580 |
</select>
|
|
|
581 |
</td>
|
|
|
582 |
</tr>
|
|
|
583 |
<tr>
|
|
|
584 |
<td><? Output(-1, 128, "Farbe Menübalkenunterstreichung:"); ?></td>
|
|
|
585 |
<td><input type="text" name="menucolor" value="<? echo "$menucolor"; ?>" size=15 maxlength=15></td>
|
|
|
586 |
</tr>
|
|
|
587 |
<tr>
|
|
|
588 |
<td><? Output(-1, 129, "Fensterüberschrift:"); ?></td>
|
|
|
589 |
<td><input type="text" name="title_str" value="<? echo urldecode($title_str); ?>" size=30 maxlength=80></td>
|
|
|
590 |
</tr>
|
|
|
591 |
</table>
|
|
|
592 |
|
|
|
593 |
<table class="indent"><tr><td>
|
|
|
594 |
<?
|
|
|
595 |
Button(GetMessage(-1, 45, "Speichern"), "settings");
|
|
|
596 |
echo "</td></tr></table></form>\n";
|
|
|
597 |
}
|
|
|
598 |
|
|
|
599 |
function SaveSettings() {
|
|
|
600 |
global $rstufe;
|
|
|
601 |
|
|
|
602 |
$periode = $_REQUEST['periode'];
|
|
|
603 |
$verteil = $_REQUEST['verteil'];
|
|
|
604 |
$einheit = $_REQUEST['einheit'];
|
|
|
605 |
$leneinheit = $_REQUEST['leneinheit'];
|
|
|
606 |
$phase = $_REQUEST['phase'];
|
|
|
607 |
$numphase = $_REQUEST['numphase'];
|
|
|
608 |
$dtformatshort = $_REQUEST['dtformatshort'];
|
|
|
609 |
$dtformatlong = $_REQUEST['dtformatlong'];
|
|
|
610 |
$datetime = $_REQUEST['datetime'];
|
|
|
611 |
$pmlight = $_REQUEST['pmlight'];
|
|
|
612 |
$role = $_REQUEST['role'];
|
|
|
613 |
$ist_erledigung = $_REQUEST['ist_erledigung'];
|
|
|
614 |
$menucolor = $_REQUEST['menucolor'];
|
|
|
615 |
$title_str = urlencode($_REQUEST['title_str']);
|
|
|
616 |
$ist_future = $_REQUEST['ist_future'];
|
|
|
617 |
$pj_lock = $_REQUEST['pj_lock'];
|
|
|
618 |
$statusbericht = $_REQUEST['statusbericht'];
|
|
|
619 |
$shortcuts = $_REQUEST['shortcuts'];
|
|
|
620 |
$verrmodul = $_REQUEST['verrmodul'];
|
|
|
621 |
$fixkunde = $_REQUEST['fixkunde'];
|
|
|
622 |
$stdwhg = $_REQUEST['stdwhg'];
|
|
|
623 |
$language = $_REQUEST['language'];
|
|
|
624 |
$pjcopy = $_REQUEST['pjcopy'];
|
|
|
625 |
|
|
|
626 |
if (!isset($periode) || $periode < 1)
|
|
|
627 |
global $periode;
|
|
|
628 |
|
|
|
629 |
if (!isset($verteil) || $verteil < 1)
|
|
|
630 |
global $verteil;
|
|
|
631 |
|
|
|
632 |
if (!isset($einheit) || $einheit < 1)
|
|
|
633 |
global $einheit;
|
|
|
634 |
|
|
|
635 |
if ($rstufe > 1) {
|
|
|
636 |
Error(GetMessage(-1, 50, "Berechtigungsfehler!"));
|
|
|
637 |
return false;
|
|
|
638 |
}
|
|
|
639 |
|
|
|
640 |
if (!isset($dtformatshort) || strlen($dtformatshort) < 1)
|
|
|
641 |
$dtformatshort = "j.n.Y";
|
|
|
642 |
|
|
|
643 |
if (!isset($dtformatlong) || strlen($dtformatlong) < 1)
|
|
|
644 |
$dtformatlong = "d F Y";
|
|
|
645 |
|
|
|
646 |
if (!isset($datetime) || strlen($datetime) < 1)
|
|
|
647 |
$datetime = "d.m.Y H:i:s";
|
|
|
648 |
|
|
|
649 |
$err = 0;
|
|
|
650 |
|
|
|
651 |
switch ($periode) {
|
|
|
652 |
case 5: if ($einheit > 1) $err = 1; break;
|
|
|
653 |
case 4: if ($einheit > 2) $err = 1; break;
|
|
|
654 |
case 3: if ($einheit > 3) $err = 1; break;
|
|
|
655 |
case 2: if ($einheit > 4) $err = 1; break;
|
|
|
656 |
case 1: if ($einheit > 5) $err = 1; break;
|
|
|
657 |
}
|
|
|
658 |
|
|
|
659 |
if ($err == 1) {
|
|
|
660 |
Error(GetMessage(-1, 130, "Eine Arbeitseinheit muss immer kleiner als die eingestellte Periode sein!"));
|
|
|
661 |
}
|
|
|
662 |
|
|
|
663 |
switch ($einheit) {
|
|
|
664 |
case 1: $maxlen = 1; break;
|
|
|
665 |
case 2: $maxlen = 24; break;
|
|
|
666 |
case 3: $maxlen = 24 * 7; break;
|
|
|
667 |
case 4: $maxlen = 24 * 30; break;
|
|
|
668 |
case 5: $maxlen = 24 * 91; break;
|
|
|
669 |
case 6: $maxlen = 24 * 364; break;
|
|
|
670 |
}
|
|
|
671 |
|
|
|
672 |
if ($leneinheit > $maxlen) {
|
|
|
673 |
Error(GetMessage(-1, 131, "Die von ihnen eingestellte Länge einer Arbeitseinheit übersteigt die maximale Länge von %d Stunden!", $maxlen));
|
|
|
674 |
$err = 1;
|
|
|
675 |
}
|
|
|
676 |
|
|
|
677 |
if ($err == 1) {
|
|
|
678 |
Settings();
|
|
|
679 |
require('footer.inc');
|
|
|
680 |
return false;
|
|
|
681 |
}
|
|
|
682 |
|
|
|
683 |
if (!isset($pmlight))
|
|
|
684 |
$pmlight = 0;
|
|
|
685 |
|
|
|
686 |
if (!isset($statusbericht))
|
|
|
687 |
$statusbericht = false;
|
|
|
688 |
|
|
|
689 |
if (!isset($shortcuts))
|
|
|
690 |
$shortcuts = false;
|
|
|
691 |
|
|
|
692 |
if (!isset($verrmodul))
|
|
|
693 |
$verrmodul = false;
|
|
|
694 |
|
|
|
695 |
if (!isset($fixkunde))
|
|
|
696 |
$fixkunde = false;
|
|
|
697 |
|
|
|
698 |
# Planungseinstellungen speichern
|
|
|
699 |
$fp = fopen("setup/settings.dat", "w+");
|
|
|
700 |
|
|
|
701 |
if (!$fp) {
|
|
|
702 |
Error(GetMessage(-1, 132, "Datei \"settings.dat\" konnte nicht angelegt werden!"));
|
|
|
703 |
return false;
|
|
|
704 |
}
|
|
|
705 |
|
|
|
706 |
$dat = "[pm]\nperiode=$periode\nverteil=$verteil\neinheit=$einheit\n";
|
|
|
707 |
$dat .= "leneinheit=$leneinheit\nphase=$phase\nnumphase=$numphase\n";
|
|
|
708 |
$dat .= "dtformatshort=$dtformatshort\ndtformatlong=$dtformatlong\n";
|
|
|
709 |
$dat .= "datetime=$datetime\npmlight=$pmlight\nrole=$role\n";
|
|
|
710 |
$dat .= "ist_erledigung=$ist_erledigung\nmenucolor=$menucolor\ntitle=$title_str\n";
|
|
|
711 |
$dat .= "ist_future=$ist_future\npj_lock=$pj_lock\nstatusbericht=$statusbericht\n";
|
|
|
712 |
$dat .= "shortcuts=$shortcuts\nverrmodul=$verrmodul\nfixkunde=$fixkunde\n";
|
|
|
713 |
$dat .= "stdwhg=$stdwhg\nlanguage=$language\npjcopy=$pjcopy";
|
|
|
714 |
fwrite($fp, $dat);
|
|
|
715 |
fclose($fp);
|
|
|
716 |
return true;
|
|
|
717 |
}
|
|
|
718 |
|
|
|
719 |
function ChangePW() {
|
|
|
720 |
global $unum;
|
|
|
721 |
global $rstufe;
|
|
|
722 |
global $menu;
|
|
|
723 |
|
|
|
724 |
if ($rstufe == 0 || $rstufe == 1 || $rstufe == 5) {
|
|
|
725 |
Error(GetMessage(-1, 133, "Sie sind nicht berechtigt ein Passwort zu ändern!"));
|
|
|
726 |
return;
|
|
|
727 |
}
|
|
|
728 |
|
|
|
729 |
$s = "<p><b>Hinweise für ein sicheres Passwort</b><br><br>\n";
|
|
|
730 |
$s .= "Ein gutes Passwort sollte aus möglichst zufälligen\n";
|
|
|
731 |
$s .= "Buchstaben und Ziffern bestehen. Zusätzlich sollten Groß−\n";
|
|
|
732 |
$s .= "und Kleinbuchstaben gemischt verwendet werden.</p>\n";
|
|
|
733 |
Output(-1, 134, $s);
|
|
|
734 |
|
|
|
735 |
echo "<form name=\"forms\" action=\"forms.php\" method=\"post\">\n";
|
|
|
736 |
echo "<input type=\"hidden\" name=\"headline\" value=\"32\">\n";
|
|
|
737 |
echo "<input type=\"hidden\" name=\"menu\" value=\"$menu\">\n";
|
|
|
738 |
echo "<input type=\"hidden\" name=\"func\" value=\"DoChangePW\">\n";
|
|
|
739 |
|
|
|
740 |
echo "<table class=\"input\">\n";
|
|
|
741 |
echo "<tr><td>" . GetMessage(-1, 135, "Altes Passwort:") . "</td>\n";
|
|
|
742 |
echo "<td><input class=\"inputmust\" type=\"password\" name=\"oldpass\" size=8 maxlength=8></td></tr>\n";
|
|
|
743 |
echo "<tr><td>" . GetMessage(-1, 136, "Neues Passwort:") . "</td>\n";
|
|
|
744 |
echo "<td><input class=\"inputmust\" type=\"password\" name=\"newpass1\" size=8 maxlength=8></td></tr>\n";
|
|
|
745 |
echo "<tr><td>" . GetMessage(-1, 137, "Passwort wiederholen:") . "</td>\n";
|
|
|
746 |
echo "<td><input class=\"inputmust\" type=\"password\" name=\"newpass2\" size=8 maxlength=8></td></tr>\n";
|
|
|
747 |
echo "</table></td></tr></table>\n";
|
|
|
748 |
ButtonSubmit(GetMessage(-1, 138, "Passwort speichern"), "forms");
|
|
|
749 |
// echo "<input type=\"submit\" name=\"submit\" value=\"Passwort speichern\">";
|
|
|
750 |
// echo "<input type=\"reset\">\n";
|
|
|
751 |
echo "</form>\n";
|
|
|
752 |
}
|
|
|
753 |
|
|
|
754 |
function DoChangePW() {
|
|
|
755 |
global $unum;
|
|
|
756 |
$oldpass = $_REQUEST['oldpass'];
|
|
|
757 |
$newpass1 = $_REQUEST['newpass1'];
|
|
|
758 |
$newpass2 = $_REQUEST['newpass2'];
|
|
|
759 |
$err = 0;
|
|
|
760 |
|
|
|
761 |
if (strlen($oldpass) == 0) {
|
|
|
762 |
Error(GetMessage(-1, 164, "Sie müssen das alte Passwort angeben, um es ändern zu können!"));
|
|
|
763 |
$err = 1;
|
|
|
764 |
}
|
|
|
765 |
|
|
|
766 |
$db = OpenDB();
|
|
|
767 |
$query = "select mi_passwd from mitarbeiter where mi_num = $unum";
|
|
|
768 |
|
|
|
769 |
if (!($result = QueryDB($db, $query))) {
|
|
|
770 |
closeDB($db);
|
|
|
771 |
return;
|
|
|
772 |
}
|
|
|
773 |
|
|
|
774 |
$data = fetchDB($result, 0);
|
|
|
775 |
$mi_passwd = $data[0];
|
|
|
776 |
$pw = md5($oldpass);
|
|
|
777 |
|
|
|
778 |
if ($pw != $mi_passwd) {
|
|
|
779 |
Error("Das alte Passwort ist nicht korrekt!");
|
|
|
780 |
closeDB($db);
|
|
|
781 |
return;
|
|
|
782 |
}
|
|
|
783 |
|
|
|
784 |
if ($newpass1 != $newpass2) {
|
|
|
785 |
Error(GetMessage($db, 165, "Das neue Passwort muss 2 mal gleich eingegeben werden!"));
|
|
|
786 |
closeDB($db);
|
|
|
787 |
return;
|
|
|
788 |
}
|
|
|
789 |
|
|
|
790 |
if (strlen($newpass1) < 4) {
|
|
|
791 |
Error(GetMessage($db, 166, "Das neue Passwort muss mindestens 4 Zeichen lang sein!"));
|
|
|
792 |
closeDB($db);
|
|
|
793 |
return;
|
|
|
794 |
}
|
|
|
795 |
|
|
|
796 |
if ($pw == md5($newpass1)) {
|
|
|
797 |
Error(GetMessage($db, 167, "Das neue Passwort muss sich vom alten unterscheiden!"));
|
|
|
798 |
$err = 1;
|
|
|
799 |
}
|
|
|
800 |
|
|
|
801 |
if ($err > 0) {
|
|
|
802 |
closeDB($db);
|
|
|
803 |
return;
|
|
|
804 |
}
|
|
|
805 |
|
|
|
806 |
# Wegschreiben des neuen Passworts
|
|
|
807 |
$pw = md5($newpass1);
|
|
|
808 |
$query = "update mitarbeiter set mi_passwd = '$pw' where mi_num = $unum";
|
|
|
809 |
|
|
|
810 |
if (!QueryDB($db, $query)) {
|
|
|
811 |
closeDB($db);
|
|
|
812 |
return;
|
|
|
813 |
}
|
|
|
814 |
|
|
|
815 |
Output($db, 168, "<p>Das Passwort wurde erfolgreich geändert!</p>");
|
|
|
816 |
closeDB($db);
|
|
|
817 |
}
|
|
|
818 |
|
|
|
819 |
function TempTagsatz($edit=false) {
|
|
|
820 |
global $menu;
|
|
|
821 |
global $headline;
|
|
|
822 |
global $rstufe;
|
|
|
823 |
global $verrmodul;
|
|
|
824 |
global $VisualDate;
|
|
|
825 |
global $stdwhg;
|
|
|
826 |
global $dtformatshort;
|
|
|
827 |
|
|
|
828 |
if (!$verrmodul)
|
|
|
829 |
return;
|
|
|
830 |
|
|
|
831 |
if ($rstufe != 0 && $rstufe != 1 && $rstufe != 4) {
|
|
|
832 |
Error(GetMessage(-1, 50, "Berechtigungsfehler!"));
|
|
|
833 |
return;
|
|
|
834 |
}
|
|
|
835 |
|
|
|
836 |
if (!$edit) {
|
|
|
837 |
$ini_array = parse_ini_file("setup/ration.dat");
|
|
|
838 |
$valid_from = $ini_array['valid_from'];
|
|
|
839 |
|
|
|
840 |
if (isset($valid_from) && strlen($valid_from) == 10) {
|
|
|
841 |
$darr = explode("-", $valid_from);
|
|
|
842 |
$dt = mktime(0, 0, 0, $darr[1], $darr[2], $darr[0]);
|
|
|
843 |
$valid_from = date($dtformatshort, $dt);
|
|
|
844 |
} else
|
|
|
845 |
$valid_from = date($dtformatshort);
|
|
|
846 |
|
|
|
847 |
$amount = $ini_array['amount'];
|
|
|
848 |
$nightr = $ini_array['nightr'];
|
|
|
849 |
$ration = $ini_array['ration'];
|
|
|
850 |
$kmcar = $ini_array['kmcar'];
|
|
|
851 |
$kmdrain = $ini_array['kmdrain'];
|
|
|
852 |
$kmplain = $ini_array['kmplain'];
|
|
|
853 |
} else {
|
|
|
854 |
$valid_from = $_REQUEST['valid_from'];
|
|
|
855 |
$amount = $_REQUEST['amount'];
|
|
|
856 |
$nightr = $_REQUEST['nightr'];
|
|
|
857 |
$ration = $_REQUEST['ration'];
|
|
|
858 |
$kmcar = $_REQUEST['kmcar'];
|
|
|
859 |
$kmdrain = $_REQUEST['kmdrain'];
|
|
|
860 |
$kmplain = $_REQUEST['kmplain'];
|
|
|
861 |
}
|
|
|
862 |
|
|
|
863 |
$db = OpenDB();
|
|
|
864 |
$query = "select wh_whg from key_whg where wh_num = $stdwhg";
|
|
|
865 |
|
|
|
866 |
if (!($result = QueryDB($db, $query))) {
|
|
|
867 |
closeDB($db);
|
|
|
868 |
return;
|
|
|
869 |
}
|
|
|
870 |
|
|
|
871 |
$data = fetchDB($result, 0);
|
|
|
872 |
$wh_whg = $data[0];
|
|
|
873 |
?>
|
|
|
874 |
<form name="tagsatz" action="forms.php" method="post">
|
|
|
875 |
<input type="hidden" name="menu" value="<? echo "$menu"; ?>">
|
|
|
876 |
<input type="hidden" name="headline" value="<? echo "$headline"; ?>">
|
|
|
877 |
<input type="hidden" name="func" value="SaveTagsatz">
|
|
|
878 |
<table class="input">
|
|
|
879 |
<tr>
|
|
|
880 |
<th class="sel" colspan=2><? Output($db, 169, "Vorlage für Tagsatz"); ?></th>
|
|
|
881 |
</tr>
|
|
|
882 |
<tr>
|
|
|
883 |
<td><? Output($db, 170, "Beträge gültig ab"); ?> (<? echo "$VisualDate"; ?>):</td>
|
|
|
884 |
<td><input type="text" name="valid_from" class="inputmust" value="<? echo "$valid_from"; ?>" size=10 maxlength=10 onChange="javascript:CheckDate(this, false)"></td>
|
|
|
885 |
</tr>
|
|
|
886 |
<tr>
|
|
|
887 |
<td><? Output($db, 171, "Tagsatz:"); ?></td>
|
|
|
888 |
<td><input type="text" name="amount" class="inputmust" value="<? echo FormatNum($amount, 2); ?>" size=16 maxlength=16><? echo "$wh_whg"; ?></td>
|
|
|
889 |
</tr>
|
|
|
890 |
<tr>
|
|
|
891 |
<td><? Output($db, 172, "Nächtigungspauschale:"); ?></td>
|
|
|
892 |
<td><input type="text" name="nightr" value="<? echo FormatNum($nightr, 2); ?>" size=16 maxlength=16><? echo "$wh_whg"; ?></td>
|
|
|
893 |
</tr>
|
|
|
894 |
<tr>
|
|
|
895 |
<td><? Output($db, 173, "Tagesdiäten:"); ?></td>
|
|
|
896 |
<td><input type="text" name="ration" value="<? echo FormatNum($ration, 2); ?>" size=16 maxlength=16><? echo "$wh_whg"; ?></td>
|
|
|
897 |
</tr>
|
|
|
898 |
<tr>
|
|
|
899 |
<td><? Output($db, 174, "Kilometerpauschale PKW:"); ?></td>
|
|
|
900 |
<td><input type="text" name="kmcar" value="<? echo FormatNum($kmcar, 2); ?>" size=16 maxlength=16><? echo "$wh_whg"; ?></td>
|
|
|
901 |
</tr>
|
|
|
902 |
<tr>
|
|
|
903 |
<td><? Output($db, 175, "Kilometerpauschale Zug:"); ?></td>
|
|
|
904 |
<td><input type="text" name="kmdrain" value="<? echo FormatNum($kmdrain, 2); ?>" size=16 maxlength=16><? echo "$wh_whg"; ?></td>
|
|
|
905 |
</tr>
|
|
|
906 |
<tr>
|
|
|
907 |
<td><? Output($db, 176, "Kilometerpauschale Flugzeug:"); ?></td>
|
|
|
908 |
<td><input type="text" name="kmplain" value="<? echo FormatNum($kmplain, 2); ?>" size=16 maxlength=16><? echo "$wh_whg"; ?></td>
|
|
|
909 |
</tr>
|
|
|
910 |
</table>
|
|
|
911 |
<table class="indent"><tr><td>
|
|
|
912 |
<?
|
|
|
913 |
ButtonSubmit(GetMessage($db, 177, "Speichern"), "tagsatz");
|
|
|
914 |
echo "</td></tr></table>\n";
|
|
|
915 |
closeDB($db);
|
|
|
916 |
}
|
|
|
917 |
|
|
|
918 |
function SaveTagsatz() {
|
|
|
919 |
global $verrmodul;
|
|
|
920 |
|
|
|
921 |
if (!$verrmodul)
|
|
|
922 |
return;
|
|
|
923 |
|
|
|
924 |
$valid_from = $_REQUEST['valid_from'];
|
|
|
925 |
$amount = str_replace(",", ".", $_REQUEST['amount']);
|
|
|
926 |
$nightr = str_replace(",", ".", $_REQUEST['nightr']);
|
|
|
927 |
$ration = str_replace(",", ".", $_REQUEST['ration']);
|
|
|
928 |
$kmcar = str_replace(",", ".", $_REQUEST['kmcar']);
|
|
|
929 |
$kmdrain = str_replace(",", ".", $_REQUEST['kmdrain']);
|
|
|
930 |
$kmplain = str_replace(",", ".", $_REQUEST['kmplain']);
|
|
|
931 |
|
|
|
932 |
$err = 0;
|
|
|
933 |
|
|
|
934 |
if (!isset($valid_from) || strlen($valid_from) < 6 || str_wordcount($valid_from, ".") != 3) {
|
|
|
935 |
Error(GetMessage(-1, 178, "Kein oder ungültiges Datum! Sie müssen ein gültiges Datum eingeben!"));
|
|
|
936 |
$err = 1;
|
|
|
937 |
}
|
|
|
938 |
|
|
|
939 |
if (!isset($amount) || strlen($amount) <= 0) {
|
|
|
940 |
Error(GetMessage(-1, 179, "Sie müssen einen Tagsatz größer 0,0 eingeben!"));
|
|
|
941 |
$err = 1;
|
|
|
942 |
}
|
|
|
943 |
|
|
|
944 |
if ($err)
|
|
|
945 |
TempTagsatz(true);
|
|
|
946 |
|
|
|
947 |
$fp = fopen("setup/ration.dat", "w+");
|
|
|
948 |
|
|
|
949 |
if (!$fp) {
|
|
|
950 |
Error(GetMessage(-1, 180, "Datei \"ration.dat\" konnte nicht angelegt werden!"));
|
|
|
951 |
return;
|
|
|
952 |
}
|
|
|
953 |
|
|
|
954 |
$dat = "[ration]\nvalid_from=".DateToDBDate($valid_from)."\n";
|
|
|
955 |
$dat .= "amount=$amount\nnightr=$nightr\nration=$ration\nkmcar=$kmcar\n";
|
|
|
956 |
$dat .= "kmdrain=$kmdrain\nkmplain=$kmplain\n";
|
|
|
957 |
fwrite($fp, $dat);
|
|
|
958 |
fclose($fp);
|
|
|
959 |
}
|
|
|
960 |
|
|
|
961 |
if (isset($func)) {
|
|
|
962 |
if ($func == "SaveSettings") {
|
|
|
963 |
if (!SaveSettings())
|
|
|
964 |
exit;
|
|
|
965 |
}
|
|
|
966 |
|
|
|
967 |
if ($func == "DoChangePW")
|
|
|
968 |
DoChangePW();
|
|
|
969 |
|
|
|
970 |
if ($func == "SaveTagsatz")
|
|
|
971 |
SaveTagsatz();
|
|
|
972 |
}
|
|
|
973 |
|
|
|
974 |
switch ($knopf) {
|
|
|
975 |
case 1:
|
|
|
976 |
ListProj();
|
|
|
977 |
break;
|
|
|
978 |
|
|
|
979 |
case 30:
|
|
|
980 |
EditMitarbeiter($headline, $rstufe, $menu, $unum);
|
|
|
981 |
break;
|
|
|
982 |
|
|
|
983 |
case 31:
|
|
|
984 |
EditProject($headline, $rstufe, $menu, $unum);
|
|
|
985 |
break;
|
|
|
986 |
|
|
|
987 |
case 32:
|
|
|
988 |
EditKey("tmgroup", $headline, $rstufe, $menu, $unum);
|
|
|
989 |
break;
|
|
|
990 |
|
|
|
991 |
case 33:
|
|
|
992 |
EditKey("sgf", $headline, $rstufe, $menu, $unum);
|
|
|
993 |
break;
|
|
|
994 |
|
|
|
995 |
case 34:
|
|
|
996 |
EditKey("abt", $headline, $rstufe, $menu, $unum);
|
|
|
997 |
break;
|
|
|
998 |
case 35:
|
|
|
999 |
EditKey("land", $headline, $rstufe, $menu, $unum);
|
|
|
1000 |
break;
|
|
|
1001 |
|
|
|
1002 |
case 36:
|
|
|
1003 |
EditKey("role", $headline, $rstufe, $menu, $unum);
|
|
|
1004 |
break;
|
|
|
1005 |
|
|
|
1006 |
case 37:
|
|
|
1007 |
EditKey("status", $headline, $rstufe, $menu, $unum);
|
|
|
1008 |
break;
|
|
|
1009 |
|
|
|
1010 |
case 38:
|
|
|
1011 |
EditKey("phase", $headline, $rstufe, $menu, $unum);
|
|
|
1012 |
break;
|
|
|
1013 |
|
|
|
1014 |
case 39:
|
|
|
1015 |
Settings();
|
|
|
1016 |
break;
|
|
|
1017 |
|
|
|
1018 |
case 40:
|
|
|
1019 |
EditTemplates();
|
|
|
1020 |
break;
|
|
|
1021 |
|
|
|
1022 |
case 41:
|
|
|
1023 |
ChangePW();
|
|
|
1024 |
break;
|
|
|
1025 |
|
|
|
1026 |
case 45:
|
|
|
1027 |
EditKey("anrede", $headline, $rstufe, $menu, $unum);
|
|
|
1028 |
break;
|
|
|
1029 |
|
|
|
1030 |
case 46:
|
|
|
1031 |
EditKey("category", $headline, $rstufe, $menu, $unum);
|
|
|
1032 |
break;
|
|
|
1033 |
|
|
|
1034 |
case 47:
|
|
|
1035 |
EditKey("costloc", $headline, $rstufe, $menu, $unum);
|
|
|
1036 |
break;
|
|
|
1037 |
|
|
|
1038 |
case 49:
|
|
|
1039 |
TempTagsatz();
|
|
|
1040 |
break;
|
|
|
1041 |
|
|
|
1042 |
case -1: break;
|
|
|
1043 |
|
|
|
1044 |
default:
|
|
|
1045 |
if ($menu == 1) {
|
|
|
1046 |
require_once('helper.inc');
|
|
|
1047 |
require('start.inc');
|
|
|
1048 |
}
|
|
|
1049 |
}
|
|
|
1050 |
|
|
|
1051 |
require('footer.inc');
|
|
|
1052 |
?>
|