Permalink
Browse files

- New Folder Manager UI

- Fix invalid Request when creating a folder (#1487443)
- Add folder size and quota indicator in folder manager (#1485780)
- Add possibility to move a subfolder into root folder (#1486791)
  • Loading branch information...
1 parent a5ee723 commit af3c045ecf4865361981f4c9aa392dfe1f93ac90 @alecpl alecpl committed Dec 3, 2010
Showing with 1,222 additions and 1,322 deletions.
  1. +4 −0 CHANGELOG
  2. +8 −9 index.php
  3. +66 −2 program/include/main.inc
  4. +37 −20 program/include/rcube_imap.php
  5. +100 −199 program/js/app.js
  6. +0 −4 program/localization/ar_SA/labels.inc
  7. +0 −3 program/localization/ar_SA/messages.inc
  8. +0 −4 program/localization/ast/labels.inc
  9. +0 −3 program/localization/ast/messages.inc
  10. +0 −4 program/localization/az_AZ/labels.inc
  11. +0 −3 program/localization/az_AZ/messages.inc
  12. +0 −4 program/localization/bg_BG/labels.inc
  13. +0 −3 program/localization/bg_BG/messages.inc
  14. +0 −4 program/localization/bn_BD/labels.inc
  15. +0 −3 program/localization/bn_BD/messages.inc
  16. +0 −4 program/localization/br/labels.inc
  17. +0 −4 program/localization/bs_BA/labels.inc
  18. +0 −4 program/localization/ca_ES/labels.inc
  19. +0 −3 program/localization/ca_ES/messages.inc
  20. +0 −4 program/localization/cs_CZ/labels.inc
  21. +0 −3 program/localization/cs_CZ/messages.inc
  22. +0 −4 program/localization/cy_GB/labels.inc
  23. +0 −3 program/localization/cy_GB/messages.inc
  24. +0 −4 program/localization/da_DK/labels.inc
  25. +0 −3 program/localization/da_DK/messages.inc
  26. +0 −4 program/localization/de_CH/labels.inc
  27. +0 −3 program/localization/de_CH/messages.inc
  28. +0 −4 program/localization/de_DE/labels.inc
  29. +0 −3 program/localization/de_DE/messages.inc
  30. +0 −4 program/localization/el_GR/labels.inc
  31. +0 −3 program/localization/el_GR/messages.inc
  32. +0 −4 program/localization/en_GB/labels.inc
  33. +0 −3 program/localization/en_GB/messages.inc
  34. +7 −4 program/localization/en_US/labels.inc
  35. +9 −3 program/localization/en_US/messages.inc
  36. +0 −4 program/localization/eo/labels.inc
  37. +0 −1 program/localization/eo/messages.inc
  38. +0 −4 program/localization/es_AR/labels.inc
  39. +0 −3 program/localization/es_AR/messages.inc
  40. +0 −4 program/localization/es_ES/labels.inc
  41. +0 −3 program/localization/es_ES/messages.inc
  42. +0 −4 program/localization/et_EE/labels.inc
  43. +0 −3 program/localization/et_EE/messages.inc
  44. +0 −4 program/localization/eu_ES/labels.inc
  45. +0 −1 program/localization/eu_ES/messages.inc
  46. +0 −4 program/localization/fa/labels.inc
  47. +0 −3 program/localization/fa/messages.inc
  48. +0 −4 program/localization/fa_AF/labels.inc
  49. +0 −3 program/localization/fa_AF/messages.inc
  50. +0 −4 program/localization/fi_FI/labels.inc
  51. +0 −3 program/localization/fi_FI/messages.inc
  52. +0 −4 program/localization/fr_FR/labels.inc
  53. +0 −3 program/localization/fr_FR/messages.inc
  54. +0 −4 program/localization/ga_IE/labels.inc
  55. +0 −4 program/localization/gl_ES/labels.inc
  56. +0 −3 program/localization/gl_ES/messages.inc
  57. +0 −4 program/localization/he_IL/labels.inc
  58. +0 −3 program/localization/he_IL/messages.inc
  59. +0 −4 program/localization/hi_IN/labels.inc
  60. +0 −4 program/localization/hr_HR/labels.inc
  61. +0 −3 program/localization/hr_HR/messages.inc
  62. +0 −4 program/localization/hu_HU/labels.inc
  63. +0 −3 program/localization/hu_HU/messages.inc
  64. +0 −4 program/localization/hy_AM/labels.inc
  65. +0 −3 program/localization/hy_AM/messages.inc
  66. +0 −4 program/localization/id_ID/labels.inc
  67. +0 −3 program/localization/id_ID/messages.inc
  68. +0 −4 program/localization/is_IS/labels.inc
  69. +0 −4 program/localization/it_IT/labels.inc
  70. +0 −3 program/localization/it_IT/messages.inc
  71. +0 −4 program/localization/ja_JP/labels.inc
  72. +0 −3 program/localization/ja_JP/messages.inc
  73. +0 −4 program/localization/ka_GE/labels.inc
  74. +0 −3 program/localization/ka_GE/messages.inc
  75. +0 −4 program/localization/kh_KH/labels.inc
  76. +0 −3 program/localization/kh_KH/messages.inc
  77. +0 −4 program/localization/ko_KR/labels.inc
  78. +0 −3 program/localization/ko_KR/messages.inc
  79. +0 −4 program/localization/ku/labels.inc
  80. +0 −1 program/localization/ku/messages.inc
  81. +0 −4 program/localization/lt_LT/labels.inc
  82. +0 −3 program/localization/lt_LT/messages.inc
  83. +0 −4 program/localization/lv_LV/labels.inc
  84. +0 −3 program/localization/lv_LV/messages.inc
  85. +0 −4 program/localization/mk_MK/labels.inc
  86. +0 −3 program/localization/mk_MK/messages.inc
  87. +0 −4 program/localization/mr_IN/labels.inc
  88. +0 −3 program/localization/mr_IN/messages.inc
  89. +0 −4 program/localization/ms_MY/labels.inc
  90. +0 −1 program/localization/ms_MY/messages.inc
  91. +0 −4 program/localization/nb_NO/labels.inc
  92. +0 −3 program/localization/nb_NO/messages.inc
  93. +0 −4 program/localization/ne_NP/labels.inc
  94. +0 −4 program/localization/nl_BE/labels.inc
  95. +0 −3 program/localization/nl_BE/messages.inc
  96. +0 −4 program/localization/nl_NL/labels.inc
  97. +0 −3 program/localization/nl_NL/messages.inc
  98. +0 −4 program/localization/nn_NO/labels.inc
  99. +0 −3 program/localization/nn_NO/messages.inc
  100. +7 −4 program/localization/pl_PL/labels.inc
  101. +9 −3 program/localization/pl_PL/messages.inc
  102. +0 −4 program/localization/ps/labels.inc
  103. +0 −3 program/localization/ps/messages.inc
  104. +0 −4 program/localization/pt_BR/labels.inc
  105. +0 −3 program/localization/pt_BR/messages.inc
  106. +0 −4 program/localization/pt_PT/labels.inc
  107. +0 −3 program/localization/pt_PT/messages.inc
  108. +0 −4 program/localization/ro_RO/labels.inc
  109. +0 −3 program/localization/ro_RO/messages.inc
  110. +0 −4 program/localization/ru_RU/labels.inc
  111. +0 −3 program/localization/ru_RU/messages.inc
  112. +0 −4 program/localization/si_LK/labels.inc
  113. +0 −1 program/localization/si_LK/messages.inc
  114. +0 −4 program/localization/sk_SK/labels.inc
  115. +0 −3 program/localization/sk_SK/messages.inc
  116. +0 −4 program/localization/sl_SI/labels.inc
  117. +0 −3 program/localization/sl_SI/messages.inc
  118. +0 −4 program/localization/sq_AL/labels.inc
  119. +0 −1 program/localization/sq_AL/messages.inc
  120. +0 −4 program/localization/sr_CS/labels.inc
  121. +0 −1 program/localization/sr_CS/messages.inc
  122. +0 −4 program/localization/sv_SE/labels.inc
  123. +0 −3 program/localization/sv_SE/messages.inc
  124. +0 −4 program/localization/ta_IN/labels.inc
  125. +0 −3 program/localization/ta_IN/messages.inc
  126. +0 −4 program/localization/th_TH/labels.inc
  127. +0 −4 program/localization/tr_TR/labels.inc
  128. +0 −3 program/localization/tr_TR/messages.inc
  129. +0 −4 program/localization/uk_UA/labels.inc
  130. +0 −3 program/localization/uk_UA/messages.inc
  131. +0 −4 program/localization/vi_VN/labels.inc
  132. +0 −4 program/localization/zh_CN/labels.inc
  133. +0 −3 program/localization/zh_CN/messages.inc
  134. +0 −4 program/localization/zh_TW/labels.inc
  135. +0 −3 program/localization/zh_TW/messages.inc
  136. +0 −59 program/steps/mail/func.inc
  137. +294 −0 program/steps/settings/edit_folder.inc
  138. +370 −0 program/steps/settings/folders.inc
  139. +0 −443 program/steps/settings/manage_folders.inc
  140. +176 −0 program/steps/settings/save_folder.inc
  141. +14 −0 skins/default/common.css
  142. +2 −6 skins/default/iehacks.css
  143. +0 −19 skins/default/mail.css
  144. +33 −79 skins/default/settings.css
  145. +24 −0 skins/default/templates/folderedit.html
  146. +62 −0 skins/default/templates/folders.html
  147. +0 −41 skins/default/templates/managefolders.html
View
@@ -8,6 +8,10 @@ CHANGELOG Roundcube Webmail
- Fix cursor position on compose form in Webkit browsers (#1486674)
- Fix setting charset of attachment filenames (#1487122)
- Allow setting autocomplete attribute for all inputs separately (#1487313)
+- New Folder Manager UI
+- Fix invalid Request when creating a folder (#1487443)
+- Add folder size and quota indicator in folder manager (#1485780)
+- Add possibility to move a subfolder into root folder (#1486791)
RELEASE 0.5-BETA
----------------
View
@@ -218,16 +218,15 @@
'group-addmembers' => 'groups.inc',
'group-delmembers' => 'groups.inc',
),
-
+
'settings' => array(
- 'folders' => 'manage_folders.inc',
- 'create-folder' => 'manage_folders.inc',
- 'rename-folder' => 'manage_folders.inc',
- 'delete-folder' => 'manage_folders.inc',
- 'subscribe' => 'manage_folders.inc',
- 'unsubscribe' => 'manage_folders.inc',
- 'enable-threading' => 'manage_folders.inc',
- 'disable-threading' => 'manage_folders.inc',
+ 'folders' => 'folders.inc',
+ 'rename-folder' => 'folders.inc',
+ 'delete-folder' => 'folders.inc',
+ 'subscribe' => 'folders.inc',
+ 'unsubscribe' => 'folders.inc',
+ 'purge' => 'folders.inc',
+ 'folder-size' => 'folders.inc',
'add-identity' => 'edit_identity.inc',
)
);
View
@@ -1314,8 +1314,13 @@ function rcmail_mailbox_select($p = array())
$p += array('maxlength' => 100, 'realnames' => false);
$a_mailboxes = array();
-
- foreach ($RCMAIL->imap->list_mailboxes() as $folder)
+
+ if ($p['unsubscribed'])
+ $list = $RCMAIL->imap->list_unsubscribed();
+ else
+ $list = $RCMAIL->imap->list_mailboxes();
+
+ foreach ($list as $folder)
if (empty($p['exceptions']) || !in_array($folder, $p['exceptions']))
rcmail_build_folder_tree($a_mailboxes, $folder, $RCMAIL->imap->get_hierarchy_delimiter());
@@ -1551,6 +1556,65 @@ function rcmail_localize_foldername($name)
}
+function rcmail_quota_display($attrib)
+{
+ global $OUTPUT;
+
+ if (!$attrib['id'])
+ $attrib['id'] = 'rcmquotadisplay';
+
+ if(isset($attrib['display']))
+ $_SESSION['quota_display'] = $attrib['display'];
+
+ $OUTPUT->add_gui_object('quotadisplay', $attrib['id']);
+
+ $quota = rcmail_quota_content($attrib);
+
+ $OUTPUT->add_script('$(document).ready(function(){
+ rcmail.set_quota('.json_serialize($quota).')});', 'foot');
+
+ return html::span($attrib, '');
+}
+
+
+function rcmail_quota_content($attrib=NULL)
+{
+ global $RCMAIL;
+
+ $quota = $RCMAIL->imap->get_quota();
+ $quota = $RCMAIL->plugins->exec_hook('quota', $quota);
+
+ $quota_result = (array) $quota;
+ $quota_result['type'] = isset($_SESSION['quota_display']) ? $_SESSION['quota_display'] : '';
+
+ if (!$quota['total'] && $RCMAIL->config->get('quota_zero_as_unlimited')) {
+ $quota_result['title'] = rcube_label('unlimited');
+ $quota_result['percent'] = 0;
+ }
+ else if ($quota['total']) {
+ if (!isset($quota['percent']))
+ $quota_result['percent'] = min(100, round(($quota['used']/max(1,$quota['total']))*100));
+
+ $title = sprintf('%s / %s (%.0f%%)',
+ show_bytes($quota['used'] * 1024), show_bytes($quota['total'] * 1024),
+ $quota_result['percent']);
+
+ $quota_result['title'] = $title;
+
+ if ($attrib['width'])
+ $quota_result['width'] = $attrib['width'];
+ if ($attrib['height'])
+ $quota_result['height'] = $attrib['height'];
+ }
+ else {
+ $quota_result['title'] = rcube_label('unknown');
+ $quota_result['percent'] = 0;
+ }
+
+ return $quota_result;
+}
+
+
/**
* Output HTML editor scripts
*
@@ -2553,6 +2553,9 @@ function move_message($uids, $to_mbox, $from_mbox='')
$to_mbox = $this->mod_mailbox($to_mbox);
$from_mbox = strlen($from_mbox) ? $this->mod_mailbox($from_mbox) : $this->mailbox;
+ if ($to_mbox === $from_mbox)
+ return false;
+
list($uids, $all_mode) = $this->_parse_uids($uids, $from_mbox);
// exit if no message uids are specified
@@ -3009,6 +3012,26 @@ function get_quota()
/**
+ * Get mailbox size (size of all messages in a mailbox)
+ *
+ * @param string $name Mailbox name
+ * @return int Mailbox size in bytes, False on error
+ */
+ function get_mailbox_size($name)
+ {
+ $name = $this->mod_mailbox($name);
+
+ // @TODO: could we try to use QUOTA here?
+ $result = $this->conn->fetchHeaderIndex($name, '1:*', 'SIZE', false);
+
+ if (is_array($result))
+ $result = array_sum($result);
+
+ return $result;
+ }
+
+
+ /**
* Subscribe to a specific mailbox(es)
*
* @param array $a_mboxes Mailbox name(s)
@@ -3043,48 +3066,42 @@ function unsubscribe($a_mboxes)
/**
* Create a new mailbox on the server and register it in local cache
*
- * @param string $name New mailbox name (as utf-7 string)
+ * @param string $name New mailbox name
* @param boolean $subscribe True if the new mailbox should be subscribed
- * @param string Name of the created mailbox, false on error
+ * @param boolean True on success
*/
function create_mailbox($name, $subscribe=false)
{
- $result = false;
-
- // reduce mailbox name to 100 chars
- $name = substr($name, 0, 100);
+ $result = false;
$abs_name = $this->mod_mailbox($name);
- $result = $this->conn->createFolder($abs_name);
+ $result = $this->conn->createFolder($abs_name);
// try to subscribe it
if ($result && $subscribe)
$this->subscribe($name);
- return $result ? $name : false;
+ return $result;
}
/**
* Set a new name to an existing mailbox
*
- * @param string $mbox_name Mailbox to rename (as utf-7 string)
- * @param string $new_name New mailbox name (as utf-7 string)
- * @return string Name of the renames mailbox, False on error
+ * @param string $mbox_name Mailbox to rename
+ * @param string $new_name New mailbox name
+ * @return boolean True on success
*/
function rename_mailbox($mbox_name, $new_name)
{
$result = false;
- // encode mailbox name and reduce it to 100 chars
- $name = substr($new_name, 0, 100);
-
// make absolute path
- $mailbox = $this->mod_mailbox($mbox_name);
- $abs_name = $this->mod_mailbox($name);
+ $mailbox = $this->mod_mailbox($mbox_name);
+ $abs_name = $this->mod_mailbox($new_name);
// check if mailbox is subscribed
$a_subscribed = $this->_list_mailboxes();
- $subscribed = in_array($mailbox, $a_subscribed);
+ $subscribed = in_array($mailbox, $a_subscribed);
// unsubscribe folder
if ($subscribed)
@@ -3113,14 +3130,14 @@ function rename_mailbox($mbox_name, $new_name)
if ($result && $subscribed)
$this->conn->subscribe($abs_name);
- return $result ? $name : false;
+ return $result;
}
/**
* Remove mailboxes from server
*
- * @param string|array $mbox_name sMailbox name(s) string/array
+ * @param string|array $mbox_name Mailbox name(s) string/array
* @return boolean True on success
*/
function delete_mailbox($mbox_name)
@@ -3208,7 +3225,7 @@ function mailbox_exists($mbox_name, $subscription=false)
}
else {
$a_folders = $this->conn->listMailboxes('', $mbox);
- }
+ }
if (is_array($a_folders) && in_array($mbox, $a_folders)) {
$this->icache[$key][] = $mbox;
Oops, something went wrong.

0 comments on commit af3c045

Please sign in to comment.