[ Index ]
 

Code source de WebCalendar 1.0.5

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables | Statistiques

title

Body

[fermer]

/includes/ -> functions.php (sommaire)

All of WebCalendar's functions

Author: Craig Knudsen <cknudsen@cknudsen.com>
Copyright: Craig Knudsen, <cknudsen@cknudsen.com>, http://www.k5n.us/cknudsen
License: http://www.gnu.org/licenses/gpl.html GNU GPL
Poids: 4856 lignes (167 kb)
Inclus ou requis: 5 fois
Référencé: 0 fois
Nécessite: 1 fichier
 includes/site_extras.php

Définit 91 fonctions

  getPostValue()
  getGetValue()
  getValue()
  getIntValue()
  load_global_settings()
  get_plugin_list()
  get_user_plugin_list()
  get_web_browser()
  do_debug()
  get_preferred_view()
  send_to_preferred_view()
  do_redirect()
  send_http_login()
  remember_this_view()
  get_last_view()
  send_no_cache_header()
  load_user_preferences()
  event_get_external_users()
  activity_log()
  get_my_users()
  get_pref_setting()
  get_browser_language()
  load_user_layers()
  site_extras_for_popup()
  build_event_popup()
  print_date_selection()
  date_selection_html()
  display_small_month()
  print_entry()
  get_site_extra_fields()
  read_events()
  get_entries()
  query_events()
  read_repeated_events()
  get_all_dates()
  get_repeating_entries()
  repeated_event_matches_date()
  date_to_epoch()
  is_exception()
  get_sunday_before()
  get_monday_before()
  week_number()
  icon_text()
  print_date_entries()
  times_overlap()
  check_for_conflicts()
  time_to_minutes()
  calc_time_slot()
  html_for_add_icon()
  html_for_event_week_at_a_glance()
  html_for_event_day_at_a_glance()
  print_day_at_a_glance()
  display_unapproved_events()
  activate_urls()
  display_time()
  month_name()
  month_short_name()
  weekday_name()
  weekday_short_name()
  date_to_str()
  hextoint()
  decode_string()
  encode_string()
  my_array_splice()
  load_user_categories()
  print_category_menu()
  html_to_8bits()
  user_get_boss_list()
  user_is_assistant()
  user_has_boss()
  boss_must_be_notified()
  boss_must_approve_event()
  fake_mail()
  print_date_entries_timebar()
  print_entry_timebar()
  print_header_timebar()
  get_nonuser_cals()
  nonuser_load_variables()
  user_is_nonuser_admin()
  load_nonuser_preferences()
  set_today()
  gregorianToISO()
  isLeapYear()
  clean_html()
  clean_word()
  clean_int()
  clean_whitespace()
  languageToAbbrev()
  background_css()
  daily_matrix()
  add_duration()

Fonctions
Fonctions qui ne font pas partie d'une Classe:

getPostValue( $name )   X-Ref
Gets the value resulting from an HTTP POST method.

<b>Note:</b> The return value will be affected by the value of
<var>magic_quotes_gpc</var> in the php.ini file.

param: string $name Name used in the HTML form
return: string The value used in the HTML form

getGetValue( $name )   X-Ref
Gets the value resulting from an HTTP GET method.

<b>Note:</b> The return value will be affected by the value of
<var>magic_quotes_gpc</var> in the php.ini file.

If you need to enforce a specific input format (such as numeric input), then
use the {@link getValue()} function.

param: string $name Name used in the HTML form or found in the URL
return: string The value used in the HTML form (or URL)

getValue( $name, $format="", $fatal=false )   X-Ref
Gets the value resulting from either HTTP GET method or HTTP POST method.

<b>Note:</b> The return value will be affected by the value of
<var>magic_quotes_gpc</var> in the php.ini file.

<b>Note:</b> If you need to get an integer value, yuou can use the
getIntValue function.

param: string $name   Name used in the HTML form or found in the URL
param: string $format A regular expression format that the input must match.
param: bool   $fatal  Is it considered a fatal error requiring execution to
return: string The value used in the HTML form (or URL)

getIntValue( $name, $fatal=false )   X-Ref
Gets an integer value resulting from an HTTP GET or HTTP POST method.

<b>Note:</b> The return value will be affected by the value of
<var>magic_quotes_gpc</var> in the php.ini file.

param: string $name  Name used in the HTML form or found in the URL
param: bool   $fatal Is it considered a fatal error requiring execution to
return: string The value used in the HTML form (or URL)

load_global_settings()   X-Ref
Loads default system settings (which can be updated via admin.php).

System settings are stored in the webcal_config table.

<b>Note:</b> If the setting for <var>server_url</var> is not set, the value
will be calculated and stored in the database.


get_plugin_list( $include_disabled=false )   X-Ref
Gets the list of active plugins.

Should be called after {@link load_global_settings()} and {@link load_user_preferences()}.

return: array Active plugins

get_user_plugin_list()   X-Ref
Get plugins available to the current user.

Do this by getting a list of all plugins that are not disabled by the
administrator and make sure this user has not disabled any of them.

It's done this was so that when an admin adds a new plugin, it shows up on
each users system automatically (until they disable it).

return: array Plugins available to current user

get_web_browser()   X-Ref
Identify user's browser.

Returned value will be one of:
- "Mozilla/5" = Mozilla (open source Mozilla 5.0)
- "Mozilla/[3,4]" = Netscape (3.X, 4.X)
- "MSIE 4" = MSIE (4.X)

return: string String identifying browser

do_debug( $msg )   X-Ref
Logs a debug message.

Generally, we do not leave calls to this function in the code.  It is used
for debugging only.

param: string $msg Text to be logged

get_preferred_view( $indate="", $args="" )   X-Ref
Gets user's preferred view.

The user's preferred view is stored in the $STARTVIEW global variable.  This
is loaded from the user preferences (or system settings if there are no user
prefererences.)

param: string $indate Date to pass to preferred view in YYYYMMDD format
param: string $args   Arguments to include in the URL (such as "user=joe")
return: string URL of the user's preferred view

send_to_preferred_view( $indate="", $args="" )   X-Ref
Sends a redirect to the user's preferred view.

The user's preferred view is stored in the $STARTVIEW global variable.  This
is loaded from the user preferences (or system settings if there are no user
prefererences.)

param: string $indate Date to pass to preferred view in YYYYMMDD format
param: string $args   Arguments to include in the URL (such as "user=joe")

do_redirect( $url )   X-Ref
Pas de description

send_http_login()   X-Ref
Sends an HTTP login request to the browser and stops execution.


remember_this_view()   X-Ref
Generates a cookie that saves the last calendar view.

Cookie is based on the current <var>$REQUEST_URI</var>.

We save this cookie so we can return to this same page after a user
edits/deletes/etc an event.


get_last_view()   X-Ref
Gets the last page stored using {@link remember_this_view()}.

return: string The URL of the last view or an empty string if it cannot be

send_no_cache_header()   X-Ref
Sends HTTP headers that tell the browser not to cache this page.

Different browser use different mechanisms for this, so a series of HTTP
header directives are sent.

<b>Note:</b> This function needs to be called before any HTML output is sent
to the browser.

load_user_preferences()   X-Ref
Loads the current user's preferences as global variables from the webcal_user_pref table.

Also loads the list of views for this user (not really a preference, but
this is a convenient place to put this...)

<b>Notes:</b>
- If <var>$allow_color_customization</var> is set to 'N', then we ignore any
color preferences.
- Other default values will also be set if the user has not saved a
preference and no global value has been set by the administrator in the
system settings.

event_get_external_users( $event_id, $use_mailto=0 )   X-Ref
Gets the list of external users for an event from the webcal_entry_ext_user table in an HTML format.

param: int $event_id   Event ID
param: int $use_mailto When set to 1, email address will contain an href
return: string The list of external users for an event formatte in HTML.

activity_log( $event_id, $user, $user_cal, $type, $text )   X-Ref
Adds something to the activity log for an event.

The information will be saved to the webcal_entry_log table.

param: int    $event_id Event ID
param: string $user     Username of user doing this
param: string $user_cal Username of user whose calendar is affected
param: string $type     Type of activity we are logging:
param: string $text     Text comment to add with activity log entry

get_my_users()   X-Ref
Gets a list of users.

If groups are enabled, this will restrict the list of users to only those
users who are in the same group(s) as the user (unless the user is an admin
user).  We allow admin users to see all users because they can also edit
someone else's events (so they may need access to users who are not in the
same groups that they are in).

return: array Array of users, where each element in the array is an array

get_pref_setting( $user, $setting )   X-Ref
Gets a preference setting for the specified user.

If no value is found in the database, then the system default setting will
be returned.

param: string $user    User login we are getting preference for
param: string $setting Name of the setting
return: string The value found in the webcal_user_pref table for the

get_browser_language()   X-Ref
Gets browser-specified language preference.

return: string Preferred language

load_user_layers($user="",$force=0)   X-Ref
Loads current user's layer info into layer global variable.

If the system setting <var>$allow_view_other</var> is not set to 'Y', then
we ignore all layer functionality.  If <var>$force</var> is 0, we only load
layers if the current user preferences have layers turned on.

param: string $user  Username of user to load layers for
param: int    $force If set to 1, then load layers for this user even if

site_extras_for_popup( $id )   X-Ref
Generates the HTML used in an event popup for the site_extras fields of an event.

param: int $id Event ID
return: string The HTML to be used within the event popup for any site_extra

build_event_popup( $popupid, $user, $description, $time, $site_extras='' )   X-Ref
Builds the HTML for the event popup.

param: string $popupid     CSS id to use for event popup
param: string $user        Username of user the event pertains to
param: string $description Event description
param: string $time        Time of the event (already formatted in a display format)
param: string $site_extras HTML for any site_extras for this event
return: string The HTML for the event popup

print_date_selection( $prefix, $date )   X-Ref
Prints out a date selection box for use in a form.

param: string $prefix Prefix to use in front of form element names
param: int    $date   Currently selected date (in YYYYMMDD format)

date_selection_html( $prefix, $date )   X-Ref
Generate HTML for a date selection for use in a form.

param: string $prefix Prefix to use in front of form element names
param: int    $date   Currently selected date (in YYYYMMDD format)
return: string HTML for the selection box

display_small_month( $thismonth, $thisyear, $showyear,$show_weeknums=false, $minical_id='', $month_link='month.php?' )   X-Ref
Prints out a minicalendar for a month.

param: int    $thismonth     Number of the month to print
param: int    $thisyear      Number of the year
param: bool   $showyear      Show the year in the calendar's title?
param: bool   $show_weeknums Show week numbers to the left of each row?
param: string $minical_id    id attribute for the minical table
param: string $month_link    URL and query string for month link that should

print_entry( $id, $date, $time, $duration,$name, $description, $status,$pri, $access, $event_owner, $event_cat=-1 )   X-Ref
Prints the HTML for one day's events in the month view.

param: int    $id          Event ID
param: int    $date        Date of event (relevant in repeating events) in
param: int    $time        Time (in HHMMSS format)
param: int    $duration    Event duration in minutes
param: string $name        Event name
param: string $description Long description of event
param: string $status      Event status
param: int    $pri         Event priority
param: string $access      Event access
param: string $event_owner Username of user associated with this event
param: int    $event_cat   Category of event for <var>$event_owner</var>

get_site_extra_fields( $eventid )   X-Ref
Gets any site-specific fields for an entry that are stored in the database in the webcal_site_extras table.

param: int $eventid Event ID
return: array Array with the keys as follows:

read_events( $user, $startdate, $enddate, $cat_id = '' )   X-Ref
Reads all the events for a user for the specified range of dates.

This is only called once per page request to improve performance.  All the
events get loaded into the array <var>$events</var> sorted by time of day
(not date).

param: string $user      Username
param: string $startdate Start date range, inclusive (in YYYYMMDD format)
param: string $enddate   End date range, inclusive (in YYYYMMDD format)
param: int    $cat_id    Category ID to filter on
return: array Array of events

get_entries( $user, $date, $get_unapproved=true )   X-Ref
Gets all the events for a specific date.

Events are retreived from the array of pre-loaded events (which was loaded
all at once to improve performance).

The returned events will be sorted by time of day.

param: string $user           Username
param: string $date           Date to get events for in YYYYMMDD format
param: bool   $get_unapproved Load unapproved events?
return: array Array of events

query_events( $user, $want_repeated, $date_filter, $cat_id = '' )   X-Ref
Reads events visible to a user.

Includes layers and possibly public access if enabled

param: string $user          Username
param: bool   $want_repeated Get repeating events?
param: string $date_filter   SQL phrase starting with AND, to be appended to
param: int    $cat_id        Category ID to filter on.  May be empty.
return: array Array of events sorted by time of day

read_repeated_events( $user, $cat_id = '', $date = '' )   X-Ref
Reads all the repeated events for a user.

This is only called once per page request to improve performance. All the
events get loaded into the array <var>$repeated_events</var> sorted by time of day (not
date).

This will load all the repeated events into memory.

<b>Notes:</b>
- To get which events repeat on a specific date, use
{@link get_repeating_entries()}.
- To get all the dates that one specific event repeats on, call
{@link get_all_dates()}.

param: string $user   Username
param: int    $cat_id Category ID to filter on  (May be empty)
param: string $date   Cutoff date for repeating event endtimes in YYYYMMDD
return: Array of repeating events sorted by time of day

get_all_dates( $date, $rpt_type, $end, $days, $ex_days, $freq=1 )   X-Ref
Returns all the dates a specific event will fall on accounting for the repeating.

Any event with no end will be assigned one.

param: string $date     Initial date in raw format
param: string $rpt_type Repeating type as stored in the database
param: string $end      End date
param: string $days     Days events occurs on (for weekly)
param: array  $ex_dates Array of exception dates for this event in YYYYMMDD format
param: int    $freq     Frequency of repetition
return: array Array of dates (in UNIX time format)

get_repeating_entries( $user, $dateYmd, $get_unapproved=true )   X-Ref
Gets all the repeating events for the specified date.

<b>Note:</b>
The global variable <var>$repeated_events</var> needs to be
set by calling {@link read_repeated_events()} first.

param: string $user           Username
param: string $date           Date to get events for in YYYYMMDD format
param: bool   $get_unapproved Include unapproved events in results?
return: mixed The query result resource on queries (which can then be

repeated_event_matches_date($event,$dateYmd)   X-Ref
Determines whether the event passed in will fall on the date passed.

param: array  $event   The event as an array
param: string $dateYmd Date to check in YYYYMMDD format
return: bool Does <var>$event</var> occur on <var>$dateYmd</var>?

date_to_epoch( $d )   X-Ref
Converts a date to a timestamp.

param: string $d Date in YYYYMMDD format
return: int Timestamp representing 3:00 (or 4:00 if during Daylight Saving

is_exception( $date, $ex_days )   X-Ref
Checks if a date is an exception for an event.

param: string $date   Date in YYYYMMDD format
param: array  $exdays Array of dates in YYYYMMDD format

get_sunday_before( $year, $month, $day )   X-Ref
Gets the Sunday of the week that the specified date is in.

If the date specified is a Sunday, then that date is returned.

param: int $year  Year
param: int $month Month (1-12)
param: int $day   Day of the month
return: int The date (in UNIX timestamp format)

get_monday_before( $year, $month, $day )   X-Ref
Gets the Monday of the week that the specified date is in.

If the date specified is a Monday, then that date is returned.

param: int $year  Year
param: int $month Month (1-12)
param: int $day   Day of the month
return: int The date (in UNIX timestamp format)

week_number( $date )   X-Ref
Returns the week number for specified date.

Depends on week numbering settings.

param: int $date Date in UNIX timestamp format
return: string The week number of the specified date

icon_text( $id, $can_edit, $can_delete )   X-Ref
Generates the HTML for an add/edit/delete icon.

This function is not yet used.  Some of the places that will call it have to
be updated to also get the event owner so we know if the current user has
access to edit and delete.

param: int  $id         Event ID
param: bool $can_edit   Can this user edit this event?
param: bool $can_delete Can this user delete this event?
return: HTML for add/edit/delete icon.

print_date_entries( $date, $user, $ssi )   X-Ref
Prints all the calendar entries for the specified user for the specified date.

If we are displaying data from someone other than
the logged in user, then check the access permission of the entry.

param: string $date Date in YYYYMMDD format
param: string $user Username
param: bool   $ssi  Is this being called from week_ssi.php?

times_overlap( $time1, $duration1, $time2, $duration2 )   X-Ref
Checks to see if two events overlap.

param: string $time1 Time 1 in HHMMSS format
param: int    $duration1 Duration 1 in minutes
param: string $time2 Time 2 in HHMMSS format
param: int    $duration2 Duration 2 in minutes
return: bool True if the two times overlap, false if they do not

check_for_conflicts( $dates, $duration, $hour, $minute,$participants, $login, $id )   X-Ref
Checks for conflicts.

Find overlaps between an array of dates and the other dates in the database.

Limits on number of appointments: if enabled in System Settings
(<var>$limit_appts</var> global variable), too many appointments can also
generate a scheduling conflict.

param: array  $dates        Array of dates in YYYYMMDD format that is
param: int    $duration     Event duration in minutes
param: int    $hour         Hour of event (0-23)
param: int    $minute       Minute of the event (0-59)
param: array  $participants Array of users whose calendars are to be checked
param: string $login        The current user name
param: int    $id           Current event id (this keeps overlaps from
return: Empty string for no conflicts or return the HTML of the

time_to_minutes( $time )   X-Ref
Converts a time format HHMMSS (like 130000 for 1PM) into number of minutes past midnight.

param: string $time Input time in HHMMSS format
return: int The number of minutes since midnight

calc_time_slot( $time, $round_down = false )   X-Ref
Calculates which row/slot this time represents.

This is used in day and week views where hours of the time are separeted
into different cells in a table.

<b>Note:</b> the global variable <var>$TIME_SLOTS</var> is used to determine
how many time slots there are and how many minutes each is.  This variable
is defined user preferences (or defaulted to admin system settings).

param: string $time       Input time in HHMMSS format
param: bool   $round_down Should we change 1100 to 1059?
return: int The time slot index

html_for_add_icon( $date=0,$hour="", $minute="", $user="" )   X-Ref
Generates the HTML for an icon to add a new event.

param: string $date   Date for new event in YYYYMMDD format
param: int    $hour   Hour of day (0-23)
param: int    $minute Minute of the hour (0-59)
param: string $user   Participant to initially select for new event
return: string The HTML for the add event icon

html_for_event_week_at_a_glance( $id, $date, $time,$name, $description, $status, $pri, $access, $duration, $event_owner,$event_category=-1 )   X-Ref
Generates the HTML for an event to be viewed in the week-at-glance (week.php).

The HTML will be stored in an array (global variable $hour_arr)
indexed on the event's starting hour.

param: int    $id             Event id
param: string $date           Date of event in YYYYMMDD format
param: string $time           Time of event in HHMM format
param: string $name           Brief description of event
param: string $description    Full description of event
param: string $status         Status of event ('A', 'W')
param: int    $pri            Priority of event
param: string $access         Access to event by others ('P', 'R')
param: int    $duration       Duration of event in minutes
param: string $event_owner    User who created event
param: int    $event_category Category id for event

html_for_event_day_at_a_glance( $id, $date, $time,$name, $description, $status, $pri, $access, $duration, $event_owner,$event_category=-1 )   X-Ref
Generates the HTML for an event to be viewed in the day-at-glance (day.php).

The HTML will be stored in an array (global variable $hour_arr)
indexed on the event's starting hour.

param: int    $id             Event id
param: string $date           Date of event in YYYYMMDD format
param: string $time           Time of event in HHMM format
param: string $name           Brief description of event
param: string $description    Full description of event
param: string $status         Status of event ('A', 'W')
param: int    $pri            Priority of event
param: string $access         Access to event by others ('P', 'R')
param: int    $duration       Duration of event in minutes
param: string $event_owner    User who created event
param: int    $event_category Category id for event

print_day_at_a_glance( $date, $user, $can_add=0 )   X-Ref
Prints all the calendar entries for the specified user for the specified date in day-at-a-glance format.

If we are displaying data from someone other than
the logged in user, then check the access permission of the entry.

param: string $date Date in YYYYMMDD format
param: string $user Username of calendar

display_unapproved_events( $user )   X-Ref
Checks for any unnaproved events.

If any are found, display a link to the unapproved events (where they can be
approved).

If the user is an admin user, also count up any public events.
If the user is a nonuser admin, count up events on the nonuser calendar.

param: string $user Current user login

activate_urls( $text )   X-Ref
Looks for URLs in the given text, and makes them into links.

param: string $text Input text
return: string The text altered to have HTML links for any web links

display_time( $time, $ignore_offset=0 )   X-Ref
Displays a time in either 12 or 24 hour format.

The global variable $TZ_OFFSET is used to adjust the time.  Note that this
is somewhat of a kludge for timezone support.  If an event is set for 11PM
server time and the user is 2 hours ahead, it will show up as 1AM, but the
date will not be adjusted to the next day.

param: string $time          Input time in HHMMSS format
param: bool   $ignore_offset If true, then do not use the timezone offset
return: string The time in the user's timezone and preferred format

month_name( $m )   X-Ref
Returns the full name of the specified month.

Use {@link month_short_name()} to get the abbreviated name of the month.

param: int $m Number of the month (0-11)
return: string The full name of the specified month

month_short_name( $m )   X-Ref
Returns the abbreviated name of the specified month (such as "Jan").

Use {@link month_name()} to get the full name of the month.

param: int $m Number of the month (0-11)
return: string The abbreviated name of the specified month (example: "Jan")

weekday_name( $w )   X-Ref
Returns the full weekday name.

Use {@link weekday_short_name()} to get the abbreviated weekday name.

param: int $w Number of the day in the week (0=Sunday,...,6=Saturday)
return: string The full weekday name ("Sunday")

weekday_short_name( $w )   X-Ref
Returns the abbreviated weekday name.

Use {@link weekday_name()} to get the full weekday name.

param: int $w Number of the day in the week (0=Sunday,...,6=Saturday)
return: string The abbreviated weekday name ("Sun")

date_to_str( $indate, $format="", $show_weekday=true, $short_months=false, $server_time="" )   X-Ref
Converts a date in YYYYMMDD format into "Friday, December 31, 1999",
"Friday, 12-31-1999" or whatever format the user prefers.

param: string $indate       Date in YYYYMMDD format
param: string $format       Format to use for date (default is "__month__
param: bool   $show_weekday Should the day of week also be included?
param: bool   $short_months Should the abbreviated month names be used
param: int    $server_time ???
return: string Date in the specified format

hextoint( $val )   X-Ref
Converts a hexadecimal digit to an integer.

param: string $val Hexadecimal digit
return: int Equivalent integer in base-10

decode_string( $instr )   X-Ref
Extracts a user's name from a session id.

This prevents users from begin able to edit their cookies.txt file and set
the username in plain text.

param: string $instr A hex-encoded string. "Hello" would be "678ea786a5".
return: string The decoded string

encode_string( $instr )   X-Ref
Takes an input string and encode it into a slightly encoded hexval that we
can use as a session cookie.

param: string $instr Text to encode
return: string The encoded text

my_array_splice(&$input,$offset,$length,$replacement)   X-Ref
An implementatin of array_splice() for PHP3.

param: array $input       Array to be spliced into
param: int   $offset      Where to begin the splice
param: int   $length      How long the splice should be
param: array $replacement What to splice in

load_user_categories($ex_global = '')   X-Ref
Loads current user's category info and stuff it into category global
variable.

param: string $ex_global Don't include global categories ('' or '1')

print_category_menu( $form, $date = '', $cat_id = '' )   X-Ref
Prints dropdown HTML for categories.

param: string $form   The page to submit data to (without .php)
param: string $date   Date in YYYYMMDD format
param: int    $cat_id Category id that should be pre-selected

html_to_8bits( $html )   X-Ref
Converts HTML entities in 8bit.

<b>Note:</b> Only supported for PHP4 (not PHP3).

param: string $html HTML text
return: string The converted text

user_get_boss_list( $assistant )   X-Ref
Gets a list of an assistant's boss from the webcal_asst table.

param: string $assistant Login of assistant
return: array Array of bosses, where each boss is an array with the following

user_is_assistant( $assistant, $boss )   X-Ref
Is this user an assistant of this boss?

param: string $assistant Login of potential assistant
param: string $boss      Login of potential boss
return: bool True or false

user_has_boss( $assistant )   X-Ref
Is this user an assistant?

param: string $assistant Login for user
return: bool true if the user is an assistant to one or more bosses

boss_must_be_notified( $assistant, $boss )   X-Ref
Checks the boss user preferences to see if the boss wants to be notified via
email on changes to their calendar.

param: string $assistant Assistant login
param: string $boss      Boss login
return: bool True if the boss wants email notifications

boss_must_approve_event( $assistant, $boss )   X-Ref
Checks the boss user preferences to see if the boss must approve events
added to their calendar.

param: string $assistant Assistant login
param: string $boss      Boss login
return: bool True if the boss must approve new events

fake_mail( $mailto, $subj, $text, $hdrs )   X-Ref
Fakes an email for testing purposes.

param: string $mailto Email address to send mail to
param: string $subj   Subject of email
param: string $text   Email body
param: string $hdrs   Other email headers

print_date_entries_timebar( $date, $user, $ssi )   X-Ref
Prints all the entries in a time bar format for the specified user for the
specified date.

If we are displaying data from someone other than the logged in user, then
check the access permission of the entry.

param: string $date Date in YYYYMMDD format
param: string $user Username
param: bool   $ssi  Should we not include links to add new events?

print_entry_timebar( $id, $date, $time, $duration,$name, $description, $status,$pri, $access, $event_owner, $event_category=-1 )   X-Ref
Prints the HTML for an events with a timebar.

param: int    $id             Event id
param: string $date           Date of event in YYYYMMDD format
param: string $time           Time of event in HHMM format
param: int    $duration       Duration of event in minutes
param: string $name           Brief description of event
param: string $description    Full description of event
param: string $status         Status of event ('A', 'W')
param: int    $pri            Priority of event
param: string $access         Access to event by others ('P', 'R')
param: string $event_owner    User who created event
param: int    $event_category Category id for event

print_header_timebar($start_hour, $end_hour)   X-Ref
Prints the header for the timebar.

param: int $start_hour Start hour
param: int $end_hour   End hour

get_nonuser_cals($user = '')   X-Ref
Gets a list of nonuser calendars and return info in an array.

param: string $user Login of admin of the nonuser calendars
return: array Array of nonuser cals, where each is an array with the

nonuser_load_variables( $login, $prefix )   X-Ref
Loads nonuser variables (login, firstname, etc.).

The following variables will be set:
- <var>login</var>
- <var>firstname</var>
- <var>lastname</var>
- <var>fullname</var>
- <var>admin</var>
- <var>email</var>

param: string $login  Login name of nonuser calendar
param: string $prefix Prefix to use for variables that will be set.

user_is_nonuser_admin( $login, $nonuser )   X-Ref
Checks the webcal_nonuser_cals table to determine if the user is the
administrator for the nonuser calendar.

param: string $login   Login of user that is the potential administrator
param: string $nonuser Login name for nonuser calendar
return: bool True if the user is the administrator for the nonuser calendar

load_nonuser_preferences($nonuser)   X-Ref
Loads nonuser preferences from the webcal_user_pref table if on a nonuser
admin page.

param: string $nonuser Login name for nonuser calendar

set_today($date)   X-Ref
Determines what the day is after the <var>$TZ_OFFSET</var> and sets it globally.

The following global variables will be set:
- <var>$thisyear</var>
- <var>$thismonth</var>
- <var>$thisday</var>
- <var>$thisdate</var>
- <var>$today</var>

param: string $date The date in YYYYMMDD format

gregorianToISO($day,$month,$year)   X-Ref
Converts from Gregorian Year-Month-Day to ISO YearNumber-WeekNumber-WeekDay.

param: int $day   Day of month
param: int $month Number of month
param: int $year  Year
return: string Date in ISO YearNumber-WeekNumber-WeekDay format

isLeapYear($year='')   X-Ref
Is this a leap year?

param: int $year Year
return: bool True for a leap year, else false

clean_html($value)   X-Ref
Replaces unsafe characters with HTML encoded equivalents.

param: string $value Input text
return: string The cleaned text

clean_word($data)   X-Ref
Removes non-word characters from the specified text.

param: string $data Input text
return: string The converted text

clean_int($data)   X-Ref
Removes non-digits from the specified text.

param: string $data Input text
return: string The converted text

clean_whitespace($data)   X-Ref
Removes whitespace from the specified text.

param: string $data Input text
return: string The converted text

languageToAbbrev( $name )   X-Ref
Converts language names to their abbreviation.

param: string $name Name of the language (such as "French")
return: string The abbreviation ("fr" for "French")

background_css( $color, $height = '', $percent = '' )   X-Ref
Creates the CSS for using gradient.php, if the appropriate GD functions are
available.

A one-pixel wide image will be used for the background image.

<b>Note:</b> The gd library module needs to be available to use gradient
images.  If it is not available, a single background color will be used
instead.

param: string $color   Base color
param: int    $height  Height of gradient image
param: int    $percent How many percent lighter the top color should be
return: string The style sheet text to use

daily_matrix( $date, $participants, $popup = '' )   X-Ref
Draws a daily outlook style availability grid showing events that are
approved and awaiting approval.

param: string $date         Date to show the grid for
param: array  $participants Which users should be included in the grid
param: string $popup        Not used

add_duration( $time, $duration )   X-Ref
Return the time in HHMMSS format of input time + duration

<b>Note:</b> The gd library module needs to be available to use gradient
images.  If it is not available, a single background color will be used
instead.

param: string $time   format "235900"
param: int $duration  number of minutes
return: string The time in HHMMSS format



Généré le : Fri Nov 30 19:09:19 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics