mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:07 +01:00
added new feature - matrix view
This commit is contained in:
parent
1bd0e2d351
commit
68b12e4b5e
@ -192,7 +192,7 @@
|
||||
$phpgw->template->set_var("data",$str);
|
||||
$phpgw->template->parse("output","list",True);
|
||||
|
||||
$phpgw->template->set_var("field",lang("Access"));
|
||||
$phpgw->template->set_var("field",lang("Groups"));
|
||||
$str = "<select name=\"n_groups[]\" multiple size=\"5\">";
|
||||
$user_groups = $phpgw->accounts->read_group_names();
|
||||
for ($i=0;$i<count($user_groups);$i++) {
|
||||
@ -206,26 +206,27 @@
|
||||
$phpgw->template->parse("output","list",True);
|
||||
|
||||
$phpgw->template->set_var("field",lang("Participants"));
|
||||
$phpgw->db->query("select account_id,account_lastname,account_firstname,account_lid "
|
||||
$db2 = $phpgw->db;
|
||||
$db2->query("select account_id,account_lastname,account_firstname,account_lid "
|
||||
. "from accounts where account_status !='L' and "
|
||||
. "account_id != ".$phpgw_info["user"]["account_id"]." "
|
||||
. "and account_permissions like '%:calendar:%' "
|
||||
. "order by account_lastname,account_firstname,account_lid");
|
||||
|
||||
if ($phpgw->db->num_rows() > 50)
|
||||
if ($db2->num_rows() > 50)
|
||||
$size = 15;
|
||||
else if ($phpgw->db->num_rows() > 5)
|
||||
else if ($db2->num_rows() > 5)
|
||||
$size = 5;
|
||||
else
|
||||
$size = $phpgw->db->num_rows();
|
||||
$size = $db2->num_rows();
|
||||
$str = "<select name=\"participants[]\" multiple size=\"5\">";
|
||||
for ($l=0;$l<count($cal_info->participants);$l++)
|
||||
$parts[$cal_info->participants[$l]] = True;
|
||||
while ($phpgw->db->next_record()) {
|
||||
$str .= "<option value=\"" . $phpgw->db->f("account_id") . "\"";
|
||||
if ($parts[$phpgw->db->f("account_id")])
|
||||
while ($db2->next_record()) {
|
||||
$str .= "<option value=\"" . $db2->f("account_id") . "\"";
|
||||
if ($parts[$db2->f("account_id")])
|
||||
$str .= " selected";
|
||||
$str .= ">".$phpgw->common->grab_owner_name($phpgw->db->f("account_id"))."</option>";
|
||||
$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"]."\">";
|
||||
@ -273,7 +274,7 @@
|
||||
$phpgw->template->set_var("data",$str);
|
||||
$phpgw->template->parse("output","list",True);
|
||||
|
||||
$phpgw->template->set_var("field",lang("Repeat Day")."<br>".lang("for weekly"));
|
||||
$phpgw->template->set_var("field",lang("Repeat Day")."<br>".lang("(for weekly)"));
|
||||
$str = "<input type=\"checkbox\" name=\"rpt_sun\" value=\"y\"".($cal_info->rpt_sun?"checked":"")."> ".lang("Sunday")." ";
|
||||
$str .= "<input type=\"checkbox\" name=\"rpt_mon\" value=\"y\"".($cal_info->rpt_mon?"checked":"")."> ".lang("Monday")." ";
|
||||
$str .= "<input type=\"checkbox\" name=\"rpt_tue\" value=\"y\"".($cal_info->rpt_tue?"checked":"")."> ".lang("Tuesday")." ";
|
||||
|
@ -48,6 +48,11 @@
|
||||
<img src="<?php echo $phpgw_info["server"]["app_images"]; ?>/month.gif" alt="<?php echo lang("This month"); ?>" border="0">
|
||||
</a>
|
||||
</td>
|
||||
<td width="2%" align="left">
|
||||
<a href="<?php echo $phpgw->link("matrixselect.php","day=".$phpgw->calendar->today["day"]."&month=".$phpgw->calendar->today["month"]."&year=".$phpgw->calendar->today["year"]); ?>">
|
||||
<img src="<?php echo $phpgw_info["server"]["app_images"]; ?>/view.gif" alt="<?php echo lang("Daily Matrix View"); ?>" border="0">
|
||||
</a>
|
||||
</td>
|
||||
<td align="right">
|
||||
<form action="<?php echo $phpgw->link("search.php"); ?>" method="POST">
|
||||
<input type="hidden" name="from" value="<?php echo $PHP_SELF; ?>">
|
||||
|
120
calendar/matrixselect.php
Executable file
120
calendar/matrixselect.php
Executable file
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Calendar *
|
||||
* http://www.phpgroupware.org *
|
||||
* Based on Webcalendar by Craig Knudsen <cknudsen@radix.net> *
|
||||
* http://www.radix.net/~cknudsen *
|
||||
* -------------------------------------------- *
|
||||
* 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$ */
|
||||
|
||||
$phpgw_info["flags"] = array("currentapp" => "calendar", "enable_calendar_class" => True, "enable_nextmatchs_class" => True);
|
||||
include("../header.inc.php");
|
||||
|
||||
if(isset($friendly) && $friendly) {
|
||||
if(!isset($phpgw_info["user"]["preferences"]["calendar"]["weekdaystarts"]))
|
||||
$phpgw_info["user"]["preferences"]["calendar"]["weekdaystarts"] = "Sunday";
|
||||
|
||||
if (isset($date) && strlen($date) > 0) {
|
||||
$thisyear = substr($date, 0, 4);
|
||||
$thismonth = substr($date, 4, 2);
|
||||
$thisday = substr($date, 6, 2);
|
||||
} else {
|
||||
if (!isset($day) || !$day)
|
||||
$thisday = $phpgw->calendar->today["day"];
|
||||
else
|
||||
$thisday = $day;
|
||||
if (!isset($month) || !$month)
|
||||
$thismonth = $phpgw->calendar->today["month"];
|
||||
else
|
||||
$thismonth = $month;
|
||||
if (!isset($year) || !$year)
|
||||
$thisyear = $phpgw->calendar->today["year"];
|
||||
else
|
||||
$thisyear = $year;
|
||||
}
|
||||
}
|
||||
|
||||
$phpgw->template->set_file(array("matrix_query_begin" => "matrix_query.tpl",
|
||||
"list" => "list.tpl",
|
||||
"matrix_query_end" => "matrix_query.tpl",
|
||||
"form_button" => "form_button_script.tpl"));
|
||||
|
||||
$phpgw->template->set_block("matrix_query_begin","list","matrix_query_end","form_button");
|
||||
|
||||
// $phpgw->template->set_var("bg_color",$phpgw_info["theme"]["bg_text"]);
|
||||
$phpgw->template->set_var("matrix_action",lang("Daily Matrix View"));
|
||||
$phpgw->template->set_var("action_url",$phpgw->link("timematrix.php"));
|
||||
|
||||
$phpgw->template->parse("out","matrix_query_begin");
|
||||
|
||||
$phpgw->template->set_var("field",lang("Date"));
|
||||
|
||||
$day_html = "<select name=\"day\">";
|
||||
for ($i = 1; $i <= 31; $i++)
|
||||
$day_html .= "<option value=\"$i\"" . ($i == $thisday ? " selected" : "") . ">$i"
|
||||
. "</option>\n";
|
||||
$day_html .= "</select>";
|
||||
|
||||
$month_html = "<select name=\"month\">";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$m = lang(date("F", mktime(0,0,0,$i,1,$cal_info->year)));
|
||||
$month_html .= "<option value=\"$i\"" . ($i == $thismonth ? " selected" : "") . ">$m"
|
||||
. "</option>\n";
|
||||
}
|
||||
$month_html .= "</select>";
|
||||
|
||||
$year_html = "<select name=\"year\">";
|
||||
for ($i = ($thisyear - 1); $i < ($thisyear + 5); $i++) {
|
||||
$year_html .= "<option value=\"$i\"" . ($i == $thisyear ? " selected" : "") . ">$i"
|
||||
. "</option>\n";
|
||||
}
|
||||
$year_html .= "</select>";
|
||||
|
||||
$phpgw->template->set_var("data",$phpgw->common->dateformatorder($year_html,$month_html,$day_html));
|
||||
$phpgw->template->parse("output","list",True);
|
||||
|
||||
$phpgw->template->set_var("field",lang("Participants"));
|
||||
$db2 = $phpgw->db;
|
||||
$db2->query("select account_id,account_lastname,account_firstname "
|
||||
. "from accounts where account_status !='L' and "
|
||||
. "account_id != ".$phpgw_info["user"]["account_id"]." "
|
||||
. "and account_permissions like '%:calendar:%' "
|
||||
. "order by account_lastname,account_firstname");
|
||||
|
||||
$num_rows = $db2->num_rows();
|
||||
if ($num_rows > 50)
|
||||
$size = 15;
|
||||
elseif ($num_rows > 5)
|
||||
$size = 5;
|
||||
else
|
||||
$size = $num_rows;
|
||||
$str = "<select name=\"participants[]\" multiple size=\"$size\">";
|
||||
|
||||
while($db2->next_record()) {
|
||||
$id = $db2->f("account_id");
|
||||
$str .= "<option value=\"".$id."\">".$phpgw->common->grab_owner_name($id)."</option>\n";
|
||||
}
|
||||
$str .= "</select>";
|
||||
$str .= "<input type=\"hidden\" name=\"participants[]\" value=\"".$phpgw_info["user"]["account_id"]."\">";
|
||||
$phpgw->template->set_var("data",$str);
|
||||
$phpgw->template->parse("output","list",True);
|
||||
|
||||
$phpgw->template->set_var("submit_button",lang("Submit"));
|
||||
|
||||
$phpgw->template->set_var("action_url_button","");
|
||||
$phpgw->template->set_var("action_text_button",lang("Cancel"));
|
||||
$phpgw->template->set_var("action_confirm_button","onClick=\"history.back(-1)\"");
|
||||
|
||||
$phpgw->template->parse("cancel_button","form_button");
|
||||
|
||||
$phpgw->template->pparse("out","matrix_query_end");
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
|
||||
?>
|
@ -1,8 +1,8 @@
|
||||
<!-- $Id$ -->
|
||||
<!-- BEGIN list -->
|
||||
<tr>
|
||||
<td valign="top" width="10%"><b>{field}:</b></td>
|
||||
<td valign="top" width="90%">{data}</td>
|
||||
<td valign="top" width="20%"><b>{field}:</b></td>
|
||||
<td valign="top" width="80%">{data}</td>
|
||||
</tr>
|
||||
<!-- END list -->
|
||||
|
||||
|
20
calendar/templates/default/matrix_query.tpl
Executable file
20
calendar/templates/default/matrix_query.tpl
Executable file
@ -0,0 +1,20 @@
|
||||
<!-- $Id$ -->
|
||||
<!-- BEGIN matrix_query_begin -->
|
||||
<center>
|
||||
<h2><font color="#000000">{matrix_action}</font></h2>
|
||||
|
||||
<form action="{action_url}" method="post" name="matrixform">
|
||||
<table border="0" width="75%">
|
||||
<!-- END matrix_query_begin -->
|
||||
|
||||
{output}
|
||||
|
||||
<!-- BEGIN matrix_query_end -->
|
||||
</table>
|
||||
<input type="submit" value="{submit_button}">
|
||||
</form>
|
||||
|
||||
{cancel_button}
|
||||
</center>
|
||||
<!-- END matrix_query_end -->
|
||||
|
@ -16,6 +16,27 @@
|
||||
$phpgw_info["flags"] = array("currentapp" => "calendar", "enable_calendar_class" => True, "enable_nextmatchs_class" => True);
|
||||
include("../header.inc.php");
|
||||
|
||||
if (isset($date) && strlen($date) > 0) {
|
||||
$thisyear = substr($date, 0, 4);
|
||||
$thismonth = substr($date, 4, 2);
|
||||
$thisday = substr($date, 6, 2);
|
||||
} else {
|
||||
if (!isset($day) || !$day)
|
||||
$thisday = $phpgw->calendar->today["day"];
|
||||
else
|
||||
$thisday = $day;
|
||||
if (!isset($month) || !$month)
|
||||
$thismonth = $phpgw->calendar->today["month"];
|
||||
else
|
||||
$thismonth = $month;
|
||||
if (!isset($year) || !$year)
|
||||
$thisyear = $phpgw->calendar->today["year"];
|
||||
else
|
||||
$thisyear = $year;
|
||||
}
|
||||
|
||||
$date = $thisyear.$thismonth.$thisday;
|
||||
|
||||
echo $phpgw->calendar->timematrix($phpgw->calendar->date_to_epoch($date),0,0,$participants);
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user