forked from kivitendo/kivitendo-crm
/
showTermin.php
91 lines (90 loc) · 3.44 KB
/
showTermin.php
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
<?php
require_once("inc/stdLib.php");
include("inc/crmLib.php");
if ($_GET["del"]) {
deleteTermin($_GET["del"]);
echo "<script language='JavaScript'>self.close();</script>";
}
$data=getTerminData($_GET["termid"]);
$usr=getTerminUser($_GET["termid"]);
$privat = ($data["privat"]=='t' && $data["uid"]!=$_SESSION["loginCRM"]);
$edit = false;
if ($data["uid"]==$_SESSION["loginCRM"]) $edit = true;
$links="";
if ($usr) foreach ($usr as $row) {
if (substr($row["uid"],0,1)<>"f" and $row["uid"]<>"E".$_SESSION["loginCRM"]) {
$user[]=$row["uid"];
} else if ($row["uid"]=="E".$_SESSION["loginCRM"]) {
$edit = true;
}
}
if ($user) {
$selusr=getUsrNamen($user);
foreach($selusr as $row) {
if (substr($row["id"],0,1)=="C") { $tmp="firma1.php?Q=C&id=".substr($row["id"],1); }
else if (substr($row["id"],0,1)=="V") { $tmp="firma1.php?Q=V&id=".substr($row["id"],1); }
else if (substr($row["id"],0,1)=="P") { $tmp="kontakt.php?id=".substr($row["id"],1); }
if (substr($row["id"],0,1)=="G") {
$links.="(".$row["name"].") ";
} else {
$links.="[<a href='#' onClick='openstamm(\"$tmp\")'>".(($row["name"])?$row["name"]:$row["login"])."</a>] \n";
}
}
}
list($tt,$mm,$yy)=explode("\.",$data["starttag"]);
$ft=feiertage($yy);
$x=mktime(0,0,0,$mm,$tt,$yy);
$wdhlg=array("0"=>"einmalig","1"=>"täglich","2"=>"2-tägig","7"=>"wöchentlich",
"14"=>"2-wöchenltich","30"=>"monatlich","365"=>"jählich");
?>
<html>
<head><title>Lx-Termin</title>
<link type="text/css" REL="stylesheet" HREF="../css/<?php echo $_SESSION["stylesheet"]; ?>"></link>
<link type="text/css" REL="stylesheet" HREF="css/<?php echo $_SESSION["stylesheet"]; ?>"></link>
<script language="JavaScript">
function editterm() {
opener.parent.location.href='termin.php?holen=<?php echo $_GET["termid"] ?>';
self.close();
}
function delterm() {
Check = confirm("Wirklich löschen?");
if(Check == false) return false;
document.location.href='showTermin.php?del=<?php echo $_GET["termid"] ?>';
}
function openstamm(link) {
opener.top.main_window.location.href=link;
self.close();
}
</script>
</head>
<body>
<?php
echo "Termin: <b>".(($privat)?"Privattermin":$data["cause"])."</b><br>";
if ($data["location"]) echo "Ort: ".$data["location"]."<br />";
if ($data["catname"]) echo $data["catname"].'<br />';
echo db2date($data["starttag"])." ".$data["startzeit"]." - ";
echo ($data["stoptag"]<>$data["starttag"])?db2date($data["stoptag"])." ".$data["stopzeit"]:$data["stopzeit"];
echo "<br>";
echo "Wiederholung: ".$wdhlg[$data["repeat"]].", ";
echo ($data["ft"]==1)?"nur Arbeitstage":"auch Feiertage";
echo "<br>";
if ($ft[$x]) echo $ft[$x];
echo "<hr><br>";
if ($privat) {
echo "Privattermin<br />";
} else {
echo $data["c_cause"]."<br />";
}
?>
<hr>
<?php echo $links ?>
<br>
<br>
<input type="button" onClick="self.close()" value="schließen">
<?php if (!$privat && $edit) { ?>
<input type="button" onClick="delterm()" value="löschen">
<input type="button" onClick="editterm()" value="ändern">
<?php } ?>
<script language='JavaScript'>self.focus();</script>
</body>
</html>