$view->user = $identity->getName();
$view->calendar = $share->get('name');
$view->imageId = $image->getContentId();
- if ($GLOBALS['conf']['share']['hidden']) {
- $view->subscribe = Horde::url('calendars/subscribe.php', true)->add('calendar', $share->getName());
- }
- $multipart = Kronolith::buildMimeMessage($view, 'notification', $image);
}
// Process owner and owner permissions.
$share->set('owner', $new_owner);
$share->save();
if ($GLOBALS['conf']['share']['notify']) {
+ $view->ownerChange = true;
+ $multipart = Kronolith::buildMimeMessage($view, 'notification', $image);
$to = $GLOBALS['injector']
->getInstance('Horde_Core_Factory_Identity')
->create($new_owner)
->getDefaultFromAddress(true);
- try {
- $message = Horde::callHook('shareOwnerNotification', array($new_owner, $share));
- } catch (Horde_Exception_HookNotSet $e) {
- $message = sprintf(_("%s has assigned the ownership of \"%s\" to you"),
- $view->user,
- $share->get('name'));
- }
- $mail->addHeader('Subject', _("Ownership assignment"));
- $mail->addHeader('To', $to, 'UTF-8', false);
- $mail->setBody($message, 'UTF-8');
+ $mail->addHeader('Subject', _("Ownership assignment"), 'UTF-8');
+ $mail->addHeader('To', $to, 'UTF-8');
+ $mail->setBasePart($multipart);
$mail->send($GLOBALS['injector']->getInstance('Horde_Mail'));
+ $view->ownerChange = false;
}
}
}
+ if ($GLOBALS['conf']['share']['notify']) {
+ if ($GLOBALS['conf']['share']['hidden']) {
+ $view->subscribe = Horde::url('calendars/subscribe.php', true)->add('calendar', $share->getName());
+ }
+ $multipart = Kronolith::buildMimeMessage($view, 'notification', $image);
+ }
+
if ($GLOBALS['registry']->isAdmin() ||
!empty($GLOBALS['conf']['share']['world'])) {
// Process default permissions.
<tr>
<td>
<font size="2">
+ <?php if ($this->ownerChange): ?>
+ <?php printf(_("%s has assigned the ownership of the calendar %s to you."), '<strong>' . $this->h($this->user) . '</strong>', '<strong>' . $this->h($this->calendar) . '</strong>') ?>
+ <?php else: ?>
<?php printf(_("%s wants to share the calendar %s with you to grant you access to all events in this calendar."), '<strong>' . $this->h($this->user) . '</strong>', '<strong>' . $this->h($this->calendar) . '</strong>') ?>
<?php if ($this->subscribe): ?>
<?php echo _("To subscribe to this calendar, you need to click the following link:") ?>
<br><br>
<strong><a href="<?php echo $this->h($this->subscribe) ?>"><?php echo $this->h($this->subscribe) ?></a></strong>
<?php endif ?>
+ <?php endif ?>
</font>
</td>
</tr>
<?php printf(_("Invitation from %s to the calendar \"%s\""), $this->user, $this->calendar) ?>
+<?php if ($this->ownerChange): ?>
+<?php printf(_("%s has assigned the ownership of the calendar \"%s\" to you."), $this->user, $this->calendar) ?>
+<?php else: ?>
<?php printf(_("%s wants to share the calendar \"%s\" with you to grant you access to all events in this calendar."), $this->user, $this->calendar) ?>
<?php if ($this->subscribe): ?>
<?php echo _("To subscribe to this calendar, you need to click the following link:") ?>
<?php echo $this->subscribe ?>
<?php endif ?>
+<?php endif ?>