0 ) { $id = 0; } $external_users = ""; $participants = array (); if ( ! empty ( $id ) && $id > 0 ) { // first see who has access to edit this entry if ( $is_admin || $is_assistant || $is_nonuser_admin) { $can_edit = true; } else { $can_edit = false; if ( $readonly == "N" || $is_admin ) { $sql = "SELECT webcal_entry.cal_id FROM webcal_entry, " . "webcal_entry_user WHERE webcal_entry.cal_id = " . "webcal_entry_user.cal_id AND webcal_entry.cal_id = $id " . "AND (webcal_entry.cal_create_by = '$login' " . "OR webcal_entry_user.cal_login = '$login')"; $res = dbi_query ( $sql ); if ( $res ) { $row = dbi_fetch_row ( $res ); if ( $row && $row[0] > 0 ) $can_edit = true; dbi_free_result ( $res ); } } } $sql = "SELECT cal_create_by, cal_date, cal_time, cal_mod_date, " . "cal_mod_time, cal_duration, cal_priority, cal_type, cal_access, " . "cal_name, cal_description FROM webcal_entry WHERE cal_id = " . $id; $res = dbi_query ( $sql ); if ( $res ) { $row = dbi_fetch_row ( $res ); if ( ! empty ( $override ) ) { // Leave $cal_date to what was set in URL with date=YYYYMMDD } else { $cal_date = $row[1]; } $create_by = $row[0]; $year = (int) ( $cal_date / 10000 ); $month = ( $cal_date / 100 ) % 100; $day = $cal_date % 100; $time = $row[2]; if ( $time >= 0 ) { /* -1 = no time specified */ $time += $TZ_OFFSET * 10000; if ( $time > 240000 ) { $time -= 240000; $gmt = mktime ( 3, 0, 0, $month, $day, $year ); $gmt += $ONE_DAY; $month = date ( "m", $gmt ); $day = date ( "d", $gmt ); $year = date ( "Y", $gmt ); } else if ( $time < 0 ) { $time += 240000; $gmt = mktime ( 3, 0, 0, $month, $day, $year ); $gmt -= $ONE_DAY; $month = date ( "m", $gmt ); $day = date ( "d", $gmt ); $year = date ( "Y", $gmt ); } // Set alterted date $cal_date = sprintf("%04d%02d%02d",$year,$month,$day); } if ( $time >= 0 ) { $hour = floor($time / 10000); $minute = ( $time / 100 ) % 100; $duration = $row[5]; } else { $duration = ""; } $priority = $row[6]; $type = $row[7]; $access = $row[8]; $name = $row[9]; $description = $row[10]; // check for repeating event info... // but not if we are overriding a single entry of an already repeating // event... confusing, eh? if ( ! empty ( $override ) ) { $rpt_type = "none"; $rpt_end = 0; $rpt_end_date = $cal_date; $rpt_freq = 1; $rpt_days = "nnnnnnn"; $rpt_sun = $rpt_mon = $rpt_tue = $rpt_wed = $rpt_thu = $rpt_fri = $rpt_sat = false; } else { $res = dbi_query ( "SELECT cal_id, cal_type, cal_end, " . "cal_frequency, cal_days FROM webcal_entry_repeats " . "WHERE cal_id = $id" ); if ( $res ) { if ( $row = dbi_fetch_row ( $res ) ) { $rpt_type = $row[1]; if ( $row[2] > 0 ) $rpt_end = date_to_epoch ( $row[2] ); else $rpt_end = 0; $rpt_end_date = $row[2]; $rpt_freq = $row[3]; $rpt_days = $row[4]; $rpt_sun = ( substr ( $rpt_days, 0, 1 ) == 'y' ); $rpt_mon = ( substr ( $rpt_days, 1, 1 ) == 'y' ); $rpt_tue = ( substr ( $rpt_days, 2, 1 ) == 'y' ); $rpt_wed = ( substr ( $rpt_days, 3, 1 ) == 'y' ); $rpt_thu = ( substr ( $rpt_days, 4, 1 ) == 'y' ); $rpt_fri = ( substr ( $rpt_days, 5, 1 ) == 'y' ); $rpt_sat = ( substr ( $rpt_days, 6, 1 ) == 'y' ); } } } } $sql = "SELECT cal_login, cal_category FROM webcal_entry_user WHERE cal_id = $id"; $res = dbi_query ( $sql ); if ( $res ) { while ( $row = dbi_fetch_row ( $res ) ) { if ( ! $is_secretary || $login != $row[0] ) $participants[$row[0]] = 1; if ($login == $row[0]) $cat_id = $row[1]; } } if ( ! empty ( $allow_external_users ) && $allow_external_users == "Y" ) { $external_users = event_get_external_users ( $id ); } } else { $id = 0; // to avoid warnings below about use of undefined var if ( empty ( $hour ) ) $time = -1; else $time = $hour * 100; if ( $readonly == "N" || $is_admin ) $can_edit = true; if ( ! empty ( $defusers ) ) { $tmp_ar = explode ( ",", $defusers ); for ( $i = 0; $i < count ( $tmp_ar ); $i++ ) { $participants[$tmp_ar[$i]] = 1; } } } if ( ! empty ( $year ) && $year ) $thisyear = $year; if ( ! empty ( $month ) && $month ) $thismonth = $month; if ( ! empty ( $day ) && $day ) $thisday = $day; if ( empty ( $rpt_type ) || ! $rpt_type ) $rpt_type = "none"; // avoid error for using undefined vars if ( empty ( $hour ) ) $hour = -1; if ( empty ( $duration ) ) $duration = 0; if ( $duration == ( 24 * 60 ) ) { $hour = $minute = $duration = ""; $allday = "Y"; } else $allday = "N"; if ( empty ( $name ) ) $name = ""; if ( empty ( $description ) ) $description = ""; if ( empty ( $priority ) ) $priority = 0; if ( empty ( $access ) ) $access = ""; if ( empty ( $rpt_freq ) ) $rpt_freq = 0; if ( empty ( $rpt_end_date ) ) $rpt_end_date = 0; if ( ( empty ( $year ) || ! $year ) && ( empty ( $month ) || ! $month ) && ( ! empty ( $date ) && strlen ( $date ) ) ) { $thisyear = $year = substr ( $date, 0, 4 ); $thismonth = $month = substr ( $date, 4, 2 ); $thisday = $day = substr ( $date, 6, 2 ); $cal_date = $date; } else { if ( empty ( $cal_date ) ) $cal_date = date ( "Ymd" ); } $thisdate = sprintf ( "%04d%02d%02d", $thisyear, $thismonth, $thisday ); if ( empty ( $cal_date ) || ! $cal_date ) $cal_date = $thisdate; $BodyX = 'xonload="timetype_handler()"'; $INC = array('js/popups.php','js/edit_entry.php'); print_header($INC,'',$BodyX); ?>

\n"; // we need an additional hidden input field echo "\n"; // are we overriding an entry from a repeating event... if ( $override ) { echo "\n"; echo "\n"; } // if assistant, need to remember boss = user if ( $is_assistant || $is_nonuser_admin ) echo "\n"; ?> 0 ) $extras = get_site_extra_fields ( $id ); for ( $i = 0; $i < count ( $site_extras ); $i++ ) { $extra_name = $site_extras[$i][0]; $extra_descr = $site_extras[$i][1]; $extra_type = $site_extras[$i][2]; $extra_arg1 = $site_extras[$i][3]; $extra_arg2 = $site_extras[$i][4]; //echo "\n"; if ( $extra_type == $EXTRA_MULTILINETEXT ) echo "\n"; } // end site-specific extra fields ?> 0 ) { if ( ! empty ( $participants[$l] ) ) $users .= " SELECTED"; } else { if ( ! empty ( $defusers ) ) { // default selection of participants was in the URL if ( ! empty ( $participants[$l] ) ) $users .= " SELECTED"; } else { if ( ( $l == $login && ! $is_assistant && ! $is_nonuser_admin ) || ( ! empty ( $user ) && $l == $user ) ) $users .= " SELECTED"; } } $users .= "> " . $userlist[$i]['cal_fullname']; } if ( $size > 50 ) $size = 15; else if ( $size > 5 ) $size = 5; print ""; print "\n"; // external users if ( ! empty ( $allow_external_users ) && $allow_external_users == "Y" ) { print ""; print "\n"; print "\n"; } } ?>
">:
">:
">:
">: " MAXLENGTH=2>:" MAXLENGTH=2> " . translate("am") . "\n"; echo "" . translate("pm") . "\n"; } ?>     
">: ">:"> ()
">:
">:
">:
Extra " . $extra_name . " - " . $site_extras[$i][2] . // " - " . $extras[$extra_name]['cal_name'] . // "arg1: $extra_arg1, arg2: $extra_arg2

"; else echo "
"; echo "" . translate ( $extra_descr ) . ":"; if ( $extra_type == $EXTRA_URL ) { echo ''; } else if ( $extra_type == $EXTRA_EMAIL ) { echo ''; } else if ( $extra_type == $EXTRA_DATE ) { if ( ! empty ( $extras[$extra_name]['cal_date'] ) ) print_date_selection ( $extra_name, $extras[$extra_name]['cal_date'] ); else print_date_selection ( $extra_name, $cal_date ); } else if ( $extra_type == $EXTRA_TEXT ) { $size = ( $extra_arg1 > 0 ? $extra_arg1 : 50 ); echo ''; } else if ( $extra_type == $EXTRA_MULTILINETEXT ) { $cols = ( $extra_arg1 > 0 ? $extra_arg1 : 50 ); $rows = ( $extra_arg2 > 0 ? $extra_arg2 : 5 ); echo ''; } else if ( $extra_type == $EXTRA_USER ) { // show list of calendar users... echo ""; } else if ( $extra_type == $EXTRA_REMINDER ) { $rem_status = 0; // don't send echo " 0 ) $rem_status = 1; } else { // editing event... check status if ( ! empty ( $extras[$extra_name]['cal_remind'] ) ) $rem_status = 1; } if ( $rem_status ) echo " CHECKED"; echo "> "; etranslate ( "Yes" ); echo "  "; etranslate ( "No" ); echo "  "; if ( ( $extra_arg2 & $EXTRA_REMINDER_WITH_DATE ) > 0 ) { if ( ! empty ( $extras[$extra_name]['cal_date'] ) && $extras[$extra_name]['cal_date'] > 0 ) print_date_selection ( $extra_name, $extras[$extra_name]['cal_date'] ); else print_date_selection ( $extra_name, $cal_date ); } else if ( ( $extra_arg2 & $EXTRA_REMINDER_WITH_OFFSET ) > 0 ) { if ( ! empty ( $extras[$extra_name]['cal_data'] ) ) $minutes = $extras[$extra_name]['cal_data']; else $minutes = $extra_arg1; // will be specified in total minutes $d = (int) ( $minutes / ( 24 * 60 ) ); $minutes -= ( $d * 24 * 60 ); $h = (int) ( $minutes / 60 ); $minutes -= ( $h * 60 ); echo " " . translate("days") . "  "; echo " " . translate("hours") . "  "; echo " " . translate("minutes") . "  "; etranslate("before event"); } } else if ( $extra_type == $EXTRA_SELECTLIST ) { // show custom select list. echo ""; } echo "
" . translate("Participants") . ":"; if ( $groups_enabled == "Y" ) { echo ""; } print "
" . translate("External Participants") . ":
">: " . translate("None"); echo " " . translate("Daily"); echo " " . translate("Weekly"); echo " " . translate("Monthly") . " (" . translate("by day") . ")"; echo " " . translate("Monthly") . " (" . translate("by day (from end)") . ")"; echo " " . translate("Monthly") . " (" . translate("by date") . ")"; echo " " . translate("Yearly"); ?>
">: >    
">: () " . translate("Sunday"); echo " " . translate("Monday"); echo " " . translate("Tuesday"); echo " " . translate("Wednesday"); echo " " . translate("Thursday"); echo " " . translate("Friday"); echo " " . translate("Saturday"); ?>
">:
0 && ( $login == $create_by || $single_user == "Y" || $is_admin ) ) { ?> ');">