Added capability to schedule others and not yourself

This commit is contained in:
skeeter 2000-11-26 18:03:20 +00:00
parent 94b2199bbe
commit 8f150afb78
6 changed files with 39 additions and 3 deletions

View File

@ -208,6 +208,7 @@
$phpgw->template->set_var("data",$str);
$phpgw->template->parse("output","list",True);
// Participants
$phpgw->template->set_var("field",lang("Participants"));
$db2 = $phpgw->db;
$db2->query("select account_id,account_lastname,account_firstname,account_lid "
@ -232,10 +233,29 @@
$str .= ">".$phpgw->common->grab_owner_name($db2->f("account_id"))."</option>";
}
$str .= "</select>";
$str .= "<input type=\"hidden\" name=\"participants[]\" value=\"".$phpgw_info["user"]["account_id"]."\">";
// $str .= "<input type=\"hidden\" name=\"participants[]\" value=\"".$phpgw_info["user"]["account_id"]."\">";
$phpgw->template->set_var("data",$str);
$phpgw->template->parse("output","list",True);
// I Participate
$phpgw->template->set_var("field",lang("I Participate"));
$participate = False;
if($id) {
for($i=0;$i<count($cal_info->participants);$i++) {
if($cal_info->participants[$i] == $phpgw_info["user"]["account_id"]) {
$participate = True;
}
}
}
$str = "<input type=\"checkbox\" name=\"participants[]\" value=\"".$phpgw_info["user"]["account_id"]."\"";
if($id && $participate) {
$str .= " checked";
}
$str .= ">";
$phpgw->template->set_var("data",$str);
$phpgw->template->parse("output","list",True);
// Repeat Type
$phpgw->template->set_var("field",lang("Repeat Type"));
$str = "<select name=\"rpt_type\">";
$rpt_type_str = Array("none","daily","weekly","monthlybyday","monthlybydate","yearly");

View File

@ -23,6 +23,14 @@
$data = $HTTP_POST_VARS[$key];
$cal_info->set($key,$data);
}
$participating = False;
if($phpgw_info["user"]["account_id"] == $cal_info->participants[count($cal_info->participants) - 1]) {
$participating = True;
}
if(!$participating && count($cal_info->participants) == 1) {
$cal_info->owner = $cal_info->participants[0];
}
$phpgw->common->appsession($cal_info);
$overlapping_events = $phpgw->calendar->overlap($cal_info->month,$cal_info->day,$cal_info->year,$cal_info->hour,$cal_info->minute,$cal_info->ampm,$cal_info->duration,$cal_info->participants,$cal_info->id);
} else {

View File

@ -91,7 +91,13 @@
$phpgw->template->parse("output","list",True);
$phpgw->template->set_var("field",lang("Created by"));
if($is_my_event)
$participate = False;
for($i=0;$i<count($cal_info->participants);$i++) {
if($cal_info->participants[$i] == $phpgw_info["user"]["account_id"]) {
$participate = True;
}
}
if($is_my_event && $participate)
$phpgw->template->set_var("data","<a href=\""
.$phpgw->link("timematrix.php","participants=".$cal_info->owner."&date=".$cal_info->year.$cal_info->month.$cal_info->day)
."\">".$phpgw->common->grab_owner_name($cal_info->owner)."</a>");

View File

@ -40,7 +40,7 @@
switch($view) {
case "free/busy" :
echo $phpgw->calendar->timematrix($phpgw->calendar->date_to_epoch($date),0,0,$participants);
echo $phpgw->calendar->timematrix($phpgw->calendar->date_to_epoch($date),$phpgw->calendar->splittime("000000"),0,$participants);
break;
case "weekly" :
echo $phpgw->calendar->display_large_week($thisday,$thismonth,$thisyear,true,$participants);

View File

@ -1,5 +1,6 @@
[0.9.7] - Fixed SQL error in tts
- Fixed table locking in admin -> edit account
- Added capability to schedule others and not yourself to calendar.
[0.9.6] - Fix user permissions where not being checked properly.

View File

@ -173,6 +173,7 @@ high common en High
home common en Home
home phone addressbook en Home Phone
human resources common en Human Resources
i participate calendar en I Participate
idle admin en idle
if applicable email en If Applicable
ignore conflict calendar en Ignore Conflict