+ function lookup($obj, $person, $evtype='')
+ {
+ $x = DB_DataObject::Factory($this->tableName());
+ $x->object($obj);
+ $x->person($person);
+ if (!empty($evtype)) {
+ $x->evtype = $evtype;
+ }
+ if ($x->count() != 1) {
+ return false;
+ }
+ $x->find(true);
+ return $x;
+
+ }
+
+
+ function beforeDelete($dependants_array, $roo) {
+ if ($this->delivered()) {
+ $roo->jerr("you can not delete a record of a successfull delivery");
+ }
+ }
+ function beforeInsert($request,$roo)
+ {
+ if (empty($request['act_when']) && !empty($request['act_start'])) {
+ $this->act_start($request['act_start']);
+ }
+
+ }
+ function beforeUpdate($old, $request,$roo)
+ {
+ if (empty($request['act_when']) && !empty($request['act_start'])) {
+ $this->act_start($request['act_start']);
+ }
+ }
+