[ Index ]
 

Code source de eGroupWare 1.2.106-2

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

title

Body

[fermer]

/projectmanager/inc/ -> class.boprojectmanager.inc.php (sommaire)

(pas de description)

Poids: 788 lignes (26 kb)
Inclus ou requis: 5 fois
Référencé: 0 fois
Nécessite: 2 fichiers
 projectmanager/inc/class.datasource.inc.php
 projectmanager/inc/class.soprojectmanager.inc.php

Définit 1 class

boprojectmanager:: (19 méthodes):
  boprojectmanager()
  instanciate()
  pe_summary()
  update()
  save()
  delete()
  db2data()
  data2db()
  generate_pm_number()
  check_acl()
  link_title()
  link_query()
  search_link()
  ancestors()
  get_project_tree()
  log2file()
  debug_message()
  date_add()
  copy()


Classe: boprojectmanager  - X-Ref

General business object of the projectmanager

This class does all the timezone-conversation: All function expect user-time and convert them to server-time
before calling the storage object.

boprojectmanager($pm_id=null,$instanciate='')   X-Ref
Constructor, calls the constructor of the extended class

param: int $pm_id id of the project to load, default null
param: string $instanciate='' comma-separated: constraints,milestones,roles

instanciate($instanciate,$pre='so')   X-Ref
Instanciates some classes which dont get instanciated by default

param: string $instanciate comma-separated: constraints,milestones,roles
param: string $pre='so' class prefix to use, default so

pe_summary($pm_id=null)   X-Ref
Summarize the information of all elements of a project: min(start-time), sum(time), avg(completion), ...

This is implemented in the projectelements class, we call it via ExecMethod

param: int/array $pm_id=null int project-id, array of project-id's or null to use $this->pm_id
return: array/boolean with summary information (keys as for a single project-element), false on error

update($pm_id=null,$update_necessary=-1,$data=null)   X-Ref
update a project after a change in one of it's project-elements

If the data and the exact changes gets supplied (see params),
an whole update or even the update itself might be avoided.
Not used at the moment!

param: int $pm_id=null project-id or null to use $this->data['pm_id']
param: int $update_necessary=-1 which fields need updating, or'ed PM_ constants from the datasource class
param: array $data=null data of the project-element if availible

save($keys=null,$touch_modified=true,$do_notify=true)   X-Ref
saves a project

reimplemented to automatic create a project-ID / pm_number, if empty

param: array $keys if given $keys are copied to data before saveing => allows a save as
param: boolean $touch_modified=true should modification date+user be set, default yes
param: boolean $do_notify=true should link::notify be called, default yes
return: int 0 on success and errno != 0 else

delete($keys=null)   X-Ref
deletes a project identified by $keys or the loaded one, reimplemented to remove the project-elements too

param: array $keys if given array with col => value pairs to characterise the rows to delete
return: int affected rows, should be 1 if ok, 0 if an error

db2data($data=null)   X-Ref
changes the data from the db-format to your work-format

reimplemented to adjust the timezone of the timestamps (adding $this->tz_offset_s to get user-time)
Please note, we do NOT call the method of the parent or so_sql !!!

param: array $data if given works on that array and returns result, else works on internal data-array
return: array with changed data

data2db($data=null)   X-Ref
changes the data from your work-format to the db-format

reimplemented to adjust the timezone of the timestamps (subtraction $this->tz_offset_s to get server-time)
Please note, we do NOT call the method of the parent or so_sql !!!

param: array $data if given works on that array and returns result, else works on internal data-array
return: array with changed data

generate_pm_number($set_data=true,$parent='')   X-Ref
generate a project-ID / pm_number in the form P-YYYY-nnnn (YYYY=year, nnnn=incrementing number)

param: boolean $set_data=true set generated number in $this->data, default true
param: string $parent='' pm_number of parent, if given a /nnnn is added
return: string the new pm_number

check_acl($required,$data=0,$no_cache=false)   X-Ref
checks if the user has enough rights for a certain operation

Rights are given via owner grants or role based acl

param: int $required EGW_ACL_READ, EGW_ACL_WRITE, EGW_ACL_ADD, EGW_ACL_DELETE, EGW_ACL_BUDGET, EGW_ACL_EDIT_BUDGET
param: array/int $data=null project or project-id to use, default the project in $this->data
param: boolean $no_cache=false should a cached value be used, if availible, or not
return: boolean true if the rights are ok, false if not

link_title( $entry )   X-Ref
get title for an project identified by $entry

Is called as hook to participate in the linking

param: int/array $entry int pm_id or array with project entry
param: string the title

link_query( $pattern )   X-Ref
query projectmanager for entries matching $pattern

Is called as hook to participate in the linking

param: string $pattern pattern to search
return: array with pm_id - title pairs of the matching entries

search_link($location)   X-Ref
Hook called by link-class to include projectmanager in the appregistry of the linkage

param: array/string $location location and other parameters (not used)
return: array with method-names

ancestors($pm_id=0,$ancestors=array()   X-Ref
gets all ancestors of a given project (calls itself recursivly)

A project P is the parent of an other project C, if link_id1=P.pm_id and link_id2=C.pm_id !
To get all parents of a project C, we use all links to the project, which link_id2=C.pm_id.

param: int $pm_id=0 id or 0 to use $this->pm_id
param: array $ancestors=array() already identified ancestors, default none
return: array with ancestors

get_project_tree($filter = array('pm_status' => 'active')   X-Ref
Query the project-tree from the DB, project tree is indexed by a path consisting of pm_id's delimited by slashes (/)

param: array $filter=array('pm_status' => 'active') filter for the search, default active projects
param: string $filter_op='AND' AND or OR filters together, default AND
return: array with path => array(pm_id,pm_number,pm_title,pm_parent) pairs

log2file($msg)   X-Ref
write a debug-message to the log-file $this->logfile (if set)

param: string $msg

debug_message($msg)   X-Ref
EITHER echos a (preformatted / no-html) debug-message OR logs it to a file

param: string $msg

date_add($start,$time,$uid)   X-Ref
Add a timespan to a given datetime, taking into account the availibility and worktimes of the user

ToDo: take exclusivly blocked times (calendar) into account

param: int $start start timestamp (usertime)
param: int $time working time in minutes to add, 0 advances to the next working time
param: int $uid user-id
return: int/boolean end-time or false if it cant be calculated because user has no availibility or worktime

copy($source,$only_stage=0,$parent_number='')   X-Ref
Copies a project

param: int $source id of project to copy
param: int $only_stage=0 0=both stages plus saving the project, 1=copy of the project, 2=copying the element tree
param: string $parent_number='' number of the parent project, to create a sub-project-number
return: boolean true on successful copy, false otherwise (eg. permission denied)



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