/** * Return an additional message for the response. * * @param boolean $is_update Indicates if the request was an update. * * @return string The message. */ public function getMessage($is_update = false) { if ($this->_comment === null) { return sprintf("%s %s:\n\n%s", $this->_resource->getCommonName(), $this->getShortMessage($is_update), $this->getRequest()->getSummary()); } else { return sprintf("%s %s:\n\n%s\n\n%s", $this->_resource->getCommonName(), $this->getShortMessage($is_update), $this->getRequest()->getSummary(), $this->_comment); } }
/** * Return the response as a MIME message. * * @param Horde_Itip_Response_Type $type The response type. * @param Horde_Itip_Response_Options $options The options for the response. * * @return array A list of two object: The mime headers and the mime * message. */ public function getMessage(Horde_Itip_Response_Type $type, Horde_Itip_Response_Options $options) { $message = new Horde_Mime_Part(); $message->setType('text/calendar'); $options->prepareIcsMimePart($message); $message->setContents($this->getIcalendar($type, $options)->exportvCalendar()); $message->setEOL("\r\n"); $this->_setIcsFilename($message); $message->setContentTypeParameter('METHOD', 'REPLY'); // Build the reply headers. $from = $this->_resource->getFrom(); $reply_to = $this->_resource->getReplyTo(); $headers = new Horde_Mime_Headers(); $headers->addHeaderOb(Horde_Mime_Headers_Date::create()); $headers->addHeader('From', $from); $headers->addHeader('To', $this->_request->getOrganizer()); if (!empty($reply_to) && $reply_to != $from) { $headers->addHeader('Reply-to', $reply_to); } $headers->addHeader('Subject', $type->getSubject()); $options->prepareResponseMimeHeaders($headers); return array($headers, $message); }