[ Index ]
 

Code source de eGroupWare 1.2.106-2

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

title

Body

[fermer]

/infolog/inc/ -> class.soinfolog.inc.php (sommaire)

storage object / db-layer for InfoLog all values passed to this class are run either through intval or addslashes to prevent query-insertion and for pgSql 7.3 compatibility

Author: Ralf Becker <RalfBecker@outdoor-training.de>
Copyright: (c) by Ralf Becker <RalfBecker@outdoor-training.de>
License: http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
Poids: 617 lignes (22 kb)
Inclus ou requis: 1 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 13 fonctions

  soinfolog()
  check_access()
  aclFilter()
  statusFilter()
  dateFilter()
  init()
  read()
  get_status()
  delete()
  change_delete_owner()
  write()
  anzSubs()
  search()

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

soinfolog( $info_id = 0)   X-Ref
constructor


check_access( $info,$required_rights,$implicit_edit=false )   X-Ref
checks if user has the $required_rights to access $info_id (private access is handled too)

param: array/int $info data or info_id of InfoLog entry
param: int $required_rights EGW_ACL_xyz anded together
param: boolean $implicit_edit=false responsible has only implicit read and add rigths, unless this is set to true
return: boolean True if access is granted else False

aclFilter($filter = False)   X-Ref
generate sql to be AND'ed into a query to ensure ACL is respected (incl. _PRIVATE)

param: $filter: none|all - list all entrys user have rights to see<br>
return: string the necesary sql

statusFilter($filter = '')   X-Ref
generate sql to filter based on the status of the log-entry

param: $filter done = done or billed, open = not ()done or billed), offer = offer
return: string the necesary sql

dateFilter($filter = '')   X-Ref
generate sql to filter based on the start- and enddate of the log-entry

param: $filter upcoming = startdate is in the future<br>
return: string the necesary sql

init()   X-Ref
initialise the internal $this->data to be empty

only non-empty values got initialised

read($info_id)   X-Ref
read InfoLog entry $info_id

some cacheing is done to prevent multiple reads of the same entry

param: $info_id id of log-entry
return: array/boolean the entry as array or False on error (eg. entry not found)

get_status($ids)   X-Ref
Read the status of the given infolog-ids

param: array $ids array with id's
return: array with id => status pairs

delete($info_id,$delete_children=True,$new_parent=0)   X-Ref
delete InfoLog entry $info_id AND the links to it

param: int $info_id id of log-entry
param: bool $delete_children delete the children, if not set there parent-id to $new_parent
param: int $new_parent new parent-id to set for subs

change_delete_owner($owner,$new_owner=0)   X-Ref
changes or deletes entries with a spezified owner (for hook_delete_account)

param: $owner old owner
param: $new_owner new owner or 0 if entries should be deleted

write($values,$check_modified=0)   X-Ref
writes the given $values to InfoLog, a new entry gets created if info_id is not set or 0

param: array $values with the data of the log-entry
param: int $check_modified=0 old modification date to check before update (include in WHERE)
return: int/boolean info_id, false on error or 0 if the entry has been updated in the meantime

anzSubs( $info_id )   X-Ref
count the sub-entries of $info_id

This is done now be search too (in key info_anz_subs), if DB can use sub-queries

param: $info_id id of log-entry
return: int the number of sub-entries

search(&$query)   X-Ref
searches InfoLog for a certain pattern in $query

If DB can use sub-queries, the number of subs are under the key info_anz_subs.

param: $query[order] column-name to sort after
param: $query[sort] sort-order DESC or ASC
param: $query[filter] string with combination of acl-, date- and status-filters, eg. 'own-open-today' or ''
param: $query[cat_id] category to use or 0 or unset
param: $query[search] pattern to search, search is done in info_from, info_subject and info_des
param: $query[action] / $query[action_id] if only entries linked to a specified app/entry show be used
param: &$query[start], &$query[total] nextmatch-parameters will be used and set if query returns less entries
param: $query[col_filter] array with column-name - data pairs, data == '' means no filter (!)
param: $query[subs] boolean return subs or not, if unset the user preference is used
param: $query[num_rows] number of rows to return if $query[start] is set, default is to use the value from the general prefs
return: array with id's as key of the matching log-entries



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