[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/calendar/inc/ -> class.bocalupdate.inc.php (sommaire)

(pas de description)

Poids: 990 lignes (34 kb)
Inclus ou requis: 3 fois
Référencé: 0 fois
Nécessite: 1 fichier
 calendar/inc/class.bocal.inc.php

Définit 1 class

bocalupdate:: (15 méthodes):
  bocalupdate()
  update()
  check4update()
  update_requested()
  send_update()
  get_update_message()
  send_alarm()
  save()
  set_status()
  delete()
  _get_event_details()
  event2array()
  log2file()
  save_alarm()
  delete_alarm()


Classe: bocalupdate  - X-Ref

Class to access AND manipulate all calendar data (business object)

The new UI, BO and SO classes have a strikt definition, in which time-zone they operate:
UI only operates in user-time, so there have to be no conversation at all !!!
BO's functions take and return user-time only (!), they convert internaly everything to servertime, because
SO operates only on server-time

As this BO class deals with dates/times of several types and timezone, each variable should have a postfix
appended, telling with type it is: _s = seconds, _su = secs in user-time, _ss = secs in server-time, _h = hours

All new BO code (should be true for eGW in general) NEVER use any $_REQUEST ($_POST or $_GET) vars itself.
Nor does it store the state of any UI-elements (eg. cat-id selectbox). All this is the task of the UI class(es) !!!

All permanent debug messages of the calendar-code should done via the debug-message method of the bocal class !!!

bocalupdate()   X-Ref
Constructor


update(&$event,$ignore_conflicts=false,$touch_modified=true,$ignore_acl=false)   X-Ref
updates or creates an event, it (optionaly) checks for conflicts and sends the necessary notifications

param: array &$event event-array, on return some values might be changed due to set defaults
param: boolean $ignore_conflicts=false just ignore conflicts or do a conflict check and return the conflicting events
param: boolean $touch_modified=true touch modificatin time and set modifing user, default true=yes
param: boolean $ignore_acl=flase should we ignore the acl
return: mixed on success: int $cal_id > 0, on error false or array with conflicting events (only if $check_conflicts)

check4update($new_event,$old_event)   X-Ref
Check for added, modified or deleted participants

param: array $new_event the updated event
param: array $old_event the event before the update

update_requested($userid,$part_prefs,$msg_type,$old_event,$new_event)   X-Ref
checks if $userid has requested (in $part_prefs) updates for $msg_type

param: int $userid numerical user-id
param: array $part_prefs preferces of the user $userid
param: int $msg_type type of the notification: MSG_ADDED, MSG_MODIFIED, MSG_ACCEPTED, ...
param: array $old_event Event before the change
param: array $new_event Event after the change
return: boolean true = update requested, flase otherwise

send_update($msg_type,$to_notify,$old_event,$new_event=null,$user=0)   X-Ref
sends update-messages to certain participants of an event

param: int $msg_type type of the notification: MSG_ADDED, MSG_MODIFIED, MSG_ACCEPTED, ...
param: array $to_notify numerical user-ids as keys (!) (value is not used)
param: array $old_event Event before the change
param: array $new_event=null Event after the change
param: int $user=0 User who started the notify, default current user
return: mixed returncode from send-class or false on error

get_update_message($event,$added)   X-Ref
Pas de description

send_alarm($alarm)   X-Ref
Function called via async service, when an alarm is to be send

param: array $alarm array with keys owner, cal_id, all
return: boolean

save($event)   X-Ref
saves an event to the database, does NOT do any notifications, see bocalupdate::update for that

This methode converts from user to server time and handles the insertion of users and dates of repeating events

param: array $event
return: int/boolean $cal_id > 0 or false on error (eg. permission denied)

set_status($cal_id,$user_type,$user_id,$status,$recur_date=0)   X-Ref
set the status of one participant for a given recurrence or for all recurrences since now (includes recur_date=0)

param: int $cal_id
param: char $user_type 'u' regular user
param: int $user_id
param: int/char $status numeric status (defines) or 1-char code: 'R', 'U', 'T' or 'A'
param: int $recur_date=0 date to change, or 0 = all since now
return: int number of changed recurrences

delete($cal_id,$recur_date=0)   X-Ref
deletes an event

param: int $cal_id id of the event to delete
param: int $recur_date=0 if a single event from a series should be deleted, its date
return: boolean true on success, false on error (usually permission denied)

_get_event_details($event,$action,&$event_arr,$disinvited=array()   X-Ref
helper for send_update and get_update_message


event2array($event)   X-Ref
create array with name, translated name and readable content of each attributes of an event

old function, so far only used by send_update (therefor it's in bocalupdate and not bocal)

returns: array of attributes with fieldname as key and array with the 'field'=translated name 'data' = readable content (for participants this is an array !)
param: array $event event to use

log2file($event2save,$event_saved,$old_event=null,$type='update')   X-Ref
log all updates to a file

param: array $event2save event-data before calling save
param: array $event_saved event-data read back from the DB
param: array $old_event=null event-data in the DB before calling save
param: string $type='update'

save_alarm($cal_id,$alarm)   X-Ref
saves a new or updated alarm

param: int $cal_id Id of the calendar-entry
param: array $alarm array with fields: text, owner, enabled, ..
return: string id of the alarm, or false on error (eg. no perms)

delete_alarm($id)   X-Ref
delete one alarms identified by its id

param: string $id alarm-id is a string of 'cal:'.$cal_id.':'.$alarm_nr, it is used as the job-id too
return: int number of alarms deleted, false on error (eg. no perms)



Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7