added code to allow for viewing others calendar items - NOT FULLY IMPLEMENTED

This commit is contained in:
skeeter 2000-11-21 04:10:45 +00:00
parent 99dd567247
commit c7e6e4f021
4 changed files with 55 additions and 8 deletions

View File

@ -50,6 +50,22 @@
}
}
if(!isset($owner)) { $owner = 0; }
unset($owner);
if(!isset($owner) || !$owner) {
$id = $phpgw_info["user"]["userid"];
$fn = $phpgw_info["user"]["firstname"];
$ln = $phpgw_info["user"]["lastname"];
$owner = 0;
} else {
$phpgw->db->query("SELECT account_lid,account_firstname,account_lastname FROM accounts WHERE account_id=$owner");
$phpgw->db->next_record();
$id = $phpgw->db->f("account_lid");
$fn = $phpgw->db->f("account_firstname");
$ln = $phpgw->db->f("account_lastname");
}
$view = "day";
$now = $phpgw->calendar->splitdate(mktime (2, 0, 0, $thismonth, $thisday, $thisyear));
@ -68,8 +84,8 @@
$m = mktime(2,0,0,$thismonth,1,$thisyear);
$phpgw->template->set_var("date",lang(strftime("%B",$m))." ".$thisday.", ".$thisyear);
$phpgw->template->set_var("username",$phpgw->common->display_fullname($phpgw_info["user"]["userid"],$phpgw_info["user"]["firstname"],$phpgw_info["user"]["lastname"]));
$phpgw->template->set_var("daily_events",$phpgw->calendar->print_day_at_a_glance($now));
$phpgw->template->set_var("username",$phpgw->common->display_fullname($id,$fn,$ln));
$phpgw->template->set_var("daily_events",$phpgw->calendar->print_day_at_a_glance($now,$owner));
$phpgw->template->set_var("small_calendar",$phpgw->calendar->pretty_small_calendar($now["day"],$now["month"],$now["year"],"day.php"));
if (!$friendly) {

View File

@ -342,8 +342,7 @@ function validate_and_submit() {
<tr>
<td><b><?php echo lang("Frequency"); ?>: </b></td>
<td>
<input name="rpt_freq" size="4" maxlength="4" value="<?php
echo $cal_info->rpt_freq; ?>">
<input name="rpt_freq" size="4" maxlength="4" value="<?php echo $cal_info->rpt_freq; ?>">
</td>
</tr>
</TABLE>

View File

@ -50,6 +50,22 @@
}
}
if(!isset($owner)) { $owner = 0; }
unset($owner);
if(!isset($owner) || !$owner) {
$id = $phpgw_info["user"]["userid"];
$fn = $phpgw_info["user"]["firstname"];
$ln = $phpgw_info["user"]["lastname"];
$owner = 0;
} else {
$phpgw->db->query("SELECT account_lid,account_firstname,account_lastname FROM accounts WHERE account_id=$owner");
$phpgw->db->next_record();
$id = $phpgw->db->f("account_lid");
$fn = $phpgw->db->f("account_firstname");
$ln = $phpgw->db->f("account_lastname");
}
$next = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth + 1,1,$thisyear));
$prev = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth - 1,1,$thisyear));
@ -72,9 +88,9 @@
$m = mktime(2,0,0,$thismonth,1,$thisyear);
$phpgw->template->set_var("month_identifier",lang(strftime("%B",$m)) . " " . $thisyear);
$phpgw->template->set_var("username",$phpgw->common->display_fullname($phpgw_info["user"]["userid"],$phpgw_info["user"]["firstname"],$phpgw_info["user"]["lastname"]));
$phpgw->template->set_var("username",$phpgw->common->display_fullname($id,$fn,$ln));
$phpgw->template->set_var("small_calendar_next",$phpgw->calendar->pretty_small_calendar($thisday,$next["month"],$next["year"],"day.php"));
$phpgw->template->set_var("large_month",$phpgw->calendar->display_large_month($thismonth,$thisyear,True,"edit_entry.php"));
$phpgw->template->set_var("large_month",$phpgw->calendar->display_large_month($thismonth,$thisyear,True,$owner));
if (!$friendly) {
$param = "year=".$now["year"]."&month=".$now["month"]."&friendly=1";
$phpgw->template->set_var("print","<a href=\"".$phpgw->link($PHP_SELF,$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window."

View File

@ -49,6 +49,22 @@
}
}
if(!isset($owner)) { $owner = 0; }
unset($owner);
if(!isset($owner) || !$owner) {
$id = $phpgw_info["user"]["userid"];
$fn = $phpgw_info["user"]["firstname"];
$ln = $phpgw_info["user"]["lastname"];
$owner = 0;
} else {
$phpgw->db->query("SELECT account_lid,account_firstname,account_lastname FROM accounts WHERE account_id=$owner");
$phpgw->db->next_record();
$id = $phpgw->db->f("account_lid");
$fn = $phpgw->db->f("account_firstname");
$ln = $phpgw->db->f("account_lastname");
}
$next = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth,$thisday + 7,$thisyear));
$prev = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth,$thisday - 7,$thisyear));
@ -89,7 +105,7 @@
$week_id .= $last["day"].", ".$last["year"];
$phpgw->template->set_var("week_identifier",$week_id);
$phpgw->template->set_var("username",$phpgw->common->display_fullname($phpgw_info["user"]["userid"],$phpgw_info["user"]["firstname"],$phpgw_info["user"]["lastname"]));
$phpgw->template->set_var("username",$phpgw->common->display_fullname($id,$fn,$ln));
if (!$friendly) {
$phpgw->template->set_var("next_week_link","<a href=\"".$phpgw->link("week.php","year=".$next["year"]."&month=".$next["month"]."&day=".$next["day"])."\">&gt;&gt;</a>");
@ -97,7 +113,7 @@
$phpgw->template->set_var("next_week_link","&gt;&gt;");
}
$phpgw->template->set_var("small_calendar_next",$phpgw->calendar->pretty_small_calendar($thisday,$nextmonth["month"],$nextmonth["year"],"day.php"));
$phpgw->template->set_var("week_display",$phpgw->calendar->display_large_week($thisday,$thismonth,$thisyear,true));
$phpgw->template->set_var("week_display",$phpgw->calendar->display_large_week($thisday,$thismonth,$thisyear,true,$owner));
if (!$friendly) {
$param = "year=".$thisyear."&month=".$thismonth."&day=".$thisday."&friendly=1";