[ 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.boprojectelements.inc.php (sommaire)

(pas de description)

Poids: 621 lignes (22 kb)
Inclus ou requis: 2 fois
Référencé: 0 fois
Nécessite: 1 fichier
 projectmanager/inc/class.soprojectelements.inc.php

Définit 1 class

boprojectelements:: (14 méthodes):
  boprojectelements()
  notify()
  update()
  sync_all()
  check_acl()
  datasource()
  db2data()
  data2db()
  save()
  delete()
  read()
  titles()
  debug_message()
  copytree()


Classe: boprojectelements  - X-Ref

Elements business object of the projectmanager

boprojectelements($pm_id=null,$pe_id=null)   X-Ref
Constructor, class the constructor of the extended class

param: int $pm_id pm_id of the project to use, default null
param: int $pe_id pe_id of the project-element to load, default null

notify($data)   X-Ref
receives notifications from the link-class: new, deleted links to pm entries, or updated content of linked entries

We only process link- & update-notifications to parent-projects!
A project P is the parent of an other project C, if link_id1=P.pm_id and link_id2=C.pm_id !

param: array $data array with keys type, id, target_app, target_id, link_id, data

update($app,$id,$pe_id=0,$pm_id=null,$update_project=true)   X-Ref
Updates / creates a project-element with the data of it's datasource

Sets additionally $this->updated with the or'ed id's of the updated values

ToDo: if end-date changed, update elements which have "us" as start-constrain

param: string $app appname
param: string $id id of $app as used by the link-class and the datasource
param: int $pe_id=0 element- / link-id or 0 to only read and return the entry, but not save it!
param: int $pm_id=null project-id, default $this->pm_id
param: boolean $update_project=true update the data in the project if necessary
return: array/boolean the updated project-element or false on error (eg. no read access)

sync_all($pm_id=null)   X-Ref
sync all project-elements

The sync of the elements is done by calling the update-method for each (not ignored) element
in the order of their planned starts and after that calling the projects update methode only
once if necessary!

param: int $pm_id=null id of project to use, default null=use $this->pm_id
return: int number of updated elements

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

The rights on a project-element depend on the rigths on the parent-project:
- One can only read an element, if he can read the project (any rights, at least READ on the project)
- Adding, editing and deleting of elements require the ADD right of the project (deleting requires the element to exist pe_id!=0)
- reading or editing of budgets require the concerned rights of the project

param: int $required EGW_ACL_READ, EGW_ACL_WRITE, EGW_ACL_ADD, EGW_ACL_DELETE, EGW_ACL_BUDGET or EGW_ACL_EDIT_BUDGET
param: array/int $data=null project-element or pe_id to use, default the project-element in $this->data
return: boolean true if the rights are ok, false if not

datasource($app)   X-Ref
Get reference to instance of the datasource used for $app

The class has to be named datasource_$app and is search first in the App's inc-dir and then in the one of
ProjectManager. If it's not found PM's datasource baseclass is used.

param: string $app appname
return: object

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

save($keys=null,$touch_modified=true,$update_project=-1)   X-Ref
saves an project-element, reimplemented from SO, to save the remark in the link, if $keys['update_remark']

param: array $keys=null 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: int $update_project=-1 update the data in the project (or'ed PM_ id's), default -1=everything
return: int 0 on success and errno != 0 else

delete($keys=null)   X-Ref
deletes a project-element or all project-elements of a project, reimplemented to remove the link too

param: array/int $keys if given array with pm_id and/or pe_id or just an integer pe_id
return: int affected rows, should be 1 if ok, 0 if an error

read($keys,$extra_cols='',$join=true)   X-Ref
reads row matched by key and puts all cols in the data array, reimplemented to also read the constraints

param: array $keys array with keys in form internalName => value, may be a scalar value if only one key
param: string/array $extra_cols string or array of strings to be added to the SELECT, eg. "count(*) as num"
param: string $join='' sql to do a join, added as is after the table-name, eg. ", table2 WHERE x=y" or
return: array/boolean data if row could be retrived else False

titles($keys=array()   X-Ref
reads the titles of all project-elements specified by $keys

param: array $keys keys of elements to read, default empty = all of the project the class is instanciated for
return: array with pe_id => lang(pe_app): pe_title pairs

debug_message($msg)   X-Ref
echos a (preformatted / no-html) debug-message and evtl. log it to a file

It uses the debug_message method of boprojectmanager

param: string $msg

copytree($source)   X-Ref
Copies the elementtree from an other project

This is done by calling the copy method of the datasource (if existent) and then calling update with the (new) app_id

param: int $source
return: boolean true on success, false otherwise



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