Changeset 1580 in subversion
- Timestamp:
- Jun 30, 2008 5:36:18 AM (5 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 10 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_imap.php (modified) (1 diff)
-
program/js/app.js (modified) (13 diffs)
-
program/lib/imap.inc (modified) (2 diffs)
-
program/localization/en_US/labels.inc (modified) (1 diff)
-
program/localization/pl_PL/labels.inc (modified) (1 diff)
-
program/steps/mail/func.inc (modified) (11 diffs)
-
program/steps/mail/mark.inc (modified) (1 diff)
-
skins/default/mail.css (modified) (1 diff)
-
skins/default/templates/mail.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r1576 r1580 1 1 CHANGELOG RoundCube Webmail 2 2 --------------------------- 3 4 2008/06/30 (alec) 5 ---------- 6 - Added flag column on messages list (#1484623) 3 7 4 8 2008/06/24 (alec) -
trunk/roundcubemail/program/include/rcube_imap.php
r1562 r1580 1316 1316 else if ($flag=='UNSEEN') 1317 1317 $result = iil_C_Unseen($this->conn, $this->mailbox, join(',', array_values($msg_ids))); 1318 else if ($flag=='UNFLAGGED') 1319 $result = iil_C_UnFlag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), 'FLAGGED'); 1318 1320 else 1319 1321 $result = iil_C_Flag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), $flag); -
trunk/roundcubemail/program/js/app.js
r1570 r1580 137 137 138 138 this.message_list.init(); 139 this.enable_command('toggle_status', true);139 this.enable_command('toggle_status', 'toggle_flag', true); 140 140 141 141 if (this.gui_objects.mailcontframe) … … 374 374 row.unread = this.env.messages[uid].unread ? true : false; 375 375 row.replied = this.env.messages[uid].replied ? true : false; 376 row.flagged = this.env.messages[uid].flagged ? true : false; 376 377 } 377 378 … … 383 384 row.icon._row = row.obj; 384 385 row.icon.onmousedown = function(e) { p.command('toggle_status', this); }; 386 } 387 388 // global variable 'flagged_col' may be not defined yet 389 if (!this.env.flagged_col && this.env.coltypes) 390 { 391 var found; 392 if((found = find_in_array('flag', this.env.coltypes)) >= 0) 393 this.set_env('flagged_col', found+1); 394 } 395 396 // set eventhandler to flag icon, if icon found 397 if (this.env.flagged_col && (row.flagged_icon = row.obj.cells[this.env.flagged_col].childNodes[0]) 398 && row.flagged_icon.nodeName=='IMG') 399 { 400 var p = this; 401 row.flagged_icon.id = 'flaggedicn_'+row.uid; 402 row.flagged_icon._row = row.obj; 403 row.flagged_icon.onmousedown = function(e) { p.command('toggle_flag', this); }; 385 404 } 386 405 }; … … 709 728 break; 710 729 730 case 'toggle_flag': 731 if (props && !props._row) 732 break; 733 734 var uid; 735 var flag = 'flagged'; 736 737 if (props._row.uid) 738 { 739 uid = props._row.uid; 740 this.message_list.dont_select = true; 741 // toggle flagged/unflagged 742 if (this.message_list.rows[uid].flagged) 743 flag = 'unflagged'; 744 } 745 this.mark_message(flag, uid); 746 break; 747 711 748 case 'always-load': 712 749 if (this.env.uid && this.env.sender) { … … 1527 1564 for (var n=0; n<selection.length; n++) 1528 1565 { 1529 a_uids[a_uids.length] = selection[n];1566 a_uids[a_uids.length] = selection[n]; 1530 1567 } 1531 1568 } … … 1539 1576 if ((flag=='read' && this.message_list.rows[id].unread) 1540 1577 || (flag=='unread' && !this.message_list.rows[id].unread) 1541 || (flag=='delete' && !this.message_list.rows[id].deleted) 1542 || (flag=='undelete' && this.message_list.rows[id].deleted)) 1578 || (flag=='delete' && !this.message_list.rows[id].deleted) 1579 || (flag=='undelete' && this.message_list.rows[id].deleted) 1580 || (flag=='flagged' && !this.message_list.rows[id].flagged) 1581 || (flag=='unflagged' && this.message_list.rows[id].flagged)) 1543 1582 { 1544 1583 r_uids[r_uids.length] = id; … … 1559 1598 case 'undelete': 1560 1599 this.toggle_delete_status(r_uids); 1600 break; 1601 case 'flagged': 1602 case 'unflagged': 1603 this.toggle_flagged_status(flag, a_uids); 1561 1604 break; 1562 1605 } … … 1626 1669 } 1627 1670 1671 1672 // set image to flagged or unflagged 1673 this.toggle_flagged_status = function(flag, a_uids) 1674 { 1675 // mark all message rows as flagged/unflagged 1676 var icn_src; 1677 var rows = this.message_list.rows; 1678 for (var i=0; i<a_uids.length; i++) 1679 { 1680 uid = a_uids[i]; 1681 if (rows[uid]) 1682 { 1683 rows[uid].flagged = (flag=='flagged' ? true : false); 1684 1685 if (rows[uid].flagged && this.env.flaggedicon) 1686 icn_src = this.env.flaggedicon; 1687 else if (this.env.unflaggedicon) 1688 icn_src = this.env.unflaggedicon; 1689 1690 if (rows[uid].flagged_icon && icn_src) 1691 rows[uid].flagged_icon.src = icn_src; 1692 } 1693 } 1694 1695 this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag='+flag); 1696 }; 1628 1697 1629 1698 // mark all message rows as deleted/undeleted … … 3244 3313 cell.id = 'rcmHead'+col; 3245 3314 } 3246 3247 if (col == 'subject' && this.message_list) 3315 else if (col == 'subject' && this.message_list) 3248 3316 this.message_list.subject_col = n+1; 3317 else if (col == 'flag' && this.env.unflaggedicon) 3318 { 3319 cell.innerHTML = '<img src="'+this.env.unflaggedicon+'" alt="" />'; 3320 } 3249 3321 } 3250 3322 }; … … 3262 3334 this.env.messages[uid] = {deleted:flags.deleted?1:0, 3263 3335 replied:flags.replied?1:0, 3264 unread:flags.unread?1:0}; 3336 unread:flags.unread?1:0, 3337 flagged:flags.flagged?1:0}; 3265 3338 3266 3339 var row = document.createElement('TR'); … … 3277 3350 var col = document.createElement('TD'); 3278 3351 col.className = 'icon'; 3279 col.innerHTML = icon ? '<img src="'+icon+'" alt="" border="0"/>' : '';3352 col.innerHTML = icon ? '<img src="'+icon+'" alt="" />' : ''; 3280 3353 row.appendChild(col); 3281 3354 … … 3286 3359 col = document.createElement('TD'); 3287 3360 col.className = String(c).toLowerCase(); 3288 col.innerHTML = cols[c]; 3361 3362 if (c=='flag') 3363 { 3364 if (flags.flagged && this.env.flaggedicon) 3365 col.innerHTML = '<img src="'+this.env.flaggedicon+'" alt="" />'; 3366 else if(this.env.unflaggedicon) 3367 col.innerHTML = '<img src="'+this.env.unflaggedicon+'" alt="" />'; 3368 } 3369 else 3370 col.innerHTML = cols[c]; 3371 3289 3372 row.appendChild(col); 3290 3373 } … … 3292 3375 col = document.createElement('TD'); 3293 3376 col.className = 'icon'; 3294 col.innerHTML = attachment && this.env.attachmenticon ? '<img src="'+this.env.attachmenticon+'" alt="" border="0"/>' : '';3377 col.innerHTML = attachment && this.env.attachmenticon ? '<img src="'+this.env.attachmenticon+'" alt="" />' : ''; 3295 3378 row.appendChild(col); 3296 3379 -
trunk/roundcubemail/program/lib/imap.inc
r1565 r1580 150 150 var $forwarded = false; 151 151 var $junk = false; 152 var $flagged = false; 152 153 } 153 154 … … 1759 1760 } else if (strcasecmp($val, '$MDNSent') == 0) { 1760 1761 $result[$id]->mdn_sent = true; 1762 } else if (strcasecmp($val, 'Flagged') == 0) { 1763 $result[$id]->flagged = true; 1761 1764 } 1762 1765 } -
trunk/roundcubemail/program/localization/en_US/labels.inc
r1536 r1580 142 142 $labels['markread'] = 'As read'; 143 143 $labels['markunread'] = 'As unread'; 144 $labels['markflagged'] = 'As flagged'; 145 $labels['markunflagged'] = 'As unflagged'; 144 146 145 147 $labels['select'] = 'Select'; -
trunk/roundcubemail/program/localization/pl_PL/labels.inc
r1541 r1580 136 136 $labels['markunread'] = 'Jako nieprzeczytanÄ 137 137 '; 138 $labels['markflagged'] = 'Jako oflagowanÄ 139 '; 140 $labels['markunflagged'] = 'Jako nieoflagowanÄ 141 '; 138 142 $labels['select'] = 'Zaznacz'; 139 143 $labels['all'] = 'Wszystkie'; -
trunk/roundcubemail/program/steps/mail/func.inc
r1570 r1580 75 75 76 76 77 78 77 /** 79 78 * return the message list as HTML table … … 84 83 85 84 $skin_path = $CONFIG['skin_path']; 86 $image_tag = '<img src="%s%s" alt="%s" border="0"/>';85 $image_tag = '<img src="%s%s" alt="%s" />'; 87 86 88 87 // check to see if we have some settings for sorting … … 104 103 105 104 $out = '<table' . $attrib_str . ">\n"; 106 107 105 108 106 // define list of cols to be displayed … … 134 132 { 135 133 // get column name 136 $col_name = Q(rcube_label($col));134 $col_name = $col != 'flag' ? Q(rcube_label($col)) : sprintf($image_tag, $skin_path, $attrib['unflaggedicon'], ''); 137 135 138 136 // make sort links … … 198 196 foreach ($a_headers as $i => $header) //while (list($i, $header) = each($a_headers)) 199 197 { 200 $message_icon = $attach_icon = '';198 $message_icon = $attach_icon = $flagged_icon = ''; 201 199 $js_row_arr = array(); 202 200 $zebra_class = $i%2 ? 'even' : 'odd'; … … 209 207 if ($header->answered) 210 208 $js_row_arr['replied'] = true; 209 if ($header->flagged) 210 $js_row_arr['flagged'] = true; 211 211 212 // set message icon 212 213 if ($attrib['deletedicon'] && $header->deleted) … … 218 219 else if ($attrib['messageicon']) 219 220 $message_icon = $attrib['messageicon']; 221 222 if ($attrib['flaggedicon'] && $header->flagged) 223 $flagged_icon = $attrib['flaggedicon']; 224 else if ($attrib['unflaggedicon'] && !$header->flagged) 225 $flagged_icon = $attrib['unflaggedicon']; 220 226 221 227 // set attachment icon … … 227 233 $header->seen ? '' : ' unread', 228 234 $header->deleted ? ' deleted' : '', 235 $header->flagged ? ' flagged' : '', 229 236 $zebra_class); 230 237 231 238 $out .= sprintf("<td class=\"icon\">%s</td>\n", $message_icon ? sprintf($image_tag, $skin_path, $message_icon, '') : ''); 239 232 240 233 241 if (!empty($header->charset)) … … 247 255 $cont = sprintf('<a href="%s" onclick="return rcube_event.cancel(event)">%s</a>', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), $cont); 248 256 } 257 else if ($col=='flag') 258 $cont = $flagged_icon ? sprintf($image_tag, $skin_path, $flagged_icon, '') : ''; 249 259 else if ($col=='size') 250 260 $cont = show_bytes($header->$col); … … 289 299 if ($attrib['attachmenticon']) 290 300 $OUTPUT->set_env('attachmenticon', $skin_path . $attrib['attachmenticon']); 301 if ($attrib['flaggedicon']) 302 $OUTPUT->set_env('flaggedicon', $skin_path . $attrib['flaggedicon']); 303 if ($attrib['unflaggedicon']) 304 $OUTPUT->set_env('unflaggedicon', $skin_path . $attrib['unflaggedicon']); 291 305 292 306 $OUTPUT->set_env('messages', $a_js_message_arr); … … 354 368 $a_msg_flags['unread'] = $header->seen ? 0 : 1; 355 369 $a_msg_flags['replied'] = $header->answered ? 1 : 0; 370 $a_msg_flags['flagged'] = $header->flagged ? 1 : 0; 371 356 372 $OUTPUT->command('add_message_row', 357 373 $header->uid, -
trunk/roundcubemail/program/steps/mail/mark.inc
r1292 r1580 23 23 'delete' => 'DELETED', 24 24 'read' => 'SEEN', 25 'unread' => 'UNSEEN'); 25 'unread' => 'UNSEEN', 26 'flagged' => 'FLAGGED', 27 'unflagged' => 'UNFLAGGED'); 26 28 27 29 if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_value('_flag', RCUBE_INPUT_POST))) -
trunk/roundcubemail/skins/default/mail.css
r1571 r1580 457 457 } 458 458 459 #messagelist tr td.icon 459 #messagelist tr td.icon, 460 #messagelist tr td.flag 460 461 { 461 462 width: 16px; -
trunk/roundcubemail/skins/default/templates/mail.html
r1303 r1580 69 69 deletedIcon="/images/icons/deleted.png" 70 70 repliedIcon="/images/icons/replied.png" 71 attachmentIcon="/images/icons/attachment.png" /> 71 attachmentIcon="/images/icons/attachment.png" 72 flaggedIcon="/images/icons/flagged.png" 73 unflaggedIcon="/images/icons/unflagged.png" /> 72 74 </div> 73 75 … … 113 115 <li><roundcube:button command="mark" prop="read" label="markread" classAct="active" /></li> 114 116 <li><roundcube:button command="mark" prop="unread" label="markunread" classAct="active" /></li> 117 <li><roundcube:button command="mark" prop="flagged" label="markflagged" classAct="active" /></li> 118 <li><roundcube:button command="mark" prop="unflagged" label="markunflagged" classAct="active" /></li> 115 119 </ul> 116 120 </div>
Note: See TracChangeset
for help on using the changeset viewer.
