thomascube
2008-03-21 17b5fb797f4bc142fee8cd72ade3890b4dfdbd82
program/steps/mail/compose.inc
@@ -90,7 +90,11 @@
  // similar as in program/steps/mail/show.inc
  $MESSAGE = array('UID' => $msg_uid);
  $MESSAGE['headers'] = &$IMAP->get_headers($msg_uid);
  $MESSAGE['structure'] = &$IMAP->get_structure($msg_uid);
  $MESSAGE['structure'] = &$IMAP->get_structure($msg_uid);
  if (!empty($MESSAGE['headers']->charset))
    $IMAP->set_charset($MESSAGE['headers']->charset);
  $MESSAGE['subject'] = $IMAP->decode_header($MESSAGE['headers']->subject);
  $MESSAGE['parts'] = $IMAP->get_mime_numbers($MESSAGE['structure']);
  
@@ -562,10 +566,14 @@
function rcmail_create_draft_body($body, $bodyIsHtml)
{
  global $IMAP, $MESSAGE;
  // add attachments
  if (!isset($_SESSION['compose']['forward_attachments']) &&
      is_array($MESSAGE['parts']) && sizeof($MESSAGE['parts'])>1)
  /**
   * add attachments
   * sizeof($MESSAGE['parts'] can be 1 - e.g. attachment, but no text!
   */
  if (!isset($_SESSION['compose']['forward_attachments'])
      && is_array($MESSAGE['parts'])
      && count($MESSAGE['parts']) > 0)
    rcmail_write_compose_attachments($MESSAGE);
  return $body;
@@ -583,7 +591,7 @@
  
  foreach ($message['parts'] as $pid => $part)
  {
    if ($part->ctype_primary != 'message' && $part->ctype_primary != 'text' &&
    if ($part->ctype_primary != 'message' &&
        ($part->disposition=='attachment' || $part->disposition=='inline' || $part->headers['content-id'] ||
         (empty($part->disposition) && $part->filename)))
    {
@@ -736,6 +744,8 @@
function rcmail_priority_selector($attrib)
{
  global $MESSAGE;
  list($form_start, $form_end) = get_form_tags($attrib);
  unset($attrib['form']);
  
@@ -749,7 +759,7 @@
                       rcube_label('highest')),
                 array(5, 4, 0, 2, 1));
                 
  $sel = isset($_POST['_priority']) ? $_POST['_priority'] : 0;
  $sel = isset($_POST['_priority']) ? $_POST['_priority'] : intval($MESSAGE['headers']->priority);
  $out = $form_start ? "$form_start\n" : '';
  $out .= $selector->show($sel);
@@ -761,6 +771,8 @@
function rcmail_receipt_checkbox($attrib)
{
  global $MESSAGE;
  list($form_start, $form_end) = get_form_tags($attrib);
  unset($attrib['form']);
  
@@ -772,7 +784,7 @@
  $checkbox = new checkbox($attrib);
  $out = $form_start ? "$form_start\n" : '';
  $out .= $checkbox->show(0);
  $out .= $checkbox->show($MESSAGE['headers']->mdn_to ? 1 : 0);
  $out .= $form_end ? "\n$form_end" : '';
  return $out;