From: Jan Schneider Date: Thu, 11 Nov 2010 22:17:58 +0000 (+0100) Subject: Nicer invitation mails. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4758a18d7642e495ec0540340634a8864e09511d;p=horde.git Nicer invitation mails. --- diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index ef1369af1..c9d9152bf 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -581,8 +581,8 @@ abstract class Kronolith_Event } // Tags - $tags = implode(', ', $this->tags); - if (!empty($tags)) { + if ($this->tags) { + $tags = implode(', ', $this->tags); $vEvent->setAttribute('CATEGORIES', $tags); } diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index bf9cf7263..cb17a5a4d 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -2254,10 +2254,20 @@ class Kronolith return; } + // Generate image mime part first and only once, because we + // need the Content-ID. + $background = new Horde_Themes_Image('big_invitation.png'); + $image = new Horde_Mime_Part(); + $image->setType('image/png'); + $image->setContents(file_get_contents($background->fs)); + $image->setContentId(); + $image->setDisposition('attachment'); + $share = $GLOBALS['kronolith_shares']->getShare($event->calendar); $view = new Horde_View(array('templatePath' => KRONOLITH_TEMPLATES . '/itip')); new Horde_View_Helper_Text($view); $view->event = $event; + $view->imageId = $image->getContentId(); foreach ($event->attendees as $email => $status) { /* Don't bother sending an invitation/update if the recipient does @@ -2346,12 +2356,19 @@ class Kronolith $bodyText->setType('text/plain'); $bodyText->setCharset('UTF-8'); $bodyText->setContents($view->render('notification.plain.php')); + $bodyText->setDisposition('inline'); $multipart->addPart($bodyText); $bodyHtml = new Horde_Mime_Part(); $bodyHtml->setType('text/html'); $bodyHtml->setCharset('UTF-8'); $bodyHtml->setContents($view->render('notification.html.php')); - $multipart->addPart($bodyHtml); + $bodyHtml->setDisposition('inline'); + $related = new Horde_Mime_Part(); + $related->setType('multipart/related'); + $related->setContentTypeParameter('start', $bodyHtml->setContentId()); + $related->addPart($bodyHtml); + $related->addPart($image); + $multipart->addPart($related); $multipart->addPart($ics); $recipient = empty($status['name']) ? $email : Horde_Mime_Address::trimAddress($status['name'] . ' <' . $email . '>'); $mail = new Horde_Mime_Mail(array('subject' => $view->subject, diff --git a/kronolith/templates/itip/notification.html.php b/kronolith/templates/itip/notification.html.php index b0119b13b..432dcc336 100644 --- a/kronolith/templates/itip/notification.html.php +++ b/kronolith/templates/itip/notification.html.php @@ -1,47 +1,76 @@ -

h($this->header) ?>

- - - - - - - - - - - - - - - event->location)): ?> - - - - - - event->description)): ?> - - - - - - attendees): ?> - - - - - - -
h($this->event->getTitle()) ?>
h($this->event->start->strftime('%x %X')) ?>
h($this->event->end->strftime('%x %X')) ?>
h($this->event->location) ?>
getInstance('Horde_Core_Factory_TextFilter')->filter($this->event->description, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'callback' => null)) ?>
- attendees as $attendee): ?> - -
- -
- - -
- -

- -

', '', '', '', '', '') ?>

+

h($this->header) ?>

+ + + +
+ + + + + + + + + + > + + + + + > + + + + + event->location)): ?> + + > + + + + + + attendees): ?> + + > + + + + + + + event->description)): ?> + + > + + + + + + + +
h($this->event->getTitle()) ?>
+ +  event->start->strftime('%x %X') ?>
+ +  event->end->strftime('%x %X') ?>
+ +  h($this->event->location) ?>
+ +   + attendees as $attendee): ?> + + h($attendee) ?>
+ + h($attendee) ?>
+ + + +
+ +  getInstance('Horde_Core_Factory_TextFilter')->filter($this->event->description, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'callback' => null)) ?>
+
+ +

+ +

', '', '', '', '', '') ?>

diff --git a/kronolith/templates/view/view.inc b/kronolith/templates/view/view.inc index 35a4cf644..4d948a384 100644 --- a/kronolith/templates/view/view.inc +++ b/kronolith/templates/view/view.inc @@ -172,7 +172,7 @@ if ($this->event->initialized && $this->event->alarm > 0): hasMethod('mail/compose'); foreach ($attendees as $email => $status): $full = empty($status['name']) ? $email : Horde_Mime_Address::trimAddress($status['name'] . (strpos($email, '@') === false ? '' : ' <' . $email . '>')) ?> - call('mail/compose', array(array('to' => $full))))->link(array('title' => sprintf(_("Send an email to %s"), empty($status['name']) ? $email : $status['name']))) . htmlspecialchars($full) . '') : htmlspecialchars($full) ?> + call('mail/compose', array(array('to' => $full)))->link(array('title' => sprintf(_("Send an email to %s"), empty($status['name']) ? $email : $status['name']))) . htmlspecialchars($full) . '') : htmlspecialchars($full) ?> diff --git a/kronolith/themes/graphics/big_invitation.png b/kronolith/themes/graphics/big_invitation.png new file mode 100644 index 000000000..c6d7606b4 Binary files /dev/null and b/kronolith/themes/graphics/big_invitation.png differ