Working on update the owner fields to work off account_id

This commit is contained in:
jengo 2000-10-25 21:21:08 +00:00
parent b33d3e05c4
commit bca1ba9ca0
6 changed files with 16 additions and 15 deletions

View File

@ -21,7 +21,7 @@
if ($id > 0) {
$can_edit = false;
$phpgw->db->query("SELECT cal_id FROM webcal_entry_user WHERE cal_login="
. "'" . $phpgw_info["user"]["userid"] . "' AND cal_id = $id");
. "'" . $phpgw_info["user"]["account_id"] . "' AND cal_id = $id");
$phpgw->db->next_record();
if ($phpgw->db->f("cal_id") > 0)
$can_edit = true;
@ -258,9 +258,10 @@ function validate_and_submit() {
<?php
$phpgw->db->query("select account_lid,account_lastname, account_firstname from accounts where "
. "account_status !='L' and account_lid != '" . $phpgw_info["user"]["userid"] . "' and "
. "account_permissions like '%:calendar:%' order by account_lastname,account_firstname,account_lid");
$phpgw->db->query("select account_id,account_lid,account_lastname, account_firstname from "
. "accounts where account_status !='L' and account_lid != '"
. $phpgw_info["user"]["userid"] . "' and account_permissions like '%:calendar:%' "
. "order by account_lastname,account_firstname,account_lid");
if ($phpgw->db->num_rows() > 50)
$size = 15;
@ -273,8 +274,8 @@ function validate_and_submit() {
. "<TD>\n<SELECT NAME=\"participants[]\" multiple size=\"$size\">\n";
while ($phpgw->db->next_record()) {
echo "<option value=\"" . $phpgw->db->f("account_lid") . "\"";
if ($participants[$phpgw->db->f("account_lid")])
echo "<option value=\"" . $phpgw->db->f("account_id") . "\"";
if ($participants[$phpgw->db->f("account_id")])
echo " selected";
echo ">" . $phpgw->common->display_fullname($phpgw->db->f("account_lid"),
@ -284,7 +285,7 @@ function validate_and_submit() {
}
echo "</select><input type=\"hidden\" name=\"participants[]\" value=\""
. $phpgw_info["user"]["userid"] ."\">"
. $phpgw_info["user"]["account_id"] ."\">"
. "</td></tr>\n";
?>

View File

@ -126,7 +126,7 @@ if (! $error) {
$sql = "INSERT INTO webcal_entry (cal_create_by, cal_date, " .
"cal_time, cal_mod_date, cal_mod_time, cal_duration, cal_priority, " .
"cal_access, cal_type, cal_name, cal_description ) " .
"VALUES ('" . $phpgw_info["user"]["userid"] . "', ";
"VALUES ('" . $phpgw_info["user"]["account_id"] . "', ";
$date = mktime(0,0,0,$month,$day,$year);
$sql .= date("Ymd", $date) . ", ";

View File

@ -294,7 +294,7 @@
. "WHERE webcal_entry.cal_id = webcal_entry_repeats.cal_id "
. "AND webcal_entry.cal_id = webcal_entry_user.cal_id "
. "AND webcal_entry_groups.cal_id = webcal_entry.cal_id "
. "AND (webcal_entry_user.cal_login = '" . $phpgw_info["user"]["userid"] . "' OR (webcal_entry.cal_access='group' ";
. "AND (webcal_entry_user.cal_login = '" . $phpgw_info["user"]["account_id"] . "' OR (webcal_entry.cal_access='group' ";
$group_names = $phpgw->accounts->read_group_names();
if ($group_names) {
$sql .= " AND (";
@ -377,7 +377,7 @@
. "ON webcal_entry_groups.cal_id=webcal_entry.cal_id "
. "WHERE webcal_entry.cal_date='" . date("Ymd", $date) . "' "
. "AND webcal_entry.cal_type != 'M' "
. "AND (webcal_entry_user.cal_login='" . $phpgw_info["user"]["userid"] . "' "
. "AND (webcal_entry_user.cal_login='" . $phpgw_info["user"]["account_id"] . "' "
. sql_search_calendar() . ") "
. "ORDER BY webcal_entry.cal_priority, webcal_entry.cal_time";
} else {
@ -388,7 +388,7 @@
. "FROM webcal_entry, webcal_entry_user, webcal_entry_groups "
. "WHERE webcal_entry.cal_date='" . date("Ymd", $date) . "' "
. "AND webcal_entry.cal_type != 'M' AND "
. "(webcal_entry_user.cal_login='" . $phpgw_info["user"]["userid"] . "' "
. "(webcal_entry_user.cal_login='" . $phpgw_info["user"]["account_id"] . "' "
. " AND webcal_entry.cal_id=webcal_entry_user.cal_id OR "
. "(webcal_entry_groups.cal_id=webcal_entry.cal_id "
. sql_search_calendar() . ")) ORDER "
@ -548,7 +548,7 @@
. "ON webcal_entry_groups.cal_id=webcal_entry.cal_id "
. "WHERE webcal_entry.cal_date='" . date("Ymd", $date) . "' "
. "AND webcal_entry.cal_type != 'M' "
. "AND (webcal_entry_user.cal_login='" . $phpgw_info["user"]["userid"] . "' "
. "AND (webcal_entry_user.cal_login='" . $phpgw_info["user"]["account_id"] . "' "
. sql_search_calendar() . ") "
. "ORDER BY webcal_entry.cal_priority, webcal_entry.cal_time";

View File

@ -51,7 +51,7 @@
. "webcal_entry_groups WHERE (UPPER(webcal_entry.cal_name) LIKE UPPER('%"
. $words[$i] . "%') OR UPPER(webcal_entry.cal_description) "
. "LIKE UPPER('%" . $words[$i] . "%')) AND (webcal_entry_user.cal_login = '"
. $phpgw_info["user"]["userid"] . "' OR (webcal_entry.cal_access='public' "
. $phpgw_info["user"]["account_id"] . "' OR (webcal_entry.cal_access='public' "
. sql_search_calendar() . ")) ORDER BY cal_date";
$phpgw->db->query($sql);

View File

@ -196,7 +196,7 @@
<P>
<?php
if ($phpgw_info["user"]["userid"] == $create_by) {
if ($phpgw_info["user"]["account_id"] == $create_by) {
echo "<A HREF=\"" . $phpgw->link("edit_entry.php","id=$id") . "\">"
. lang("Edit") . "</A><BR>\n<A HREF=\"" . $phpgw->link("delete.php","id=$id") . "\" onClick=\"return confirm('"
. lang("Are you sure\\nyou want to\\ndelete this entry ?\\n\\nThis will delete\\nthis entry for all users.") . "');\">" . lang("Delete") . "</A><BR>\n";

View File

@ -137,7 +137,7 @@
<TR>
<?php
// Pre-Load the repeated events
$repeated_events = read_repeated_events($phpgw_info["user"]["userid"]);
$repeated_events = read_repeated_events($phpgw_info["user"]["account_id"]);
$today = mktime(2,0,0,date("m"), date("d"), date("Y"));
for ($j = 0; $j < 7; $j++) {