public static function ContactContract(C3op_Projects_Action $action, C3op_Projects_HumanResource $humanResource, C3op_Projects_HumanResourceMapper $humanResourceMapper) { if ($humanResource->GetContact() > 0 && $humanResource->GetStatus() == C3op_Projects_HumanResourceStatusConstants::STATUS_FORESEEN) { $humanResource->SetStatus(C3op_Projects_HumanResourceStatusConstants::STATUS_CONTRACTED); $humanResourceMapper->update($humanResource); self::LogContracting($action); } }
public function ContactDismiss(C3op_Projects_Action $action, C3op_Projects_HumanResource $humanResource, C3op_Projects_HumanResourceMapper $humanResourceMapper) { if ($humanResource->GetContact() > 0) { $humanResource->SetContact(0); $humanResourceMapper->update($humanResource); $this->LogDismiss($action); } }
public function process($data) { $db = Zend_Registry::get('db'); $humanResourceMapper = new C3op_Projects_HumanResourceMapper($db); if ($this->isValid($data) !== true) { throw new C3op_Form_InstitutionEditException('Invalid data!'); } else { $id = $data['id']; $humanResource = $humanResourceMapper->findById($id); $humanResource->SetDescription($this->description->GetValue()); $humanResource->SetContact($this->contact->GetValue()); $humanResource->SetValue($this->value->GetValue()); $humanResource->SetAction($this->action->GetValue()); $humanResourceMapper->update($humanResource); return $humanResource->GetId(); } }