Removeable attachments, Auto-default folder creation, bug fixes
1 files added
15 files modified
| | |
| | | CHANGELOG RoundCube Webmail |
| | | --------------------------- |
| | | |
| | | 2006/06/29 (richs) |
| | | ---------- |
| | | - Added ability to remove attachments (Feature #1436721) |
| | | - Default folders are now auto-created on first login (Feature #1471594) |
| | | - Fixed compatibility with folder apostrophes (e.g.: Joe's Folder) (Bug #1429458) |
| | | - Corrected Italian localizations |
| | | - Tweaked rename-folder form to clear after a rename |
| | | |
| | | |
| | | 2006/06/26 (richs) |
| | | ---------- |
| | | - Added button to immediately check for new messages |
| | |
| | | $rcmail_config['product_name'] = 'RoundCube Webmail'; |
| | | $rcmail_config['read_when_deleted'] = TRUE; |
| | | $rcmail_config['enable_spellcheck'] = TRUE; |
| | | $rcmail_config['protect_default_folders'] = TRUE; |
| | | - replace the following line from /config/main.inc.php |
| | | @include($_SERVER['HTTP_HOST'].'.inc.php'); |
| | | with |
| | |
| | | if ($_action=='upload') |
| | | include('program/steps/mail/upload.inc'); |
| | | |
| | | if ($_action=='compose') |
| | | if ($_action=='compose' || $_action=='remove-attachment') |
| | | include('program/steps/mail/compose.inc'); |
| | | |
| | | if ($_action=='addcontact') |
| | |
| | | if (!is_array($a_folders) || !sizeof($a_folders)) |
| | | $a_folders = array(); |
| | | |
| | | // create INBOX if it does not exist |
| | | if (!in_array_nocase('INBOX', $a_folders)) |
| | | // create Default folders if they do not exist |
| | | global $CONFIG; |
| | | foreach ($CONFIG['default_imap_folders'] as $folder) |
| | | { |
| | | $this->create_mailbox('INBOX', TRUE); |
| | | array_unshift($a_folders, 'INBOX'); |
| | | if (!in_array_nocase($folder, $a_folders)) |
| | | { |
| | | $this->create_mailbox($folder, TRUE); |
| | | $this->subscribe($folder); |
| | | } |
| | | } |
| | | |
| | | $a_folders = iil_C_ListSubscribed($this->conn, $this->_mod_mailbox($root), $filter); |
| | | $a_mailbox_cache = array(); |
| | | |
| | | // write mailboxlist to cache |
| | |
| | | // append a mail message (source) to a specific mailbox |
| | | function save_message($mbox_name, &$message) |
| | | { |
| | | $mbox_name = stripslashes($mbox_name); |
| | | $mailbox = $this->_mod_mailbox($mbox_name); |
| | | |
| | | // make sure mailbox exists |
| | |
| | | // move a message from one mailbox to another |
| | | function move_message($uids, $to_mbox, $from_mbox='') |
| | | { |
| | | $to_mbox = stripslashes($to_mbox); |
| | | $from_mbox = stripslashes($from_mbox); |
| | | $to_mbox = $this->_mod_mailbox($to_mbox); |
| | | $from_mbox = $from_mbox ? $this->_mod_mailbox($from_mbox) : $this->mailbox; |
| | | |
| | |
| | | // mark messages as deleted and expunge mailbox |
| | | function delete_message($uids, $mbox_name='') |
| | | { |
| | | $mbox_name = stripslashes($mbox_name); |
| | | $mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox; |
| | | |
| | | // convert the list of uids to array |
| | |
| | | // clear all messages in a specific mailbox |
| | | function clear_mailbox($mbox_name=NULL) |
| | | { |
| | | $mbox_name = stripslashes($mbox_name); |
| | | $mailbox = !empty($mbox_name) ? $this->_mod_mailbox($mbox_name) : $this->mailbox; |
| | | $msg_count = $this->_messagecount($mailbox, 'ALL'); |
| | | |
| | |
| | | // send IMAP expunge command and clear cache |
| | | function expunge($mbox_name='', $clear_cache=TRUE) |
| | | { |
| | | $mbox_name = stripslashes($mbox_name); |
| | | $mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox; |
| | | return $this->_expunge($mailbox, $clear_cache); |
| | | } |
| | |
| | | |
| | | if (this.env.action=='compose') |
| | | { |
| | | this.enable_command('add-attachment', 'send-attachment', 'send', true); |
| | | this.enable_command('add-attachment', 'send-attachment', 'remove-attachment', 'send', true); |
| | | if (this.env.spellcheck) |
| | | this.enable_command('spellcheck', true); |
| | | if (this.env.drafts_mailbox) |
| | |
| | | case 'send-attachment': |
| | | this.upload_file(props) |
| | | break; |
| | | |
| | | case 'remove-attachment': |
| | | this.remove_attachment(props); |
| | | break; |
| | | |
| | | case 'reply-all': |
| | | case 'reply': |
| | |
| | | { |
| | | if (this.env.mailbox==this.env.drafts_mailbox) |
| | | { |
| | | //alert(this.env.mailbox); |
| | | //this.disable_command('reply', 'reply-all', 'forward', 'print', 'moveto'); |
| | | this.enable_command('show', selected); |
| | | this.enable_command('delete', this.selection.length>0 ? true : false); |
| | | } |
| | |
| | | lock = true; |
| | | this.set_busy(true, 'movingmessage'); |
| | | } |
| | | |
| | | // send request to server |
| | | this.http_request('moveto', '_uid='+a_uids.join(',')+'&_mbox='+escape(this.env.mailbox)+'&_target_mbox='+escape(mbox)+'&_from='+(this.env.action ? this.env.action : ''), lock); |
| | | }; |
| | |
| | | |
| | | // add file name to attachment list |
| | | // called from upload page |
| | | this.add2attachment_list = function(name) |
| | | this.add2attachment_list = function(name,content) |
| | | { |
| | | if (!this.gui_objects.attachmentlist) |
| | | return false; |
| | | |
| | | var li = document.createElement('LI'); |
| | | li.innerHTML = name; |
| | | li.id = name; |
| | | li.innerHTML = content; |
| | | this.gui_objects.attachmentlist.appendChild(li); |
| | | return true; |
| | | }; |
| | | |
| | | this.remove_from_attachment_list = function(name) |
| | | { |
| | | if (!this.gui_objects.attachmentlist) |
| | | return false; |
| | | |
| | | var list = this.gui_objects.attachmentlist.getElementsByTagName("li"); |
| | | for (i=0;i<list.length;i++) |
| | | if (list[i].id == name) |
| | | this.gui_objects.attachmentlist.removeChild(list[i]); |
| | | } |
| | | |
| | | this.remove_attachment = function(name) |
| | | { |
| | | if (name) |
| | | this.http_request('remove-attachment', '_filename='+escape(name)); |
| | | |
| | | return true; |
| | | } |
| | | |
| | | // send remote request to add a new contact |
| | | this.add_contact = function(value) |
| | |
| | | |
| | | if (oldname && newname) |
| | | this.http_request('rename-folder', '_folder_oldname='+escape(oldname)+'&_folder_newname='+escape(newname)); |
| | | else if (form.elements['_folder_newname']) |
| | | form.elements['_folder_newname'].focus(); |
| | | |
| | | }; |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | form.elements['_folder_newname'].value=''; |
| | | }; |
| | | |
| | | |
| | |
| | | // add a new folder to the subscription list by cloning a folder row |
| | | this.add_folder_row = function(name) |
| | | { |
| | | name = name.replace('\\',""); |
| | | if (!this.gui_objects.subscriptionlist) |
| | | return false; |
| | | |
| | | var tbody = this.gui_objects.subscriptionlist.tBodies[0]; |
| | | var id = tbody.childNodes.length+1; |
| | | |
| | | // clone a table row |
| | | var row = this.clone_table_row(tbody.rows[0]); |
| | | row.id = 'rcmrow'+id; |
| | | tbody.appendChild(row); |
| | | |
| | | if (!tbody.rows[0]) |
| | | { |
| | | // Refresh to create the first table row |
| | | location.href = this.env.comm_path+'&_action=folders'; |
| | | } |
| | | else |
| | | { |
| | | // clone a table row if there are existing rows |
| | | var row = this.clone_table_row(tbody.rows[0]); |
| | | row.id = 'rcmrow'+id; |
| | | tbody.appendChild(row); |
| | | } |
| | | |
| | | // add to folder/row-ID map |
| | | this.env.subscriptionrows[row.id] = name; |
| | |
| | | row.cells[1].firstChild.checked = true; |
| | | } |
| | | if (row.cells[2].firstChild.tagName=='A') |
| | | row.cells[2].firstChild.onclick = new Function(this.ref+".command('delete-folder','"+name+"')"); |
| | | row.cells[2].firstChild.onclick = new Function(this.ref+".command('delete-folder','"+name.replace('\'','\\\'')+"')"); |
| | | |
| | | var form; |
| | | if ((form = this.gui_objects.editform) && form.elements['_folder_name']) |
| | | form.elements['_folder_name'].value = ''; |
| | | |
| | | // add new folder to rename-folder list |
| | | if (form.elements['_folder_oldname']) |
| | | form.elements['_folder_oldname'].options[form.elements['_folder_oldname'].options.length] = new Option(name,name); |
| | | form.elements['_folder_oldname'].options[form.elements['_folder_oldname'].options.length] = new Option(name,name); |
| | | |
| | | }; |
| | | |
| | |
| | | $labels['today'] = 'Oggi'; |
| | | |
| | | // toolbar buttons |
| | | $labels['checkmail'] = 'Controllando per vedere se c'è nuovi messaggi'; |
| | | $labels['checkmail'] = 'Controllo per vedere se ci sono nuovi messaggi'; |
| | | $labels['writenewmessage'] = 'Scrivi un nuovo messaggio'; |
| | | $labels['replytomessage'] = 'Rispondi al messaggio'; |
| | | $labels['replytoallmessage'] = 'Rispondi a tutti'; |
| | |
| | | $labels['sortdesc'] = 'Ordinamento discendente'; |
| | | |
| | | |
| | | ?> |
| | | ?> |
| | |
| | | |
| | | $messages['loadingdata'] = 'Caricamento dati...'; |
| | | |
| | | $messages['checkingmail'] = 'Controllando per vedere se c'è nuovi messaggi...'; |
| | | $messages['checkingmail'] = 'Controllo per vedere se ci sono nuovi messaggi...'; |
| | | |
| | | $messages['sendingmessage'] = 'Invio messaggio in corso...'; |
| | | |
| | |
| | | $messages['nosearchname'] = 'Per favore, immetti un nome o un indirizzo e-mail'; |
| | | |
| | | |
| | | ?> |
| | | ?> |
| | |
| | | if (!is_array($_SESSION['compose'])) |
| | | $_SESSION['compose'] = array('id' => uniqid(rand())); |
| | | |
| | | // remove an attachment |
| | | if ($_action=='remove-attachment' && !empty($_GET['_filename'])) |
| | | { |
| | | if (is_array($_SESSION['compose']['attachments'])) |
| | | foreach ($_SESSION['compose']['attachments'] as $i => $attachment) |
| | | if ($attachment['name'] == $_GET['_filename']) |
| | | { |
| | | @unlink($attachment['path']); |
| | | unset($_SESSION['compose']['attachments'][$i]); |
| | | $commands = sprintf("parent.%s.remove_from_attachment_list('%s');\n", $JS_OBJECT_NAME, $_GET['_filename']); |
| | | rcube_remote_response($commands); |
| | | exit; |
| | | } |
| | | } |
| | | |
| | | // add some labels to client |
| | | rcube_add_label('nosubject', 'norecipientwarning', 'nosubjectwarning', 'nobodywarning', 'notsentwarning', 'savingmessage', 'savingmessage', 'messagesaved'); |
| | |
| | | |
| | | if (is_array($_SESSION['compose']['attachments'])) |
| | | { |
| | | if ($attrib['deleteicon']) |
| | | $button = sprintf('<img src="%s%s" alt="%s" border="0" / style="padding-right:2px;vertical-align:middle">', $CONFIG['skin_path'], $attrib['deleteicon'], rcube_label('delete')); |
| | | else |
| | | $button = rcube_label('delete'); |
| | | |
| | | foreach ($_SESSION['compose']['attachments'] as $i => $a_prop) |
| | | $out .= sprintf("<li>%s</li>\n", $a_prop['name']); |
| | | $out .= sprintf('<li id="%s"><a href="#" onclick="%s.command(\'remove-attachment\',\'%s\')" title="%s">%s</a>%s</li>', $a_prop['name'], $JS_OBJECT_NAME, $a_prop['name'], rcube_label('deletefolder'), $button, $a_prop['name']); |
| | | } |
| | | |
| | | $OUTPUT->add_script(sprintf("%s.gui_object('attachmentlist', '%s');", $JS_OBJECT_NAME, $attrib['id'])); |
| | |
| | | $out = '<input type="file" name="_attachments[]"'. $attrib_str . " />"; |
| | | return $out; |
| | | } |
| | | |
| | | |
| | | function rcmail_priority_selector($attrib) |
| | | { |
| | |
| | | $class_name, |
| | | $zebra_class, |
| | | $unread_count ? ' unread' : '', |
| | | $folder['id']==$mbox_name ? ' selected' : '', |
| | | addslashes($folder['id'])==addslashes($mbox_name) ? ' selected' : '', |
| | | $COMM_PATH, |
| | | urlencode($folder['id']), |
| | | $JS_OBJECT_NAME, |
| | | $folder['id'], |
| | | addslashes($folder['id']), |
| | | $JS_OBJECT_NAME, |
| | | $folder['id'], |
| | | addslashes($folder['id']), |
| | | $title, |
| | | rep_specialchars_output($foldername, 'html', 'all')); |
| | | |
| | |
| | | { |
| | | foreach ($a_folders as $mbox_row) |
| | | { |
| | | $commands = sprintf("this.set_unread_count('%s', %d);\n", $mbox_row, $IMAP->messagecount($mbox_row, 'UNSEEN')); |
| | | $commands = sprintf("this.set_unread_count('%s', %d);\n", addslashes($mbox_row), $IMAP->messagecount($mbox_row, 'UNSEEN')); |
| | | rcube_remote_response($commands, TRUE); |
| | | } |
| | | } |
| | | |
| | | exit; |
| | | ?> |
| | | ?> |
| | |
| | | rcube_remote_response($commands); |
| | | |
| | | exit; |
| | | ?> |
| | | ?> |
| | |
| | | 'mimetype' => $_FILES['_attachments']['type'][$i], |
| | | 'path' => $tmpfname); |
| | | |
| | | $response .= sprintf("parent.%s.add2attachment_list('%s');\n", $JS_OBJECT_NAME, $_FILES['_attachments']['name'][$i]); |
| | | $button = sprintf('<img src="%s/images/icons/remove-attachment.png" alt="%s" border="0" style="padding-right:2px;vertical-align:middle">', $CONFIG['skin_path'], rcube_label('delete')); |
| | | $content = sprintf('<a href="#" onclick="%s.command(\\\'remove-attachment\\\',\\\'%s\\\')" title="%s">%s</a>%s',$JS_OBJECT_NAME, $_FILES['_attachments']['name'][$i], rcube_label('deletefolder'), $button, $_FILES['_attachments']['name'][$i]); |
| | | $response .= sprintf('parent.%s.add2attachment_list(\'%s\',\'%s\');',$JS_OBJECT_NAME, $_FILES['_attachments']['name'][$i], $content); |
| | | } |
| | | } |
| | | |
| | |
| | | EOF; |
| | | exit; |
| | | |
| | | ?> |
| | | ?> |
| | |
| | | |
| | | if ($rename && $REMOTE_REQUEST) |
| | | { |
| | | $commands = sprintf("this.add_folder_row('%s');", rep_specialchars_output($rename, 'js')); |
| | | $commands .= sprintf("this.remove_folder_row('%s')", rep_specialchars_output($_GET['_folder_oldname'], 'js')); |
| | | $commands = sprintf("this.add_folder_row('%s');\n", addslashes(rep_specialchars_output($rename, 'js'))); |
| | | $commands .= sprintf("this.remove_folder_row('%s');", rep_specialchars_output($_GET['_folder_oldname'], 'js')); |
| | | rcube_remote_response($commands); |
| | | } |
| | | else if (!$rename && $REMOTE_REQUEST) |
| | |
| | | #attachment-list |
| | | { |
| | | margin: 0px; |
| | | padding: 0px 0px 0px 68px; |
| | | padding: 0px 0px 0px 0px; |
| | | height: 18px; |
| | | list-style-image: none; |
| | | list-style-type: none; |
| | | background-color: #DFDFDF; |
| | | background: url(images/icons/attachment.png) no-repeat #DFDFDF; |
| | | background-position: 52px 1px; |
| | | border-bottom: 1px solid #FFFFFF; |
| | | } |
| | |
| | | { |
| | | height: 18px; |
| | | font-size: 11px; |
| | | padding-left: 26px; |
| | | padding-left: 2px; |
| | | padding-top: 2px; |
| | | padding-right: 4px; |
| | | background: url(images/icons/attachment.png) no-repeat; |
| | | background-position: 4px 1px; |
| | | border-bottom: 1px solid #EBEBEB; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | |
| | | |
| | | <div id="compose-attachments"> |
| | | <div><roundcube:label name="attachments" /></div> |
| | | <roundcube:object name="composeAttachmentList" /> |
| | | <roundcube:object name="composeAttachmentList" deleteIcon="/images/icons/remove-attachment.png"/ > |
| | | <p><roundcube:button command="add-attachment" imagePas="/images/buttons/add_pas.png" imageSel="/images/buttons/add_sel.png" imageAct="/images/buttons/add_act.png" width="23" height="18" title="addattachment" /> |
| | | </div> |
| | | |