*/ class ems_command_followup_processfollowup extends ems_command_base { /** * See class description for purpose * * @param ems_framework_registry $param The registry object. * @access protected * @return string The command's status. */ protected function doExecute(ems_framework_registry $param) { $followup = $param->data->get("followup"); $parent = $param->data->get("parentObject"); if ($followup && $parent) { $text = $param->input->get("followup_content_text"); $date = $param->input->get("followup_follow_up_date"); $isPublic = $param->input->get("followup_is_public"); $owner = $param->input->get("followup_owner_id"); $categoryID = $param->input->get("followup_category_id"); $whenCompleted = $param->input->get("followup_when_completed"); $followup->setTableDefID($parent->getTableDef()); $followup->setRefID($parent->getID()); if ($followup->getOriginalPosterID() === null) $followup->setOriginalPosterID($param->getUser()->getID()); if ($owner) { $followup->setOwnerID($owner); } else { $followup->setOwnerID($param->getUser()->getID()); } $followup->setContentText($text); $followup->setFollowupDate($date); $followup->setIsPublic($isPublic); if ($categoryID) $followup->setCategoryID($categoryID); if ($whenCompleted) $followup->setWhenCompleted($whenCompleted); if ($followup->save()) { $param->message->add($param->factory->system->createMessage("Follow-up saved successfully.","SUCCESS")); return self::statuses("CMD_OK"); } else { $param->message->add($param->factory->system->createMessage("An error occured while saving the follow-up data.","ERROR")); return self::statuses("CMD_ERROR"); } } // end if check for objects } } ?>