Merge branch 'template_locales'
[kivitendo-erp.git] / bin / mozilla / kopf.pl
1 #!/usr/bin/perl
2 #
3
4 $| = 1;
5
6 use CGI::Carp qw(fatalsToBrowser);
7
8 use strict;
9
10 my $form     = $main::form;
11 my $locale   = $main::locale;
12
13 $form->header;
14 my $paramstring = $ENV{"QUERY_STRING"};
15 my @felder = split "&", $paramstring;
16 my ($name, $wert);
17 foreach (@felder) {
18   ($name, $wert) = split "=", $_;
19   $wert =~ tr/+/ /;
20   $name = $wert;
21 }
22 my $login =
23     "[" . $form->{login}
24   . " - <a href=\"login.pl?action=logout\" target=\"_top\">"
25   . $locale->text('Logout')
26   . "</a>] ";
27 my ($Sekunden, $Minuten,   $Stunden,   $Monatstag, $Monat,
28     $Jahr,     $Wochentag, $Jahrestag, $Sommerzeit)
29   = localtime(time);
30 my $CTIME_String = localtime(time);
31 $Monat     += 1;
32 $Jahrestag += 1;
33 $Monat     = $Monat < 10     ? $Monat     = "0" . $Monat     : $Monat;
34 $Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag;
35 $Jahr += 1900;
36 my @Wochentage = ("Sonntag",    "Montag",  "Dienstag", "Mittwoch",
37                   "Donnerstag", "Freitag", "Samstag");
38 my @Monatsnamen = ("",       "Januar",    "Februar", "M&auml;rz",
39                    "April",  "Mai",       "Juni",    "Juli",
40                    "August", "September", "Oktober", "November",
41                    "Dezember");
42 my $datum =
43     $Wochentage[$Wochentag] . ", der "
44   . $Monatstag . "."
45   . $Monat . "."
46   . $Jahr . " - ";
47
48 #$zeit="<div id='Uhr'>".$Stunden.":".$Minuten.":".$Sekunden."</div>";
49 my $zeit = "<div id='Uhr'>" . $Stunden . ":" . $Minuten . "</div>";
50
51 print qq|
52 <script type="text/javascript">
53 <!--
54 var clockid=new Array()
55 var clockidoutside=new Array()
56 var i_clock=-1
57 var thistime= new Date()
58 var hours= | . $Stunden . qq|;
59 var minutes= | . $Minuten . qq|;
60 var seconds= | . $Sekunden . qq|;
61 if (eval(hours) <10) {hours="0"+hours}
62 if (eval(minutes) < 10) {minutes="0"+minutes}
63 if (seconds < 10) {seconds="0"+seconds}
64 //var thistime = hours+":"+minutes+":"+seconds
65 var thistime = hours+":"+minutes
66
67 function writeclock() {
68   i_clock++
69   if (document.all \|\| document.getElementById \|\| document.layers) {
70     clockid[i_clock]="clock"+i_clock
71     document.write("<font family=arial size=2><span id='"+clockid[i_clock]+"' style='position:relative'>"+thistime+"</span></font>")
72   }
73 }
74
75 function clockon() {
76   thistime= new Date()
77   hours=thistime.getHours()
78   minutes=thistime.getMinutes()
79   seconds=thistime.getSeconds()
80   if (eval(hours) <10) {hours="0"+hours}
81   if (eval(minutes) < 10) {minutes="0"+minutes}
82   if (seconds < 10) {seconds="0"+seconds}
83   //thistime = hours+":"+minutes+":"+seconds
84   thistime = hours+":"+minutes
85
86   if (document.all) {
87     for (i=0;i<=clockid.length-1;i++) {
88       var thisclock=eval(clockid[i])
89       thisclock.innerHTML=thistime
90     }
91   }
92
93   if (document.getElementById) {
94     for (i=0;i<=clockid.length-1;i++) {
95       document.getElementById(clockid[i]).innerHTML=thistime
96     }
97   }
98   var timer=setTimeout("clockon()",60000)
99 }
100 window.onload=clockon
101 //-->
102 </script>
103 |;
104
105 #
106 print qq|
107 <body bgcolor="#ffffff" text="#ffffff" link="#ffffff" vlink="#ffffff" alink="#ffffff" topmargin="0" leftmargin="0"  marginwidth="0" marginheight="0" style="background-image: url('image/fade.png'); background-repeat:repeat-x;">
108
109 <table border="0" width="100%" background="image/bg_titel.gif" cellpadding="0" cellspacing="0">
110   <tr>
111     <td  style="color:white; font-family:verdana,arial,sans-serif; font-size: 12px;"> 
112       &nbsp;[<a href="JavaScript:top.main_window.print();" title="| . $locale->text('Hardcopy') . qq|">| . $locale->text('Print') . qq|</a>]
113       &nbsp;[<a HREF="login.pl" target="_blank" "title="| . $locale->text('Open a further Lx-Office Window or Tab') . qq|">| . $locale->text('New Win/Tab') . qq|</a>]
114       &nbsp;[<a href="Javascript:top.main_window.history.back();" title="| . $locale->text('Go one step back') . qq|">| . $locale->text('Back') . qq|</a>] 
115       <!-- is there a better solution for Back? Possibly with the callback variable? -->
116     </td>
117     <td align="right" style="vertical-align:middle; color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>|
118   . $login . $datum . qq| <script>writeclock()</script>&nbsp;
119     </td>
120   </tr>
121 </table>
122 </body>
123 </html>
124 |;
125
126 #