DataObjects/Person.php
authorEdward <edward@roojs.com>
Wed, 22 May 2013 11:29:12 +0000 (19:29 +0800)
committerEdward <edward@roojs.com>
Wed, 22 May 2013 11:29:12 +0000 (19:29 +0800)
DataObjects/Person.php

index 3b0c082..19a4df6 100644 (file)
@@ -891,6 +891,11 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
             }
             $p->setFrom($person);
             
+            $companies = DB_DataObject::facotry('companies');
+            if(!$companies->get('comptype', 'OWNER')){
+                $roo->jerr("Missing OWNER companies!");
+            }
+            $p->company_id = $companies->pid();
             // strip the 'spaces etc.. make lowercase..
             $name = strtolower(str_replace(' ', '', $person['name']));
             $p->setPassword("$prefix$name");