2000-09-06 23:54:20 +02:00
|
|
|
<?php
|
2000-08-18 05:24:22 +02:00
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare *
|
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* The file written by Joseph Engo <jengo@phpgroupware.org> *
|
|
|
|
* -------------------------------------------- *
|
|
|
|
* This program is free software; you can redistribute it and/or modify it *
|
|
|
|
* under the terms of the GNU General Public License as published by the *
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
|
|
* option) any later version. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2000-11-09 14:21:36 +01:00
|
|
|
if (!isset($sessionid) || !$sessionid) {
|
2000-08-18 05:24:22 +02:00
|
|
|
Header("Location: login.php");
|
2000-09-03 15:02:32 +02:00
|
|
|
exit;
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
|
|
|
|
2000-11-16 08:40:37 +01:00
|
|
|
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home",
|
|
|
|
"enable_message_class" => True, "enable_calendar_class" => True,
|
|
|
|
"enable_todo_class" => True, "enable_addressbook_class" => True
|
|
|
|
);
|
2000-08-18 05:24:22 +02:00
|
|
|
include("header.inc.php");
|
|
|
|
// Note: I need to add checks to make sure these apps are installed.
|
|
|
|
|
2000-12-11 10:18:09 +01:00
|
|
|
if (($phpgw_info["user"]["preferences"]["common"]["useframes"] && $phpgw_info["server"]["useframes"] == "allowed")
|
|
|
|
|| ($phpgw_info["server"]["useframes"] == "always")) {
|
|
|
|
|
|
|
|
if (! $navbarframe && ! $framebody) {
|
|
|
|
$tpl = new Template($phpgw_info["server"]["template_dir"]);
|
2000-12-11 11:02:30 +01:00
|
|
|
$tpl->set_file(array("frames" => "frames.tpl",
|
|
|
|
"frame_body" => "frames_body.tpl",
|
|
|
|
"frame_navbar" => "frames_navbar.tpl"
|
|
|
|
));
|
2000-12-11 10:18:09 +01:00
|
|
|
|
|
|
|
$tpl->set_var("navbar_link",$phpgw->link("index.php?navbarframe=True"));
|
|
|
|
$tpl->set_var("body_link",$phpgw->link("index.php?framebody=True"));
|
|
|
|
|
2000-12-11 11:02:30 +01:00
|
|
|
if ($phpgw_info["user"]["preferences"]["common"]["frame_navbar_location"] == "bottom") {
|
|
|
|
$tpl->set_var("frame_size","*,60");
|
|
|
|
$tpl->parse("frames_","frame_body",True);
|
|
|
|
$tpl->parse("frames_","frame_navbar",True);
|
|
|
|
} else {
|
|
|
|
$tpl->set_var("frame_size","60,*");
|
|
|
|
$tpl->parse("frames_","frame_navbar",True);
|
|
|
|
$tpl->parse("frames_","frame_body",True);
|
|
|
|
}
|
2000-12-11 10:18:09 +01:00
|
|
|
$tpl->pparse("out","frames");
|
|
|
|
}
|
|
|
|
if ($navbarframe) {
|
|
|
|
$phpgw->common->phpgw_header();
|
|
|
|
$phpgw->common->navbar();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$phpgw->common->phpgw_header();
|
|
|
|
$phpgw->common->navbar();
|
|
|
|
}
|
|
|
|
|
2000-10-12 19:56:44 +02:00
|
|
|
if ($cd=="yes" && $phpgw_info["user"]["preferences"]["common"]["default_app"]
|
|
|
|
&& $phpgw_info["user"]["apps"][$phpgw_info["user"]["preferences"]["common"]["default_app"]]) {
|
2000-11-29 19:32:56 +01:00
|
|
|
$phpgw->redirect($phpgw->link($phpgw_info["server"]["webserver_url"] . "/"
|
|
|
|
. $phpgw_info["user"]["preferences"]["common"]["default_app"] . "/"));
|
2000-08-18 05:24:22 +02:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2000-11-04 11:44:21 +01:00
|
|
|
$phpgw->common->read_preferences("addressbook");
|
|
|
|
$phpgw->common->read_preferences("email");
|
|
|
|
$phpgw->common->read_preferences("calendar");
|
2000-11-11 08:10:24 +01:00
|
|
|
$phpgw->common->read_preferences("stocks");
|
2000-11-01 11:26:14 +01:00
|
|
|
|
2000-11-07 16:47:05 +01:00
|
|
|
$phpgw->db->query("select app_version from applications where app_name='admin'",__LINE__,__FILE__);
|
2000-11-02 09:52:10 +01:00
|
|
|
$phpgw->db->next_record();
|
|
|
|
|
|
|
|
if ($phpgw_info["server"]["version"] > $phpgw->db->f("app_version")) {
|
2000-11-02 00:37:10 +01:00
|
|
|
echo "<p><b>" . lang("Your are running a newer version of phpGroupWare then your database is setup for")
|
|
|
|
. "<br>" . lang("It is recommend that you run setup to upgrade your tables to the current version")
|
|
|
|
. "</b>";
|
2000-11-01 11:26:14 +01:00
|
|
|
}
|
2000-11-28 20:54:10 +01:00
|
|
|
|
|
|
|
$phpgw->translation->add_app("mainscreen");
|
|
|
|
if (lang("mainscreen_message") != "mainscreen_message*") {
|
2000-11-28 21:10:01 +01:00
|
|
|
echo "<center>" . stripslashes(lang("mainscreen_message")) . "</center>";
|
2000-11-24 05:45:09 +01:00
|
|
|
}
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2000-11-09 14:21:36 +01:00
|
|
|
if ((isset($phpgw_info["user"]["apps"]["admin"]) &&
|
|
|
|
$phpgw_info["user"]["apps"]["admin"]) &&
|
|
|
|
(isset($phpgw_info["server"]["checkfornewversion"]) &&
|
|
|
|
$phpgw_info["server"]["checkfornewversion"])) {
|
2000-08-26 03:05:04 +02:00
|
|
|
$phpgw->network->set_addcrlf(False);
|
2000-12-08 13:43:54 +01:00
|
|
|
$lines = $phpgw->network->gethttpsocketfile("http://www.phpgroupware.org/currentversion");
|
2000-08-18 05:24:22 +02:00
|
|
|
for ($i=0; $i<count($lines); $i++) {
|
|
|
|
if (ereg("currentversion",$lines[$i])) {
|
|
|
|
$line_found = explode(":",chop($lines[$i]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($line_found[1] > $phpgw_info["server"]["version"]) {
|
|
|
|
echo "<p>There is a new version of phpGroupWare avaiable. <a href=\""
|
|
|
|
. "http://www.phpgroupware.org\">http://www.phpgroupware.org</a>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-11-11 08:10:24 +01:00
|
|
|
echo '<p><table border="0" width="100%">';
|
2000-08-18 05:24:22 +02:00
|
|
|
?>
|
|
|
|
<script langague="JavaScript">
|
|
|
|
function opennotifywindow()
|
|
|
|
{
|
|
|
|
window.open("<?php echo $phpgw->link("notify.php")?>", "phpGroupWare", "width=150,height=25,location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status=yes");
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
//echo '<a href="javascript:opennotifywindow()">Open notify window</a>';
|
2000-11-11 08:10:24 +01:00
|
|
|
|
|
|
|
if ($phpgw_info["user"]["apps"]["stocks"] && $phpgw_info["user"]["preferences"]["stocks"]["enabled"]) {
|
|
|
|
include($phpgw_info["server"]["server_root"] . "/stocks/inc/functions.inc.php");
|
|
|
|
echo '<tr><td align="right">' . return_quotes($quotes) . '</td></tr>';
|
|
|
|
}
|
2000-09-03 09:56:11 +02:00
|
|
|
|
2000-11-09 14:21:36 +01:00
|
|
|
if ((isset($phpgw_info["user"]["apps"]["email"]) &&
|
|
|
|
$phpgw_info["user"]["apps"]["email"]) &&
|
|
|
|
(isset($phpgw_info["user"]["preferences"]["email"]["mainscreen_showmail"]) &&
|
|
|
|
$phpgw_info["user"]["preferences"]["email"]["mainscreen_showmail"])) {
|
2000-08-18 05:24:22 +02:00
|
|
|
echo "<!-- Mailox info -->\n";
|
|
|
|
|
|
|
|
$mbox = $phpgw->msg->login();
|
|
|
|
if (! $mbox) {
|
|
|
|
echo "Mail error: can not open connection to mail server";
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
$mailbox_status = $phpgw->msg->status($mbox,"{" . $phpgw_info["server"]["mail_server"] . ":" . $phpgw_info["server"]["mail_port"] . "}INBOX",SA_UNSEEN);
|
|
|
|
if ($mailbox_status->unseen == 1) {
|
2000-11-16 13:15:57 +01:00
|
|
|
echo "<tr><td><A href=\"" . $phpgw->link("email/index.php") . "\"> "
|
2000-09-07 22:49:55 +02:00
|
|
|
. lang("You have 1 new message!") . "</A></td></tr>\n";
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
|
|
|
if ($mailbox_status->unseen > 1) {
|
2000-11-16 13:15:57 +01:00
|
|
|
echo "<tr><td><A href=\"" . $phpgw->link("email/index.php") . "\"> "
|
2000-09-07 22:49:55 +02:00
|
|
|
. lang("You have x new messages!",$mailbox_status->unseen) . "</A></td></tr>";
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
|
|
|
echo "<!-- Mailox info -->\n";
|
|
|
|
}
|
|
|
|
|
2000-10-23 21:16:20 +02:00
|
|
|
if ($phpgw_info["user"]["apps"]["addressbook"]
|
2000-10-20 17:47:11 +02:00
|
|
|
&& $phpgw_info["user"]["preferences"]["addressbook"]["mainscreen_showbirthdays"]) {
|
2000-08-18 05:24:22 +02:00
|
|
|
echo "<!-- Birthday info -->\n";
|
2000-10-23 21:52:50 +02:00
|
|
|
$phpgw->db->query("select DISTINCT ab_firstname,ab_lastname from addressbook where "
|
2000-11-07 16:47:05 +01:00
|
|
|
. "ab_bday like '" . $phpgw->common->show_date(time(),"n/d",__LINE__,__FILE__)
|
2000-10-23 21:52:50 +02:00
|
|
|
. "/%' and (ab_owner='" . $phpgw_info["user"]["userid"] . "' or ab_access='"
|
|
|
|
. "ab_public')");
|
2000-08-18 05:24:22 +02:00
|
|
|
while ($phpgw->db->next_record()) {
|
2000-10-23 21:52:50 +02:00
|
|
|
echo "<tr><td>" . lang("Today is x's birthday!", $phpgw->db->f("ab_firstname") . " "
|
|
|
|
. $phpgw->db->f("ab_lastname")) . "</td></tr>\n";
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
2000-08-30 09:55:42 +02:00
|
|
|
$tommorow = $phpgw->common->show_date(mktime(0,0,0,
|
|
|
|
$phpgw->common->show_date(time(),"m"),
|
|
|
|
$phpgw->common->show_date(time(),"d")+1,
|
|
|
|
$phpgw->common->show_date(time(),"Y")),"n/d" );
|
2000-10-23 21:52:50 +02:00
|
|
|
$phpgw->db->query("select ab_firstname,ab_lastname from addressbook where "
|
2000-10-23 21:16:20 +02:00
|
|
|
. "ab_bday like '$tommorow/%' and (ab_owner='"
|
2000-11-07 16:47:05 +01:00
|
|
|
. $phpgw_info["user"]["userid"] . "' or ab_access='public')",__LINE__,__FILE__);
|
2000-08-18 05:24:22 +02:00
|
|
|
while ($phpgw->db->next_record()) {
|
2000-10-23 21:16:20 +02:00
|
|
|
echo "<tr><td>" . lang("Tommorow is x's birthday.", $phpgw->db->f("ab_firstname") . " "
|
|
|
|
. $phpgw->db->f("ab_lastname")) . "</td></tr>\n";
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
|
|
|
echo "<!-- Birthday info -->\n";
|
|
|
|
}
|
|
|
|
|
2000-10-23 21:16:20 +02:00
|
|
|
if ($phpgw_info["user"]["apps"]["calendar"]
|
2000-10-20 17:47:11 +02:00
|
|
|
&& $phpgw_info["user"]["preferences"]["calendar"]["mainscreen_showevents"]) {
|
2000-08-18 05:24:22 +02:00
|
|
|
echo "<!-- Calendar info -->\n";
|
2000-12-05 07:10:57 +01:00
|
|
|
$now = $phpgw->calendar->splitdate(mktime (0, 0, 0, $phpgw->calendar->today["month"], $phpgw->calendar->today["day"], $phpgw->calendar->today["year"]) - ((60 * 60) * $phpgw_info["user"]["preferences"]["common"]["tz_offset"]));
|
|
|
|
|
2000-11-16 13:15:57 +01:00
|
|
|
echo "<table border=\"0\" width=\"70%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"center\">"
|
2000-12-03 22:50:47 +01:00
|
|
|
. lang(date("F",$phpgw->calendar->today["raw"])) . " " .$phpgw->calendar->today["day"] . ", " . $phpgw->calendar->today["year"] ."</tr></td>"
|
2000-11-18 22:59:11 +01:00
|
|
|
. "<tr><td bgcolor=\"".$phpgw_info["theme"]["bg_text"]."\" valign=\"top\">"
|
2000-12-05 07:10:57 +01:00
|
|
|
. $phpgw->calendar->print_day_at_a_glance($now)."</td></tr></table>\n";
|
2000-08-18 05:24:22 +02:00
|
|
|
echo "<!-- Calendar info -->\n";
|
|
|
|
}
|
|
|
|
|
2000-11-17 18:00:17 +01:00
|
|
|
//$phpgw->common->debug_phpgw_info();
|
2000-11-06 01:57:16 +01:00
|
|
|
//$phpgw->common->debug_list_core_functions();
|
2000-08-18 05:24:22 +02:00
|
|
|
?>
|
|
|
|
<TR><TD></TD></TR>
|
|
|
|
</TABLE>
|
|
|
|
<?php
|
|
|
|
include($phpgw_info["server"]["api_dir"] . "/footer.inc.php");
|
|
|
|
?>
|
|
|
|
|