| | |
| | | // 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']); |
| | | |
| | |
| | | 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; |
| | |
| | | |
| | | 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))) |
| | | { |
| | |
| | | |
| | | function rcmail_priority_selector($attrib) |
| | | { |
| | | global $MESSAGE; |
| | | |
| | | list($form_start, $form_end) = get_form_tags($attrib); |
| | | unset($attrib['form']); |
| | | |
| | |
| | | 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); |
| | |
| | | |
| | | function rcmail_receipt_checkbox($attrib) |
| | | { |
| | | global $MESSAGE; |
| | | |
| | | list($form_start, $form_end) = get_form_tags($attrib); |
| | | unset($attrib['form']); |
| | | |
| | |
| | | $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; |
| | |
| | | $a_contacts = array(); |
| | | |
| | | if ($result = $CONTACTS->list_records()) |
| | | { |
| | | { |
| | | while ($sql_arr = $result->iterate()) |
| | | if ($sql_arr['email']) |
| | | $a_contacts[] = format_email_recipient($sql_arr['email'], JQ($sql_arr['name'])); |
| | | } |
| | | |
| | | /* LDAP autocompletion */ |
| | | foreach ($CONFIG['ldap_public'] as $ldapserv_config) |
| | | { |
| | | if ($ldapserv_config['fuzzy_search'] != 1) |
| | | $a_contacts[] = format_email_recipient($sql_arr['email'], $sql_arr['name']); |
| | | } |
| | | if (isset($CONFIG['ldap_public'])) |
| | | { |
| | | /* LDAP autocompletion */ |
| | | foreach ($CONFIG['ldap_public'] as $ldapserv_config) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | $LDAP = new rcube_ldap($ldapserv_config); |
| | | $LDAP->connect(); |
| | | $LDAP->set_pagesize(1000); |
| | | |
| | | $results = $LDAP->search($ldapserv_config['mail_field'], ""); |
| | | |
| | | for ($i = 0; $i < $results->count; $i++) |
| | | { |
| | | if ($results->records[$i]['email'] != '') |
| | | { |
| | | $email = $results->records[$i]['email']; |
| | | $name = $results->records[$i]['name']; |
| | | |
| | | $a_contacts[] = format_email_recipient($email, JQ($name)); |
| | | if ($ldapserv_config['fuzzy_search'] != 1) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | $LDAP = new rcube_ldap($ldapserv_config); |
| | | $LDAP->connect(); |
| | | $LDAP->set_pagesize(1000); |
| | | |
| | | $results = $LDAP->search($ldapserv_config['mail_field'], ""); |
| | | |
| | | for ($i = 0; $i < $results->count; $i++) |
| | | { |
| | | if ($results->records[$i]['email'] != '') |
| | | { |
| | | $email = $results->records[$i]['email']; |
| | | $name = $results->records[$i]['name']; |
| | | |
| | | $LDAP->close(); |
| | | } |
| | | |
| | | if ($a_contacts) |
| | | { |
| | | $a_contacts[] = format_email_recipient($email, $name); |
| | | } |
| | | } |
| | | $LDAP->close(); |
| | | } |
| | | } |
| | | if ($a_contacts) |
| | | { |
| | | $OUTPUT->set_env('contacts', $a_contacts); |
| | | } |
| | | |
| | | } |
| | | parse_template('compose'); |
| | | ?> |